Repository: wandb/openui Branch: main Commit: f9d8f0e30e1e Files: 192 Total size: 22.3 MB Directory structure: gitextract_qjsg2d9w/ ├── .devcontainer/ │ ├── devcontainer.json │ └── postCreateCommand.sh ├── .gitattributes ├── .github/ │ └── workflows/ │ └── docker.yml ├── .gitignore ├── .gitpod.yml ├── .husky/ │ ├── pre-commit │ └── pre-push ├── .python-version ├── LICENSE ├── README.md ├── backend/ │ ├── .dockerignore │ ├── .github/ │ │ └── workflows/ │ │ ├── publish.yml │ │ └── test.yml │ ├── .gitignore │ ├── .python-version │ ├── .vscode/ │ │ ├── extensions.json │ │ └── settings.json │ ├── Dockerfile │ ├── LICENSE │ ├── README.md │ ├── fly.toml │ ├── openui/ │ │ ├── __init__.py │ │ ├── __main__.py │ │ ├── config.py │ │ ├── config.yaml │ │ ├── db/ │ │ │ └── models.py │ │ ├── dist/ │ │ │ ├── annotator/ │ │ │ │ └── index.html │ │ │ ├── assets/ │ │ │ │ ├── CodeEditor-B1zwGt1y.css │ │ │ │ ├── CodeEditor-B9qhAAku.js │ │ │ │ ├── babel-CqqbTYm7.js │ │ │ │ ├── css-D1nB4Vcj.js │ │ │ │ ├── cssMode-CMP9zKWk.js │ │ │ │ ├── html-B2LDEzWk.js │ │ │ │ ├── html-B4dTfUY8.js │ │ │ │ ├── htmlMode-BZEeRbEQ.js │ │ │ │ ├── index-B7PjGjI7.js │ │ │ │ ├── index-CnQwS-Fb.css │ │ │ │ ├── index-DnTpCebm.js │ │ │ │ ├── javascript-BcV1SRi8.js │ │ │ │ ├── jsonMode-CWFvP3uU.js │ │ │ │ ├── markdown-7fQo6M4U.js │ │ │ │ ├── python-CsxvR8Mf.js │ │ │ │ ├── standalone-BS_cqyLa.js │ │ │ │ ├── tsMode-FcR9Jej8.js │ │ │ │ ├── typescript-BfKWl9Pr.js │ │ │ │ └── yaml-DWuY8lcX.js │ │ │ ├── index.html │ │ │ ├── logo.html │ │ │ ├── logo.txt │ │ │ ├── manifest.webmanifest │ │ │ ├── monacoeditorwork/ │ │ │ │ ├── css.worker.bundle.js │ │ │ │ ├── editor.worker.bundle.js │ │ │ │ ├── html.worker.bundle.js │ │ │ │ ├── json.worker.bundle.js │ │ │ │ ├── tailwindcss.worker.bundle.js │ │ │ │ └── ts.worker.bundle.js │ │ │ ├── registerSW.js │ │ │ ├── robots.txt │ │ │ ├── sw.js │ │ │ └── workbox-3e8df8c8.js │ │ ├── dummy.py │ │ ├── eval/ │ │ │ ├── .gitignore │ │ │ ├── __init__.py │ │ │ ├── dataset.py │ │ │ ├── download_and_convert.sh │ │ │ ├── evaluate.py │ │ │ ├── evaluate_weave.py │ │ │ ├── model.py │ │ │ ├── prompt_to_img.py │ │ │ ├── promptsearch.py │ │ │ ├── scrape.py │ │ │ ├── screenshots.py │ │ │ ├── svg_annotator.html │ │ │ ├── synthesize.py │ │ │ └── to_fine_tune.py │ │ ├── litellm.py │ │ ├── log_config.yaml │ │ ├── logo.ascii │ │ ├── logs.py │ │ ├── models.py │ │ ├── ollama.py │ │ ├── openai.py │ │ ├── server.py │ │ ├── session.py │ │ ├── tui/ │ │ │ ├── app.py │ │ │ ├── code.py │ │ │ ├── code_browser.tcss │ │ │ └── markdown.py │ │ └── util/ │ │ ├── __init__.py │ │ ├── email.py │ │ ├── screenshots.py │ │ └── storage.py │ ├── pyproject.toml │ └── tests/ │ └── test_openui.py ├── docker-compose.yaml ├── frontend/ │ ├── .cz.json │ ├── .github/ │ │ ├── CODEOWNERS │ │ ├── renovate.json │ │ └── workflows/ │ │ └── codeql-analysis.yml │ ├── .gitignore │ ├── .postcssrc.json │ ├── .prettierrc.json │ ├── .stylelintrc.json │ ├── .vscode/ │ │ ├── extensions.json │ │ └── settings.json │ ├── LICENSE │ ├── README.md │ ├── components.json │ ├── eslint.config.mjs │ ├── index.html │ ├── integration_tests/ │ │ ├── basic.spec.ts │ │ └── util.ts │ ├── package.json │ ├── playwright.config.ts │ ├── public/ │ │ ├── annotator/ │ │ │ └── index.html │ │ ├── logo.html │ │ ├── logo.txt │ │ └── robots.txt │ ├── src/ │ │ ├── App.tsx │ │ ├── __tests__/ │ │ │ ├── App.tsx │ │ │ └── utils.ts │ │ ├── api/ │ │ │ ├── models.ts │ │ │ ├── openai.ts │ │ │ └── openui.ts │ │ ├── components/ │ │ │ ├── Chat.tsx │ │ │ ├── CodeEditor.tsx │ │ │ ├── CodeViewer.tsx │ │ │ ├── CurrentUiContext.tsx │ │ │ ├── ErrorBoundary.tsx │ │ │ ├── Examples.tsx │ │ │ ├── FileUpload.tsx │ │ │ ├── Head.tsx │ │ │ ├── History.tsx │ │ │ ├── HistoryItem.tsx │ │ │ ├── HtmlAnnotator.tsx │ │ │ ├── LoadingOrError.tsx │ │ │ ├── Logo.tsx │ │ │ ├── NavBar.tsx │ │ │ ├── Prompt.tsx │ │ │ ├── Register.tsx │ │ │ ├── Scaffold.tsx │ │ │ ├── Screenshot.tsx │ │ │ ├── Settings.tsx │ │ │ ├── ShareDialog.tsx │ │ │ ├── SyntaxHighlighter.tsx │ │ │ ├── VersionPreview.tsx │ │ │ ├── Versions.tsx │ │ │ ├── __tests__/ │ │ │ │ └── LoadingOrError.tsx │ │ │ └── ui/ │ │ │ ├── avatar.tsx │ │ │ ├── button.tsx │ │ │ ├── checkbox.tsx │ │ │ ├── dialog.tsx │ │ │ ├── dropdown-menu.tsx │ │ │ ├── hover-card.tsx │ │ │ ├── input.tsx │ │ │ ├── label.tsx │ │ │ ├── popover.tsx │ │ │ ├── select.tsx │ │ │ ├── sheet.tsx │ │ │ ├── slider.tsx │ │ │ ├── switch.tsx │ │ │ ├── textarea.tsx │ │ │ └── tooltip.tsx │ │ ├── hooks/ │ │ │ └── index.ts │ │ ├── index.css │ │ ├── lib/ │ │ │ ├── anysphere.ts │ │ │ ├── constants.ts │ │ │ ├── events.ts │ │ │ ├── html.ts │ │ │ ├── i18n.ts │ │ │ ├── markdown.ts │ │ │ ├── simple.ts │ │ │ ├── themes.ts │ │ │ ├── utils.ts │ │ │ └── webauthn.ts │ │ ├── main.tsx │ │ ├── mocks/ │ │ │ ├── handlers.ts │ │ │ └── server.ts │ │ ├── pages/ │ │ │ └── AI/ │ │ │ └── index.tsx │ │ ├── setupTests.ts │ │ ├── state/ │ │ │ ├── atoms/ │ │ │ │ ├── history.ts │ │ │ │ ├── prompts.ts │ │ │ │ └── ui.ts │ │ │ └── index.ts │ │ └── testUtils.tsx │ ├── tailwind.config.js │ ├── tsconfig.json │ ├── tsconfig.node.json │ ├── vercel.json │ └── vite.config.ts └── openui.code-workspace ================================================ FILE CONTENTS ================================================ ================================================ FILE: .devcontainer/devcontainer.json ================================================ { "name": "OpenUI Development", "image": "mcr.microsoft.com/devcontainers/python:3.12", // More features: https://containers.dev/features. "features": { "ghcr.io/devcontainers/features/node:1": { "nodeGypDependencies": true, "version": "lts", "nvmVersion": "latest" }, "ghcr.io/devcontainers/features/rust:1": { "version": "latest", "profile": "minimal" }, "ghcr.io/wandb/catnip/feature:1": {} }, "mounts": [ "source=codespaces-linux-cache,target=/home/vscode/.cache,consistency=delegated,type=volume" ], "customizations": { "vscode": { "settings": {}, "extensions": [ "ms-python.python", "tamasfe.even-better-toml", "charliermarsh.ruff", "ms-toolsai.jupyter", "ms-azuretools.vscode-docker", "GitHub.copilot", "ms-python.black-formatter" ] } }, "forwardPorts": [6369], "portsAttributes": { "5173": { "label": "OpenUI UI Dev Server", "onAutoForward": "notify" }, "7878": { "label": "OpenUI Server", "onAutoForward": "notify" } }, // Install Ollama in the prebuild step "onCreateCommand": "curl -fsSL https://ollama.com/install.sh | sh", "postCreateCommand": "bash ./.devcontainer/postCreateCommand.sh", "postStartCommand": "nohup bash -c 'ollama serve &'", "secrets": { "OPENAI_API_KEY": { "description": "Your OpenAI API Key", "documentationUrl": "https://platform.openai.com/api-keys" }, "WANDB_API_KEY": { "description": "Your W&B API Key", "documentationUrl": "https://wandb.ai/authorize" } } // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. // "remoteUser": "root" } ================================================ FILE: .devcontainer/postCreateCommand.sh ================================================ #!/bin/bash # Fix cache perms mkdir -p $HOME/.cache sudo chown -R $USER $HOME/.cache # Install node packages cd /workspaces/openui/frontend pnpm install # Install python packages cd /workspaces/openui/backend pip install -e .[test] # Pull a model for ollama, using llava for now as it's multi-modal ollama pull llava # addressing warning... git config --unset-all core.hooksPath pre-commit install --allow-missing-config # pre-commit hooks cause permission weirdness git config --global --add safe.directory /workspaces/openui ================================================ FILE: .gitattributes ================================================ backend/openui/dist/* binary ================================================ FILE: .github/workflows/docker.yml ================================================ name: Build, test and release OpenUI on: push: branches: - "**" workflow_dispatch: env: REGISTRY: ghcr.io IMAGE_NAME: ${{ github.repository }} jobs: build-frontend: runs-on: ubuntu-latest permissions: contents: write packages: write steps: - name: Checkout repository uses: actions/checkout@v4 - uses: pnpm/action-setup@v4 name: Install pnpm with: version: 9 run_install: false - name: Install Node.js uses: actions/setup-node@v4 with: cache-dependency-path: frontend/pnpm-lock.yaml node-version: 20 cache: "pnpm" - name: Get pnpm store directory shell: bash working-directory: ./frontend run: | echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV - uses: actions/cache@v4 name: Setup pnpm cache with: path: ${{ env.STORE_PATH }} key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} restore-keys: | ${{ runner.os }}-pnpm-store- - name: Install dependencies working-directory: ./frontend run: pnpm install # We use npm here because pnpm wasn't executing post hooks - name: Build frontend working-directory: ./frontend run: npm run build - name: Upload build artifacts uses: actions/upload-artifact@v4 with: name: frontend-${{ github.sha }} path: ./frontend/dist - name: Checking in frontend assets if: github.ref == 'refs/heads/main' run: | git config user.name github-actions git config user.email github-actions@github.com git add backend/openui/dist git commit -m "Updated frontend assets" git push build-and-push-image: needs: build-frontend runs-on: ubuntu-latest permissions: contents: read packages: write attestations: write id-token: write steps: - name: Checkout repository uses: actions/checkout@v4 - name: Download build artifacts uses: actions/download-artifact@v4 with: name: frontend-${{ github.sha }} path: ./backend/openui/dist - name: Set up QEMU uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - name: Log in to the Container registry uses: docker/login-action@v3 with: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - name: Extract metadata (tags, labels) for Docker id: meta uses: docker/metadata-action@v5 with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} flavor: | latest=false tags: | type=ref,event=branch type=ref,event=tag type=ref,event=pr type=sha - name: Build and push Docker image id: push uses: docker/build-push-action@v6 with: platforms: linux/amd64,linux/arm64 context: backend/. push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} cache-from: type=gha cache-to: type=gha,mode=max - name: Generate artifact attestation uses: actions/attest-build-provenance@v1 with: subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}} subject-digest: ${{ steps.push.outputs.digest }} push-to-registry: true test: permissions: contents: read packages: write attestations: write id-token: write needs: build-and-push-image timeout-minutes: 10 runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: pnpm/action-setup@v4 name: Install pnpm with: version: 9 run_install: false - name: Install Node.js uses: actions/setup-node@v4 with: cache-dependency-path: frontend/pnpm-lock.yaml node-version: 20 cache: "pnpm" - name: Get pnpm store directory shell: bash working-directory: ./frontend run: | echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV - uses: actions/cache@v4 name: Setup pnpm cache with: path: ${{ env.STORE_PATH }} key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} restore-keys: | ${{ runner.os }}-pnpm-store- - name: Install dependencies working-directory: ./frontend run: pnpm install - name: Install Playwright Browsers working-directory: ./frontend run: pnpm exec playwright install --with-deps chromium webkit - name: Get short SHA id: get_short_sha run: echo "short_sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT - name: Run Playwright tests env: DOCKER_TAG: sha-${{ steps.get_short_sha.outputs.short_sha }} working-directory: ./frontend run: pnpm exec playwright test - uses: actions/upload-artifact@v4 if: always() with: name: playwright-report path: | ./frontend/playwright-report/ ./frontend/screenshots/ retention-days: 30 release: needs: test runs-on: ubuntu-latest permissions: contents: read packages: write attestations: write id-token: write steps: - name: Log in to the Container registry uses: docker/login-action@v3 with: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - name: Convert full SHA to short SHA id: get_short_sha run: echo "short_sha=$(echo ${{ github.sha }} | cut -c1-7)" >> $GITHUB_OUTPUT - name: Tag latest image if: github.ref == 'refs/heads/main' env: IMAGE: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} run: | docker manifest inspect ${{ env.IMAGE }}:sha-${{ steps.get_short_sha.outputs.short_sha }} docker buildx imagetools create --tag ${{ env.IMAGE }}:latest ${{ env.IMAGE }}:sha-${{ steps.get_short_sha.outputs.short_sha }} ================================================ FILE: .gitignore ================================================ .DS_Store nohup.out .cache/ .env ================================================ FILE: .gitpod.yml ================================================ # Image of workspace. Learn more: https://www.gitpod.io/docs/configure/workspaces/workspace-image image: gitpod/workspace-full:latest # List the start up tasks. Learn more: https://www.gitpod.io/docs/configure/workspaces/tasks tasks: - name: Run Open UI init: | mkdir $GITPOD_REPO_ROOT/../venv cd $GITPOD_REPO_ROOT/../venv python -m venv openui source openui/bin/activate cd $GITPOD_REPO_ROOT/backend pip install . gp sync-done init-done command: | source $GITPOD_REPO_ROOT/../venv/openui/bin/activate cd $GITPOD_REPO_ROOT/backend python -m openui # List the ports to expose. Learn more: https://www.gitpod.io/docs/configure/workspaces/ports ports: - name: Open UI description: Port 7878 for Open UI port: 7878 onOpen: notify # Learn more from ready-to-use templates: https://www.gitpod.io/docs/introduction/getting-started/quickstart ================================================ FILE: .husky/pre-commit ================================================ cd frontend && pnpm lint-staged ================================================ FILE: .husky/pre-push ================================================ cd frontend && pnpm test:push ================================================ FILE: .python-version ================================================ openui ================================================ FILE: LICENSE ================================================ Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [2024] [Weights and Biases, Inc.] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ================================================ FILE: README.md ================================================ # OpenUI

OpenUI

Building UI components can be a slog. OpenUI aims to make the process fun, fast, and flexible. It's also a tool we're using at [W&B](https://wandb.com) to test and prototype our next generation tooling for building powerful applications on top of LLM's. ## Overview ![Demo](./assets/demo.gif) OpenUI let's you describe UI using your imagination, then see it rendered live. You can ask for changes and convert HTML to React, Svelte, Web Components, etc. It's like [v0](https://v0.dev) but open source and not as polished :stuck_out_tongue_closed_eyes:. ## Live Demo [Try the demo](https://openui.fly.dev) ## Running Locally OpenUI supports [OpenAI](https://platform.openai.com/api-keys), [Groq](https://console.groq.com/keys), and any model [LiteLLM](https://docs.litellm.ai/docs/) supports such as [Gemini](https://aistudio.google.com/app/apikey) or [Anthropic (Claude)](https://console.anthropic.com/settings/keys). The following environment variables are optional, but need to be set in your environment for alternative models to work: - **OpenAI** `OPENAI_API_KEY` - **Groq** `GROQ_API_KEY` - **Gemini** `GEMINI_API_KEY` - **Anthropic** `ANTHROPIC_API_KEY` - **Cohere** `COHERE_API_KEY` - **Mistral** `MISTRAL_API_KEY` - **OpenAI Compatible** `OPENAI_COMPATIBLE_ENDPOINT` and `OPENAI_COMPATIBLE_API_KEY` For example, if you're running a tool like [localai](https://localai.io/) you can set `OPENAI_COMPATIBLE_ENDPOINT` and optionally `OPENAI_COMPATIBLE_API_KEY` to have the models available listed in the UI's model selector under LiteLLM. ### Ollama You can also use models available to [Ollama](https://ollama.com). [Install Ollama](https://ollama.com/download) and pull a model like [Llava](https://ollama.com/library/llava). If Ollama is not running on http://127.0.0.1:11434, you can set the `OLLAMA_HOST` environment variable to the host and port of your Ollama instance. For example when running in docker you'll need to point to http://host.docker.internal:11434 as shown below. ### Docker (preferred) The following command would forward the specified API keys from your shell environment and tell Docker to use the Ollama instance running on your machine. ```bash export ANTHROPIC_API_KEY=xxx export OPENAI_API_KEY=xxx docker run --rm --name openui -p 7878:7878 -e OPENAI_API_KEY -e ANTHROPIC_API_KEY -e OLLAMA_HOST=http://host.docker.internal:11434 ghcr.io/wandb/openui ``` Now you can goto [http://localhost:7878](http://localhost:7878) and generate new UI's! ### From Source / Python Assuming you have git and [uv](https://github.com/astral-sh/uv) installed: ```bash git clone https://github.com/wandb/openui cd openui/backend uv sync --frozen --extra litellm source .venv/bin/activate # Set API keys for any LLM's you want to use export OPENAI_API_KEY=xxx python -m openui ``` ## LiteLLM [LiteLLM](https://docs.litellm.ai/docs/) can be used to connect to basically any LLM service available. We generate a config automatically based on your environment variables. You can create your own [proxy config](https://litellm.vercel.app/docs/proxy/configs) to override this behavior. We look for a custom config in the following locations: 1. `litellm-config.yaml` in the current directory 2. `/app/litellm-config.yaml` when running in a docker container 3. An arbitrary path specified by the `OPENUI_LITELLM_CONFIG` environment variable For example to use a custom config in docker you can run: ```bash docker run -n openui -p 7878:7878 -v $(pwd)/litellm-config.yaml:/app/litellm-config.yaml ghcr.io/wandb/openui ``` To use litellm from source you can run: ```bash pip install .[litellm] export ANTHROPIC_API_KEY=xxx export OPENAI_COMPATIBLE_ENDPOINT=http://localhost:8080/v1 python -m openui --litellm ``` ## Groq To use the super fast [Groq](https://groq.com) models, set `GROQ_API_KEY` to your Groq api key which you can [find here](https://console.groq.com/keys). To use one of the Groq models, click the settings icon in the nav bar. ### Docker Compose > **DISCLAIMER:** This is likely going to be very slow. If you have a GPU you may need to change the tag of the `ollama` container to one that supports it. If you're running on a Mac, follow the instructions above and run Ollama natively to take advantage of the M1/M2. From the root directory you can run: ```bash docker-compose up -d docker exec -it openui-ollama-1 ollama pull llava ``` If you have your OPENAI_API_KEY set in the environment already, just remove `=xxx` from the `OPENAI_API_KEY` line. You can also replace `llava` in the command above with your open source model of choice *([llava](https://ollama.com/library/llava) is one of the only Ollama models that support images currently)*. You should now be able to access OpenUI at [http://localhost:7878](http://localhost:7878). *If you make changes to the frontend or backend, you'll need to run `docker-compose build` to have them reflected in the service.* ## Development A [dev container](https://github.com/wandb/openui/blob/main/.devcontainer/devcontainer.json) is configured in this repository which is the quickest way to get started. ### Codespace New with options... Choose more options when creating a Codespace, then select **New with options...**. Select the US West region if you want a really fast boot time. You'll also want to configure your OPENAI_API_KEY secret or just set it to `xxx` if you want to try Ollama *(you'll want at least 16GB of Ram)*. Once inside the code space you can run the server in one terminal: `python -m openui --dev`. Then in a new terminal: ```bash cd /workspaces/openui/frontend npm run dev ``` This should open another service on port 5173, that's the service you'll want to visit. All changes to both the frontend and backend will automatically be reloaded and reflected in your browser. ### Ollama The codespace installs ollama automaticaly and downloads the `llava` model. You can verify Ollama is running with `ollama list` if that fails, open a new terminal and run `ollama serve`. In Codespaces we pull llava on boot so you should see it in the list. You can select Ollama models from the settings gear icon in the upper left corner of the application. Any models you pull i.e. `ollama pull llama` will show up in the settings modal. Select Ollama models ### Gitpod You can easily use Open UI via Gitpod, preconfigured with Open AI. [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/wandb/openui) On launch Open UI is automatically installed and launched. Before you can use Gitpod: * Make sure you have a Gitpod account. * To use Open AI models set up the `OPENAI_API_KEY` environment variable in your Gitpod [User Account](https://gitpod.io/user/variables). Set the scope to `wandb/openui` (or your repo if you forked it). > NOTE: Other (local) models might also be used with a bigger Gitpod instance type. Required models are not preconfigured in Gitpod but can easily be added as documented above. ### Resources See the readmes in the [frontend](./frontend/README.md) and [backend](./backend/README.md) directories. ================================================ FILE: backend/.dockerignore ================================================ # flyctl launch added from .gitignore **/.venv **/__pycache__ **/wandb **/*.py[cod] **/*$py.class **/venv **/.eggs **/.pytest_cache **/*.egg-info **/.DS_Store **/build **/wandb **/*.db # flyctl launch added from openui/eval/.gitignore openui/eval/**/datasets openui/eval/**/components fly.toml ================================================ FILE: backend/.github/workflows/publish.yml ================================================ name: Publish Python Package on: release: types: [created] permissions: contents: read jobs: test: runs-on: ubuntu-latest strategy: matrix: python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] steps: - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} cache: pip cache-dependency-path: pyproject.toml - name: Install dependencies run: | pip install '.[test]' - name: Run tests run: | pytest deploy: runs-on: ubuntu-latest needs: [test] environment: release permissions: id-token: write steps: - uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v5 with: python-version: "3.12" cache: pip cache-dependency-path: pyproject.toml - name: Install dependencies run: | pip install setuptools wheel build - name: Build run: | python -m build - name: Publish uses: pypa/gh-action-pypi-publish@release/v1 ================================================ FILE: backend/.github/workflows/test.yml ================================================ name: Test on: [push, pull_request] permissions: contents: read jobs: test: runs-on: ubuntu-latest strategy: matrix: python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] steps: - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} cache: pip cache-dependency-path: pyproject.toml - name: Install dependencies run: | pip install '.[test]' - name: Run tests run: | pytest ================================================ FILE: backend/.gitignore ================================================ .venv __pycache__/ wandb/ *.py[cod] *$py.class venv .eggs .pytest_cache *.egg-info .DS_Store build eval/components eval/datasets !eval/datasets/eval.csv ================================================ FILE: backend/.python-version ================================================ 3.12 ================================================ FILE: backend/.vscode/extensions.json ================================================ { "recommendations": ["charliermarsh.ruff"] } ================================================ FILE: backend/.vscode/settings.json ================================================ { "[python]": { "editor.formatOnSave": true, "editor.defaultFormatter": "charliermarsh.ruff" } } ================================================ FILE: backend/Dockerfile ================================================ # Build the virtualenv as a separate step: Only re-execute this step when pyproject.toml changes FROM ghcr.io/astral-sh/uv:python3.12-bookworm-slim AS builder WORKDIR /app ENV UV_LINK_MODE=copy UV_COMPILE_BYTECODE=1 RUN --mount=type=cache,target=/root/.cache/uv \ --mount=type=bind,source=uv.lock,target=uv.lock \ --mount=type=bind,source=pyproject.toml,target=pyproject.toml \ uv sync --frozen --extra litellm --no-install-project --no-dev COPY . /app RUN --mount=type=cache,target=/root/.cache/uv \ uv sync --frozen --extra litellm --no-dev # Copy the virtualenv into a distroless image FROM ghcr.io/astral-sh/uv:python3.12-bookworm-slim WORKDIR /app COPY --from=builder --chown=app:app /app /app ENV PATH="/app/.venv/bin:$PATH" ENTRYPOINT ["python", "-m", "openui", "--litellm"] ================================================ FILE: backend/LICENSE ================================================ Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [2024] [Weights and Biases, Inc.] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ================================================ FILE: backend/README.md ================================================ # OpenUI [![PyPI](https://img.shields.io/pypi/v/wandb-openui.svg)](https://pypi.org/project/wandb-openui/) [![Changelog](https://img.shields.io/github/v/release/wandb/openui?include_prereleases&label=changelog)](https://github.com/wandb/openui/releases) [![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://github.com/wandb/openui/blob/main/LICENSE) A backend service for generating HTML components with AI ## Installation Clone this repo, then install using `pip`. You'll probably want to create a virtual env. ```bash git clone https://github.com/wandb/openui cd openui/backend pip install . ``` ## Usage You must set the `OPENAI_API_KEY` even if you just want to try Ollama models. Just set it to `xxx` in that case like below. ```bash OPENAI_API_KEY=xxx python -m openui ``` ### Docker You can build and run the docker file from the `/backend` directory: ```bash docker build . -t wandb/openui --load docker run -p 7878:7878 -e OPENAI_API_KEY wandb/openui ``` ## Development First be sure to install the package as editable, then passing `--dev` as an argument will live reload any local changes. ```bash pip install -e . python -m openui --dev ``` Now install the dependencies and test dependencies: ```bash pip install -e '.[test]' ``` To run the tests: ```bash pytest ``` ## Evaluation The [eval](./openui/eval) folder contains scripts for evaluating the performance of a model. It automates generating UI, taking screenshots of the UI, then asking `gpt-4-vision-preview` to rate the elements. More details about the eval pipeline coming soon... ## Google Vertex AI Create a service account with the appropriate permissions and authenticate with: ``` gcloud auth application-default login --impersonate-service-account ${GCLOUD_SERVICE_ACCOUNT}@${GCLOUD_PROJECT}.iam.gserviceaccount.com ``` ================================================ FILE: backend/fly.toml ================================================ # fly.toml app configuration file generated for openui on 2024-03-15T15:53:15-07:00 # # See https://fly.io/docs/reference/configuration/ for information about how to use this file. # app = 'openui' primary_region = 'sjc' [http_service] internal_port = 7878 force_https = true auto_stop_machines = true auto_start_machines = true min_machines_running = 0 processes = ['app'] [mounts] source = "openui_data" destination = "/root/.openui" [env] OPENUI_ENVIRONMENT = "production" OPENUI_HOST = "https://openui.fly.dev" GITHUB_CLIENT_ID = "3af8fbeb90d06484dff0" WANDB_ENTITY = "wandb" WANDB_PROJECT = "openui-hosted" [[vm]] memory = '1gb' cpu_kind = 'shared' cpus = 1 ================================================ FILE: backend/openui/__init__.py ================================================ ================================================ FILE: backend/openui/__main__.py ================================================ from pathlib import Path from .logs import setup_logger from . import server from . import config from .litellm import generate_config import os import uvicorn from uvicorn import Config import sys import subprocess import time def is_running_in_docker(): # Check for the .dockerenv file if os.path.exists("/.dockerenv"): return True # Check for Docker-related entries in /proc/self/cgroup try: with open("/proc/self/cgroup", "r") as file: for line in file: if "docker" in line: return True except Exception as e: pass if config.ENV == config.Env.PROD: return True return False if __name__ == "__main__": ui = any([arg == "-i" for arg in sys.argv]) litellm = ( any([arg == "--litellm" for arg in sys.argv]) or "OPENUI_LITELLM_CONFIG" in os.environ or os.path.exists("litellm-config.yaml") ) # TODO: only render in interactive mode? print( (Path(__file__).parent / "logo.ascii").read_text(), file=sys.stderr, flush=True ) logger = setup_logger("/tmp/openui.log" if ui else None) logger.info("Starting OpenUI AI Server created by W&B...") reload = any([arg == "--dev" for arg in sys.argv]) if reload: config.ENV = config.Env.DEV logger.info("Running in dev mode") try: from .tui.app import OpenUIApp app = OpenUIApp() server.queue = app.queue except ImportError: if ui: logger.warning( "Install OpenUI with pip install .[tui] to use the terminal UI" ) ui = False config_file = Path(__file__).parent / "log_config.yaml" api_server = server.Server( Config( "openui.server:app", host="0.0.0.0" if is_running_in_docker() else "127.0.0.1", log_config=str(config_file) if ui else None, port=config.PORT, reload=reload, ) ) if ui: with api_server.run_in_thread(): logger.info("Running Terminal UI App") app.run() else: if litellm: config_path = "litellm-config.yaml" if "OPENUI_LITELLM_CONFIG" in os.environ: config_path = os.environ["OPENUI_LITELLM_CONFIG"] elif os.path.exists("/app/litellm-config.yaml"): config_path = "/app/litellm-config.yaml" else: config_path = generate_config() logger.info( f"Starting LiteLLM in the background with config: {config_path}" ) litellm_process = subprocess.Popen( ["litellm", "--config", config_path, "--port", "4000"], stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, ) # Ensure litellm stays up for 5 seconds for i in range(5): if litellm_process.poll() is not None: stdout, stderr = litellm_process.communicate() logger.error(f"LiteLLM failed to start:\n{stderr}") break time.sleep(1) logger.info("Running API Server") mkcert_dir = Path.home() / ".vite-plugin-mkcert" if reload: # TODO: hot reload wasn't working with the server approach, and ctrl-C doesn't # work with the uvicorn.run approach, so here we are uvicorn.run( "openui.server:app", host="0.0.0.0" if is_running_in_docker() else "127.0.0.1", port=config.PORT, reload=reload, ) else: api_server.run_with_wandb() ================================================ FILE: backend/openui/config.py ================================================ import os from pathlib import Path import secrets from urllib.parse import urlparse from enum import Enum class Env(Enum): LOCAL = 1 PROD = 2 DEV = 3 try: env = os.getenv("OPENUI_ENVIRONMENT", "local") if env == "production": env = "prod" elif env == "development": env = "dev" ENV = Env[env.upper()] except KeyError: print("Invalid environment, defaulting to running locally") ENV = Env.LOCAL default_db = Path.home() / ".openui" / "db.sqlite" default_db.parent.mkdir(exist_ok=True) DB = os.getenv("DATABASE", default_db) HOST = os.getenv( "OPENUI_HOST", "https://localhost:5173" if ENV == Env.DEV else "http://localhost:7878", ) RP_ID = urlparse(HOST).hostname SESSION_KEY = os.getenv("OPENUI_SESSION_KEY") if SESSION_KEY is None: env_path = Path.home() / ".openui" / ".env" if env_path.exists(): SESSION_KEY = env_path.read_text().splitlines()[0].split("=")[1] else: SESSION_KEY = secrets.token_hex(32) with env_path.open("w") as f: f.write(f"OPENUI_SESSION_KEY={SESSION_KEY}") # Set the LITELLM_MASTER_KEY to a random value if it's not already set if os.getenv("LITELLM_MASTER_KEY") is None: os.environ["LITELLM_MASTER_KEY"] = "sk-{SESSION_KEY}" # GPT 3.5 is 0.0005 per 1k tokens input and 0.0015 output # 700k puts us at a max of $1.00 spent per user over a 48 hour period MAX_TOKENS = int(os.getenv("OPENUI_MAX_TOKENS", "700000")) GITHUB_CLIENT_ID = os.getenv("GITHUB_CLIENT_ID") GITHUB_CLIENT_SECRET = os.getenv("GITHUB_CLIENT_SECRET") AWS_ENDPOINT_URL_S3 = os.getenv("AWS_ENDPOINT_URL_S3") AWS_ACCESS_KEY_ID = os.getenv("AWS_ACCESS_KEY_ID") AWS_SECRET_ACCESS_KEY = os.getenv("AWS_SECRET_ACCESS_KEY") BUCKET_NAME = os.getenv("BUCKET_NAME", "openui") # Cors, if you're hosting the annotator iframe elsewhere, add it here CORS_ORIGINS = os.getenv( "OPENUI_CORS_ORIGINS", "https://wandb.github.io,https://localhost:5173" ).split(",") # Model providers OLLAMA_HOST = os.getenv("OLLAMA_HOST", "http://127.0.0.1:11434") OPENAI_BASE_URL = os.getenv("OPENAI_BASE_URL", "https://api.openai.com/v1") OPENAI_API_KEY = os.getenv("OPENAI_API_KEY", "xxx") GROQ_BASE_URL = os.getenv("GROQ_BASE_URL", "https://api.groq.com/openai/v1") GROQ_API_KEY = os.getenv("GROQ_API_KEY") LITELLM_API_KEY = os.getenv("LITELLM_API_KEY", os.getenv("LITELLM_MASTER_KEY")) LITELLM_BASE_URL = os.getenv("LITELLM_BASE_URL", "http://0.0.0.0:4000") PORT = int(os.getenv("PORT", 7878)) ================================================ FILE: backend/openui/config.yaml ================================================ litellm_settings: # callbacks: callbacks.weave_handler ================================================ FILE: backend/openui/db/models.py ================================================ from peewee import ( Model, BinaryUUIDField, BooleanField, CharField, IntegerField, DateField, CompositeKey, DateTimeField, ForeignKeyField, OperationalError, fn, ) import uuid import datetime from playhouse.sqlite_ext import SqliteExtDatabase, JSONField from playhouse.migrate import SqliteMigrator, migrate from openui import config database = SqliteExtDatabase( config.DB, pragmas=( ("cache_size", -1024 * 64), # 64MB page-cache. ("journal_mode", "wal"), # Use WAL-mode ("foreign_keys", 1), ), ) migrator = SqliteMigrator(database) class BaseModel(Model): class Meta: database = database class SchemaMigration(BaseModel): version = CharField() class User(BaseModel): id = BinaryUUIDField(primary_key=True) username = CharField(unique=True) email = CharField(null=True) created_at = DateTimeField() class Credential(BaseModel): credential_id = CharField(primary_key=True) public_key = CharField() sign_count = IntegerField() aaguid = CharField(null=True) user_verified = BooleanField(default=False) user = ForeignKeyField(User, backref="credentials") class Session(BaseModel): id = BinaryUUIDField(primary_key=True) user = ForeignKeyField(User, backref="sessions") data = JSONField() created_at = DateTimeField() updated_at = DateTimeField() class Component(BaseModel): id = BinaryUUIDField(primary_key=True) name = CharField() user = ForeignKeyField(User, backref="components") data = JSONField() class Vote(BaseModel): id = BinaryUUIDField(primary_key=True) user = ForeignKeyField(User, backref="votes") component = ForeignKeyField(Component, backref="votes") vote = BooleanField() created_at = DateTimeField() class Usage(BaseModel): input_tokens = IntegerField() output_tokens = IntegerField() day = DateField() user = ForeignKeyField(User, backref="usage") class Meta: primary_key = CompositeKey("user", "day") @classmethod def update_tokens(cls, user_id: str, input_tokens: int, output_tokens: int): Usage.insert( user_id=uuid.UUID(user_id).bytes, day=datetime.datetime.now().date(), input_tokens=input_tokens, output_tokens=output_tokens, ).on_conflict( conflict_target=[Usage.user_id, Usage.day], update={ Usage.input_tokens: Usage.input_tokens + input_tokens, Usage.output_tokens: Usage.output_tokens + output_tokens, }, ).execute() @classmethod def tokens_since(cls, user_id: str, day: datetime.date) -> int: return ( Usage.select( fn.SUM(Usage.input_tokens + Usage.output_tokens).alias("tokens") ) .where(Usage.user_id == uuid.UUID(user_id).bytes, Usage.day >= day) .get() .tokens or 0 ) CURRENT_VERSION = "2024-05-14" def alter(schema: SchemaMigration, ops: list[list], version: str) -> bool: try: migrate(*ops) except OperationalError as e: print("Migration failed", e) return False schema.version = version schema.save() print(f"Migrated {version}") return version != CURRENT_VERSION def perform_migration(schema: SchemaMigration) -> bool: if schema.version == "2024-03-08": version = "2024-03-12" aaguid = CharField(null=True) user_verified = BooleanField(default=False) altered = alter( schema, [ migrator.add_column("credential", "aaguid", aaguid), migrator.add_column("credential", "user_verified", user_verified), ], version, ) if altered: perform_migration(schema) if schema.version == "2024-03-12": version = "2024-05-14" database.create_tables([Vote]) schema.version = version schema.save() if version != CURRENT_VERSION: perform_migration(schema) def ensure_migrated(): if not config.DB.exists(): database.create_tables( [User, Credential, Session, Component, SchemaMigration, Usage, Vote] ) SchemaMigration.create(version=CURRENT_VERSION) else: schema = SchemaMigration.select().first() if schema.version != CURRENT_VERSION: perform_migration(schema) ================================================ FILE: backend/openui/dist/annotator/index.html ================================================

How do you want this to change?

================================================ FILE: backend/openui/dist/assets/CodeEditor-B1zwGt1y.css ================================================ .monaco-editor{font-family:-apple-system,BlinkMacSystemFont,Segoe WPC,Segoe UI,HelveticaNeue-Light,system-ui,Ubuntu,Droid Sans,sans-serif;--monaco-monospace-font: "SF Mono", Monaco, Menlo, Consolas, "Ubuntu Mono", "Liberation Mono", "DejaVu Sans Mono", "Courier New", monospace}.monaco-menu .monaco-action-bar.vertical .action-item .action-menu-item:focus .action-label{stroke-width:1.2px}.monaco-editor.vs-dark .monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .action-label,.monaco-editor.hc-black .monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .action-label,.monaco-editor.hc-light .monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .action-label{stroke-width:1.2px}.monaco-hover p{margin:0}.monaco-aria-container{position:absolute!important;top:0;height:1px;width:1px;margin:-1px;overflow:hidden;padding:0;clip:rect(1px,1px,1px,1px);-webkit-clip-path:inset(50%);clip-path:inset(50%)}.monaco-editor,.monaco-diff-editor .synthetic-focus,.monaco-diff-editor [tabindex="0"]:focus,.monaco-diff-editor [tabindex="-1"]:focus,.monaco-diff-editor button:focus,.monaco-diff-editor input[type=button]:focus,.monaco-diff-editor input[type=checkbox]:focus,.monaco-diff-editor input[type=search]:focus,.monaco-diff-editor input[type=text]:focus,.monaco-diff-editor select:focus,.monaco-diff-editor textarea:focus{outline-width:1px;outline-style:solid;outline-offset:-1px;outline-color:var(--vscode-focusBorder);opacity:1}.monaco-aria-container{position:absolute;left:-999em}::-ms-clear{display:none}.monaco-editor .editor-widget input{color:inherit}.monaco-editor{position:relative;overflow:visible;-webkit-text-size-adjust:100%;color:var(--vscode-editor-foreground);background-color:var(--vscode-editor-background)}.monaco-editor-background{background-color:var(--vscode-editor-background)}.monaco-editor .rangeHighlight{background-color:var(--vscode-editor-rangeHighlightBackground);box-sizing:border-box;border:1px solid var(--vscode-editor-rangeHighlightBorder)}.monaco-editor.hc-black .rangeHighlight,.monaco-editor.hc-light .rangeHighlight{border-style:dotted}.monaco-editor .symbolHighlight{background-color:var(--vscode-editor-symbolHighlightBackground);box-sizing:border-box;border:1px solid var(--vscode-editor-symbolHighlightBorder)}.monaco-editor.hc-black .symbolHighlight,.monaco-editor.hc-light .symbolHighlight{border-style:dotted}.monaco-editor .overflow-guard{position:relative;overflow:hidden}.monaco-editor .view-overlays{position:absolute;top:0}.monaco-editor .view-overlays>div,.monaco-editor .margin-view-overlays>div{position:absolute;width:100%}.monaco-editor .squiggly-error{border-bottom:4px double var(--vscode-editorError-border)}.monaco-editor .squiggly-error:before{display:block;content:"";width:100%;height:100%;background:var(--vscode-editorError-background)}.monaco-editor .squiggly-warning{border-bottom:4px double var(--vscode-editorWarning-border)}.monaco-editor .squiggly-warning:before{display:block;content:"";width:100%;height:100%;background:var(--vscode-editorWarning-background)}.monaco-editor .squiggly-info{border-bottom:4px double var(--vscode-editorInfo-border)}.monaco-editor .squiggly-info:before{display:block;content:"";width:100%;height:100%;background:var(--vscode-editorInfo-background)}.monaco-editor .squiggly-hint{border-bottom:2px dotted var(--vscode-editorHint-border)}.monaco-editor.showUnused .squiggly-unnecessary{border-bottom:2px dashed var(--vscode-editorUnnecessaryCode-border)}.monaco-editor.showDeprecated .squiggly-inline-deprecated{text-decoration:line-through;-webkit-text-decoration-color:var(--vscode-editor-foreground, inherit);text-decoration-color:var(--vscode-editor-foreground, inherit)}.monaco-scrollable-element>.scrollbar>.scra{cursor:pointer;font-size:11px!important}.monaco-scrollable-element>.visible{opacity:1;background:#0000;transition:opacity .1s linear;z-index:11}.monaco-scrollable-element>.invisible{opacity:0;pointer-events:none}.monaco-scrollable-element>.invisible.fade{transition:opacity .8s linear}.monaco-scrollable-element>.shadow{position:absolute;display:none}.monaco-scrollable-element>.shadow.top{display:block;top:0;left:3px;height:3px;width:100%;box-shadow:var(--vscode-scrollbar-shadow) 0 6px 6px -6px inset}.monaco-scrollable-element>.shadow.left{display:block;top:3px;left:0;height:100%;width:3px;box-shadow:var(--vscode-scrollbar-shadow) 6px 0 6px -6px inset}.monaco-scrollable-element>.shadow.top-left-corner{display:block;top:0;left:0;height:3px;width:3px}.monaco-scrollable-element>.shadow.top.left{box-shadow:var(--vscode-scrollbar-shadow) 6px 0 6px -6px inset}.monaco-scrollable-element>.scrollbar>.slider{background:var(--vscode-scrollbarSlider-background)}.monaco-scrollable-element>.scrollbar>.slider:hover{background:var(--vscode-scrollbarSlider-hoverBackground)}.monaco-scrollable-element>.scrollbar>.slider.active{background:var(--vscode-scrollbarSlider-activeBackground)}.monaco-editor .inputarea{min-width:0;min-height:0;margin:0;padding:0;position:absolute;outline:none!important;resize:none;border:none;overflow:hidden;color:transparent;background-color:transparent;z-index:-10}.monaco-editor .inputarea.ime-input{z-index:10;caret-color:var(--vscode-editorCursor-foreground);color:var(--vscode-editor-foreground)}.monaco-editor .margin-view-overlays .line-numbers{bottom:0;font-variant-numeric:tabular-nums;position:absolute;text-align:right;display:inline-block;vertical-align:middle;box-sizing:border-box;cursor:default}.monaco-editor .relative-current-line-number{text-align:left;display:inline-block;width:100%}.monaco-editor .margin-view-overlays .line-numbers.lh-odd{margin-top:1px}.monaco-editor .line-numbers{color:var(--vscode-editorLineNumber-foreground)}.monaco-editor .line-numbers.active-line-number{color:var(--vscode-editorLineNumber-activeForeground)}.monaco-editor .margin{background-color:var(--vscode-editorGutter-background)}.monaco-mouse-cursor-text{cursor:text}.monaco-editor .blockDecorations-container{position:absolute;top:0;pointer-events:none}.monaco-editor .blockDecorations-block{position:absolute;box-sizing:border-box}.monaco-editor .view-overlays .current-line,.monaco-editor .margin-view-overlays .current-line{display:block;position:absolute;left:0;top:0;box-sizing:border-box;height:100%}.monaco-editor .margin-view-overlays .current-line.current-line-margin.current-line-margin-both{border-right:0}.monaco-editor .lines-content .cdr{position:absolute;height:100%}.monaco-editor .glyph-margin{position:absolute;top:0}.monaco-editor .glyph-margin-widgets .cgmr{position:absolute;display:flex;align-items:center;justify-content:center}.monaco-editor .glyph-margin-widgets .cgmr.codicon-modifier-spin:before{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.monaco-editor .lines-content .core-guide{position:absolute;box-sizing:border-box;height:100%}.mtkcontrol{color:#fff!important;background:#960000!important}.mtkoverflow{background-color:var(--vscode-button-background, var(--vscode-editor-background));color:var(--vscode-button-foreground, var(--vscode-editor-foreground));border-width:1px;border-style:solid;border-color:var(--vscode-contrastBorder);border-radius:2px;padding:4px;cursor:pointer}.mtkoverflow:hover{background-color:var(--vscode-button-hoverBackground)}.monaco-editor.no-user-select .lines-content,.monaco-editor.no-user-select .view-line,.monaco-editor.no-user-select .view-lines{-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-user-select:none}.monaco-editor.mac .lines-content:hover,.monaco-editor.mac .view-line:hover,.monaco-editor.mac .view-lines:hover{-moz-user-select:text;user-select:text;-webkit-user-select:text;-ms-user-select:text}.monaco-editor.enable-user-select{-moz-user-select:initial;-ms-user-select:initial;user-select:initial;-webkit-user-select:initial}.monaco-editor .view-lines{white-space:nowrap}.monaco-editor .view-line{position:absolute;width:100%}.monaco-editor .lines-content>.view-lines>.view-line>span{top:0;bottom:0;position:absolute}.monaco-editor .mtkw{color:var(--vscode-editorWhitespace-foreground)!important}.monaco-editor .mtkz{display:inline-block;color:var(--vscode-editorWhitespace-foreground)!important}.monaco-editor .lines-decorations{position:absolute;top:0;background:#fff}.monaco-editor .margin-view-overlays .cldr{position:absolute;height:100%}.monaco-editor .margin-view-overlays .cmdr{position:absolute;left:0;width:100%;height:100%}.monaco-editor .minimap.slider-mouseover .minimap-slider{opacity:0;transition:opacity .1s linear}.monaco-editor .minimap.slider-mouseover:hover .minimap-slider,.monaco-editor .minimap.slider-mouseover .minimap-slider.active{opacity:1}.monaco-editor .minimap-slider .minimap-slider-horizontal{background:var(--vscode-minimapSlider-background)}.monaco-editor .minimap-slider:hover .minimap-slider-horizontal{background:var(--vscode-minimapSlider-hoverBackground)}.monaco-editor .minimap-slider.active .minimap-slider-horizontal{background:var(--vscode-minimapSlider-activeBackground)}.monaco-editor .minimap-shadow-visible{box-shadow:var(--vscode-scrollbar-shadow) -6px 0 6px -6px inset}.monaco-editor .minimap-shadow-hidden{position:absolute;width:0}.monaco-editor .minimap-shadow-visible{position:absolute;left:-6px;width:6px}.monaco-editor.no-minimap-shadow .minimap-shadow-visible{position:absolute;left:-1px;width:1px}.minimap.autohide{opacity:0;transition:opacity .5s}.minimap.autohide:hover{opacity:1}.monaco-editor .minimap{z-index:5}.monaco-editor .overlayWidgets{position:absolute;top:0;left:0}.monaco-editor .view-ruler{position:absolute;top:0;box-shadow:1px 0 0 0 var(--vscode-editorRuler-foreground) inset}.monaco-editor .scroll-decoration{position:absolute;top:0;left:0;height:6px;box-shadow:var(--vscode-scrollbar-shadow) 0 6px 6px -6px inset}.monaco-editor .lines-content .cslr{position:absolute}.monaco-editor .focused .selected-text{background-color:var(--vscode-editor-selectionBackground)}.monaco-editor .selected-text{background-color:var(--vscode-editor-inactiveSelectionBackground)}.monaco-editor .top-left-radius{border-top-left-radius:3px}.monaco-editor .bottom-left-radius{border-bottom-left-radius:3px}.monaco-editor .top-right-radius{border-top-right-radius:3px}.monaco-editor .bottom-right-radius{border-bottom-right-radius:3px}.monaco-editor.hc-black .top-left-radius{border-top-left-radius:0}.monaco-editor.hc-black .bottom-left-radius{border-bottom-left-radius:0}.monaco-editor.hc-black .top-right-radius{border-top-right-radius:0}.monaco-editor.hc-black .bottom-right-radius{border-bottom-right-radius:0}.monaco-editor.hc-light .top-left-radius{border-top-left-radius:0}.monaco-editor.hc-light .bottom-left-radius{border-bottom-left-radius:0}.monaco-editor.hc-light .top-right-radius{border-top-right-radius:0}.monaco-editor.hc-light .bottom-right-radius{border-bottom-right-radius:0}.monaco-editor .cursors-layer{position:absolute;top:0}.monaco-editor .cursors-layer>.cursor{position:absolute;overflow:hidden;box-sizing:border-box}.monaco-editor .cursors-layer.cursor-smooth-caret-animation>.cursor{transition:all 80ms}.monaco-editor .cursors-layer.cursor-block-outline-style>.cursor{background:transparent!important;border-style:solid;border-width:1px}.monaco-editor .cursors-layer.cursor-underline-style>.cursor{border-bottom-width:2px;border-bottom-style:solid;background:transparent!important}.monaco-editor .cursors-layer.cursor-underline-thin-style>.cursor{border-bottom-width:1px;border-bottom-style:solid;background:transparent!important}@keyframes monaco-cursor-smooth{0%,20%{opacity:1}60%,to{opacity:0}}@keyframes monaco-cursor-phase{0%,20%{opacity:1}90%,to{opacity:0}}@keyframes monaco-cursor-expand{0%,20%{transform:scaleY(1)}80%,to{transform:scaleY(0)}}.cursor-smooth{animation:monaco-cursor-smooth .5s ease-in-out 0s 20 alternate}.cursor-phase{animation:monaco-cursor-phase .5s ease-in-out 0s 20 alternate}.cursor-expand>.cursor{animation:monaco-cursor-expand .5s ease-in-out 0s 20 alternate}.monaco-editor .mwh{position:absolute;color:var(--vscode-editorWhitespace-foreground)!important}.monaco-workbench .workbench-hover{position:relative;font-size:13px;line-height:19px;z-index:40;overflow:hidden;max-width:700px;background:var(--vscode-editorHoverWidget-background);border:1px solid var(--vscode-editorHoverWidget-border);border-radius:3px;color:var(--vscode-editorHoverWidget-foreground);box-shadow:0 2px 8px var(--vscode-widget-shadow)}.monaco-workbench .workbench-hover hr{border-bottom:none}.monaco-workbench .workbench-hover:not(.skip-fade-in){animation:fadein .1s linear}.monaco-workbench .workbench-hover.compact{font-size:12px}.monaco-workbench .workbench-hover.compact .hover-contents{padding:2px 8px}.monaco-workbench .workbench-hover-container.locked .workbench-hover{outline:1px solid var(--vscode-editorHoverWidget-border)}.monaco-workbench .workbench-hover-container.locked .workbench-hover:focus,.monaco-workbench .workbench-hover-lock:focus{outline:1px solid var(--vscode-focusBorder)}.monaco-workbench .workbench-hover-container.locked .workbench-hover-lock:hover{background:var(--vscode-toolbar-hoverBackground)}.monaco-workbench .workbench-hover-pointer{position:absolute;z-index:41;pointer-events:none}.monaco-workbench .workbench-hover-pointer:after{content:"";position:absolute;width:5px;height:5px;background-color:var(--vscode-editorHoverWidget-background);border-right:1px solid var(--vscode-editorHoverWidget-border);border-bottom:1px solid var(--vscode-editorHoverWidget-border)}.monaco-workbench .locked .workbench-hover-pointer:after{width:4px;height:4px;border-right-width:2px;border-bottom-width:2px}.monaco-workbench .workbench-hover-pointer.left{left:-3px}.monaco-workbench .workbench-hover-pointer.right{right:3px}.monaco-workbench .workbench-hover-pointer.top{top:-3px}.monaco-workbench .workbench-hover-pointer.bottom{bottom:3px}.monaco-workbench .workbench-hover-pointer.left:after{transform:rotate(135deg)}.monaco-workbench .workbench-hover-pointer.right:after{transform:rotate(315deg)}.monaco-workbench .workbench-hover-pointer.top:after{transform:rotate(225deg)}.monaco-workbench .workbench-hover-pointer.bottom:after{transform:rotate(45deg)}.monaco-workbench .workbench-hover a{color:var(--vscode-textLink-foreground)}.monaco-workbench .workbench-hover a:focus{outline:1px solid;outline-offset:-1px;text-decoration:underline;outline-color:var(--vscode-focusBorder)}.monaco-workbench .workbench-hover a:hover,.monaco-workbench .workbench-hover a:active{color:var(--vscode-textLink-activeForeground)}.monaco-workbench .workbench-hover code{background:var(--vscode-textCodeBlock-background)}.monaco-workbench .workbench-hover .hover-row .actions{background:var(--vscode-editorHoverWidget-statusBarBackground)}.monaco-workbench .workbench-hover.right-aligned{left:1px}.monaco-workbench .workbench-hover.right-aligned .hover-row.status-bar .actions{flex-direction:row-reverse}.monaco-workbench .workbench-hover.right-aligned .hover-row.status-bar .actions .action-container{margin-right:0;margin-left:16px}.monaco-hover{cursor:default;position:absolute;overflow:hidden;-moz-user-select:text;-ms-user-select:text;user-select:text;-webkit-user-select:text;box-sizing:border-box;animation:fadein .1s linear;line-height:1.5em;white-space:var(--vscode-hover-whiteSpace, normal)}.monaco-hover.hidden{display:none}.monaco-hover a:hover:not(.disabled){cursor:pointer}.monaco-hover .hover-contents:not(.html-hover-contents){padding:4px 8px}.monaco-hover .markdown-hover>.hover-contents:not(.code-hover-contents){max-width:var(--vscode-hover-maxWidth, 500px);word-wrap:break-word}.monaco-hover .markdown-hover>.hover-contents:not(.code-hover-contents) hr{min-width:100%}.monaco-hover p,.monaco-hover .code,.monaco-hover ul,.monaco-hover h1,.monaco-hover h2,.monaco-hover h3,.monaco-hover h4,.monaco-hover h5,.monaco-hover h6{margin:8px 0}.monaco-hover h1,.monaco-hover h2,.monaco-hover h3,.monaco-hover h4,.monaco-hover h5,.monaco-hover h6{line-height:1.1}.monaco-hover code{font-family:var(--monaco-monospace-font)}.monaco-hover hr{box-sizing:border-box;border-left:0px;border-right:0px;margin:4px -8px -4px;height:1px}.monaco-hover p:first-child,.monaco-hover .code:first-child,.monaco-hover ul:first-child{margin-top:0}.monaco-hover p:last-child,.monaco-hover .code:last-child,.monaco-hover ul:last-child{margin-bottom:0}.monaco-hover ul,.monaco-hover ol{padding-left:20px}.monaco-hover li>p{margin-bottom:0}.monaco-hover li>ul{margin-top:0}.monaco-hover code{border-radius:3px;padding:0 .4em}.monaco-hover .monaco-tokenized-source{white-space:var(--vscode-hover-sourceWhiteSpace, pre-wrap)}.monaco-hover .hover-row.status-bar{font-size:12px;line-height:22px}.monaco-hover .hover-row.status-bar .info{font-style:italic;padding:0 8px}.monaco-hover .hover-row.status-bar .actions{display:flex;padding:0 8px;width:100%}.monaco-hover .hover-row.status-bar .actions .action-container{margin-right:16px;cursor:pointer}.monaco-hover .hover-row.status-bar .actions .action-container .action .icon{padding-right:4px}.monaco-hover .markdown-hover .hover-contents .codicon{color:inherit;font-size:inherit;vertical-align:middle}.monaco-hover .hover-contents a.code-link:hover,.monaco-hover .hover-contents a.code-link{color:inherit}.monaco-hover .hover-contents a.code-link:before{content:"("}.monaco-hover .hover-contents a.code-link:after{content:")"}.monaco-hover .hover-contents a.code-link>span{text-decoration:underline;border-bottom:1px solid transparent;text-underline-position:under;color:var(--vscode-textLink-foreground)}.monaco-hover .hover-contents a.code-link>span:hover{color:var(--vscode-textLink-activeForeground)}.monaco-hover .markdown-hover .hover-contents:not(.code-hover-contents):not(.html-hover-contents) span{margin-bottom:4px;display:inline-block}.monaco-hover-content{padding-right:2px;padding-bottom:2px;box-sizing:border-box}.monaco-hover-content .action-container a{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.monaco-hover-content .action-container.disabled{pointer-events:none;opacity:.4;cursor:default}.monaco-editor .rendered-markdown kbd{background-color:var(--vscode-keybindingLabel-background);color:var(--vscode-keybindingLabel-foreground);border-style:solid;border-width:1px;border-radius:3px;border-color:var(--vscode-keybindingLabel-border);border-bottom-color:var(--vscode-keybindingLabel-bottomBorder);box-shadow:inset 0 -1px 0 var(--vscode-widget-shadow);vertical-align:middle;padding:1px 3px}.rendered-markdown li:has(input[type=checkbox]){list-style-type:none}.context-view{position:absolute}.context-view.fixed{all:initial;font-family:inherit;font-size:13px;position:fixed;color:inherit}.monaco-list{position:relative;height:100%;width:100%;white-space:nowrap}.monaco-list.mouse-support{-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-user-select:none}.monaco-list>.monaco-scrollable-element{height:100%}.monaco-list-rows{position:relative;width:100%;height:100%}.monaco-list.horizontal-scrolling .monaco-list-rows{width:auto;min-width:100%}.monaco-list-row{position:absolute;box-sizing:border-box;overflow:hidden;width:100%}.monaco-list.mouse-support .monaco-list-row{cursor:pointer;touch-action:none}.monaco-list .monaco-scrollable-element>.scrollbar.vertical,.monaco-pane-view>.monaco-split-view2.vertical>.monaco-scrollable-element>.scrollbar.vertical{z-index:14}.monaco-list-row.scrolling{display:none!important}.monaco-list.element-focused,.monaco-list.selection-single,.monaco-list.selection-multiple{outline:0!important}.monaco-drag-image{display:inline-block;padding:1px 7px;border-radius:10px;font-size:12px;position:absolute;z-index:1000}.monaco-list-type-filter-message{position:absolute;box-sizing:border-box;width:100%;height:100%;top:0;left:0;padding:40px 1em 1em;text-align:center;white-space:normal;opacity:.7;pointer-events:none}.monaco-list-type-filter-message:empty{display:none}.monaco-select-box-dropdown-padding{--dropdown-padding-top: 1px;--dropdown-padding-bottom: 1px}.hc-black .monaco-select-box-dropdown-padding,.hc-light .monaco-select-box-dropdown-padding{--dropdown-padding-top: 3px;--dropdown-padding-bottom: 4px}.monaco-select-box-dropdown-container{display:none;box-sizing:border-box}.monaco-select-box-dropdown-container>.select-box-details-pane>.select-box-description-markdown *{margin:0}.monaco-select-box-dropdown-container>.select-box-details-pane>.select-box-description-markdown a:focus{outline:1px solid -webkit-focus-ring-color;outline-offset:-1px}.monaco-select-box-dropdown-container>.select-box-details-pane>.select-box-description-markdown code{line-height:15px;font-family:var(--monaco-monospace-font)}.monaco-select-box-dropdown-container.visible{display:flex;flex-direction:column;text-align:left;width:1px;overflow:hidden;border-bottom-left-radius:3px;border-bottom-right-radius:3px}.monaco-select-box-dropdown-container>.select-box-dropdown-list-container{flex:0 0 auto;align-self:flex-start;padding-top:var(--dropdown-padding-top);padding-bottom:var(--dropdown-padding-bottom);padding-left:1px;padding-right:1px;width:100%;overflow:hidden;box-sizing:border-box}.monaco-select-box-dropdown-container>.select-box-details-pane{padding:5px}.hc-black .monaco-select-box-dropdown-container>.select-box-dropdown-list-container{padding-top:var(--dropdown-padding-top);padding-bottom:var(--dropdown-padding-bottom)}.monaco-select-box-dropdown-container>.select-box-dropdown-list-container .monaco-list .monaco-list-row{cursor:pointer}.monaco-select-box-dropdown-container>.select-box-dropdown-list-container .monaco-list .monaco-list-row>.option-text{text-overflow:ellipsis;overflow:hidden;padding-left:3.5px;white-space:nowrap;float:left}.monaco-select-box-dropdown-container>.select-box-dropdown-list-container .monaco-list .monaco-list-row>.option-detail{text-overflow:ellipsis;overflow:hidden;padding-left:3.5px;white-space:nowrap;float:left;opacity:.7}.monaco-select-box-dropdown-container>.select-box-dropdown-list-container .monaco-list .monaco-list-row>.option-decorator-right{text-overflow:ellipsis;overflow:hidden;padding-right:10px;white-space:nowrap;float:right}.monaco-select-box-dropdown-container>.select-box-dropdown-list-container .monaco-list .monaco-list-row>.visually-hidden{position:absolute;left:-10000px;top:auto;width:1px;height:1px;overflow:hidden}.monaco-select-box-dropdown-container>.select-box-dropdown-container-width-control{flex:1 1 auto;align-self:flex-start;opacity:0}.monaco-select-box-dropdown-container>.select-box-dropdown-container-width-control>.width-control-div{overflow:hidden;max-height:0px}.monaco-select-box-dropdown-container>.select-box-dropdown-container-width-control>.width-control-div>.option-text-width-control{padding-left:4px;padding-right:8px;white-space:nowrap}.monaco-select-box{width:100%;cursor:pointer;border-radius:2px}.monaco-select-box-dropdown-container{font-size:13px;font-weight:400;text-transform:none}.monaco-action-bar .action-item.select-container{cursor:default}.monaco-action-bar .action-item .monaco-select-box{cursor:pointer;min-width:100px;min-height:18px;padding:2px 23px 2px 8px}.mac .monaco-action-bar .action-item .monaco-select-box{font-size:11px;border-radius:5px}.monaco-action-bar{white-space:nowrap;height:100%}.monaco-action-bar .actions-container{display:flex;margin:0 auto;padding:0;height:100%;width:100%;align-items:center}.monaco-action-bar.vertical .actions-container{display:inline-block}.monaco-action-bar .action-item{display:block;align-items:center;justify-content:center;cursor:pointer;position:relative}.monaco-action-bar .action-item.disabled{cursor:default}.monaco-action-bar .action-item .icon,.monaco-action-bar .action-item .codicon{display:block}.monaco-action-bar .action-item .codicon{display:flex;align-items:center;width:16px;height:16px}.monaco-action-bar .action-label{display:flex;font-size:11px;padding:3px;border-radius:5px}.monaco-action-bar .action-item.disabled .action-label,.monaco-action-bar .action-item.disabled .action-label:before,.monaco-action-bar .action-item.disabled .action-label:hover{color:var(--vscode-disabledForeground)}.monaco-action-bar.vertical{text-align:left}.monaco-action-bar.vertical .action-item{display:block}.monaco-action-bar.vertical .action-label.separator{display:block;border-bottom:1px solid #bbb;padding-top:1px;margin-left:.8em;margin-right:.8em}.monaco-action-bar .action-item .action-label.separator{width:1px;height:16px;margin:5px 4px!important;cursor:default;min-width:1px;padding:0;background-color:#bbb}.secondary-actions .monaco-action-bar .action-label{margin-left:6px}.monaco-action-bar .action-item.select-container{overflow:hidden;flex:1;max-width:170px;min-width:60px;display:flex;align-items:center;justify-content:center;margin-right:10px}.monaco-action-bar .action-item.action-dropdown-item{display:flex}.monaco-action-bar .action-item.action-dropdown-item>.action-dropdown-item-separator{display:flex;align-items:center;cursor:default}.monaco-action-bar .action-item.action-dropdown-item>.action-dropdown-item-separator>div{width:1px}.monaco-dropdown{height:100%;padding:0}.monaco-dropdown>.dropdown-label{cursor:pointer;height:100%;display:flex;align-items:center;justify-content:center}.monaco-dropdown>.dropdown-label>.action-label.disabled{cursor:default}.monaco-dropdown-with-primary{display:flex!important;flex-direction:row;border-radius:5px}.monaco-dropdown-with-primary>.action-container>.action-label{margin-right:0}.monaco-dropdown-with-primary>.dropdown-action-container>.monaco-dropdown>.dropdown-label .codicon[class*=codicon-]{font-size:12px;padding-left:0;padding-right:0;line-height:16px;margin-left:-3px}.monaco-dropdown-with-primary>.dropdown-action-container>.monaco-dropdown>.dropdown-label>.action-label{display:block;background-size:16px;background-position:center center;background-repeat:no-repeat}.monaco-action-bar .action-item.menu-entry .action-label.icon{width:16px;height:16px;background-repeat:no-repeat;background-position:50%;background-size:16px}.monaco-dropdown-with-default{display:flex!important;flex-direction:row;border-radius:5px}.monaco-dropdown-with-default>.action-container>.action-label{margin-right:0}.monaco-dropdown-with-default>.action-container.menu-entry>.action-label.icon{width:16px;height:16px;background-repeat:no-repeat;background-position:50%;background-size:16px}.monaco-dropdown-with-default:hover{background-color:var(--vscode-toolbar-hoverBackground)}.monaco-dropdown-with-default>.dropdown-action-container>.monaco-dropdown>.dropdown-label .codicon[class*=codicon-]{font-size:12px;padding-left:0;padding-right:0;line-height:16px;margin-left:-3px}.monaco-dropdown-with-default>.dropdown-action-container>.monaco-dropdown>.dropdown-label>.action-label{display:block;background-size:16px;background-position:center center;background-repeat:no-repeat}.quick-input-widget{font-size:13px}.quick-input-widget .monaco-highlighted-label .highlight{color:#0066bf}.vs .quick-input-widget .monaco-list-row.focused .monaco-highlighted-label .highlight{color:#9dddff}.vs-dark .quick-input-widget .monaco-highlighted-label .highlight{color:#0097fb}.hc-black .quick-input-widget .monaco-highlighted-label .highlight{color:#f38518}.hc-light .quick-input-widget .monaco-highlighted-label .highlight{color:#0f4a85}.monaco-keybinding>.monaco-keybinding-key{background-color:#ddd6;border:solid 1px rgba(204,204,204,.4);border-bottom-color:#bbb6;box-shadow:inset 0 -1px #bbb6;color:#555}.hc-black .monaco-keybinding>.monaco-keybinding-key{background-color:transparent;border:solid 1px rgb(111,195,223);box-shadow:none;color:#fff}.hc-light .monaco-keybinding>.monaco-keybinding-key{background-color:transparent;border:solid 1px #0F4A85;box-shadow:none;color:#292929}.vs-dark .monaco-keybinding>.monaco-keybinding-key{background-color:#8080802b;border:solid 1px rgba(51,51,51,.6);border-bottom-color:#4449;box-shadow:inset 0 -1px #4449;color:#ccc}.monaco-custom-toggle{margin-left:2px;float:left;cursor:pointer;overflow:hidden;width:20px;height:20px;border-radius:3px;border:1px solid transparent;padding:1px;box-sizing:border-box;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-user-select:none}.monaco-custom-toggle:hover{background-color:var(--vscode-inputOption-hoverBackground)}.hc-black .monaco-custom-toggle:hover,.hc-light .monaco-custom-toggle:hover{border:1px dashed var(--vscode-focusBorder)}.hc-black .monaco-custom-toggle,.hc-light .monaco-custom-toggle,.hc-black .monaco-custom-toggle:hover,.hc-light .monaco-custom-toggle:hover{background:none}.monaco-custom-toggle.monaco-checkbox{height:18px;width:18px;border:1px solid transparent;border-radius:3px;margin-right:9px;margin-left:0;padding:0;opacity:1;background-size:16px!important}.monaco-action-bar .checkbox-action-item{display:flex;align-items:center}.monaco-action-bar .checkbox-action-item>.monaco-custom-toggle.monaco-checkbox{margin-right:4px}.monaco-action-bar .checkbox-action-item>.checkbox-label{font-size:12px}.monaco-custom-toggle.monaco-checkbox:not(.checked):before{visibility:hidden}.quick-input-widget{position:absolute;width:600px;z-index:2550;left:50%;margin-left:-300px;-webkit-app-region:no-drag;border-radius:6px}.quick-input-titlebar{display:flex;align-items:center;border-radius:inherit}.quick-input-left-action-bar{display:flex;margin-left:4px;flex:1}.quick-input-title{padding:3px 0;text-align:center;text-overflow:ellipsis;overflow:hidden}.quick-input-right-action-bar{display:flex;margin-right:4px;flex:1}.quick-input-right-action-bar>.actions-container{justify-content:flex-end}.quick-input-titlebar .monaco-action-bar .action-label.codicon{background-position:center;background-repeat:no-repeat;padding:2px}.quick-input-description{margin:6px 6px 6px 11px}.quick-input-header .quick-input-description{margin:4px 2px;flex:1}.quick-input-header{display:flex;padding:8px 6px 2px}.quick-input-widget.hidden-input .quick-input-header{padding:0;margin-bottom:0}.quick-input-and-message{display:flex;flex-direction:column;flex-grow:1;min-width:0;position:relative}.quick-input-check-all{align-self:center;margin:0}.quick-input-filter{flex-grow:1;display:flex;position:relative}.quick-input-box{flex-grow:1}.quick-input-widget.show-checkboxes .quick-input-box,.quick-input-widget.show-checkboxes .quick-input-message{margin-left:5px}.quick-input-visible-count{position:absolute;left:-10000px}.quick-input-count{align-self:center;position:absolute;right:4px;display:flex;align-items:center}.quick-input-count .monaco-count-badge{vertical-align:middle;padding:2px 4px;border-radius:2px;min-height:auto;line-height:normal}.quick-input-action{margin-left:6px}.quick-input-action .monaco-text-button{font-size:11px;padding:0 6px;display:flex;height:25px;align-items:center}.quick-input-message{margin-top:-1px;padding:5px;overflow-wrap:break-word}.quick-input-message>.codicon{margin:0 .2em;vertical-align:text-bottom}.quick-input-message a{color:inherit}.quick-input-progress.monaco-progress-container{position:relative}.quick-input-list{line-height:22px}.quick-input-widget.hidden-input .quick-input-list{margin-top:4px;padding-bottom:4px}.quick-input-list .monaco-list{overflow:hidden;max-height:440px;padding-bottom:5px}.quick-input-list .monaco-scrollable-element{padding:0 5px}.quick-input-list .quick-input-list-entry{box-sizing:border-box;overflow:hidden;display:flex;height:100%;padding:0 6px}.quick-input-list .quick-input-list-entry.quick-input-list-separator-border{border-top-width:1px;border-top-style:solid}.quick-input-list .monaco-list-row{border-radius:3px}.quick-input-list .monaco-list-row[data-index="0"] .quick-input-list-entry.quick-input-list-separator-border{border-top-style:none}.quick-input-list .quick-input-list-label{overflow:hidden;display:flex;height:100%;flex:1}.quick-input-list .quick-input-list-checkbox{align-self:center;margin:0}.quick-input-list .quick-input-list-icon{background-size:16px;background-position:left center;background-repeat:no-repeat;padding-right:6px;width:16px;height:22px;display:flex;align-items:center;justify-content:center}.quick-input-list .quick-input-list-rows{overflow:hidden;text-overflow:ellipsis;display:flex;flex-direction:column;height:100%;flex:1;margin-left:5px}.quick-input-widget.show-checkboxes .quick-input-list .quick-input-list-rows{margin-left:10px}.quick-input-widget .quick-input-list .quick-input-list-checkbox{display:none}.quick-input-widget.show-checkboxes .quick-input-list .quick-input-list-checkbox{display:inline}.quick-input-list .quick-input-list-rows>.quick-input-list-row{display:flex;align-items:center}.quick-input-list .quick-input-list-rows>.quick-input-list-row .monaco-icon-label,.quick-input-list .quick-input-list-rows>.quick-input-list-row .monaco-icon-label .monaco-icon-label-container>.monaco-icon-name-container{flex:1}.quick-input-list .quick-input-list-rows>.quick-input-list-row .codicon[class*=codicon-]{vertical-align:text-bottom}.quick-input-list .quick-input-list-rows .monaco-highlighted-label>span{opacity:1}.quick-input-list .quick-input-list-entry .quick-input-list-entry-keybinding{margin-right:8px}.quick-input-list .quick-input-list-label-meta{opacity:.7;line-height:normal;text-overflow:ellipsis;overflow:hidden}.quick-input-list .monaco-list .monaco-list-row .monaco-highlighted-label .highlight{font-weight:700;background-color:unset;color:var(--vscode-list-highlightForeground)!important}.quick-input-list .monaco-list .monaco-list-row.focused .monaco-highlighted-label .highlight{color:var(--vscode-list-focusHighlightForeground)!important}.quick-input-list .quick-input-list-entry .quick-input-list-separator{margin-right:4px}.quick-input-list .quick-input-list-entry-action-bar{display:flex;flex:0;overflow:visible}.quick-input-list .quick-input-list-entry-action-bar .action-label{display:none}.quick-input-list .quick-input-list-entry-action-bar .action-label.codicon{margin-right:4px;padding:0 2px 2px}.quick-input-list .quick-input-list-entry-action-bar{margin-top:1px;margin-right:4px}.quick-input-list .quick-input-list-entry .quick-input-list-entry-action-bar .action-label.always-visible,.quick-input-list .quick-input-list-entry:hover .quick-input-list-entry-action-bar .action-label,.quick-input-list .quick-input-list-entry.focus-inside .quick-input-list-entry-action-bar .action-label,.quick-input-list .monaco-list-row.focused .quick-input-list-entry-action-bar .action-label,.quick-input-list .monaco-list-row.passive-focused .quick-input-list-entry-action-bar .action-label{display:flex}.quick-input-list .monaco-list-row.focused .monaco-keybinding-key,.quick-input-list .monaco-list-row.focused .quick-input-list-entry .quick-input-list-separator{color:inherit}.quick-input-list .monaco-list-row.focused .monaco-keybinding-key{background:none}.quick-input-list .quick-input-list-separator-as-item{padding:4px 6px;font-size:12px}.quick-input-list .quick-input-list-separator-as-item .label-name{font-weight:600}.quick-input-list .quick-input-list-separator-as-item .label-description{opacity:1!important}.quick-input-list .monaco-tree-sticky-row .quick-input-list-entry.quick-input-list-separator-as-item.quick-input-list-separator-border{border-top-style:none}.quick-input-list .monaco-tree-sticky-row{padding:0 5px}.quick-input-list .monaco-tl-twistie{display:none!important}:root{--vscode-sash-size: 4px;--vscode-sash-hover-size: 4px}.monaco-sash{position:absolute;z-index:35;touch-action:none}.monaco-sash.disabled{pointer-events:none}.monaco-sash.mac.vertical{cursor:col-resize}.monaco-sash.vertical.minimum{cursor:e-resize}.monaco-sash.vertical.maximum{cursor:w-resize}.monaco-sash.mac.horizontal{cursor:row-resize}.monaco-sash.horizontal.minimum{cursor:s-resize}.monaco-sash.horizontal.maximum{cursor:n-resize}.monaco-sash.disabled{cursor:default!important;pointer-events:none!important}.monaco-sash.vertical{cursor:ew-resize;top:0;width:var(--vscode-sash-size);height:100%}.monaco-sash.horizontal{cursor:ns-resize;left:0;width:100%;height:var(--vscode-sash-size)}.monaco-sash:not(.disabled)>.orthogonal-drag-handle{content:" ";height:calc(var(--vscode-sash-size) * 2);width:calc(var(--vscode-sash-size) * 2);z-index:100;display:block;cursor:all-scroll;position:absolute}.monaco-sash.horizontal.orthogonal-edge-north:not(.disabled)>.orthogonal-drag-handle.start,.monaco-sash.horizontal.orthogonal-edge-south:not(.disabled)>.orthogonal-drag-handle.end{cursor:nwse-resize}.monaco-sash.horizontal.orthogonal-edge-north:not(.disabled)>.orthogonal-drag-handle.end,.monaco-sash.horizontal.orthogonal-edge-south:not(.disabled)>.orthogonal-drag-handle.start{cursor:nesw-resize}.monaco-sash.vertical>.orthogonal-drag-handle.start{left:calc(var(--vscode-sash-size) * -.5);top:calc(var(--vscode-sash-size) * -1)}.monaco-sash.vertical>.orthogonal-drag-handle.end{left:calc(var(--vscode-sash-size) * -.5);bottom:calc(var(--vscode-sash-size) * -1)}.monaco-sash.horizontal>.orthogonal-drag-handle.start{top:calc(var(--vscode-sash-size) * -.5);left:calc(var(--vscode-sash-size) * -1)}.monaco-sash.horizontal>.orthogonal-drag-handle.end{top:calc(var(--vscode-sash-size) * -.5);right:calc(var(--vscode-sash-size) * -1)}.monaco-sash:before{content:"";pointer-events:none;position:absolute;width:100%;height:100%;background:transparent}.monaco-workbench:not(.reduce-motion) .monaco-sash:before{transition:background-color .1s ease-out}.monaco-sash.hover:before,.monaco-sash.active:before{background:var(--vscode-sash-hoverBorder)}.monaco-sash.vertical:before{width:var(--vscode-sash-hover-size);left:calc(50% - (var(--vscode-sash-hover-size) / 2))}.monaco-sash.horizontal:before{height:var(--vscode-sash-hover-size);top:calc(50% - (var(--vscode-sash-hover-size) / 2))}.pointer-events-disabled{pointer-events:none!important}.monaco-sash.debug{background:#0ff}.monaco-sash.debug.disabled{background:#0ff3}.monaco-sash.debug:not(.disabled)>.orthogonal-drag-handle{background:red}.monaco-split-view2{position:relative;width:100%;height:100%}.monaco-split-view2>.sash-container{position:absolute;width:100%;height:100%;pointer-events:none}.monaco-split-view2>.sash-container>.monaco-sash{pointer-events:initial}.monaco-split-view2>.monaco-scrollable-element{width:100%;height:100%}.monaco-split-view2>.monaco-scrollable-element>.split-view-container{width:100%;height:100%;white-space:nowrap;position:relative}.monaco-split-view2>.monaco-scrollable-element>.split-view-container>.split-view-view{white-space:initial;position:absolute}.monaco-split-view2>.monaco-scrollable-element>.split-view-container>.split-view-view:not(.visible){display:none}.monaco-split-view2.vertical>.monaco-scrollable-element>.split-view-container>.split-view-view{width:100%}.monaco-split-view2.horizontal>.monaco-scrollable-element>.split-view-container>.split-view-view{height:100%}.monaco-split-view2.separator-border>.monaco-scrollable-element>.split-view-container>.split-view-view:not(:first-child):before{content:" ";position:absolute;top:0;left:0;z-index:5;pointer-events:none;background-color:var(--separator-border)}.monaco-split-view2.separator-border.horizontal>.monaco-scrollable-element>.split-view-container>.split-view-view:not(:first-child):before{height:100%;width:1px}.monaco-split-view2.separator-border.vertical>.monaco-scrollable-element>.split-view-container>.split-view-view:not(:first-child):before{height:1px;width:100%}.monaco-table{display:flex;flex-direction:column;position:relative;height:100%;width:100%;white-space:nowrap;overflow:hidden}.monaco-table>.monaco-split-view2{border-bottom:1px solid transparent}.monaco-table>.monaco-list{flex:1}.monaco-table-tr{display:flex;height:100%}.monaco-table-th{width:100%;height:100%;font-weight:700;overflow:hidden;text-overflow:ellipsis}.monaco-table-th,.monaco-table-td{box-sizing:border-box;flex-shrink:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.monaco-table>.monaco-split-view2 .monaco-sash.vertical:before{content:"";position:absolute;left:calc(var(--vscode-sash-size) / 2);width:0;border-left:1px solid transparent}.monaco-workbench:not(.reduce-motion) .monaco-table>.monaco-split-view2,.monaco-workbench:not(.reduce-motion) .monaco-table>.monaco-split-view2 .monaco-sash.vertical:before{transition:border-color .2s ease-out}.monaco-inputbox{position:relative;display:block;padding:0;box-sizing:border-box;border-radius:2px;font-size:inherit}.monaco-inputbox>.ibwrapper>.input,.monaco-inputbox>.ibwrapper>.mirror{padding:4px 6px}.monaco-inputbox>.ibwrapper{position:relative;width:100%;height:100%}.monaco-inputbox>.ibwrapper>.input{display:inline-block;box-sizing:border-box;width:100%;height:100%;line-height:inherit;border:none;font-family:inherit;font-size:inherit;resize:none;color:inherit}.monaco-inputbox>.ibwrapper>input{text-overflow:ellipsis}.monaco-inputbox>.ibwrapper>textarea.input{display:block;scrollbar-width:none;outline:none}.monaco-inputbox>.ibwrapper>textarea.input::-webkit-scrollbar{display:none}.monaco-inputbox>.ibwrapper>textarea.input.empty{white-space:nowrap}.monaco-inputbox>.ibwrapper>.mirror{position:absolute;display:inline-block;width:100%;top:0;left:0;box-sizing:border-box;white-space:pre-wrap;visibility:hidden;word-wrap:break-word}.monaco-inputbox-container{text-align:right}.monaco-inputbox-container .monaco-inputbox-message{display:inline-block;overflow:hidden;text-align:left;width:100%;box-sizing:border-box;padding:.4em;font-size:12px;line-height:17px;margin-top:-1px;word-wrap:break-word}.monaco-inputbox .monaco-action-bar{position:absolute;right:2px;top:4px}.monaco-inputbox .monaco-action-bar .action-item{margin-left:2px}.monaco-inputbox .monaco-action-bar .action-item .codicon{background-repeat:no-repeat;width:16px;height:16px}.monaco-findInput{position:relative}.monaco-findInput .monaco-inputbox{font-size:13px;width:100%}.monaco-findInput>.controls{position:absolute;top:3px;right:2px}.vs .monaco-findInput.disabled{background-color:#e1e1e1}.vs-dark .monaco-findInput.disabled{background-color:#333}.monaco-findInput.highlight-0 .controls,.hc-light .monaco-findInput.highlight-0 .controls{animation:monaco-findInput-highlight-0 .1s linear 0s}.monaco-findInput.highlight-1 .controls,.hc-light .monaco-findInput.highlight-1 .controls{animation:monaco-findInput-highlight-1 .1s linear 0s}.hc-black .monaco-findInput.highlight-0 .controls,.vs-dark .monaco-findInput.highlight-0 .controls{animation:monaco-findInput-highlight-dark-0 .1s linear 0s}.hc-black .monaco-findInput.highlight-1 .controls,.vs-dark .monaco-findInput.highlight-1 .controls{animation:monaco-findInput-highlight-dark-1 .1s linear 0s}@keyframes monaco-findInput-highlight-0{0%{background:#fdff00cc}to{background:transparent}}@keyframes monaco-findInput-highlight-1{0%{background:#fdff00cc}99%{background:transparent}}@keyframes monaco-findInput-highlight-dark-0{0%{background:#ffffff70}to{background:transparent}}@keyframes monaco-findInput-highlight-dark-1{0%{background:#ffffff70}99%{background:transparent}}.monaco-tl-row{display:flex;height:100%;align-items:center;position:relative}.monaco-tl-row.disabled{cursor:default}.monaco-tl-indent{height:100%;position:absolute;top:0;left:16px;pointer-events:none}.hide-arrows .monaco-tl-indent{left:12px}.monaco-tl-indent>.indent-guide{display:inline-block;box-sizing:border-box;height:100%;border-left:1px solid transparent}.monaco-workbench:not(.reduce-motion) .monaco-tl-indent>.indent-guide{transition:border-color .1s linear}.monaco-tl-twistie,.monaco-tl-contents{height:100%}.monaco-tl-twistie{font-size:10px;text-align:right;padding-right:6px;flex-shrink:0;width:16px;display:flex!important;align-items:center;justify-content:center;transform:translate(3px)}.monaco-tl-contents{flex:1;overflow:hidden}.monaco-tl-twistie:before{border-radius:20px}.monaco-tl-twistie.collapsed:before{transform:rotate(-90deg)}.monaco-tl-twistie.codicon-tree-item-loading:before{animation:codicon-spin 1.25s steps(30) infinite}.monaco-tree-type-filter{position:absolute;top:0;display:flex;padding:3px;max-width:200px;z-index:100;margin:0 6px;border:1px solid var(--vscode-widget-border);border-bottom-left-radius:4px;border-bottom-right-radius:4px}.monaco-workbench:not(.reduce-motion) .monaco-tree-type-filter{transition:top .3s}.monaco-tree-type-filter.disabled{top:-40px!important}.monaco-tree-type-filter-grab{display:flex!important;align-items:center;justify-content:center;cursor:-webkit-grab;cursor:grab;margin-right:2px}.monaco-tree-type-filter-grab.grabbing{cursor:-webkit-grabbing;cursor:grabbing}.monaco-tree-type-filter-input{flex:1}.monaco-tree-type-filter-input .monaco-inputbox{height:23px}.monaco-tree-type-filter-input .monaco-inputbox>.ibwrapper>.input,.monaco-tree-type-filter-input .monaco-inputbox>.ibwrapper>.mirror{padding:2px 4px}.monaco-tree-type-filter-input .monaco-findInput>.controls{top:2px}.monaco-tree-type-filter-actionbar{margin-left:4px}.monaco-tree-type-filter-actionbar .monaco-action-bar .action-label{padding:2px}.monaco-list .monaco-scrollable-element .monaco-tree-sticky-container{position:absolute;top:0;left:0;width:100%;height:0;z-index:13;background-color:var(--vscode-sideBar-background)}.monaco-list .monaco-scrollable-element .monaco-tree-sticky-container .monaco-tree-sticky-row.monaco-list-row{position:absolute;width:100%;opacity:1!important;overflow:hidden;background-color:var(--vscode-sideBar-background)}.monaco-list .monaco-scrollable-element .monaco-tree-sticky-container .monaco-tree-sticky-row:hover{background-color:var(--vscode-list-hoverBackground)!important;cursor:pointer}.monaco-list .monaco-scrollable-element .monaco-tree-sticky-container.empty,.monaco-list .monaco-scrollable-element .monaco-tree-sticky-container.empty .monaco-tree-sticky-container-shadow{display:none}.monaco-list .monaco-scrollable-element .monaco-tree-sticky-container .monaco-tree-sticky-container-shadow{position:absolute;bottom:-3px;left:0;height:0px;width:100%}.monaco-list .monaco-scrollable-element .monaco-tree-sticky-container[tabindex="0"]:focus{outline:none}.monaco-icon-label{display:flex;overflow:hidden;text-overflow:ellipsis}.monaco-icon-label:before{background-size:16px;background-position:left center;background-repeat:no-repeat;padding-right:6px;width:16px;height:22px;line-height:inherit!important;display:inline-block;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;vertical-align:top;flex-shrink:0}.monaco-icon-label-container.disabled{color:var(--vscode-disabledForeground)}.monaco-icon-label>.monaco-icon-label-container{min-width:0;overflow:hidden;text-overflow:ellipsis;flex:1}.monaco-icon-label>.monaco-icon-label-container>.monaco-icon-name-container>.label-name{color:inherit;white-space:pre}.monaco-icon-label>.monaco-icon-label-container>.monaco-icon-name-container>.label-name>.label-separator{margin:0 2px;opacity:.5}.monaco-icon-label>.monaco-icon-label-container>.monaco-icon-suffix-container>.label-suffix{opacity:.7;white-space:pre}.monaco-icon-label>.monaco-icon-label-container>.monaco-icon-description-container>.label-description{opacity:.7;margin-left:.5em;font-size:.9em;white-space:pre}.monaco-icon-label.nowrap>.monaco-icon-label-container>.monaco-icon-description-container>.label-description{white-space:nowrap}.vs .monaco-icon-label>.monaco-icon-label-container>.monaco-icon-description-container>.label-description{opacity:.95}.monaco-icon-label.italic>.monaco-icon-label-container>.monaco-icon-name-container>.label-name,.monaco-icon-label.italic>.monaco-icon-label-container>.monaco-icon-description-container>.label-description{font-style:italic}.monaco-icon-label.deprecated{text-decoration:line-through;opacity:.66}.monaco-icon-label.italic:after{font-style:italic}.monaco-icon-label.strikethrough>.monaco-icon-label-container>.monaco-icon-name-container>.label-name,.monaco-icon-label.strikethrough>.monaco-icon-label-container>.monaco-icon-description-container>.label-description{text-decoration:line-through}.monaco-icon-label:after{opacity:.75;font-size:90%;font-weight:600;margin:auto 16px 0 5px;text-align:center}.monaco-list:focus .selected .monaco-icon-label,.monaco-list:focus .selected .monaco-icon-label:after{color:inherit!important}.monaco-list-row.focused.selected .label-description,.monaco-list-row.selected .label-description{opacity:.8}.monaco-keybinding{display:flex;align-items:center;line-height:10px}.monaco-keybinding>.monaco-keybinding-key{display:inline-block;border-style:solid;border-width:1px;border-radius:3px;vertical-align:middle;font-size:11px;padding:3px 5px;margin:0 2px}.monaco-keybinding>.monaco-keybinding-key:first-child{margin-left:0}.monaco-keybinding>.monaco-keybinding-key:last-child{margin-right:0}.monaco-keybinding>.monaco-keybinding-key-separator{display:inline-block}.monaco-keybinding>.monaco-keybinding-key-chord-separator{width:6px}.monaco-text-button{box-sizing:border-box;display:flex;width:100%;padding:4px;border-radius:2px;text-align:center;cursor:pointer;justify-content:center;align-items:center;border:1px solid var(--vscode-button-border, transparent);line-height:18px}.monaco-text-button:focus{outline-offset:2px!important}.monaco-text-button:hover{text-decoration:none!important}.monaco-button.disabled:focus,.monaco-button.disabled{opacity:.4!important;cursor:default}.monaco-text-button .codicon{margin:0 .2em;color:inherit!important}.monaco-text-button.monaco-text-button-with-short-label{flex-direction:row;flex-wrap:wrap;padding:0 4px;overflow:hidden;height:28px}.monaco-text-button.monaco-text-button-with-short-label>.monaco-button-label{flex-basis:100%}.monaco-text-button.monaco-text-button-with-short-label>.monaco-button-label-short{flex-grow:1;width:0;overflow:hidden}.monaco-text-button.monaco-text-button-with-short-label>.monaco-button-label,.monaco-text-button.monaco-text-button-with-short-label>.monaco-button-label-short{display:flex;justify-content:center;align-items:center;font-weight:400;font-style:inherit;padding:4px 0}.monaco-button-dropdown{display:flex;cursor:pointer}.monaco-button-dropdown.disabled{cursor:default}.monaco-button-dropdown>.monaco-button:focus{outline-offset:-1px!important}.monaco-button-dropdown.disabled>.monaco-button.disabled,.monaco-button-dropdown.disabled>.monaco-button.disabled:focus,.monaco-button-dropdown.disabled>.monaco-button-dropdown-separator{opacity:.4!important}.monaco-button-dropdown>.monaco-button.monaco-text-button{border-right-width:0!important}.monaco-button-dropdown .monaco-button-dropdown-separator{padding:4px 0;cursor:default}.monaco-button-dropdown .monaco-button-dropdown-separator>div{height:100%;width:1px}.monaco-button-dropdown>.monaco-button.monaco-dropdown-button{border:1px solid var(--vscode-button-border, transparent);border-left-width:0!important;border-radius:0 2px 2px 0;display:flex;align-items:center}.monaco-button-dropdown>.monaco-button.monaco-text-button{border-radius:2px 0 0 2px}.monaco-description-button{display:flex;flex-direction:column;align-items:center;margin:4px 5px}.monaco-description-button .monaco-button-description{font-style:italic;font-size:11px;padding:4px 20px}.monaco-description-button .monaco-button-label,.monaco-description-button .monaco-button-description{display:flex;justify-content:center;align-items:center}.monaco-description-button .monaco-button-label>.codicon,.monaco-description-button .monaco-button-description>.codicon{margin:0 .2em;color:inherit!important}.monaco-button.default-colors,.monaco-button-dropdown.default-colors>.monaco-button{color:var(--vscode-button-foreground);background-color:var(--vscode-button-background)}.monaco-button.default-colors:hover,.monaco-button-dropdown.default-colors>.monaco-button:hover{background-color:var(--vscode-button-hoverBackground)}.monaco-button.default-colors.secondary,.monaco-button-dropdown.default-colors>.monaco-button.secondary{color:var(--vscode-button-secondaryForeground);background-color:var(--vscode-button-secondaryBackground)}.monaco-button.default-colors.secondary:hover,.monaco-button-dropdown.default-colors>.monaco-button.secondary:hover{background-color:var(--vscode-button-secondaryHoverBackground)}.monaco-button-dropdown.default-colors .monaco-button-dropdown-separator{background-color:var(--vscode-button-background);border-top:1px solid var(--vscode-button-border);border-bottom:1px solid var(--vscode-button-border)}.monaco-button-dropdown.default-colors .monaco-button.secondary+.monaco-button-dropdown-separator{background-color:var(--vscode-button-secondaryBackground)}.monaco-button-dropdown.default-colors .monaco-button-dropdown-separator>div{background-color:var(--vscode-button-separator)}.monaco-count-badge{padding:3px 6px;border-radius:11px;font-size:11px;min-width:18px;min-height:18px;line-height:11px;font-weight:400;text-align:center;display:inline-block;box-sizing:border-box}.monaco-count-badge.long{padding:2px 3px;border-radius:2px;min-height:auto;line-height:normal}.monaco-progress-container{width:100%;height:2px;overflow:hidden}.monaco-progress-container .progress-bit{width:2%;height:2px;position:absolute;left:0;display:none}.monaco-progress-container.active .progress-bit{display:inherit}.monaco-progress-container.discrete .progress-bit{left:0;transition:width .1s linear}.monaco-progress-container.discrete.done .progress-bit{width:100%}.monaco-progress-container.infinite .progress-bit{animation-name:progress;animation-duration:4s;animation-iteration-count:infinite;transform:translateZ(0);animation-timing-function:linear}.monaco-progress-container.infinite.infinite-long-running .progress-bit{animation-timing-function:steps(100)}@keyframes progress{0%{transform:translate(0) scaleX(1)}50%{transform:translate(2500%) scaleX(3)}to{transform:translate(4900%) scaleX(1)}}.monaco-editor .diff-hidden-lines-widget{width:100%}.monaco-editor .diff-hidden-lines{height:0px;transform:translateY(-10px);font-size:13px;line-height:14px}.monaco-editor .diff-hidden-lines:not(.dragging) .top:hover,.monaco-editor .diff-hidden-lines:not(.dragging) .bottom:hover,.monaco-editor .diff-hidden-lines .top.dragging,.monaco-editor .diff-hidden-lines .bottom.dragging{background-color:var(--vscode-focusBorder)}.monaco-editor .diff-hidden-lines .top,.monaco-editor .diff-hidden-lines .bottom{transition:background-color .1s ease-out;height:4px;background-color:transparent;background-clip:padding-box;border-bottom:2px solid transparent;border-top:4px solid transparent}.monaco-editor.draggingUnchangedRegion.canMoveTop:not(.canMoveBottom) *,.monaco-editor .diff-hidden-lines .top.canMoveTop:not(.canMoveBottom),.monaco-editor .diff-hidden-lines .bottom.canMoveTop:not(.canMoveBottom){cursor:n-resize!important}.monaco-editor.draggingUnchangedRegion:not(.canMoveTop).canMoveBottom *,.monaco-editor .diff-hidden-lines .top:not(.canMoveTop).canMoveBottom,.monaco-editor .diff-hidden-lines .bottom:not(.canMoveTop).canMoveBottom{cursor:s-resize!important}.monaco-editor.draggingUnchangedRegion.canMoveTop.canMoveBottom *,.monaco-editor .diff-hidden-lines .top.canMoveTop.canMoveBottom,.monaco-editor .diff-hidden-lines .bottom.canMoveTop.canMoveBottom{cursor:ns-resize!important}.monaco-editor .diff-hidden-lines .top{transform:translateY(4px)}.monaco-editor .diff-hidden-lines .bottom{transform:translateY(-6px)}.monaco-editor .diff-unchanged-lines{background:var(--vscode-diffEditor-unchangedCodeBackground)}.monaco-editor .noModificationsOverlay{z-index:1;background:var(--vscode-editor-background);display:flex;justify-content:center;align-items:center}.monaco-editor .diff-hidden-lines .center{background:var(--vscode-diffEditor-unchangedRegionBackground);color:var(--vscode-diffEditor-unchangedRegionForeground);overflow:hidden;display:block;text-overflow:ellipsis;white-space:nowrap;height:24px;box-shadow:inset 0 -5px 5px -7px var(--vscode-diffEditor-unchangedRegionShadow),inset 0 5px 5px -7px var(--vscode-diffEditor-unchangedRegionShadow)}.monaco-editor .diff-hidden-lines .center span.codicon{vertical-align:middle}.monaco-editor .diff-hidden-lines .center a:hover .codicon{cursor:pointer;color:var(--vscode-editorLink-activeForeground)!important}.monaco-editor .diff-hidden-lines div.breadcrumb-item{cursor:pointer}.monaco-editor .diff-hidden-lines div.breadcrumb-item:hover{color:var(--vscode-editorLink-activeForeground)}.monaco-editor .movedOriginal,.monaco-editor .movedModified{border:2px solid var(--vscode-diffEditor-move-border)}.monaco-editor .movedOriginal.currentMove,.monaco-editor .movedModified.currentMove{border:2px solid var(--vscode-diffEditor-moveActive-border)}.monaco-diff-editor .moved-blocks-lines path.currentMove{stroke:var(--vscode-diffEditor-moveActive-border)}.monaco-diff-editor .moved-blocks-lines path{pointer-events:visiblestroke}.monaco-diff-editor .moved-blocks-lines .arrow{fill:var(--vscode-diffEditor-move-border)}.monaco-diff-editor .moved-blocks-lines .arrow.currentMove{fill:var(--vscode-diffEditor-moveActive-border)}.monaco-diff-editor .moved-blocks-lines .arrow-rectangle{fill:var(--vscode-editor-background)}.monaco-diff-editor .moved-blocks-lines{position:absolute;pointer-events:none}.monaco-diff-editor .moved-blocks-lines path{fill:none;stroke:var(--vscode-diffEditor-move-border);stroke-width:2}.monaco-editor .char-delete.diff-range-empty{margin-left:-1px;border-left:solid var(--vscode-diffEditor-removedTextBackground) 3px}.monaco-editor .char-insert.diff-range-empty{border-left:solid var(--vscode-diffEditor-insertedTextBackground) 3px}.monaco-editor .fold-unchanged{cursor:pointer}.monaco-diff-editor .diff-moved-code-block{display:flex;justify-content:flex-end;margin-top:-4px}.monaco-diff-editor .diff-moved-code-block .action-bar .action-label.codicon{width:12px;height:12px;font-size:12px}.monaco-diff-editor .diffOverview{z-index:9}.monaco-diff-editor .diffOverview .diffViewport{z-index:10}.monaco-diff-editor.vs .diffOverview{background:#00000008}.monaco-diff-editor.vs-dark .diffOverview{background:#ffffff03}.monaco-scrollable-element.modified-in-monaco-diff-editor.vs .scrollbar,.monaco-scrollable-element.modified-in-monaco-diff-editor.vs-dark .scrollbar{background:#0000}.monaco-scrollable-element.modified-in-monaco-diff-editor.hc-black .scrollbar,.monaco-scrollable-element.modified-in-monaco-diff-editor.hc-light .scrollbar{background:none}.monaco-scrollable-element.modified-in-monaco-diff-editor .slider{z-index:10}.modified-in-monaco-diff-editor .slider.active{background:#ababab66}.modified-in-monaco-diff-editor.hc-black .slider.active,.modified-in-monaco-diff-editor.hc-light .slider.active{background:none}.monaco-editor .insert-sign,.monaco-diff-editor .insert-sign,.monaco-editor .delete-sign,.monaco-diff-editor .delete-sign{font-size:11px!important;opacity:.7!important;display:flex!important;align-items:center}.monaco-editor.hc-black .insert-sign,.monaco-diff-editor.hc-black .insert-sign,.monaco-editor.hc-black .delete-sign,.monaco-diff-editor.hc-black .delete-sign,.monaco-editor.hc-light .insert-sign,.monaco-diff-editor.hc-light .insert-sign,.monaco-editor.hc-light .delete-sign,.monaco-diff-editor.hc-light .delete-sign{opacity:1}.monaco-editor .inline-deleted-margin-view-zone,.monaco-editor .inline-added-margin-view-zone{text-align:right}.monaco-editor .arrow-revert-change{z-index:10;position:absolute}.monaco-editor .arrow-revert-change:hover{cursor:pointer}.monaco-editor .view-zones .view-lines .view-line span{display:inline-block}.monaco-editor .margin-view-zones .lightbulb-glyph:hover{cursor:pointer}.monaco-editor .char-insert,.monaco-diff-editor .char-insert{background-color:var(--vscode-diffEditor-insertedTextBackground)}.monaco-editor .line-insert,.monaco-diff-editor .line-insert{background-color:var(--vscode-diffEditor-insertedLineBackground, var(--vscode-diffEditor-insertedTextBackground))}.monaco-editor .line-insert,.monaco-editor .char-insert{box-sizing:border-box;border:1px solid var(--vscode-diffEditor-insertedTextBorder)}.monaco-editor.hc-black .line-insert,.monaco-editor.hc-light .line-insert,.monaco-editor.hc-black .char-insert,.monaco-editor.hc-light .char-insert{border-style:dashed}.monaco-editor .line-delete,.monaco-editor .char-delete{box-sizing:border-box;border:1px solid var(--vscode-diffEditor-removedTextBorder)}.monaco-editor.hc-black .line-delete,.monaco-editor.hc-light .line-delete,.monaco-editor.hc-black .char-delete,.monaco-editor.hc-light .char-delete{border-style:dashed}.monaco-editor .inline-added-margin-view-zone,.monaco-editor .gutter-insert,.monaco-diff-editor .gutter-insert{background-color:var(--vscode-diffEditorGutter-insertedLineBackground, var(--vscode-diffEditor-insertedLineBackground), var(--vscode-diffEditor-insertedTextBackground))}.monaco-editor .char-delete,.monaco-diff-editor .char-delete{background-color:var(--vscode-diffEditor-removedTextBackground)}.monaco-editor .line-delete,.monaco-diff-editor .line-delete{background-color:var(--vscode-diffEditor-removedLineBackground, var(--vscode-diffEditor-removedTextBackground))}.monaco-editor .inline-deleted-margin-view-zone,.monaco-editor .gutter-delete,.monaco-diff-editor .gutter-delete{background-color:var(--vscode-diffEditorGutter-removedLineBackground, var(--vscode-diffEditor-removedLineBackground), var(--vscode-diffEditor-removedTextBackground))}.monaco-diff-editor.side-by-side .editor.modified{box-shadow:-6px 0 5px -5px var(--vscode-scrollbar-shadow);border-left:1px solid var(--vscode-diffEditor-border)}.monaco-diff-editor.side-by-side .editor.original{box-shadow:6px 0 5px -5px var(--vscode-scrollbar-shadow);border-right:1px solid var(--vscode-diffEditor-border)}.monaco-diff-editor .diffViewport{background:var(--vscode-scrollbarSlider-background)}.monaco-diff-editor .diffViewport:hover{background:var(--vscode-scrollbarSlider-hoverBackground)}.monaco-diff-editor .diffViewport:active{background:var(--vscode-scrollbarSlider-activeBackground)}.monaco-editor .diagonal-fill{background-image:linear-gradient(-45deg,var(--vscode-diffEditor-diagonalFill) 12.5%,#0000 12.5%,#0000 50%,var(--vscode-diffEditor-diagonalFill) 50%,var(--vscode-diffEditor-diagonalFill) 62.5%,#0000 62.5%,#0000 100%);background-size:8px 8px}.monaco-diff-editor .gutter{position:relative;overflow:hidden;flex-shrink:0;flex-grow:0}.monaco-diff-editor .gutter .gutterItem{opacity:0;transition:opacity .7s}.monaco-diff-editor .gutter .gutterItem.showAlways{opacity:1;transition:none}.monaco-diff-editor .gutter .gutterItem.noTransition{transition:none}.monaco-diff-editor .gutter:hover .gutterItem{opacity:1;transition:opacity .1s ease-in-out}.monaco-diff-editor .gutter .gutterItem .background{position:absolute;height:100%;left:50%;width:1px;border-left:2px var(--vscode-menu-border) solid}.monaco-diff-editor .gutter .gutterItem .buttons{position:absolute;width:100%;display:flex;justify-content:center;align-items:center}.monaco-diff-editor .gutter .gutterItem .buttons .monaco-toolbar{height:-moz-fit-content;height:fit-content}.monaco-diff-editor .gutter .gutterItem .buttons .monaco-toolbar .monaco-action-bar{line-height:1}.monaco-diff-editor .gutter .gutterItem .buttons .monaco-toolbar .monaco-action-bar .actions-container{width:-moz-fit-content;width:fit-content;border-radius:4px;border:1px var(--vscode-menu-border) solid;background:var(--vscode-editor-background)}.monaco-diff-editor .gutter .gutterItem .buttons .monaco-toolbar .monaco-action-bar .actions-container .action-item:hover{background:var(--vscode-toolbar-hoverBackground)}.monaco-diff-editor .gutter .gutterItem .buttons .monaco-toolbar .monaco-action-bar .actions-container .action-item .action-label{padding:.5px 1px}.monaco-component.diff-review{-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-user-select:none;z-index:99}.monaco-diff-editor .diff-review{position:absolute}.monaco-component.diff-review .diff-review-line-number{text-align:right;display:inline-block;color:var(--vscode-editorLineNumber-foreground)}.monaco-component.diff-review .diff-review-summary{padding-left:10px}.monaco-component.diff-review .diff-review-shadow{position:absolute;box-shadow:var(--vscode-scrollbar-shadow) 0 -6px 6px -6px inset}.monaco-component.diff-review .diff-review-row{white-space:pre}.monaco-component.diff-review .diff-review-table{display:table;min-width:100%}.monaco-component.diff-review .diff-review-row{display:table-row;width:100%}.monaco-component.diff-review .diff-review-spacer{display:inline-block;width:10px;vertical-align:middle}.monaco-component.diff-review .diff-review-spacer>.codicon{font-size:9px!important}.monaco-component.diff-review .diff-review-actions{display:inline-block;position:absolute;right:10px;top:2px;z-index:100}.monaco-component.diff-review .diff-review-actions .action-label{width:16px;height:16px;margin:2px 0}.monaco-component.diff-review .revertButton{cursor:pointer}.monaco-toolbar{height:100%}.monaco-toolbar .toolbar-toggle-more{display:inline-block;padding:0}.monaco-component.multiDiffEditor{background:var(--vscode-multiDiffEditor-background);overflow-y:hidden}.monaco-component.multiDiffEditor .active{--vscode-multiDiffEditor-border: var(--vscode-focusBorder)}.monaco-component.multiDiffEditor .multiDiffEntry{display:flex;flex-direction:column;flex:1;overflow:hidden}.monaco-component.multiDiffEditor .multiDiffEntry .collapse-button{margin:0 5px;cursor:pointer}.monaco-component.multiDiffEditor .multiDiffEntry .collapse-button a{display:block}.monaco-component.multiDiffEditor .multiDiffEntry .header{z-index:1000;background:var(--vscode-editor-background)}.monaco-component.multiDiffEditor .multiDiffEntry .header:not(.collapsed) .header-content{border-bottom:1px solid var(--vscode-sideBarSectionHeader-border)}.monaco-component.multiDiffEditor .multiDiffEntry .header .header-content{margin:8px 0 0;padding:4px 5px;border-top:1px solid var(--vscode-multiDiffEditor-border);display:flex;align-items:center;color:var(--vscode-foreground);background:var(--vscode-multiDiffEditor-headerBackground)}.monaco-component.multiDiffEditor .multiDiffEntry .header .header-content.shadow{box-shadow:var(--vscode-scrollbar-shadow) 0 6px 6px -6px}.monaco-component.multiDiffEditor .multiDiffEntry .header .header-content .file-path{display:flex;flex:1;min-width:0}.monaco-component.multiDiffEditor .multiDiffEntry .header .header-content .file-path .title{font-size:14px;line-height:22px}.monaco-component.multiDiffEditor .multiDiffEntry .header .header-content .file-path .title.original{flex:1;min-width:0;text-overflow:ellipsis}.monaco-component.multiDiffEditor .multiDiffEntry .header .header-content .file-path .status{font-weight:600;opacity:.75;margin:0 10px;line-height:22px}.monaco-component.multiDiffEditor .multiDiffEntry .header .header-content .actions{padding:0 8px}.monaco-component.multiDiffEditor .multiDiffEntry .editorParent{flex:1;display:flex;flex-direction:column;border-bottom:1px solid var(--vscode-multiDiffEditor-border);overflow:hidden}.monaco-component.multiDiffEditor .multiDiffEntry .editorContainer{flex:1}.monaco-editor .selection-anchor{background-color:#007acc;width:2px!important}.monaco-editor .bracket-match{box-sizing:border-box;background-color:var(--vscode-editorBracketMatch-background);border:1px solid var(--vscode-editorBracketMatch-border)}.inline-editor-progress-decoration{display:inline-block;width:1em;height:1em}.inline-progress-widget{display:flex!important;justify-content:center;align-items:center}.inline-progress-widget .icon{font-size:80%!important}.inline-progress-widget:hover .icon{font-size:90%!important;animation:none}.inline-progress-widget:hover .icon:before{content:var(--vscode-icon-x-content);font-family:var(--vscode-icon-x-font-family)}.monaco-editor .monaco-editor-overlaymessage{padding-bottom:8px;z-index:10000}.monaco-editor .monaco-editor-overlaymessage.below{padding-bottom:0;padding-top:8px;z-index:10000}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.monaco-editor .monaco-editor-overlaymessage.fadeIn{animation:fadeIn .15s ease-out}@keyframes fadeOut{0%{opacity:1}to{opacity:0}}.monaco-editor .monaco-editor-overlaymessage.fadeOut{animation:fadeOut .1s ease-out}.monaco-editor .monaco-editor-overlaymessage .message{padding:2px 4px;color:var(--vscode-editorHoverWidget-foreground);background-color:var(--vscode-editorHoverWidget-background);border:1px solid var(--vscode-inputValidation-infoBorder);border-radius:3px}.monaco-editor .monaco-editor-overlaymessage .message p{margin-block:0px}.monaco-editor .monaco-editor-overlaymessage .message a{color:var(--vscode-textLink-foreground)}.monaco-editor .monaco-editor-overlaymessage .message a:hover{color:var(--vscode-textLink-activeForeground)}.monaco-editor.hc-black .monaco-editor-overlaymessage .message,.monaco-editor.hc-light .monaco-editor-overlaymessage .message{border-width:2px}.monaco-editor .monaco-editor-overlaymessage .anchor{width:0!important;height:0!important;border-color:transparent;border-style:solid;z-index:1000;border-width:8px;position:absolute;left:2px}.monaco-editor .monaco-editor-overlaymessage .anchor.top{border-bottom-color:var(--vscode-inputValidation-infoBorder)}.monaco-editor .monaco-editor-overlaymessage .anchor.below{border-top-color:var(--vscode-inputValidation-infoBorder)}.monaco-editor .monaco-editor-overlaymessage:not(.below) .anchor.top,.monaco-editor .monaco-editor-overlaymessage.below .anchor.below{display:none}.monaco-editor .monaco-editor-overlaymessage.below .anchor.top{display:inherit;top:-8px}.post-edit-widget{box-shadow:0 0 8px 2px var(--vscode-widget-shadow);border:1px solid var(--vscode-widget-border, transparent);border-radius:4px;background-color:var(--vscode-editorWidget-background);overflow:hidden}.post-edit-widget .monaco-button{padding:2px;border:none;border-radius:0}.post-edit-widget .monaco-button:hover{background-color:var(--vscode-button-secondaryHoverBackground)!important}.post-edit-widget .monaco-button .codicon{margin:0}@font-face{font-family:codicon;font-display:block;src:url(/assets/codicon-B16ygVZF.ttf) format("truetype")}.codicon[class*=codicon-]{font: 16px/1 codicon;display:inline-block;text-decoration:none;text-rendering:auto;text-align:center;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-user-select:none}.codicon-wrench-subaction{opacity:.5}@keyframes codicon-spin{to{transform:rotate(360deg)}}.codicon-sync.codicon-modifier-spin,.codicon-loading.codicon-modifier-spin,.codicon-gear.codicon-modifier-spin,.codicon-notebook-state-executing.codicon-modifier-spin{animation:codicon-spin 1.5s steps(30) infinite}.codicon-modifier-disabled{opacity:.4}.codicon-loading,.codicon-tree-item-loading:before{animation-duration:1s!important;animation-timing-function:cubic-bezier(.53,.21,.29,.67)!important}.monaco-editor .codicon.codicon-symbol-array,.monaco-workbench .codicon.codicon-symbol-array{color:var(--vscode-symbolIcon-arrayForeground)}.monaco-editor .codicon.codicon-symbol-boolean,.monaco-workbench .codicon.codicon-symbol-boolean{color:var(--vscode-symbolIcon-booleanForeground)}.monaco-editor .codicon.codicon-symbol-class,.monaco-workbench .codicon.codicon-symbol-class{color:var(--vscode-symbolIcon-classForeground)}.monaco-editor .codicon.codicon-symbol-method,.monaco-workbench .codicon.codicon-symbol-method{color:var(--vscode-symbolIcon-methodForeground)}.monaco-editor .codicon.codicon-symbol-color,.monaco-workbench .codicon.codicon-symbol-color{color:var(--vscode-symbolIcon-colorForeground)}.monaco-editor .codicon.codicon-symbol-constant,.monaco-workbench .codicon.codicon-symbol-constant{color:var(--vscode-symbolIcon-constantForeground)}.monaco-editor .codicon.codicon-symbol-constructor,.monaco-workbench .codicon.codicon-symbol-constructor{color:var(--vscode-symbolIcon-constructorForeground)}.monaco-editor .codicon.codicon-symbol-value,.monaco-workbench .codicon.codicon-symbol-value,.monaco-editor .codicon.codicon-symbol-enum,.monaco-workbench .codicon.codicon-symbol-enum{color:var(--vscode-symbolIcon-enumeratorForeground)}.monaco-editor .codicon.codicon-symbol-enum-member,.monaco-workbench .codicon.codicon-symbol-enum-member{color:var(--vscode-symbolIcon-enumeratorMemberForeground)}.monaco-editor .codicon.codicon-symbol-event,.monaco-workbench .codicon.codicon-symbol-event{color:var(--vscode-symbolIcon-eventForeground)}.monaco-editor .codicon.codicon-symbol-field,.monaco-workbench .codicon.codicon-symbol-field{color:var(--vscode-symbolIcon-fieldForeground)}.monaco-editor .codicon.codicon-symbol-file,.monaco-workbench .codicon.codicon-symbol-file{color:var(--vscode-symbolIcon-fileForeground)}.monaco-editor .codicon.codicon-symbol-folder,.monaco-workbench .codicon.codicon-symbol-folder{color:var(--vscode-symbolIcon-folderForeground)}.monaco-editor .codicon.codicon-symbol-function,.monaco-workbench .codicon.codicon-symbol-function{color:var(--vscode-symbolIcon-functionForeground)}.monaco-editor .codicon.codicon-symbol-interface,.monaco-workbench .codicon.codicon-symbol-interface{color:var(--vscode-symbolIcon-interfaceForeground)}.monaco-editor .codicon.codicon-symbol-key,.monaco-workbench .codicon.codicon-symbol-key{color:var(--vscode-symbolIcon-keyForeground)}.monaco-editor .codicon.codicon-symbol-keyword,.monaco-workbench .codicon.codicon-symbol-keyword{color:var(--vscode-symbolIcon-keywordForeground)}.monaco-editor .codicon.codicon-symbol-module,.monaco-workbench .codicon.codicon-symbol-module{color:var(--vscode-symbolIcon-moduleForeground)}.monaco-editor .codicon.codicon-symbol-namespace,.monaco-workbench .codicon.codicon-symbol-namespace{color:var(--vscode-symbolIcon-namespaceForeground)}.monaco-editor .codicon.codicon-symbol-null,.monaco-workbench .codicon.codicon-symbol-null{color:var(--vscode-symbolIcon-nullForeground)}.monaco-editor .codicon.codicon-symbol-number,.monaco-workbench .codicon.codicon-symbol-number{color:var(--vscode-symbolIcon-numberForeground)}.monaco-editor .codicon.codicon-symbol-object,.monaco-workbench .codicon.codicon-symbol-object{color:var(--vscode-symbolIcon-objectForeground)}.monaco-editor .codicon.codicon-symbol-operator,.monaco-workbench .codicon.codicon-symbol-operator{color:var(--vscode-symbolIcon-operatorForeground)}.monaco-editor .codicon.codicon-symbol-package,.monaco-workbench .codicon.codicon-symbol-package{color:var(--vscode-symbolIcon-packageForeground)}.monaco-editor .codicon.codicon-symbol-property,.monaco-workbench .codicon.codicon-symbol-property{color:var(--vscode-symbolIcon-propertyForeground)}.monaco-editor .codicon.codicon-symbol-reference,.monaco-workbench .codicon.codicon-symbol-reference{color:var(--vscode-symbolIcon-referenceForeground)}.monaco-editor .codicon.codicon-symbol-snippet,.monaco-workbench .codicon.codicon-symbol-snippet{color:var(--vscode-symbolIcon-snippetForeground)}.monaco-editor .codicon.codicon-symbol-string,.monaco-workbench .codicon.codicon-symbol-string{color:var(--vscode-symbolIcon-stringForeground)}.monaco-editor .codicon.codicon-symbol-struct,.monaco-workbench .codicon.codicon-symbol-struct{color:var(--vscode-symbolIcon-structForeground)}.monaco-editor .codicon.codicon-symbol-text,.monaco-workbench .codicon.codicon-symbol-text{color:var(--vscode-symbolIcon-textForeground)}.monaco-editor .codicon.codicon-symbol-type-parameter,.monaco-workbench .codicon.codicon-symbol-type-parameter{color:var(--vscode-symbolIcon-typeParameterForeground)}.monaco-editor .codicon.codicon-symbol-unit,.monaco-workbench .codicon.codicon-symbol-unit{color:var(--vscode-symbolIcon-unitForeground)}.monaco-editor .codicon.codicon-symbol-variable,.monaco-workbench .codicon.codicon-symbol-variable{color:var(--vscode-symbolIcon-variableForeground)}.monaco-editor .lightBulbWidget{display:flex;align-items:center;justify-content:center}.monaco-editor .lightBulbWidget:hover{cursor:pointer}.monaco-editor .lightBulbWidget.codicon-light-bulb,.monaco-editor .lightBulbWidget.codicon-lightbulb-sparkle{color:var(--vscode-editorLightBulb-foreground)}.monaco-editor .lightBulbWidget.codicon-lightbulb-autofix,.monaco-editor .lightBulbWidget.codicon-lightbulb-sparkle-autofix{color:var(--vscode-editorLightBulbAutoFix-foreground, var(--vscode-editorLightBulb-foreground))}.monaco-editor .lightBulbWidget.codicon-sparkle-filled{color:var(--vscode-editorLightBulbAi-foreground, var(--vscode-icon-foreground))}.monaco-editor .lightBulbWidget:before{position:relative;z-index:2}.monaco-editor .lightBulbWidget:after{position:absolute;top:0;left:0;content:"";display:block;width:100%;height:100%;opacity:.3;background-color:var(--vscode-editor-background);z-index:1}.action-widget{font-size:13px;min-width:160px;max-width:80vw;z-index:40;display:block;width:100%;border:1px solid var(--vscode-editorWidget-border)!important;border-radius:2px;background-color:var(--vscode-editorWidget-background);color:var(--vscode-editorWidget-foreground)}.context-view-block{position:fixed;cursor:initial;left:0;top:0;width:100%;height:100%;z-index:-1}.context-view-pointerBlock{position:fixed;cursor:initial;left:0;top:0;width:100%;height:100%;z-index:2}.action-widget .monaco-list{-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-user-select:none;border:none!important;border-width:0!important}.action-widget .monaco-list:focus:before{outline:0!important}.action-widget .monaco-list .monaco-scrollable-element{overflow:visible}.action-widget .monaco-list .monaco-list-row{padding:0 10px;white-space:nowrap;cursor:pointer;touch-action:none;width:100%}.action-widget .monaco-list .monaco-list-row.action.focused:not(.option-disabled){background-color:var(--vscode-quickInputList-focusBackground)!important;color:var(--vscode-quickInputList-focusForeground);outline:1px solid var(--vscode-menu-selectionBorder, transparent);outline-offset:-1px}.action-widget .monaco-list-row.group-header{color:var(--vscode-descriptionForeground)!important;font-weight:600}.action-widget .monaco-list .group-header,.action-widget .monaco-list .option-disabled,.action-widget .monaco-list .option-disabled:before,.action-widget .monaco-list .option-disabled .focused,.action-widget .monaco-list .option-disabled .focused:before{cursor:default!important;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-color:transparent!important;outline:0 solid!important}.action-widget .monaco-list-row.action{display:flex;gap:6px;align-items:center}.action-widget .monaco-list-row.action.option-disabled,.action-widget .monaco-list:focus .monaco-list-row.focused.action.option-disabled,.action-widget .monaco-list-row.action.option-disabled .codicon,.action-widget .monaco-list:not(.drop-target):not(.dragging) .monaco-list-row:hover:not(.selected):not(.focused).option-disabled{color:var(--vscode-disabledForeground)}.action-widget .monaco-list-row.action:not(.option-disabled) .codicon{color:inherit}.action-widget .monaco-list-row.action .title{flex:1;overflow:hidden;text-overflow:ellipsis}.action-widget .monaco-list-row.action .monaco-keybinding>.monaco-keybinding-key{background-color:var(--vscode-keybindingLabel-background);color:var(--vscode-keybindingLabel-foreground);border-style:solid;border-width:1px;border-radius:3px;border-color:var(--vscode-keybindingLabel-border);border-bottom-color:var(--vscode-keybindingLabel-bottomBorder);box-shadow:inset 0 -1px 0 var(--vscode-widget-shadow)}.action-widget .action-widget-action-bar{background-color:var(--vscode-editorHoverWidget-statusBarBackground);border-top:1px solid var(--vscode-editorHoverWidget-border)}.action-widget .action-widget-action-bar:before{display:block;content:"";width:100%}.action-widget .action-widget-action-bar .actions-container{padding:0 8px}.action-widget-action-bar .action-label{color:var(--vscode-textLink-activeForeground);font-size:12px;line-height:22px;padding:0;pointer-events:all}.action-widget-action-bar .action-item{margin-right:16px;pointer-events:none}.action-widget-action-bar .action-label:hover{background-color:transparent!important}.monaco-action-bar .actions-container.highlight-toggled .action-label.checked{background:var(--vscode-actionBar-toggledBackground)!important}.monaco-editor .codelens-decoration{overflow:hidden;display:inline-block;text-overflow:ellipsis;white-space:nowrap;color:var(--vscode-editorCodeLens-foreground);line-height:var(--vscode-editorCodeLens-lineHeight);font-size:var(--vscode-editorCodeLens-fontSize);padding-right:calc(var(--vscode-editorCodeLens-fontSize)*.5);font-feature-settings:var(--vscode-editorCodeLens-fontFeatureSettings);font-family:var(--vscode-editorCodeLens-fontFamily),var(--vscode-editorCodeLens-fontFamilyDefault)}.monaco-editor .codelens-decoration>span,.monaco-editor .codelens-decoration>a{-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-user-select:none;white-space:nowrap;vertical-align:sub}.monaco-editor .codelens-decoration>a{text-decoration:none}.monaco-editor .codelens-decoration>a:hover{cursor:pointer;color:var(--vscode-editorLink-activeForeground)!important}.monaco-editor .codelens-decoration>a:hover .codicon{color:var(--vscode-editorLink-activeForeground)!important}.monaco-editor .codelens-decoration .codicon{vertical-align:middle;color:currentColor!important;color:var(--vscode-editorCodeLens-foreground);line-height:var(--vscode-editorCodeLens-lineHeight);font-size:var(--vscode-editorCodeLens-fontSize)}.monaco-editor .codelens-decoration>a:hover .codicon:before{cursor:pointer}@keyframes fadein{0%{opacity:0;visibility:visible}to{opacity:1}}.monaco-editor .codelens-decoration.fadein{animation:fadein .1s linear}.colorpicker-widget{height:190px;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-user-select:none}.colorpicker-color-decoration,.hc-light .colorpicker-color-decoration{border:solid .1em #000;box-sizing:border-box;margin:.1em .2em 0;width:.8em;height:.8em;line-height:.8em;display:inline-block;cursor:pointer}.hc-black .colorpicker-color-decoration,.vs-dark .colorpicker-color-decoration{border:solid .1em #eee}.colorpicker-header{display:flex;height:24px;position:relative;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAYAAACp8Z5+AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAZdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuMTZEaa/1AAAAHUlEQVQYV2PYvXu3JAi7uLiAMaYAjAGTQBPYLQkAa/0Zef3qRswAAAAASUVORK5CYII=);background-size:9px 9px;image-rendering:-moz-crisp-edges;image-rendering:pixelated}.colorpicker-header .picked-color{width:240px;display:flex;align-items:center;justify-content:center;line-height:24px;cursor:pointer;color:#fff;flex:1;white-space:nowrap;overflow:hidden}.colorpicker-header .picked-color .picked-color-presentation{white-space:nowrap;margin-left:5px;margin-right:5px}.colorpicker-header .picked-color .codicon{color:inherit;font-size:14px}.colorpicker-header .picked-color.light{color:#000}.colorpicker-header .original-color{width:74px;z-index:inherit;cursor:pointer}.standalone-colorpicker{color:var(--vscode-editorHoverWidget-foreground);background-color:var(--vscode-editorHoverWidget-background);border:1px solid var(--vscode-editorHoverWidget-border)}.colorpicker-header.standalone-colorpicker{border-bottom:none}.colorpicker-header .close-button{cursor:pointer;background-color:var(--vscode-editorHoverWidget-background);border-left:1px solid var(--vscode-editorHoverWidget-border)}.colorpicker-header .close-button-inner-div{width:100%;height:100%;text-align:center}.colorpicker-header .close-button-inner-div:hover{background-color:var(--vscode-toolbar-hoverBackground)}.colorpicker-header .close-icon{padding:3px}.colorpicker-body{display:flex;padding:8px;position:relative}.colorpicker-body .saturation-wrap{overflow:hidden;height:150px;position:relative;min-width:220px;flex:1}.colorpicker-body .saturation-box{height:150px;position:absolute}.colorpicker-body .saturation-selection{width:9px;height:9px;margin:-5px 0 0 -5px;border:1px solid rgb(255,255,255);border-radius:100%;box-shadow:0 0 2px #000c;position:absolute}.colorpicker-body .strip{width:25px;height:150px}.colorpicker-body .standalone-strip{width:25px;height:122px}.colorpicker-body .hue-strip{position:relative;margin-left:8px;cursor:-webkit-grab;cursor:grab;background:linear-gradient(to bottom,red,#ff0 17%,#0f0 33%,#0ff,#00f 67%,#f0f 83%,red)}.colorpicker-body .opacity-strip{position:relative;margin-left:8px;cursor:-webkit-grab;cursor:grab;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAYAAACp8Z5+AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAZdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuMTZEaa/1AAAAHUlEQVQYV2PYvXu3JAi7uLiAMaYAjAGTQBPYLQkAa/0Zef3qRswAAAAASUVORK5CYII=);background-size:9px 9px;image-rendering:-moz-crisp-edges;image-rendering:pixelated}.colorpicker-body .strip.grabbing{cursor:-webkit-grabbing;cursor:grabbing}.colorpicker-body .slider{position:absolute;top:0;left:-2px;width:calc(100% + 4px);height:4px;box-sizing:border-box;border:1px solid rgba(255,255,255,.71);box-shadow:0 0 1px #000000d9}.colorpicker-body .strip .overlay{height:150px;pointer-events:none}.colorpicker-body .standalone-strip .standalone-overlay{height:122px;pointer-events:none}.standalone-colorpicker-body{display:block;border:1px solid transparent;border-bottom:1px solid var(--vscode-editorHoverWidget-border);overflow:hidden}.colorpicker-body .insert-button{position:absolute;height:20px;width:58px;padding:0;right:8px;bottom:8px;background:var(--vscode-button-background);color:var(--vscode-button-foreground);border-radius:2px;border:none;cursor:pointer}.colorpicker-body .insert-button:hover{background:var(--vscode-button-hoverBackground)}.monaco-editor .inlineSuggestionsHints.withBorder{z-index:39;color:var(--vscode-editorHoverWidget-foreground);background-color:var(--vscode-editorHoverWidget-background);border:1px solid var(--vscode-editorHoverWidget-border)}.monaco-editor .inlineSuggestionsHints a,.monaco-editor .inlineSuggestionsHints a:hover{color:var(--vscode-foreground)}.monaco-editor .inlineSuggestionsHints .keybinding{display:flex;margin-left:4px;opacity:.6}.monaco-editor .inlineSuggestionsHints .keybinding .monaco-keybinding-key{font-size:8px;padding:2px 3px}.monaco-editor .inlineSuggestionsHints .availableSuggestionCount a{display:flex;min-width:19px;justify-content:center}.monaco-editor .inlineSuggestionStatusBarItemLabel{margin-right:2px}.monaco-editor .peekview-widget .head{box-sizing:border-box;display:flex;justify-content:space-between;flex-wrap:nowrap}.monaco-editor .peekview-widget .head .peekview-title{display:flex;align-items:baseline;font-size:13px;margin-left:20px;min-width:0;text-overflow:ellipsis;overflow:hidden}.monaco-editor .peekview-widget .head .peekview-title.clickable{cursor:pointer}.monaco-editor .peekview-widget .head .peekview-title .dirname:not(:empty){font-size:.9em;margin-left:.5em}.monaco-editor .peekview-widget .head .peekview-title .meta{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.monaco-editor .peekview-widget .head .peekview-title .dirname,.monaco-editor .peekview-widget .head .peekview-title .filename{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.monaco-editor .peekview-widget .head .peekview-title .meta:not(:empty):before{content:"-";padding:0 .3em}.monaco-editor .peekview-widget .head .peekview-actions{flex:1;text-align:right;padding-right:2px}.monaco-editor .peekview-widget .head .peekview-actions>.monaco-action-bar{display:inline-block}.monaco-editor .peekview-widget .head .peekview-actions>.monaco-action-bar,.monaco-editor .peekview-widget .head .peekview-actions>.monaco-action-bar>.actions-container{height:100%}.monaco-editor .peekview-widget>.body{border-top:1px solid;position:relative}.monaco-editor .peekview-widget .head .peekview-title .codicon{margin-right:4px;align-self:center}.monaco-editor .peekview-widget .monaco-list .monaco-list-row.focused .codicon{color:inherit!important}.monaco-editor .zone-widget{position:absolute;z-index:10}.monaco-editor .zone-widget .zone-widget-container{border-top-style:solid;border-bottom-style:solid;border-top-width:0;border-bottom-width:0;position:relative}.monaco-editor .zone-widget .zone-widget-container.reference-zone-widget{border-top-width:1px;border-bottom-width:1px}.monaco-editor .reference-zone-widget .inline{display:inline-block;vertical-align:top}.monaco-editor .reference-zone-widget .messages{height:100%;width:100%;text-align:center;padding:3em 0}.monaco-editor .reference-zone-widget .ref-tree{line-height:23px;background-color:var(--vscode-peekViewResult-background);color:var(--vscode-peekViewResult-lineForeground)}.monaco-editor .reference-zone-widget .ref-tree .reference{text-overflow:ellipsis;overflow:hidden}.monaco-editor .reference-zone-widget .ref-tree .reference-file{display:inline-flex;width:100%;height:100%;color:var(--vscode-peekViewResult-fileForeground)}.monaco-editor .reference-zone-widget .ref-tree .monaco-list:focus .selected .reference-file{color:inherit!important}.monaco-editor .reference-zone-widget .ref-tree .monaco-list:focus .monaco-list-rows>.monaco-list-row.selected:not(.highlighted){background-color:var(--vscode-peekViewResult-selectionBackground);color:var(--vscode-peekViewResult-selectionForeground)!important}.monaco-editor .reference-zone-widget .ref-tree .reference-file .count{margin-right:12px;margin-left:auto}.monaco-editor .reference-zone-widget .ref-tree .referenceMatch .highlight{background-color:var(--vscode-peekViewResult-matchHighlightBackground)}.monaco-editor .reference-zone-widget .preview .reference-decoration{background-color:var(--vscode-peekViewEditor-matchHighlightBackground);border:2px solid var(--vscode-peekViewEditor-matchHighlightBorder);box-sizing:border-box}.monaco-editor .reference-zone-widget .preview .monaco-editor .monaco-editor-background,.monaco-editor .reference-zone-widget .preview .monaco-editor .inputarea.ime-input{background-color:var(--vscode-peekViewEditor-background)}.monaco-editor .reference-zone-widget .preview .monaco-editor .margin{background-color:var(--vscode-peekViewEditorGutter-background)}.monaco-editor.hc-black .reference-zone-widget .ref-tree .reference-file,.monaco-editor.hc-light .reference-zone-widget .ref-tree .reference-file{font-weight:700}.monaco-editor.hc-black .reference-zone-widget .ref-tree .referenceMatch .highlight,.monaco-editor.hc-light .reference-zone-widget .ref-tree .referenceMatch .highlight{border:1px dotted var(--vscode-contrastActiveBorder, transparent);box-sizing:border-box}.monaco-editor .hoverHighlight{background-color:var(--vscode-editor-hoverHighlightBackground)}.monaco-editor .monaco-hover{color:var(--vscode-editorHoverWidget-foreground);background-color:var(--vscode-editorHoverWidget-background);border:1px solid var(--vscode-editorHoverWidget-border);border-radius:3px}.monaco-editor .monaco-hover a{color:var(--vscode-textLink-foreground)}.monaco-editor .monaco-hover a:hover{color:var(--vscode-textLink-activeForeground)}.monaco-editor .monaco-hover .hover-row{display:flex}.monaco-editor .monaco-hover .hover-row .hover-row-contents{min-width:0;display:flex;flex-direction:column}.monaco-editor .monaco-hover .hover-row .verbosity-actions{display:flex;flex-direction:column;padding-left:5px;padding-right:5px;justify-content:end;border-right:1px solid var(--vscode-editorHoverWidget-border)}.monaco-editor .monaco-hover .hover-row .verbosity-actions .codicon{cursor:pointer;font-size:11px}.monaco-editor .monaco-hover .hover-row .verbosity-actions .codicon.enabled{color:var(--vscode-textLink-foreground)}.monaco-editor .monaco-hover .hover-row .verbosity-actions .codicon.disabled{opacity:.6}.monaco-editor .monaco-hover .hover-row .actions{background-color:var(--vscode-editorHoverWidget-statusBarBackground)}.monaco-editor .monaco-hover code{background-color:var(--vscode-textCodeBlock-background)}.monaco-editor.vs .dnd-target,.monaco-editor.hc-light .dnd-target{border-right:2px dotted black;color:#fff}.monaco-editor.vs-dark .dnd-target{border-right:2px dotted #AEAFAD;color:#51504f}.monaco-editor.hc-black .dnd-target{border-right:2px dotted #fff;color:#000}.monaco-editor.mouse-default .view-lines,.monaco-editor.vs-dark.mac.mouse-default .view-lines,.monaco-editor.hc-black.mac.mouse-default .view-lines,.monaco-editor.hc-light.mac.mouse-default .view-lines{cursor:default}.monaco-editor.mouse-copy .view-lines,.monaco-editor.vs-dark.mac.mouse-copy .view-lines,.monaco-editor.hc-black.mac.mouse-copy .view-lines,.monaco-editor.hc-light.mac.mouse-copy .view-lines{cursor:copy}.monaco-editor .findOptionsWidget{background-color:var(--vscode-editorWidget-background);color:var(--vscode-editorWidget-foreground);box-shadow:0 0 8px 2px var(--vscode-widget-shadow);border:2px solid var(--vscode-contrastBorder)}.monaco-editor .find-widget{position:absolute;z-index:35;height:33px;overflow:hidden;line-height:19px;transition:transform .2s linear;padding:0 4px;box-sizing:border-box;transform:translateY(calc(-100% - 10px));box-shadow:0 0 8px 2px var(--vscode-widget-shadow);color:var(--vscode-editorWidget-foreground);border-left:1px solid var(--vscode-widget-border);border-right:1px solid var(--vscode-widget-border);border-bottom:1px solid var(--vscode-widget-border);border-bottom-left-radius:4px;border-bottom-right-radius:4px;background-color:var(--vscode-editorWidget-background)}.monaco-workbench.reduce-motion .monaco-editor .find-widget{transition:transform 0ms linear}.monaco-editor .find-widget textarea{margin:0}.monaco-editor .find-widget.hiddenEditor{display:none}.monaco-editor .find-widget.replaceToggled>.replace-part{display:flex}.monaco-editor .find-widget.visible{transform:translateY(0)}.monaco-editor .find-widget .monaco-inputbox.synthetic-focus{outline:1px solid -webkit-focus-ring-color;outline-offset:-1px;outline-color:var(--vscode-focusBorder)}.monaco-editor .find-widget .monaco-inputbox .input{background-color:transparent;min-height:0}.monaco-editor .find-widget .monaco-findInput .input{font-size:13px}.monaco-editor .find-widget>.find-part,.monaco-editor .find-widget>.replace-part{margin:3px 25px 0 17px;font-size:12px;display:flex}.monaco-editor .find-widget>.find-part .monaco-inputbox,.monaco-editor .find-widget>.replace-part .monaco-inputbox{min-height:25px}.monaco-editor .find-widget>.replace-part .monaco-inputbox>.ibwrapper>.mirror{padding-right:22px}.monaco-editor .find-widget>.find-part .monaco-inputbox>.ibwrapper>.input,.monaco-editor .find-widget>.find-part .monaco-inputbox>.ibwrapper>.mirror,.monaco-editor .find-widget>.replace-part .monaco-inputbox>.ibwrapper>.input,.monaco-editor .find-widget>.replace-part .monaco-inputbox>.ibwrapper>.mirror{padding-top:2px;padding-bottom:2px}.monaco-editor .find-widget>.find-part .find-actions{height:25px;display:flex;align-items:center}.monaco-editor .find-widget>.replace-part .replace-actions{height:25px;display:flex;align-items:center}.monaco-editor .find-widget .monaco-findInput{vertical-align:middle;display:flex;flex:1}.monaco-editor .find-widget .monaco-findInput .monaco-scrollable-element{width:100%}.monaco-editor .find-widget .monaco-findInput .monaco-scrollable-element .scrollbar.vertical{opacity:0}.monaco-editor .find-widget .matchesCount{display:flex;flex:initial;margin:0 0 0 3px;padding:2px 0 0 2px;height:25px;vertical-align:middle;box-sizing:border-box;text-align:center;line-height:23px}.monaco-editor .find-widget .button{width:16px;height:16px;padding:3px;border-radius:5px;flex:initial;margin-left:3px;background-position:center center;background-repeat:no-repeat;cursor:pointer;display:flex;align-items:center;justify-content:center}.monaco-editor .find-widget .codicon-find-selection{width:22px;height:22px;padding:3px;border-radius:5px}.monaco-editor .find-widget .button.left{margin-left:0;margin-right:3px}.monaco-editor .find-widget .button.wide{width:auto;padding:1px 6px;top:-1px}.monaco-editor .find-widget .button.toggle{position:absolute;top:0;left:3px;width:18px;height:100%;border-radius:0;box-sizing:border-box}.monaco-editor .find-widget .button.toggle.disabled{display:none}.monaco-editor .find-widget .disabled{color:var(--vscode-disabledForeground);cursor:default}.monaco-editor .find-widget>.replace-part{display:none}.monaco-editor .find-widget>.replace-part>.monaco-findInput{position:relative;display:flex;vertical-align:middle;flex:auto;flex-grow:0;flex-shrink:0}.monaco-editor .find-widget>.replace-part>.monaco-findInput>.controls{position:absolute;top:3px;right:2px}.monaco-editor .find-widget.reduced-find-widget .matchesCount{display:none}.monaco-editor .find-widget.narrow-find-widget{max-width:257px!important}.monaco-editor .find-widget.collapsed-find-widget{max-width:170px!important}.monaco-editor .find-widget.collapsed-find-widget .button.previous,.monaco-editor .find-widget.collapsed-find-widget .button.next,.monaco-editor .find-widget.collapsed-find-widget .button.replace,.monaco-editor .find-widget.collapsed-find-widget .button.replace-all,.monaco-editor .find-widget.collapsed-find-widget>.find-part .monaco-findInput .controls{display:none}.monaco-editor .find-widget.no-results .matchesCount{color:var(--vscode-errorForeground)}.monaco-editor .findMatch{animation-duration:0;animation-name:inherit!important;background-color:var(--vscode-editor-findMatchHighlightBackground)}.monaco-editor .currentFindMatch{background-color:var(--vscode-editor-findMatchBackground);border:2px solid var(--vscode-editor-findMatchBorder);padding:1px;box-sizing:border-box}.monaco-editor .findScope{background-color:var(--vscode-editor-findRangeHighlightBackground)}.monaco-editor .find-widget .monaco-sash{left:0!important;background-color:var(--vscode-editorWidget-resizeBorder, var(--vscode-editorWidget-border))}.monaco-editor.hc-black .find-widget .button:before{position:relative;top:1px;left:2px}.monaco-editor .find-widget .button:not(.disabled):hover,.monaco-editor .find-widget .codicon-find-selection:hover{background-color:var(--vscode-toolbar-hoverBackground)!important}.monaco-editor.findMatch{background-color:var(--vscode-editor-findMatchHighlightBackground)}.monaco-editor.currentFindMatch{background-color:var(--vscode-editor-findMatchBackground)}.monaco-editor.findScope{background-color:var(--vscode-editor-findRangeHighlightBackground)}.monaco-editor.findMatch{background-color:var(--vscode-editorWidget-background)}.monaco-editor .find-widget>.button.codicon-widget-close{position:absolute;top:5px;right:4px}.monaco-editor .margin-view-overlays .codicon-folding-manual-collapsed,.monaco-editor .margin-view-overlays .codicon-folding-manual-expanded,.monaco-editor .margin-view-overlays .codicon-folding-expanded,.monaco-editor .margin-view-overlays .codicon-folding-collapsed{cursor:pointer;opacity:0;transition:opacity .5s;display:flex;align-items:center;justify-content:center;font-size:140%;margin-left:2px}.monaco-workbench.reduce-motion .monaco-editor .margin-view-overlays .codicon-folding-manual-collapsed,.monaco-workbench.reduce-motion .monaco-editor .margin-view-overlays .codicon-folding-manual-expanded,.monaco-workbench.reduce-motion .monaco-editor .margin-view-overlays .codicon-folding-expanded,.monaco-workbench.reduce-motion .monaco-editor .margin-view-overlays .codicon-folding-collapsed{transition:initial}.monaco-editor .margin-view-overlays:hover .codicon,.monaco-editor .margin-view-overlays .codicon.codicon-folding-collapsed,.monaco-editor .margin-view-overlays .codicon.codicon-folding-manual-collapsed,.monaco-editor .margin-view-overlays .codicon.alwaysShowFoldIcons{opacity:1}.monaco-editor .inline-folded:after{color:gray;margin:.1em .2em 0;content:"⋯";display:inline;line-height:1em;cursor:pointer}.monaco-editor .folded-background{background-color:var(--vscode-editor-foldBackground)}.monaco-editor .cldr.codicon.codicon-folding-expanded,.monaco-editor .cldr.codicon.codicon-folding-collapsed,.monaco-editor .cldr.codicon.codicon-folding-manual-expanded,.monaco-editor .cldr.codicon.codicon-folding-manual-collapsed{color:var(--vscode-editorGutter-foldingControlForeground)!important}.monaco-editor .suggest-preview-additional-widget{white-space:nowrap}.monaco-editor .suggest-preview-additional-widget .content-spacer{color:transparent;white-space:pre}.monaco-editor .suggest-preview-additional-widget .button{display:inline-block;cursor:pointer;text-decoration:underline;text-underline-position:under}.monaco-editor .ghost-text-hidden{opacity:0;font-size:0}.monaco-editor .ghost-text-decoration,.monaco-editor .suggest-preview-text .ghost-text{font-style:italic}.monaco-editor .ghost-text-decoration,.monaco-editor .ghost-text-decoration-preview,.monaco-editor .suggest-preview-text .ghost-text{color:var(--vscode-editorGhostText-foreground)!important;background-color:var(--vscode-editorGhostText-background);border:1px solid var(--vscode-editorGhostText-border)}.monaco-editor .snippet-placeholder{min-width:2px;outline-style:solid;outline-width:1px;background-color:var(--vscode-editor-snippetTabstopHighlightBackground, transparent);outline-color:var(--vscode-editor-snippetTabstopHighlightBorder, transparent)}.monaco-editor .finish-snippet-placeholder{outline-style:solid;outline-width:1px;background-color:var(--vscode-editor-snippetFinalTabstopHighlightBackground, transparent);outline-color:var(--vscode-editor-snippetFinalTabstopHighlightBorder, transparent)}.monaco-editor .suggest-widget{width:430px;z-index:40;display:flex;flex-direction:column;border-radius:3px}.monaco-editor .suggest-widget.message{flex-direction:row;align-items:center}.monaco-editor .suggest-widget,.monaco-editor .suggest-details{flex:0 1 auto;width:100%;border-style:solid;border-width:1px;border-color:var(--vscode-editorSuggestWidget-border);background-color:var(--vscode-editorSuggestWidget-background)}.monaco-editor.hc-black .suggest-widget,.monaco-editor.hc-black .suggest-details,.monaco-editor.hc-light .suggest-widget,.monaco-editor.hc-light .suggest-details{border-width:2px}.monaco-editor .suggest-widget .suggest-status-bar{box-sizing:border-box;display:none;flex-flow:row nowrap;justify-content:space-between;width:100%;font-size:80%;padding:0 4px;border-top:1px solid var(--vscode-editorSuggestWidget-border);overflow:hidden}.monaco-editor .suggest-widget.with-status-bar .suggest-status-bar{display:flex}.monaco-editor .suggest-widget .suggest-status-bar .left{padding-right:8px}.monaco-editor .suggest-widget.with-status-bar .suggest-status-bar .action-label{color:var(--vscode-editorSuggestWidgetStatus-foreground)}.monaco-editor .suggest-widget.with-status-bar .suggest-status-bar .action-item:not(:last-of-type) .action-label{margin-right:0}.monaco-editor .suggest-widget.with-status-bar .suggest-status-bar .action-item:not(:last-of-type) .action-label:after{content:", ";margin-right:.3em}.monaco-editor .suggest-widget.with-status-bar .monaco-list .monaco-list-row>.contents>.main>.right>.readMore,.monaco-editor .suggest-widget.with-status-bar .monaco-list .monaco-list-row.focused.string-label>.contents>.main>.right>.readMore{display:none}.monaco-editor .suggest-widget.with-status-bar:not(.docs-side) .monaco-list .monaco-list-row:hover>.contents>.main>.right.can-expand-details>.details-label{width:100%}.monaco-editor .suggest-widget>.message{padding-left:22px}.monaco-editor .suggest-widget>.tree{height:100%;width:100%}.monaco-editor .suggest-widget .monaco-list{-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-user-select:none}.monaco-editor .suggest-widget .monaco-list .monaco-list-row{display:flex;-mox-box-sizing:border-box;box-sizing:border-box;padding-right:10px;background-repeat:no-repeat;background-position:2px 2px;white-space:nowrap;cursor:pointer;touch-action:none}.monaco-editor .suggest-widget .monaco-list .monaco-list-row.focused{color:var(--vscode-editorSuggestWidget-selectedForeground)}.monaco-editor .suggest-widget .monaco-list .monaco-list-row.focused .codicon{color:var(--vscode-editorSuggestWidget-selectedIconForeground)}.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents{flex:1;height:100%;overflow:hidden;padding-left:2px}.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main{display:flex;overflow:hidden;text-overflow:ellipsis;white-space:pre;justify-content:space-between}.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.left,.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.right{display:flex}.monaco-editor .suggest-widget .monaco-list .monaco-list-row:not(.focused)>.contents>.main .monaco-icon-label{color:var(--vscode-editorSuggestWidget-foreground)}.monaco-editor .suggest-widget:not(.frozen) .monaco-highlighted-label .highlight{font-weight:700}.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main .monaco-highlighted-label .highlight{color:var(--vscode-editorSuggestWidget-highlightForeground)}.monaco-editor .suggest-widget .monaco-list .monaco-list-row.focused>.contents>.main .monaco-highlighted-label .highlight{color:var(--vscode-editorSuggestWidget-focusHighlightForeground)}.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.header>.codicon-close,.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.right>.readMore:before{color:inherit;opacity:1;font-size:14px;cursor:pointer}.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.header>.codicon-close{position:absolute;top:6px;right:2px}.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.header>.codicon-close:hover,.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.right>.readMore:hover{opacity:1}.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.right>.details-label{opacity:.7}.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.left>.signature-label{overflow:hidden;text-overflow:ellipsis;opacity:.6}.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.left>.qualifier-label{margin-left:12px;opacity:.4;font-size:85%;line-height:initial;text-overflow:ellipsis;overflow:hidden;align-self:center}.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.right>.details-label{font-size:85%;margin-left:1.1em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.right>.details-label>.monaco-tokenized-source{display:inline}.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.right>.details-label{display:none}.monaco-editor .suggest-widget:not(.shows-details) .monaco-list .monaco-list-row.focused>.contents>.main>.right>.details-label{display:inline}.monaco-editor .suggest-widget .monaco-list .monaco-list-row:not(.string-label)>.contents>.main>.right>.details-label,.monaco-editor .suggest-widget.docs-side .monaco-list .monaco-list-row.focused:not(.string-label)>.contents>.main>.right>.details-label{display:inline}.monaco-editor .suggest-widget:not(.docs-side) .monaco-list .monaco-list-row.focused:hover>.contents>.main>.right.can-expand-details>.details-label{width:calc(100% - 26px)}.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.left{flex-shrink:1;flex-grow:1;overflow:hidden}.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.left>.monaco-icon-label{flex-shrink:0}.monaco-editor .suggest-widget .monaco-list .monaco-list-row:not(.string-label)>.contents>.main>.left>.monaco-icon-label{max-width:100%}.monaco-editor .suggest-widget .monaco-list .monaco-list-row.string-label>.contents>.main>.left>.monaco-icon-label{flex-shrink:1}.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.right{overflow:hidden;flex-shrink:4;max-width:70%}.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.right>.readMore{display:inline-block;position:absolute;right:10px;width:18px;height:18px;visibility:hidden}.monaco-editor .suggest-widget.docs-side .monaco-list .monaco-list-row>.contents>.main>.right>.readMore{display:none!important}.monaco-editor .suggest-widget .monaco-list .monaco-list-row.string-label>.contents>.main>.right>.readMore{display:none}.monaco-editor .suggest-widget .monaco-list .monaco-list-row.focused.string-label>.contents>.main>.right>.readMore{display:inline-block}.monaco-editor .suggest-widget .monaco-list .monaco-list-row.focused:hover>.contents>.main>.right>.readMore{visibility:visible}.monaco-editor .suggest-widget .monaco-list .monaco-list-row .monaco-icon-label.deprecated{opacity:.66;text-decoration:unset}.monaco-editor .suggest-widget .monaco-list .monaco-list-row .monaco-icon-label.deprecated>.monaco-icon-label-container>.monaco-icon-name-container{text-decoration:line-through}.monaco-editor .suggest-widget .monaco-list .monaco-list-row .monaco-icon-label:before{height:100%}.monaco-editor .suggest-widget .monaco-list .monaco-list-row .icon{display:block;height:16px;width:16px;margin-left:2px;background-repeat:no-repeat;background-size:80%;background-position:center}.monaco-editor .suggest-widget .monaco-list .monaco-list-row .icon.hide{display:none}.monaco-editor .suggest-widget .monaco-list .monaco-list-row .suggest-icon{display:flex;align-items:center;margin-right:4px}.monaco-editor .suggest-widget.no-icons .monaco-list .monaco-list-row .icon,.monaco-editor .suggest-widget.no-icons .monaco-list .monaco-list-row .suggest-icon:before{display:none}.monaco-editor .suggest-widget .monaco-list .monaco-list-row .icon.customcolor .colorspan{margin:0 0 0 .3em;border:.1em solid #000;width:.7em;height:.7em;display:inline-block}.monaco-editor .suggest-details-container{z-index:41}.monaco-editor .suggest-details{display:flex;flex-direction:column;cursor:default;color:var(--vscode-editorSuggestWidget-foreground)}.monaco-editor .suggest-details.focused{border-color:var(--vscode-focusBorder)}.monaco-editor .suggest-details a{color:var(--vscode-textLink-foreground)}.monaco-editor .suggest-details a:hover{color:var(--vscode-textLink-activeForeground)}.monaco-editor .suggest-details code{background-color:var(--vscode-textCodeBlock-background)}.monaco-editor .suggest-details.no-docs{display:none}.monaco-editor .suggest-details>.monaco-scrollable-element{flex:1}.monaco-editor .suggest-details>.monaco-scrollable-element>.body{box-sizing:border-box;height:100%;width:100%}.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.header>.type{flex:2;overflow:hidden;text-overflow:ellipsis;opacity:.7;white-space:pre;margin:0 24px 0 0;padding:4px 0 12px 5px}.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.header>.type.auto-wrap{white-space:normal;word-break:break-all}.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.docs{margin:0;padding:4px 5px;white-space:pre-wrap}.monaco-editor .suggest-details.no-type>.monaco-scrollable-element>.body>.docs{margin-right:24px;overflow:hidden}.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.docs.markdown-docs{padding:0;white-space:initial;min-height:calc(1rem + 8px)}.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.docs.markdown-docs>div,.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.docs.markdown-docs>span:not(:empty){padding:4px 5px}.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.docs.markdown-docs>div>p:first-child{margin-top:0}.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.docs.markdown-docs>div>p:last-child{margin-bottom:0}.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.docs.markdown-docs .monaco-tokenized-source{white-space:pre}.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.docs .code{white-space:pre-wrap;word-wrap:break-word}.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.docs.markdown-docs .codicon{vertical-align:sub}.monaco-editor .suggest-details>.monaco-scrollable-element>.body>p:empty{display:none}.monaco-editor .suggest-details code{border-radius:3px;padding:0 .4em}.monaco-editor .suggest-details ul,.monaco-editor .suggest-details ol{padding-left:20px}.monaco-editor .suggest-details p code{font-family:var(--monaco-monospace-font)}.monaco-editor .goto-definition-link{text-decoration:underline;cursor:pointer;color:var(--vscode-editorLink-activeForeground)!important}.monaco-editor .peekview-widget .head .peekview-title .severity-icon{display:inline-block;vertical-align:text-top;margin-right:4px}.monaco-editor .marker-widget{text-overflow:ellipsis;white-space:nowrap}.monaco-editor .marker-widget>.stale{opacity:.6;font-style:italic}.monaco-editor .marker-widget .title{display:inline-block;padding-right:5px}.monaco-editor .marker-widget .descriptioncontainer{position:absolute;white-space:pre;-moz-user-select:text;-ms-user-select:text;user-select:text;-webkit-user-select:text;padding:8px 12px 0 20px}.monaco-editor .marker-widget .descriptioncontainer .message{display:flex;flex-direction:column}.monaco-editor .marker-widget .descriptioncontainer .message .details{padding-left:6px}.monaco-editor .marker-widget .descriptioncontainer .message .source,.monaco-editor .marker-widget .descriptioncontainer .message span.code{opacity:.6}.monaco-editor .marker-widget .descriptioncontainer .message a.code-link{opacity:.6;color:inherit}.monaco-editor .marker-widget .descriptioncontainer .message a.code-link:before{content:"("}.monaco-editor .marker-widget .descriptioncontainer .message a.code-link:after{content:")"}.monaco-editor .marker-widget .descriptioncontainer .message a.code-link>span{text-decoration:underline;border-bottom:1px solid transparent;text-underline-position:under;color:var(--vscode-textLink-activeForeground)}.monaco-editor .marker-widget .descriptioncontainer .filename{cursor:pointer;color:var(--vscode-textLink-activeForeground)}.monaco-editor .zone-widget .codicon.codicon-error,.markers-panel .marker-icon.error,.markers-panel .marker-icon .codicon.codicon-error,.text-search-provider-messages .providerMessage .codicon.codicon-error,.extensions-viewlet>.extensions .codicon.codicon-error,.extension-editor .codicon.codicon-error,.preferences-editor .codicon.codicon-error{color:var(--vscode-problemsErrorIcon-foreground)}.monaco-editor .zone-widget .codicon.codicon-warning,.markers-panel .marker-icon.warning,.markers-panel .marker-icon .codicon.codicon-warning,.text-search-provider-messages .providerMessage .codicon.codicon-warning,.extensions-viewlet>.extensions .codicon.codicon-warning,.extension-editor .codicon.codicon-warning,.preferences-editor .codicon.codicon-warning{color:var(--vscode-problemsWarningIcon-foreground)}.monaco-editor .zone-widget .codicon.codicon-info,.markers-panel .marker-icon.info,.markers-panel .marker-icon .codicon.codicon-info,.text-search-provider-messages .providerMessage .codicon.codicon-info,.extensions-viewlet>.extensions .codicon.codicon-info,.extension-editor .codicon.codicon-info,.preferences-editor .codicon.codicon-info{color:var(--vscode-problemsInfoIcon-foreground)}.monaco-editor.vs .valueSetReplacement{outline:solid 2px var(--vscode-editorBracketMatch-border)}.monaco-editor .linked-editing-decoration{background-color:var(--vscode-editor-linkedEditingBackground);min-width:1px}.monaco-editor .detected-link,.monaco-editor .detected-link-active{text-decoration:underline;text-underline-position:under}.monaco-editor .detected-link-active{cursor:pointer;color:var(--vscode-editorLink-activeForeground)!important}.monaco-editor .focused .selectionHighlight{background-color:var(--vscode-editor-selectionHighlightBackground);box-sizing:border-box;border:1px solid var(--vscode-editor-selectionHighlightBorder)}.monaco-editor.hc-black .focused .selectionHighlight,.monaco-editor.hc-light .focused .selectionHighlight{border-style:dotted}.monaco-editor .wordHighlight{background-color:var(--vscode-editor-wordHighlightBackground);box-sizing:border-box;border:1px solid var(--vscode-editor-wordHighlightBorder)}.monaco-editor.hc-black .wordHighlight,.monaco-editor.hc-light .wordHighlight{border-style:dotted}.monaco-editor .wordHighlightStrong{background-color:var(--vscode-editor-wordHighlightStrongBackground);box-sizing:border-box;border:1px solid var(--vscode-editor-wordHighlightStrongBorder)}.monaco-editor.hc-black .wordHighlightStrong,.monaco-editor.hc-light .wordHighlightStrong{border-style:dotted}.monaco-editor .wordHighlightText{background-color:var(--vscode-editor-wordHighlightTextBackground);box-sizing:border-box;border:1px solid var(--vscode-editor-wordHighlightTextBorder)}.monaco-editor.hc-black .wordHighlightText,.monaco-editor.hc-light .wordHighlightText{border-style:dotted}.monaco-editor .inline-edit-remove{background-color:var(--vscode-editorGhostText-background);font-style:italic;text-decoration:line-through}.monaco-editor .inline-edit-remove.backgroundColoring{background-color:var(--vscode-diffEditor-removedLineBackground)}.monaco-editor .inline-edit-hidden{opacity:0;font-size:0}.monaco-editor .inline-edit-decoration,.monaco-editor .suggest-preview-text .inline-edit{font-style:italic}.monaco-editor .inline-completion-text-to-replace{text-decoration:underline;text-underline-position:under}.monaco-editor .inline-edit-decoration,.monaco-editor .inline-edit-decoration-preview,.monaco-editor .suggest-preview-text .inline-edit{color:var(--vscode-editorGhostText-foreground)!important;background-color:var(--vscode-editorGhostText-background);border:1px solid var(--vscode-editorGhostText-border)}.monaco-editor .inlineEditHints.withBorder{z-index:39;color:var(--vscode-editorHoverWidget-foreground);background-color:var(--vscode-editorHoverWidget-background);border:1px solid var(--vscode-editorHoverWidget-border)}.monaco-editor .inlineEditHints a,.monaco-editor .inlineEditHints a:hover{color:var(--vscode-foreground)}.monaco-editor .inlineEditHints .keybinding{display:flex;margin-left:4px;opacity:.6}.monaco-editor .inlineEditHints .keybinding .monaco-keybinding-key{font-size:8px;padding:2px 3px}.monaco-editor .inlineEditStatusBarItemLabel{margin-right:2px}.monaco-editor .parameter-hints-widget{z-index:39;display:flex;flex-direction:column;line-height:1.5em;cursor:default;color:var(--vscode-editorHoverWidget-foreground);background-color:var(--vscode-editorHoverWidget-background);border:1px solid var(--vscode-editorHoverWidget-border)}.hc-black .monaco-editor .parameter-hints-widget,.hc-light .monaco-editor .parameter-hints-widget{border-width:2px}.monaco-editor .parameter-hints-widget>.phwrapper{max-width:440px;display:flex;flex-direction:row}.monaco-editor .parameter-hints-widget.multiple{min-height:3.3em;padding:0}.monaco-editor .parameter-hints-widget.multiple .body:before{content:"";display:block;height:100%;position:absolute;opacity:.5;border-left:1px solid var(--vscode-editorHoverWidget-border)}.monaco-editor .parameter-hints-widget p,.monaco-editor .parameter-hints-widget ul{margin:8px 0}.monaco-editor .parameter-hints-widget .monaco-scrollable-element,.monaco-editor .parameter-hints-widget .body{display:flex;flex:1;flex-direction:column;min-height:100%}.monaco-editor .parameter-hints-widget .signature{padding:4px 5px;position:relative}.monaco-editor .parameter-hints-widget .signature.has-docs:after{content:"";display:block;position:absolute;left:0;width:100%;padding-top:4px;opacity:.5;border-bottom:1px solid var(--vscode-editorHoverWidget-border)}.monaco-editor .parameter-hints-widget .docs{padding:0 10px 0 5px;white-space:pre-wrap}.monaco-editor .parameter-hints-widget .docs.empty{display:none}.monaco-editor .parameter-hints-widget .docs a{color:var(--vscode-textLink-foreground)}.monaco-editor .parameter-hints-widget .docs a:hover{color:var(--vscode-textLink-activeForeground);cursor:pointer}.monaco-editor .parameter-hints-widget .docs .markdown-docs{white-space:initial}.monaco-editor .parameter-hints-widget .docs code{font-family:var(--monaco-monospace-font);border-radius:3px;padding:0 .4em;background-color:var(--vscode-textCodeBlock-background)}.monaco-editor .parameter-hints-widget .docs .monaco-tokenized-source,.monaco-editor .parameter-hints-widget .docs .code{white-space:pre-wrap}.monaco-editor .parameter-hints-widget .controls{display:none;flex-direction:column;align-items:center;min-width:22px;justify-content:flex-end}.monaco-editor .parameter-hints-widget.multiple .controls{display:flex;padding:0 2px}.monaco-editor .parameter-hints-widget.multiple .button{width:16px;height:16px;background-repeat:no-repeat;cursor:pointer}.monaco-editor .parameter-hints-widget .button.previous{bottom:24px}.monaco-editor .parameter-hints-widget .overloads{text-align:center;height:12px;line-height:12px;font-family:var(--monaco-monospace-font)}.monaco-editor .parameter-hints-widget .signature .parameter.active{color:var(--vscode-editorHoverWidget-highlightForeground);font-weight:700}.monaco-editor .parameter-hints-widget .documentation-parameter>.parameter{font-weight:700;margin-right:.5em}.monaco-editor .rename-box{z-index:100;color:inherit;border-radius:4px}.monaco-editor .rename-box.preview{padding:4px 4px 0}.monaco-editor .rename-box .rename-input-with-button{padding:3px;border-radius:2px;width:calc(100% - 8px)}.monaco-editor .rename-box .rename-input{width:calc(100% - 8px);padding:0}.monaco-editor .rename-box .rename-input:focus{outline:none}.monaco-editor .rename-box .rename-suggestions-button{display:flex;align-items:center;padding:3px;background-color:transparent;border:none;border-radius:5px;cursor:pointer}.monaco-editor .rename-box .rename-suggestions-button:hover{background-color:var(--vscode-toolbar-hoverBackground)}.monaco-editor .rename-box .rename-candidate-list-container .monaco-list-row{border-radius:2px}.monaco-editor .rename-box .rename-label{display:none;opacity:.8}.monaco-editor .rename-box.preview .rename-label{display:inherit}.monaco-editor .sticky-widget{overflow:hidden}.monaco-editor .sticky-widget-line-numbers{float:left;background-color:inherit}.monaco-editor .sticky-widget-lines-scrollable{display:inline-block;position:absolute;overflow:hidden;width:var(--vscode-editorStickyScroll-scrollableWidth);background-color:inherit}.monaco-editor .sticky-widget-lines{position:absolute;background-color:inherit}.monaco-editor .sticky-line-number,.monaco-editor .sticky-line-content{color:var(--vscode-editorLineNumber-foreground);white-space:nowrap;display:inline-block;position:absolute;background-color:inherit}.monaco-editor .sticky-line-number .codicon-folding-expanded,.monaco-editor .sticky-line-number .codicon-folding-collapsed{float:right;transition:var(--vscode-editorStickyScroll-foldingOpacityTransition)}.monaco-editor .sticky-line-content{width:var(--vscode-editorStickyScroll-scrollableWidth);background-color:inherit;white-space:nowrap}.monaco-editor .sticky-line-number-inner{display:inline-block;text-align:right}.monaco-editor .sticky-widget{border-bottom:1px solid var(--vscode-editorStickyScroll-border)}.monaco-editor .sticky-line-content:hover{background-color:var(--vscode-editorStickyScrollHover-background);cursor:pointer}.monaco-editor .sticky-widget{width:100%;box-shadow:var(--vscode-editorStickyScroll-shadow) 0 3px 2px -2px;z-index:4;background-color:var(--vscode-editorStickyScroll-background)}.monaco-editor .sticky-widget.peek{background-color:var(--vscode-peekViewEditorStickyScroll-background)}.monaco-editor .unicode-highlight{border:1px solid var(--vscode-editorUnicodeHighlight-border);background-color:var(--vscode-editorUnicodeHighlight-background);box-sizing:border-box}.editor-banner{box-sizing:border-box;cursor:default;width:100%;font-size:12px;display:flex;overflow:visible;height:26px;background:var(--vscode-banner-background)}.editor-banner .icon-container{display:flex;flex-shrink:0;align-items:center;padding:0 6px 0 10px}.editor-banner .icon-container.custom-icon{background-repeat:no-repeat;background-position:center center;background-size:16px;width:16px;padding:0;margin:0 6px 0 10px}.editor-banner .message-container{display:flex;align-items:center;line-height:26px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.editor-banner .message-container p{-webkit-margin-before:0;margin-block-start:0;-webkit-margin-after:0;margin-block-end:0}.editor-banner .message-actions-container{flex-grow:1;flex-shrink:0;line-height:26px;margin:0 4px}.editor-banner .message-actions-container a.monaco-button{width:inherit;margin:2px 8px;padding:0 12px}.editor-banner .message-actions-container a{padding:3px;margin-left:12px;text-decoration:underline}.editor-banner .action-container{padding:0 10px 0 6px}.editor-banner{background-color:var(--vscode-banner-background)}.editor-banner,.editor-banner .action-container .codicon,.editor-banner .message-actions-container .monaco-link{color:var(--vscode-banner-foreground)}.editor-banner .icon-container .codicon{color:var(--vscode-banner-iconForeground)}.monaco-link{color:var(--vscode-textLink-foreground)}.monaco-link:hover{color:var(--vscode-textLink-activeForeground)} ================================================ FILE: backend/openui/dist/assets/CodeEditor-B9qhAAku.js ================================================ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/html-B4dTfUY8.js","assets/index-B7PjGjI7.js","assets/index-CnQwS-Fb.css","assets/index-DnTpCebm.js","assets/javascript-BcV1SRi8.js","assets/typescript-BfKWl9Pr.js","assets/python-CsxvR8Mf.js","assets/yaml-DWuY8lcX.js","assets/cssMode-CMP9zKWk.js","assets/htmlMode-BZEeRbEQ.js","assets/jsonMode-CWFvP3uU.js","assets/tsMode-FcR9Jej8.js"])))=>i.map(i=>d[i]); var AZ=Object.defineProperty;var MZ=(s,e,t)=>e in s?AZ(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t;var Q1=(s,e,t)=>MZ(s,typeof e!="symbol"?e+"":e,t);import{g as _t,W as Sm,_ as er,$ as RZ,a3 as PZ,a7 as FZ,N as OZ,M as BZ,L as WZ,a2 as HZ,a0 as VZ,a1 as zZ,aw as UZ,j as $Z}from"./index-B7PjGjI7.js";import{C as jZ}from"./index-DnTpCebm.js";function KZ(s,e,t){return e in s?Object.defineProperty(s,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):s[e]=t,s}function l5(s,e){var t=Object.keys(s);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(s);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(s,n).enumerable})),t.push.apply(t,i)}return t}function d5(s){for(var e=1;e=0)&&(t[n]=s[n]);return t}function GZ(s,e){if(s==null)return{};var t=qZ(s,e),i,n;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(s);for(n=0;n=0)&&Object.prototype.propertyIsEnumerable.call(s,i)&&(t[i]=s[i])}return t}function ZZ(s,e){return XZ(s)||YZ(s,e)||QZ(s,e)||JZ()}function XZ(s){if(Array.isArray(s))return s}function YZ(s,e){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(s)))){var t=[],i=!0,n=!1,o=void 0;try{for(var r=s[Symbol.iterator](),a;!(i=(a=r.next()).done)&&(t.push(a.value),!(e&&t.length===e));i=!0);}catch(l){n=!0,o=l}finally{try{!i&&r.return!=null&&r.return()}finally{if(n)throw o}}return t}}function QZ(s,e){if(s){if(typeof s=="string")return c5(s,e);var t=Object.prototype.toString.call(s).slice(8,-1);if(t==="Object"&&s.constructor&&(t=s.constructor.name),t==="Map"||t==="Set")return Array.from(s);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return c5(s,e)}}function c5(s,e){(e==null||e>s.length)&&(e=s.length);for(var t=0,i=new Array(e);t=s.length?s.apply(this,n):function(){for(var r=arguments.length,a=new Array(r),l=0;l1&&arguments[1]!==void 0?arguments[1]:{};J1.initial(s),J1.handler(e);var t={current:s},i=dv(gX)(t,e),n=dv(hX)(t),o=dv(J1.changes)(s),r=dv(uX)(t);function a(){var d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(c){return c};return J1.selector(d),d(t.current)}function l(d){tX(i,n,o,r)(d)}return[a,l]}function uX(s,e){return wb(e)?e(s.current):e}function hX(s,e){return s.current=h5(h5({},s.current),e),e}function gX(s,e,t){return wb(e)?e(s.current):Object.keys(t).forEach(function(i){var n;return(n=e[i])===null||n===void 0?void 0:n.call(e,s.current[i])}),t}var fX={create:cX},pX={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.52.2/min/vs"}};function mX(s){return function e(){for(var t=this,i=arguments.length,n=new Array(i),o=0;o=s.length?s.apply(this,n):function(){for(var r=arguments.length,a=new Array(r),l=0;l{i.current=!1}:s,e)}var wr=VX;function Fv(){}function Xp(s,e,t,i){return zX(s,i)||UX(s,e,t,i)}function zX(s,e){return s.editor.getModel(dW(s,e))}function UX(s,e,t,i){return s.editor.createModel(e,t,i?dW(s,i):void 0)}function dW(s,e){return s.Uri.parse(e)}function $X({original:s,modified:e,language:t,originalLanguage:i,modifiedLanguage:n,originalModelPath:o,modifiedModelPath:r,keepCurrentOriginalModel:a=!1,keepCurrentModifiedModel:l=!1,theme:d="light",loading:c="Loading...",options:u={},height:h="100%",width:g="100%",className:f,wrapperProps:m={},beforeMount:_=Fv,onMount:v=Fv}){let[b,C]=_t.useState(!1),[w,y]=_t.useState(!0),D=_t.useRef(null),L=_t.useRef(null),k=_t.useRef(null),I=_t.useRef(v),O=_t.useRef(_),R=_t.useRef(!1);lW(()=>{let U=NL.init();return U.then(J=>(L.current=J)&&y(!1)).catch(J=>(J==null?void 0:J.type)!=="cancelation"&&console.error("Monaco initialization: error:",J)),()=>D.current?V():U.cancel()}),wr(()=>{if(D.current&&L.current){let U=D.current.getOriginalEditor(),J=Xp(L.current,s||"",i||t||"text",o||"");J!==U.getModel()&&U.setModel(J)}},[o],b),wr(()=>{if(D.current&&L.current){let U=D.current.getModifiedEditor(),J=Xp(L.current,e||"",n||t||"text",r||"");J!==U.getModel()&&U.setModel(J)}},[r],b),wr(()=>{let U=D.current.getModifiedEditor();U.getOption(L.current.editor.EditorOption.readOnly)?U.setValue(e||""):e!==U.getValue()&&(U.executeEdits("",[{range:U.getModel().getFullModelRange(),text:e||"",forceMoveMarkers:!0}]),U.pushUndoStop())},[e],b),wr(()=>{var U,J;(J=(U=D.current)==null?void 0:U.getModel())==null||J.original.setValue(s||"")},[s],b),wr(()=>{let{original:U,modified:J}=D.current.getModel();L.current.editor.setModelLanguage(U,i||t||"text"),L.current.editor.setModelLanguage(J,n||t||"text")},[t,i,n],b),wr(()=>{var U;(U=L.current)==null||U.editor.setTheme(d)},[d],b),wr(()=>{var U;(U=D.current)==null||U.updateOptions(u)},[u],b);let P=_t.useCallback(()=>{var pe;if(!L.current)return;O.current(L.current);let U=Xp(L.current,s||"",i||t||"text",o||""),J=Xp(L.current,e||"",n||t||"text",r||"");(pe=D.current)==null||pe.setModel({original:U,modified:J})},[t,e,n,s,i,o,r]),F=_t.useCallback(()=>{var U;!R.current&&k.current&&(D.current=L.current.editor.createDiffEditor(k.current,{automaticLayout:!0,...u}),P(),(U=L.current)==null||U.editor.setTheme(d),C(!0),R.current=!0)},[u,d,P]);_t.useEffect(()=>{b&&I.current(D.current,L.current)},[b]),_t.useEffect(()=>{!w&&!b&&F()},[w,b,F]);function V(){var J,pe,De,ge;let U=(J=D.current)==null?void 0:J.getModel();a||((pe=U==null?void 0:U.original)==null||pe.dispose()),l||((De=U==null?void 0:U.modified)==null||De.dispose()),(ge=D.current)==null||ge.dispose()}return Sm.createElement(aW,{width:g,height:h,isEditorReady:b,loading:c,_ref:k,className:f,wrapperProps:m})}var jX=$X;_t.memo(jX);function KX(s){let e=_t.useRef();return _t.useEffect(()=>{e.current=s},[s]),e.current}var qX=KX,ew=new Map;function GX({defaultValue:s,defaultLanguage:e,defaultPath:t,value:i,language:n,path:o,theme:r="light",line:a,loading:l="Loading...",options:d={},overrideServices:c={},saveViewState:u=!0,keepCurrentModel:h=!1,width:g="100%",height:f="100%",className:m,wrapperProps:_={},beforeMount:v=Fv,onMount:b=Fv,onChange:C,onValidate:w=Fv}){let[y,D]=_t.useState(!1),[L,k]=_t.useState(!0),I=_t.useRef(null),O=_t.useRef(null),R=_t.useRef(null),P=_t.useRef(b),F=_t.useRef(v),V=_t.useRef(),U=_t.useRef(i),J=qX(o),pe=_t.useRef(!1),De=_t.useRef(!1);lW(()=>{let ye=NL.init();return ye.then(ve=>(I.current=ve)&&k(!1)).catch(ve=>(ve==null?void 0:ve.type)!=="cancelation"&&console.error("Monaco initialization: error:",ve)),()=>O.current?We():ye.cancel()}),wr(()=>{var ve,ce,Qt,Ui;let ye=Xp(I.current,s||i||"",e||n||"",o||t||"");ye!==((ve=O.current)==null?void 0:ve.getModel())&&(u&&ew.set(J,(ce=O.current)==null?void 0:ce.saveViewState()),(Qt=O.current)==null||Qt.setModel(ye),u&&((Ui=O.current)==null||Ui.restoreViewState(ew.get(o))))},[o],y),wr(()=>{var ye;(ye=O.current)==null||ye.updateOptions(d)},[d],y),wr(()=>{!O.current||i===void 0||(O.current.getOption(I.current.editor.EditorOption.readOnly)?O.current.setValue(i):i!==O.current.getValue()&&(De.current=!0,O.current.executeEdits("",[{range:O.current.getModel().getFullModelRange(),text:i,forceMoveMarkers:!0}]),O.current.pushUndoStop(),De.current=!1))},[i],y),wr(()=>{var ve,ce;let ye=(ve=O.current)==null?void 0:ve.getModel();ye&&n&&((ce=I.current)==null||ce.editor.setModelLanguage(ye,n))},[n],y),wr(()=>{var ye;a!==void 0&&((ye=O.current)==null||ye.revealLine(a))},[a],y),wr(()=>{var ye;(ye=I.current)==null||ye.editor.setTheme(r)},[r],y);let ge=_t.useCallback(()=>{var ye;if(!(!R.current||!I.current)&&!pe.current){F.current(I.current);let ve=o||t,ce=Xp(I.current,i||s||"",e||n||"",ve||"");O.current=(ye=I.current)==null?void 0:ye.editor.create(R.current,{model:ce,automaticLayout:!0,...d},c),u&&O.current.restoreViewState(ew.get(ve)),I.current.editor.setTheme(r),a!==void 0&&O.current.revealLine(a),D(!0),pe.current=!0}},[s,e,t,i,n,o,d,c,u,r,a]);_t.useEffect(()=>{y&&P.current(O.current,I.current)},[y]),_t.useEffect(()=>{!L&&!y&&ge()},[L,y,ge]),U.current=i,_t.useEffect(()=>{var ye,ve;y&&C&&((ye=V.current)==null||ye.dispose(),V.current=(ve=O.current)==null?void 0:ve.onDidChangeModelContent(ce=>{De.current||C(O.current.getValue(),ce)}))},[y,C]),_t.useEffect(()=>{if(y){let ye=I.current.editor.onDidChangeMarkers(ve=>{var Qt;let ce=(Qt=O.current.getModel())==null?void 0:Qt.uri;if(ce&&ve.find(Ui=>Ui.path===ce.path)){let Ui=I.current.editor.getModelMarkers({resource:ce});w==null||w(Ui)}});return()=>{ye==null||ye.dispose()}}return()=>{}},[y,w]);function We(){var ye,ve;(ye=V.current)==null||ye.dispose(),h?u&&ew.set(o,O.current.saveViewState()):(ve=O.current.getModel())==null||ve.dispose(),O.current.dispose()}return Sm.createElement(aW,{width:g,height:f,isEditorReady:y,loading:l,_ref:R,className:m,wrapperProps:_})}var ZX=GX,XX=_t.memo(ZX),YX=XX;globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(s,e){return this.cache.has(s)?this.cache.get(s):(this.cache.set(s,e),e)}};const f5={inherit:!0,base:"vs-dark",colors:{"activityBar.activeBackground":"#181818","activityBar.background":"#181818","activityBar.border":"#383838","activityBar.foreground":"#e3e1e3","activityBar.inactiveForeground":"#7a797a","activityBarBadge.background":"#228df2","activityBarBadge.foreground":"#d6d6dd","badge.background":"#228df2","badge.foreground":"#d6d6dd","breadcrumb.activeSelectionForeground":"#d6d6dd","breadcrumb.background":"#181818","breadcrumb.focusForeground":"#d6d6dd","breadcrumb.foreground":"#a6a6a6","button.background":"#228df2","button.foreground":"#e6e6ed","button.hoverBackground":"#359dff","button.secondaryBackground":"#1d1d1d","button.secondaryForeground":"#d6d6dd","button.secondaryHoverBackground":"#303030","checkbox.background":"#1d1d1d","checkbox.border":"#4f4f4f","checkbox.foreground":"#d6d6dd","commandCenter.activeBackground":"#1d1d1d","commandCenter.background":"#292929","commandCenter.foreground":"#c1c1c1","debugExceptionWidget.background":"#1d1d1d","debugExceptionWidget.border":"#383838","debugToolBar.background":"#343334","debugToolBar.border":"#383838","diffEditor.border":"#383838","diffEditor.insertedTextBackground":"#83d6c530","diffEditor.insertedTextBorder":"#d6d6dd00","diffEditor.removedTextBackground":"#f14c4c30","diffEditor.removedTextBorder":"#d6d6dd00","dropdown.background":"#1d1d1d","dropdown.border":"#383838","dropdown.foreground":"#d6d6dd","editor.background":"#181818","editor.findMatchBackground":"#163764","editor.findMatchBorder":"#00000000","editor.findMatchHighlightBackground":"#7c511a","editor.findMatchHighlightBorder":"#d7d7dd02","editor.findRangeHighlightBackground":"#1d1d1d","editor.findRangeHighlightBorder":"#d6d6dd00","editor.foldBackground":"#1d1d1d","editor.foreground":"#d6d6dd","editor.hoverHighlightBackground":"#5b51ec70","editor.inactiveSelectionBackground":"#363636","editor.lineHighlightBackground":"#292929","editor.lineHighlightBorder":"#d6d6dd00","editor.rangeHighlightBackground":"#1d1d1d","editor.rangeHighlightBorder":"#38383800","editor.selectionBackground":"#163761","editor.selectionHighlightBackground":"#16376170","editor.selectionHighlightBorder":"#d6d6dd00","editor.wordHighlightBackground":"#ff000000","editor.wordHighlightBorder":"#d6d6dd00","editor.wordHighlightStrongBackground":"#16376170","editor.wordHighlightStrongBorder":"#d6d6dd00","editorBracketMatch.background":"#163761","editorBracketMatch.border":"#d6d6dd00","editorCodeLens.foreground":"#d6d6dd","editorCursor.background":"#181818","editorCursor.foreground":"#d6d6dd","editorError.background":"#b73a3400","editorError.border":"#d6d6dd00","editorError.foreground":"#f14c4c","editorGroup.border":"#383838","editorGroup.emptyBackground":"#181818","editorGroupHeader.border":"#d6d6dd00","editorGroupHeader.tabsBackground":"#292929","editorGroupHeader.tabsBorder":"#d6d6dd00","editorGutter.addedBackground":"#15ac91","editorGutter.background":"#181818","editorGutter.commentRangeForeground":"#d6d6dd","editorGutter.deletedBackground":"#f14c4c","editorGutter.foldingControlForeground":"#d6d6dd","editorGutter.modifiedBackground":"#e5b95c","editorHoverWidget.background":"#1d1d1d","editorHoverWidget.border":"#383838","editorHoverWidget.foreground":"#d6d6dd","editorIndentGuide.activeBackground":"#737377","editorIndentGuide.background":"#383838","editorInfo.background":"#d6d6dd00","editorInfo.border":"#d6d6dd00","editorInfo.foreground":"#228df2","editorInlayHint.background":"#2b2b2b","editorInlayHint.foreground":"#838383","editorLineNumber.activeForeground":"#c2c2c2","editorLineNumber.foreground":"#535353","editorLink.activeForeground":"#228df2","editorMarkerNavigation.background":"#2d2d30","editorMarkerNavigationError.background":"#f14c4c","editorMarkerNavigationInfo.background":"#4c9df3","editorMarkerNavigationWarning.background":"#e5b95c","editorOverviewRuler.background":"#25252500","editorOverviewRuler.border":"#7f7f7f4d","editorRuler.foreground":"#383838","editorSuggestWidget.background":"#1d1d1d","editorSuggestWidget.border":"#383838","editorSuggestWidget.foreground":"#d6d6dd","editorSuggestWidget.highlightForeground":"#d6d6dd","editorSuggestWidget.selectedBackground":"#163761","editorWarning.background":"#a9904000","editorWarning.border":"#d6d6dd00","editorWarning.foreground":"#ea7620","editorWhitespace.foreground":"#737373","editorWidget.background":"#292929","editorWidget.foreground":"#d6d6dd","editorWidget.resizeBorder":"#ea7620",focusBorder:"#d6d6dd00",foreground:"#d6d6dd","gitDecoration.addedResourceForeground":"#5a964d","gitDecoration.conflictingResourceForeground":"#aaa0fa","gitDecoration.deletedResourceForeground":"#f14c4c","gitDecoration.ignoredResourceForeground":"#666666","gitDecoration.modifiedResourceForeground":"#1981ef","gitDecoration.stageDeletedResourceForeground":"#f14c4c","gitDecoration.stageModifiedResourceForeground":"#1981ef","gitDecoration.submoduleResourceForeground":"#1981ef","gitDecoration.untrackedResourceForeground":"#3ea17f","icon.foreground":"#d6d6dd","input.background":"#212121","input.border":"#ffffff1e","input.foreground":"#d6d6dd","input.placeholderForeground":"#7b7b7b","inputOption.activeBackground":"#de3c72","inputOption.activeBorder":"#d6d6dd00","inputOption.activeForeground":"#d6d6dd","list.activeSelectionBackground":"#163761","list.activeSelectionForeground":"#d6d6dd","list.dropBackground":"#d6d6dd00","list.focusBackground":"#5b51ec","list.focusForeground":"#d6d6dd","list.highlightForeground":"#d6d6dd","list.hoverBackground":"#2a282a","list.hoverForeground":"#d6d6dd","list.inactiveSelectionBackground":"#3c3b3c","list.inactiveSelectionForeground":"#d6d6dd","listFilterWidget.background":"#5b51ec","listFilterWidget.noMatchesOutline":"#f14c4c","listFilterWidget.outline":"#00000000","menu.background":"#292929","menu.border":"#000000","menu.foreground":"#d6d6dd","menu.selectionBackground":"#194176","menu.selectionBorder":"#00000000","menu.selectionForeground":"#d6d6dd","menu.separatorBackground":"#3e3e3e","menubar.selectionBackground":"#d6d6dd20","menubar.selectionBorder":"#d6d6dd00","menubar.selectionForeground":"#d6d6dd","merge.commonContentBackground":"#1d1d1d","merge.commonHeaderBackground":"#323232","merge.currentContentBackground":"#1a493d","merge.currentHeaderBackground":"#83d6c595","merge.incomingContentBackground":"#28384b","merge.incomingHeaderBackground":"#395f8f","minimap.background":"#181818","minimap.errorHighlight":"#f14c4c","minimap.findMatchHighlight":"#15ac9170","minimap.selectionHighlight":"#363636","minimap.warningHighlight":"#ea7620","minimapGutter.addedBackground":"#15ac91","minimapGutter.deletedBackground":"#f14c4c","minimapGutter.modifiedBackground":"#e5b95c","notebook.focusedCellBorder":"#15ac91","notebook.focusedEditorBorder":"#15ac9177","notificationCenter.border":"#2c2c2c","notificationCenterHeader.background":"#2c2c2c","notificationCenterHeader.foreground":"#d6d6dd","notificationToast.border":"#383838","notifications.background":"#1d1d1d","notifications.border":"#2c2c2c","notifications.foreground":"#d6d6dd","notificationsErrorIcon.foreground":"#f14c4c","notificationsInfoIcon.foreground":"#228df2","notificationsWarningIcon.foreground":"#ea7620","panel.background":"#292929","panel.border":"#181818","panelSection.border":"#383838","panelTitle.activeBorder":"#d6d6dd","panelTitle.activeForeground":"#d6d6dd","panelTitle.inactiveForeground":"#d6d6dd","peekView.border":"#383838","peekViewEditor.background":"#001f33","peekViewEditor.matchHighlightBackground":"#ea762070","peekViewEditor.matchHighlightBorder":"#d6d6dd00","peekViewEditorGutter.background":"#001f33","peekViewResult.background":"#1d1d1d","peekViewResult.fileForeground":"#d6d6dd","peekViewResult.lineForeground":"#d6d6dd","peekViewResult.matchHighlightBackground":"#ea762070","peekViewResult.selectionBackground":"#363636","peekViewResult.selectionForeground":"#d6d6dd","peekViewTitle.background":"#1d1d1d","peekViewTitleDescription.foreground":"#d6d6dd","peekViewTitleLabel.foreground":"#d6d6dd","pickerGroup.border":"#383838","pickerGroup.foreground":"#d6d6dd","progressBar.background":"#15ac91","scrollbar.shadow":"#d6d6dd00","scrollbarSlider.activeBackground":"#676767","scrollbarSlider.background":"#67676750","scrollbarSlider.hoverBackground":"#676767","selection.background":"#163761","settings.focusedRowBackground":"#d6d6dd07","settings.headerForeground":"#d6d6dd","sideBar.background":"#181818","sideBar.border":"#383838","sideBar.dropBackground":"#d6d6dd00","sideBar.foreground":"#d1d1d1","sideBarSectionHeader.background":"#18181800","sideBarSectionHeader.border":"#d1d1d100","sideBarSectionHeader.foreground":"#d1d1d1","sideBarTitle.foreground":"#d1d1d1","statusBar.background":"#181818","statusBar.border":"#383838","statusBar.debuggingBackground":"#ea7620","statusBar.debuggingBorder":"#d6d6dd00","statusBar.debuggingForeground":"#e7e7e7","statusBar.foreground":"#d6d6dd","statusBar.noFolderBackground":"#181818","statusBar.noFolderBorder":"#d6d6dd00","statusBar.noFolderForeground":"#6b6b6b","statusBarItem.activeBackground":"#d6d6dd25","statusBarItem.hoverBackground":"#d6d6dd20","statusBarItem.remoteBackground":"#5b51ec","statusBarItem.remoteForeground":"#d6d6dd","tab.activeBackground":"#181818","tab.activeBorder":"#d6d6dd00","tab.activeBorderTop":"#d6d6dd","tab.activeForeground":"#d6d6dd","tab.border":"#d6d6dd00","tab.hoverBorder":"#6d6d7071","tab.hoverForeground":"#d6d6dd","tab.inactiveBackground":"#292929","tab.inactiveForeground":"#d6d6dd","terminal.ansiBlack":"#676767","terminal.ansiBlue":"#4c9df3","terminal.ansiBrightBlack":"#676767","terminal.ansiBrightBlue":"#4c9df3","terminal.ansiBrightCyan":"#75d3ba","terminal.ansiBrightGreen":"#15ac91","terminal.ansiBrightMagenta":"#e567dc","terminal.ansiBrightRed":"#f14c4c","terminal.ansiBrightWhite":"#d6d6dd","terminal.ansiBrightYellow":"#e5b95c","terminal.ansiCyan":"#75d3ba","terminal.ansiGreen":"#15ac91","terminal.ansiMagenta":"#e567dc","terminal.ansiRed":"#f14c4c","terminal.ansiWhite":"#d6d6dd","terminal.ansiYellow":"#e5b95c","terminal.background":"#191919","terminal.border":"#383838","terminal.foreground":"#d6d6dd","terminal.selectionBackground":"#636262fd","terminalCursor.background":"#5b51ec","terminalCursor.foreground":"#d6d6dd","textLink.foreground":"#228df2","titleBar.activeBackground":"#292929","titleBar.activeForeground":"#d1d1d1","titleBar.border":"#383838","titleBar.inactiveBackground":"#3c3b3c","titleBar.inactiveForeground":"#cccccc99","tree.indentGuidesStroke":"#d6d6dd00","walkThrough.embeddedEditorBackground":"#00000050","widget.shadow":"#111111eb"},rules:[{foreground:"#E394DC",token:"attribute.value.html"},{foreground:"#AAA0FA",token:"attribute.name.html"},{foreground:"#87C3FF",token:"tag.html"},{foreground:"#A8CC7C",fontStyle:"",token:"string.quoted.binary.single.python"},{foreground:"#82D2CE",fontStyle:"",token:"constant.language.false.cpp"},{foreground:"#82D2CE",fontStyle:"",token:"constant.language.true.cpp"},{foreground:"#D6D6DD",token:"punctuation.definition.delayed.unison"},{foreground:"#D6D6DD",token:"punctuation.definition.list.begin.unison"},{foreground:"#D6D6DD",token:"punctuation.definition.list.end.unison"},{foreground:"#D6D6DD",token:"punctuation.definition.ability.begin.unison"},{foreground:"#D6D6DD",token:"punctuation.definition.ability.end.unison"},{foreground:"#D6D6DD",token:"punctuation.operator.assignment.as.unison"},{foreground:"#D6D6DD",token:"punctuation.separator.pipe.unison"},{foreground:"#D6D6DD",token:"punctuation.separator.delimiter.unison"},{foreground:"#D6D6DD",token:"punctuation.definition.hash.unison"},{foreground:"#A8CC7C",token:"keyword.control.directive"},{foreground:"#D1D1D1",fontStyle:"",token:"constant.other.ellipsis.python"},{foreground:"#83D6C5",token:"variable.other.generic-type.haskell"},{foreground:"#898989",fontStyle:"",token:"punctuation.definition.tag"},{foreground:"#F8C762",token:"storage.type.haskell"},{foreground:"#D6D6DD",token:"support.variable.magic.python"},{foreground:"#D6D6DD",token:"punctuation.separator.period.python"},{foreground:"#D6D6DD",token:"punctuation.separator.element.python"},{foreground:"#D6D6DD",token:"punctuation.parenthesis.begin.python"},{foreground:"#D6D6DD",token:"punctuation.parenthesis.end.python"},{foreground:"#EFB080",token:"variable.parameter.function.language.special.self.python"},{foreground:"#82D2CE",fontStyle:"",token:"variable.language.this.cpp"},{foreground:"#D6D6DD",token:"storage.modifier.lifetime.rust"},{foreground:"#AAA0FA",token:"support.function.std.rust"},{foreground:"#EFB080",token:"entity.name.lifetime.rust"},{foreground:"#AA9BF5",token:"variable.other.property"},{foreground:"#D6D6DD",token:"variable.language.rust"},{foreground:"#83D6C5",token:"support.constant.edge"},{foreground:"#D6D6DD",token:"constant.other.character-class.regexp"},{foreground:"#F8C762",token:"keyword.operator.quantifier.regexp"},{foreground:"#E394DC",token:"punctuation.definition.string.begin"},{foreground:"#E394DC",token:"punctuation.definition.string.end"},{foreground:"#D6D6DD",token:"variable.parameter.function"},{foreground:"#6D6D6D",token:"comment markup.link"},{foreground:"#EFB080",token:"markup.changed.diff"},{foreground:"#AAA0FA",token:"meta.diff.header.from-file"},{foreground:"#AAA0FA",token:"meta.diff.header.to-file"},{foreground:"#AAA0FA",token:"punctuation.definition.from-file.diff"},{foreground:"#AAA0FA",token:"punctuation.definition.to-file.diff"},{foreground:"#E394DC",token:"markup.inserted.diff"},{foreground:"#D6D6DD",token:"markup.deleted.diff"},{foreground:"#D6D6DD",token:"meta.function.c"},{foreground:"#D6D6DD",token:"meta.function.cpp"},{foreground:"#D6D6DD",token:"punctuation.section.block.begin.bracket.curly.cpp"},{foreground:"#D6D6DD",token:"punctuation.section.block.end.bracket.curly.cpp"},{foreground:"#D6D6DD",token:"punctuation.terminator.statement.c"},{foreground:"#D6D6DD",token:"punctuation.section.block.begin.bracket.curly.c"},{foreground:"#D6D6DD",token:"punctuation.section.block.end.bracket.curly.c"},{foreground:"#D6D6DD",token:"punctuation.section.parens.begin.bracket.round.c"},{foreground:"#D6D6DD",token:"punctuation.section.parens.end.bracket.round.c"},{foreground:"#D6D6DD",token:"punctuation.section.parameters.begin.bracket.round.c"},{foreground:"#D6D6DD",token:"punctuation.section.parameters.end.bracket.round.c"},{foreground:"#D6D6DD",token:"punctuation.separator.key-value"},{foreground:"#AAA0FA",token:"keyword.operator.expression.import"},{foreground:"#EFB080",token:"support.constant.math"},{foreground:"#F8C762",token:"support.constant.property.math"},{foreground:"#EFB080",token:"variable.other.constant"},{foreground:"#AA9BF5",token:"variable.other.constant"},{foreground:"#EFB080",token:"storage.type.annotation.java"},{foreground:"#EFB080",token:"storage.type.object.array.java"},{foreground:"#D6D6DD",token:"source.java"},{foreground:"#D6D6DD",token:"punctuation.section.block.begin.java"},{foreground:"#D6D6DD",token:"punctuation.section.block.end.java"},{foreground:"#D6D6DD",token:"punctuation.definition.method-parameters.begin.java"},{foreground:"#D6D6DD",token:"punctuation.definition.method-parameters.end.java"},{foreground:"#D6D6DD",token:"meta.method.identifier.java"},{foreground:"#D6D6DD",token:"punctuation.section.method.begin.java"},{foreground:"#D6D6DD",token:"punctuation.section.method.end.java"},{foreground:"#D6D6DD",token:"punctuation.terminator.java"},{foreground:"#D6D6DD",token:"punctuation.section.class.begin.java"},{foreground:"#D6D6DD",token:"punctuation.section.class.end.java"},{foreground:"#D6D6DD",token:"punctuation.section.inner-class.begin.java"},{foreground:"#D6D6DD",token:"punctuation.section.inner-class.end.java"},{foreground:"#D6D6DD",token:"meta.method-call.java"},{foreground:"#D6D6DD",token:"punctuation.section.class.begin.bracket.curly.java"},{foreground:"#D6D6DD",token:"punctuation.section.class.end.bracket.curly.java"},{foreground:"#D6D6DD",token:"punctuation.section.method.begin.bracket.curly.java"},{foreground:"#D6D6DD",token:"punctuation.section.method.end.bracket.curly.java"},{foreground:"#D6D6DD",token:"punctuation.separator.period.java"},{foreground:"#D6D6DD",token:"punctuation.bracket.angle.java"},{foreground:"#D6D6DD",token:"punctuation.definition.annotation.java"},{foreground:"#D6D6DD",token:"meta.method.body.java"},{foreground:"#AAA0FA",token:"meta.method.java"},{foreground:"#EFB080",token:"storage.modifier.import.java"},{foreground:"#EFB080",token:"storage.type.java"},{foreground:"#EFB080",token:"storage.type.generic.java"},{foreground:"#83D6C5",token:"keyword.operator.instanceof.java"},{foreground:"#D6D6DD",token:"meta.definition.variable.name.java"},{foreground:"#D6D6DD",token:"keyword.operator.logical"},{foreground:"#D6D6DD",token:"keyword.operator.bitwise"},{foreground:"#D6D6DD",token:"keyword.operator.channel"},{foreground:"#D6D6DD",token:"keyword.operator.css"},{foreground:"#D6D6DD",token:"keyword.operator.scss"},{foreground:"#D6D6DD",token:"keyword.operator.less"},{foreground:"#F8C762",token:"support.constant.color.w3c-standard-color-name.css"},{foreground:"#F8C762",token:"support.constant.color.w3c-standard-color-name.scss"},{foreground:"#D6D6DD",token:"punctuation.separator.list.comma.css"},{foreground:"#F8C762",token:"support.constant.color.w3c-standard-color-name.css"},{foreground:"#EFB080",token:"support.module.node"},{foreground:"#EFB080",token:"support.type.object.module"},{foreground:"#EFB080",token:"support.module.node"},{foreground:"#EFB080",token:"entity.name.type.module"},{foreground:"#D6D6DD",token:""},{foreground:"#D6D6DD",token:"meta.object-literal.key"},{foreground:"#D6D6DD",token:"support.variable.object.process"},{foreground:"#D6D6DD",token:"support.variable.object.node"},{foreground:"#94C1FA",token:"variable.other.readwrite"},{foreground:"#AA9BF5",token:"support.variable.property"},{foreground:"#F8C762",token:"support.constant.json"},{foreground:"#83D6C5",token:"keyword.operator.expression.instanceof"},{foreground:"#83D6C5",token:"keyword.operator.new"},{foreground:"#83D6C5",token:"keyword.operator.ternary"},{foreground:"#83D6C5",token:"keyword.operator.optional"},{foreground:"#83D6C5",token:"keyword.operator.expression.keyof"},{foreground:"#D6D6DD",token:"support.type.object.console"},{foreground:"#F8C762",token:"support.variable.property.process"},{foreground:"#EBC88D",token:"entity.name.function.js"},{foreground:"#EBC88D",token:"support.function.console.js"},{foreground:"#D6D6DD",token:"keyword.operator.misc.rust"},{foreground:"#83D6C5",token:"keyword.operator.sigil.rust"},{foreground:"#83D6C5",token:"keyword.operator.delete"},{foreground:"#D6D6DD",token:"support.type.object.dom"},{foreground:"#D6D6DD",token:"support.variable.dom"},{foreground:"#D6D6DD",token:"support.variable.property.dom"},{foreground:"#D6D6DD",token:"keyword.operator.arithmetic"},{foreground:"#D6D6DD",token:"keyword.operator.comparison"},{foreground:"#D6D6DD",token:"keyword.operator.decrement"},{foreground:"#D6D6DD",token:"keyword.operator.increment"},{foreground:"#D6D6DD",token:"keyword.operator.relational"},{foreground:"#83D6C5",token:"keyword.operator.assignment.c"},{foreground:"#83D6C5",token:"keyword.operator.comparison.c"},{foreground:"#83D6C5",token:"keyword.operator.c"},{foreground:"#83D6C5",token:"keyword.operator.increment.c"},{foreground:"#83D6C5",token:"keyword.operator.decrement.c"},{foreground:"#83D6C5",token:"keyword.operator.bitwise.shift.c"},{foreground:"#83D6C5",token:"keyword.operator.assignment.cpp"},{foreground:"#83D6C5",token:"keyword.operator.comparison.cpp"},{foreground:"#83D6C5",token:"keyword.operator.cpp"},{foreground:"#83D6C5",token:"keyword.operator.increment.cpp"},{foreground:"#83D6C5",token:"keyword.operator.decrement.cpp"},{foreground:"#83D6C5",token:"keyword.operator.bitwise.shift.cpp"},{foreground:"#D6D6DD",token:"punctuation.separator.delimiter"},{foreground:"#83D6C5",token:"punctuation.separator.c"},{foreground:"#83D6C5",token:"punctuation.separator.cpp"},{foreground:"#D6D6DD",token:"support.type.posix-reserved.c"},{foreground:"#D6D6DD",token:"support.type.posix-reserved.cpp"},{foreground:"#83D6C5",token:"keyword.operator.sizeof.c"},{foreground:"#83D6C5",token:"keyword.operator.sizeof.cpp"},{foreground:"#F8C762",token:"variable.parameter.function.language.python"},{foreground:"#82D2CE",token:"support.type.python"},{foreground:"#83D6C5",token:"keyword.operator.logical.python"},{foreground:"#F8C762",token:"variable.parameter.function.python"},{foreground:"#D6D6DD",token:"punctuation.definition.arguments.begin.python"},{foreground:"#D6D6DD",token:"punctuation.definition.arguments.end.python"},{foreground:"#D6D6DD",token:"punctuation.separator.arguments.python"},{foreground:"#D6D6DD",token:"punctuation.definition.list.begin.python"},{foreground:"#D6D6DD",token:"punctuation.definition.list.end.python"},{foreground:"#AAA0FA",token:"meta.function-call.generic.python"},{foreground:"#F8C762",token:"constant.character.format.placeholder.other.python"},{foreground:"#D6D6DD",token:"keyword.operator"},{foreground:"#83D6C5",token:"keyword.operator.assignment.compound"},{foreground:"#D6D6DD",token:"keyword.operator.assignment.compound.js"},{foreground:"#D6D6DD",token:"keyword.operator.assignment.compound.ts"},{foreground:"#83D6C5",token:"keyword"},{foreground:"#D1D1D1",token:"entity.name.namespace"},{foreground:"#D6D6DD",token:"variable"},{foreground:"#D6D6DD",token:"variable.c"},{foreground:"#C1808A",token:"variable.language"},{foreground:"#D6D6DD",token:"token.variable.parameter.java"},{foreground:"#EFB080",token:"import.storage.java"},{foreground:"#83D6C5",token:"token.package.keyword"},{foreground:"#D6D6DD",token:"token.package"},{foreground:"#EFB080",token:"entity.name.type.namespace"},{foreground:"#87C3FF",token:"support.class"},{foreground:"#87C3FF",token:" entity.name.type.class"},{foreground:"#EFB080",token:"entity.name.class.identifier.namespace.type"},{foreground:"#EFB080",token:"entity.name.class"},{foreground:"#EFB080",token:"variable.other.class.js"},{foreground:"#EFB080",token:"variable.other.class.ts"},{foreground:"#D6D6DD",token:"variable.other.class.php"},{foreground:"#EFB080",token:"entity.name.type"},{foreground:"#A8CC7C",token:"keyword.control.directive.include.cpp"},{foreground:"#F8C762",token:"control.elements"},{foreground:"#F8C762",token:" keyword.operator.less"},{foreground:"#AAA0FA",token:"keyword.other.special-method"},{foreground:"#82D2CE",token:"storage"},{foreground:"#D1D1D1",fontStyle:"",token:"storage.modifier.reference"},{foreground:"#D1D1D1",fontStyle:"",token:"storage.modifier.pointer"},{foreground:"#83D6C5",token:"token.storage"},{foreground:"#83D6C5",token:"keyword.operator.expression.delete"},{foreground:"#83D6C5",token:"keyword.operator.expression.in"},{foreground:"#83D6C5",token:"keyword.operator.expression.of"},{foreground:"#83D6C5",token:"keyword.operator.expression.instanceof"},{foreground:"#83D6C5",token:"keyword.operator.new"},{foreground:"#83D6C5",token:"keyword.operator.expression.typeof"},{foreground:"#83D6C5",token:"keyword.operator.expression.void"},{foreground:"#EFB080",token:"token.storage.type.java"},{foreground:"#EFB080",token:"support.function"},{foreground:"#87C3FF",fontStyle:"",token:"meta.property-name.css"},{foreground:"#FAD075",token:"meta.tag"},{foreground:"#E394DC",token:"string"},{foreground:"#EFB080",token:"entity.other.inherited-class"},{foreground:"#D6D6DD",token:"constant.other.symbol"},{foreground:"#EBC88D",token:"constant.numeric"},{foreground:"#EBC88D",token:"constant.other.color"},{foreground:"#F8C762",token:"punctuation.definition.constant"},{foreground:"#AF9CFF",token:"entity.name.tag.template"},{foreground:"#AF9CFF",token:"entity.name.tag.script"},{foreground:"#AF9CFF",token:"entity.name.tag.style"},{foreground:"#87C3FF",token:"entity.name.tag.html"},{foreground:"#E394DC",fontStyle:"",token:"meta.property-value.css"},{foreground:"#AAA0FA",token:"entity.other.attribute-name"},{foreground:"#AAA0FA",fontStyle:"",token:"entity.other.attribute-name.id"},{foreground:"#F8C762",fontStyle:"",token:"entity.other.attribute-name.class.css"},{foreground:"#83D6C5",token:"meta.selector"},{foreground:"#D6D6DD",token:"markup.heading"},{foreground:"#AAA0FA",token:"markup.heading punctuation.definition.heading"},{foreground:"#AAA0FA",token:" entity.name.section"},{foreground:"#EBC88D",token:"keyword.other.unit"},{foreground:"#F8C762",token:"markup.bold"},{foreground:"#F8C762",token:"todo.bold"},{foreground:"#EFB080",token:"punctuation.definition.bold"},{foreground:"#83D6C5",token:"markup.italic"},{foreground:"#83D6C5",token:" punctuation.definition.italic"},{foreground:"#83D6C5",token:"todo.emphasis"},{foreground:"#83D6C5",token:"emphasis md"},{foreground:"#D6D6DD",token:"entity.name.section.markdown"},{foreground:"#D6D6DD",token:"punctuation.definition.heading.markdown"},{foreground:"#D6D6DD",token:"punctuation.definition.list.begin.markdown"},{foreground:"#D6D6DD",token:"markup.heading.setext"},{foreground:"#F8C762",token:"punctuation.definition.bold.markdown"},{foreground:"#E394DC",token:"markup.inline.raw.markdown"},{foreground:"#E394DC",token:"markup.inline.raw.string.markdown"},{foreground:"#D6D6DD",token:"punctuation.definition.list.markdown"},{foreground:"#D6D6DD",token:"punctuation.definition.string.begin.markdown"},{foreground:"#D6D6DD",token:"punctuation.definition.string.end.markdown"},{foreground:"#D6D6DD",token:"punctuation.definition.metadata.markdown"},{foreground:"#D6D6DD",token:"beginning.punctuation.definition.list.markdown"},{foreground:"#D6D6DD",token:"punctuation.definition.metadata.markdown"},{foreground:"#83D6C5",token:"markup.underline.link.markdown"},{foreground:"#83D6C5",token:"markup.underline.link.image.markdown"},{foreground:"#AAA0FA",token:"string.other.link.title.markdown"},{foreground:"#AAA0FA",token:"string.other.link.description.markdown"},{foreground:"#D6D6DD",token:"string.regexp"},{foreground:"#D6D6DD",token:"constant.character.escape"},{foreground:"#D6D6DD",token:"punctuation.section.embedded"},{foreground:"#D6D6DD",token:" variable.interpolation"},{foreground:"#83D6C5",token:"punctuation.section.embedded.begin"},{foreground:"#83D6C5",token:"punctuation.section.embedded.end"},{foreground:"#D6D6DD",token:"invalid.illegal"},{foreground:"#D6D6DD",token:"invalid.illegal.bad-ampersand.html"},{foreground:"#D6D6DD",token:"invalid.broken"},{foreground:"#D6D6DD",token:"invalid.deprecated"},{foreground:"#D6D6DD",token:"invalid.unimplemented"},{foreground:"#D6D6DD",token:"source.json meta.structure.dictionary.json > string.quoted.json"},{foreground:"#D6D6DD",token:"source.json meta.structure.dictionary.json > string.quoted.json > punctuation.string"},{foreground:"#E394DC",token:"source.json meta.structure.dictionary.json > value.json > string.quoted.json"},{foreground:"#E394DC",token:"source.json meta.structure.array.json > value.json > string.quoted.json"},{foreground:"#E394DC",token:"source.json meta.structure.dictionary.json > value.json > string.quoted.json > punctuation"},{foreground:"#E394DC",token:"source.json meta.structure.array.json > value.json > string.quoted.json > punctuation"},{foreground:"#D6D6DD",token:"source.json meta.structure.dictionary.json > constant.language.json"},{foreground:"#D6D6DD",token:"source.json meta.structure.array.json > constant.language.json"},{foreground:"#82D2CE",token:"support.type.property-name.json"},{foreground:"#83D6C5",token:"text.html.laravel-blade source.php.embedded.line.html entity.name.tag.laravel-blade"},{foreground:"#83D6C5",token:"text.html.laravel-blade source.php.embedded.line.html support.constant.laravel-blade"},{foreground:"#EFB080",token:"support.other.namespace.use.php"},{foreground:"#EFB080",token:"support.other.namespace.use-as.php"},{foreground:"#EFB080",token:"support.other.namespace.php"},{foreground:"#EFB080",token:"entity.other.alias.php"},{foreground:"#EFB080",token:"meta.interface.php"},{foreground:"#83D6C5",token:"keyword.operator.error-control.php"},{foreground:"#83D6C5",token:"keyword.operator.type.php"},{foreground:"#D6D6DD",token:"punctuation.section.array.begin.php"},{foreground:"#D6D6DD",token:"punctuation.section.array.end.php"},{foreground:"#F44747",token:"invalid.illegal.non-null-typehinted.php"},{foreground:"#EFB080",token:"storage.type.php"},{foreground:"#EFB080",token:"meta.other.type.phpdoc.php"},{foreground:"#EFB080",token:"keyword.other.type.php"},{foreground:"#EFB080",token:"keyword.other.array.phpdoc.php"},{foreground:"#AAA0FA",token:"meta.function-call.php"},{foreground:"#AAA0FA",token:"meta.function-call.object.php"},{foreground:"#AAA0FA",token:"meta.function-call.static.php"},{foreground:"#D6D6DD",token:"punctuation.definition.parameters.begin.bracket.round.php"},{foreground:"#D6D6DD",token:"punctuation.definition.parameters.end.bracket.round.php"},{foreground:"#D6D6DD",token:"punctuation.separator.delimiter.php"},{foreground:"#D6D6DD",token:"punctuation.section.scope.begin.php"},{foreground:"#D6D6DD",token:"punctuation.section.scope.end.php"},{foreground:"#D6D6DD",token:"punctuation.terminator.expression.php"},{foreground:"#D6D6DD",token:"punctuation.definition.arguments.begin.bracket.round.php"},{foreground:"#D6D6DD",token:"punctuation.definition.arguments.end.bracket.round.php"},{foreground:"#D6D6DD",token:"punctuation.definition.storage-type.begin.bracket.round.php"},{foreground:"#D6D6DD",token:"punctuation.definition.storage-type.end.bracket.round.php"},{foreground:"#D6D6DD",token:"punctuation.definition.array.begin.bracket.round.php"},{foreground:"#D6D6DD",token:"punctuation.definition.array.end.bracket.round.php"},{foreground:"#D6D6DD",token:"punctuation.definition.begin.bracket.round.php"},{foreground:"#D6D6DD",token:"punctuation.definition.end.bracket.round.php"},{foreground:"#D6D6DD",token:"punctuation.definition.begin.bracket.curly.php"},{foreground:"#D6D6DD",token:"punctuation.definition.end.bracket.curly.php"},{foreground:"#D6D6DD",token:"punctuation.definition.section.switch-block.end.bracket.curly.php"},{foreground:"#D6D6DD",token:"punctuation.definition.section.switch-block.start.bracket.curly.php"},{foreground:"#D6D6DD",token:"punctuation.definition.section.switch-block.begin.bracket.curly.php"},{foreground:"#D6D6DD",token:"punctuation.definition.section.switch-block.end.bracket.curly.php"},{foreground:"#F8C762",token:"support.constant.core.rust"},{foreground:"#F8C762",token:"support.constant.ext.php"},{foreground:"#F8C762",token:"support.constant.std.php"},{foreground:"#F8C762",token:"support.constant.core.php"},{foreground:"#F8C762",token:"support.constant.parser-token.php"},{foreground:"#AAA0FA",token:"entity.name.goto-label.php"},{foreground:"#AAA0FA",token:"support.other.php"},{foreground:"#D6D6DD",token:"keyword.operator.logical.php"},{foreground:"#D6D6DD",token:"keyword.operator.bitwise.php"},{foreground:"#D6D6DD",token:"keyword.operator.arithmetic.php"},{foreground:"#83D6C5",token:"keyword.operator.regexp.php"},{foreground:"#D6D6DD",token:"keyword.operator.comparison.php"},{foreground:"#83D6C5",token:"keyword.operator.heredoc.php"},{foreground:"#83D6C5",token:"keyword.operator.nowdoc.php"},{foreground:"#A8CC7C",token:"meta.function.decorator.python"},{foreground:"#A8CC7C",fontStyle:"",token:"punctuation.definition.decorator.python"},{foreground:"#A8CC7C",fontStyle:"",token:"entity.name.function.decorator.python"},{foreground:"#D6D6DD",token:"support.token.decorator.python"},{foreground:"#D6D6DD",token:"meta.function.decorator.identifier.python"},{foreground:"#D6D6DD",token:"function.parameter"},{foreground:"#D6D6DD",token:"function.brace"},{foreground:"#D6D6DD",token:"function.parameter.ruby"},{foreground:"#D6D6DD",token:" function.parameter.cs"},{foreground:"#D6D6DD",token:"constant.language.symbol.ruby"},{foreground:"#D6D6DD",token:"rgb-value"},{foreground:"#F8C762",token:"inline-color-decoration rgb-value"},{foreground:"#F8C762",token:"less rgb-value"},{foreground:"#D6D6DD",token:"selector.sass"},{foreground:"#82D2CE",token:"support.type.primitive.ts"},{foreground:"#82D2CE",token:"support.type.builtin.ts"},{foreground:"#82D2CE",token:"support.type.primitive.tsx"},{foreground:"#82D2CE",token:"support.type.builtin.tsx"},{foreground:"#D6D6DD",token:"block.scope.end"},{foreground:"#D6D6DD",token:"block.scope.begin"},{foreground:"#EFB080",token:"storage.type.cs"},{foreground:"#D6D6DD",token:"entity.name.variable.local.cs"},{foreground:"#AAA0FA",token:"token.info-token"},{foreground:"#F8C762",token:"token.warn-token"},{foreground:"#F44747",token:"token.error-token"},{foreground:"#83D6C5",token:"token.debug-token"},{foreground:"#83D6C5",token:"punctuation.definition.template-expression.begin"},{foreground:"#83D6C5",token:"punctuation.definition.template-expression.end"},{foreground:"#83D6C5",token:"punctuation.section.embedded"},{foreground:"#D6D6DD",token:"meta.template.expression"},{foreground:"#83D6C5",token:"keyword.operator.module"},{foreground:"#AAA0FA",token:"support.type.type.flowtype"},{foreground:"#EFB080",token:"support.type.primitive"},{foreground:"#D6D6DD",token:"meta.property.object"},{foreground:"#D6D6DD",token:"variable.parameter.function.js"},{foreground:"#E394DC",token:"keyword.other.template.begin"},{foreground:"#E394DC",token:"keyword.other.template.end"},{foreground:"#E394DC",token:"keyword.other.substitution.begin"},{foreground:"#E394DC",token:"keyword.other.substitution.end"},{foreground:"#D6D6DD",token:"keyword.operator.assignment"},{foreground:"#EFB080",token:"keyword.operator.assignment.go"},{foreground:"#83D6C5",token:"keyword.operator.arithmetic.go"},{foreground:"#83D6C5",token:"keyword.operator.address.go"},{foreground:"#EFB080",token:"entity.name.package.go"},{foreground:"#D6D6DD",token:"support.type.prelude.elm"},{foreground:"#F8C762",token:"support.constant.elm"},{foreground:"#83D6C5",token:"punctuation.quasi.element"},{foreground:"#D6D6DD",token:"constant.character.entity"},{foreground:"#D6D6DD",token:"entity.other.attribute-name.pseudo-element"},{foreground:"#D6D6DD",token:"entity.other.attribute-name.pseudo-class"},{foreground:"#EFB080",token:"entity.global.clojure"},{foreground:"#D6D6DD",token:"meta.symbol.clojure"},{foreground:"#D6D6DD",token:"constant.keyword.clojure"},{foreground:"#D6D6DD",token:"meta.arguments.coffee"},{foreground:"#D6D6DD",token:"variable.parameter.function.coffee"},{foreground:"#E394DC",token:"source.ini"},{foreground:"#D6D6DD",token:"meta.scope.prerequisites.makefile"},{foreground:"#EFB080",token:"source.makefile"},{foreground:"#EFB080",token:"storage.modifier.import.groovy"},{foreground:"#AAA0FA",token:"meta.method.groovy"},{foreground:"#D6D6DD",token:"meta.definition.variable.name.groovy"},{foreground:"#E394DC",token:"meta.definition.class.inherited.classes.groovy"},{foreground:"#EFB080",token:"support.variable.semantic.hlsl"},{foreground:"#83D6C5",token:"support.type.texture.hlsl"},{foreground:"#83D6C5",token:"support.type.sampler.hlsl"},{foreground:"#83D6C5",token:"support.type.object.hlsl"},{foreground:"#83D6C5",token:"support.type.object.rw.hlsl"},{foreground:"#83D6C5",token:"support.type.fx.hlsl"},{foreground:"#83D6C5",token:"support.type.object.hlsl"},{foreground:"#D6D6DD",token:"text.variable"},{foreground:"#D6D6DD",token:"text.bracketed"},{foreground:"#EFB080",token:"support.type.swift"},{foreground:"#EFB080",token:"support.type.vb.asp"},{foreground:"#EFB080",token:"entity.name.function.xi"},{foreground:"#D6D6DD",token:"entity.name.class.xi"},{foreground:"#D6D6DD",token:"constant.character.character-class.regexp.xi"},{foreground:"#83D6C5",token:"constant.regexp.xi"},{foreground:"#D6D6DD",token:"keyword.control.xi"},{foreground:"#D6D6DD",token:"invalid.xi"},{foreground:"#E394DC",token:"beginning.punctuation.definition.quote.markdown.xi"},{foreground:"#6D6D6D",token:"beginning.punctuation.definition.list.markdown.xi"},{foreground:"#AAA0FA",token:"constant.character.xi"},{foreground:"#AAA0FA",token:"accent.xi"},{foreground:"#F8C762",token:"wikiword.xi"},{foreground:"#D6D6DD",token:"constant.other.color.rgb-value.xi"},{foreground:"#6D6D6D",token:"punctuation.definition.tag.xi"},{foreground:"#EFB080",token:"entity.name.label.cs"},{foreground:"#EFB080",token:"entity.name.scope-resolution.function.call"},{foreground:"#EFB080",token:"entity.name.scope-resolution.function.definition"},{foreground:"#D6D6DD",token:"entity.name.label.cs"},{foreground:"#D6D6DD",token:"markup.heading.setext.1.markdown"},{foreground:"#D6D6DD",token:"markup.heading.setext.2.markdown"},{foreground:"#D6D6DD",token:" meta.brace.square"},{foreground:"#6D6D6D",fontStyle:"italic",token:"comment"},{foreground:"#6D6D6D",fontStyle:"italic",token:" punctuation.definition.comment"},{foreground:"#6D6D6D",token:"markup.quote.markdown"},{foreground:"#D6D6DD",token:"punctuation.definition.block.sequence.item.yaml"},{foreground:"#D6D6DD",token:"constant.language.symbol.elixir"},{fontStyle:"italic",token:"entity.other.attribute-name.js"},{fontStyle:"italic",token:"entity.other.attribute-name.ts"},{fontStyle:"italic",token:"entity.other.attribute-name.jsx"},{fontStyle:"italic",token:"entity.other.attribute-name.tsx"},{fontStyle:"italic",token:"variable.parameter"},{fontStyle:"italic",token:"variable.language.super"},{fontStyle:"italic",token:"comment.line.double-slash"},{fontStyle:"italic",token:"comment.block.documentation"},{fontStyle:"italic",token:"keyword.control.import.python"},{fontStyle:"italic",token:"keyword.control.flow.python"},{fontStyle:"italic",token:"markup.italic.markdown"}],encodedTokensColors:[]};let kT;function ul(){if(!kT)throw new Error("Monaco is undefined. Call setMonaco(monaco) first.");return kT}function QX(s){kT=s}function JX(s){const{MarkerSeverity:e}=ul();return s===e.Error?1:s===e.Warning?2:s===e.Info?3:4}function eY(s){const{MarkerSeverity:e}=ul();return s===1?e.Error:s===2?e.Warning:s===3?e.Info:e.Hint}function tY(s){return s}function iY(s){return s}function of(s){return{start:{line:s.startLineNumber-1,character:s.startColumn-1},end:{line:s.endLineNumber-1,character:s.endColumn-1}}}function Zl(s){return{startLineNumber:s.start.line+1,startColumn:s.start.character+1,endLineNumber:s.end.line+1,endColumn:s.end.character+1}}function nY(s){return{location:{range:of(s),uri:String(s.resource)},message:s.message}}function sY(s){const{Uri:e}=ul();return{...Zl(s.location.range),message:s.message,resource:e.parse(s.location.uri)}}function oY(s){const e={message:s.message,range:of(s),severity:JX(s.severity)};return typeof s.code=="string"?e.code=s.code:s.code!=null&&(e.code=s.code.value,e.codeDescription={href:String(s.code.target)}),s.relatedInformation&&(e.relatedInformation=s.relatedInformation.map(nY)),s.tags&&(e.tags=s.tags.map(tY)),s.source!=null&&(e.source=s.source),e}function cW(s,e){var t;const{MarkerSeverity:i,Uri:n}=ul(),o={...Zl(s.range),message:s.message,severity:s.severity?eY(s.severity):(t=void 0)!==null&&t!==void 0?t:i.Error};return s.code!=null&&(o.code=s.codeDescription==null?String(s.code):{value:String(s.code),target:n.parse(s.codeDescription.href)}),s.relatedInformation&&(o.relatedInformation=s.relatedInformation.map(sY)),s.tags&&(o.tags=s.tags.map(iY)),s.source!=null&&(o.source=s.source),o}function rY(s){return{range:Zl(s.range),text:s.newText}}function aY(s){const e={};return s.ignoreIfExists!=null&&(e.ignoreIfExists=s.ignoreIfExists),s.ignoreIfNotExists!=null&&(e.ignoreIfNotExists=s.ignoreIfNotExists),s.overwrite!=null&&(e.overwrite=s.overwrite),s.recursive!=null&&(e.recursive=s.recursive),e}function lY(s){const{Uri:e}=ul(),t=s.kind==="create"?{newResource:e.parse(s.uri)}:s.kind==="delete"?{oldResource:e.parse(s.uri)}:{oldResource:e.parse(s.oldUri),newResource:e.parse(s.newUri)};return s.options&&(t.options=aY(s.options)),t}function p5(s,e,t){const{Uri:i}=ul();return{resource:i.parse(e),versionId:t,textEdit:rY(s)}}function dY(s){var e;const t=[];if(s.changes)for(const[i,n]of Object.entries(s.changes))for(const o of n)t.push(p5(o,i));if(s.documentChanges)for(const i of s.documentChanges)if("textDocument"in i)for(const n of i.edits)t.push(p5(n,i.textDocument.uri,(e=i.textDocument.version)!==null&&e!==void 0?e:void 0));else t.push(lY(i));return{edits:t}}function cY(s,e){const t={title:s.title,isPreferred:s.isPreferred};return s.diagnostics&&(t.diagnostics=s.diagnostics.map(i=>cW(i))),s.disabled&&(t.disabled=s.disabled.reason),s.edit&&(t.edit=dY(s.edit)),s.isPreferred!=null&&(t.isPreferred=s.isPreferred),s.kind&&(t.kind=s.kind),t}function uY(s){const e={diagnostics:s.markers.map(oY),triggerKind:s.trigger};return s.only!=null&&(e.only=[s.only]),e}function hY(s){const e={title:s.title,command:s.id};return s.arguments&&(e.arguments=s.arguments),e}function gY(s){const e={title:s.title,id:s.command};return s.arguments&&(e.arguments=s.arguments),e}function fY(s){return{red:s.red,blue:s.blue,green:s.green,alpha:s.alpha}}function pY(s){return{range:Zl(s.range),color:fY(s.color)}}function mY(s){const{CompletionTriggerKind:e}=ul().languages;return s===e.Invoke?1:s===e.TriggerCharacter?2:3}function _Y(s){const e={triggerKind:mY(s.triggerKind)};return s.triggerCharacter!=null&&(e.triggerCharacter=s.triggerCharacter),e}function vY(s){const{CompletionItemKind:e}=ul().languages;if(s===e.Text)return 1;if(s===e.Method)return 2;if(s===e.Function)return 3;if(s===e.Constructor)return 4;if(s===e.Field)return 5;if(s===e.Variable)return 6;if(s===e.Class)return 7;if(s===e.Interface)return 8;if(s===e.Module)return 9;if(s===e.Property)return 10;if(s===e.Unit)return 11;if(s===e.Value)return 12;if(s===e.Enum)return 13;if(s===e.Keyword)return 14;if(s===e.Snippet)return 15;if(s===e.Color)return 16;if(s===e.File)return 17;if(s===e.Reference)return 18;if(s===e.Folder)return 19;if(s===e.EnumMember)return 20;if(s===e.Constant)return 21;if(s===e.Struct)return 22;if(s===e.Event)return 23;if(s===e.Operator)return 24;if(s===e.TypeParameter)return 25}function bY(s){const{CompletionItemKind:e}=ul().languages;return s===1?e.Text:s===2?e.Method:s===3?e.Function:s===4?e.Constructor:s===5?e.Field:s===6?e.Variable:s===7?e.Class:s===8?e.Interface:s===9?e.Module:s===10?e.Property:s===11?e.Unit:s===12?e.Value:s===13?e.Enum:s===14?e.Keyword:s===15?e.Snippet:s===16?e.Color:s===17?e.File:s===18?e.Reference:s===19?e.Folder:s===20?e.EnumMember:s===21?e.Constant:s===22?e.Struct:s===23?e.Event:s===24?e.Operator:e.TypeParameter}function CY(s){return s}function wY(s){return s}function yY(s){return{kind:"markdown",value:s.value}}function uW(s){return{value:s.value}}function SY(s){var e;return{newText:(e=s.text)!==null&&e!==void 0?e:"",range:of(s.range)}}function DY(s){return{range:Zl(s.range),text:s.newText}}function LY(s,e){return"insert"in s?{newText:e,insert:of(s.insert),replace:of(s.replace)}:{newText:e,range:of(s)}}function xY(s){const{CompletionItemInsertTextRule:e}=ul().languages,t={kind:vY(s.kind),label:typeof s.label=="string"?s.label:s.label.label,textEdit:LY(s.range,s.insertText)};return s.additionalTextEdits&&(t.additionalTextEdits=s.additionalTextEdits.map(SY)),s.command&&(t.command=hY(s.command)),s.commitCharacters&&(t.commitCharacters=s.commitCharacters),s.detail!=null&&(t.detail=s.detail),typeof s.documentation=="string"?t.documentation=s.documentation:s.documentation&&(t.documentation=yY(s.documentation)),s.filterText!=null&&(t.filterText=s.filterText),s.insertTextRules===e.InsertAsSnippet?t.insertTextFormat=2:s.insertTextRules===e.KeepWhitespace&&(t.insertTextMode=2),s.preselect!=null&&(t.preselect=s.preselect),s.sortText!=null&&(t.sortText=s.sortText),s.tags&&(t.tags=s.tags.map(CY)),t}function kY(s){return"range"in s?Zl(s.range):"insert"in s&&"replace"in s?{insert:Zl(s.insert),replace:Zl(s.replace)}:Zl(s)}function hW(s,e){var t,i,n,o,r;const{CompletionItemInsertTextRule:a,CompletionItemKind:l}=ul().languages,d=(t=e.itemDefaults)!==null&&t!==void 0?t:{},c=(i=s.textEdit)!==null&&i!==void 0?i:d.editRange,u=(n=s.commitCharacters)!==null&&n!==void 0?n:d.commitCharacters,h=(o=s.insertTextFormat)!==null&&o!==void 0?o:d.insertTextFormat,g=(r=s.insertTextMode)!==null&&r!==void 0?r:d.insertTextMode;let f=s.insertText,m;c?(m=kY(c),"newText"in c&&(f=c.newText)):m={...e.range};const _={insertText:f??"",kind:s.kind==null?l.Text:bY(s.kind),label:s.label,range:m};return s.additionalTextEdits&&(_.additionalTextEdits=s.additionalTextEdits.map(DY)),s.command&&(_.command=gY(s.command)),u&&(_.commitCharacters=u),s.detail!=null&&(_.detail=s.detail),typeof s.documentation=="string"?_.documentation=s.documentation:s.documentation&&(_.documentation=uW(s.documentation)),s.filterText!=null&&(_.filterText=s.filterText),h===2?_.insertTextRules=a.InsertAsSnippet:g===2&&(_.insertTextRules=a.KeepWhitespace),s.preselect!=null&&(_.preselect=s.preselect),s.sortText!=null&&(_.sortText=s.sortText),s.tags&&(_.tags=s.tags.map(wY)),_}function EY(s,e){return{incomplete:!!s.isIncomplete,suggestions:s.items.map(t=>hW(t,{range:e.range,itemDefaults:s.itemDefaults}))}}function m5(s){return typeof s=="string"?{value:s}:{value:`\`\`\`${s.language} ${s.value} \`\`\``}}function IY(s){return typeof s=="string"||"language"in s?[m5(s)]:Array.isArray(s)?s.map(m5):[uW(s)]}function TY(s){const e={contents:IY(s.contents)};return s.range&&(e.range=Zl(s.range)),e}function gW(s){return{character:s.column-1,line:s.lineNumber-1}}function NY(s,e,t){const i=new Map,n=u=>{if(e==="*")return!0;const h=u.getLanguageId();return Array.isArray(e)?e.includes(h):e===h},o=async u=>{const h=u.getVersionId(),g=await t.provideMarkerData(u);!u.isDisposed()&&h===u.getVersionId()&&n(u)&&s.editor.setModelMarkers(u,t.owner,g??[])},r=u=>{if(!n(u))return;let h;const g=u.onDidChangeContent(()=>{clearTimeout(h),h=setTimeout(()=>{o(u)},500)});i.set(u,{dispose(){clearTimeout(h),g.dispose()}}),o(u)},a=u=>{s.editor.setModelMarkers(u,t.owner,[]);const h=i.get(u);h&&(h.dispose(),i.delete(u))},l=s.editor.onDidCreateModel(r),d=s.editor.onWillDisposeModel(u=>{var h;a(u),(h=t.doReset)==null||h.call(t,u)}),c=s.editor.onDidChangeModelLanguage(({model:u})=>{var h;a(u),r(u),(h=t.doReset)==null||h.call(t,u)});for(const u of s.editor.getModels())r(u);return{dispose(){for(const u of i.keys())a(u);l.dispose(),d.dispose(),c.dispose()},async revalidate(){await Promise.all(s.editor.getModels().map(o))}}}function AY(s,e){let{createData:t,interval:i=3e4,label:n,moduleId:o,stopWhenIdleFor:r=12e4}=e,a,l=0,d=!1;const c=()=>{a&&(a.dispose(),a=void 0)},u=setInterval(()=>{if(!a)return;Date.now()-l>r&&c()},i);return{dispose(){d=!0,clearInterval(u),c()},getWorker(...h){if(d)throw new Error("Worker manager has been disposed");return l=Date.now(),a||(a=s.editor.createWebWorker({createData:t,label:n,moduleId:o})),a.withSyncedResources(h)},updateCreateData(h){t=h,c()}}}function Ws(s,e){MY(s)&&(s="100%");var t=RY(s);return s=e===360?s:Math.min(e,Math.max(0,parseFloat(s))),t&&(s=parseInt(String(s*e),10)/100),Math.abs(s-e)<1e-6?1:(e===360?s=(s<0?s%e+e:s%e)/parseFloat(String(e)):s=s%e/parseFloat(String(e)),s)}function tw(s){return Math.min(1,Math.max(0,s))}function MY(s){return typeof s=="string"&&s.indexOf(".")!==-1&&parseFloat(s)===1}function RY(s){return typeof s=="string"&&s.indexOf("%")!==-1}function fW(s){return s=parseFloat(s),(isNaN(s)||s<0||s>1)&&(s=1),s}function jg(s){return s<=1?"".concat(Number(s)*100,"%"):s}function Kg(s){return s.length===1?"0"+s:String(s)}function PY(s,e,t){return{r:Ws(s,255)*255,g:Ws(e,255)*255,b:Ws(t,255)*255}}function _5(s,e,t){s=Ws(s,255),e=Ws(e,255),t=Ws(t,255);var i=Math.max(s,e,t),n=Math.min(s,e,t),o=0,r=0,a=(i+n)/2;if(i===n)r=0,o=0;else{var l=i-n;switch(r=a>.5?l/(2-i-n):l/(i+n),i){case s:o=(e-t)/l+(e1&&(t-=1),t<1/6?s+(e-s)*(6*t):t<1/2?e:t<2/3?s+(e-s)*(2/3-t)*6:s}function FY(s,e,t){var i,n,o;if(s=Ws(s,360),e=Ws(e,100),t=Ws(t,100),e===0)n=t,o=t,i=t;else{var r=t<.5?t*(1+e):t+e-t*e,a=2*t-r;i=gE(a,r,s+1/3),n=gE(a,r,s),o=gE(a,r,s-1/3)}return{r:i*255,g:n*255,b:o*255}}function v5(s,e,t){s=Ws(s,255),e=Ws(e,255),t=Ws(t,255);var i=Math.max(s,e,t),n=Math.min(s,e,t),o=0,r=i,a=i-n,l=i===0?0:a/i;if(i===n)o=0;else{switch(i){case s:o=(e-t)/a+(e>16,g:(s&65280)>>8,b:s&255}}var CS={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function VY(s){var e={r:0,g:0,b:0},t=1,i=null,n=null,o=null,r=!1,a=!1;return typeof s=="string"&&(s=$Y(s)),typeof s=="object"&&(Bd(s.r)&&Bd(s.g)&&Bd(s.b)?(e=PY(s.r,s.g,s.b),r=!0,a=String(s.r).substr(-1)==="%"?"prgb":"rgb"):Bd(s.h)&&Bd(s.s)&&Bd(s.v)?(i=jg(s.s),n=jg(s.v),e=OY(s.h,i,n),r=!0,a="hsv"):Bd(s.h)&&Bd(s.s)&&Bd(s.l)&&(i=jg(s.s),o=jg(s.l),e=FY(s.h,i,o),r=!0,a="hsl"),Object.prototype.hasOwnProperty.call(s,"a")&&(t=s.a)),t=fW(t),{ok:r,format:s.format||a,r:Math.min(255,Math.max(e.r,0)),g:Math.min(255,Math.max(e.g,0)),b:Math.min(255,Math.max(e.b,0)),a:t}}var zY="[-\\+]?\\d+%?",UY="[-\\+]?\\d*\\.\\d+%?",Fu="(?:".concat(UY,")|(?:").concat(zY,")"),fE="[\\s|\\(]+(".concat(Fu,")[,|\\s]+(").concat(Fu,")[,|\\s]+(").concat(Fu,")\\s*\\)?"),pE="[\\s|\\(]+(".concat(Fu,")[,|\\s]+(").concat(Fu,")[,|\\s]+(").concat(Fu,")[,|\\s]+(").concat(Fu,")\\s*\\)?"),Ea={CSS_UNIT:new RegExp(Fu),rgb:new RegExp("rgb"+fE),rgba:new RegExp("rgba"+pE),hsl:new RegExp("hsl"+fE),hsla:new RegExp("hsla"+pE),hsv:new RegExp("hsv"+fE),hsva:new RegExp("hsva"+pE),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function $Y(s){if(s=s.trim().toLowerCase(),s.length===0)return!1;var e=!1;if(CS[s])s=CS[s],e=!0;else if(s==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var t=Ea.rgb.exec(s);return t?{r:t[1],g:t[2],b:t[3]}:(t=Ea.rgba.exec(s),t?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=Ea.hsl.exec(s),t?{h:t[1],s:t[2],l:t[3]}:(t=Ea.hsla.exec(s),t?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=Ea.hsv.exec(s),t?{h:t[1],s:t[2],v:t[3]}:(t=Ea.hsva.exec(s),t?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=Ea.hex8.exec(s),t?{r:vr(t[1]),g:vr(t[2]),b:vr(t[3]),a:C5(t[4]),format:e?"name":"hex8"}:(t=Ea.hex6.exec(s),t?{r:vr(t[1]),g:vr(t[2]),b:vr(t[3]),format:e?"name":"hex"}:(t=Ea.hex4.exec(s),t?{r:vr(t[1]+t[1]),g:vr(t[2]+t[2]),b:vr(t[3]+t[3]),a:C5(t[4]+t[4]),format:e?"name":"hex8"}:(t=Ea.hex3.exec(s),t?{r:vr(t[1]+t[1]),g:vr(t[2]+t[2]),b:vr(t[3]+t[3]),format:e?"name":"hex"}:!1)))))))))}function Bd(s){return!!Ea.CSS_UNIT.exec(String(s))}var jY=function(){function s(e,t){e===void 0&&(e=""),t===void 0&&(t={});var i;if(e instanceof s)return e;typeof e=="number"&&(e=HY(e)),this.originalInput=e;var n=VY(e);this.originalInput=e,this.r=n.r,this.g=n.g,this.b=n.b,this.a=n.a,this.roundA=Math.round(100*this.a)/100,this.format=(i=t.format)!==null&&i!==void 0?i:n.format,this.gradientType=t.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=n.ok}return s.prototype.isDark=function(){return this.getBrightness()<128},s.prototype.isLight=function(){return!this.isDark()},s.prototype.getBrightness=function(){var e=this.toRgb();return(e.r*299+e.g*587+e.b*114)/1e3},s.prototype.getLuminance=function(){var e=this.toRgb(),t,i,n,o=e.r/255,r=e.g/255,a=e.b/255;return o<=.03928?t=o/12.92:t=Math.pow((o+.055)/1.055,2.4),r<=.03928?i=r/12.92:i=Math.pow((r+.055)/1.055,2.4),a<=.03928?n=a/12.92:n=Math.pow((a+.055)/1.055,2.4),.2126*t+.7152*i+.0722*n},s.prototype.getAlpha=function(){return this.a},s.prototype.setAlpha=function(e){return this.a=fW(e),this.roundA=Math.round(100*this.a)/100,this},s.prototype.isMonochrome=function(){var e=this.toHsl().s;return e===0},s.prototype.toHsv=function(){var e=v5(this.r,this.g,this.b);return{h:e.h*360,s:e.s,v:e.v,a:this.a}},s.prototype.toHsvString=function(){var e=v5(this.r,this.g,this.b),t=Math.round(e.h*360),i=Math.round(e.s*100),n=Math.round(e.v*100);return this.a===1?"hsv(".concat(t,", ").concat(i,"%, ").concat(n,"%)"):"hsva(".concat(t,", ").concat(i,"%, ").concat(n,"%, ").concat(this.roundA,")")},s.prototype.toHsl=function(){var e=_5(this.r,this.g,this.b);return{h:e.h*360,s:e.s,l:e.l,a:this.a}},s.prototype.toHslString=function(){var e=_5(this.r,this.g,this.b),t=Math.round(e.h*360),i=Math.round(e.s*100),n=Math.round(e.l*100);return this.a===1?"hsl(".concat(t,", ").concat(i,"%, ").concat(n,"%)"):"hsla(".concat(t,", ").concat(i,"%, ").concat(n,"%, ").concat(this.roundA,")")},s.prototype.toHex=function(e){return e===void 0&&(e=!1),b5(this.r,this.g,this.b,e)},s.prototype.toHexString=function(e){return e===void 0&&(e=!1),"#"+this.toHex(e)},s.prototype.toHex8=function(e){return e===void 0&&(e=!1),BY(this.r,this.g,this.b,this.a,e)},s.prototype.toHex8String=function(e){return e===void 0&&(e=!1),"#"+this.toHex8(e)},s.prototype.toHexShortString=function(e){return e===void 0&&(e=!1),this.a===1?this.toHexString(e):this.toHex8String(e)},s.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},s.prototype.toRgbString=function(){var e=Math.round(this.r),t=Math.round(this.g),i=Math.round(this.b);return this.a===1?"rgb(".concat(e,", ").concat(t,", ").concat(i,")"):"rgba(".concat(e,", ").concat(t,", ").concat(i,", ").concat(this.roundA,")")},s.prototype.toPercentageRgb=function(){var e=function(t){return"".concat(Math.round(Ws(t,255)*100),"%")};return{r:e(this.r),g:e(this.g),b:e(this.b),a:this.a}},s.prototype.toPercentageRgbString=function(){var e=function(t){return Math.round(Ws(t,255)*100)};return this.a===1?"rgb(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%)"):"rgba(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%, ").concat(this.roundA,")")},s.prototype.toName=function(){if(this.a===0)return"transparent";if(this.a<1)return!1;for(var e="#"+b5(this.r,this.g,this.b,!1),t=0,i=Object.entries(CS);t=0,o=!t&&n&&(e.startsWith("hex")||e==="name");return o?e==="name"&&this.a===0?this.toName():this.toRgbString():(e==="rgb"&&(i=this.toRgbString()),e==="prgb"&&(i=this.toPercentageRgbString()),(e==="hex"||e==="hex6")&&(i=this.toHexString()),e==="hex3"&&(i=this.toHexString(!0)),e==="hex4"&&(i=this.toHex8String(!0)),e==="hex8"&&(i=this.toHex8String()),e==="name"&&(i=this.toName()),e==="hsl"&&(i=this.toHslString()),e==="hsv"&&(i=this.toHsvString()),i||this.toHexString())},s.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},s.prototype.clone=function(){return new s(this.toString())},s.prototype.lighten=function(e){e===void 0&&(e=10);var t=this.toHsl();return t.l+=e/100,t.l=tw(t.l),new s(t)},s.prototype.brighten=function(e){e===void 0&&(e=10);var t=this.toRgb();return t.r=Math.max(0,Math.min(255,t.r-Math.round(255*-(e/100)))),t.g=Math.max(0,Math.min(255,t.g-Math.round(255*-(e/100)))),t.b=Math.max(0,Math.min(255,t.b-Math.round(255*-(e/100)))),new s(t)},s.prototype.darken=function(e){e===void 0&&(e=10);var t=this.toHsl();return t.l-=e/100,t.l=tw(t.l),new s(t)},s.prototype.tint=function(e){return e===void 0&&(e=10),this.mix("white",e)},s.prototype.shade=function(e){return e===void 0&&(e=10),this.mix("black",e)},s.prototype.desaturate=function(e){e===void 0&&(e=10);var t=this.toHsl();return t.s-=e/100,t.s=tw(t.s),new s(t)},s.prototype.saturate=function(e){e===void 0&&(e=10);var t=this.toHsl();return t.s+=e/100,t.s=tw(t.s),new s(t)},s.prototype.greyscale=function(){return this.desaturate(100)},s.prototype.spin=function(e){var t=this.toHsl(),i=(t.h+e)%360;return t.h=i<0?360+i:i,new s(t)},s.prototype.mix=function(e,t){t===void 0&&(t=50);var i=this.toRgb(),n=new s(e).toRgb(),o=t/100,r={r:(n.r-i.r)*o+i.r,g:(n.g-i.g)*o+i.g,b:(n.b-i.b)*o+i.b,a:(n.a-i.a)*o+i.a};return new s(r)},s.prototype.analogous=function(e,t){e===void 0&&(e=6),t===void 0&&(t=30);var i=this.toHsl(),n=360/t,o=[this];for(i.h=(i.h-(n*e>>1)+720)%360;--e;)i.h=(i.h+n)%360,o.push(new s(i));return o},s.prototype.complement=function(){var e=this.toHsl();return e.h=(e.h+180)%360,new s(e)},s.prototype.monochromatic=function(e){e===void 0&&(e=6);for(var t=this.toHsv(),i=t.h,n=t.s,o=t.v,r=[],a=1/e;e--;)r.push(new s({h:i,s:n,v:o})),o=(o+a)%1;return r},s.prototype.splitcomplement=function(){var e=this.toHsl(),t=e.h;return[this,new s({h:(t+72)%360,s:e.s,l:e.l}),new s({h:(t+216)%360,s:e.s,l:e.l})]},s.prototype.onBackground=function(e){var t=this.toRgb(),i=new s(e).toRgb(),n=t.a+i.a*(1-t.a);return new s({r:(t.r*t.a+i.r*i.a*(1-t.a))/n,g:(t.g*t.a+i.g*i.a*(1-t.a))/n,b:(t.b*t.a+i.b*i.a*(1-t.a))/n,a:n})},s.prototype.triad=function(){return this.polyad(3)},s.prototype.tetrad=function(){return this.polyad(4)},s.prototype.polyad=function(e){for(var t=this.toHsl(),i=t.h,n=[this],o=360/e,r=1;r{t.delete(i)}),{async provideDocumentColors(i){const n=await e(i.uri),o=[],r=[],a=await n.getDocumentColors(String(i.uri),i.getLanguageId());if(a)for(const l of a){const d=pY(l),c=i.getValueInRange(d.range);qY.test(c)?o.push(d):r.push(d)}return t.set(i,i.deltaDecorations(t.get(i)??[],r.map(({color:l,range:d})=>({range:d,options:{before:{content:" ",inlineClassName:`${GY(l)} colorpicker-color-decoration`,inlineClassNameAffectsLetterSpacing:!0}}})))),o},provideColorPresentations(i,n){const o=i.getValueInRange(n.range),r=new RegExp(`-\\[(${ET.join("|")}|(?:(?:#|rgba?\\(|hsla?\\())[^\\]]+)\\]$`,"i").exec(o);if(!r)return[];const[a]=r,l=ET.includes(a),d=KY({r:n.color.red,g:n.color.green,b:n.color.blue,a:n.color.alpha});let c=d.toHex8String(!l&&(a.length===4||a.length===5));c.length===5?c=c.replace(/f$/,""):c.length===9&&(c=c.replace(/ff$/,""));const u=d.toRgbString().replaceAll(" ",""),h=d.toHslString().replaceAll(" ",""),g=o.slice(0,Math.max(0,r.index));return[{label:`${g}-[${c}]`},{label:`${g}-[${u}]`},{label:`${g}-[${h}]`}]}}}function XY(s){return{async provideHover(e,t){const n=await(await s(e.uri)).doHover(String(e.uri),e.getLanguageId(),gW(t));return n&&TY(n)}}}function YY(s){return{async provideCodeActions(e,t,i){const o=await(await s(e.uri)).doCodeActions(String(e.uri),e.getLanguageId(),of(t),uY(i));if(o)return{actions:o.map(r=>cY(r)),dispose(){}}}}}function QY(s){return{async provideCompletionItems(e,t,i){const o=await(await s(e.uri)).doComplete(String(e.uri),e.getLanguageId(),gW(t),_Y(i));if(!o)return;const r=e.getWordUntilPosition(t);return EY(o,{range:{startLineNumber:t.lineNumber,startColumn:r.startColumn,endLineNumber:t.lineNumber,endColumn:r.endColumn}})},async resolveCompletionItem(e){const i=await(await s()).resolveCompletionItem(xY(e));return hW(i,{range:e.range})}}}function JY(s){return{owner:"tailwindcss",async provideMarkerData(e){const i=await(await s(e.uri)).doValidate(String(e.uri),e.getLanguageId());return i==null?void 0:i.map(n=>cW(n))}}}function AL(s,e){return{name:`@${s}`,description:{kind:"markdown",value:e},references:[{name:`@${s} documentation`,url:`https://tailwindcss.com/docs/functions-and-directives#${s}`}]}}var eQ=AL("tailwind",`Use the \`@tailwind\` directive to insert Tailwind's \`base\`, \`components\`, \`utilities\` and \`variants\` styles into your CSS. \`\`\`css /** * This injects Tailwind's base styles and any base styles registered by * plugins. */ @tailwind base; /** * This injects Tailwind's component classes and any component classes * registered by plugins. */ @tailwind components; /** * This injects Tailwind's utility classes and any utility classes registered * by plugins. */ @tailwind utilities; /** * Use this directive to control where Tailwind injects the hover, focus, * responsive, dark mode, and other variants of each class. * * If omitted, Tailwind will append these classes to the very end of * your stylesheet by default. */ @tailwind variants; \`\`\``),tQ=AL("layer",`Use the \`@layer\` directive to tell Tailwind which "bucket" a set of custom styles belong to. Valid layers are \`base\`, \`components\`, and \`utilities\`. \`\`\`css @tailwind base; @tailwind components; @tailwind utilities; @layer base { h1 { @apply text-2xl; } h2 { @apply text-xl; } } @layer components { .btn-blue { @apply bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded; } } @layer utilities { .filter-none { filter: none; } .filter-grayscale { filter: grayscale(100%); } } \`\`\` Tailwind will automatically move any CSS within a \`@layer\` directive to the same place as the corresponding \`@tailwind\` rule, so you don't have to worry about authoring your CSS in a specific order to avoid specificity issues. Any custom CSS added to a layer will only be included in the final build if that CSS is actually used in your HTML, just like all of the classes built in to Tailwind by default. Wrapping any custom CSS in a \`@layer\` directive also makes it possible to use modifiers with those rules, like \`hover:\` and \`focus:\` or responsive modifiers like \`md:\` and \`lg:\`.`),iQ=AL("apply",`Use \`@apply\` to inline any existing utility classes into your own custom CSS. This is useful when you need to write custom CSS (like to override the styles in a third-party library) but still want to work with your design tokens and use the same syntax you're used to using in your HTML. \`\`\`css .select2-dropdown { @apply rounded-b-lg shadow-md; } .select2-search { @apply border border-gray-300 rounded; } .select2-results__group { @apply text-lg font-bold text-gray-900; } \`\`\` Any rules inlined with \`@apply\` will have \`!important\` **removed** by default to avoid specificity issues: \`\`\`css /* Input */ .foo { color: blue !important; } .bar { @apply foo; } /* Output */ .foo { color: blue !important; } .bar { color: blue; } \`\`\` If you'd like to \`@apply\` an existing class and make it \`!important\`, simply add \`!important\` to the end of the declaration: \`\`\`css /* Input */ .btn { @apply font-bold py-2 px-4 rounded !important; } /* Output */ .btn { font-weight: 700 !important; padding-top: .5rem !important; padding-bottom: .5rem !important; padding-right: 1rem !important; padding-left: 1rem !important; border-radius: .25rem !important; } \`\`\` Note that if you're using Sass/SCSS, you'll need to use Sass' interpolation feature to get this to work: \`\`\`css .btn { @apply font-bold py-2 px-4 rounded #{!important}; } \`\`\``),nQ=AL("config",'Use the `@config` directive to specify which config file Tailwind should use when compiling CSS file. This is useful for projects that need to use different configuration files for different CSS entry points.\n\n```css\n@config "./tailwind.site.config.js";\n@tailwind base;\n@tailwind components;\n@tailwind utilities;\n```\n\n```css\n@config "./tailwind.admin.config.js";\n@tailwind base;\n@tailwind components;\n@tailwind utilities;\n```\n\nThe path you provide to the `@config` directive is relative to that CSS file, and will take precedence over a path defined in your PostCSS configuration or in the Tailwind CLI.'),sQ={version:1.1,atDirectives:[eQ,tQ,iQ,nQ]},oQ=["css","javascript","html","mdx","typescript"],rQ=(s,{languageSelector:e=oQ,tailwindConfig:t}={})=>{QX(s);const i=AY(s,{label:"tailwindcss",moduleId:"monaco-tailwindcss/tailwindcss.worker",createData:{tailwindConfig:t}}),n=[i,s.languages.registerCodeActionProvider(e,YY(i.getWorker)),s.languages.registerColorProvider(e,ZY(s,i.getWorker)),s.languages.registerCompletionItemProvider(e,QY(i.getWorker)),s.languages.registerHoverProvider(e,XY(i.getWorker))];for(const o of Array.isArray(e)?e:[e])typeof o=="string"&&n.push(NY(s,o,JY(i.getWorker)));return{dispose(){for(const o of n)o.dispose()},setTailwindConfig(o){i.updateCreateData({tailwindConfig:o})},async generateStylesFromContent(o,r){return(await i.getWorker()).generateStylesFromContent(o,r.map(l=>typeof l=="string"?{content:l}:l))}}},aQ=Object.defineProperty,pW=s=>{throw TypeError(s)},ML=(s,e)=>{for(var t in e)aQ(s,t,{get:e[t],enumerable:!0})},mW=(s,e,t)=>e.has(s)||pW("Cannot "+t),uu=(s,e,t)=>(mW(s,e,"read from private field"),e.get(s)),lQ=(s,e,t)=>e.has(s)?pW("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(s):e.set(s,t),dQ=(s,e,t,i)=>(mW(s,e,"write to private field"),e.set(s,t),t),_W={};ML(_W,{languages:()=>bse,options:()=>_se,printers:()=>vse});var cQ=[{linguistLanguageId:183,name:"JavaScript",type:"programming",tmScope:"source.js",aceMode:"javascript",codemirrorMode:"javascript",codemirrorMimeType:"text/javascript",color:"#f1e05a",aliases:["js","node"],extensions:[".js","._js",".bones",".cjs",".es",".es6",".frag",".gs",".jake",".javascript",".jsb",".jscad",".jsfl",".jslib",".jsm",".jspre",".jss",".mjs",".njs",".pac",".sjs",".ssjs",".xsjs",".xsjslib",".wxs"],filenames:["Jakefile"],interpreters:["chakra","d8","gjs","js","node","nodejs","qjs","rhino","v8","v8-shell","zx"],parsers:["babel","acorn","espree","meriyah","babel-flow","babel-ts","flow","typescript"],vscodeLanguageIds:["javascript","mongo"]},{linguistLanguageId:183,name:"Flow",type:"programming",tmScope:"source.js",aceMode:"javascript",codemirrorMode:"javascript",codemirrorMimeType:"text/javascript",color:"#f1e05a",aliases:[],extensions:[".js.flow"],filenames:[],interpreters:["chakra","d8","gjs","js","node","nodejs","qjs","rhino","v8","v8-shell"],parsers:["flow","babel-flow"],vscodeLanguageIds:["javascript"]},{linguistLanguageId:183,name:"JSX",type:"programming",tmScope:"source.js.jsx",aceMode:"javascript",codemirrorMode:"jsx",codemirrorMimeType:"text/jsx",color:void 0,aliases:void 0,extensions:[".jsx"],filenames:void 0,interpreters:void 0,parsers:["babel","babel-flow","babel-ts","flow","typescript","espree","meriyah"],vscodeLanguageIds:["javascriptreact"],group:"JavaScript"},{linguistLanguageId:378,name:"TypeScript",type:"programming",color:"#3178c6",aliases:["ts"],interpreters:["deno","ts-node"],extensions:[".ts",".cts",".mts"],tmScope:"source.ts",aceMode:"typescript",codemirrorMode:"javascript",codemirrorMimeType:"application/typescript",parsers:["typescript","babel-ts"],vscodeLanguageIds:["typescript"]},{linguistLanguageId:94901924,name:"TSX",type:"programming",color:"#3178c6",group:"TypeScript",extensions:[".tsx"],tmScope:"source.tsx",aceMode:"javascript",codemirrorMode:"jsx",codemirrorMimeType:"text/jsx",parsers:["typescript","babel-ts"],vscodeLanguageIds:["typescriptreact"]}],vW={};ML(vW,{canAttachComment:()=>_ee,embed:()=>ste,experimentalFeatures:()=>lse,getCommentChildNodes:()=>vee,getVisitorKeys:()=>yW,handleComments:()=>zW,insertPragma:()=>_te,isBlockComment:()=>Ca,isGap:()=>bee,massageAstNode:()=>pJ,print:()=>ase,printComment:()=>PJ,willPrintOwnComments:()=>JW});var uQ=(s,e,t,i)=>{if(!(s&&e==null))return e.replaceAll?e.replaceAll(t,i):t.global?e.replace(t,i):e.split(t).join(i)},As=uQ,hQ=(s,e,t)=>{if(!(s&&e==null))return Array.isArray(e)||typeof e=="string"?e[t<0?e.length+t:t]:e.at(t)},Si=hQ;function gQ(s){return s!==null&&typeof s=="object"}var fQ=gQ;function*pQ(s,e){let{getVisitorKeys:t,filter:i=()=>!0}=e,n=o=>fQ(o)&&i(o);for(let o of t(s)){let r=s[o];if(Array.isArray(r))for(let a of r)n(a)&&(yield a);else n(r)&&(yield r)}}function*mQ(s,e){let t=[s];for(let i=0;i/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;function bQ(s){return s===12288||s>=65281&&s<=65376||s>=65504&&s<=65510}function CQ(s){return s>=4352&&s<=4447||s===8986||s===8987||s===9001||s===9002||s>=9193&&s<=9196||s===9200||s===9203||s===9725||s===9726||s===9748||s===9749||s>=9776&&s<=9783||s>=9800&&s<=9811||s===9855||s>=9866&&s<=9871||s===9875||s===9889||s===9898||s===9899||s===9917||s===9918||s===9924||s===9925||s===9934||s===9940||s===9962||s===9970||s===9971||s===9973||s===9978||s===9981||s===9989||s===9994||s===9995||s===10024||s===10060||s===10062||s>=10067&&s<=10069||s===10071||s>=10133&&s<=10135||s===10160||s===10175||s===11035||s===11036||s===11088||s===11093||s>=11904&&s<=11929||s>=11931&&s<=12019||s>=12032&&s<=12245||s>=12272&&s<=12287||s>=12289&&s<=12350||s>=12353&&s<=12438||s>=12441&&s<=12543||s>=12549&&s<=12591||s>=12593&&s<=12686||s>=12688&&s<=12773||s>=12783&&s<=12830||s>=12832&&s<=12871||s>=12880&&s<=42124||s>=42128&&s<=42182||s>=43360&&s<=43388||s>=44032&&s<=55203||s>=63744&&s<=64255||s>=65040&&s<=65049||s>=65072&&s<=65106||s>=65108&&s<=65126||s>=65128&&s<=65131||s>=94176&&s<=94180||s===94192||s===94193||s>=94208&&s<=100343||s>=100352&&s<=101589||s>=101631&&s<=101640||s>=110576&&s<=110579||s>=110581&&s<=110587||s===110589||s===110590||s>=110592&&s<=110882||s===110898||s>=110928&&s<=110930||s===110933||s>=110948&&s<=110951||s>=110960&&s<=111355||s>=119552&&s<=119638||s>=119648&&s<=119670||s===126980||s===127183||s===127374||s>=127377&&s<=127386||s>=127488&&s<=127490||s>=127504&&s<=127547||s>=127552&&s<=127560||s===127568||s===127569||s>=127584&&s<=127589||s>=127744&&s<=127776||s>=127789&&s<=127797||s>=127799&&s<=127868||s>=127870&&s<=127891||s>=127904&&s<=127946||s>=127951&&s<=127955||s>=127968&&s<=127984||s===127988||s>=127992&&s<=128062||s===128064||s>=128066&&s<=128252||s>=128255&&s<=128317||s>=128331&&s<=128334||s>=128336&&s<=128359||s===128378||s===128405||s===128406||s===128420||s>=128507&&s<=128591||s>=128640&&s<=128709||s===128716||s>=128720&&s<=128722||s>=128725&&s<=128727||s>=128732&&s<=128735||s===128747||s===128748||s>=128756&&s<=128764||s>=128992&&s<=129003||s===129008||s>=129292&&s<=129338||s>=129340&&s<=129349||s>=129351&&s<=129535||s>=129648&&s<=129660||s>=129664&&s<=129673||s>=129679&&s<=129734||s>=129742&&s<=129756||s>=129759&&s<=129769||s>=129776&&s<=129784||s>=131072&&s<=196605||s>=196608&&s<=262141}var wQ=s=>!(bQ(s)||CQ(s)),yQ=/[^\x20-\x7F]/u;function SQ(s){if(!s)return 0;if(!yQ.test(s))return s.length;s=s.replace(vQ()," ");let e=0;for(let t of s){let i=t.codePointAt(0);i<=31||i>=127&&i<=159||i>=768&&i<=879||(e+=wQ(i)?1:2)}return e}var Qm=SQ;function cP(s){return(e,t,i)=>{let n=!!(i!=null&&i.backwards);if(t===!1)return!1;let{length:o}=e,r=t;for(;r>=0&&r0}var mi=NQ,bW=new Proxy(()=>{},{get:()=>bW}),fP=bW,iw="'",w5='"';function AQ(s,e){let t=e===!0||e===iw?iw:w5,i=t===iw?w5:iw,n=0,o=0;for(let r of s)r===t?n++:r===i&&o++;return n>o?i:t}var CW=AQ;function MQ(s,e,t){let i=e==='"'?"'":'"',n=As(!1,s,/\\(.)|(["'])/gsu,(o,r,a)=>r===i?r:a===e?"\\"+a:a||(t&&/^[^\n\r"'0-7\\bfnrt-vx\u2028\u2029]$/u.test(r)?r:"\\"+r));return e+n+e}var RQ=MQ;function PQ(s,e){fP.ok(/^(?["']).*\k$/su.test(s));let t=s.slice(1,-1),i=e.parser==="json"||e.parser==="jsonc"||e.parser==="json5"&&e.quoteProps==="preserve"&&!e.singleQuote?'"':e.__isInHtmlAttribute?"'":CW(t,e.singleQuote);return s.charAt(0)===i?s:RQ(t,i,!1)}var t_=PQ;function Ln(s){var e,t,i;let n=((e=s.range)==null?void 0:e[0])??s.start,o=(i=((t=s.declaration)==null?void 0:t.decorators)??s.decorators)==null?void 0:i[0];return o?Math.min(Ln(o),n):n}function oi(s){var e;return((e=s.range)==null?void 0:e[1])??s.end}function RL(s,e){let t=Ln(s);return Number.isInteger(t)&&t===Ln(e)}function FQ(s,e){let t=oi(s);return Number.isInteger(t)&&t===oi(e)}function OQ(s,e){return RL(s,e)&&FQ(s,e)}var N0=null;function Ov(s){if(N0!==null&&typeof N0.property){let e=N0;return N0=Ov.prototype=null,e}return N0=Ov.prototype=s??Object.create(null),new Ov}var BQ=10;for(let s=0;s<=BQ;s++)Ov();function WQ(s){return Ov(s)}function HQ(s,e="type"){WQ(s);function t(i){let n=i[e],o=s[n];if(!Array.isArray(o))throw Object.assign(new Error(`Missing visitor keys for '${n}'.`),{node:i});return o}return t}var wW=HQ,VQ={ArrayExpression:["elements"],AssignmentExpression:["left","right"],BinaryExpression:["left","right"],InterpreterDirective:[],Directive:["value"],DirectiveLiteral:[],BlockStatement:["directives","body"],BreakStatement:["label"],CallExpression:["callee","arguments","typeParameters","typeArguments"],CatchClause:["param","body"],ConditionalExpression:["test","consequent","alternate"],ContinueStatement:["label"],DebuggerStatement:[],DoWhileStatement:["body","test"],EmptyStatement:[],ExpressionStatement:["expression"],File:["program"],ForInStatement:["left","right","body"],ForStatement:["init","test","update","body"],FunctionDeclaration:["id","typeParameters","params","predicate","returnType","body"],FunctionExpression:["id","typeParameters","params","returnType","body"],Identifier:["typeAnnotation","decorators"],IfStatement:["test","consequent","alternate"],LabeledStatement:["label","body"],StringLiteral:[],NumericLiteral:[],NullLiteral:[],BooleanLiteral:[],RegExpLiteral:[],LogicalExpression:["left","right"],MemberExpression:["object","property"],NewExpression:["callee","arguments","typeParameters","typeArguments"],Program:["directives","body"],ObjectExpression:["properties"],ObjectMethod:["decorators","key","typeParameters","params","returnType","body"],ObjectProperty:["key","value","decorators"],RestElement:["argument","typeAnnotation","decorators"],ReturnStatement:["argument"],SequenceExpression:["expressions"],ParenthesizedExpression:["expression"],SwitchCase:["test","consequent"],SwitchStatement:["discriminant","cases"],ThisExpression:[],ThrowStatement:["argument"],TryStatement:["block","handler","finalizer"],UnaryExpression:["argument"],UpdateExpression:["argument"],VariableDeclaration:["declarations"],VariableDeclarator:["id","init"],WhileStatement:["test","body"],WithStatement:["object","body"],AssignmentPattern:["left","right","decorators","typeAnnotation"],ArrayPattern:["elements","typeAnnotation","decorators"],ArrowFunctionExpression:["typeParameters","params","predicate","returnType","body"],ClassBody:["body"],ClassExpression:["decorators","id","typeParameters","superClass","superTypeParameters","mixins","implements","body","superTypeArguments"],ClassDeclaration:["decorators","id","typeParameters","superClass","superTypeParameters","mixins","implements","body","superTypeArguments"],ExportAllDeclaration:["source","attributes","exported"],ExportDefaultDeclaration:["declaration"],ExportNamedDeclaration:["declaration","specifiers","source","attributes"],ExportSpecifier:["local","exported"],ForOfStatement:["left","right","body"],ImportDeclaration:["specifiers","source","attributes"],ImportDefaultSpecifier:["local"],ImportNamespaceSpecifier:["local"],ImportSpecifier:["imported","local"],ImportExpression:["source","options"],MetaProperty:["meta","property"],ClassMethod:["decorators","key","typeParameters","params","returnType","body"],ObjectPattern:["properties","typeAnnotation","decorators"],SpreadElement:["argument"],Super:[],TaggedTemplateExpression:["tag","typeParameters","quasi","typeArguments"],TemplateElement:[],TemplateLiteral:["quasis","expressions"],YieldExpression:["argument"],AwaitExpression:["argument"],BigIntLiteral:[],ExportNamespaceSpecifier:["exported"],OptionalMemberExpression:["object","property"],OptionalCallExpression:["callee","arguments","typeParameters","typeArguments"],ClassProperty:["decorators","variance","key","typeAnnotation","value"],ClassAccessorProperty:["decorators","key","typeAnnotation","value"],ClassPrivateProperty:["decorators","variance","key","typeAnnotation","value"],ClassPrivateMethod:["decorators","key","typeParameters","params","returnType","body"],PrivateName:["id"],StaticBlock:["body"],AnyTypeAnnotation:[],ArrayTypeAnnotation:["elementType"],BooleanTypeAnnotation:[],BooleanLiteralTypeAnnotation:[],NullLiteralTypeAnnotation:[],ClassImplements:["id","typeParameters"],DeclareClass:["id","typeParameters","extends","mixins","implements","body"],DeclareFunction:["id","predicate"],DeclareInterface:["id","typeParameters","extends","body"],DeclareModule:["id","body"],DeclareModuleExports:["typeAnnotation"],DeclareTypeAlias:["id","typeParameters","right"],DeclareOpaqueType:["id","typeParameters","supertype"],DeclareVariable:["id"],DeclareExportDeclaration:["declaration","specifiers","source","attributes"],DeclareExportAllDeclaration:["source","attributes"],DeclaredPredicate:["value"],ExistsTypeAnnotation:[],FunctionTypeAnnotation:["typeParameters","this","params","rest","returnType"],FunctionTypeParam:["name","typeAnnotation"],GenericTypeAnnotation:["id","typeParameters"],InferredPredicate:[],InterfaceExtends:["id","typeParameters"],InterfaceDeclaration:["id","typeParameters","extends","body"],InterfaceTypeAnnotation:["extends","body"],IntersectionTypeAnnotation:["types"],MixedTypeAnnotation:[],EmptyTypeAnnotation:[],NullableTypeAnnotation:["typeAnnotation"],NumberLiteralTypeAnnotation:[],NumberTypeAnnotation:[],ObjectTypeAnnotation:["properties","indexers","callProperties","internalSlots"],ObjectTypeInternalSlot:["id","value"],ObjectTypeCallProperty:["value"],ObjectTypeIndexer:["variance","id","key","value"],ObjectTypeProperty:["key","value","variance"],ObjectTypeSpreadProperty:["argument"],OpaqueType:["id","typeParameters","supertype","impltype"],QualifiedTypeIdentifier:["qualification","id"],StringLiteralTypeAnnotation:[],StringTypeAnnotation:[],SymbolTypeAnnotation:[],ThisTypeAnnotation:[],TupleTypeAnnotation:["types","elementTypes"],TypeofTypeAnnotation:["argument","typeArguments"],TypeAlias:["id","typeParameters","right"],TypeAnnotation:["typeAnnotation"],TypeCastExpression:["expression","typeAnnotation"],TypeParameter:["bound","default","variance"],TypeParameterDeclaration:["params"],TypeParameterInstantiation:["params"],UnionTypeAnnotation:["types"],Variance:[],VoidTypeAnnotation:[],EnumDeclaration:["id","body"],EnumBooleanBody:["members"],EnumNumberBody:["members"],EnumStringBody:["members"],EnumSymbolBody:["members"],EnumBooleanMember:["id","init"],EnumNumberMember:["id","init"],EnumStringMember:["id","init"],EnumDefaultedMember:["id"],IndexedAccessType:["objectType","indexType"],OptionalIndexedAccessType:["objectType","indexType"],JSXAttribute:["name","value"],JSXClosingElement:["name"],JSXElement:["openingElement","children","closingElement"],JSXEmptyExpression:[],JSXExpressionContainer:["expression"],JSXSpreadChild:["expression"],JSXIdentifier:[],JSXMemberExpression:["object","property"],JSXNamespacedName:["namespace","name"],JSXOpeningElement:["name","typeParameters","typeArguments","attributes"],JSXSpreadAttribute:["argument"],JSXText:[],JSXFragment:["openingFragment","children","closingFragment"],JSXOpeningFragment:[],JSXClosingFragment:[],Noop:[],Placeholder:[],V8IntrinsicIdentifier:[],ArgumentPlaceholder:[],BindExpression:["object","callee"],ImportAttribute:["key","value"],Decorator:["expression"],DoExpression:["body"],ExportDefaultSpecifier:["exported"],RecordExpression:["properties"],TupleExpression:["elements"],ModuleExpression:["body"],TopicReference:[],PipelineTopicExpression:["expression"],PipelineBareFunction:["callee"],PipelinePrimaryTopicReference:[],TSParameterProperty:["parameter","decorators"],TSDeclareFunction:["id","typeParameters","params","returnType","body"],TSDeclareMethod:["decorators","key","typeParameters","params","returnType"],TSQualifiedName:["left","right"],TSCallSignatureDeclaration:["typeParameters","parameters","typeAnnotation","params","returnType"],TSConstructSignatureDeclaration:["typeParameters","parameters","typeAnnotation","params","returnType"],TSPropertySignature:["key","typeAnnotation"],TSMethodSignature:["key","typeParameters","parameters","typeAnnotation","params","returnType"],TSIndexSignature:["parameters","typeAnnotation"],TSAnyKeyword:[],TSBooleanKeyword:[],TSBigIntKeyword:[],TSIntrinsicKeyword:[],TSNeverKeyword:[],TSNullKeyword:[],TSNumberKeyword:[],TSObjectKeyword:[],TSStringKeyword:[],TSSymbolKeyword:[],TSUndefinedKeyword:[],TSUnknownKeyword:[],TSVoidKeyword:[],TSThisType:[],TSFunctionType:["typeParameters","parameters","typeAnnotation","params","returnType"],TSConstructorType:["typeParameters","parameters","typeAnnotation","params","returnType"],TSTypeReference:["typeName","typeParameters","typeArguments"],TSTypePredicate:["parameterName","typeAnnotation"],TSTypeQuery:["exprName","typeParameters","typeArguments"],TSTypeLiteral:["members"],TSArrayType:["elementType"],TSTupleType:["elementTypes"],TSOptionalType:["typeAnnotation"],TSRestType:["typeAnnotation"],TSNamedTupleMember:["label","elementType"],TSUnionType:["types"],TSIntersectionType:["types"],TSConditionalType:["checkType","extendsType","trueType","falseType"],TSInferType:["typeParameter"],TSParenthesizedType:["typeAnnotation"],TSTypeOperator:["typeAnnotation"],TSIndexedAccessType:["objectType","indexType"],TSMappedType:["typeParameter","nameType","typeAnnotation"],TSTemplateLiteralType:["quasis","types"],TSLiteralType:["literal"],TSExpressionWithTypeArguments:["expression","typeParameters"],TSInterfaceDeclaration:["id","typeParameters","extends","body"],TSInterfaceBody:["body"],TSTypeAliasDeclaration:["id","typeParameters","typeAnnotation"],TSInstantiationExpression:["expression","typeParameters","typeArguments"],TSAsExpression:["expression","typeAnnotation"],TSSatisfiesExpression:["expression","typeAnnotation"],TSTypeAssertion:["typeAnnotation","expression"],TSEnumBody:["members"],TSEnumDeclaration:["id","members"],TSEnumMember:["id","initializer"],TSModuleDeclaration:["id","body"],TSModuleBlock:["body"],TSImportType:["argument","options","qualifier","typeParameters","typeArguments"],TSImportEqualsDeclaration:["id","moduleReference"],TSExternalModuleReference:["expression"],TSNonNullExpression:["expression"],TSExportAssignment:["expression"],TSNamespaceExportDeclaration:["id"],TSTypeAnnotation:["typeAnnotation"],TSTypeParameterInstantiation:["params"],TSTypeParameterDeclaration:["params"],TSTypeParameter:["constraint","default","name"],ChainExpression:["expression"],ExperimentalRestProperty:["argument"],ExperimentalSpreadProperty:["argument"],Literal:[],MethodDefinition:["decorators","key","value"],PrivateIdentifier:[],Property:["key","value"],PropertyDefinition:["decorators","key","typeAnnotation","value","variance"],AccessorProperty:["decorators","key","typeAnnotation","value"],TSAbstractAccessorProperty:["decorators","key","typeAnnotation"],TSAbstractKeyword:[],TSAbstractMethodDefinition:["key","value"],TSAbstractPropertyDefinition:["decorators","key","typeAnnotation"],TSAsyncKeyword:[],TSClassImplements:["expression","typeArguments","typeParameters"],TSDeclareKeyword:[],TSEmptyBodyFunctionExpression:["id","typeParameters","params","returnType"],TSExportKeyword:[],TSInterfaceHeritage:["expression","typeArguments","typeParameters"],TSPrivateKeyword:[],TSProtectedKeyword:[],TSPublicKeyword:[],TSReadonlyKeyword:[],TSStaticKeyword:[],AsConstExpression:["expression"],AsExpression:["expression","typeAnnotation"],BigIntLiteralTypeAnnotation:[],BigIntTypeAnnotation:[],ComponentDeclaration:["id","params","body","typeParameters","rendersType"],ComponentParameter:["name","local"],ComponentTypeAnnotation:["params","rest","typeParameters","rendersType"],ComponentTypeParameter:["name","typeAnnotation"],ConditionalTypeAnnotation:["checkType","extendsType","trueType","falseType"],DeclareComponent:["id","params","rest","typeParameters","rendersType"],DeclareEnum:["id","body"],DeclareHook:["id"],DeclareNamespace:["id","body"],EnumBigIntBody:["members"],EnumBigIntMember:["id","init"],HookDeclaration:["id","params","body","typeParameters","returnType"],HookTypeAnnotation:["params","returnType","rest","typeParameters"],InferTypeAnnotation:["typeParameter"],KeyofTypeAnnotation:["argument"],ObjectTypeMappedTypeProperty:["keyTparam","propType","sourceType","variance"],QualifiedTypeofIdentifier:["qualification","id"],TupleTypeLabeledElement:["label","elementType","variance"],TupleTypeSpreadElement:["label","typeAnnotation"],TypeOperator:["typeAnnotation"],TypePredicate:["parameterName","typeAnnotation","asserts"],NGRoot:["node"],NGPipeExpression:["left","right","arguments"],NGChainedExpression:["expressions"],NGEmptyExpression:[],NGMicrosyntax:["body"],NGMicrosyntaxKey:[],NGMicrosyntaxExpression:["expression","alias"],NGMicrosyntaxKeyedExpression:["key","expression"],NGMicrosyntaxLet:["key","value"],NGMicrosyntaxAs:["key","alias"],JsExpressionRoot:["node"],JsonRoot:["node"],TSJSDocAllType:[],TSJSDocUnknownType:[],TSJSDocNullableType:["typeAnnotation"],TSJSDocNonNullableType:["typeAnnotation"],NeverTypeAnnotation:[],UndefinedTypeAnnotation:[],UnknownTypeAnnotation:[],SatisfiesExpression:["expression","typeAnnotation"]},zQ=wW(VQ),yW=zQ;function UQ(s){let e=new Set(s);return t=>e.has(t==null?void 0:t.type)}var wi=UQ,$Q=wi(["Block","CommentBlock","MultiLine"]),Ca=$Q,jQ=wi(["AnyTypeAnnotation","ThisTypeAnnotation","NumberTypeAnnotation","VoidTypeAnnotation","BooleanTypeAnnotation","BigIntTypeAnnotation","SymbolTypeAnnotation","StringTypeAnnotation","NeverTypeAnnotation","UndefinedTypeAnnotation","UnknownTypeAnnotation","EmptyTypeAnnotation","MixedTypeAnnotation"]),SW=jQ;function KQ(s,e){let t=e.split(".");for(let i=t.length-1;i>=0;i--){let n=t[i];if(i===0)return s.type==="Identifier"&&s.name===n;if(s.type!=="MemberExpression"||s.optional||s.computed||s.property.type!=="Identifier"||s.property.name!==n)return!1;s=s.object}}function qQ(s,e){return e.some(t=>KQ(s,t))}var GQ=qQ;function ZQ({type:s}){return s.startsWith("TS")&&s.endsWith("Keyword")}var DW=ZQ;function TT(s,e){return e(s)||_Q(s,{getVisitorKeys:yW,predicate:e})}function pP(s){return s.type==="AssignmentExpression"||s.type==="BinaryExpression"||s.type==="LogicalExpression"||s.type==="NGPipeExpression"||s.type==="ConditionalExpression"||ui(s)||Rn(s)||s.type==="SequenceExpression"||s.type==="TaggedTemplateExpression"||s.type==="BindExpression"||s.type==="UpdateExpression"&&!s.prefix||Xl(s)||s.type==="TSNonNullExpression"||s.type==="ChainExpression"}function XQ(s){return s.expressions?s.expressions[0]:s.left??s.test??s.callee??s.object??s.tag??s.argument??s.expression}function LW(s){if(s.expressions)return["expressions",0];if(s.left)return["left"];if(s.test)return["test"];if(s.object)return["object"];if(s.callee)return["callee"];if(s.tag)return["tag"];if(s.argument)return["argument"];if(s.expression)return["expression"];throw new Error("Unexpected node has no left side.")}var Y_=wi(["Line","CommentLine","SingleLine","HashbangComment","HTMLOpen","HTMLClose","Hashbang","InterpreterDirective"]),YQ=wi(["ExportDefaultDeclaration","DeclareExportDeclaration","ExportNamedDeclaration","ExportAllDeclaration","DeclareExportAllDeclaration"]),zs=wi(["ArrayExpression","TupleExpression"]),il=wi(["ObjectExpression","RecordExpression"]);function QQ(s){return s.type==="LogicalExpression"&&s.operator==="??"}function Pc(s){return s.type==="NumericLiteral"||s.type==="Literal"&&typeof s.value=="number"}function xW(s){return s.type==="UnaryExpression"&&(s.operator==="+"||s.operator==="-")&&Pc(s.argument)}function sr(s){return!!(s&&(s.type==="StringLiteral"||s.type==="Literal"&&typeof s.value=="string"))}function kW(s){return s.type==="RegExpLiteral"||s.type==="Literal"&&!!s.regex}var mP=wi(["Literal","BooleanLiteral","BigIntLiteral","DirectiveLiteral","NullLiteral","NumericLiteral","RegExpLiteral","StringLiteral"]),JQ=wi(["Identifier","ThisExpression","Super","PrivateName","PrivateIdentifier"]),_h=wi(["ObjectTypeAnnotation","TSTypeLiteral","TSMappedType"]),yb=wi(["FunctionExpression","ArrowFunctionExpression"]);function eJ(s){return s.type==="FunctionExpression"||s.type==="ArrowFunctionExpression"&&s.body.type==="BlockStatement"}function _E(s){return ui(s)&&s.callee.type==="Identifier"&&["async","inject","fakeAsync","waitForAsync"].includes(s.callee.name)}var bs=wi(["JSXElement","JSXFragment"]);function PL(s){return s.method&&s.kind==="init"||s.kind==="get"||s.kind==="set"}function EW(s){return(s.type==="ObjectTypeProperty"||s.type==="ObjectTypeInternalSlot")&&!s.static&&!s.method&&s.kind!=="get"&&s.kind!=="set"&&s.value.type==="FunctionTypeAnnotation"}function tJ(s){return(s.type==="TypeAnnotation"||s.type==="TSTypeAnnotation")&&s.typeAnnotation.type==="FunctionTypeAnnotation"&&!s.static&&!RL(s,s.typeAnnotation)}var Fc=wi(["BinaryExpression","LogicalExpression","NGPipeExpression"]);function zp(s){return Rn(s)||s.type==="BindExpression"&&!!s.object}var iJ=wi(["TSThisType","NullLiteralTypeAnnotation","BooleanLiteralTypeAnnotation","StringLiteralTypeAnnotation","BigIntLiteralTypeAnnotation","NumberLiteralTypeAnnotation","TSLiteralType","TSTemplateLiteralType"]);function _P(s){return DW(s)||SW(s)||iJ(s)||(s.type==="GenericTypeAnnotation"||s.type==="TSTypeReference")&&!s.typeParameters&&!s.typeArguments}function nJ(s){return s.type==="Identifier"&&(s.name==="beforeEach"||s.name==="beforeAll"||s.name==="afterEach"||s.name==="afterAll")}var sJ=["it","it.only","it.skip","describe","describe.only","describe.skip","test","test.only","test.skip","test.step","test.describe","test.describe.only","test.describe.parallel","test.describe.parallel.only","test.describe.serial","test.describe.serial.only","skip","xit","xdescribe","xtest","fit","fdescribe","ftest"];function oJ(s){return GQ(s,sJ)}function FL(s,e){if((s==null?void 0:s.type)!=="CallExpression"||s.optional)return!1;let t=wa(s);if(t.length===1){if(_E(s)&&FL(e))return yb(t[0]);if(nJ(s.callee))return _E(t[0])}else if((t.length===2||t.length===3)&&(t[0].type==="TemplateLiteral"||sr(t[0]))&&oJ(s.callee))return t[2]&&!Pc(t[2])?!1:(t.length===2?yb(t[1]):eJ(t[1])&&uo(t[1]).length<=1)||_E(t[1]);return!1}var IW=s=>e=>((e==null?void 0:e.type)==="ChainExpression"&&(e=e.expression),s(e)),ui=IW(wi(["CallExpression","OptionalCallExpression"])),Rn=IW(wi(["MemberExpression","OptionalMemberExpression"]));function y5(s,e=5){return TW(s,e)<=e}function TW(s,e){let t=0;for(let i in s){let n=s[i];if(n&&typeof n=="object"&&typeof n.type=="string"&&(t++,t+=TW(n,e-t)),t>e)return t}return t}var rJ=.25;function vP(s,e){let{printWidth:t}=e;if(Re(s))return!1;let i=t*rJ;if(s.type==="ThisExpression"||s.type==="Identifier"&&s.name.length<=i||xW(s)&&!Re(s.argument))return!0;let n=s.type==="Literal"&&"regex"in s&&s.regex.pattern||s.type==="RegExpLiteral"&&s.pattern;return n?n.length<=i:sr(s)?t_(fa(s),e).length<=i:s.type==="TemplateLiteral"?s.expressions.length===0&&s.quasis[0].value.raw.length<=i&&!s.quasis[0].value.raw.includes(` `):s.type==="UnaryExpression"?vP(s.argument,{printWidth:t}):s.type==="CallExpression"&&s.arguments.length===0&&s.callee.type==="Identifier"?s.callee.name.length<=i-2:mP(s)}function vh(s,e){return bs(e)?OL(e):Re(e,Ze.Leading,t=>Ar(s,oi(t)))}function S5(s){return s.quasis.some(e=>e.value.raw.includes(` `))}function NW(s,e){return(s.type==="TemplateLiteral"&&S5(s)||s.type==="TaggedTemplateExpression"&&S5(s.quasi))&&!Ar(e,Ln(s),{backwards:!0})}function AW(s){if(!Re(s))return!1;let e=Si(!1,Dm(s,Ze.Dangling),-1);return e&&!Ca(e)}function aJ(s){if(s.length<=1)return!1;let e=0;for(let t of s)if(yb(t)){if(e+=1,e>1)return!0}else if(ui(t)){for(let i of wa(t))if(yb(i))return!0}return!1}function MW(s){let{node:e,parent:t,key:i}=s;return i==="callee"&&ui(e)&&ui(t)&&t.arguments.length>0&&e.arguments.length>t.arguments.length}var lJ=new Set(["!","-","+","~"]);function Wa(s,e=2){if(e<=0)return!1;if(s.type==="ChainExpression"||s.type==="TSNonNullExpression")return Wa(s.expression,e);let t=i=>Wa(i,e-1);if(kW(s))return Qm(s.pattern??s.regex.pattern)<=5;if(mP(s)||JQ(s)||s.type==="ArgumentPlaceholder")return!0;if(s.type==="TemplateLiteral")return s.quasis.every(i=>!i.value.raw.includes(` `))&&s.expressions.every(t);if(il(s))return s.properties.every(i=>!i.computed&&(i.shorthand||i.value&&t(i.value)));if(zs(s))return s.elements.every(i=>i===null||t(i));if(i_(s)){if(s.type==="ImportExpression"||Wa(s.callee,e)){let i=wa(s);return i.length<=e&&i.every(t)}return!1}return Rn(s)?Wa(s.object,e)&&Wa(s.property,e):s.type==="UnaryExpression"&&lJ.has(s.operator)||s.type==="UpdateExpression"?Wa(s.argument,e):!1}function fa(s){var e;return((e=s.extra)==null?void 0:e.raw)??s.raw}function dJ(s){return s}function Xc(s,e="es5"){return s.trailingComma==="es5"&&e==="es5"||s.trailingComma==="all"&&(e==="all"||e==="es5")}function Co(s,e){switch(s.type){case"BinaryExpression":case"LogicalExpression":case"AssignmentExpression":case"NGPipeExpression":return Co(s.left,e);case"MemberExpression":case"OptionalMemberExpression":return Co(s.object,e);case"TaggedTemplateExpression":return s.tag.type==="FunctionExpression"?!1:Co(s.tag,e);case"CallExpression":case"OptionalCallExpression":return s.callee.type==="FunctionExpression"?!1:Co(s.callee,e);case"ConditionalExpression":return Co(s.test,e);case"UpdateExpression":return!s.prefix&&Co(s.argument,e);case"BindExpression":return s.object&&Co(s.object,e);case"SequenceExpression":return Co(s.expressions[0],e);case"ChainExpression":case"TSSatisfiesExpression":case"TSAsExpression":case"TSNonNullExpression":case"AsExpression":case"AsConstExpression":case"SatisfiesExpression":return Co(s.expression,e);default:return e(s)}}var D5={"==":!0,"!=":!0,"===":!0,"!==":!0},nw={"*":!0,"/":!0,"%":!0},NT={">>":!0,">>>":!0,"<<":!0};function bP(s,e){return!(wS(e)!==wS(s)||s==="**"||D5[s]&&D5[e]||e==="%"&&nw[s]||s==="%"&&nw[e]||e!==s&&nw[e]&&nw[s]||NT[s]&&NT[e])}var cJ=new Map([["|>"],["??"],["||"],["&&"],["|"],["^"],["&"],["==","===","!=","!=="],["<",">","<=",">=","in","instanceof"],[">>","<<",">>>"],["+","-"],["*","/","%"],["**"]].flatMap((s,e)=>s.map(t=>[t,e])));function wS(s){return cJ.get(s)}function uJ(s){return!!NT[s]||s==="|"||s==="^"||s==="&"}function hJ(s){var e;if(s.rest)return!0;let t=uo(s);return((e=Si(!1,t,-1))==null?void 0:e.type)==="RestElement"}var vE=new WeakMap;function uo(s){if(vE.has(s))return vE.get(s);let e=[];return s.this&&e.push(s.this),Array.isArray(s.parameters)?e.push(...s.parameters):Array.isArray(s.params)&&e.push(...s.params),s.rest&&e.push(s.rest),vE.set(s,e),e}function gJ(s,e){let{node:t}=s,i=0,n=o=>e(o,i++);t.this&&s.call(n,"this"),Array.isArray(t.parameters)?s.each(n,"parameters"):Array.isArray(t.params)&&s.each(n,"params"),t.rest&&s.call(n,"rest")}var bE=new WeakMap;function wa(s){if(bE.has(s))return bE.get(s);if(s.type==="ChainExpression")return wa(s.expression);let e=s.arguments;return s.type==="ImportExpression"&&(e=[s.source],s.options&&e.push(s.options)),bE.set(s,e),e}function yS(s,e){let{node:t}=s;if(t.type==="ChainExpression")return s.call(()=>yS(s,e),"expression");t.type==="ImportExpression"?(s.call(i=>e(i,0),"source"),t.options&&s.call(i=>e(i,1),"options")):s.each(e,"arguments")}function L5(s,e){let t=[];if(s.type==="ChainExpression"&&(s=s.expression,t.push("expression")),s.type==="ImportExpression"){if(e===0||e===(s.options?-2:-1))return[...t,"source"];if(s.options&&(e===1||e===-1))return[...t,"options"];throw new RangeError("Invalid argument index")}if(e<0&&(e=s.arguments.length+e),e<0||e>=s.arguments.length)throw new RangeError("Invalid argument index");return[...t,"arguments",e]}function SS(s){return s.value.trim()==="prettier-ignore"&&!s.unignore}function OL(s){return(s==null?void 0:s.prettierIgnore)||Re(s,Ze.PrettierIgnore)}var Ze={Leading:2,Trailing:4,Dangling:8,Block:16,Line:32,PrettierIgnore:64,First:128,Last:256},RW=(s,e)=>{if(typeof s=="function"&&(e=s,s=0),s||e)return(t,i,n)=>!(s&Ze.Leading&&!t.leading||s&Ze.Trailing&&!t.trailing||s&Ze.Dangling&&(t.leading||t.trailing)||s&Ze.Block&&!Ca(t)||s&Ze.Line&&!Y_(t)||s&Ze.First&&i!==0||s&Ze.Last&&i!==n.length-1||s&Ze.PrettierIgnore&&!SS(t)||e&&!e(t))};function Re(s,e,t){if(!mi(s==null?void 0:s.comments))return!1;let i=RW(e,t);return i?s.comments.some(i):!0}function Dm(s,e,t){if(!Array.isArray(s==null?void 0:s.comments))return[];let i=RW(e,t);return i?s.comments.filter(i):s.comments}var Yc=(s,{originalText:e})=>gP(e,oi(s));function i_(s){return ui(s)||s.type==="NewExpression"||s.type==="ImportExpression"}function Qc(s){return s&&(s.type==="ObjectProperty"||s.type==="Property"&&!PL(s))}var Xl=wi(["TSAsExpression","TSSatisfiesExpression","AsExpression","AsConstExpression","SatisfiesExpression"]),bh=wi(["TSUnionType","UnionTypeAnnotation"]),CP=wi(["TSIntersectionType","IntersectionTypeAnnotation"]),Ch=wi(["TSConditionalType","ConditionalTypeAnnotation"]),fJ=new Set(["range","raw","comments","leadingComments","trailingComments","innerComments","extra","start","end","loc","flags","errors","tokens"]),yp=s=>{for(let e of s.quasis)delete e.value};function PW(s,e,t){var i,n;if(s.type==="Program"&&delete e.sourceType,(s.type==="BigIntLiteral"||s.type==="BigIntLiteralTypeAnnotation")&&s.value&&(e.value=s.value.toLowerCase()),(s.type==="BigIntLiteral"||s.type==="Literal")&&s.bigint&&(e.bigint=s.bigint.toLowerCase()),s.type==="EmptyStatement"||s.type==="JSXText"||s.type==="JSXExpressionContainer"&&(s.expression.type==="Literal"||s.expression.type==="StringLiteral")&&s.expression.value===" ")return null;if((s.type==="Property"||s.type==="ObjectProperty"||s.type==="MethodDefinition"||s.type==="ClassProperty"||s.type==="ClassMethod"||s.type==="PropertyDefinition"||s.type==="TSDeclareMethod"||s.type==="TSPropertySignature"||s.type==="ObjectTypeProperty"||s.type==="ImportAttribute")&&s.key&&!s.computed){let{key:r}=s;sr(r)||Pc(r)?e.key=String(r.value):r.type==="Identifier"&&(e.key=r.name)}if(s.type==="JSXElement"&&s.openingElement.name.name==="style"&&s.openingElement.attributes.some(r=>r.type==="JSXAttribute"&&r.name.name==="jsx"))for(let{type:r,expression:a}of e.children)r==="JSXExpressionContainer"&&a.type==="TemplateLiteral"&&yp(a);s.type==="JSXAttribute"&&s.name.name==="css"&&s.value.type==="JSXExpressionContainer"&&s.value.expression.type==="TemplateLiteral"&&yp(e.value.expression),s.type==="JSXAttribute"&&((i=s.value)==null?void 0:i.type)==="Literal"&&/["']|"|'/u.test(s.value.value)&&(e.value.value=As(!1,s.value.value,/["']|"|'/gu,'"'));let o=s.expression||s.callee;if(s.type==="Decorator"&&o.type==="CallExpression"&&o.callee.name==="Component"&&o.arguments.length===1){let r=s.expression.arguments[0].properties;for(let[a,l]of e.expression.arguments[0].properties.entries())switch(r[a].key.name){case"styles":zs(l.value)&&yp(l.value.elements[0]);break;case"template":l.value.type==="TemplateLiteral"&&yp(l.value);break}}s.type==="TaggedTemplateExpression"&&(s.tag.type==="MemberExpression"||s.tag.type==="Identifier"&&(s.tag.name==="gql"||s.tag.name==="graphql"||s.tag.name==="css"||s.tag.name==="md"||s.tag.name==="markdown"||s.tag.name==="html")||s.tag.type==="CallExpression")&&yp(e.quasi),s.type==="TemplateLiteral"&&((n=s.leadingComments)!=null&&n.some(r=>Ca(r)&&["GraphQL","HTML"].some(a=>r.value===` ${a} `))||t.type==="CallExpression"&&t.callee.name==="graphql"||!s.leadingComments)&&yp(e),s.type==="ChainExpression"&&s.expression.type==="TSNonNullExpression"&&(e.type="TSNonNullExpression",e.expression.type="ChainExpression"),s.type==="TSMappedType"&&(delete e.key,delete e.constraint),s.type==="TSEnumDeclaration"&&delete e.body}PW.ignoredProperties=fJ;var pJ=PW,Zf="string",Oc="array",Q_="cursor",Xf="indent",Yf="align",Qf="trim",pa="group",Xh="fill",sd="if-break",Jf="indent-if-break",ep="line-suffix",Yh="line-suffix-boundary",ur="line",Jc="label",eu="break-parent",FW=new Set([Q_,Xf,Yf,Qf,pa,Xh,sd,Jf,ep,Yh,ur,Jc,eu]);function mJ(s){if(typeof s=="string")return Zf;if(Array.isArray(s))return Oc;if(!s)return;let{type:e}=s;if(FW.has(e))return e}var Qh=mJ,_J=s=>new Intl.ListFormat("en-US",{type:"disjunction"}).format(s);function vJ(s){let e=s===null?"null":typeof s;if(e!=="string"&&e!=="object")return`Unexpected doc '${e}', Expected it to be 'string' or 'object'.`;if(Qh(s))throw new Error("doc is valid.");let t=Object.prototype.toString.call(s);if(t!=="[object Object]")return`Unexpected doc '${t}'.`;let i=_J([...FW].map(n=>`'${n}'`));return`Unexpected doc.type '${s.type}'. Expected it to be ${i}.`}var bJ=class extends Error{constructor(e){super(vJ(e));Q1(this,"name","InvalidDocError");this.doc=e}},Sb=bJ,x5={};function CJ(s,e,t,i){let n=[s];for(;n.length>0;){let o=n.pop();if(o===x5){t(n.pop());continue}t&&n.push(o,x5);let r=Qh(o);if(!r)throw new Sb(o);if((e==null?void 0:e(o))!==!1)switch(r){case Oc:case Xh:{let a=r===Oc?o:o.parts;for(let l=a.length,d=l-1;d>=0;--d)n.push(a[d]);break}case sd:n.push(o.flatContents,o.breakContents);break;case pa:if(i&&o.expandedStates)for(let a=o.expandedStates.length,l=a-1;l>=0;--l)n.push(o.expandedStates[l]);else n.push(o.contents);break;case Yf:case Xf:case Jf:case Jc:case ep:n.push(o.contents);break;case Zf:case Q_:case Qf:case Yh:case ur:case eu:break;default:throw new Sb(o)}}}var wP=CJ;function J_(s,e){if(typeof s=="string")return e(s);let t=new Map;return i(s);function i(o){if(t.has(o))return t.get(o);let r=n(o);return t.set(o,r),r}function n(o){switch(Qh(o)){case Oc:return e(o.map(i));case Xh:return e({...o,parts:o.parts.map(i)});case sd:return e({...o,breakContents:i(o.breakContents),flatContents:i(o.flatContents)});case pa:{let{expandedStates:r,contents:a}=o;return r?(r=r.map(i),a=r[0]):a=i(a),e({...o,contents:a,expandedStates:r})}case Yf:case Xf:case Jf:case Jc:case ep:return e({...o,contents:i(o.contents)});case Zf:case Q_:case Qf:case Yh:case ur:case eu:return e(o);default:throw new Sb(o)}}}function OW(s,e,t){let i=t,n=!1;function o(r){if(n)return!1;let a=e(r);a!==void 0&&(n=!0,i=a)}return wP(s,o),i}function wJ(s){if(s.type===pa&&s.break||s.type===ur&&s.hard||s.type===eu)return!0}function So(s){return OW(s,wJ,!1)}function k5(s){if(s.length>0){let e=Si(!1,s,-1);!e.expandedStates&&!e.break&&(e.break="propagated")}return null}function yJ(s){let e=new Set,t=[];function i(o){if(o.type===eu&&k5(t),o.type===pa){if(t.push(o),e.has(o))return!1;e.add(o)}}function n(o){o.type===pa&&t.pop().break&&k5(t)}wP(s,i,n,!0)}function SJ(s){return s.type===ur&&!s.hard?s.soft?"":" ":s.type===sd?s.flatContents:s}function AT(s){return J_(s,SJ)}function DJ(s){switch(Qh(s)){case Xh:if(s.parts.every(e=>e===""))return"";break;case pa:if(!s.contents&&!s.id&&!s.break&&!s.expandedStates)return"";if(s.contents.type===pa&&s.contents.id===s.id&&s.contents.break===s.break&&s.contents.expandedStates===s.expandedStates)return s.contents;break;case Yf:case Xf:case Jf:case ep:if(!s.contents)return"";break;case sd:if(!s.flatContents&&!s.breakContents)return"";break;case Oc:{let e=[];for(let t of s){if(!t)continue;let[i,...n]=Array.isArray(t)?t:[t];typeof i=="string"&&typeof Si(!1,e,-1)=="string"?e[e.length-1]+=i:e.push(i),e.push(...n)}return e.length===0?"":e.length===1?e[0]:e}case Zf:case Q_:case Qf:case Yh:case ur:case Jc:case eu:break;default:throw new Sb(s)}return s}function yP(s){return J_(s,e=>DJ(e))}function _f(s,e=VW){return J_(s,t=>typeof t=="string"?si(e,t.split(` `)):t)}function LJ(s){if(s.type===ur)return!0}function xJ(s){return OW(s,LJ,!1)}function MT(s,e){return s.type===Jc?{...s,contents:e(s.contents)}:e(s)}function kJ(s){let e=!0;return wP(s,t=>{switch(Qh(t)){case Zf:if(t==="")break;case Qf:case Yh:case ur:case eu:return e=!1,!1}}),e}var EJ=()=>{},IJ=EJ;function Le(s){return{type:Xf,contents:s}}function gd(s,e){return{type:Yf,contents:e,n:s}}function re(s,e={}){return IJ(e.expandedStates),{type:pa,id:e.id,contents:s,break:!!e.shouldBreak,expandedStates:e.expandedStates}}function TJ(s){return gd(Number.NEGATIVE_INFINITY,s)}function BW(s){return gd(-1,s)}function qg(s,e){return re(s[0],{...e,expandedStates:s})}function WW(s){return{type:Xh,parts:s}}function Rt(s,e="",t={}){return{type:sd,breakContents:s,flatContents:e,groupId:t.groupId}}function BL(s,e){return{type:Jf,contents:s,groupId:e.groupId,negate:e.negate}}function E5(s){return{type:ep,contents:s}}var Bc={type:Yh},fd={type:eu},HW={type:ur,hard:!0},NJ={type:ur,hard:!0,literal:!0},Ue={type:ur},be={type:ur,soft:!0},Se=[HW,fd],VW=[NJ,fd],sw={type:Q_};function si(s,e){let t=[];for(let i=0;i0){for(let n=0;n1&&e.every(t=>t.trimStart()[0]==="*")}var RJ=MJ;function PJ(s,e){let t=s.node;if(Y_(t))return e.originalText.slice(Ln(t),oi(t)).trimEnd();if(Ca(t))return RJ(t)?FJ(t):["/*",_f(t.value),"*/"];throw new Error("Not a comment: "+JSON.stringify(t))}function FJ(s){let e=s.value.split(` `);return["/*",si(Se,e.map((t,i)=>i===0?t.trimEnd():" "+(iUJ,ownLine:()=>zJ,remaining:()=>$J});function OJ(s){let e=s.type||s.kind||"(unknown type)",t=String(s.name||s.id&&(typeof s.id=="object"?s.id.name:s.id)||s.key&&(typeof s.key=="object"?s.key.name:s.key)||s.value&&(typeof s.value=="object"?"":String(s.value))||s.operator||"");return t.length>20&&(t=t.slice(0,19)+"…"),e+(t?" "+t:"")}function SP(s,e){(s.comments??(s.comments=[])).push(e),e.printed=!1,e.nodeDescription=OJ(s)}function Us(s,e){e.leading=!0,e.trailing=!1,SP(s,e)}function ma(s,e,t){e.leading=!1,e.trailing=!1,t&&(e.marker=t),SP(s,e)}function pn(s,e){e.leading=!1,e.trailing=!0,SP(s,e)}function BJ(s,e){let t=null,i=e;for(;i!==t;)t=i,i=Jm(s,i),i=uP(s,i),i=hP(s,i),i=e_(s,i);return i}var e0=BJ;function WJ(s,e){let t=e0(s,e);return t===!1?"":s.charAt(t)}var nl=WJ;function HJ(s,e,t){for(let i=e;ie(s))}function UJ(s){return[jJ,GW,jW,XW,DP,LP,$W,KW,ZW,iee,see,kP,dee,xP,hee,gee,pee].some(e=>e(s))}function $J(s){return[YW,DP,LP,GJ,eee,qW,kP,JJ,QJ,uee,xP,cee].some(e=>e(s))}function tp(s,e){let t=(s.body||s.properties).find(({type:i})=>i!=="EmptyStatement");t?Us(t,e):ma(s,e)}function RT(s,e){s.type==="BlockStatement"?tp(s,e):Us(s,e)}function jJ({comment:s,followingNode:e}){return e&&UW(s)?(Us(e,s),!0):!1}function DP({comment:s,precedingNode:e,enclosingNode:t,followingNode:i,text:n}){if((t==null?void 0:t.type)!=="IfStatement"||!i)return!1;if(nl(n,oi(s))===")")return pn(e,s),!0;if(e===t.consequent&&i===t.alternate){let o=e0(n,oi(t.consequent));if(Ln(s)"?(ma(e,s),!0):!1}function eee({comment:s,enclosingNode:e,text:t}){return nl(t,oi(s))!==")"?!1:e&&(QW(e)&&uo(e).length===0||i_(e)&&wa(e).length===0)?(ma(e,s),!0):((e==null?void 0:e.type)==="MethodDefinition"||(e==null?void 0:e.type)==="TSAbstractMethodDefinition")&&uo(e.value).length===0?(ma(e.value,s),!0):!1}function tee({comment:s,precedingNode:e,enclosingNode:t,followingNode:i,text:n}){return(e==null?void 0:e.type)==="ComponentTypeParameter"&&((t==null?void 0:t.type)==="DeclareComponent"||(t==null?void 0:t.type)==="ComponentTypeAnnotation")&&(i==null?void 0:i.type)!=="ComponentTypeParameter"||((e==null?void 0:e.type)==="ComponentParameter"||(e==null?void 0:e.type)==="RestElement")&&(t==null?void 0:t.type)==="ComponentDeclaration"&&nl(n,oi(s))===")"?(pn(e,s),!0):!1}function GW({comment:s,precedingNode:e,enclosingNode:t,followingNode:i,text:n}){return(e==null?void 0:e.type)==="FunctionTypeParam"&&(t==null?void 0:t.type)==="FunctionTypeAnnotation"&&(i==null?void 0:i.type)!=="FunctionTypeParam"||((e==null?void 0:e.type)==="Identifier"||(e==null?void 0:e.type)==="AssignmentPattern"||(e==null?void 0:e.type)==="ObjectPattern"||(e==null?void 0:e.type)==="ArrayPattern"||(e==null?void 0:e.type)==="RestElement"||(e==null?void 0:e.type)==="TSParameterProperty")&&QW(t)&&nl(n,oi(s))===")"?(pn(e,s),!0):!Ca(s)&&((t==null?void 0:t.type)==="FunctionDeclaration"||(t==null?void 0:t.type)==="FunctionExpression"||(t==null?void 0:t.type)==="ObjectMethod")&&(i==null?void 0:i.type)==="BlockStatement"&&t.body===i&&e0(n,oi(s))===Ln(i)?(tp(i,s),!0):!1}function ZW({comment:s,enclosingNode:e}){return(e==null?void 0:e.type)==="LabeledStatement"?(Us(e,s),!0):!1}function xP({comment:s,enclosingNode:e}){return((e==null?void 0:e.type)==="ContinueStatement"||(e==null?void 0:e.type)==="BreakStatement")&&!e.label?(pn(e,s),!0):!1}function iee({comment:s,precedingNode:e,enclosingNode:t}){return ui(t)&&e&&t.callee===e&&t.arguments.length>0?(Us(t.arguments[0],s),!0):!1}function nee({comment:s,precedingNode:e,enclosingNode:t,followingNode:i}){return bh(t)?(SS(s)&&(i.prettierIgnore=!0,s.unignore=!0),e?(pn(e,s),!0):!1):(bh(i)&&SS(s)&&(i.types[0].prettierIgnore=!0,s.unignore=!0),!1)}function see({comment:s,enclosingNode:e}){return Qc(e)?(Us(e,s),!0):!1}function kP({comment:s,enclosingNode:e,ast:t,isLastComment:i}){var n;return((n=t==null?void 0:t.body)==null?void 0:n.length)===0?(i?ma(t,s):Us(t,s),!0):(e==null?void 0:e.type)==="Program"&&e.body.length===0&&!mi(e.directives)?(i?ma(e,s):Us(e,s),!0):!1}function oee({comment:s,enclosingNode:e}){return(e==null?void 0:e.type)==="ForInStatement"||(e==null?void 0:e.type)==="ForOfStatement"?(Us(e,s),!0):!1}function XW({comment:s,precedingNode:e,enclosingNode:t,text:i}){if((t==null?void 0:t.type)==="ImportSpecifier"||(t==null?void 0:t.type)==="ExportSpecifier")return Us(t,s),!0;let n=(e==null?void 0:e.type)==="ImportSpecifier"&&(t==null?void 0:t.type)==="ImportDeclaration",o=(e==null?void 0:e.type)==="ExportSpecifier"&&(t==null?void 0:t.type)==="ExportNamedDeclaration";return(n||o)&&Ar(i,oi(s))?(pn(e,s),!0):!1}function ree({comment:s,enclosingNode:e}){return(e==null?void 0:e.type)==="AssignmentPattern"?(Us(e,s),!0):!1}var aee=new Set(["VariableDeclarator","AssignmentExpression","TypeAlias","TSTypeAliasDeclaration"]),lee=new Set(["ObjectExpression","RecordExpression","ArrayExpression","TupleExpression","TemplateLiteral","TaggedTemplateExpression","ObjectTypeAnnotation","TSTypeLiteral"]);function dee({comment:s,enclosingNode:e,followingNode:t}){return aee.has(e==null?void 0:e.type)&&t&&(lee.has(t.type)||Ca(s))?(Us(t,s),!0):!1}function cee({comment:s,enclosingNode:e,followingNode:t,text:i}){return!t&&((e==null?void 0:e.type)==="TSMethodSignature"||(e==null?void 0:e.type)==="TSDeclareFunction"||(e==null?void 0:e.type)==="TSAbstractMethodDefinition")&&nl(i,oi(s))===";"?(pn(e,s),!0):!1}function YW({comment:s,enclosingNode:e,followingNode:t}){if(SS(s)&&(e==null?void 0:e.type)==="TSMappedType"&&(t==null?void 0:t.type)==="TSTypeParameter"&&t.constraint)return e.prettierIgnore=!0,s.unignore=!0,!0}function uee({comment:s,precedingNode:e,enclosingNode:t,followingNode:i}){return(t==null?void 0:t.type)!=="TSMappedType"?!1:(i==null?void 0:i.type)==="TSTypeParameter"&&i.name?(Us(i.name,s),!0):(e==null?void 0:e.type)==="TSTypeParameter"&&e.constraint?(pn(e.constraint,s),!0):!1}function hee({comment:s,enclosingNode:e,followingNode:t}){return!e||e.type!=="SwitchCase"||e.test||!t||t!==e.consequent[0]?!1:(t.type==="BlockStatement"&&Y_(s)?tp(t,s):ma(e,s),!0)}function gee({comment:s,precedingNode:e,enclosingNode:t,followingNode:i}){return bh(e)&&((t.type==="TSArrayType"||t.type==="ArrayTypeAnnotation")&&!i||CP(t))?(pn(Si(!1,e.types,-1),s),!0):!1}function fee({comment:s,enclosingNode:e,precedingNode:t,followingNode:i}){if(((e==null?void 0:e.type)==="ObjectPattern"||(e==null?void 0:e.type)==="ArrayPattern")&&(i==null?void 0:i.type)==="TSTypeAnnotation")return t?pn(t,s):ma(e,s),!0}function pee({comment:s,precedingNode:e,enclosingNode:t,followingNode:i}){var n;if(!i&&(t==null?void 0:t.type)==="UnaryExpression"&&((e==null?void 0:e.type)==="LogicalExpression"||(e==null?void 0:e.type)==="BinaryExpression")){let o=((n=t.argument.loc)==null?void 0:n.start.line)!==e.right.loc.start.line,r=Y_(s)||s.loc.start.line===s.loc.end.line,a=s.loc.start.line===e.right.loc.start.line;if(o&&r&&a)return pn(e.right,s),!0}return!1}var QW=wi(["ArrowFunctionExpression","FunctionExpression","FunctionDeclaration","ObjectMethod","ClassMethod","TSDeclareFunction","TSCallSignatureDeclaration","TSConstructSignatureDeclaration","TSMethodSignature","TSConstructorType","TSFunctionType","TSDeclareMethod"]),mee=new Set(["EmptyStatement","TemplateElement","TSEmptyBodyFunctionExpression","ChainExpression"]);function _ee(s){return!mee.has(s.type)}function vee(s,e){var t;if((e.parser==="typescript"||e.parser==="flow"||e.parser==="acorn"||e.parser==="espree"||e.parser==="meriyah"||e.parser==="__babel_estree")&&s.type==="MethodDefinition"&&((t=s.value)==null?void 0:t.type)==="FunctionExpression"&&uo(s.value).length===0&&!s.value.returnType&&!mi(s.value.typeParameters)&&s.value.body)return[...s.decorators||[],s.key,s.value.body]}function JW(s){let{node:e,parent:t}=s;return(bs(e)||t&&(t.type==="JSXSpreadAttribute"||t.type==="JSXSpreadChild"||bh(t)||(t.type==="ClassDeclaration"||t.type==="ClassExpression")&&t.superClass===e))&&(!OL(e)||bh(t))}function bee(s,{parser:e}){if(e==="flow"||e==="babel-flow")return s=As(!1,s,/[\s(]/gu,""),s===""||s==="/*"||s==="/*::"}function Cee(s){switch(s){case"cr":return"\r";case"crlf":return`\r `;default:return` `}}var Uo=Symbol("MODE_BREAK"),kl=Symbol("MODE_FLAT"),Yp=Symbol("cursor"),PT=Symbol("DOC_FILL_PRINTED_LENGTH");function eH(){return{value:"",length:0,queue:[]}}function wee(s,e){return FT(s,{type:"indent"},e)}function yee(s,e,t){return e===Number.NEGATIVE_INFINITY?s.root||eH():e<0?FT(s,{type:"dedent"},t):e?e.type==="root"?{...s,root:s}:FT(s,{type:typeof e=="string"?"stringAlign":"numberAlign",n:e},t):s}function FT(s,e,t){let i=e.type==="dedent"?s.queue.slice(0,-1):[...s.queue,e],n="",o=0,r=0,a=0;for(let f of i)switch(f.type){case"indent":c(),t.useTabs?l(1):d(t.tabWidth);break;case"stringAlign":c(),n+=f.n,o+=f.n.length;break;case"numberAlign":r+=1,a+=f.n;break;default:throw new Error(`Unexpected type '${f.type}'`)}return h(),{...s,value:n,length:o,queue:i};function l(f){n+=" ".repeat(f),o+=t.tabWidth*f}function d(f){n+=" ".repeat(f),o+=f}function c(){t.useTabs?u():h()}function u(){r>0&&l(r),g()}function h(){a>0&&d(a),g()}function g(){r=0,a=0}}function OT(s){let e=0,t=0,i=s.length;e:for(;i--;){let n=s[i];if(n===Yp){t++;continue}for(let o=n.length-1;o>=0;o--){let r=n[o];if(r===" "||r===" ")e++;else{s[i]=n.slice(0,o+1);break e}}}if(e>0||t>0)for(s.length=i+1;t-- >0;)s.push(Yp);return e}function ow(s,e,t,i,n,o){if(t===Number.POSITIVE_INFINITY)return!0;let r=e.length,a=[s],l=[];for(;t>=0;){if(a.length===0){if(r===0)return!0;a.push(e[--r]);continue}let{mode:d,doc:c}=a.pop(),u=Qh(c);switch(u){case Zf:l.push(c),t-=Qm(c);break;case Oc:case Xh:{let h=u===Oc?c:c.parts,g=c[PT]??0;for(let f=h.length-1;f>=g;f--)a.push({mode:d,doc:h[f]});break}case Xf:case Yf:case Jf:case Jc:a.push({mode:d,doc:c.contents});break;case Qf:t+=OT(l);break;case pa:{if(o&&c.break)return!1;let h=c.break?Uo:d,g=c.expandedStates&&h===Uo?Si(!1,c.expandedStates,-1):c.contents;a.push({mode:h,doc:g});break}case sd:{let h=(c.groupId?n[c.groupId]||kl:d)===Uo?c.breakContents:c.flatContents;h&&a.push({mode:d,doc:h});break}case ur:if(d===Uo||c.hard)return!0;c.soft||(l.push(" "),t--);break;case ep:i=!0;break;case Yh:if(i)return!1;break}}return!1}function tH(s,e){let t={},i=e.printWidth,n=Cee(e.endOfLine),o=0,r=[{ind:eH(),mode:Uo,doc:s}],a=[],l=!1,d=[],c=0;for(yJ(s);r.length>0;){let{ind:h,mode:g,doc:f}=r.pop();switch(Qh(f)){case Zf:{let m=n!==` `?As(!1,f,` `,n):f;a.push(m),r.length>0&&(o+=Qm(m));break}case Oc:for(let m=f.length-1;m>=0;m--)r.push({ind:h,mode:g,doc:f[m]});break;case Q_:if(c>=2)throw new Error("There are too many 'cursor' in doc.");a.push(Yp),c++;break;case Xf:r.push({ind:wee(h,e),mode:g,doc:f.contents});break;case Yf:r.push({ind:yee(h,f.n,e),mode:g,doc:f.contents});break;case Qf:o-=OT(a);break;case pa:switch(g){case kl:if(!l){r.push({ind:h,mode:f.break?Uo:kl,doc:f.contents});break}case Uo:{l=!1;let m={ind:h,mode:kl,doc:f.contents},_=i-o,v=d.length>0;if(!f.break&&ow(m,r,_,v,t))r.push(m);else if(f.expandedStates){let b=Si(!1,f.expandedStates,-1);if(f.break){r.push({ind:h,mode:Uo,doc:b});break}else for(let C=1;C=f.expandedStates.length){r.push({ind:h,mode:Uo,doc:b});break}else{let w=f.expandedStates[C],y={ind:h,mode:kl,doc:w};if(ow(y,r,_,v,t)){r.push(y);break}}}else r.push({ind:h,mode:Uo,doc:f.contents});break}}f.id&&(t[f.id]=Si(!1,r,-1).mode);break;case Xh:{let m=i-o,_=f[PT]??0,{parts:v}=f,b=v.length-_;if(b===0)break;let C=v[_+0],w=v[_+1],y={ind:h,mode:kl,doc:C},D={ind:h,mode:Uo,doc:C},L=ow(y,[],m,d.length>0,t,!0);if(b===1){L?r.push(y):r.push(D);break}let k={ind:h,mode:kl,doc:w},I={ind:h,mode:Uo,doc:w};if(b===2){L?r.push(k,y):r.push(I,D);break}let O=v[_+2],R={ind:h,mode:g,doc:{...f,[PT]:_+2}};ow({ind:h,mode:kl,doc:[C,w,O]},[],m,d.length>0,t,!0)?r.push(R,k,y):L?r.push(R,I,y):r.push(R,I,D);break}case sd:case Jf:{let m=f.groupId?t[f.groupId]:g;if(m===Uo){let _=f.type===sd?f.breakContents:f.negate?f.contents:Le(f.contents);_&&r.push({ind:h,mode:g,doc:_})}if(m===kl){let _=f.type===sd?f.flatContents:f.negate?Le(f.contents):f.contents;_&&r.push({ind:h,mode:g,doc:_})}break}case ep:d.push({ind:h,mode:g,doc:f.contents});break;case Yh:d.length>0&&r.push({ind:h,mode:g,doc:HW});break;case ur:switch(g){case kl:if(f.hard)l=!0;else{f.soft||(a.push(" "),o+=1);break}case Uo:if(d.length>0){r.push({ind:h,mode:g,doc:f},...d.reverse()),d.length=0;break}f.literal?h.root?(a.push(n,h.root.value),o=h.root.length):(a.push(n),o=0):(o-=OT(a),a.push(n+h.value),o=h.length);break}break;case Jc:r.push({ind:h,mode:g,doc:f.contents});break;case eu:break;default:throw new Sb(f)}r.length===0&&d.length>0&&(r.push(...d.reverse()),d.length=0)}let u=a.indexOf(Yp);if(u!==-1){let h=a.indexOf(Yp,u+1);if(h===-1)return{formatted:a.filter(_=>_!==Yp).join("")};let g=a.slice(0,u).join(""),f=a.slice(u+1,h).join(""),m=a.slice(h+1).join("");return{formatted:g+f+m,cursorNodeStart:g.length,cursorNodeText:f}}return{formatted:a.join("")}}function See(s,e,t=0){let i=0;for(let n=t;n{if(o.push(e()),d.tail)return;let{tabWidth:c}=t,u=d.value.raw,h=u.includes(` `)?xee(u,c):a;a=h;let g=r[l],f=i[n][l],m=wh(t.originalText,oi(d),Ln(i.quasis[l+1]));if(!m){let v=tH(g,{...t,printWidth:Number.POSITIVE_INFINITY}).formatted;v.includes(` `)?m=!0:g=v}m&&(Re(f)||f.type==="Identifier"||Rn(f)||f.type==="ConditionalExpression"||f.type==="SequenceExpression"||Xl(f)||Fc(f))&&(g=[Le([be,g]),be]);let _=h===0&&u.endsWith(` `)?gd(Number.NEGATIVE_INFINITY,g):AJ(g,h,c);o.push(re(["${",_,Bc,"}"]))},"quasis"),o.push("`"),o}function kee(s,e){let t=e("quasi");return s1(t.label&&{tagged:!0,...t.label},[e("tag"),e(s.node.typeArguments?"typeArguments":"typeParameters"),Bc,t])}function Eee(s,e,t){let{node:i}=s,n=i.quasis[0].value.raw.trim().split(/\s*\|\s*/u);if(n.length>1||n.some(o=>o.length>0)){e.__inJestEach=!0;let o=s.map(t,"expressions");e.__inJestEach=!1;let r=[],a=o.map(h=>"${"+tH(h,{...e,printWidth:Number.POSITIVE_INFINITY,endOfLine:"lf"}).formatted+"}"),l=[{hasLineBreak:!1,cells:[]}];for(let h=1;hh.cells.length)),c=Array.from({length:d}).fill(0),u=[{cells:n},...l.filter(h=>h.cells.length>0)];for(let{cells:h}of u.filter(g=>!g.hasLineBreak))for(let[g,f]of h.entries())c[g]=Math.max(c[g],Qm(f));return r.push(Bc,"`",Le([Se,si(Se,u.map(h=>si(" | ",h.cells.map((g,f)=>h.hasLineBreak?g:g+" ".repeat(c[f]-Qm(g))))))]),Se,"`"),r}}function Iee(s,e){let{node:t}=s,i=e();return Re(t)&&(i=re([Le([be,i]),be])),["${",i,Bc,"}"]}function EP(s,e){return s.map(t=>Iee(t,e),"expressions")}function nH(s,e){return J_(s,t=>typeof t=="string"?e?As(!1,t,/(\\*)`/gu,"$1$1\\`"):sH(t):t)}function sH(s){return As(!1,s,/([\\`]|\$\{)/gu,String.raw`\$1`)}function Tee({node:s,parent:e}){let t=/^[fx]?(?:describe|it|test)$/u;return e.type==="TaggedTemplateExpression"&&e.quasi===s&&e.tag.type==="MemberExpression"&&e.tag.property.type==="Identifier"&&e.tag.property.name==="each"&&(e.tag.object.type==="Identifier"&&t.test(e.tag.object.name)||e.tag.object.type==="MemberExpression"&&e.tag.object.property.type==="Identifier"&&(e.tag.object.property.name==="only"||e.tag.object.property.name==="skip")&&e.tag.object.object.type==="Identifier"&&t.test(e.tag.object.object.name))}var BT=[(s,e)=>s.type==="ObjectExpression"&&e==="properties",(s,e)=>s.type==="CallExpression"&&s.callee.type==="Identifier"&&s.callee.name==="Component"&&e==="arguments",(s,e)=>s.type==="Decorator"&&e==="expression"];function Nee(s){let e=i=>i.type==="TemplateLiteral",t=(i,n)=>Qc(i)&&!i.computed&&i.key.type==="Identifier"&&i.key.name==="styles"&&n==="value";return s.match(e,(i,n)=>zs(i)&&n==="elements",t,...BT)||s.match(e,t,...BT)}function Aee(s){return s.match(e=>e.type==="TemplateLiteral",(e,t)=>Qc(e)&&!e.computed&&e.key.type==="Identifier"&&e.key.name==="template"&&t==="value",...BT)}function CE(s,e){return Re(s,Ze.Block|Ze.Leading,({value:t})=>t===` ${e} `)}function oH({node:s,parent:e},t){return CE(s,t)||Mee(e)&&CE(e,t)||e.type==="ExpressionStatement"&&CE(e,t)}function Mee(s){return s.type==="AsConstExpression"||s.type==="TSAsExpression"&&s.typeAnnotation.type==="TSTypeReference"&&s.typeAnnotation.typeName.type==="Identifier"&&s.typeAnnotation.typeName.name==="const"}async function Ree(s,e,t){let{node:i}=t,n=i.quasis.map(c=>c.value.raw),o=0,r=n.reduce((c,u,h)=>h===0?u:c+"@prettier-placeholder-"+o+++"-id"+u,""),a=await s(r,{parser:"scss"}),l=EP(t,e),d=Pee(a,l);if(!d)throw new Error("Couldn't insert all the expressions");return["`",Le([Se,d]),be,"`"]}function Pee(s,e){if(!mi(e))return s;let t=0,i=J_(yP(s),n=>typeof n!="string"||!n.includes("@prettier-placeholder")?n:n.split(/@prettier-placeholder-(\d+)-id/u).map((o,r)=>r%2===0?_f(o):(t++,e[o])));return e.length===t?i:null}function Fee({node:s,parent:e,grandparent:t}){return t&&s.quasis&&e.type==="JSXExpressionContainer"&&t.type==="JSXElement"&&t.openingElement.name.name==="style"&&t.openingElement.attributes.some(i=>i.type==="JSXAttribute"&&i.name.name==="jsx")||(e==null?void 0:e.type)==="TaggedTemplateExpression"&&e.tag.type==="Identifier"&&e.tag.name==="css"||(e==null?void 0:e.type)==="TaggedTemplateExpression"&&e.tag.type==="MemberExpression"&&e.tag.object.name==="css"&&(e.tag.property.name==="global"||e.tag.property.name==="resolve")}function rw(s){return s.type==="Identifier"&&s.name==="styled"}function I5(s){return/^[A-Z]/u.test(s.object.name)&&s.property.name==="extend"}function Oee({parent:s}){if(!s||s.type!=="TaggedTemplateExpression")return!1;let e=s.tag.type==="ParenthesizedExpression"?s.tag.expression:s.tag;switch(e.type){case"MemberExpression":return rw(e.object)||I5(e);case"CallExpression":return rw(e.callee)||e.callee.type==="MemberExpression"&&(e.callee.object.type==="MemberExpression"&&(rw(e.callee.object.object)||I5(e.callee.object))||e.callee.object.type==="CallExpression"&&rw(e.callee.object.callee));case"Identifier":return e.name==="css";default:return!1}}function Bee({parent:s,grandparent:e}){return(e==null?void 0:e.type)==="JSXAttribute"&&s.type==="JSXExpressionContainer"&&e.name.type==="JSXIdentifier"&&e.name.name==="css"}function Wee(s){if(Fee(s)||Oee(s)||Bee(s)||Nee(s))return Ree}var Hee=Wee;async function Vee(s,e,t){let{node:i}=t,n=i.quasis.length,o=EP(t,e),r=[];for(let a=0;a2&&h[0].trim()===""&&h[1].trim()==="",_=g>2&&h[g-1].trim()===""&&h[g-2].trim()==="",v=h.every(C=>/^\s*(?:#[^\n\r]*)?$/u.test(C));if(!c&&/#[^\n\r]*$/u.test(h[g-1]))return null;let b=null;v?b=zee(h):b=await s(u,{parser:"graphql"}),b?(b=nH(b,!1),!d&&m&&r.push(""),r.push(b),!c&&_&&r.push("")):!d&&!c&&m&&r.push(""),f&&r.push(f)}return["`",Le([Se,si(Se,r)]),Se,"`"]}function zee(s){let e=[],t=!1,i=s.map(n=>n.trim());for(let[n,o]of i.entries())o!==""&&(i[n-1]===""&&t?e.push([Se,o]):e.push(o),t=!0);return e.length===0?null:si(Se,e)}function Uee({node:s,parent:e}){return oH({node:s,parent:e},"GraphQL")||e&&(e.type==="TaggedTemplateExpression"&&(e.tag.type==="MemberExpression"&&e.tag.object.name==="graphql"&&e.tag.property.name==="experimental"||e.tag.type==="Identifier"&&(e.tag.name==="gql"||e.tag.name==="graphql"))||e.type==="CallExpression"&&e.callee.type==="Identifier"&&e.callee.name==="graphql")}function $ee(s){if(Uee(s))return Vee}var jee=$ee,wE=0;async function rH(s,e,t,i,n){let{node:o}=i,r=wE;wE=wE+1>>>0;let a=v=>`PRETTIER_HTML_PLACEHOLDER_${v}_${r}_IN_JS`,l=o.quasis.map((v,b,C)=>b===C.length-1?v.value.cooked:v.value.cooked+a(b)).join(""),d=EP(i,t),c=new RegExp(a(String.raw`(\d+)`),"gu"),u=0,h=await e(l,{parser:s,__onHtmlRoot(v){u=v.children.length}}),g=J_(h,v=>{if(typeof v!="string")return v;let b=[],C=v.split(c);for(let w=0;w1?Le(re(g)):re(g),m,"`"]))}function Kee(s){return oH(s,"HTML")||s.match(e=>e.type==="TemplateLiteral",(e,t)=>e.type==="TaggedTemplateExpression"&&e.tag.type==="Identifier"&&e.tag.name==="html"&&t==="quasi")}var qee=rH.bind(void 0,"html"),Gee=rH.bind(void 0,"angular");function Zee(s){if(Kee(s))return qee;if(Aee(s))return Gee}var Xee=Zee;async function Yee(s,e,t){let{node:i}=t,n=As(!1,i.quasis[0].value.raw,/((?:\\\\)*)\\`/gu,(l,d)=>"\\".repeat(d.length/2)+"`"),o=Qee(n),r=o!=="";r&&(n=As(!1,n,new RegExp(`^${o}`,"gmu"),""));let a=nH(await s(n,{parser:"markdown",__inJsTemplate:!0}),!0);return["`",r?Le([be,a]):[VW,TJ(a)],be,"`"]}function Qee(s){let e=s.match(/^([^\S\n]*)\S/mu);return e===null?"":e[1]}function Jee(s){if(ete(s))return Yee}function ete({node:s,parent:e}){return(e==null?void 0:e.type)==="TaggedTemplateExpression"&&s.quasis.length===1&&e.tag.type==="Identifier"&&(e.tag.name==="md"||e.tag.name==="markdown")}var tte=Jee;function ite(s){let{node:e}=s;if(e.type!=="TemplateLiteral"||nte(e))return;let t;for(let i of[Hee,jee,Xee,tte])if(t=i(s),!!t)return e.quasis.length===1&&e.quasis[0].value.raw.trim()===""?"``":async(...n)=>{let o=await t(...n);return o&&s1({embed:!0,...o.label},o)}}function nte({quasis:s}){return s.some(({value:{cooked:e}})=>e===null)}var ste=ite,ote=/\*\/$/,rte=/^\/\*\*?/,aH=/^\s*(\/\*\*?(.|\r?\n)*?\*\/)/,ate=/(^|\s+)\/\/([^\n\r]*)/g,T5=/^(\r?\n)+/,lte=/(?:^|\r?\n) *(@[^\n\r]*?) *\r?\n *(?![^\n\r@]*\/\/[^]*)([^\s@][^\n\r@]+?) *\r?\n/g,N5=/(?:^|\r?\n) *@(\S+) *([^\n\r]*)/g,dte=/(\r?\n|^) *\* ?/g,lH=[];function cte(s){let e=s.match(aH);return e?e[0].trimStart():""}function ute(s){let e=s.match(aH),t=e==null?void 0:e[0];return t==null?s:s.slice(t.length)}function hte(s){let e=` `;s=As(!1,s.replace(rte,"").replace(ote,""),dte,"$1");let t="";for(;t!==s;)t=s,s=As(!1,s,lte,`${e}$1 $2${e}`);s=s.replace(T5,"").trimEnd();let i=Object.create(null),n=As(!1,s,N5,"").replace(T5,"").trimEnd(),o;for(;o=N5.exec(s);){let r=As(!1,o[2],ate,"");if(typeof i[o[1]]=="string"||Array.isArray(i[o[1]])){let a=i[o[1]];i[o[1]]=[...lH,...Array.isArray(a)?a:[a],r]}else i[o[1]]=r}return{comments:n,pragmas:i}}function gte({comments:s="",pragmas:e={}}){let t=` `,i="/**",n=" *",o=" */",r=Object.keys(e),a=r.flatMap(d=>A5(d,e[d])).map(d=>`${n} ${d}${t}`).join("");if(!s){if(r.length===0)return"";if(r.length===1&&!Array.isArray(e[r[0]])){let d=e[r[0]];return`${i} ${A5(r[0],d)[0]}${o}`}}let l=s.split(t).map(d=>`${n} ${d}`).join(t)+t;return i+t+(s?l:"")+(s&&r.length>0?n+t:"")+a+o}function A5(s,e){return[...lH,...Array.isArray(e)?e:[e]].map(t=>`@${s} ${t}`.trim())}function fte(s){if(!s.startsWith("#!"))return"";let e=s.indexOf(` `);return e===-1?s:s.slice(0,e)}var pte=fte;function mte(s){let e=pte(s);e&&(s=s.slice(e.length+1));let t=cte(s),{pragmas:i,comments:n}=hte(t);return{shebang:e,text:s,pragmas:i,comments:n}}function _te(s){let{shebang:e,text:t,pragmas:i,comments:n}=mte(s),o=ute(t),r=gte({pragmas:{format:"",...i},comments:n.trimStart()});return(e?`${e} `:"")+r+(o.startsWith(` `)?` `:` `)+o}function vte(s,e){let{originalText:t,[Symbol.for("comments")]:i,locStart:n,locEnd:o,[Symbol.for("printedComments")]:r}=e,{node:a}=s,l=n(a),d=o(a);for(let c of i)n(c)>=l&&o(c)<=d&&r.add(c);return t.slice(l,d)}var bte=vte;function WT(s,e){var t,i,n,o,r,a,l,d,c;if(s.isRoot)return!1;let{node:u,key:h,parent:g}=s;if(e.__isInHtmlInterpolation&&!e.bracketSpacing&&Ste(u)&&cv(s))return!0;if(Cte(u))return!1;if(u.type==="Identifier"){if((t=u.extra)!=null&&t.parenthesized&&/^PRETTIER_HTML_PLACEHOLDER_\d+_\d+_IN_JS$/u.test(u.name)||h==="left"&&(u.name==="async"&&!g.await||u.name==="let")&&g.type==="ForOfStatement")return!0;if(u.name==="let"){let f=(i=s.findAncestor(m=>m.type==="ForOfStatement"))==null?void 0:i.left;if(f&&Co(f,m=>m===u))return!0}if(h==="object"&&u.name==="let"&&g.type==="MemberExpression"&&g.computed&&!g.optional){let f=s.findAncestor(_=>_.type==="ExpressionStatement"||_.type==="ForStatement"||_.type==="ForInStatement"),m=f?f.type==="ExpressionStatement"?f.expression:f.type==="ForStatement"?f.init:f.left:void 0;if(m&&Co(m,_=>_===u))return!0}if(h==="expression")switch(u.name){case"await":case"interface":case"module":case"using":case"yield":case"let":case"component":case"hook":case"type":{let f=s.findAncestor(m=>!Xl(m));if(f!==g&&f.type==="ExpressionStatement")return!0}}return!1}if(u.type==="ObjectExpression"||u.type==="FunctionExpression"||u.type==="ClassExpression"||u.type==="DoExpression"){let f=(n=s.findAncestor(m=>m.type==="ExpressionStatement"))==null?void 0:n.expression;if(f&&Co(f,m=>m===u))return!0}if(u.type==="ObjectExpression"){let f=(o=s.findAncestor(m=>m.type==="ArrowFunctionExpression"))==null?void 0:o.body;if(f&&f.type!=="SequenceExpression"&&f.type!=="AssignmentExpression"&&Co(f,m=>m===u))return!0}switch(g.type){case"ParenthesizedExpression":return!1;case"ClassDeclaration":case"ClassExpression":if(h==="superClass"&&(u.type==="ArrowFunctionExpression"||u.type==="AssignmentExpression"||u.type==="AwaitExpression"||u.type==="BinaryExpression"||u.type==="ConditionalExpression"||u.type==="LogicalExpression"||u.type==="NewExpression"||u.type==="ObjectExpression"||u.type==="SequenceExpression"||u.type==="TaggedTemplateExpression"||u.type==="UnaryExpression"||u.type==="UpdateExpression"||u.type==="YieldExpression"||u.type==="TSNonNullExpression"||u.type==="ClassExpression"&&mi(u.decorators)))return!0;break;case"ExportDefaultDeclaration":return dH(s,e)||u.type==="SequenceExpression";case"Decorator":if(h==="expression"&&!Lte(u))return!0;break;case"TypeAnnotation":if(s.match(void 0,void 0,(f,m)=>m==="returnType"&&f.type==="ArrowFunctionExpression")&&yte(u))return!0;break;case"BinaryExpression":if(h==="left"&&(g.operator==="in"||g.operator==="instanceof")&&u.type==="UnaryExpression")return!0;break;case"VariableDeclarator":if(h==="init"&&s.match(void 0,void 0,(f,m)=>m==="declarations"&&f.type==="VariableDeclaration",(f,m)=>m==="left"&&f.type==="ForInStatement"))return!0;break}switch(u.type){case"UpdateExpression":if(g.type==="UnaryExpression")return u.prefix&&(u.operator==="++"&&g.operator==="+"||u.operator==="--"&&g.operator==="-");case"UnaryExpression":switch(g.type){case"UnaryExpression":return u.operator===g.operator&&(u.operator==="+"||u.operator==="-");case"BindExpression":return!0;case"MemberExpression":case"OptionalMemberExpression":return h==="object";case"TaggedTemplateExpression":return!0;case"NewExpression":case"CallExpression":case"OptionalCallExpression":return h==="callee";case"BinaryExpression":return h==="left"&&g.operator==="**";case"TSNonNullExpression":return!0;default:return!1}case"BinaryExpression":if(g.type==="UpdateExpression"||u.operator==="in"&&wte(s))return!0;if(u.operator==="|>"&&(r=u.extra)!=null&&r.parenthesized){let f=s.grandparent;if(f.type==="BinaryExpression"&&f.operator==="|>")return!0}case"TSTypeAssertion":case"TSAsExpression":case"TSSatisfiesExpression":case"AsExpression":case"AsConstExpression":case"SatisfiesExpression":case"LogicalExpression":switch(g.type){case"TSAsExpression":case"TSSatisfiesExpression":case"AsExpression":case"AsConstExpression":case"SatisfiesExpression":return!Xl(u);case"ConditionalExpression":return Xl(u)||QQ(u);case"CallExpression":case"NewExpression":case"OptionalCallExpression":return h==="callee";case"ClassExpression":case"ClassDeclaration":return h==="superClass";case"TSTypeAssertion":case"TaggedTemplateExpression":case"UnaryExpression":case"JSXSpreadAttribute":case"SpreadElement":case"BindExpression":case"AwaitExpression":case"TSNonNullExpression":case"UpdateExpression":return!0;case"MemberExpression":case"OptionalMemberExpression":return h==="object";case"AssignmentExpression":case"AssignmentPattern":return h==="left"&&(u.type==="TSTypeAssertion"||Xl(u));case"LogicalExpression":if(u.type==="LogicalExpression")return g.operator!==u.operator;case"BinaryExpression":{let{operator:f,type:m}=u;if(!f&&m!=="TSTypeAssertion")return!0;let _=wS(f),v=g.operator,b=wS(v);return b>_||h==="right"&&b===_||b===_&&!bP(v,f)?!0:b<_&&f==="%"?v==="+"||v==="-":!!uJ(v)}default:return!1}case"SequenceExpression":switch(g.type){case"ReturnStatement":return!1;case"ForStatement":return!1;case"ExpressionStatement":return h!=="expression";case"ArrowFunctionExpression":return h!=="body";default:return!0}case"YieldExpression":if(g.type==="AwaitExpression"||g.type==="TSTypeAssertion")return!0;case"AwaitExpression":switch(g.type){case"TaggedTemplateExpression":case"UnaryExpression":case"LogicalExpression":case"SpreadElement":case"TSAsExpression":case"TSSatisfiesExpression":case"TSNonNullExpression":case"AsExpression":case"AsConstExpression":case"SatisfiesExpression":case"BindExpression":return!0;case"MemberExpression":case"OptionalMemberExpression":return h==="object";case"NewExpression":case"CallExpression":case"OptionalCallExpression":return h==="callee";case"ConditionalExpression":return h==="test";case"BinaryExpression":return!(!u.argument&&g.operator==="|>");default:return!1}case"TSFunctionType":if(s.match(f=>f.type==="TSFunctionType",(f,m)=>m==="typeAnnotation"&&f.type==="TSTypeAnnotation",(f,m)=>m==="returnType"&&f.type==="ArrowFunctionExpression"))return!0;case"TSConditionalType":case"TSConstructorType":case"ConditionalTypeAnnotation":if(h==="extendsType"&&Ch(u)&&g.type===u.type||h==="checkType"&&Ch(g))return!0;if(h==="extendsType"&&g.type==="TSConditionalType"){let{typeAnnotation:f}=u.returnType||u.typeAnnotation;if(f.type==="TSTypePredicate"&&f.typeAnnotation&&(f=f.typeAnnotation.typeAnnotation),f.type==="TSInferType"&&f.typeParameter.constraint)return!0}case"TSUnionType":case"TSIntersectionType":if((bh(g)||CP(g))&&g.types.length>1&&(!u.types||u.types.length>1))return!0;case"TSInferType":if(u.type==="TSInferType"){if(g.type==="TSRestType")return!1;if(h==="types"&&(g.type==="TSUnionType"||g.type==="TSIntersectionType")&&u.typeParameter.type==="TSTypeParameter"&&u.typeParameter.constraint)return!0}case"TSTypeOperator":return g.type==="TSArrayType"||g.type==="TSOptionalType"||g.type==="TSRestType"||h==="objectType"&&g.type==="TSIndexedAccessType"||g.type==="TSTypeOperator"||g.type==="TSTypeAnnotation"&&s.grandparent.type.startsWith("TSJSDoc");case"TSTypeQuery":return h==="objectType"&&g.type==="TSIndexedAccessType"||h==="elementType"&&g.type==="TSArrayType";case"TypeOperator":return g.type==="ArrayTypeAnnotation"||g.type==="NullableTypeAnnotation"||h==="objectType"&&(g.type==="IndexedAccessType"||g.type==="OptionalIndexedAccessType")||g.type==="TypeOperator";case"TypeofTypeAnnotation":return h==="objectType"&&(g.type==="IndexedAccessType"||g.type==="OptionalIndexedAccessType")||h==="elementType"&&g.type==="ArrayTypeAnnotation";case"ArrayTypeAnnotation":return g.type==="NullableTypeAnnotation";case"IntersectionTypeAnnotation":case"UnionTypeAnnotation":return g.type==="TypeOperator"||g.type==="ArrayTypeAnnotation"||g.type==="NullableTypeAnnotation"||g.type==="IntersectionTypeAnnotation"||g.type==="UnionTypeAnnotation"||h==="objectType"&&(g.type==="IndexedAccessType"||g.type==="OptionalIndexedAccessType");case"InferTypeAnnotation":case"NullableTypeAnnotation":return g.type==="ArrayTypeAnnotation"||h==="objectType"&&(g.type==="IndexedAccessType"||g.type==="OptionalIndexedAccessType");case"ComponentTypeAnnotation":case"FunctionTypeAnnotation":{if(u.type==="ComponentTypeAnnotation"&&(u.rendersType===null||u.rendersType===void 0))return!1;if(s.match(void 0,(m,_)=>_==="typeAnnotation"&&m.type==="TypeAnnotation",(m,_)=>_==="returnType"&&m.type==="ArrowFunctionExpression")||s.match(void 0,(m,_)=>_==="typeAnnotation"&&m.type==="TypePredicate",(m,_)=>_==="typeAnnotation"&&m.type==="TypeAnnotation",(m,_)=>_==="returnType"&&m.type==="ArrowFunctionExpression"))return!0;let f=g.type==="NullableTypeAnnotation"?s.grandparent:g;return f.type==="UnionTypeAnnotation"||f.type==="IntersectionTypeAnnotation"||f.type==="ArrayTypeAnnotation"||h==="objectType"&&(f.type==="IndexedAccessType"||f.type==="OptionalIndexedAccessType")||h==="checkType"&&g.type==="ConditionalTypeAnnotation"||h==="extendsType"&&g.type==="ConditionalTypeAnnotation"&&((a=u.returnType)==null?void 0:a.type)==="InferTypeAnnotation"&&((l=u.returnType)==null?void 0:l.typeParameter.bound)||f.type==="NullableTypeAnnotation"||g.type==="FunctionTypeParam"&&g.name===null&&uo(u).some(m=>{var _;return((_=m.typeAnnotation)==null?void 0:_.type)==="NullableTypeAnnotation"})}case"OptionalIndexedAccessType":return h==="objectType"&&g.type==="IndexedAccessType";case"StringLiteral":case"NumericLiteral":case"Literal":if(typeof u.value=="string"&&g.type==="ExpressionStatement"&&!g.directive){let f=s.grandparent;return f.type==="Program"||f.type==="BlockStatement"}return h==="object"&&g.type==="MemberExpression"&&typeof u.value=="number";case"AssignmentExpression":{let f=s.grandparent;return h==="body"&&g.type==="ArrowFunctionExpression"?!0:h==="key"&&(g.type==="ClassProperty"||g.type==="PropertyDefinition")&&g.computed||(h==="init"||h==="update")&&g.type==="ForStatement"?!1:g.type==="ExpressionStatement"?u.left.type==="ObjectPattern":!(h==="key"&&g.type==="TSPropertySignature"||g.type==="AssignmentExpression"||g.type==="SequenceExpression"&&f.type==="ForStatement"&&(f.init===g||f.update===g)||h==="value"&&g.type==="Property"&&f.type==="ObjectPattern"&&f.properties.includes(g)||g.type==="NGChainedExpression"||h==="node"&&g.type==="JsExpressionRoot")}case"ConditionalExpression":switch(g.type){case"TaggedTemplateExpression":case"UnaryExpression":case"SpreadElement":case"BinaryExpression":case"LogicalExpression":case"NGPipeExpression":case"ExportDefaultDeclaration":case"AwaitExpression":case"JSXSpreadAttribute":case"TSTypeAssertion":case"TypeCastExpression":case"TSAsExpression":case"TSSatisfiesExpression":case"AsExpression":case"AsConstExpression":case"SatisfiesExpression":case"TSNonNullExpression":return!0;case"NewExpression":case"CallExpression":case"OptionalCallExpression":return h==="callee";case"ConditionalExpression":return e.experimentalTernaries?!1:h==="test";case"MemberExpression":case"OptionalMemberExpression":return h==="object";default:return!1}case"FunctionExpression":switch(g.type){case"NewExpression":case"CallExpression":case"OptionalCallExpression":return h==="callee";case"TaggedTemplateExpression":return!0;default:return!1}case"ArrowFunctionExpression":switch(g.type){case"BinaryExpression":return g.operator!=="|>"||((d=u.extra)==null?void 0:d.parenthesized);case"NewExpression":case"CallExpression":case"OptionalCallExpression":return h==="callee";case"MemberExpression":case"OptionalMemberExpression":return h==="object";case"TSAsExpression":case"TSSatisfiesExpression":case"AsExpression":case"AsConstExpression":case"SatisfiesExpression":case"TSNonNullExpression":case"BindExpression":case"TaggedTemplateExpression":case"UnaryExpression":case"LogicalExpression":case"AwaitExpression":case"TSTypeAssertion":return!0;case"ConditionalExpression":return h==="test";default:return!1}case"ClassExpression":switch(g.type){case"NewExpression":return h==="callee";default:return!1}case"OptionalMemberExpression":case"OptionalCallExpression":case"CallExpression":case"MemberExpression":if(Dte(s))return!0;case"TaggedTemplateExpression":case"TSNonNullExpression":if(h==="callee"&&(g.type==="BindExpression"||g.type==="NewExpression")){let f=u;for(;f;)switch(f.type){case"CallExpression":case"OptionalCallExpression":return!0;case"MemberExpression":case"OptionalMemberExpression":case"BindExpression":f=f.object;break;case"TaggedTemplateExpression":f=f.tag;break;case"TSNonNullExpression":f=f.expression;break;default:return!1}}return!1;case"BindExpression":return h==="callee"&&(g.type==="BindExpression"||g.type==="NewExpression")||h==="object"&&Rn(g);case"NGPipeExpression":return!(g.type==="NGRoot"||g.type==="NGMicrosyntaxExpression"||g.type==="ObjectProperty"&&!((c=u.extra)!=null&&c.parenthesized)||zs(g)||h==="arguments"&&ui(g)||h==="right"&&g.type==="NGPipeExpression"||h==="property"&&g.type==="MemberExpression"||g.type==="AssignmentExpression");case"JSXFragment":case"JSXElement":return h==="callee"||h==="left"&&g.type==="BinaryExpression"&&g.operator==="<"||!zs(g)&&g.type!=="ArrowFunctionExpression"&&g.type!=="AssignmentExpression"&&g.type!=="AssignmentPattern"&&g.type!=="BinaryExpression"&&g.type!=="NewExpression"&&g.type!=="ConditionalExpression"&&g.type!=="ExpressionStatement"&&g.type!=="JsExpressionRoot"&&g.type!=="JSXAttribute"&&g.type!=="JSXElement"&&g.type!=="JSXExpressionContainer"&&g.type!=="JSXFragment"&&g.type!=="LogicalExpression"&&!ui(g)&&!Qc(g)&&g.type!=="ReturnStatement"&&g.type!=="ThrowStatement"&&g.type!=="TypeCastExpression"&&g.type!=="VariableDeclarator"&&g.type!=="YieldExpression";case"TSInstantiationExpression":return h==="object"&&Rn(g)}return!1}var Cte=wi(["BlockStatement","BreakStatement","ComponentDeclaration","ClassBody","ClassDeclaration","ClassMethod","ClassProperty","PropertyDefinition","ClassPrivateProperty","ContinueStatement","DebuggerStatement","DeclareComponent","DeclareClass","DeclareExportAllDeclaration","DeclareExportDeclaration","DeclareFunction","DeclareHook","DeclareInterface","DeclareModule","DeclareModuleExports","DeclareNamespace","DeclareVariable","DeclareEnum","DoWhileStatement","EnumDeclaration","ExportAllDeclaration","ExportDefaultDeclaration","ExportNamedDeclaration","ExpressionStatement","ForInStatement","ForOfStatement","ForStatement","FunctionDeclaration","HookDeclaration","IfStatement","ImportDeclaration","InterfaceDeclaration","LabeledStatement","MethodDefinition","ReturnStatement","SwitchStatement","ThrowStatement","TryStatement","TSDeclareFunction","TSEnumDeclaration","TSImportEqualsDeclaration","TSInterfaceDeclaration","TSModuleDeclaration","TSNamespaceExportDeclaration","TypeAlias","VariableDeclaration","WhileStatement","WithStatement"]);function wte(s){let e=0,{node:t}=s;for(;t;){let i=s.getParentNode(e++);if((i==null?void 0:i.type)==="ForStatement"&&i.init===t)return!0;t=i}return!1}function yte(s){return TT(s,e=>e.type==="ObjectTypeAnnotation"&&TT(e,t=>t.type==="FunctionTypeAnnotation"))}function Ste(s){return il(s)}function cv(s){let{parent:e,key:t}=s;switch(e.type){case"NGPipeExpression":if(t==="arguments"&&s.isLast)return s.callParent(cv);break;case"ObjectProperty":if(t==="value")return s.callParent(()=>s.key==="properties"&&s.isLast);break;case"BinaryExpression":case"LogicalExpression":if(t==="right")return s.callParent(cv);break;case"ConditionalExpression":if(t==="alternate")return s.callParent(cv);break;case"UnaryExpression":if(e.prefix)return s.callParent(cv);break}return!1}function dH(s,e){let{node:t,parent:i}=s;return t.type==="FunctionExpression"||t.type==="ClassExpression"?i.type==="ExportDefaultDeclaration"||!WT(s,e):!pP(t)||i.type!=="ExportDefaultDeclaration"&&WT(s,e)?!1:s.call(()=>dH(s,e),...LW(t))}function Dte(s){return!!(s.match(void 0,(e,t)=>t==="expression"&&e.type==="ChainExpression",(e,t)=>t==="tag"&&e.type==="TaggedTemplateExpression")||s.match(e=>e.type==="OptionalCallExpression"||e.type==="OptionalMemberExpression",(e,t)=>t==="tag"&&e.type==="TaggedTemplateExpression")||s.match(e=>e.type==="OptionalCallExpression"||e.type==="OptionalMemberExpression",(e,t)=>t==="expression"&&e.type==="TSNonNullExpression",(e,t)=>t==="tag"&&e.type==="TaggedTemplateExpression")||s.match(void 0,(e,t)=>t==="expression"&&e.type==="ChainExpression",(e,t)=>t==="expression"&&e.type==="TSNonNullExpression",(e,t)=>t==="tag"&&e.type==="TaggedTemplateExpression")||s.match(void 0,(e,t)=>t==="expression"&&e.type==="TSNonNullExpression",(e,t)=>t==="expression"&&e.type==="ChainExpression",(e,t)=>t==="tag"&&e.type==="TaggedTemplateExpression")||s.match(e=>e.type==="OptionalMemberExpression"||e.type==="OptionalCallExpression",(e,t)=>t==="object"&&e.type==="MemberExpression"||t==="callee"&&(e.type==="CallExpression"||e.type==="NewExpression"))||s.match(e=>e.type==="OptionalMemberExpression"||e.type==="OptionalCallExpression",(e,t)=>t==="expression"&&e.type==="TSNonNullExpression",(e,t)=>t==="object"&&e.type==="MemberExpression"||t==="callee"&&e.type==="CallExpression")||s.match(e=>e.type==="CallExpression"||e.type==="MemberExpression",(e,t)=>t==="expression"&&e.type==="ChainExpression")&&(s.match(void 0,void 0,(e,t)=>t==="callee"&&(e.type==="CallExpression"&&!e.optional||e.type==="NewExpression")||t==="object"&&e.type==="MemberExpression"&&!e.optional)||s.match(void 0,void 0,(e,t)=>t==="expression"&&e.type==="TSNonNullExpression",(e,t)=>t==="object"&&e.type==="MemberExpression"||t==="callee"&&e.type==="CallExpression"))||s.match(e=>e.type==="CallExpression"||e.type==="MemberExpression",(e,t)=>t==="expression"&&e.type==="TSNonNullExpression",(e,t)=>t==="expression"&&e.type==="ChainExpression",(e,t)=>t==="object"&&e.type==="MemberExpression"||t==="callee"&&e.type==="CallExpression"))}function HT(s){return s.type==="Identifier"?!0:Rn(s)?!s.computed&&!s.optional&&s.property.type==="Identifier"&&HT(s.object):!1}function Lte(s){return s.type==="ChainExpression"&&(s=s.expression),HT(s)||ui(s)&&!s.optional&&HT(s.callee)}var ip=WT;function xte(s,e){let t=e-1;t=Jm(s,t,{backwards:!0}),t=e_(s,t,{backwards:!0}),t=Jm(s,t,{backwards:!0});let i=e_(s,t,{backwards:!0});return t!==i}var kte=xte,Ete=()=>!0;function IP(s,e){let t=s.node;return t.printed=!0,e.printer.printComment(s,e)}function Ite(s,e){var t;let i=s.node,n=[IP(s,e)],{printer:o,originalText:r,locStart:a,locEnd:l}=e;if((t=o.isBlockComment)!=null&&t.call(o,i)){let c=Ar(r,l(i))?Ar(r,a(i),{backwards:!0})?Se:Ue:" ";n.push(c)}else n.push(Se);let d=e_(r,Jm(r,l(i)));return d!==!1&&Ar(r,d)&&n.push(Se),n}function Tte(s,e,t){var i;let n=s.node,o=IP(s,e),{printer:r,originalText:a,locStart:l}=e,d=(i=r.isBlockComment)==null?void 0:i.call(r,n);if(t!=null&&t.hasLineSuffix&&!(t!=null&&t.isBlock)||Ar(a,l(n),{backwards:!0})){let c=kte(a,l(n));return{doc:E5([Se,c?Se:"",o]),isBlock:d,hasLineSuffix:!0}}return!d||t!=null&&t.hasLineSuffix?{doc:[E5([" ",o]),fd],isBlock:d,hasLineSuffix:!0}:{doc:[" ",o],isBlock:d,hasLineSuffix:!1}}function gn(s,e,t={}){let{node:i}=s;if(!mi(i==null?void 0:i.comments))return"";let{indent:n=!1,marker:o,filter:r=Ete}=t,a=[];if(s.each(({node:d})=>{d.leading||d.trailing||d.marker!==o||!r(d)||a.push(IP(s,e))},"comments"),a.length===0)return"";let l=si(Se,a);return n?Le([Se,l]):l}function cH(s,e){let t=s.node;if(!t)return{};let i=e[Symbol.for("printedComments")];if((t.comments||[]).filter(a=>!i.has(a)).length===0)return{leading:"",trailing:""};let n=[],o=[],r;return s.each(()=>{let a=s.node;if(i!=null&&i.has(a))return;let{leading:l,trailing:d}=a;l?n.push(Ite(s,e)):d&&(r=Tte(s,e,r),o.push(r.doc))},"comments"),{leading:n,trailing:o}}function Xa(s,e,t){let{leading:i,trailing:n}=cH(s,t);return!i&&!n?e:MT(e,o=>[i,o,n])}var Nte=class extends Error{constructor(e,t,i="type"){super(`Unexpected ${t} node ${i}: ${JSON.stringify(e[i])}.`);Q1(this,"name","UnexpectedNodeError");this.node=e}},t0=Nte;function Ate(s){if(typeof s!="string")throw new TypeError("Expected a string");return s.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}var Ia,Mte=class{constructor(s){lQ(this,Ia),dQ(this,Ia,new Set(s))}getLeadingWhitespaceCount(s){let e=uu(this,Ia),t=0;for(let i=0;i=0&&e.has(s.charAt(i));i--)t++;return t}getLeadingWhitespace(s){let e=this.getLeadingWhitespaceCount(s);return s.slice(0,e)}getTrailingWhitespace(s){let e=this.getTrailingWhitespaceCount(s);return s.slice(s.length-e)}hasLeadingWhitespace(s){return uu(this,Ia).has(s.charAt(0))}hasTrailingWhitespace(s){return uu(this,Ia).has(Si(!1,s,-1))}trimStart(s){let e=this.getLeadingWhitespaceCount(s);return s.slice(e)}trimEnd(s){let e=this.getTrailingWhitespaceCount(s);return s.slice(0,s.length-e)}trim(s){return this.trimEnd(this.trimStart(s))}split(s,e=!1){let t=`[${Ate([...uu(this,Ia)].join(""))}]+`,i=new RegExp(e?`(${t})`:t,"u");return s.split(i)}hasWhitespaceCharacter(s){let e=uu(this,Ia);return Array.prototype.some.call(s,t=>e.has(t))}hasNonWhitespaceCharacter(s){let e=uu(this,Ia);return Array.prototype.some.call(s,t=>!e.has(t))}isWhitespaceOnly(s){let e=uu(this,Ia);return Array.prototype.every.call(s,t=>e.has(t))}};Ia=new WeakMap;var Rte=Mte,Ny=new Rte(` \r `),yE=s=>s===""||s===Ue||s===Se||s===be;function Pte(s,e,t){var i,n,o,r,a;let{node:l}=s;if(l.type==="JSXElement"&&Xte(l))return[t("openingElement"),t("closingElement")];let d=l.type==="JSXElement"?t("openingElement"):t("openingFragment"),c=l.type==="JSXElement"?t("closingElement"):t("closingFragment");if(l.children.length===1&&l.children[0].type==="JSXExpressionContainer"&&(l.children[0].expression.type==="TemplateLiteral"||l.children[0].expression.type==="TaggedTemplateExpression"))return[d,...s.map(t,"children"),c];l.children=l.children.map(k=>Yte(k)?{type:"JSXText",value:" ",raw:" "}:k);let u=l.children.some(bs),h=l.children.filter(k=>k.type==="JSXExpressionContainer").length>1,g=l.type==="JSXElement"&&l.openingElement.attributes.length>1,f=So(d)||u||g||h,m=s.parent.rootMarker==="mdx",_=e.singleQuote?"{' '}":'{" "}',v=m?Ue:Rt([_,be]," "),b=((n=(i=l.openingElement)==null?void 0:i.name)==null?void 0:n.name)==="fbt",C=Fte(s,e,t,v,b),w=l.children.some(k=>Db(k));for(let k=C.length-2;k>=0;k--){let I=C[k]===""&&C[k+1]==="",O=C[k]===Se&&C[k+1]===""&&C[k+2]===Se,R=(C[k]===be||C[k]===Se)&&C[k+1]===""&&C[k+2]===v,P=C[k]===v&&C[k+1]===""&&(C[k+2]===be||C[k+2]===Se),F=C[k]===v&&C[k+1]===""&&C[k+2]===v,V=C[k]===be&&C[k+1]===""&&C[k+2]===Se||C[k]===Se&&C[k+1]===""&&C[k+2]===be;O&&w||I||R||F||V?C.splice(k,2):P&&C.splice(k+1,2)}for(;C.length>0&&yE(Si(!1,C,-1));)C.pop();for(;C.length>1&&yE(C[0])&&yE(C[1]);)C.shift(),C.shift();let y=[""];for(let[k,I]of C.entries()){if(I===v){if(k===1&&kJ(C[k-1])){if(C.length===2){y.push([y.pop(),_]);continue}y.push([_,Se],"");continue}else if(k===C.length-1){y.push([y.pop(),_]);continue}else if(C[k-1]===""&&C[k-2]===Se){y.push([y.pop(),_]);continue}}k%2===0?y.push([y.pop(),I]):y.push(I,""),So(I)&&(f=!0)}let D=w?WW(y):re(y,{shouldBreak:!0});if(((o=e.cursorNode)==null?void 0:o.type)==="JSXText"&&l.children.includes(e.cursorNode)?D=[sw,D,sw]:((r=e.nodeBeforeCursor)==null?void 0:r.type)==="JSXText"&&l.children.includes(e.nodeBeforeCursor)?D=[sw,D]:((a=e.nodeAfterCursor)==null?void 0:a.type)==="JSXText"&&l.children.includes(e.nodeAfterCursor)&&(D=[D,sw]),m)return D;let L=re([d,Le([Se,D]),Se,c]);return f?L:qg([re([d,...C,c]),L])}function Fte(s,e,t,i,n){let o="",r=[o];function a(d){o=d,r.push([r.pop(),d])}function l(d){d!==""&&(o=d,r.push(d,""))}return s.each(({node:d,next:c})=>{if(d.type==="JSXText"){let u=fa(d);if(Db(d)){let h=Ny.split(u,!0);h[0]===""&&(h.shift(),/\n/u.test(h[0])?l(R5(n,h[1],d,c)):l(i),h.shift());let g;if(Si(!1,h,-1)===""&&(h.pop(),g=h.pop()),h.length===0)return;for(let[f,m]of h.entries())f%2===1?l(Ue):a(m);g!==void 0?/\n/u.test(g)?l(R5(n,o,d,c)):l(i):l(M5(n,o,d,c))}else/\n/u.test(u)?u.match(/\n/gu).length>1&&l(Se):l(i)}else{let u=t();if(a(u),c&&Db(c)){let h=Ny.trim(fa(c)),[g]=Ny.split(h);l(M5(n,g,d,c))}else l(Se)}},"children"),r}function M5(s,e,t,i){return s?"":t.type==="JSXElement"&&!t.closingElement||(i==null?void 0:i.type)==="JSXElement"&&!i.closingElement?e.length===1?be:Se:be}function R5(s,e,t,i){return s?Se:e.length===1?t.type==="JSXElement"&&!t.closingElement||(i==null?void 0:i.type)==="JSXElement"&&!i.closingElement?Se:be:Se}var Ote=new Set(["ArrayExpression","TupleExpression","JSXAttribute","JSXElement","JSXExpressionContainer","JSXFragment","ExpressionStatement","CallExpression","OptionalCallExpression","ConditionalExpression","JsExpressionRoot"]);function Bte(s,e,t){let{parent:i}=s;if(Ote.has(i.type))return e;let n=s.match(void 0,r=>r.type==="ArrowFunctionExpression",ui,r=>r.type==="JSXExpressionContainer"),o=ip(s,t);return re([o?"":Rt("("),Le([be,e]),be,o?"":Rt(")")],{shouldBreak:n})}function Wte(s,e,t){let{node:i}=s,n=[];if(n.push(t("name")),i.value){let o;if(sr(i.value)){let r=fa(i.value),a=As(!1,As(!1,r.slice(1,-1),"'","'"),""",'"'),l=CW(a,e.jsxSingleQuote);a=l==='"'?As(!1,a,'"',"""):As(!1,a,"'","'"),o=s.call(()=>Xa(s,_f(l+a+l),e),"value")}else o=t("value");n.push("=",o)}return n}function Hte(s,e,t){let{node:i}=s,n=(o,r)=>o.type==="JSXEmptyExpression"||!Re(o)&&(zs(o)||il(o)||o.type==="ArrowFunctionExpression"||o.type==="AwaitExpression"&&(n(o.argument,o)||o.argument.type==="JSXElement")||ui(o)||o.type==="ChainExpression"&&ui(o.expression)||o.type==="FunctionExpression"||o.type==="TemplateLiteral"||o.type==="TaggedTemplateExpression"||o.type==="DoExpression"||bs(r)&&(o.type==="ConditionalExpression"||Fc(o)));return n(i.expression,s.parent)?re(["{",t("expression"),Bc,"}"]):re(["{",Le([be,t("expression")]),be,Bc,"}"])}function Vte(s,e,t){var i,n;let{node:o}=s,r=Re(o.name)||Re(o.typeParameters)||Re(o.typeArguments);if(o.selfClosing&&o.attributes.length===0&&!r)return["<",t("name"),o.typeArguments?t("typeArguments"):t("typeParameters")," />"];if(((i=o.attributes)==null?void 0:i.length)===1&&sr(o.attributes[0].value)&&!o.attributes[0].value.value.includes(` `)&&!r&&!Re(o.attributes[0]))return re(["<",t("name"),o.typeArguments?t("typeArguments"):t("typeParameters")," ",...s.map(t,"attributes"),o.selfClosing?" />":">"]);let a=(n=o.attributes)==null?void 0:n.some(d=>sr(d.value)&&d.value.value.includes(` `)),l=e.singleAttributePerLine&&o.attributes.length>1?Se:Ue;return re(["<",t("name"),o.typeArguments?t("typeArguments"):t("typeParameters"),Le(s.map(()=>[l,t()],"attributes")),...zte(o,e,r)],{shouldBreak:a})}function zte(s,e,t){return s.selfClosing?[Ue,"/>"]:Ute(s,e,t)?[">"]:[be,">"]}function Ute(s,e,t){let i=s.attributes.length>0&&Re(Si(!1,s.attributes,-1),Ze.Trailing);return s.attributes.length===0&&!t||(e.bracketSameLine||e.jsxBracketSameLine)&&(!t||s.attributes.length>0)&&!i}function $te(s,e,t){let{node:i}=s,n=[];n.push(""),n}function jte(s,e){let{node:t}=s,i=Re(t),n=Re(t,Ze.Line),o=t.type==="JSXOpeningFragment";return[o?"<":""]}function Kte(s,e,t){let i=Xa(s,Pte(s,e,t),e);return Bte(s,i,e)}function qte(s,e){let{node:t}=s,i=Re(t,Ze.Line);return[gn(s,e,{indent:i}),i?Se:""]}function Gte(s,e,t){let{node:i}=s;return["{",s.call(({node:n})=>{let o=["...",t()];return!Re(n)||!JW(s)?o:[Le([be,Xa(s,o,e)]),be]},i.type==="JSXSpreadAttribute"?"argument":"expression"),"}"]}function Zte(s,e,t){let{node:i}=s;if(i.type.startsWith("JSX"))switch(i.type){case"JSXAttribute":return Wte(s,e,t);case"JSXIdentifier":return i.name;case"JSXNamespacedName":return si(":",[t("namespace"),t("name")]);case"JSXMemberExpression":return si(".",[t("object"),t("property")]);case"JSXSpreadAttribute":case"JSXSpreadChild":return Gte(s,e,t);case"JSXExpressionContainer":return Hte(s,e,t);case"JSXFragment":case"JSXElement":return Kte(s,e,t);case"JSXOpeningElement":return Vte(s,e,t);case"JSXClosingElement":return $te(s,e,t);case"JSXOpeningFragment":case"JSXClosingFragment":return jte(s,e);case"JSXEmptyExpression":return qte(s,e);case"JSXText":throw new Error("JSXText should be handled by JSXElement");default:throw new t0(i,"JSX")}}function Xte(s){if(s.children.length===0)return!0;if(s.children.length>1)return!1;let e=s.children[0];return e.type==="JSXText"&&!Db(e)}function Db(s){return s.type==="JSXText"&&(Ny.hasNonWhitespaceCharacter(fa(s))||!/\n/u.test(fa(s)))}function Yte(s){return s.type==="JSXExpressionContainer"&&sr(s.expression)&&s.expression.value===" "&&!Re(s.expression)}function Qte(s){let{node:e,parent:t}=s;if(!bs(e)||!bs(t))return!1;let{index:i,siblings:n}=s,o;for(let r=i;r>0;r--){let a=n[r-1];if(!(a.type==="JSXText"&&!Db(a))){o=a;break}}return(o==null?void 0:o.type)==="JSXExpressionContainer"&&o.expression.type==="JSXEmptyExpression"&&OL(o.expression)}function Jte(s){return OL(s.node)||Qte(s)}var uH=Jte,eie=0;function hH(s,e,t){var i;let{node:n,parent:o,grandparent:r,key:a}=s,l=a!=="body"&&(o.type==="IfStatement"||o.type==="WhileStatement"||o.type==="SwitchStatement"||o.type==="DoWhileStatement"),d=n.operator==="|>"&&((i=s.root.extra)==null?void 0:i.__isUsingHackPipeline),c=VT(s,t,e,!1,l);if(l)return c;if(d)return re(c);if(ui(o)&&o.callee===n||o.type==="UnaryExpression"||Rn(o)&&!o.computed)return re([Le([be,...c]),be]);let u=o.type==="ReturnStatement"||o.type==="ThrowStatement"||o.type==="JSXExpressionContainer"&&r.type==="JSXAttribute"||n.operator!=="|"&&o.type==="JsExpressionRoot"||n.type!=="NGPipeExpression"&&(o.type==="NGRoot"&&e.parser==="__ng_binding"||o.type==="NGMicrosyntaxExpression"&&r.type==="NGMicrosyntax"&&r.body.length===1)||n===o.body&&o.type==="ArrowFunctionExpression"||n!==o.body&&o.type==="ForStatement"||o.type==="ConditionalExpression"&&r.type!=="ReturnStatement"&&r.type!=="ThrowStatement"&&!ui(r)||o.type==="TemplateLiteral",h=o.type==="AssignmentExpression"||o.type==="VariableDeclarator"||o.type==="ClassProperty"||o.type==="PropertyDefinition"||o.type==="TSAbstractPropertyDefinition"||o.type==="ClassPrivateProperty"||Qc(o),g=Fc(n.left)&&bP(n.operator,n.left.operator);if(u||Lb(n)&&!g||!Lb(n)&&h)return re(c);if(c.length===0)return"";let f=bs(n.right),m=c.findIndex(y=>typeof y!="string"&&!Array.isArray(y)&&y.type===pa),_=c.slice(0,m===-1?1:m+1),v=c.slice(_.length,f?-1:void 0),b=Symbol("logicalChain-"+ ++eie),C=re([..._,Le(v)],{id:b});if(!f)return C;let w=Si(!1,c,-1);return re([C,BL(w,{groupId:b})])}function VT(s,e,t,i,n){var o;let{node:r}=s;if(!Fc(r))return[re(e())];let a=[];bP(r.operator,r.left.operator)?a=s.call(_=>VT(_,e,t,!0,n),"left"):a.push(re(e("left")));let l=Lb(r),d=(r.operator==="|>"||r.type==="NGPipeExpression"||tie(s,t))&&!vh(t.originalText,r.right),c=!Re(r.right,Ze.Leading,UW)&&vh(t.originalText,r.right),u=r.type==="NGPipeExpression"?"|":r.operator,h=r.type==="NGPipeExpression"&&r.arguments.length>0?re(Le([be,": ",si([Ue,": "],s.map(()=>gd(2,re(e())),"arguments"))])):"",g;if(l)g=[u," ",e("right"),h];else{let _=u==="|>"&&((o=s.root.extra)!=null&&o.__isUsingHackPipeline)?s.call(v=>VT(v,e,t,!0,n),"right"):e("right");if(t.experimentalOperatorPosition==="start"){let v="";if(c)switch(Qh(_)){case Oc:v=_.splice(0,1)[0];break;case Jc:v=_.contents.splice(0,1)[0];break}g=[Ue,v,u," ",_,h]}else g=[d?Ue:"",u,d?" ":Ue,_,h]}let{parent:f}=s,m=Re(r.left,Ze.Trailing|Ze.Line);if((m||!(n&&r.type==="LogicalExpression")&&f.type!==r.type&&r.left.type!==r.type&&r.right.type!==r.type)&&(g=re(g,{shouldBreak:m})),t.experimentalOperatorPosition==="start"?a.push(l||c?" ":"",g):a.push(d?"":" ",g),i&&Re(r)){let _=yP(Xa(s,a,t));return _.type===Xh?_.parts:Array.isArray(_)?_:[_]}return a}function Lb(s){return s.type!=="LogicalExpression"?!1:!!(il(s.right)&&s.right.properties.length>0||zs(s.right)&&s.right.elements.length>0||bs(s.right))}var P5=s=>s.type==="BinaryExpression"&&s.operator==="|";function tie(s,e){return(e.parser==="__vue_expression"||e.parser==="__vue_ts_expression")&&P5(s.node)&&!s.hasAncestor(t=>!P5(t)&&t.type!=="JsExpressionRoot")}function iie(s,e,t){let{node:i}=s;if(i.type.startsWith("NG"))switch(i.type){case"NGRoot":return[t("node"),Re(i.node)?" //"+Dm(i.node)[0].value.trimEnd():""];case"NGPipeExpression":return hH(s,e,t);case"NGChainedExpression":return re(si([";",Ue],s.map(()=>sie(s)?t():["(",t(),")"],"expressions")));case"NGEmptyExpression":return"";case"NGMicrosyntax":return s.map(()=>[s.isFirst?"":F5(s)?" ":[";",Ue],t()],"body");case"NGMicrosyntaxKey":return/^[$_a-z][\w$]*(?:-[$_a-z][\w$])*$/iu.test(i.name)?i.name:JSON.stringify(i.name);case"NGMicrosyntaxExpression":return[t("expression"),i.alias===null?"":[" as ",t("alias")]];case"NGMicrosyntaxKeyedExpression":{let{index:n,parent:o}=s,r=F5(s)||(n===1&&(i.key.name==="then"||i.key.name==="else"||i.key.name==="as")||(n===2||n===3)&&(i.key.name==="else"&&o.body[n-1].type==="NGMicrosyntaxKeyedExpression"&&o.body[n-1].key.name==="then"||i.key.name==="track"))&&o.body[0].type==="NGMicrosyntaxExpression";return[t("key"),r?" ":": ",t("expression")]}case"NGMicrosyntaxLet":return["let ",t("key"),i.value===null?"":[" = ",t("value")]];case"NGMicrosyntaxAs":return[t("key")," as ",t("alias")];default:throw new t0(i,"Angular")}}function F5({node:s,index:e}){return s.type==="NGMicrosyntaxKeyedExpression"&&s.key.name==="of"&&e===1}var nie=wi(["CallExpression","OptionalCallExpression","AssignmentExpression"]);function sie({node:s}){return TT(s,nie)}function gH(s,e,t){let{node:i}=s;return re([si(Ue,s.map(t,"decorators")),fH(i,e)?Se:Ue])}function oie(s,e,t){return pH(s.node)?[si(Se,s.map(t,"declaration","decorators")),Se]:""}function rie(s,e,t){let{node:i,parent:n}=s,{decorators:o}=i;if(!mi(o)||pH(n)||uH(s))return"";let r=i.type==="ClassExpression"||i.type==="ClassDeclaration"||fH(i,e);return[s.key==="declaration"&&YQ(n)?Se:r?fd:"",si(Ue,s.map(t,"decorators")),Ue]}function fH(s,e){return s.decorators.some(t=>Ar(e.originalText,oi(t)))}function pH(s){var e;if(s.type!=="ExportDefaultDeclaration"&&s.type!=="ExportNamedDeclaration"&&s.type!=="DeclareExportDeclaration")return!1;let t=(e=s.declaration)==null?void 0:e.decorators;return mi(t)&&RL(s,t[0])}var DS=class extends Error{constructor(){super(...arguments);Q1(this,"name","ArgExpansionBailout")}};function aie(s,e,t){let{node:i}=s,n=wa(i);if(n.length===0)return["(",gn(s,e),")"];let o=n.length-1;if(cie(n)){let u=["("];return yS(s,(h,g)=>{u.push(t()),g!==o&&u.push(", ")}),u.push(")"),u}let r=!1,a=[];yS(s,({node:u},h)=>{let g=t();h===o||(Yc(u,e)?(r=!0,g=[g,",",Se,Se]):g=[g,",",Ue]),a.push(g)});let l=!e.parser.startsWith("__ng_")&&i.type!=="ImportExpression"&&Xc(e,"all")?",":"";function d(){return re(["(",Le([Ue,...a]),l,Ue,")"],{shouldBreak:!0})}if(r||s.parent.type!=="Decorator"&&aJ(n))return d();if(die(n)){let u=a.slice(1);if(u.some(So))return d();let h;try{h=t(L5(i,0),{expandFirstArg:!0})}catch(g){if(g instanceof DS)return d();throw g}return So(h)?[fd,qg([["(",re(h,{shouldBreak:!0}),", ",...u,")"],d()])]:qg([["(",h,", ",...u,")"],["(",re(h,{shouldBreak:!0}),", ",...u,")"],d()])}if(lie(n,a,e)){let u=a.slice(0,-1);if(u.some(So))return d();let h;try{h=t(L5(i,-1),{expandLastArg:!0})}catch(g){if(g instanceof DS)return d();throw g}return So(h)?[fd,qg([["(",...u,re(h,{shouldBreak:!0}),")"],d()])]:qg([["(",...u,h,")"],["(",...u,re(h,{shouldBreak:!0}),")"],d()])}let c=["(",Le([be,...a]),Rt(l),be,")"];return MW(s)?c:re(c,{shouldBreak:a.some(So)||r})}function Bv(s,e=!1){return il(s)&&(s.properties.length>0||Re(s))||zs(s)&&(s.elements.length>0||Re(s))||s.type==="TSTypeAssertion"&&Bv(s.expression)||Xl(s)&&Bv(s.expression)||s.type==="FunctionExpression"||s.type==="ArrowFunctionExpression"&&(!s.returnType||!s.returnType.typeAnnotation||s.returnType.typeAnnotation.type!=="TSTypeReference"||uie(s.body))&&(s.body.type==="BlockStatement"||s.body.type==="ArrowFunctionExpression"&&Bv(s.body,!0)||il(s.body)||zs(s.body)||!e&&(ui(s.body)||s.body.type==="ConditionalExpression")||bs(s.body))||s.type==="DoExpression"||s.type==="ModuleExpression"}function lie(s,e,t){var i,n;let o=Si(!1,s,-1);if(s.length===1){let a=Si(!1,e,-1);if((i=a.label)!=null&&i.embed&&((n=a.label)==null?void 0:n.hug)!==!1)return!0}let r=Si(!1,s,-2);return!Re(o,Ze.Leading)&&!Re(o,Ze.Trailing)&&Bv(o)&&(!r||r.type!==o.type)&&(s.length!==2||r.type!=="ArrowFunctionExpression"||!zs(o))&&!(s.length>1&&VH(o,t))}function die(s){if(s.length!==2)return!1;let[e,t]=s;return e.type==="ModuleExpression"&&hie(t)?!0:!Re(e)&&(e.type==="FunctionExpression"||e.type==="ArrowFunctionExpression"&&e.body.type==="BlockStatement")&&t.type!=="FunctionExpression"&&t.type!=="ArrowFunctionExpression"&&t.type!=="ConditionalExpression"&&mH(t)&&!Bv(t)}function mH(s){if(s.type==="ParenthesizedExpression")return mH(s.expression);if(Xl(s)||s.type==="TypeCastExpression"){let{typeAnnotation:e}=s;if(e.type==="TypeAnnotation"&&(e=e.typeAnnotation),e.type==="TSArrayType"&&(e=e.elementType,e.type==="TSArrayType"&&(e=e.elementType)),e.type==="GenericTypeAnnotation"||e.type==="TSTypeReference"){let t=e.typeArguments??e.typeParameters;(t==null?void 0:t.params.length)===1&&(e=t.params[0])}return _P(e)&&Wa(s.expression,1)}return i_(s)&&wa(s).length>1?!1:Fc(s)?Wa(s.left,1)&&Wa(s.right,1):kW(s)||Wa(s)}function cie(s){return s.length===2?O5(s,0):s.length===3?s[0].type==="Identifier"&&O5(s,1):!1}function O5(s,e){let t=s[e],i=s[e+1];return t.type==="ArrowFunctionExpression"&&uo(t).length===0&&t.body.type==="BlockStatement"&&i.type==="ArrayExpression"&&!s.some(n=>Re(n))}function uie(s){return s.type==="BlockStatement"&&(s.body.some(e=>e.type!=="EmptyStatement")||Re(s,Ze.Dangling))}function hie(s){return s.type==="ObjectExpression"&&s.properties.length===1&&Qc(s.properties[0])&&s.properties[0].key.type==="Identifier"&&s.properties[0].key.name==="type"&&sr(s.properties[0].value)&&s.properties[0].value.value==="module"}var zT=aie,gie=s=>((s.type==="ChainExpression"||s.type==="TSNonNullExpression")&&(s=s.expression),ui(s)&&wa(s).length>0);function fie(s,e,t){var i;let n=t("object"),o=_H(s,e,t),{node:r}=s,a=s.findAncestor(c=>!(Rn(c)||c.type==="TSNonNullExpression")),l=s.findAncestor(c=>!(c.type==="ChainExpression"||c.type==="TSNonNullExpression")),d=a&&(a.type==="NewExpression"||a.type==="BindExpression"||a.type==="AssignmentExpression"&&a.left.type!=="Identifier")||r.computed||r.object.type==="Identifier"&&r.property.type==="Identifier"&&!Rn(l)||(l.type==="AssignmentExpression"||l.type==="VariableDeclarator")&&(gie(r.object)||((i=n.label)==null?void 0:i.memberChain));return s1(n.label,[n,d?o:re(Le([be,o]))])}function _H(s,e,t){let i=t("property"),{node:n}=s,o=ko(s);return n.computed?!n.property||Pc(n.property)?[o,"[",i,"]"]:re([o,"[",Le([be,i]),be,"]"]):[o,".",i]}function vH(s,e,t){if(s.node.type==="ChainExpression")return s.call(()=>vH(s,e,t),"expression");let{parent:i}=s,n=!i||i.type==="ExpressionStatement",o=[];function r(V){let{originalText:U}=e,J=e0(U,oi(V));return U.charAt(J)===")"?J!==!1&&gP(U,J+1):Yc(V,e)}function a(){let{node:V}=s;if(V.type==="ChainExpression")return s.call(a,"expression");if(ui(V)&&(zp(V.callee)||ui(V.callee))){let U=r(V);o.unshift({node:V,hasTrailingEmptyLine:U,printed:[Xa(s,[ko(s),vf(s,e,t),zT(s,e,t)],e),U?Se:""]}),s.call(a,"callee")}else zp(V)?(o.unshift({node:V,needsParens:ip(s,e),printed:Xa(s,Rn(V)?_H(s,e,t):WH(s,e,t),e)}),s.call(a,"object")):V.type==="TSNonNullExpression"?(o.unshift({node:V,printed:Xa(s,"!",e)}),s.call(a,"expression")):o.unshift({node:V,printed:t()})}let{node:l}=s;o.unshift({node:l,printed:[ko(s),vf(s,e,t),zT(s,e,t)]}),l.callee&&s.call(a,"callee");let d=[],c=[o[0]],u=1;for(;u0&&d.push(c);function g(V){return/^[A-Z]|^[$_]+$/u.test(V)}function f(V){return V.length<=e.tabWidth}function m(V){var U;let J=(U=V[1][0])==null?void 0:U.node.computed;if(V[0].length===1){let De=V[0][0].node;return De.type==="ThisExpression"||De.type==="Identifier"&&(g(De.name)||n&&f(De.name)||J)}let pe=Si(!1,V[0],-1).node;return Rn(pe)&&pe.property.type==="Identifier"&&(g(pe.property.name)||J)}let _=d.length>=2&&!Re(d[1][0].node)&&m(d);function v(V){let U=V.map(J=>J.printed);return V.length>0&&Si(!1,V,-1).needsParens?["(",...U,")"]:U}function b(V){return V.length===0?"":Le([Se,si(Se,V.map(v))])}let C=d.map(v),w=C,y=_?3:2,D=d.flat(),L=D.slice(1,-1).some(V=>Re(V.node,Ze.Leading))||D.slice(0,-1).some(V=>Re(V.node,Ze.Trailing))||d[y]&&Re(d[y][0].node,Ze.Leading);if(d.length<=y&&!L&&!d.some(V=>Si(!1,V,-1).hasTrailingEmptyLine))return MW(s)?w:re(w);let k=Si(!1,d[_?1:0],-1).node,I=!ui(k)&&r(k),O=[v(d[0]),_?d.slice(1,2).map(v):"",I?Se:"",b(d.slice(_?2:1))],R=o.map(({node:V})=>V).filter(ui);function P(){let V=Si(!1,Si(!1,d,-1),-1).node,U=Si(!1,C,-1);return ui(V)&&So(U)&&R.slice(0,-1).some(J=>J.arguments.some(yb))}let F;return L||R.length>2&&R.some(V=>!V.arguments.every(U=>Wa(U)))||C.slice(0,-1).some(So)||P()?F=re(O):F=[So(w)||I?fd:"",qg([w,O])],s1({memberChain:!0},F)}var pie=vH;function bH(s,e,t){var i;let{node:n}=s,o=n.type==="NewExpression",r=n.type==="ImportExpression",a=ko(s),l=wa(n),d=l.length===1&&NW(l[0],e.originalText);if(d||mie(s)||FL(n,s.parent)){let u=[];if(yS(s,()=>{u.push(t())}),!(d&&(i=u[0].label)!=null&&i.embed))return[o?"new ":"",B5(s,t),a,vf(s,e,t),"(",si(", ",u),")"]}if(!r&&!o&&zp(n.callee)&&!s.call(u=>ip(u,e),"callee",...n.callee.type==="ChainExpression"?["expression"]:[]))return pie(s,e,t);let c=[o?"new ":"",B5(s,t),a,vf(s,e,t),zT(s,e,t)];return r||ui(n.callee)?re(c):c}function B5(s,e){let{node:t}=s;return t.type==="ImportExpression"?`import${t.phase?`.${t.phase}`:""}`:e("callee")}function mie(s){let{node:e}=s;if(e.type!=="CallExpression"||e.optional||e.callee.type!=="Identifier")return!1;let t=wa(e);return e.callee.name==="require"?t.length===1&&sr(t[0])||t.length>1:e.callee.name==="define"&&s.parent.type==="ExpressionStatement"?t.length===1||t.length===2&&t[0].type==="ArrayExpression"||t.length===3&&sr(t[0])&&t[1].type==="ArrayExpression":!1}function o1(s,e,t,i,n,o){let r=bie(s,e,t,i,o),a=o?t(o,{assignmentLayout:r}):"";switch(r){case"break-after-operator":return re([re(i),n,re(Le([Ue,a]))]);case"never-break-after-operator":return re([re(i),n," ",a]);case"fluid":{let l=Symbol("assignment");return re([re(i),n,re(Le(Ue),{id:l}),Bc,BL(a,{groupId:l})])}case"break-lhs":return re([i,n," ",re(a)]);case"chain":return[re(i),n,Ue,a];case"chain-tail":return[re(i),n,Le([Ue,a])];case"chain-tail-arrow-chain":return[re(i),n,a];case"only-left":return i}}function _ie(s,e,t){let{node:i}=s;return o1(s,e,t,t("left"),[" ",i.operator],"right")}function vie(s,e,t){return o1(s,e,t,t("id")," =","init")}function bie(s,e,t,i,n){let{node:o}=s,r=o[n];if(!r)return"only-left";let a=!Ay(r);if(s.match(Ay,CH,c=>!a||c.type!=="ExpressionStatement"&&c.type!=="VariableDeclaration"))return a?r.type==="ArrowFunctionExpression"&&r.body.type==="ArrowFunctionExpression"?"chain-tail-arrow-chain":"chain-tail":"chain";if(!a&&Ay(r.right)||vh(e.originalText,r))return"break-after-operator";if(o.type==="ImportAttribute"||r.type==="CallExpression"&&r.callee.name==="require"||e.parser==="json5"||e.parser==="jsonc"||e.parser==="json")return"never-break-after-operator";let l=xJ(i);if(wie(o)||Lie(o)||wH(o)&&l)return"break-lhs";let d=kie(o,i,e);return s.call(()=>Cie(s,e,t,d),n)?"break-after-operator":yie(o)?"break-lhs":!l&&(d||r.type==="TemplateLiteral"||r.type==="TaggedTemplateExpression"||r.type==="BooleanLiteral"||Pc(r)||r.type==="ClassExpression")?"never-break-after-operator":"fluid"}function Cie(s,e,t,i){let n=s.node;if(Fc(n)&&!Lb(n))return!0;switch(n.type){case"StringLiteralTypeAnnotation":case"SequenceExpression":return!0;case"TSConditionalType":case"ConditionalTypeAnnotation":if(!e.experimentalTernaries&&!Tie(n))break;return!0;case"ConditionalExpression":{if(!e.experimentalTernaries){let{test:d}=n;return Fc(d)&&!Lb(d)}let{consequent:a,alternate:l}=n;return a.type==="ConditionalExpression"||l.type==="ConditionalExpression"}case"ClassExpression":return mi(n.decorators)}if(i)return!1;let o=n,r=[];for(;;)if(o.type==="UnaryExpression"||o.type==="AwaitExpression"||o.type==="YieldExpression"&&o.argument!==null)o=o.argument,r.push("argument");else if(o.type==="TSNonNullExpression")o=o.expression,r.push("expression");else break;return!!(sr(o)||s.call(()=>yH(s,e,t),...r))}function wie(s){if(CH(s)){let e=s.left||s.id;return e.type==="ObjectPattern"&&e.properties.length>2&&e.properties.some(t=>{var i;return Qc(t)&&(!t.shorthand||((i=t.value)==null?void 0:i.type)==="AssignmentPattern")})}return!1}function Ay(s){return s.type==="AssignmentExpression"}function CH(s){return Ay(s)||s.type==="VariableDeclarator"}function yie(s){let e=Die(s);if(mi(e)){let t=s.type==="TSTypeAliasDeclaration"?"constraint":"bound";if(e.length>1&&e.some(i=>i[t]||i.default))return!0}return!1}var Sie=wi(["TSTypeAliasDeclaration","TypeAlias"]);function Die(s){var e;if(Sie(s))return(e=s.typeParameters)==null?void 0:e.params}function Lie(s){if(s.type!=="VariableDeclarator")return!1;let{typeAnnotation:e}=s.id;if(!e||!e.typeAnnotation)return!1;let t=W5(e.typeAnnotation);return mi(t)&&t.length>1&&t.some(i=>mi(W5(i))||i.type==="TSConditionalType")}function wH(s){var e;return s.type==="VariableDeclarator"&&((e=s.init)==null?void 0:e.type)==="ArrowFunctionExpression"}var xie=wi(["TSTypeReference","GenericTypeAnnotation"]);function W5(s){var e;if(xie(s))return(e=s.typeArguments??s.typeParameters)==null?void 0:e.params}function yH(s,e,t,i=!1){var n;let{node:o}=s,r=()=>yH(s,e,t,!0);if(o.type==="ChainExpression"||o.type==="TSNonNullExpression")return s.call(r,"expression");if(ui(o)){if((n=bH(s,e,t).label)!=null&&n.memberChain)return!1;let a=wa(o);return!(a.length===0||a.length===1&&vP(a[0],e))||Eie(o,t)?!1:s.call(r,"callee")}return Rn(o)?s.call(r,"object"):i&&(o.type==="Identifier"||o.type==="ThisExpression")}function kie(s,e,t){return Qc(s)?(e=yP(e),typeof e=="string"&&Qm(e)1)return!0;if(t.length===1){let n=t[0];if(bh(n)||CP(n)||n.type==="TSTypeLiteral"||n.type==="ObjectTypeAnnotation")return!0}let i=s.typeParameters?"typeParameters":"typeArguments";if(So(e(i)))return!0}return!1}function Iie(s){var e;return(e=s.typeParameters??s.typeArguments)==null?void 0:e.params}function Tie(s){function e(t){switch(t.type){case"FunctionTypeAnnotation":case"GenericTypeAnnotation":case"TSFunctionType":return!!t.typeParameters;case"TSTypeReference":return!!(t.typeArguments??t.typeParameters);default:return!1}}return e(s.checkType)||e(s.extendsType)}function np(s,e,t,i,n){let o=s.node,r=uo(o),a=n?vf(s,t,e):"";if(r.length===0)return[a,"(",gn(s,t,{filter:g=>nl(t.originalText,oi(g))===")"}),")"];let{parent:l}=s,d=FL(l),c=SH(o),u=[];if(gJ(s,(g,f)=>{let m=f===r.length-1;m&&o.rest&&u.push("..."),u.push(e()),!m&&(u.push(","),d||c?u.push(" "):Yc(r[f],t)?u.push(Se,Se):u.push(Ue))}),i&&!Aie(s)){if(So(a)||So(u))throw new DS;return re([AT(a),"(",AT(u),")"])}let h=r.every(g=>!mi(g.decorators));return c&&h?[a,"(",...u,")"]:d?[a,"(",...u,")"]:(EW(l)||tJ(l)||l.type==="TypeAlias"||l.type==="UnionTypeAnnotation"||l.type==="IntersectionTypeAnnotation"||l.type==="FunctionTypeAnnotation"&&l.returnType===o)&&r.length===1&&r[0].name===null&&o.this!==r[0]&&r[0].typeAnnotation&&o.typeParameters===null&&_P(r[0].typeAnnotation)&&!o.rest?t.arrowParens==="always"||o.type==="HookTypeAnnotation"?["(",...u,")"]:u:[a,"(",Le([be,...u]),Rt(!hJ(o)&&Xc(t,"all")?",":""),be,")"]}function SH(s){if(!s)return!1;let e=uo(s);if(e.length!==1)return!1;let[t]=e;return!Re(t)&&(t.type==="ObjectPattern"||t.type==="ArrayPattern"||t.type==="Identifier"&&t.typeAnnotation&&(t.typeAnnotation.type==="TypeAnnotation"||t.typeAnnotation.type==="TSTypeAnnotation")&&_h(t.typeAnnotation.typeAnnotation)||t.type==="FunctionTypeParam"&&_h(t.typeAnnotation)&&t!==s.rest||t.type==="AssignmentPattern"&&(t.left.type==="ObjectPattern"||t.left.type==="ArrayPattern")&&(t.right.type==="Identifier"||il(t.right)&&t.right.properties.length===0||zs(t.right)&&t.right.elements.length===0))}function Nie(s){let e;return s.returnType?(e=s.returnType,e.typeAnnotation&&(e=e.typeAnnotation)):s.typeAnnotation&&(e=s.typeAnnotation),e}function i0(s,e){var t;let i=Nie(s);if(!i)return!1;let n=(t=s.typeParameters)==null?void 0:t.params;if(n){if(n.length>1)return!1;if(n.length===1){let o=n[0];if(o.constraint||o.default)return!1}}return uo(s).length===1&&(_h(i)||So(e))}function Aie(s){return s.match(e=>e.type==="ArrowFunctionExpression"&&e.body.type==="BlockStatement",(e,t)=>{if(e.type==="CallExpression"&&t==="arguments"&&e.arguments.length===1&&e.callee.type==="CallExpression"){let i=e.callee.callee;return i.type==="Identifier"||i.type==="MemberExpression"&&!i.computed&&i.object.type==="Identifier"&&i.property.type==="Identifier"}return!1},(e,t)=>e.type==="VariableDeclarator"&&t==="init"||e.type==="ExportDefaultDeclaration"&&t==="declaration"||e.type==="TSExportAssignment"&&t==="expression"||e.type==="AssignmentExpression"&&t==="right"&&e.left.type==="MemberExpression"&&e.left.object.type==="Identifier"&&e.left.object.name==="module"&&e.left.property.type==="Identifier"&&e.left.property.name==="exports",e=>e.type!=="VariableDeclaration"||e.kind==="const"&&e.declarations.length===1)}function Mie(s){let e=uo(s);return e.length>1&&e.some(t=>t.type==="TSParameterProperty")}var Rie=wi(["VoidTypeAnnotation","TSVoidKeyword","NullLiteralTypeAnnotation","TSNullKeyword"]),Pie=wi(["ObjectTypeAnnotation","TSTypeLiteral","GenericTypeAnnotation","TSTypeReference"]);function Fie(s){let{types:e}=s;if(e.some(i=>Re(i)))return!1;let t=e.find(i=>Pie(i));return t?e.every(i=>i===t||Rie(i)):!1}function DH(s){return _P(s)||_h(s)?!0:bh(s)?Fie(s):!1}function Oie(s,e,t){let i=e.semi?";":"",{node:n}=s,o=[or(s),"opaque type ",t("id"),t("typeParameters")];return n.supertype&&o.push(": ",t("supertype")),n.impltype&&o.push(" = ",t("impltype")),o.push(i),o}function LH(s,e,t){let i=e.semi?";":"",{node:n}=s,o=[or(s)];o.push("type ",t("id"),t("typeParameters"));let r=n.type==="TSTypeAliasDeclaration"?"typeAnnotation":"right";return[o1(s,e,t,o," =",r),i]}function xH(s,e,t){let i=!1;return re(s.map(({isFirst:n,previous:o,node:r,index:a})=>{let l=t();if(n)return l;let d=_h(r),c=_h(o);return c&&d?[" & ",i?Le(l):l]:!c&&!d?e.experimentalOperatorPosition==="start"?Le([Ue,"& ",l]):Le([" &",Ue,l]):(a>1&&(i=!0),[" & ",a>1?Le(l):l])},"types"))}function kH(s,e,t){let{node:i}=s,{parent:n}=s,o=n.type!=="TypeParameterInstantiation"&&(!Ch(n)||!e.experimentalTernaries)&&n.type!=="TSTypeParameterInstantiation"&&n.type!=="GenericTypeAnnotation"&&n.type!=="TSTypeReference"&&n.type!=="TSTypeAssertion"&&n.type!=="TupleTypeAnnotation"&&n.type!=="TSTupleType"&&!(n.type==="FunctionTypeParam"&&!n.name&&s.grandparent.this!==n)&&!((n.type==="TypeAlias"||n.type==="VariableDeclarator"||n.type==="TSTypeAliasDeclaration")&&vh(e.originalText,i)),r=DH(i),a=s.map(c=>{let u=t();return r||(u=gd(2,u)),Xa(c,u,e)},"types");if(r)return si(" | ",a);let l=o&&!vh(e.originalText,i),d=[Rt([l?Ue:"","| "]),si([Ue,"| "],a)];return ip(s,e)?re([Le(d),be]):(n.type==="TupleTypeAnnotation"||n.type==="TSTupleType")&&n[n.type==="TupleTypeAnnotation"&&n.types?"types":"elementTypes"].length>1?re([Le([Rt(["(",be]),d]),be,Rt(")")]):re(o?Le(d):d)}function Bie(s){var e;let{node:t,parent:i}=s;return t.type==="FunctionTypeAnnotation"&&(EW(i)||!((i.type==="ObjectTypeProperty"||i.type==="ObjectTypeInternalSlot")&&!i.variance&&!i.optional&&RL(i,t)||i.type==="ObjectTypeCallProperty"||((e=s.getParentNode(2))==null?void 0:e.type)==="DeclareFunction"))}function EH(s,e,t){let{node:i}=s,n=[WL(s)];(i.type==="TSConstructorType"||i.type==="TSConstructSignatureDeclaration")&&n.push("new ");let o=np(s,t,e,!1,!0),r=[];return i.type==="FunctionTypeAnnotation"?r.push(Bie(s)?" => ":": ",t("returnType")):r.push(Hs(s,t,i.returnType?"returnType":"typeAnnotation")),i0(i,r)&&(o=re(o)),n.push(o,r),re(n)}function IH(s,e,t){return[t("objectType"),ko(s),"[",t("indexType"),"]"]}function TH(s,e,t){return["infer ",t("typeParameter")]}function H5(s,e,t){let{node:i}=s;return[i.postfix?"":t,Hs(s,e),i.postfix?t:""]}function NH(s,e,t){let{node:i}=s;return["...",...i.type==="TupleTypeSpreadElement"&&i.label?[t("label"),": "]:[],t("typeAnnotation")]}function AH(s,e,t){let{node:i}=s;return[i.variance?t("variance"):"",t("label"),i.optional?"?":"",": ",t("elementType")]}var Wie=new WeakSet;function Hs(s,e,t="typeAnnotation"){let{node:{[t]:i}}=s;if(!i)return"";let n=!1;if(i.type==="TSTypeAnnotation"||i.type==="TypeAnnotation"){let o=s.call(MH,t);(o==="=>"||o===":"&&Re(i,Ze.Leading))&&(n=!0),Wie.add(i)}return n?[" ",e(t)]:e(t)}var MH=s=>s.match(e=>e.type==="TSTypeAnnotation",(e,t)=>(t==="returnType"||t==="typeAnnotation")&&(e.type==="TSFunctionType"||e.type==="TSConstructorType"))?"=>":s.match(e=>e.type==="TSTypeAnnotation",(e,t)=>t==="typeAnnotation"&&(e.type==="TSJSDocNullableType"||e.type==="TSJSDocNonNullableType"||e.type==="TSTypePredicate"))||s.match(e=>e.type==="TypeAnnotation",(e,t)=>t==="typeAnnotation"&&e.type==="Identifier",(e,t)=>t==="id"&&e.type==="DeclareFunction")||s.match(e=>e.type==="TypeAnnotation",(e,t)=>t==="typeAnnotation"&&e.type==="Identifier",(e,t)=>t==="id"&&e.type==="DeclareHook")||s.match(e=>e.type==="TypeAnnotation",(e,t)=>t==="bound"&&e.type==="TypeParameter"&&e.usesExtendsBound)?"":":";function RH(s,e,t){let i=MH(s);return i?[i," ",t("typeAnnotation")]:t("typeAnnotation")}function PH(s){return[s("elementType"),"[]"]}function FH({node:s},e){let t=s.type==="TSTypeQuery"?"exprName":"argument",i=s.type==="TypeofTypeAnnotation"||s.typeArguments?"typeArguments":"typeParameters";return["typeof ",e(t),e(i)]}function OH(s,e){let{node:t}=s;return[t.type==="TSTypePredicate"&&t.asserts?"asserts ":t.type==="TypePredicate"&&t.kind?`${t.kind} `:"",e("parameterName"),t.typeAnnotation?[" is ",Hs(s,e)]:""]}function ko(s){let{node:e}=s;return!e.optional||e.type==="Identifier"&&e===s.parent.key?"":ui(e)||Rn(e)&&e.computed||e.type==="OptionalIndexedAccessType"?"?.":"?"}function BH(s){return s.node.definite||s.match(void 0,(e,t)=>t==="id"&&e.type==="VariableDeclarator"&&e.definite)?"!":""}var Hie=new Set(["DeclareClass","DeclareComponent","DeclareFunction","DeclareHook","DeclareVariable","DeclareExportDeclaration","DeclareExportAllDeclaration","DeclareOpaqueType","DeclareTypeAlias","DeclareEnum","DeclareInterface"]);function or(s){let{node:e}=s;return e.declare||Hie.has(e.type)&&s.parent.type!=="DeclareExportDeclaration"?"declare ":""}var Vie=new Set(["TSAbstractMethodDefinition","TSAbstractPropertyDefinition","TSAbstractAccessorProperty"]);function WL({node:s}){return s.abstract||Vie.has(s.type)?"abstract ":""}function vf(s,e,t){let i=s.node;return i.typeArguments?t("typeArguments"):i.typeParameters?t("typeParameters"):""}function WH(s,e,t){return["::",t("callee")]}function hu(s,e,t){return s.type==="EmptyStatement"?";":s.type==="BlockStatement"||t?[" ",e]:Le([Ue,e])}function HH(s,e){return["...",e("argument"),Hs(s,e)]}function LS(s){return s.accessibility?s.accessibility+" ":""}function zie(s,e,t,i){let{node:n}=s,o=n.inexact?"...":"";return Re(n,Ze.Dangling)?re([t,o,gn(s,e,{indent:!0}),be,i]):[t,o,i]}function TP(s,e,t){let{node:i}=s,n=[],o=i.type==="TupleExpression"?"#[":"[",r="]",a=i.type==="TupleTypeAnnotation"&&i.types?"types":i.type==="TSTupleType"||i.type==="TupleTypeAnnotation"?"elementTypes":"elements",l=i[a];if(l.length===0)n.push(zie(s,e,o,r));else{let d=Si(!1,l,-1),c=(d==null?void 0:d.type)!=="RestElement"&&!i.inexact,u=d===null,h=Symbol("array"),g=!e.__inJestEach&&l.length>1&&l.every((_,v,b)=>{let C=_==null?void 0:_.type;if(!zs(_)&&!il(_))return!1;let w=b[v+1];if(w&&C!==w.type)return!1;let y=zs(_)?"elements":"properties";return _[y]&&_[y].length>1}),f=VH(i,e),m=c?u?",":Xc(e)?f?Rt(",","",{groupId:h}):Rt(","):"":"";n.push(re([o,Le([be,f?$ie(s,e,t,m):[Uie(s,e,a,i.inexact,t),m],gn(s,e)]),be,r],{shouldBreak:g,id:h}))}return n.push(ko(s),Hs(s,t)),n}function VH(s,e){return zs(s)&&s.elements.length>1&&s.elements.every(t=>t&&(Pc(t)||xW(t)&&!Re(t.argument))&&!Re(t,Ze.Trailing|Ze.Line,i=>!Ar(e.originalText,Ln(i),{backwards:!0})))}function zH({node:s},{originalText:e}){let t=n=>uP(e,hP(e,n)),i=n=>e[n]===","?n:i(t(n+1));return gP(e,i(oi(s)))}function Uie(s,e,t,i,n){let o=[];return s.each(({node:r,isLast:a})=>{o.push(r?re(n()):""),(!a||i)&&o.push([",",Ue,r&&zH(s,e)?be:""])},t),i&&o.push("..."),o}function $ie(s,e,t,i){let n=[];return s.each(({isLast:o,next:r})=>{n.push([t(),o?i:","]),o||n.push(zH(s,e)?[Se,Se]:Re(r,Ze.Leading|Ze.Line)?Se:Ue)},"elements"),WW(n)}var jie=/^[\$A-Z_a-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\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-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\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\u0AF9\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-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\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-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\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\u2160-\u2188\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-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\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][\$0-9A-Z_a-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\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\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFB-\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\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]*$/,Kie=s=>jie.test(s),qie=Kie;function Gie(s){return s.length===1?s:s.toLowerCase().replace(/^([+-]?[\d.]+e)(?:\+|(-))?0*(?=\d)/u,"$1$2").replace(/^([+-]?[\d.]+)e[+-]?0+$/u,"$1").replace(/^([+-])?\./u,"$10.").replace(/(\.\d+?)0+(?=e|$)/u,"$1").replace(/\.(?=e|$)/u,"")}var n_=Gie,My=new WeakMap;function UH(s){return/^(?:\d+|\d+\.\d+)$/u.test(s)}function V5(s,e){return e.parser==="json"||e.parser==="jsonc"||!sr(s.key)||t_(fa(s.key),e).slice(1,-1)!==s.key.value?!1:!!(qie(s.key.value)&&!(e.parser==="babel-ts"&&s.type==="ClassProperty"||e.parser==="typescript"&&s.type==="PropertyDefinition")||UH(s.key.value)&&String(Number(s.key.value))===s.key.value&&s.type!=="ImportAttribute"&&(e.parser==="babel"||e.parser==="acorn"||e.parser==="espree"||e.parser==="meriyah"||e.parser==="__babel_estree"))}function Zie(s,e){let{key:t}=s.node;return(t.type==="Identifier"||Pc(t)&&UH(n_(fa(t)))&&String(t.value)===n_(fa(t))&&!(e.parser==="typescript"||e.parser==="babel-ts"))&&(e.parser==="json"||e.parser==="jsonc"||e.quoteProps==="consistent"&&My.get(s.parent))}function r1(s,e,t){let{node:i}=s;if(i.computed)return["[",t("key"),"]"];let{parent:n}=s,{key:o}=i;if(e.quoteProps==="consistent"&&!My.has(n)){let r=s.siblings.some(a=>!a.computed&&sr(a.key)&&!V5(a,e));My.set(n,r)}if(Zie(s,e)){let r=t_(JSON.stringify(o.type==="Identifier"?o.name:o.value.toString()),e);return s.call(a=>Xa(a,r,e),"key")}return V5(i,e)&&(e.quoteProps==="as-needed"||e.quoteProps==="consistent"&&!My.get(n))?s.call(r=>Xa(r,/^\d/u.test(o.value)?n_(o.value):o.value,e),"key"):t("key")}function SE(s,e,t){let{node:i}=s;return i.shorthand?t("value"):o1(s,e,t,r1(s,e,t),":","value")}var Xie=({node:s,key:e,parent:t})=>e==="value"&&s.type==="FunctionExpression"&&(t.type==="ObjectMethod"||t.type==="ClassMethod"||t.type==="ClassPrivateMethod"||t.type==="MethodDefinition"||t.type==="TSAbstractMethodDefinition"||t.type==="TSDeclareMethod"||t.type==="Property"&&PL(t));function $H(s,e,t,i){if(Xie(s))return NP(s,t,e);let{node:n}=s,o=!1;if((n.type==="FunctionDeclaration"||n.type==="FunctionExpression")&&i!=null&&i.expandLastArg){let{parent:c}=s;ui(c)&&(wa(c).length>1||uo(n).every(u=>u.type==="Identifier"&&!u.typeAnnotation))&&(o=!0)}let r=[or(s),n.async?"async ":"",`function${n.generator?"*":""} `,n.id?e("id"):""],a=np(s,e,t,o),l=HL(s,e),d=i0(n,l);return r.push(vf(s,t,e),re([d?re(a):a,l]),n.body?" ":"",e("body")),t.semi&&(n.declare||!n.body)&&r.push(";"),r}function UT(s,e,t){let{node:i}=s,{kind:n}=i,o=i.value||i,r=[];return!n||n==="init"||n==="method"||n==="constructor"?o.async&&r.push("async "):(fP.ok(n==="get"||n==="set"),r.push(n," ")),o.generator&&r.push("*"),r.push(r1(s,e,t),i.optional||i.key.optional?"?":"",i===o?NP(s,e,t):t("value")),r}function NP(s,e,t){let{node:i}=s,n=np(s,t,e),o=HL(s,t),r=Mie(i),a=i0(i,o),l=[vf(s,e,t),re([r?re(n,{shouldBreak:!0}):a?re(n):n,o])];return i.body?l.push(" ",t("body")):l.push(e.semi?";":""),l}function Yie(s){let e=uo(s);return e.length===1&&!s.typeParameters&&!Re(s,Ze.Dangling)&&e[0].type==="Identifier"&&!e[0].typeAnnotation&&!Re(e[0])&&!e[0].optional&&!s.predicate&&!s.returnType}function jH(s,e){if(e.arrowParens==="always")return!1;if(e.arrowParens==="avoid"){let{node:t}=s;return Yie(t)}return!1}function HL(s,e){let{node:t}=s,i=[Hs(s,e,"returnType")];return t.predicate&&i.push(e("predicate")),i}function KH(s,e,t){let{node:i}=s,n=e.semi?";":"",o=[];if(i.argument){let l=t("argument");ene(e,i.argument)?l=["(",Le([Se,l]),Se,")"]:(Fc(i.argument)||i.argument.type==="SequenceExpression"||e.experimentalTernaries&&i.argument.type==="ConditionalExpression"&&(i.argument.consequent.type==="ConditionalExpression"||i.argument.alternate.type==="ConditionalExpression"))&&(l=re([Rt("("),Le([be,l]),be,Rt(")")])),o.push(" ",l)}let r=Re(i,Ze.Dangling),a=n&&r&&Re(i,Ze.Last|Ze.Line);return a&&o.push(n),r&&o.push(" ",gn(s,e)),a||o.push(n),o}function Qie(s,e,t){return["return",KH(s,e,t)]}function Jie(s,e,t){return["throw",KH(s,e,t)]}function ene(s,e){if(vh(s.originalText,e)||Re(e,Ze.Leading,t=>wh(s.originalText,Ln(t),oi(t)))&&!bs(e))return!0;if(pP(e)){let t=e,i;for(;i=XQ(t);)if(t=i,vh(s.originalText,t))return!0}return!1}var DE=new WeakMap;function qH(s){return DE.has(s)||DE.set(s,s.type==="ConditionalExpression"&&!Co(s,e=>e.type==="ObjectExpression")),DE.get(s)}var GH=s=>s.type==="SequenceExpression";function tne(s,e,t,i={}){let n=[],o,r=[],a=!1,l=!i.expandLastArg&&s.node.body.type==="ArrowFunctionExpression",d;(function v(){let{node:b}=s,C=ine(s,e,t,i);if(n.length===0)n.push(C);else{let{leading:w,trailing:y}=cH(s,e);n.push([w,C]),r.unshift(y)}l&&(a||(a=b.returnType&&uo(b).length>0||b.typeParameters||uo(b).some(w=>w.type!=="Identifier"))),!l||b.body.type!=="ArrowFunctionExpression"?(o=t("body",i),d=b.body):s.call(v,"body")})();let c=!vh(e.originalText,d)&&(GH(d)||nne(d,o,e)||!a&&qH(d)),u=s.key==="callee"&&i_(s.parent),h=Symbol("arrow-chain"),g=sne(s,i,{signatureDocs:n,shouldBreak:a}),f=!1,m=!1,_=!1;return l&&(u||i.assignmentLayout)&&(m=!0,_=!Re(s.node,Ze.Leading&Ze.Line),f=i.assignmentLayout==="chain-tail-arrow-chain"||u&&!c),o=one(s,e,i,{bodyDoc:o,bodyComments:r,functionBody:d,shouldPutBodyOnSameLine:c}),re([re(m?Le([_?be:"",g]):g,{shouldBreak:f,id:h})," =>",l?BL(o,{groupId:h}):re(o),l&&u?Rt(be,"",{groupId:h}):""])}function ine(s,e,t,i){let{node:n}=s,o=[];if(n.async&&o.push("async "),jH(s,e))o.push(t(["params",0]));else{let a=i.expandLastArg||i.expandFirstArg,l=HL(s,t);if(a){if(So(l))throw new DS;l=re(AT(l))}o.push(re([np(s,t,e,a,!0),l]))}let r=gn(s,e,{filter(a){let l=e0(e.originalText,oi(a));return l!==!1&&e.originalText.slice(l,l+2)==="=>"}});return r&&o.push(" ",r),o}function nne(s,e,t){var i,n;return zs(s)||il(s)||s.type==="ArrowFunctionExpression"||s.type==="DoExpression"||s.type==="BlockStatement"||bs(s)||((i=e.label)==null?void 0:i.hug)!==!1&&(((n=e.label)==null?void 0:n.embed)||NW(s,t.originalText))}function sne(s,e,{signatureDocs:t,shouldBreak:i}){if(t.length===1)return t[0];let{parent:n,key:o}=s;return o!=="callee"&&i_(n)||Fc(n)?re([t[0]," =>",Le([Ue,si([" =>",Ue],t.slice(1))])],{shouldBreak:i}):o==="callee"&&i_(n)||e.assignmentLayout?re(si([" =>",Ue],t),{shouldBreak:i}):re(Le(si([" =>",Ue],t)),{shouldBreak:i})}function one(s,e,t,{bodyDoc:i,bodyComments:n,functionBody:o,shouldPutBodyOnSameLine:r}){let{node:a,parent:l}=s,d=t.expandLastArg&&Xc(e,"all")?Rt(","):"",c=(t.expandLastArg||l.type==="JSXExpressionContainer")&&!Re(a)?be:"";return r&&qH(o)?[" ",re([Rt("","("),Le([be,i]),Rt("",")"),d,c]),n]:(GH(o)&&(i=re(["(",Le([be,i]),be,")"])),r?[" ",i,n]:[Le([Ue,i,n]),d,c])}var rne=(s,e,t)=>{if(!(s&&e==null)){if(e.findLast)return e.findLast(t);for(let i=e.length-1;i>=0;i--){let n=e[i];if(t(n,i,e))return n}}},ane=rne;function $T(s,e,t,i){let{node:n}=s,o=[],r=ane(!1,n[i],a=>a.type!=="EmptyStatement");return s.each(({node:a})=>{a.type!=="EmptyStatement"&&(o.push(t()),a!==r&&(o.push(Se),Yc(a,e)&&o.push(Se)))},i),o}function ZH(s,e,t){let i=lne(s,e,t),{node:n,parent:o}=s;if(n.type==="Program"&&(o==null?void 0:o.type)!=="ModuleExpression")return i?[i,Se]:"";let r=[];if(n.type==="StaticBlock"&&r.push("static "),r.push("{"),i)r.push(Le([Se,i]),Se);else{let a=s.grandparent;o.type==="ArrowFunctionExpression"||o.type==="FunctionExpression"||o.type==="FunctionDeclaration"||o.type==="ComponentDeclaration"||o.type==="HookDeclaration"||o.type==="ObjectMethod"||o.type==="ClassMethod"||o.type==="ClassPrivateMethod"||o.type==="ForStatement"||o.type==="WhileStatement"||o.type==="DoWhileStatement"||o.type==="DoExpression"||o.type==="ModuleExpression"||o.type==="CatchClause"&&!a.finalizer||o.type==="TSModuleDeclaration"||n.type==="StaticBlock"||r.push(Se)}return r.push("}"),r}function lne(s,e,t){let{node:i}=s,n=mi(i.directives),o=i.body.some(l=>l.type!=="EmptyStatement"),r=Re(i,Ze.Dangling);if(!n&&!o&&!r)return"";let a=[];return n&&(a.push($T(s,e,t,"directives")),(o||r)&&(a.push(Se),Yc(Si(!1,i.directives,-1),e)&&a.push(Se))),o&&a.push($T(s,e,t,"body")),r&&a.push(gn(s,e)),a}function dne(s){let e=new WeakMap;return function(t){return e.has(t)||e.set(t,Symbol(s)),e.get(t)}}var XH=dne;function cne(s){switch(s){case null:return"";case"PlusOptional":return"+?";case"MinusOptional":return"-?";case"Optional":return"?"}}function une(s,e,t){let{node:i}=s;return re([i.variance?t("variance"):"","[",Le([t("keyTparam")," in ",t("sourceType")]),"]",cne(i.optional),": ",t("propType")])}function YH(s,e){return s==="+"||s==="-"?s+e:e}function hne(s,e,t){let{node:i}=s,n=e.objectWrap==="preserve"&&wh(e.originalText,Ln(i),Ln(i.typeParameter));return re(["{",Le([e.bracketSpacing?Ue:be,re([t("typeParameter"),i.optional?YH(i.optional,"?"):"",i.typeAnnotation?": ":"",t("typeAnnotation")]),e.semi?Rt(";"):""]),gn(s,e),e.bracketSpacing?Ue:be,"}"],{shouldBreak:n})}var AP=XH("typeParameters");function gne(s,e,t){let{node:i}=s;return uo(i).length===1&&i.type.startsWith("TS")&&!i[t][0].constraint&&s.parent.type==="ArrowFunctionExpression"&&!(e.filepath&&/\.ts$/u.test(e.filepath))}function Wv(s,e,t,i){let{node:n}=s;if(!n[i])return"";if(!Array.isArray(n[i]))return t(i);let o=FL(s.grandparent),r=s.match(l=>!(l[i].length===1&&_h(l[i][0])),void 0,(l,d)=>d==="typeAnnotation",l=>l.type==="Identifier",wH);if(n[i].length===0||!r&&(o||n[i].length===1&&(n[i][0].type==="NullableTypeAnnotation"||DH(n[i][0]))))return["<",si(", ",s.map(t,i)),fne(s,e),">"];let a=n.type==="TSTypeParameterInstantiation"?"":gne(s,e,i)?",":Xc(e)?Rt(","):"";return re(["<",Le([be,si([",",Ue],s.map(t,i))]),a,be,">"],{id:AP(n)})}function fne(s,e){let{node:t}=s;if(!Re(t,Ze.Dangling))return"";let i=!Re(t,Ze.Line),n=gn(s,e,{indent:!i});return i?n:[n,Se]}function QH(s,e,t){let{node:i,parent:n}=s,o=[i.const?"const ":""],r=i.type==="TSTypeParameter"?t("name"):i.name;if(n.type==="TSMappedType")return n.readonly&&o.push(YH(n.readonly,"readonly")," "),o.push("[",r),i.constraint&&o.push(" in ",t("constraint")),n.nameType&&o.push(" as ",s.callParent(()=>t("nameType"))),o.push("]"),o;if(i.variance&&o.push(t("variance")),i.in&&o.push("in "),i.out&&o.push("out "),o.push(r),i.bound&&(i.usesExtendsBound&&o.push(" extends "),o.push(Hs(s,t,"bound"))),i.constraint){let a=Symbol("constraint");o.push(" extends",re(Le(Ue),{id:a}),Bc,BL(t("constraint"),{groupId:a}))}return i.default&&o.push(" = ",t("default")),re(o)}var JH=wi(["ClassProperty","PropertyDefinition","ClassPrivateProperty","ClassAccessorProperty","AccessorProperty","TSAbstractPropertyDefinition","TSAbstractAccessorProperty"]);function eV(s,e,t){let{node:i}=s,n=[or(s),WL(s),"class"],o=Re(i.id,Ze.Trailing)||Re(i.typeParameters,Ze.Trailing)||Re(i.superClass)||mi(i.extends)||mi(i.mixins)||mi(i.implements),r=[],a=[];if(i.id&&r.push(" ",t("id")),r.push(t("typeParameters")),i.superClass){let c=[_ne(s,e,t),t(i.superTypeArguments?"superTypeArguments":"superTypeParameters")],u=s.call(h=>["extends ",Xa(h,c,e)],"superClass");o?a.push(Ue,re(u)):a.push(" ",u)}else a.push(LE(s,e,t,"extends"));a.push(LE(s,e,t,"mixins"),LE(s,e,t,"implements"));let l;if(o){let c;iV(i)?c=[...r,Le(a)]:c=Le([...r,a]),l=tV(i),n.push(re(c,{id:l}))}else n.push(...r,...a);let d=i.body;return o&&mi(d.body)?n.push(Rt(Se," ",{groupId:l})):n.push(" "),n.push(t("body")),n}var tV=XH("heritageGroup");function pne(s){return Rt(Se,"",{groupId:tV(s)})}function mne(s){return["extends","mixins","implements"].reduce((e,t)=>e+(Array.isArray(s[t])?s[t].length:0),s.superClass?1:0)>1}function iV(s){return s.typeParameters&&!Re(s.typeParameters,Ze.Trailing|Ze.Line)&&!mne(s)}function LE(s,e,t,i){let{node:n}=s;if(!mi(n[i]))return"";let o=gn(s,e,{marker:i});return[iV(n)?Rt(" ",Ue,{groupId:AP(n.typeParameters)}):Ue,o,o&&Se,i,re(Le([Ue,si([",",Ue],s.map(t,i))]))]}function _ne(s,e,t){let i=t("superClass"),{parent:n}=s;return n.type==="AssignmentExpression"?re(Rt(["(",Le([be,i]),be,")"],i)):i}function nV(s,e,t){let{node:i}=s,n=[];return mi(i.decorators)&&n.push(gH(s,e,t)),n.push(LS(i)),i.static&&n.push("static "),n.push(WL(s)),i.override&&n.push("override "),n.push(UT(s,e,t)),n}function sV(s,e,t){let{node:i}=s,n=[],o=e.semi?";":"";mi(i.decorators)&&n.push(gH(s,e,t)),n.push(or(s),LS(i)),i.static&&n.push("static "),n.push(WL(s)),i.override&&n.push("override "),i.readonly&&n.push("readonly "),i.variance&&n.push(t("variance")),(i.type==="ClassAccessorProperty"||i.type==="AccessorProperty"||i.type==="TSAbstractAccessorProperty")&&n.push("accessor "),n.push(r1(s,e,t),ko(s),BH(s),Hs(s,t));let r=i.type==="TSAbstractPropertyDefinition"||i.type==="TSAbstractAccessorProperty";return[o1(s,e,t,n," =",r?void 0:"value"),o]}function vne(s,e,t){let{node:i}=s,n=[];return s.each(({node:o,next:r,isLast:a})=>{n.push(t()),!e.semi&&JH(o)&&bne(o,r)&&n.push(";"),a||(n.push(Se),Yc(o,e)&&n.push(Se))},"body"),Re(i,Ze.Dangling)&&n.push(gn(s,e)),["{",n.length>0?[Le([Se,n]),Se]:"","}"]}function bne(s,e){var t;let{type:i,name:n}=s.key;if(!s.computed&&i==="Identifier"&&(n==="static"||n==="get"||n==="set")&&!s.value&&!s.typeAnnotation)return!0;if(!e||e.static||e.accessibility||e.readonly)return!1;if(!e.computed){let o=(t=e.key)==null?void 0:t.name;if(o==="in"||o==="instanceof")return!0}if(JH(e)&&e.variance&&!e.static&&!e.declare)return!0;switch(e.type){case"ClassProperty":case"PropertyDefinition":case"TSAbstractPropertyDefinition":return e.computed;case"MethodDefinition":case"TSAbstractMethodDefinition":case"ClassMethod":case"ClassPrivateMethod":{if((e.value?e.value.async:e.async)||e.kind==="get"||e.kind==="set")return!1;let o=e.value?e.value.generator:e.generator;return!!(e.computed||o)}case"TSIndexSignature":return!0}return!1}var Cne=wi(["TSAsExpression","TSTypeAssertion","TSNonNullExpression","TSInstantiationExpression","TSSatisfiesExpression"]);function oV(s){return Cne(s)?oV(s.expression):s}var wne=wi(["FunctionExpression","ArrowFunctionExpression"]);function yne(s){return s.type==="MemberExpression"||s.type==="OptionalMemberExpression"||s.type==="Identifier"&&s.name!=="undefined"}function Sne(s,e){if(e.semi||aV(s,e)||lV(s,e))return!1;let{node:t,key:i,parent:n}=s;return!!(t.type==="ExpressionStatement"&&(i==="body"&&(n.type==="Program"||n.type==="BlockStatement"||n.type==="StaticBlock"||n.type==="TSModuleBlock")||i==="consequent"&&n.type==="SwitchCase")&&s.call(()=>rV(s,e),"expression"))}function rV(s,e){let{node:t}=s;switch(t.type){case"ParenthesizedExpression":case"TypeCastExpression":case"ArrayExpression":case"ArrayPattern":case"TemplateLiteral":case"TemplateElement":case"RegExpLiteral":return!0;case"ArrowFunctionExpression":if(!jH(s,e))return!0;break;case"UnaryExpression":{let{prefix:i,operator:n}=t;if(i&&(n==="+"||n==="-"))return!0;break}case"BindExpression":if(!t.object)return!0;break;case"Literal":if(t.regex)return!0;break;default:if(bs(t))return!0}return ip(s,e)?!0:pP(t)?s.call(()=>rV(s,e),...LW(t)):!1}function aV({node:s,parent:e},t){return(t.parentParser==="markdown"||t.parentParser==="mdx")&&s.type==="ExpressionStatement"&&bs(s.expression)&&e.type==="Program"&&e.body.length===1}function lV({node:s,parent:e},t){return(t.parser==="__vue_event_binding"||t.parser==="__vue_ts_event_binding")&&s.type==="ExpressionStatement"&&e.type==="Program"&&e.body.length===1}function Dne(s,e,t){let i=[t("expression")];if(lV(s,e)){let n=oV(s.node.expression);(wne(n)||yne(n))&&i.push(";")}else aV(s,e)||e.semi&&i.push(";");return i}function Lne(s,e,t){if(e.__isVueBindings||e.__isVueForBindingLeft){let i=s.map(t,"program","body",0,"params");if(i.length===1)return i[0];let n=si([",",Ue],i);return e.__isVueForBindingLeft?["(",Le([be,re(n)]),be,")"]:n}if(e.__isEmbeddedTypescriptGenericParameters){let i=s.map(t,"program","body",0,"typeParameters","params");return si([",",Ue],i)}}function xne(s,e){let{node:t}=s;switch(t.type){case"RegExpLiteral":return z5(t);case"BigIntLiteral":return jT(t.extra.raw);case"NumericLiteral":return n_(t.extra.raw);case"StringLiteral":return _f(t_(t.extra.raw,e));case"NullLiteral":return"null";case"BooleanLiteral":return String(t.value);case"DirectiveLiteral":return U5(t.extra.raw,e);case"Literal":{if(t.regex)return z5(t.regex);if(t.bigint)return jT(t.raw);let{value:i}=t;return typeof i=="number"?n_(t.raw):typeof i=="string"?kne(s)?U5(t.raw,e):_f(t_(t.raw,e)):String(i)}}}function kne(s){if(s.key!=="expression")return;let{parent:e}=s;return e.type==="ExpressionStatement"&&e.directive}function jT(s){return s.toLowerCase()}function z5({pattern:s,flags:e}){return e=[...e].sort().join(""),`/${s}/${e}`}function U5(s,e){let t=s.slice(1,-1);if(t.includes('"')||t.includes("'"))return s;let i=e.singleQuote?"'":'"';return i+t+i}function Ene(s,e,t){let i=s.originalText.slice(e,t);for(let n of s[Symbol.for("comments")]){let o=Ln(n);if(o>t)break;let r=oi(n);if(rs.type==="ExportDefaultDeclaration"||s.type==="DeclareExportDeclaration"&&s.default;function uV(s,e,t){let{node:i}=s,n=[oie(s,e,t),or(s),"export",cV(i)?" default":""],{declaration:o,exported:r}=i;return Re(i,Ze.Dangling)&&(n.push(" ",gn(s,e)),AW(i)&&n.push(Se)),o?n.push(" ",t("declaration")):(n.push(Ane(i)),i.type==="ExportAllDeclaration"||i.type==="DeclareExportAllDeclaration"?(n.push(" *"),r&&n.push(" as ",t("exported"))):n.push(fV(s,e,t)),n.push(gV(s,e,t),mV(s,e,t))),n.push(Nne(i,e)),n}var Tne=wi(["ClassDeclaration","ComponentDeclaration","FunctionDeclaration","TSInterfaceDeclaration","DeclareClass","DeclareComponent","DeclareFunction","DeclareHook","HookDeclaration","TSDeclareFunction","EnumDeclaration"]);function Nne(s,e){return e.semi&&(!s.declaration||cV(s)&&!Tne(s.declaration))?";":""}function MP(s,e=!0){return s&&s!=="value"?`${e?" ":""}${s}${e?"":" "}`:""}function hV(s,e){return MP(s.importKind,e)}function Ane(s){return MP(s.exportKind)}function gV(s,e,t){let{node:i}=s;if(!i.source)return"";let n=[];return pV(i,e)&&n.push(" from"),n.push(" ",t("source")),n}function fV(s,e,t){let{node:i}=s;if(!pV(i,e))return"";let n=[" "];if(mi(i.specifiers)){let o=[],r=[];s.each(()=>{let a=s.node.type;if(a==="ExportNamespaceSpecifier"||a==="ExportDefaultSpecifier"||a==="ImportNamespaceSpecifier"||a==="ImportDefaultSpecifier")o.push(t());else if(a==="ExportSpecifier"||a==="ImportSpecifier")r.push(t());else throw new t0(i,"specifier")},"specifiers"),n.push(si(", ",o)),r.length>0&&(o.length>0&&n.push(", "),r.length>1||o.length>0||i.specifiers.some(a=>Re(a))?n.push(re(["{",Le([e.bracketSpacing?Ue:be,si([",",Ue],r)]),Rt(Xc(e)?",":""),e.bracketSpacing?Ue:be,"}"])):n.push(["{",e.bracketSpacing?" ":"",...r,e.bracketSpacing?" ":"","}"]))}else n.push("{}");return n}function pV(s,e){return s.type!=="ImportDeclaration"||mi(s.specifiers)||s.importKind==="type"?!0:dV(e,Ln(s),Ln(s.source)).trimEnd().endsWith("from")}function Mne(s,e){var t,i;if((t=s.extra)!=null&&t.deprecatedAssertSyntax)return"assert";let n=dV(e,oi(s.source),(i=s.attributes)!=null&&i[0]?Ln(s.attributes[0]):oi(s)).trimStart();return n.startsWith("assert")?"assert":n.startsWith("with")||mi(s.attributes)?"with":void 0}function mV(s,e,t){let{node:i}=s;if(!i.source)return"";let n=Mne(i,e);if(!n)return"";let o=[` ${n} {`];return mi(i.attributes)&&(e.bracketSpacing&&o.push(" "),o.push(si(", ",s.map(t,"attributes"))),e.bracketSpacing&&o.push(" ")),o.push("}"),o}function Rne(s,e,t){let{node:i}=s,{type:n}=i,o=n.startsWith("Import"),r=o?"imported":"local",a=o?"local":"exported",l=i[r],d=i[a],c="",u="";return n==="ExportNamespaceSpecifier"||n==="ImportNamespaceSpecifier"?c="*":l&&(c=t(r)),d&&!Pne(i)&&(u=t(a)),[MP(n==="ImportSpecifier"?i.importKind:i.exportKind,!1),c,c&&u?" as ":"",u]}function Pne(s){if(s.type!=="ImportSpecifier"&&s.type!=="ExportSpecifier")return!1;let{local:e,[s.type==="ImportSpecifier"?"imported":"exported"]:t}=s;if(e.type!==t.type||!OQ(e,t))return!1;if(sr(e))return e.value===t.value&&fa(e)===fa(t);switch(e.type){case"Identifier":return e.name===t.name;default:return!1}}function VL(s,e,t){var i;let n=e.semi?";":"",{node:o}=s,r=o.type==="ObjectTypeAnnotation",a=o.type==="TSEnumDeclaration"||o.type==="EnumBooleanBody"||o.type==="EnumNumberBody"||o.type==="EnumBigIntBody"||o.type==="EnumStringBody"||o.type==="EnumSymbolBody",l=[o.type==="TSTypeLiteral"||a?"members":o.type==="TSInterfaceBody"?"body":"properties"];r&&l.push("indexers","callProperties","internalSlots");let d=l.flatMap(D=>s.map(({node:L})=>({node:L,printed:t(),loc:Ln(L)}),D));l.length>1&&d.sort((D,L)=>D.loc-L.loc);let{parent:c,key:u}=s,h=r&&u==="body"&&(c.type==="InterfaceDeclaration"||c.type==="DeclareInterface"||c.type==="DeclareClass"),g=o.type==="TSInterfaceBody"||a||h||o.type==="ObjectPattern"&&c.type!=="FunctionDeclaration"&&c.type!=="FunctionExpression"&&c.type!=="ArrowFunctionExpression"&&c.type!=="ObjectMethod"&&c.type!=="ClassMethod"&&c.type!=="ClassPrivateMethod"&&c.type!=="AssignmentPattern"&&c.type!=="CatchClause"&&o.properties.some(D=>D.value&&(D.value.type==="ObjectPattern"||D.value.type==="ArrayPattern"))||o.type!=="ObjectPattern"&&e.objectWrap==="preserve"&&d.length>0&&wh(e.originalText,Ln(o),d[0].loc),f=h?";":o.type==="TSInterfaceBody"||o.type==="TSTypeLiteral"?Rt(n,";"):",",m=o.type==="RecordExpression"?"#{":o.exact?"{|":"{",_=o.exact?"|}":"}",v=[],b=d.map(D=>{let L=[...v,re(D.printed)];return v=[f,Ue],(D.node.type==="TSPropertySignature"||D.node.type==="TSMethodSignature"||D.node.type==="TSConstructSignatureDeclaration"||D.node.type==="TSCallSignatureDeclaration")&&Re(D.node,Ze.PrettierIgnore)&&v.shift(),Yc(D.node,e)&&v.push(Se),L});if(o.inexact||o.hasUnknownMembers){let D;if(Re(o,Ze.Dangling)){let L=Re(o,Ze.Line);D=[gn(s,e),L||Ar(e.originalText,oi(Si(!1,Dm(o),-1)))?Se:Ue,"..."]}else D=["..."];b.push([...v,...D])}let C=(i=Si(!1,d,-1))==null?void 0:i.node,w=!(o.inexact||o.hasUnknownMembers||C&&(C.type==="RestElement"||(C.type==="TSPropertySignature"||C.type==="TSCallSignatureDeclaration"||C.type==="TSMethodSignature"||C.type==="TSConstructSignatureDeclaration")&&Re(C,Ze.PrettierIgnore))),y;if(b.length===0){if(!Re(o,Ze.Dangling))return[m,_,Hs(s,t)];y=re([m,gn(s,e,{indent:!0}),be,_,ko(s),Hs(s,t)])}else y=[h&&mi(o.properties)?pne(c):"",m,Le([e.bracketSpacing?Ue:be,...b]),Rt(w&&(f!==","||Xc(e))?f:""),e.bracketSpacing?Ue:be,_,ko(s),Hs(s,t)];return s.match(D=>D.type==="ObjectPattern"&&!mi(D.decorators),xE)||_h(o)&&(s.match(void 0,(D,L)=>L==="typeAnnotation",(D,L)=>L==="typeAnnotation",xE)||s.match(void 0,(D,L)=>D.type==="FunctionTypeParam"&&L==="typeAnnotation",xE))||!g&&s.match(D=>D.type==="ObjectPattern",D=>D.type==="AssignmentExpression"||D.type==="VariableDeclarator")?y:re(y,{shouldBreak:g})}function xE(s,e){return(e==="params"||e==="parameters"||e==="this"||e==="rest")&&SH(s)}function Fne(s){let e=[s];for(let t=0;th[I]===i),f=h.type===i.type&&!g,m,_,v=0;do _=m||i,m=s.getParentNode(v),v++;while(m&&m.type===i.type&&a.every(I=>m[I]!==_));let b=m||h,C=_;if(n&&(bs(i[a[0]])||bs(l)||bs(d)||Fne(C))){u=!0,f=!0;let I=R=>[Rt("("),Le([be,R]),be,Rt(")")],O=R=>R.type==="NullLiteral"||R.type==="Literal"&&R.value===null||R.type==="Identifier"&&R.name==="undefined";c.push(" ? ",O(l)?t(o):I(t(o))," : ",d.type===i.type||O(d)?t(r):I(t(r)))}else{let I=R=>e.useTabs?Le(t(R)):gd(2,t(R)),O=[Ue,"? ",l.type===i.type?Rt("","("):"",I(o),l.type===i.type?Rt("",")"):"",Ue,": ",I(r)];c.push(h.type!==i.type||h[r]===i||g?O:e.useTabs?BW(Le(O)):gd(Math.max(0,e.tabWidth-2),O))}let w=[o,r,...a].some(I=>Re(i[I],O=>Ca(O)&&wh(e.originalText,Ln(O),oi(O)))),y=I=>h===b?re(I,{shouldBreak:w}):w?[I,fd]:I,D=!u&&(Rn(h)||h.type==="NGPipeExpression"&&h.left===i)&&!h.computed,L=Wne(s),k=y([One(s,e,t),f?c:Le(c),n&&D&&!L?be:""]);return g||L?re([Le([be,k]),be]):k}function Vne(s,e){return(Rn(e)||e.type==="NGPipeExpression"&&e.left===s)&&!e.computed}function zne(s,e,t,i){return[...s.map(n=>Dm(n)),Dm(e),Dm(t)].flat().some(n=>Ca(n)&&wh(i.originalText,Ln(n),oi(n)))}var Une=new Map([["AssignmentExpression","right"],["VariableDeclarator","init"],["ReturnStatement","argument"],["ThrowStatement","argument"],["UnaryExpression","argument"],["YieldExpression","argument"],["AwaitExpression","argument"]]);function $ne(s){let{node:e}=s;if(e.type!=="ConditionalExpression")return!1;let t,i=e;for(let n=0;!t;n++){let o=s.getParentNode(n);if(o.type==="ChainExpression"&&o.expression===i||ui(o)&&o.callee===i||Rn(o)&&o.object===i||o.type==="TSNonNullExpression"&&o.expression===i){i=o;continue}o.type==="NewExpression"&&o.callee===i||Xl(o)&&o.expression===i?(t=s.getParentNode(n+1),i=o):t=o}return i===e?!1:t[Une.get(t.type)]===i}var kE=s=>[Rt("("),Le([be,s]),be,Rt(")")];function RP(s,e,t,i){if(!e.experimentalTernaries)return Hne(s,e,t);let{node:n}=s,o=n.type==="ConditionalExpression",r=Ch(n),a=o?"consequent":"trueType",l=o?"alternate":"falseType",d=o?["test"]:["checkType","extendsType"],c=n[a],u=n[l],h=d.map(dn=>n[dn]),{parent:g}=s,f=g.type===n.type,m=f&&d.some(dn=>g[dn]===n),_=f&&g[l]===n,v=c.type===n.type,b=u.type===n.type,C=b||_,w=e.tabWidth>2||e.useTabs,y,D,L=0;do D=y||n,y=s.getParentNode(L),L++;while(y&&y.type===n.type&&d.every(dn=>y[dn]!==D));let k=y||g,I=i&&i.assignmentLayout&&i.assignmentLayout!=="break-after-operator"&&(g.type==="AssignmentExpression"||g.type==="VariableDeclarator"||g.type==="ClassProperty"||g.type==="PropertyDefinition"||g.type==="ClassPrivateProperty"||g.type==="ObjectProperty"||g.type==="Property"),O=(g.type==="ReturnStatement"||g.type==="ThrowStatement")&&!(v||b),R=o&&k.type==="JSXExpressionContainer"&&s.grandparent.type!=="JSXAttribute",P=$ne(s),F=Vne(n,g),V=r&&ip(s,e),U=w?e.useTabs?" ":" ".repeat(e.tabWidth-1):"",J=zne(h,c,u,e)||v||b,pe=!C&&!f&&!r&&(R?c.type==="NullLiteral"||c.type==="Literal"&&c.value===null:vP(c,e)&&y5(n.test,3)),De=C||_||r&&!f||f&&o&&y5(n.test,1)||pe,ge=[];!v&&Re(c,Ze.Dangling)&&s.call(dn=>{ge.push(gn(dn,e),Se)},"consequent");let We=[];Re(n.test,Ze.Dangling)&&s.call(dn=>{We.push(gn(dn,e))},"test"),!b&&Re(u,Ze.Dangling)&&s.call(dn=>{We.push(gn(dn,e))},"alternate"),Re(n,Ze.Dangling)&&We.push(gn(s,e));let ye=Symbol("test"),ve=Symbol("consequent"),ce=Symbol("test-and-consequent"),Qt=o?[kE(t("test")),n.test.type==="ConditionalExpression"?fd:""]:[t("checkType")," ","extends"," ",Ch(n.extendsType)||n.extendsType.type==="TSMappedType"?t("extendsType"):re(kE(t("extendsType")))],Ui=re([Qt," ?"],{id:ye}),Gi=t(a),St=Le([v||R&&(bs(c)||f||C)?Se:Ue,ge,Gi]),tn=De?re([Ui,C?St:Rt(St,re(St,{id:ve}),{groupId:ye})],{id:ce}):[Ui,St],Pn=t(l),ln=pe?Rt(Pn,BW(kE(Pn)),{groupId:ce}):Pn,$e=[tn,We.length>0?[Le([Se,We]),Se]:b?Se:pe?Rt(Ue," ",{groupId:ce}):Ue,":",b?" ":w?De?Rt(U,Rt(C||pe?" ":U," "),{groupId:ce}):Rt(U," "):" ",b?ln:re([Le(ln),R&&!pe?be:""]),F&&!P?be:"",J?fd:""];return I&&!J?re(Le([be,re($e)])):I||O?re(Le($e)):P||r&&m?re([Le([be,$e]),V?be:""]):g===k?re($e):$e}function jne(s,e,t,i){let{node:n}=s;if(mP(n))return xne(s,e);let o=e.semi?";":"",r=[];switch(n.type){case"JsExpressionRoot":return t("node");case"JsonRoot":return[t("node"),Se];case"File":return Lne(s,e,t)??t("program");case"EmptyStatement":return"";case"ExpressionStatement":return Dne(s,e,t);case"ChainExpression":return t("expression");case"ParenthesizedExpression":return!Re(n.expression)&&(il(n.expression)||zs(n.expression))?["(",t("expression"),")"]:re(["(",Le([be,t("expression")]),be,")"]);case"AssignmentExpression":return _ie(s,e,t);case"VariableDeclarator":return vie(s,e,t);case"BinaryExpression":case"LogicalExpression":return hH(s,e,t);case"AssignmentPattern":return[t("left")," = ",t("right")];case"OptionalMemberExpression":case"MemberExpression":return fie(s,e,t);case"MetaProperty":return[t("meta"),".",t("property")];case"BindExpression":return n.object&&r.push(t("object")),r.push(re(Le([be,WH(s,e,t)]))),r;case"Identifier":return[n.name,ko(s),BH(s),Hs(s,t)];case"V8IntrinsicIdentifier":return["%",n.name];case"SpreadElement":case"SpreadElementPattern":case"SpreadPropertyPattern":case"RestElement":return HH(s,t);case"FunctionDeclaration":case"FunctionExpression":return $H(s,t,e,i);case"ArrowFunctionExpression":return tne(s,e,t,i);case"YieldExpression":return r.push("yield"),n.delegate&&r.push("*"),n.argument&&r.push(" ",t("argument")),r;case"AwaitExpression":if(r.push("await"),n.argument){r.push(" ",t("argument"));let{parent:a}=s;if(ui(a)&&a.callee===n||Rn(a)&&a.object===n){r=[Le([be,...r]),be];let l=s.findAncestor(d=>d.type==="AwaitExpression"||d.type==="BlockStatement");if((l==null?void 0:l.type)!=="AwaitExpression"||!Co(l.argument,d=>d===n))return re(r)}}return r;case"ExportDefaultDeclaration":case"ExportNamedDeclaration":case"ExportAllDeclaration":return uV(s,e,t);case"ImportDeclaration":return Ine(s,e,t);case"ImportSpecifier":case"ExportSpecifier":case"ImportNamespaceSpecifier":case"ExportNamespaceSpecifier":case"ImportDefaultSpecifier":case"ExportDefaultSpecifier":return Rne(s,e,t);case"ImportAttribute":return SE(s,e,t);case"Program":case"BlockStatement":case"StaticBlock":return ZH(s,e,t);case"ClassBody":return vne(s,e,t);case"ThrowStatement":return Jie(s,e,t);case"ReturnStatement":return Qie(s,e,t);case"NewExpression":case"ImportExpression":case"OptionalCallExpression":case"CallExpression":return bH(s,e,t);case"ObjectExpression":case"ObjectPattern":case"RecordExpression":return VL(s,e,t);case"Property":return PL(n)?UT(s,e,t):SE(s,e,t);case"ObjectProperty":return SE(s,e,t);case"ObjectMethod":return UT(s,e,t);case"Decorator":return["@",t("expression")];case"ArrayExpression":case"ArrayPattern":case"TupleExpression":return TP(s,e,t);case"SequenceExpression":{let{parent:a}=s;if(a.type==="ExpressionStatement"||a.type==="ForStatement"){let l=[];return s.each(({isFirst:d})=>{d?l.push(t()):l.push(",",Le([Ue,t()]))},"expressions"),re(l)}return re(si([",",Ue],s.map(t,"expressions")))}case"ThisExpression":return"this";case"Super":return"super";case"Directive":return[t("value"),o];case"UnaryExpression":return r.push(n.operator),/[a-z]$/u.test(n.operator)&&r.push(" "),Re(n.argument)?r.push(re(["(",Le([be,t("argument")]),be,")"])):r.push(t("argument")),r;case"UpdateExpression":return[n.prefix?n.operator:"",t("argument"),n.prefix?"":n.operator];case"ConditionalExpression":return RP(s,e,t,i);case"VariableDeclaration":{let a=s.map(t,"declarations"),l=s.parent,d=l.type==="ForStatement"||l.type==="ForInStatement"||l.type==="ForOfStatement",c=n.declarations.some(h=>h.init),u;return a.length===1&&!Re(n.declarations[0])?u=a[0]:a.length>0&&(u=Le(a[0])),r=[or(s),n.kind,u?[" ",u]:"",Le(a.slice(1).map(h=>[",",c&&!d?Se:Ue,h]))],d&&l.body!==n||r.push(o),re(r)}case"WithStatement":return re(["with (",t("object"),")",hu(n.body,t("body"))]);case"IfStatement":{let a=hu(n.consequent,t("consequent")),l=re(["if (",re([Le([be,t("test")]),be]),")",a]);if(r.push(l),n.alternate){let d=Re(n.consequent,Ze.Trailing|Ze.Line)||AW(n),c=n.consequent.type==="BlockStatement"&&!d;r.push(c?" ":Se),Re(n,Ze.Dangling)&&r.push(gn(s,e),d?Se:" "),r.push("else",re(hu(n.alternate,t("alternate"),n.alternate.type==="IfStatement")))}return r}case"ForStatement":{let a=hu(n.body,t("body")),l=gn(s,e),d=l?[l,be]:"";return!n.init&&!n.test&&!n.update?[d,re(["for (;;)",a])]:[d,re(["for (",re([Le([be,t("init"),";",Ue,t("test"),";",Ue,t("update")]),be]),")",a])]}case"WhileStatement":return re(["while (",re([Le([be,t("test")]),be]),")",hu(n.body,t("body"))]);case"ForInStatement":return re(["for (",t("left")," in ",t("right"),")",hu(n.body,t("body"))]);case"ForOfStatement":return re(["for",n.await?" await":""," (",t("left")," of ",t("right"),")",hu(n.body,t("body"))]);case"DoWhileStatement":{let a=hu(n.body,t("body"));return r=[re(["do",a])],n.body.type==="BlockStatement"?r.push(" "):r.push(Se),r.push("while (",re([Le([be,t("test")]),be]),")",o),r}case"DoExpression":return[n.async?"async ":"","do ",t("body")];case"BreakStatement":case"ContinueStatement":return r.push(n.type==="BreakStatement"?"break":"continue"),n.label&&r.push(" ",t("label")),r.push(o),r;case"LabeledStatement":return n.body.type==="EmptyStatement"?[t("label"),":;"]:[t("label"),": ",t("body")];case"TryStatement":return["try ",t("block"),n.handler?[" ",t("handler")]:"",n.finalizer?[" finally ",t("finalizer")]:""];case"CatchClause":if(n.param){let a=Re(n.param,d=>!Ca(d)||d.leading&&Ar(e.originalText,oi(d))||d.trailing&&Ar(e.originalText,Ln(d),{backwards:!0})),l=t("param");return["catch ",a?["(",Le([be,l]),be,") "]:["(",l,") "],t("body")]}return["catch ",t("body")];case"SwitchStatement":return[re(["switch (",Le([be,t("discriminant")]),be,")"])," {",n.cases.length>0?Le([Se,si(Se,s.map(({node:a,isLast:l})=>[t(),!l&&Yc(a,e)?Se:""],"cases"))]):"",Se,"}"];case"SwitchCase":{n.test?r.push("case ",t("test"),":"):r.push("default:"),Re(n,Ze.Dangling)&&r.push(" ",gn(s,e));let a=n.consequent.filter(l=>l.type!=="EmptyStatement");if(a.length>0){let l=$T(s,e,t,"consequent");r.push(a.length===1&&a[0].type==="BlockStatement"?[" ",l]:Le([Se,l]))}return r}case"DebuggerStatement":return["debugger",o];case"ClassDeclaration":case"ClassExpression":return eV(s,e,t);case"ClassMethod":case"ClassPrivateMethod":case"MethodDefinition":return nV(s,e,t);case"ClassProperty":case"PropertyDefinition":case"ClassPrivateProperty":case"ClassAccessorProperty":case"AccessorProperty":return sV(s,e,t);case"TemplateElement":return _f(n.value.raw);case"TemplateLiteral":return iH(s,t,e);case"TaggedTemplateExpression":return kee(s,t);case"PrivateIdentifier":return["#",n.name];case"PrivateName":return["#",t("id")];case"TopicReference":return"%";case"ArgumentPlaceholder":return"?";case"ModuleExpression":return["module ",t("body")];case"InterpreterDirective":default:throw new t0(n,"ESTree")}}function _V(s,e,t){let{parent:i,node:n,key:o}=s,r=[t("expression")];switch(n.type){case"AsConstExpression":r.push(" as const");break;case"AsExpression":case"TSAsExpression":r.push(" as ",t("typeAnnotation"));break;case"SatisfiesExpression":case"TSSatisfiesExpression":r.push(" satisfies ",t("typeAnnotation"));break}return o==="callee"&&ui(i)||o==="object"&&Rn(i)?re([Le([be,...r]),be]):r}function Kne(s,e,t){let{node:i}=s,n=[or(s),"component"];i.id&&n.push(" ",t("id")),n.push(t("typeParameters"));let o=qne(s,t,e);return i.rendersType?n.push(re([o," ",t("rendersType")])):n.push(re([o])),i.body&&n.push(" ",t("body")),e.semi&&i.type==="DeclareComponent"&&n.push(";"),n}function qne(s,e,t){let{node:i}=s,n=i.params;if(i.rest&&(n=[...n,i.rest]),n.length===0)return["(",gn(s,t,{filter:r=>nl(t.originalText,oi(r))===")"}),")"];let o=[];return Zne(s,(r,a)=>{let l=a===n.length-1;l&&i.rest&&o.push("..."),o.push(e()),!l&&(o.push(","),Yc(n[a],t)?o.push(Se,Se):o.push(Ue))}),["(",Le([be,...o]),Rt(Xc(t,"all")&&!Gne(i,n)?",":""),be,")"]}function Gne(s,e){var t;return s.rest||((t=Si(!1,e,-1))==null?void 0:t.type)==="RestElement"}function Zne(s,e){let{node:t}=s,i=0,n=o=>e(o,i++);s.each(n,"params"),t.rest&&s.call(n,"rest")}function Xne(s,e,t){let{node:i}=s;return i.shorthand?t("local"):[t("name")," as ",t("local")]}function Yne(s,e,t){let{node:i}=s,n=[];return i.name&&n.push(t("name"),i.optional?"?: ":": "),n.push(t("typeAnnotation")),n}function vV(s,e,t){return VL(s,t,e)}function bV(s,e){let{node:t}=s,i=e("id");t.computed&&(i=["[",i,"]"]);let n="";return t.initializer&&(n=e("initializer")),t.init&&(n=e("init")),n?[i," = ",n]:i}function Qne(s,e,t){let{node:i}=s,n;if(i.type==="EnumSymbolBody"||i.explicitType)switch(i.type){case"EnumBooleanBody":n="boolean";break;case"EnumNumberBody":n="number";break;case"EnumBigIntBody":n="bigint";break;case"EnumStringBody":n="string";break;case"EnumSymbolBody":n="symbol";break}return[n?`of ${n} `:"",vV(s,e,t)]}function CV(s,e,t){let{node:i}=s;return[or(s),i.const?"const ":"","enum ",e("id")," ",i.type==="TSEnumDeclaration"?vV(s,e,t):e("body")]}function Jne(s,e,t){let{node:i}=s,n=["hook"];i.id&&n.push(" ",t("id"));let o=np(s,t,e,!1,!0),r=HL(s,t),a=i0(i,r);return n.push(re([a?re(o):o,r]),i.body?" ":"",t("body")),n}function ese(s,e,t){let{node:i}=s,n=[or(s),"hook"];return i.id&&n.push(" ",t("id")),e.semi&&n.push(";"),n}function $5(s){var e;let{node:t}=s;return t.type==="HookTypeAnnotation"&&((e=s.getParentNode(2))==null?void 0:e.type)==="DeclareHook"}function tse(s,e,t){let{node:i}=s,n=[];n.push($5(s)?"":"hook ");let o=np(s,t,e,!1,!0),r=[];return r.push($5(s)?": ":" => ",t("returnType")),i0(i,r)&&(o=re(o)),n.push(o,r),re(n)}function wV(s,e,t){let{node:i}=s,n=[or(s),"interface"],o=[],r=[];i.type!=="InterfaceTypeAnnotation"&&o.push(" ",t("id"),t("typeParameters"));let a=i.typeParameters&&!Re(i.typeParameters,Ze.Trailing|Ze.Line);return mi(i.extends)&&r.push(a?Rt(" ",Ue,{groupId:AP(i.typeParameters)}):Ue,"extends ",(i.extends.length===1?dJ:Le)(si([",",Ue],s.map(t,"extends")))),Re(i.id,Ze.Trailing)||mi(i.extends)?a?n.push(re([...o,Le(r)])):n.push(re(Le([...o,...r]))):n.push(...o,...r),n.push(" ",t("body")),re(n)}function ise(s,e,t){let{node:i}=s;if(SW(i))return i.type.slice(0,-14).toLowerCase();let n=e.semi?";":"";switch(i.type){case"ComponentDeclaration":case"DeclareComponent":case"ComponentTypeAnnotation":return Kne(s,e,t);case"ComponentParameter":return Xne(s,e,t);case"ComponentTypeParameter":return Yne(s,e,t);case"HookDeclaration":return Jne(s,e,t);case"DeclareHook":return ese(s,e,t);case"HookTypeAnnotation":return tse(s,e,t);case"DeclareClass":return eV(s,e,t);case"DeclareFunction":return[or(s),"function ",t("id"),t("predicate"),n];case"DeclareModule":return["declare module ",t("id")," ",t("body")];case"DeclareModuleExports":return["declare module.exports",Hs(s,t),n];case"DeclareNamespace":return["declare namespace ",t("id")," ",t("body")];case"DeclareVariable":return[or(s),i.kind??"var"," ",t("id"),n];case"DeclareExportDeclaration":case"DeclareExportAllDeclaration":return uV(s,e,t);case"DeclareOpaqueType":case"OpaqueType":return Oie(s,e,t);case"DeclareTypeAlias":case"TypeAlias":return LH(s,e,t);case"IntersectionTypeAnnotation":return xH(s,e,t);case"UnionTypeAnnotation":return kH(s,e,t);case"ConditionalTypeAnnotation":return RP(s,e,t);case"InferTypeAnnotation":return TH(s,e,t);case"FunctionTypeAnnotation":return EH(s,e,t);case"TupleTypeAnnotation":return TP(s,e,t);case"TupleTypeLabeledElement":return AH(s,e,t);case"TupleTypeSpreadElement":return NH(s,e,t);case"GenericTypeAnnotation":return[t("id"),Wv(s,e,t,"typeParameters")];case"IndexedAccessType":case"OptionalIndexedAccessType":return IH(s,e,t);case"TypeAnnotation":return RH(s,e,t);case"TypeParameter":return QH(s,e,t);case"TypeofTypeAnnotation":return FH(s,t);case"ExistsTypeAnnotation":return"*";case"ArrayTypeAnnotation":return PH(t);case"DeclareEnum":case"EnumDeclaration":return CV(s,t,e);case"EnumBooleanBody":case"EnumNumberBody":case"EnumBigIntBody":case"EnumStringBody":case"EnumSymbolBody":return Qne(s,t,e);case"EnumBooleanMember":case"EnumNumberMember":case"EnumBigIntMember":case"EnumStringMember":case"EnumDefaultedMember":return bV(s,t);case"FunctionTypeParam":{let o=i.name?t("name"):s.parent.this===i?"this":"";return[o,ko(s),o?": ":"",t("typeAnnotation")]}case"DeclareInterface":case"InterfaceDeclaration":case"InterfaceTypeAnnotation":return wV(s,e,t);case"ClassImplements":case"InterfaceExtends":return[t("id"),t("typeParameters")];case"NullableTypeAnnotation":return["?",t("typeAnnotation")];case"Variance":{let{kind:o}=i;return fP.ok(o==="plus"||o==="minus"),o==="plus"?"+":"-"}case"KeyofTypeAnnotation":return["keyof ",t("argument")];case"ObjectTypeCallProperty":return[i.static?"static ":"",t("value")];case"ObjectTypeMappedTypeProperty":return une(s,e,t);case"ObjectTypeIndexer":return[i.static?"static ":"",i.variance?t("variance"):"","[",t("id"),i.id?": ":"",t("key"),"]: ",t("value")];case"ObjectTypeProperty":{let o="";return i.proto?o="proto ":i.static&&(o="static "),[o,i.kind!=="init"?i.kind+" ":"",i.variance?t("variance"):"",r1(s,e,t),ko(s),PL(i)?"":": ",t("value")]}case"ObjectTypeAnnotation":return VL(s,e,t);case"ObjectTypeInternalSlot":return[i.static?"static ":"","[[",t("id"),"]]",ko(s),i.method?"":": ",t("value")];case"ObjectTypeSpreadProperty":return HH(s,t);case"QualifiedTypeofIdentifier":case"QualifiedTypeIdentifier":return[t("qualification"),".",t("id")];case"NullLiteralTypeAnnotation":return"null";case"BooleanLiteralTypeAnnotation":return String(i.value);case"StringLiteralTypeAnnotation":return _f(t_(fa(i),e));case"NumberLiteralTypeAnnotation":return n_(i.raw??i.extra.raw);case"BigIntLiteralTypeAnnotation":return jT(i.raw??i.extra.raw);case"TypeCastExpression":return["(",t("expression"),Hs(s,t),")"];case"TypePredicate":return OH(s,t);case"TypeOperator":return[i.operator," ",t("typeAnnotation")];case"TypeParameterDeclaration":case"TypeParameterInstantiation":return Wv(s,e,t,"params");case"InferredPredicate":case"DeclaredPredicate":return[s.key==="predicate"&&s.parent.type!=="DeclareFunction"&&!s.parent.returnType?": ":" ","%checks",...i.type==="DeclaredPredicate"?["(",t("value"),")"]:[]];case"AsExpression":case"AsConstExpression":case"SatisfiesExpression":return _V(s,e,t)}}function nse(s,e,t){var i;let{node:n}=s;if(!n.type.startsWith("TS"))return;if(DW(n))return n.type.slice(2,-7).toLowerCase();let o=e.semi?";":"",r=[];switch(n.type){case"TSThisType":return"this";case"TSTypeAssertion":{let a=!(zs(n.expression)||il(n.expression)),l=re(["<",Le([be,t("typeAnnotation")]),be,">"]),d=[Rt("("),Le([be,t("expression")]),be,Rt(")")];return a?qg([[l,t("expression")],[l,re(d,{shouldBreak:!0})],[l,t("expression")]]):re([l,t("expression")])}case"TSDeclareFunction":return $H(s,t,e);case"TSExportAssignment":return["export = ",t("expression"),o];case"TSModuleBlock":return ZH(s,e,t);case"TSInterfaceBody":case"TSTypeLiteral":return VL(s,e,t);case"TSTypeAliasDeclaration":return LH(s,e,t);case"TSQualifiedName":return[t("left"),".",t("right")];case"TSAbstractMethodDefinition":case"TSDeclareMethod":return nV(s,e,t);case"TSAbstractAccessorProperty":case"TSAbstractPropertyDefinition":return sV(s,e,t);case"TSInterfaceHeritage":case"TSClassImplements":case"TSExpressionWithTypeArguments":case"TSInstantiationExpression":return[t("expression"),t(n.typeArguments?"typeArguments":"typeParameters")];case"TSTemplateLiteralType":return iH(s,t,e);case"TSNamedTupleMember":return AH(s,e,t);case"TSRestType":return NH(s,e,t);case"TSOptionalType":return[t("typeAnnotation"),"?"];case"TSInterfaceDeclaration":return wV(s,e,t);case"TSTypeParameterDeclaration":case"TSTypeParameterInstantiation":return Wv(s,e,t,"params");case"TSTypeParameter":return QH(s,e,t);case"TSAsExpression":case"TSSatisfiesExpression":return _V(s,e,t);case"TSArrayType":return PH(t);case"TSPropertySignature":return[n.readonly?"readonly ":"",r1(s,e,t),ko(s),Hs(s,t)];case"TSParameterProperty":return[LS(n),n.static?"static ":"",n.override?"override ":"",n.readonly?"readonly ":"",t("parameter")];case"TSTypeQuery":return FH(s,t);case"TSIndexSignature":{let a=n.parameters.length>1?Rt(Xc(e)?",":""):"",l=re([Le([be,si([", ",be],s.map(t,"parameters"))]),a,be]),d=s.parent.type==="ClassBody"&&s.key==="body";return[d&&n.static?"static ":"",n.readonly?"readonly ":"","[",n.parameters?l:"","]",Hs(s,t),d?o:""]}case"TSTypePredicate":return OH(s,t);case"TSNonNullExpression":return[t("expression"),"!"];case"TSImportType":return["import(",t("argument"),")",n.qualifier?[".",t("qualifier")]:"",Wv(s,e,t,n.typeArguments?"typeArguments":"typeParameters")];case"TSLiteralType":return t("literal");case"TSIndexedAccessType":return IH(s,e,t);case"TSTypeOperator":return[n.operator," ",t("typeAnnotation")];case"TSMappedType":return hne(s,e,t);case"TSMethodSignature":{let a=n.kind&&n.kind!=="method"?`${n.kind} `:"";r.push(LS(n),a,n.computed?"[":"",t("key"),n.computed?"]":"",ko(s));let l=np(s,t,e,!1,!0),d=n.returnType?"returnType":"typeAnnotation",c=n[d],u=c?Hs(s,t,d):"",h=i0(n,u);return r.push(h?re(l):l),c&&r.push(re(u)),re(r)}case"TSNamespaceExportDeclaration":return["export as namespace ",t("id"),e.semi?";":""];case"TSEnumDeclaration":return CV(s,t,e);case"TSEnumMember":return bV(s,t);case"TSImportEqualsDeclaration":return[n.isExport?"export ":"","import ",hV(n,!1),t("id")," = ",t("moduleReference"),e.semi?";":""];case"TSExternalModuleReference":return["require(",t("expression"),")"];case"TSModuleDeclaration":{let{parent:a}=s,l=a.type==="TSModuleDeclaration",d=((i=n.body)==null?void 0:i.type)==="TSModuleDeclaration";return l?r.push("."):(r.push(or(s)),n.kind!=="global"&&r.push(n.kind," ")),r.push(t("id")),d?r.push(t("body")):n.body?r.push(" ",re(t("body"))):r.push(o),r}case"TSConditionalType":return RP(s,e,t);case"TSInferType":return TH(s,e,t);case"TSIntersectionType":return xH(s,e,t);case"TSUnionType":return kH(s,e,t);case"TSFunctionType":case"TSCallSignatureDeclaration":case"TSConstructorType":case"TSConstructSignatureDeclaration":return EH(s,e,t);case"TSTupleType":return TP(s,e,t);case"TSTypeReference":return[t("typeName"),Wv(s,e,t,n.typeArguments?"typeArguments":"typeParameters")];case"TSTypeAnnotation":return RH(s,e,t);case"TSEmptyBodyFunctionExpression":return NP(s,e,t);case"TSJSDocAllType":return"*";case"TSJSDocUnknownType":return"?";case"TSJSDocNullableType":return H5(s,t,"?");case"TSJSDocNonNullableType":return H5(s,t,"!");case"TSParenthesizedType":default:throw new t0(n,"TypeScript")}}function sse(s,e,t,i){if(uH(s))return bte(s,e);for(let n of[iie,Zte,ise,nse,jne]){let o=n(s,e,t,i);if(o!==void 0)return o}}var ose=wi(["ClassMethod","ClassPrivateMethod","ClassProperty","ClassAccessorProperty","AccessorProperty","TSAbstractAccessorProperty","PropertyDefinition","TSAbstractPropertyDefinition","ClassPrivateProperty","MethodDefinition","TSAbstractMethodDefinition","TSDeclareMethod"]);function rse(s,e,t,i){var n;s.isRoot&&((n=e.__onHtmlBindingRoot)==null||n.call(e,s.node,e));let o=sse(s,e,t,i);if(!o)return"";let{node:r}=s;if(ose(r))return o;let a=mi(r.decorators),l=rie(s,e,t),d=r.type==="ClassExpression";if(a&&!d)return MT(o,h=>re([l,h]));let c=ip(s,e),u=Sne(s,e);return!l&&!c&&!u?o:MT(o,h=>[u?";":"",c?"(":"",c&&d&&a?[Le([Ue,l,h]),Ue]:[l,h],c?")":""])}var ase=rse,lse={avoidAstMutation:!0},dse=[{linguistLanguageId:174,name:"JSON.stringify",type:"data",color:"#292929",tmScope:"source.json",aceMode:"json",codemirrorMode:"javascript",codemirrorMimeType:"application/json",aliases:["geojson","jsonl","topojson"],extensions:[".importmap"],filenames:["package.json","package-lock.json","composer.json"],parsers:["json-stringify"],vscodeLanguageIds:["json"]},{linguistLanguageId:174,name:"JSON",type:"data",color:"#292929",tmScope:"source.json",aceMode:"json",codemirrorMode:"javascript",codemirrorMimeType:"application/json",aliases:["geojson","jsonl","topojson"],extensions:[".json",".4DForm",".4DProject",".avsc",".geojson",".gltf",".har",".ice",".JSON-tmLanguage",".mcmeta",".tfstate",".tfstate.backup",".topojson",".webapp",".webmanifest",".yy",".yyp"],filenames:[".all-contributorsrc",".arcconfig",".auto-changelog",".c8rc",".htmlhintrc",".imgbotconfig",".nycrc",".tern-config",".tern-project",".watchmanconfig","Pipfile.lock","composer.lock","flake.lock","mcmod.info",".babelrc",".jscsrc",".jshintrc",".jslintrc",".swcrc"],parsers:["json"],vscodeLanguageIds:["json"]},{linguistLanguageId:423,name:"JSON with Comments",type:"data",color:"#292929",group:"JSON",tmScope:"source.js",aceMode:"javascript",codemirrorMode:"javascript",codemirrorMimeType:"text/javascript",aliases:["jsonc"],extensions:[".jsonc",".code-snippets",".code-workspace",".sublime-build",".sublime-commands",".sublime-completions",".sublime-keymap",".sublime-macro",".sublime-menu",".sublime-mousemap",".sublime-project",".sublime-settings",".sublime-theme",".sublime-workspace",".sublime_metrics",".sublime_session"],filenames:[],parsers:["jsonc"],vscodeLanguageIds:["jsonc"]},{linguistLanguageId:175,name:"JSON5",type:"data",color:"#267CB9",extensions:[".json5"],tmScope:"source.js",aceMode:"javascript",codemirrorMode:"javascript",codemirrorMimeType:"application/json",parsers:["json5"],vscodeLanguageIds:["json5"]}],yV={};ML(yV,{getVisitorKeys:()=>gse,massageAstNode:()=>SV,print:()=>fse});var cse={JsonRoot:["node"],ArrayExpression:["elements"],ObjectExpression:["properties"],ObjectProperty:["key","value"],UnaryExpression:["argument"],NullLiteral:[],BooleanLiteral:[],StringLiteral:[],NumericLiteral:[],Identifier:[],TemplateLiteral:["quasis"],TemplateElement:[]},use=cse,hse=wW(use),gse=hse;function fse(s,e,t){let{node:i}=s;switch(i.type){case"JsonRoot":return[t("node"),Se];case"ArrayExpression":{if(i.elements.length===0)return"[]";let n=s.map(()=>s.node===null?"null":t(),"elements");return["[",Le([Se,si([",",Se],n)]),Se,"]"]}case"ObjectExpression":return i.properties.length===0?"{}":["{",Le([Se,si([",",Se],s.map(t,"properties"))]),Se,"}"];case"ObjectProperty":return[t("key"),": ",t("value")];case"UnaryExpression":return[i.operator==="+"?"":i.operator,t("argument")];case"NullLiteral":return"null";case"BooleanLiteral":return i.value?"true":"false";case"StringLiteral":return JSON.stringify(i.value);case"NumericLiteral":return j5(s)?JSON.stringify(String(i.value)):JSON.stringify(i.value);case"Identifier":return j5(s)?JSON.stringify(i.name):i.name;case"TemplateLiteral":return t(["quasis",0]);case"TemplateElement":return JSON.stringify(i.value.cooked);default:throw new t0(i,"JSON")}}function j5(s){return s.key==="key"&&s.parent.type==="ObjectProperty"}var pse=new Set(["start","end","extra","loc","comments","leadingComments","trailingComments","innerComments","errors","range","tokens"]);function SV(s,e){let{type:t}=s;if(t==="ObjectProperty"){let{key:i}=s;i.type==="Identifier"?e.key={type:"StringLiteral",value:i.name}:i.type==="NumericLiteral"&&(e.key={type:"StringLiteral",value:String(i.value)});return}if(t==="UnaryExpression"&&s.operator==="+")return e.argument;if(t==="ArrayExpression"){for(let[i,n]of s.elements.entries())n===null&&e.elements.splice(i,0,{type:"NullLiteral"});return}if(t==="TemplateLiteral")return{type:"StringLiteral",value:s.quasis[0].value.cooked}}SV.ignoredProperties=pse;var A0={bracketSpacing:{category:"Common",type:"boolean",default:!0,description:"Print spaces between brackets.",oppositeDescription:"Do not print spaces between brackets."},objectWrap:{category:"Common",type:"choice",default:"preserve",description:"How to wrap object literals.",choices:[{value:"preserve",description:"Keep as multi-line, if there is a newline between the opening brace and first property."},{value:"collapse",description:"Fit to a single line when possible."}]},singleQuote:{category:"Common",type:"boolean",default:!1,description:"Use single quotes instead of double quotes."},bracketSameLine:{category:"Common",type:"boolean",default:!1,description:"Put > of opening tags on the last line instead of on a new line."},singleAttributePerLine:{category:"Common",type:"boolean",default:!1,description:"Enforce single attribute per line in HTML, Vue and JSX."}},gu="JavaScript",mse={arrowParens:{category:gu,type:"choice",default:"always",description:"Include parentheses around a sole arrow function parameter.",choices:[{value:"always",description:"Always include parens. Example: `(x) => x`"},{value:"avoid",description:"Omit parens when possible. Example: `x => x`"}]},bracketSameLine:A0.bracketSameLine,objectWrap:A0.objectWrap,bracketSpacing:A0.bracketSpacing,jsxBracketSameLine:{category:gu,type:"boolean",description:"Put > on the last line instead of at a new line.",deprecated:"2.4.0"},semi:{category:gu,type:"boolean",default:!0,description:"Print semicolons.",oppositeDescription:"Do not print semicolons, except at the beginning of lines which may need them."},experimentalOperatorPosition:{category:gu,type:"choice",default:"end",description:"Where to print operators when binary expressions wrap lines.",choices:[{value:"start",description:"Print operators at the start of new lines."},{value:"end",description:"Print operators at the end of previous lines."}]},experimentalTernaries:{category:gu,type:"boolean",default:!1,description:"Use curious ternaries, with the question mark after the condition.",oppositeDescription:"Default behavior of ternaries; keep question marks on the same line as the consequent."},singleQuote:A0.singleQuote,jsxSingleQuote:{category:gu,type:"boolean",default:!1,description:"Use single quotes in JSX."},quoteProps:{category:gu,type:"choice",default:"as-needed",description:"Change when properties in objects are quoted.",choices:[{value:"as-needed",description:"Only add quotes around object properties where required."},{value:"consistent",description:"If at least one property in an object requires quotes, quote all properties."},{value:"preserve",description:"Respect the input use of quotes in object properties."}]},trailingComma:{category:gu,type:"choice",default:"all",description:"Print trailing commas wherever possible when multi-line.",choices:[{value:"all",description:"Trailing commas wherever possible (including function arguments)."},{value:"es5",description:"Trailing commas where valid in ES5 (objects, arrays, etc.)"},{value:"none",description:"No trailing commas."}]},singleAttributePerLine:A0.singleAttributePerLine},_se=mse,vse={estree:vW,"estree-json":yV},bse=[...cQ,...dse],Cse=_W;function mr(s,e=0){return s[s.length-(1+e)]}function wse(s){if(s.length===0)throw new Error("Invalid tail call");return[s.slice(0,s.length-1),s[s.length-1]]}function Ci(s,e,t=(i,n)=>i===n){if(s===e)return!0;if(!s||!e||s.length!==e.length)return!1;for(let i=0,n=s.length;it(s[i],e))}function Sse(s,e){let t=0,i=s-1;for(;t<=i;){const n=(t+i)/2|0,o=e(n);if(o<0)t=n+1;else if(o>0)i=n-1;else return n}return-(t+1)}function KT(s,e,t){if(s=s|0,s>=e.length)throw new TypeError("invalid index");const i=e[Math.floor(e.length*Math.random())],n=[],o=[],r=[];for(const a of e){const l=t(a,i);l<0?n.push(a):l>0?o.push(a):r.push(a)}return s!!e)}function q5(s){let e=0;for(let t=0;t0}function Wc(s,e=t=>t){const t=new Set;return s.filter(i=>{const n=e(i);return t.has(n)?!1:(t.add(n),!0)})}function FP(s,e){return s.length>0?s[0]:e}function to(s,e){let t=typeof e=="number"?s:0;typeof e=="number"?t=s:(t=0,e=s);const i=[];if(t<=e)for(let n=t;ne;n--)i.push(n);return i}function zL(s,e,t){const i=s.slice(0,e),n=s.slice(e);return i.concat(t,n)}function EE(s,e){const t=s.indexOf(e);t>-1&&(s.splice(t,1),s.unshift(e))}function aw(s,e){const t=s.indexOf(e);t>-1&&(s.splice(t,1),s.push(e))}function qT(s,e){for(const t of e)s.push(t)}function OP(s){return Array.isArray(s)?s:[s]}function Lse(s,e,t){const i=xV(s,e),n=s.length,o=t.length;s.length=n+o;for(let r=n-1;r>=i;r--)s[r+o]=s[r];for(let r=0;r0}s.isGreaterThan=i;function n(o){return o===0}s.isNeitherLessOrGreaterThan=n,s.greaterThan=1,s.lessThan=-1,s.neitherLessOrGreaterThan=0})(kb||(kb={}));function ao(s,e){return(t,i)=>e(s(t),s(i))}function xse(...s){return(e,t)=>{for(const i of s){const n=i(e,t);if(!kb.isNeitherLessOrGreaterThan(n))return n}return kb.neitherLessOrGreaterThan}}const ua=(s,e)=>s-e,kse=(s,e)=>ua(s?1:0,e?1:0);function kV(s){return(e,t)=>-s(e,t)}class Hc{constructor(e){this.items=e,this.firstIdx=0,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{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||kb.isGreaterThan(e(n,t)))&&(i=!1,t=n),!0)),t}}od.empty=new od(s=>{});class xS{constructor(e){this._indexMap=e}static createSortPermutation(e,t){const i=Array.from(e.keys()).sort((n,o)=>t(e[n],e[o]));return new xS(i)}apply(e){return e.map((t,i)=>e[this._indexMap[i]])}inverse(){const e=this._indexMap.slice();for(let t=0;t"u"}function rd(s){return!Go(s)}function Go(s){return oo(s)||s===null}function yt(s,e){if(!s)throw new Error(e?`Unexpected type, expected '${e}'`:"Unexpected type")}function Ou(s){if(Go(s))throw new Error("Assertion Failed: argument is undefined or null");return s}function kS(s){return typeof s=="function"}function Ise(s,e){const t=Math.min(s.length,e.length);for(let i=0;i{e[t]=i&&typeof i=="object"?Jd(i):i}),e}function Nse(s){if(!s||typeof s!="object")return s;const e=[s];for(;e.length>0;){const t=e.shift();Object.freeze(t);for(const i in t)if(IV.call(t,i)){const n=t[i];typeof n=="object"&&!Object.isFrozen(n)&&!Ese(n)&&e.push(n)}}return s}const IV=Object.prototype.hasOwnProperty;function TV(s,e){return GT(s,e,new Set)}function GT(s,e,t){if(Go(s))return s;const i=e(s);if(typeof i<"u")return i;if(Array.isArray(s)){const n=[];for(const o of s)n.push(GT(o,e,t));return n}if(Ms(s)){if(t.has(s))throw new Error("Cannot clone recursive data-structure");t.add(s);const n={};for(const o in s)IV.call(s,o)&&(n[o]=GT(s[o],e,t));return t.delete(s),n}return s}function UL(s,e,t=!0){return Ms(s)?(Ms(e)&&Object.keys(e).forEach(i=>{i in s?t&&(Ms(s[i])&&Ms(e[i])?UL(s[i],e[i],t):s[i]=e[i]):s[i]=e[i]}),s):e}function tr(s,e){if(s===e)return!0;if(s==null||e===null||e===void 0||typeof s!=typeof e||typeof s!="object"||Array.isArray(s)!==Array.isArray(e))return!1;let t,i;if(Array.isArray(s)){if(s.length!==e.length)return!1;for(t=0;tfunction(){const o=Array.prototype.slice.call(arguments,0);return e(n,o)},i={};for(const n of s)i[n]=t(n);return i}let Rse=typeof document<"u"&&document.location&&document.location.hash.indexOf("pseudo=true")>=0;function NV(s,e){let t;return e.length===0?t=s:t=s.replace(/\{(\d+)\}/g,(i,n)=>{const o=n[0],r=e[o];let a=i;return typeof r=="string"?a=r:(typeof r=="number"||typeof r=="boolean"||r===void 0||r===null)&&(a=String(r)),a}),Rse&&(t="["+t.replace(/[aouei]/g,"$&$&")+"]"),t}function p(s,e,...t){return NV(e,t)}function Ve(s,e,...t){const i=NV(e,t);return{value:i,original:i}}var IE,TE;const Qp="en";let ES=!1,IS=!1,Ry=!1,AV=!1,WP=!1,HP=!1,MV=!1,lw,Py=Qp,X5=Qp,Pse,Ta;const xc=globalThis;let Ls;typeof xc.vscode<"u"&&typeof xc.vscode.process<"u"?Ls=xc.vscode.process:typeof process<"u"&&typeof((IE=process==null?void 0:process.versions)===null||IE===void 0?void 0:IE.node)=="string"&&(Ls=process);const Fse=typeof((TE=Ls==null?void 0:Ls.versions)===null||TE===void 0?void 0:TE.electron)=="string",Ose=Fse&&(Ls==null?void 0:Ls.type)==="renderer";if(typeof Ls=="object"){ES=Ls.platform==="win32",IS=Ls.platform==="darwin",Ry=Ls.platform==="linux",Ry&&Ls.env.SNAP&&Ls.env.SNAP_REVISION,Ls.env.CI||Ls.env.BUILD_ARTIFACTSTAGINGDIRECTORY,lw=Qp,Py=Qp;const s=Ls.env.VSCODE_NLS_CONFIG;if(s)try{const e=JSON.parse(s),t=e.availableLanguages["*"];lw=e.locale,X5=e.osLocale,Py=t||Qp,Pse=e._translationsConfigFile}catch{}AV=!0}else typeof navigator=="object"&&!Ose?(Ta=navigator.userAgent,ES=Ta.indexOf("Windows")>=0,IS=Ta.indexOf("Macintosh")>=0,HP=(Ta.indexOf("Macintosh")>=0||Ta.indexOf("iPad")>=0||Ta.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,Ry=Ta.indexOf("Linux")>=0,MV=(Ta==null?void 0:Ta.indexOf("Mobi"))>=0,WP=!0,p({},"_"),lw=Qp,Py=lw,X5=navigator.language):console.error("Unable to resolve platform.");const as=ES,lt=IS,$s=Ry,md=AV,Jh=WP,Bse=WP&&typeof xc.importScripts=="function",Wse=Bse?xc.origin:void 0,_d=HP,RV=MV,vd=Ta,Hse=Py,Vse=typeof xc.postMessage=="function"&&!xc.importScripts,PV=(()=>{if(Vse){const s=[];xc.addEventListener("message",t=>{if(t.data&&t.data.vscodeScheduleAsyncWork)for(let i=0,n=s.length;i{const i=++e;s.push({id:i,callback:t}),xc.postMessage({vscodeScheduleAsyncWork:i},"*")}}return s=>setTimeout(s)})(),Lo=IS||HP?2:ES?1:3;let Y5=!0,Q5=!1;function FV(){if(!Q5){Q5=!0;const s=new Uint8Array(2);s[0]=1,s[1]=2,Y5=new Uint16Array(s.buffer)[0]===513}return Y5}const OV=!!(vd&&vd.indexOf("Chrome")>=0),zse=!!(vd&&vd.indexOf("Firefox")>=0),Use=!!(!OV&&vd&&vd.indexOf("Safari")>=0),$se=!!(vd&&vd.indexOf("Edg/")>=0),jse=!!(vd&&vd.indexOf("Android")>=0),ns={tabSize:4,indentSize:4,insertSpaces:!0,detectIndentation:!0,trimAutoWhitespace:!0,largeFileOptimizations:!0,bracketPairColorizationOptions:{enabled:!0,independentColorPoolPerBracketType:!1}};var ft;(function(s){function e(C){return C&&typeof C=="object"&&typeof C[Symbol.iterator]=="function"}s.is=e;const t=Object.freeze([]);function i(){return t}s.empty=i;function*n(C){yield C}s.single=n;function o(C){return e(C)?C:n(C)}s.wrap=o;function r(C){return C||t}s.from=r;function*a(C){for(let w=C.length-1;w>=0;w--)yield C[w]}s.reverse=a;function l(C){return!C||C[Symbol.iterator]().next().done===!0}s.isEmpty=l;function d(C){return C[Symbol.iterator]().next().value}s.first=d;function c(C,w){for(const y of C)if(w(y))return!0;return!1}s.some=c;function u(C,w){for(const y of C)if(w(y))return y}s.find=u;function*h(C,w){for(const y of C)w(y)&&(yield y)}s.filter=h;function*g(C,w){let y=0;for(const D of C)yield w(D,y++)}s.map=g;function*f(...C){for(const w of C)yield*w}s.concat=f;function m(C,w,y){let D=y;for(const L of C)D=w(D,L);return D}s.reduce=m;function*_(C,w,y=C.length){for(w<0&&(w+=C.length),y<0?y+=C.length:y>C.length&&(y=C.length);w{n||(n=!0,this._remove(i))}}shift(){if(this._first!==nn.Undefined){const e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==nn.Undefined){const e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==nn.Undefined&&e.next!==nn.Undefined){const t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===nn.Undefined&&e.next===nn.Undefined?(this._first=nn.Undefined,this._last=nn.Undefined):e.next===nn.Undefined?(this._last=this._last.prev,this._last.next=nn.Undefined):e.prev===nn.Undefined&&(this._first=this._first.next,this._first.prev=nn.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==nn.Undefined;)yield e.element,e=e.next}}const BV="`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?";function Kse(s=""){let e="(-?\\d*\\.\\d\\w*)|([^";for(const t of BV)s.indexOf(t)>=0||(e+="\\"+t);return e+="\\s]+)",new RegExp(e,"g")}const VP=Kse();function zP(s){let e=VP;if(s&&s instanceof RegExp)if(s.global)e=s;else{let t="g";s.ignoreCase&&(t+="i"),s.multiline&&(t+="m"),s.unicode&&(t+="u"),e=new RegExp(s.source,t)}return e.lastIndex=0,e}const WV=new Rs;WV.unshift({maxLen:1e3,windowSize:15,timeBudget:150});function Eb(s,e,t,i,n){if(e=zP(e),n||(n=ft.first(WV)),t.length>n.maxLen){let d=s-n.maxLen/2;return d<0?d=0:i+=d,t=t.substring(d,s+n.maxLen/2),Eb(s,e,t,i,n)}const o=Date.now(),r=s-1-i;let a=-1,l=null;for(let d=1;!(Date.now()-o>=n.timeBudget);d++){const c=r-n.windowSize*d;e.lastIndex=Math.max(0,c);const u=qse(e,t,r,a);if(!u&&l||(l=u,c<=0))break;a=c}if(l){const d={word:l[0],startColumn:i+1+l.index,endColumn:i+1+l.index+l[0].length};return e.lastIndex=0,d}return null}function qse(s,e,t,i){let n;for(;n=s.exec(e);){const o=n.index||0;if(o<=t&&s.lastIndex>=t)return n;if(i>0&&o>i)return null}return null}const El=8;class HV{constructor(e){this._values=e}hasChanged(e){return this._values[e]}}class VV{constructor(){this.stableMinimapLayoutInput=null,this.stableFitMaxMinimapScale=0,this.stableFitRemainingWidth=0}}class hi{constructor(e,t,i,n){this.id=e,this.name=t,this.defaultValue=i,this.schema=n}applyUpdate(e,t){return $L(e,t)}compute(e,t,i){return i}}class Hv{constructor(e,t){this.newValue=e,this.didChange=t}}function $L(s,e){if(typeof s!="object"||typeof e!="object"||!s||!e)return new Hv(e,s!==e);if(Array.isArray(s)||Array.isArray(e)){const i=Array.isArray(s)&&Array.isArray(e)&&Ci(s,e);return new Hv(e,!i)}let t=!1;for(const i in e)if(e.hasOwnProperty(i)){const n=$L(s[i],e[i]);n.didChange&&(s[i]=n.newValue,t=!0)}return new Hv(s,t)}class a1{constructor(e){this.schema=void 0,this.id=e,this.name="_never_",this.defaultValue=void 0}applyUpdate(e,t){return $L(e,t)}validate(e){return this.defaultValue}}class n0{constructor(e,t,i,n){this.id=e,this.name=t,this.defaultValue=i,this.schema=n}applyUpdate(e,t){return $L(e,t)}validate(e){return typeof e>"u"?this.defaultValue:e}compute(e,t,i){return i}}function xe(s,e){return typeof s>"u"?e:s==="false"?!1:!!s}class Ct extends n0{constructor(e,t,i,n=void 0){typeof n<"u"&&(n.type="boolean",n.default=i),super(e,t,i,n)}validate(e){return xe(e,this.defaultValue)}}function kg(s,e,t,i){if(typeof s>"u")return e;let n=parseInt(s,10);return isNaN(n)?e:(n=Math.max(t,n),n=Math.min(i,n),n|0)}class zt extends n0{static clampedInt(e,t,i,n){return kg(e,t,i,n)}constructor(e,t,i,n,o,r=void 0){typeof r<"u"&&(r.type="integer",r.default=i,r.minimum=n,r.maximum=o),super(e,t,i,r),this.minimum=n,this.maximum=o}validate(e){return zt.clampedInt(e,this.defaultValue,this.minimum,this.maximum)}}function Gse(s,e,t,i){if(typeof s>"u")return e;const n=kr.float(s,e);return kr.clamp(n,t,i)}class kr extends n0{static clamp(e,t,i){return ei?i:e}static float(e,t){if(typeof e=="number")return e;if(typeof e>"u")return t;const i=parseFloat(e);return isNaN(i)?t:i}constructor(e,t,i,n,o){typeof o<"u"&&(o.type="number",o.default=i),super(e,t,i,o),this.validationFn=n}validate(e){return this.validationFn(kr.float(e,this.defaultValue))}}class ks extends n0{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 ks.string(e,this.defaultValue)}}function Ii(s,e,t,i){return typeof s!="string"?e:i&&s in i?i[s]:t.indexOf(s)===-1?e:s}class yi extends n0{constructor(e,t,i,n,o=void 0){typeof o<"u"&&(o.type="string",o.enum=n,o.default=i),super(e,t,i,o),this._allowedValues=n}validate(e){return Ii(e,this.defaultValue,this._allowedValues)}}class dw extends hi{constructor(e,t,i,n,o,r,a=void 0){typeof a<"u"&&(a.type="string",a.enum=o,a.default=n),super(e,t,i,a),this._allowedValues=o,this._convert=r}validate(e){return typeof e!="string"?this.defaultValue:this._allowedValues.indexOf(e)===-1?this.defaultValue:this._convert(e)}}function Zse(s){switch(s){case"none":return 0;case"keep":return 1;case"brackets":return 2;case"advanced":return 3;case"full":return 4}}class Xse extends hi{constructor(){super(2,"accessibilitySupport",0,{type:"string",enum:["auto","on","off"],enumDescriptions:[p("accessibilitySupport.auto","Use platform APIs to detect when a Screen Reader is attached."),p("accessibilitySupport.on","Optimize for usage with a Screen Reader."),p("accessibilitySupport.off","Assume a screen reader is not attached.")],default:"auto",tags:["accessibility"],description:p("accessibilitySupport","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 Yse extends hi{constructor(){const e={insertSpace:!0,ignoreEmptyLines:!0};super(23,"comments",e,{"editor.comments.insertSpace":{type:"boolean",default:e.insertSpace,description:p("comments.insertSpace","Controls whether a space character is inserted when commenting.")},"editor.comments.ignoreEmptyLines":{type:"boolean",default:e.ignoreEmptyLines,description:p("comments.ignoreEmptyLines","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:xe(t.insertSpace,this.defaultValue.insertSpace),ignoreEmptyLines:xe(t.ignoreEmptyLines,this.defaultValue.ignoreEmptyLines)}}}function Qse(s){switch(s){case"blink":return 1;case"smooth":return 2;case"phase":return 3;case"expand":return 4;case"solid":return 5}}var Hn;(function(s){s[s.Line=1]="Line",s[s.Block=2]="Block",s[s.Underline=3]="Underline",s[s.LineThin=4]="LineThin",s[s.BlockOutline=5]="BlockOutline",s[s.UnderlineThin=6]="UnderlineThin"})(Hn||(Hn={}));function Jse(s){switch(s){case"line":return Hn.Line;case"block":return Hn.Block;case"underline":return Hn.Underline;case"line-thin":return Hn.LineThin;case"block-outline":return Hn.BlockOutline;case"underline-thin":return Hn.UnderlineThin}}class eoe extends a1{constructor(){super(142)}compute(e,t,i){const n=["monaco-editor"];return t.get(39)&&n.push(t.get(39)),e.extraEditorClassName&&n.push(e.extraEditorClassName),t.get(74)==="default"?n.push("mouse-default"):t.get(74)==="copy"&&n.push("mouse-copy"),t.get(111)&&n.push("showUnused"),t.get(140)&&n.push("showDeprecated"),n.join(" ")}}class toe extends Ct{constructor(){super(37,"emptySelectionClipboard",!0,{description:p("emptySelectionClipboard","Controls whether copying without a selection copies the current line.")})}compute(e,t,i){return i&&e.emptySelectionClipboard}}class ioe extends hi{constructor(){const e={cursorMoveOnType:!0,seedSearchStringFromSelection:"always",autoFindInSelection:"never",globalFindClipboard:!1,addExtraSpaceOnTop:!0,loop:!0};super(41,"find",e,{"editor.find.cursorMoveOnType":{type:"boolean",default:e.cursorMoveOnType,description:p("find.cursorMoveOnType","Controls whether the cursor should jump to find matches while typing.")},"editor.find.seedSearchStringFromSelection":{type:"string",enum:["never","always","selection"],default:e.seedSearchStringFromSelection,enumDescriptions:[p("editor.find.seedSearchStringFromSelection.never","Never seed search string from the editor selection."),p("editor.find.seedSearchStringFromSelection.always","Always seed search string from the editor selection, including word at cursor position."),p("editor.find.seedSearchStringFromSelection.selection","Only seed search string from the editor selection.")],description:p("find.seedSearchStringFromSelection","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:[p("editor.find.autoFindInSelection.never","Never turn on Find in Selection automatically (default)."),p("editor.find.autoFindInSelection.always","Always turn on Find in Selection automatically."),p("editor.find.autoFindInSelection.multiline","Turn on Find in Selection automatically when multiple lines of content are selected.")],description:p("find.autoFindInSelection","Controls the condition for turning on Find in Selection automatically.")},"editor.find.globalFindClipboard":{type:"boolean",default:e.globalFindClipboard,description:p("find.globalFindClipboard","Controls whether the Find Widget should read or modify the shared find clipboard on macOS."),included:lt},"editor.find.addExtraSpaceOnTop":{type:"boolean",default:e.addExtraSpaceOnTop,description:p("find.addExtraSpaceOnTop","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:p("find.loop","Controls whether the search automatically restarts from the beginning (or the end) when no further matches can be found.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{cursorMoveOnType:xe(t.cursorMoveOnType,this.defaultValue.cursorMoveOnType),seedSearchStringFromSelection:typeof e.seedSearchStringFromSelection=="boolean"?e.seedSearchStringFromSelection?"always":"never":Ii(t.seedSearchStringFromSelection,this.defaultValue.seedSearchStringFromSelection,["never","always","selection"]),autoFindInSelection:typeof e.autoFindInSelection=="boolean"?e.autoFindInSelection?"always":"never":Ii(t.autoFindInSelection,this.defaultValue.autoFindInSelection,["never","always","multiline"]),globalFindClipboard:xe(t.globalFindClipboard,this.defaultValue.globalFindClipboard),addExtraSpaceOnTop:xe(t.addExtraSpaceOnTop,this.defaultValue.addExtraSpaceOnTop),loop:xe(t.loop,this.defaultValue.loop)}}}class Zo extends hi{constructor(){super(51,"fontLigatures",Zo.OFF,{anyOf:[{type:"boolean",description:p("fontLigatures","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:p("fontFeatureSettings","Explicit 'font-feature-settings' CSS property. A boolean can be passed instead if one only needs to turn on/off ligatures.")}],description:p("fontLigaturesGeneral","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?Zo.OFF:e==="true"?Zo.ON:e:e?Zo.ON:Zo.OFF}}Zo.OFF='"liga" off, "calt" off';Zo.ON='"liga" on, "calt" on';class $a extends hi{constructor(){super(54,"fontVariations",$a.OFF,{anyOf:[{type:"boolean",description:p("fontVariations","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:p("fontVariationSettings","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:p("fontVariationsGeneral","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"?$a.OFF:e==="true"?$a.TRANSLATE:e:e?$a.TRANSLATE:$a.OFF}compute(e,t,i){return e.fontInfo.fontVariationSettings}}$a.OFF="normal";$a.TRANSLATE="translate";class noe extends a1{constructor(){super(50)}compute(e,t,i){return e.fontInfo}}class soe extends n0{constructor(){super(52,"fontSize",co.fontSize,{type:"number",minimum:6,maximum:100,default:co.fontSize,description:p("fontSize","Controls the font size in pixels.")})}validate(e){const t=kr.float(e,this.defaultValue);return t===0?co.fontSize:kr.clamp(t,6,100)}compute(e,t,i){return e.fontInfo.fontSize}}class Vl extends hi{constructor(){super(53,"fontWeight",co.fontWeight,{anyOf:[{type:"number",minimum:Vl.MINIMUM_VALUE,maximum:Vl.MAXIMUM_VALUE,errorMessage:p("fontWeightErrorMessage",'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:Vl.SUGGESTION_VALUES}],default:co.fontWeight,description:p("fontWeight",'Controls the font weight. Accepts "normal" and "bold" keywords or numbers between 1 and 1000.')})}validate(e){return e==="normal"||e==="bold"?e:String(zt.clampedInt(e,co.fontWeight,Vl.MINIMUM_VALUE,Vl.MAXIMUM_VALUE))}}Vl.SUGGESTION_VALUES=["normal","bold","100","200","300","400","500","600","700","800","900"];Vl.MINIMUM_VALUE=1;Vl.MAXIMUM_VALUE=1e3;class ooe extends hi{constructor(){const e={multiple:"peek",multipleDefinitions:"peek",multipleTypeDefinitions:"peek",multipleDeclarations:"peek",multipleImplementations:"peek",multipleReferences:"peek",alternativeDefinitionCommand:"editor.action.goToReferences",alternativeTypeDefinitionCommand:"editor.action.goToReferences",alternativeDeclarationCommand:"editor.action.goToReferences",alternativeImplementationCommand:"",alternativeReferenceCommand:""},t={type:"string",enum:["peek","gotoAndPeek","goto"],default:e.multiple,enumDescriptions:[p("editor.gotoLocation.multiple.peek","Show Peek view of the results (default)"),p("editor.gotoLocation.multiple.gotoAndPeek","Go to the primary result and show a Peek view"),p("editor.gotoLocation.multiple.goto","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(58,"gotoLocation",e,{"editor.gotoLocation.multiple":{deprecationMessage:p("editor.gotoLocation.multiple.deprecated","This setting is deprecated, please use separate settings like 'editor.editor.gotoLocation.multipleDefinitions' or 'editor.editor.gotoLocation.multipleImplementations' instead.")},"editor.gotoLocation.multipleDefinitions":{description:p("editor.editor.gotoLocation.multipleDefinitions","Controls the behavior the 'Go to Definition'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleTypeDefinitions":{description:p("editor.editor.gotoLocation.multipleTypeDefinitions","Controls the behavior the 'Go to Type Definition'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleDeclarations":{description:p("editor.editor.gotoLocation.multipleDeclarations","Controls the behavior the 'Go to Declaration'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleImplementations":{description:p("editor.editor.gotoLocation.multipleImplemenattions","Controls the behavior the 'Go to Implementations'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleReferences":{description:p("editor.editor.gotoLocation.multipleReferences","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:p("alternativeDefinitionCommand","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:p("alternativeTypeDefinitionCommand","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:p("alternativeDeclarationCommand","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:p("alternativeImplementationCommand","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:p("alternativeReferenceCommand","Alternative command id that is being executed when the result of 'Go to Reference' is the current location.")}})}validate(e){var t,i,n,o,r;if(!e||typeof e!="object")return this.defaultValue;const a=e;return{multiple:Ii(a.multiple,this.defaultValue.multiple,["peek","gotoAndPeek","goto"]),multipleDefinitions:(t=a.multipleDefinitions)!==null&&t!==void 0?t:Ii(a.multipleDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleTypeDefinitions:(i=a.multipleTypeDefinitions)!==null&&i!==void 0?i:Ii(a.multipleTypeDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleDeclarations:(n=a.multipleDeclarations)!==null&&n!==void 0?n:Ii(a.multipleDeclarations,"peek",["peek","gotoAndPeek","goto"]),multipleImplementations:(o=a.multipleImplementations)!==null&&o!==void 0?o:Ii(a.multipleImplementations,"peek",["peek","gotoAndPeek","goto"]),multipleReferences:(r=a.multipleReferences)!==null&&r!==void 0?r:Ii(a.multipleReferences,"peek",["peek","gotoAndPeek","goto"]),alternativeDefinitionCommand:ks.string(a.alternativeDefinitionCommand,this.defaultValue.alternativeDefinitionCommand),alternativeTypeDefinitionCommand:ks.string(a.alternativeTypeDefinitionCommand,this.defaultValue.alternativeTypeDefinitionCommand),alternativeDeclarationCommand:ks.string(a.alternativeDeclarationCommand,this.defaultValue.alternativeDeclarationCommand),alternativeImplementationCommand:ks.string(a.alternativeImplementationCommand,this.defaultValue.alternativeImplementationCommand),alternativeReferenceCommand:ks.string(a.alternativeReferenceCommand,this.defaultValue.alternativeReferenceCommand)}}}class roe extends hi{constructor(){const e={enabled:!0,delay:300,hidingDelay:300,sticky:!0,above:!0};super(60,"hover",e,{"editor.hover.enabled":{type:"boolean",default:e.enabled,description:p("hover.enabled","Controls whether the hover is shown.")},"editor.hover.delay":{type:"number",default:e.delay,minimum:0,maximum:1e4,description:p("hover.delay","Controls the delay in milliseconds after which the hover is shown.")},"editor.hover.sticky":{type:"boolean",default:e.sticky,description:p("hover.sticky","Controls whether the hover should remain visible when mouse is moved over it.")},"editor.hover.hidingDelay":{type:"integer",minimum:0,default:e.hidingDelay,description:p("hover.hidingDelay","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:p("hover.above","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:xe(t.enabled,this.defaultValue.enabled),delay:zt.clampedInt(t.delay,this.defaultValue.delay,0,1e4),sticky:xe(t.sticky,this.defaultValue.sticky),hidingDelay:zt.clampedInt(t.hidingDelay,this.defaultValue.hidingDelay,0,6e5),above:xe(t.above,this.defaultValue.above)}}}class Lm extends a1{constructor(){super(145)}compute(e,t,i){return Lm.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 o=(i+e.viewLineCount+n)/(e.pixelRatio*e.height),r=Math.floor(e.viewLineCount/o);return{typicalViewportLineCount:t,extraLinesBeforeFirstLine:i,extraLinesBeyondLastLine:n,desiredRatio:o,minimapLineCount:r}}static _computeMinimapLayout(e,t){const i=e.outerWidth,n=e.outerHeight,o=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(o*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,d=e.typicalHalfwidthCharacterWidth,c=e.scrollBeyondLastLine,u=e.minimap.renderCharacters;let h=o>=2?Math.round(e.minimap.scale*2):e.minimap.scale;const g=e.minimap.maxColumn,f=e.minimap.size,m=e.minimap.side,_=e.verticalScrollbarWidth,v=e.viewLineCount,b=e.remainingWidth,C=e.isViewportWrapping,w=u?2:3;let y=Math.floor(o*n);const D=y/o;let L=!1,k=!1,I=w*h,O=h/o,R=1;if(f==="fill"||f==="fit"){const{typicalViewportLineCount:De,extraLinesBeforeFirstLine:ge,extraLinesBeyondLastLine:We,desiredRatio:ye,minimapLineCount:ve}=Lm.computeContainedMinimapLineCount({viewLineCount:v,scrollBeyondLastLine:c,paddingTop:e.paddingTop,paddingBottom:e.paddingBottom,height:n,lineHeight:l,pixelRatio:o});if(v/ve>1)L=!0,k=!0,h=1,I=1,O=h/o;else{let Qt=!1,Ui=h+1;if(f==="fit"){const Gi=Math.ceil((ge+v+We)*I);C&&a&&b<=t.stableFitRemainingWidth?(Qt=!0,Ui=t.stableFitMaxMinimapScale):Qt=Gi>y}if(f==="fill"||Qt){L=!0;const Gi=h;I=Math.min(l*o,Math.max(1,Math.floor(1/ye))),C&&a&&b<=t.stableFitRemainingWidth&&(Ui=t.stableFitMaxMinimapScale),h=Math.min(Ui,Math.max(1,Math.floor(I/w))),h>Gi&&(R=Math.min(2,h/Gi)),O=h/o/R,y=Math.ceil(Math.max(De,ge+v+We)*I),C?(t.stableMinimapLayoutInput=e,t.stableFitRemainingWidth=b,t.stableFitMaxMinimapScale=h):(t.stableMinimapLayoutInput=null,t.stableFitRemainingWidth=0)}}}const P=Math.floor(g*O),F=Math.min(P,Math.max(0,Math.floor((b-_-2)*O/(d+O)))+El);let V=Math.floor(o*F);const U=V/o;V=Math.floor(V*R);const J=u?1:2,pe=m==="left"?0:i-F-_;return{renderMinimap:J,minimapLeft:pe,minimapWidth:F,minimapHeightIsEditorHeight:L,minimapIsSampling:k,minimapScale:h,minimapLineHeight:I,minimapCanvasInnerWidth:V,minimapCanvasInnerHeight:y,minimapCanvasOuterWidth:U,minimapCanvasOuterHeight:D}}static computeLayout(e,t){const i=t.outerWidth|0,n=t.outerHeight|0,o=t.lineHeight|0,r=t.lineNumbersDigitCount|0,a=t.typicalHalfwidthCharacterWidth,l=t.maxDigitWidth,d=t.pixelRatio,c=t.viewLineCount,u=e.get(137),h=u==="inherit"?e.get(136):u,g=h==="inherit"?e.get(132):h,f=e.get(135),m=t.isDominatedByLongLines,_=e.get(57),v=e.get(68).renderType!==0,b=e.get(69),C=e.get(105),w=e.get(84),y=e.get(73),D=e.get(103),L=D.verticalScrollbarSize,k=D.verticalHasArrows,I=D.arrowSize,O=D.horizontalScrollbarSize,R=e.get(43),P=e.get(110)!=="never";let F=e.get(66);R&&P&&(F+=16);let V=0;if(v){const tn=Math.max(r,b);V=Math.round(tn*l)}let U=0;_&&(U=o*t.glyphMarginDecorationLaneCount);let J=0,pe=J+U,De=pe+V,ge=De+F;const We=i-U-V-F;let ye=!1,ve=!1,ce=-1;h==="inherit"&&m?(ye=!0,ve=!0):g==="on"||g==="bounded"?ve=!0:g==="wordWrapColumn"&&(ce=f);const Qt=Lm._computeMinimapLayout({outerWidth:i,outerHeight:n,lineHeight:o,typicalHalfwidthCharacterWidth:a,pixelRatio:d,scrollBeyondLastLine:C,paddingTop:w.top,paddingBottom:w.bottom,minimap:y,verticalScrollbarWidth:L,viewLineCount:c,remainingWidth:We,isViewportWrapping:ve},t.memory||new VV);Qt.renderMinimap!==0&&Qt.minimapLeft===0&&(J+=Qt.minimapWidth,pe+=Qt.minimapWidth,De+=Qt.minimapWidth,ge+=Qt.minimapWidth);const Ui=We-Qt.minimapWidth,Gi=Math.max(1,Math.floor((Ui-L-2)/a)),St=k?I:0;return ve&&(ce=Math.max(1,Gi),g==="bounded"&&(ce=Math.min(ce,f))),{width:i,height:n,glyphMarginLeft:J,glyphMarginWidth:U,glyphMarginDecorationLaneCount:t.glyphMarginDecorationLaneCount,lineNumbersLeft:pe,lineNumbersWidth:V,decorationsLeft:De,decorationsWidth:F,contentLeft:ge,contentWidth:Ui,minimap:Qt,viewportColumn:Gi,isWordWrapMinified:ye,isViewportWrapping:ve,wrappingColumn:ce,verticalScrollbarWidth:L,horizontalScrollbarHeight:O,overviewRuler:{top:St,width:L,height:n-2*St,right:0}}}}class aoe extends hi{constructor(){super(139,"wrappingStrategy","simple",{"editor.wrappingStrategy":{enumDescriptions:[p("wrappingStrategy.simple","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."),p("wrappingStrategy.advanced","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:p("wrappingStrategy","Controls the algorithm that computes wrapping points. Note that when in accessibility mode, advanced will be used for the best experience.")}})}validate(e){return Ii(e,"simple",["simple","advanced"])}compute(e,t,i){return t.get(2)===2?"advanced":i}}var ia;(function(s){s.Off="off",s.OnCode="onCode",s.On="on"})(ia||(ia={}));class loe extends hi{constructor(){const e={enabled:ia.On};super(65,"lightbulb",e,{"editor.lightbulb.enabled":{type:"string",tags:["experimental"],enum:[ia.Off,ia.OnCode,ia.On],default:e.enabled,enumDescriptions:[p("editor.lightbulb.enabled.off","Disable the code action menu."),p("editor.lightbulb.enabled.onCode","Show the code action menu when the cursor is on lines with code."),p("editor.lightbulb.enabled.on","Show the code action menu when the cursor is on lines with code or on empty lines.")],description:p("enabled","Enables the Code Action lightbulb in the editor.")}})}validate(e){return!e||typeof e!="object"?this.defaultValue:{enabled:Ii(e.enabled,this.defaultValue.enabled,[ia.Off,ia.OnCode,ia.On])}}}class doe extends hi{constructor(){const e={enabled:!0,maxLineCount:5,defaultModel:"outlineModel",scrollWithEditor:!0};super(115,"stickyScroll",e,{"editor.stickyScroll.enabled":{type:"boolean",default:e.enabled,description:p("editor.stickyScroll.enabled","Shows the nested current scopes during the scroll at the top of the editor."),tags:["experimental"]},"editor.stickyScroll.maxLineCount":{type:"number",default:e.maxLineCount,minimum:1,maximum:20,description:p("editor.stickyScroll.maxLineCount","Defines the maximum number of sticky lines to show.")},"editor.stickyScroll.defaultModel":{type:"string",enum:["outlineModel","foldingProviderModel","indentationModel"],default:e.defaultModel,description:p("editor.stickyScroll.defaultModel","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:p("editor.stickyScroll.scrollWithEditor","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:xe(t.enabled,this.defaultValue.enabled),maxLineCount:zt.clampedInt(t.maxLineCount,this.defaultValue.maxLineCount,1,20),defaultModel:Ii(t.defaultModel,this.defaultValue.defaultModel,["outlineModel","foldingProviderModel","indentationModel"]),scrollWithEditor:xe(t.scrollWithEditor,this.defaultValue.scrollWithEditor)}}}class coe extends hi{constructor(){const e={enabled:"on",fontSize:0,fontFamily:"",padding:!1};super(141,"inlayHints",e,{"editor.inlayHints.enabled":{type:"string",default:e.enabled,description:p("inlayHints.enable","Enables the inlay hints in the editor."),enum:["on","onUnlessPressed","offUnlessPressed","off"],markdownEnumDescriptions:[p("editor.inlayHints.on","Inlay hints are enabled"),p("editor.inlayHints.onUnlessPressed","Inlay hints are showing by default and hide when holding {0}",lt?"Ctrl+Option":"Ctrl+Alt"),p("editor.inlayHints.offUnlessPressed","Inlay hints are hidden by default and show when holding {0}",lt?"Ctrl+Option":"Ctrl+Alt"),p("editor.inlayHints.off","Inlay hints are disabled")]},"editor.inlayHints.fontSize":{type:"number",default:e.fontSize,markdownDescription:p("inlayHints.fontSize","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:p("inlayHints.fontFamily","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:p("inlayHints.padding","Enables the padding around the inlay hints in the editor.")}})}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:Ii(t.enabled,this.defaultValue.enabled,["on","off","offUnlessPressed","onUnlessPressed"]),fontSize:zt.clampedInt(t.fontSize,this.defaultValue.fontSize,0,100),fontFamily:ks.string(t.fontFamily,this.defaultValue.fontFamily),padding:xe(t.padding,this.defaultValue.padding)}}}class uoe extends hi{constructor(){super(66,"lineDecorationsWidth",10)}validate(e){return typeof e=="string"&&/^\d+(\.\d+)?ch$/.test(e)?-parseFloat(e.substring(0,e.length-2)):zt.clampedInt(e,this.defaultValue,0,1e3)}compute(e,t,i){return i<0?zt.clampedInt(-i*e.fontInfo.typicalHalfwidthCharacterWidth,this.defaultValue,0,1e3):i}}class hoe extends kr{constructor(){super(67,"lineHeight",co.lineHeight,e=>kr.clamp(e,0,150),{markdownDescription:p("lineHeight",`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.`)})}compute(e,t,i){return e.fontInfo.lineHeight}}class goe extends hi{constructor(){const e={enabled:!0,size:"proportional",side:"right",showSlider:"mouseover",autohide:!1,renderCharacters:!0,maxColumn:120,scale:1,showRegionSectionHeaders:!0,showMarkSectionHeaders:!0,sectionHeaderFontSize:9};super(73,"minimap",e,{"editor.minimap.enabled":{type:"boolean",default:e.enabled,description:p("minimap.enabled","Controls whether the minimap is shown.")},"editor.minimap.autohide":{type:"boolean",default:e.autohide,description:p("minimap.autohide","Controls whether the minimap is hidden automatically.")},"editor.minimap.size":{type:"string",enum:["proportional","fill","fit"],enumDescriptions:[p("minimap.size.proportional","The minimap has the same size as the editor contents (and might scroll)."),p("minimap.size.fill","The minimap will stretch or shrink as necessary to fill the height of the editor (no scrolling)."),p("minimap.size.fit","The minimap will shrink as necessary to never be larger than the editor (no scrolling).")],default:e.size,description:p("minimap.size","Controls the size of the minimap.")},"editor.minimap.side":{type:"string",enum:["left","right"],default:e.side,description:p("minimap.side","Controls the side where to render the minimap.")},"editor.minimap.showSlider":{type:"string",enum:["always","mouseover"],default:e.showSlider,description:p("minimap.showSlider","Controls when the minimap slider is shown.")},"editor.minimap.scale":{type:"number",default:e.scale,minimum:1,maximum:3,enum:[1,2,3],description:p("minimap.scale","Scale of content drawn in the minimap: 1, 2 or 3.")},"editor.minimap.renderCharacters":{type:"boolean",default:e.renderCharacters,description:p("minimap.renderCharacters","Render the actual characters on a line as opposed to color blocks.")},"editor.minimap.maxColumn":{type:"number",default:e.maxColumn,description:p("minimap.maxColumn","Limit the width of the minimap to render at most a certain number of columns.")},"editor.minimap.showRegionSectionHeaders":{type:"boolean",default:e.showRegionSectionHeaders,description:p("minimap.showRegionSectionHeaders","Controls whether named regions are shown as section headers in the minimap.")},"editor.minimap.showMarkSectionHeaders":{type:"boolean",default:e.showMarkSectionHeaders,description:p("minimap.showMarkSectionHeaders","Controls whether MARK: comments are shown as section headers in the minimap.")},"editor.minimap.sectionHeaderFontSize":{type:"number",default:e.sectionHeaderFontSize,description:p("minimap.sectionHeaderFontSize","Controls the font size of section headers in the minimap.")}})}validate(e){var t;if(!e||typeof e!="object")return this.defaultValue;const i=e;return{enabled:xe(i.enabled,this.defaultValue.enabled),autohide:xe(i.autohide,this.defaultValue.autohide),size:Ii(i.size,this.defaultValue.size,["proportional","fill","fit"]),side:Ii(i.side,this.defaultValue.side,["right","left"]),showSlider:Ii(i.showSlider,this.defaultValue.showSlider,["always","mouseover"]),renderCharacters:xe(i.renderCharacters,this.defaultValue.renderCharacters),scale:zt.clampedInt(i.scale,1,1,3),maxColumn:zt.clampedInt(i.maxColumn,this.defaultValue.maxColumn,1,1e4),showRegionSectionHeaders:xe(i.showRegionSectionHeaders,this.defaultValue.showRegionSectionHeaders),showMarkSectionHeaders:xe(i.showMarkSectionHeaders,this.defaultValue.showMarkSectionHeaders),sectionHeaderFontSize:kr.clamp((t=i.sectionHeaderFontSize)!==null&&t!==void 0?t:this.defaultValue.sectionHeaderFontSize,4,32)}}}function foe(s){return s==="ctrlCmd"?lt?"metaKey":"ctrlKey":"altKey"}class poe extends hi{constructor(){super(84,"padding",{top:0,bottom:0},{"editor.padding.top":{type:"number",default:0,minimum:0,maximum:1e3,description:p("padding.top","Controls the amount of space between the top edge of the editor and the first line.")},"editor.padding.bottom":{type:"number",default:0,minimum:0,maximum:1e3,description:p("padding.bottom","Controls the amount of space between the bottom edge of the editor and the last line.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{top:zt.clampedInt(t.top,0,0,1e3),bottom:zt.clampedInt(t.bottom,0,0,1e3)}}}class moe extends hi{constructor(){const e={enabled:!0,cycle:!0};super(86,"parameterHints",e,{"editor.parameterHints.enabled":{type:"boolean",default:e.enabled,description:p("parameterHints.enabled","Enables a pop-up that shows parameter documentation and type information as you type.")},"editor.parameterHints.cycle":{type:"boolean",default:e.cycle,description:p("parameterHints.cycle","Controls whether the parameter hints menu cycles or closes when reaching the end of the list.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:xe(t.enabled,this.defaultValue.enabled),cycle:xe(t.cycle,this.defaultValue.cycle)}}}class _oe extends a1{constructor(){super(143)}compute(e,t,i){return e.pixelRatio}}class voe extends hi{constructor(){const e={other:"on",comments:"off",strings:"off"},t=[{type:"boolean"},{type:"string",enum:["on","inline","off"],enumDescriptions:[p("on","Quick suggestions show inside the suggest widget"),p("inline","Quick suggestions show as ghost text"),p("off","Quick suggestions are disabled")]}];super(89,"quickSuggestions",e,{type:"object",additionalProperties:!1,properties:{strings:{anyOf:t,default:e.strings,description:p("quickSuggestions.strings","Enable quick suggestions inside strings.")},comments:{anyOf:t,default:e.comments,description:p("quickSuggestions.comments","Enable quick suggestions inside comments.")},other:{anyOf:t,default:e.other,description:p("quickSuggestions.other","Enable quick suggestions outside of strings and comments.")}},default:e,markdownDescription:p("quickSuggestions","Controls whether suggestions should automatically show up while typing. This can be controlled for typing in comments, strings, and other code. Quick suggestion can be configured to show as ghost text or with the suggest widget. Also be aware of the '{0}'-setting which controls if suggestions are triggered by special characters.","#editor.suggestOnTriggerCharacters#")}),this.defaultValue=e}validate(e){if(typeof e=="boolean"){const d=e?"on":"off";return{comments:d,strings:d,other:d}}if(!e||typeof e!="object")return this.defaultValue;const{other:t,comments:i,strings:n}=e,o=["on","inline","off"];let r,a,l;return typeof t=="boolean"?r=t?"on":"off":r=Ii(t,this.defaultValue.other,o),typeof i=="boolean"?a=i?"on":"off":a=Ii(i,this.defaultValue.comments,o),typeof n=="boolean"?l=n?"on":"off":l=Ii(n,this.defaultValue.strings,o),{other:r,comments:a,strings:l}}}class boe extends hi{constructor(){super(68,"lineNumbers",{renderType:1,renderFn:null},{type:"string",enum:["off","on","relative","interval"],enumDescriptions:[p("lineNumbers.off","Line numbers are not rendered."),p("lineNumbers.on","Line numbers are rendered as absolute number."),p("lineNumbers.relative","Line numbers are rendered as distance in lines to cursor position."),p("lineNumbers.interval","Line numbers are rendered every 10 lines.")],default:"on",description:p("lineNumbers","Controls the display of line numbers.")})}validate(e){let t=this.defaultValue.renderType,i=this.defaultValue.renderFn;return typeof e<"u"&&(typeof e=="function"?(t=4,i=e):e==="interval"?t=3:e==="relative"?t=2:e==="on"?t=1:t=0),{renderType:t,renderFn:i}}}function TS(s){const e=s.get(98);return e==="editable"?s.get(91):e!=="on"}class Coe extends hi{constructor(){const e=[],t={type:"number",description:p("rulers.size","Number of monospace characters at which this editor ruler will render.")};super(102,"rulers",e,{type:"array",items:{anyOf:[t,{type:["object"],properties:{column:t,color:{type:"string",description:p("rulers.color","Color of this editor ruler."),format:"color-hex"}}}]},default:e,description:p("rulers","Render vertical rulers after a certain number of monospace characters. Use multiple values for multiple rulers. No rulers are drawn if array is empty.")})}validate(e){if(Array.isArray(e)){const t=[];for(const i of e)if(typeof i=="number")t.push({column:zt.clampedInt(i,0,0,1e4),color:null});else if(i&&typeof i=="object"){const n=i;t.push({column:zt.clampedInt(n.column,0,0,1e4),color:n.color})}return t.sort((i,n)=>i.column-n.column),t}return this.defaultValue}}class woe extends hi{constructor(){super(92,"readOnlyMessage",void 0)}validate(e){return!e||typeof e!="object"?this.defaultValue:e}}function J5(s,e){if(typeof s!="string")return e;switch(s){case"hidden":return 2;case"visible":return 3;default:return 1}}let yoe=class extends hi{constructor(){const e={vertical:1,horizontal:1,arrowSize:11,useShadows:!0,verticalHasArrows:!1,horizontalHasArrows:!1,horizontalScrollbarSize:12,horizontalSliderSize:12,verticalScrollbarSize:14,verticalSliderSize:14,handleMouseWheel:!0,alwaysConsumeMouseWheel:!0,scrollByPage:!1,ignoreHorizontalScrollbarInContentHeight:!1};super(103,"scrollbar",e,{"editor.scrollbar.vertical":{type:"string",enum:["auto","visible","hidden"],enumDescriptions:[p("scrollbar.vertical.auto","The vertical scrollbar will be visible only when necessary."),p("scrollbar.vertical.visible","The vertical scrollbar will always be visible."),p("scrollbar.vertical.fit","The vertical scrollbar will always be hidden.")],default:"auto",description:p("scrollbar.vertical","Controls the visibility of the vertical scrollbar.")},"editor.scrollbar.horizontal":{type:"string",enum:["auto","visible","hidden"],enumDescriptions:[p("scrollbar.horizontal.auto","The horizontal scrollbar will be visible only when necessary."),p("scrollbar.horizontal.visible","The horizontal scrollbar will always be visible."),p("scrollbar.horizontal.fit","The horizontal scrollbar will always be hidden.")],default:"auto",description:p("scrollbar.horizontal","Controls the visibility of the horizontal scrollbar.")},"editor.scrollbar.verticalScrollbarSize":{type:"number",default:e.verticalScrollbarSize,description:p("scrollbar.verticalScrollbarSize","The width of the vertical scrollbar.")},"editor.scrollbar.horizontalScrollbarSize":{type:"number",default:e.horizontalScrollbarSize,description:p("scrollbar.horizontalScrollbarSize","The height of the horizontal scrollbar.")},"editor.scrollbar.scrollByPage":{type:"boolean",default:e.scrollByPage,description:p("scrollbar.scrollByPage","Controls whether clicks scroll by page or jump to click position.")},"editor.scrollbar.ignoreHorizontalScrollbarInContentHeight":{type:"boolean",default:e.ignoreHorizontalScrollbarInContentHeight,description:p("scrollbar.ignoreHorizontalScrollbarInContentHeight","When set, the horizontal scrollbar will not increase the size of the editor's content.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e,i=zt.clampedInt(t.horizontalScrollbarSize,this.defaultValue.horizontalScrollbarSize,0,1e3),n=zt.clampedInt(t.verticalScrollbarSize,this.defaultValue.verticalScrollbarSize,0,1e3);return{arrowSize:zt.clampedInt(t.arrowSize,this.defaultValue.arrowSize,0,1e3),vertical:J5(t.vertical,this.defaultValue.vertical),horizontal:J5(t.horizontal,this.defaultValue.horizontal),useShadows:xe(t.useShadows,this.defaultValue.useShadows),verticalHasArrows:xe(t.verticalHasArrows,this.defaultValue.verticalHasArrows),horizontalHasArrows:xe(t.horizontalHasArrows,this.defaultValue.horizontalHasArrows),handleMouseWheel:xe(t.handleMouseWheel,this.defaultValue.handleMouseWheel),alwaysConsumeMouseWheel:xe(t.alwaysConsumeMouseWheel,this.defaultValue.alwaysConsumeMouseWheel),horizontalScrollbarSize:i,horizontalSliderSize:zt.clampedInt(t.horizontalSliderSize,i,0,1e3),verticalScrollbarSize:n,verticalSliderSize:zt.clampedInt(t.verticalSliderSize,n,0,1e3),scrollByPage:xe(t.scrollByPage,this.defaultValue.scrollByPage),ignoreHorizontalScrollbarInContentHeight:xe(t.ignoreHorizontalScrollbarInContentHeight,this.defaultValue.ignoreHorizontalScrollbarInContentHeight)}}};const zo="inUntrustedWorkspace",no={allowedCharacters:"editor.unicodeHighlight.allowedCharacters",invisibleCharacters:"editor.unicodeHighlight.invisibleCharacters",nonBasicASCII:"editor.unicodeHighlight.nonBasicASCII",ambiguousCharacters:"editor.unicodeHighlight.ambiguousCharacters",includeComments:"editor.unicodeHighlight.includeComments",includeStrings:"editor.unicodeHighlight.includeStrings",allowedLocales:"editor.unicodeHighlight.allowedLocales"};class Soe extends hi{constructor(){const e={nonBasicASCII:zo,invisibleCharacters:!0,ambiguousCharacters:!0,includeComments:zo,includeStrings:!0,allowedCharacters:{},allowedLocales:{_os:!0,_vscode:!0}};super(125,"unicodeHighlight",e,{[no.nonBasicASCII]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,zo],default:e.nonBasicASCII,description:p("unicodeHighlight.nonBasicASCII","Controls whether all non-basic ASCII characters are highlighted. Only characters between U+0020 and U+007E, tab, line-feed and carriage-return are considered basic ASCII.")},[no.invisibleCharacters]:{restricted:!0,type:"boolean",default:e.invisibleCharacters,description:p("unicodeHighlight.invisibleCharacters","Controls whether characters that just reserve space or have no width at all are highlighted.")},[no.ambiguousCharacters]:{restricted:!0,type:"boolean",default:e.ambiguousCharacters,description:p("unicodeHighlight.ambiguousCharacters","Controls whether characters are highlighted that can be confused with basic ASCII characters, except those that are common in the current user locale.")},[no.includeComments]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,zo],default:e.includeComments,description:p("unicodeHighlight.includeComments","Controls whether characters in comments should also be subject to Unicode highlighting.")},[no.includeStrings]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,zo],default:e.includeStrings,description:p("unicodeHighlight.includeStrings","Controls whether characters in strings should also be subject to Unicode highlighting.")},[no.allowedCharacters]:{restricted:!0,type:"object",default:e.allowedCharacters,description:p("unicodeHighlight.allowedCharacters","Defines allowed characters that are not being highlighted."),additionalProperties:{type:"boolean"}},[no.allowedLocales]:{restricted:!0,type:"object",additionalProperties:{type:"boolean"},default:e.allowedLocales,description:p("unicodeHighlight.allowedLocales","Unicode characters that are common in allowed locales are not being highlighted.")}})}applyUpdate(e,t){let i=!1;t.allowedCharacters&&e&&(tr(e.allowedCharacters,t.allowedCharacters)||(e={...e,allowedCharacters:t.allowedCharacters},i=!0)),t.allowedLocales&&e&&(tr(e.allowedLocales,t.allowedLocales)||(e={...e,allowedLocales:t.allowedLocales},i=!0));const n=super.applyUpdate(e,t);return i?new Hv(n.newValue,!0):n}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{nonBasicASCII:xm(t.nonBasicASCII,zo,[!0,!1,zo]),invisibleCharacters:xe(t.invisibleCharacters,this.defaultValue.invisibleCharacters),ambiguousCharacters:xe(t.ambiguousCharacters,this.defaultValue.ambiguousCharacters),includeComments:xm(t.includeComments,zo,[!0,!1,zo]),includeStrings:xm(t.includeStrings,zo,[!0,!1,zo]),allowedCharacters:this.validateBooleanMap(e.allowedCharacters,this.defaultValue.allowedCharacters),allowedLocales:this.validateBooleanMap(e.allowedLocales,this.defaultValue.allowedLocales)}}validateBooleanMap(e,t){if(typeof e!="object"||!e)return t;const i={};for(const[n,o]of Object.entries(e))o===!0&&(i[n]=!0);return i}}class Doe extends hi{constructor(){const e={enabled:!0,mode:"subwordSmart",showToolbar:"onHover",suppressSuggestions:!1,keepOnBlur:!1,fontFamily:"default"};super(62,"inlineSuggest",e,{"editor.inlineSuggest.enabled":{type:"boolean",default:e.enabled,description:p("inlineSuggest.enabled","Controls whether to automatically show inline suggestions in the editor.")},"editor.inlineSuggest.showToolbar":{type:"string",default:e.showToolbar,enum:["always","onHover","never"],enumDescriptions:[p("inlineSuggest.showToolbar.always","Show the inline suggestion toolbar whenever an inline suggestion is shown."),p("inlineSuggest.showToolbar.onHover","Show the inline suggestion toolbar when hovering over an inline suggestion."),p("inlineSuggest.showToolbar.never","Never show the inline suggestion toolbar.")],description:p("inlineSuggest.showToolbar","Controls when to show the inline suggestion toolbar.")},"editor.inlineSuggest.suppressSuggestions":{type:"boolean",default:e.suppressSuggestions,description:p("inlineSuggest.suppressSuggestions","Controls how inline suggestions interact with the suggest widget. If enabled, the suggest widget is not shown automatically when inline suggestions are available.")},"editor.inlineSuggest.fontFamily":{type:"string",default:e.fontFamily,description:p("inlineSuggest.fontFamily","Controls the font family of the inline suggestions.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:xe(t.enabled,this.defaultValue.enabled),mode:Ii(t.mode,this.defaultValue.mode,["prefix","subword","subwordSmart"]),showToolbar:Ii(t.showToolbar,this.defaultValue.showToolbar,["always","onHover","never"]),suppressSuggestions:xe(t.suppressSuggestions,this.defaultValue.suppressSuggestions),keepOnBlur:xe(t.keepOnBlur,this.defaultValue.keepOnBlur),fontFamily:ks.string(t.fontFamily,this.defaultValue.fontFamily)}}}class Loe extends hi{constructor(){const e={enabled:!1,showToolbar:"onHover",fontFamily:"default",keepOnBlur:!1,backgroundColoring:!1};super(63,"experimentalInlineEdit",e,{"editor.experimentalInlineEdit.enabled":{type:"boolean",default:e.enabled,description:p("inlineEdit.enabled","Controls whether to show inline edits in the editor.")},"editor.experimentalInlineEdit.showToolbar":{type:"string",default:e.showToolbar,enum:["always","onHover","never"],enumDescriptions:[p("inlineEdit.showToolbar.always","Show the inline edit toolbar whenever an inline suggestion is shown."),p("inlineEdit.showToolbar.onHover","Show the inline edit toolbar when hovering over an inline suggestion."),p("inlineEdit.showToolbar.never","Never show the inline edit toolbar.")],description:p("inlineEdit.showToolbar","Controls when to show the inline edit toolbar.")},"editor.experimentalInlineEdit.fontFamily":{type:"string",default:e.fontFamily,description:p("inlineEdit.fontFamily","Controls the font family of the inline edit.")},"editor.experimentalInlineEdit.backgroundColoring":{type:"boolean",default:e.backgroundColoring,description:p("inlineEdit.backgroundColoring","Controls whether to color the background of inline edits.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:xe(t.enabled,this.defaultValue.enabled),showToolbar:Ii(t.showToolbar,this.defaultValue.showToolbar,["always","onHover","never"]),fontFamily:ks.string(t.fontFamily,this.defaultValue.fontFamily),keepOnBlur:xe(t.keepOnBlur,this.defaultValue.keepOnBlur),backgroundColoring:xe(t.backgroundColoring,this.defaultValue.backgroundColoring)}}}class xoe extends hi{constructor(){const e={enabled:ns.bracketPairColorizationOptions.enabled,independentColorPoolPerBracketType:ns.bracketPairColorizationOptions.independentColorPoolPerBracketType};super(15,"bracketPairColorization",e,{"editor.bracketPairColorization.enabled":{type:"boolean",default:e.enabled,markdownDescription:p("bracketPairColorization.enabled","Controls whether bracket pair colorization is enabled or not. Use {0} to override the bracket highlight colors.","`#workbench.colorCustomizations#`")},"editor.bracketPairColorization.independentColorPoolPerBracketType":{type:"boolean",default:e.independentColorPoolPerBracketType,description:p("bracketPairColorization.independentColorPoolPerBracketType","Controls whether each bracket type has its own independent color pool.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:xe(t.enabled,this.defaultValue.enabled),independentColorPoolPerBracketType:xe(t.independentColorPoolPerBracketType,this.defaultValue.independentColorPoolPerBracketType)}}}class koe extends hi{constructor(){const e={bracketPairs:!1,bracketPairsHorizontal:"active",highlightActiveBracketPair:!0,indentation:!0,highlightActiveIndentation:!0};super(16,"guides",e,{"editor.guides.bracketPairs":{type:["boolean","string"],enum:[!0,"active",!1],enumDescriptions:[p("editor.guides.bracketPairs.true","Enables bracket pair guides."),p("editor.guides.bracketPairs.active","Enables bracket pair guides only for the active bracket pair."),p("editor.guides.bracketPairs.false","Disables bracket pair guides.")],default:e.bracketPairs,description:p("editor.guides.bracketPairs","Controls whether bracket pair guides are enabled or not.")},"editor.guides.bracketPairsHorizontal":{type:["boolean","string"],enum:[!0,"active",!1],enumDescriptions:[p("editor.guides.bracketPairsHorizontal.true","Enables horizontal guides as addition to vertical bracket pair guides."),p("editor.guides.bracketPairsHorizontal.active","Enables horizontal guides only for the active bracket pair."),p("editor.guides.bracketPairsHorizontal.false","Disables horizontal bracket pair guides.")],default:e.bracketPairsHorizontal,description:p("editor.guides.bracketPairsHorizontal","Controls whether horizontal bracket pair guides are enabled or not.")},"editor.guides.highlightActiveBracketPair":{type:"boolean",default:e.highlightActiveBracketPair,description:p("editor.guides.highlightActiveBracketPair","Controls whether the editor should highlight the active bracket pair.")},"editor.guides.indentation":{type:"boolean",default:e.indentation,description:p("editor.guides.indentation","Controls whether the editor should render indent guides.")},"editor.guides.highlightActiveIndentation":{type:["boolean","string"],enum:[!0,"always",!1],enumDescriptions:[p("editor.guides.highlightActiveIndentation.true","Highlights the active indent guide."),p("editor.guides.highlightActiveIndentation.always","Highlights the active indent guide even if bracket guides are highlighted."),p("editor.guides.highlightActiveIndentation.false","Do not highlight the active indent guide.")],default:e.highlightActiveIndentation,description:p("editor.guides.highlightActiveIndentation","Controls whether the editor should highlight the active indent guide.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{bracketPairs:xm(t.bracketPairs,this.defaultValue.bracketPairs,[!0,!1,"active"]),bracketPairsHorizontal:xm(t.bracketPairsHorizontal,this.defaultValue.bracketPairsHorizontal,[!0,!1,"active"]),highlightActiveBracketPair:xe(t.highlightActiveBracketPair,this.defaultValue.highlightActiveBracketPair),indentation:xe(t.indentation,this.defaultValue.indentation),highlightActiveIndentation:xm(t.highlightActiveIndentation,this.defaultValue.highlightActiveIndentation,[!0,!1,"always"])}}}function xm(s,e,t){const i=t.indexOf(s);return i===-1?e:t[i]}class Eoe extends hi{constructor(){const e={insertMode:"insert",filterGraceful:!0,snippetsPreventQuickSuggestions:!1,localityBonus:!1,shareSuggestSelections:!1,selectionMode:"always",showIcons:!0,showStatusBar:!1,preview:!1,previewMode:"subwordSmart",showInlineDetails:!0,showMethods:!0,showFunctions:!0,showConstructors:!0,showDeprecated:!0,matchOnWordStartOnly:!0,showFields:!0,showVariables:!0,showClasses:!0,showStructs:!0,showInterfaces:!0,showModules:!0,showProperties:!0,showEvents:!0,showOperators:!0,showUnits:!0,showValues:!0,showConstants:!0,showEnums:!0,showEnumMembers:!0,showKeywords:!0,showWords:!0,showColors:!0,showFiles:!0,showReferences:!0,showFolders:!0,showTypeParameters:!0,showSnippets:!0,showUsers:!0,showIssues:!0};super(118,"suggest",e,{"editor.suggest.insertMode":{type:"string",enum:["insert","replace"],enumDescriptions:[p("suggest.insertMode.insert","Insert suggestion without overwriting text right of the cursor."),p("suggest.insertMode.replace","Insert suggestion and overwrite text right of the cursor.")],default:e.insertMode,description:p("suggest.insertMode","Controls whether words are overwritten when accepting completions. Note that this depends on extensions opting into this feature.")},"editor.suggest.filterGraceful":{type:"boolean",default:e.filterGraceful,description:p("suggest.filterGraceful","Controls whether filtering and sorting suggestions accounts for small typos.")},"editor.suggest.localityBonus":{type:"boolean",default:e.localityBonus,description:p("suggest.localityBonus","Controls whether sorting favors words that appear close to the cursor.")},"editor.suggest.shareSuggestSelections":{type:"boolean",default:e.shareSuggestSelections,markdownDescription:p("suggest.shareSuggestSelections","Controls whether remembered suggestion selections are shared between multiple workspaces and windows (needs `#editor.suggestSelection#`).")},"editor.suggest.selectionMode":{type:"string",enum:["always","never","whenTriggerCharacter","whenQuickSuggestion"],enumDescriptions:[p("suggest.insertMode.always","Always select a suggestion when automatically triggering IntelliSense."),p("suggest.insertMode.never","Never select a suggestion when automatically triggering IntelliSense."),p("suggest.insertMode.whenTriggerCharacter","Select a suggestion only when triggering IntelliSense from a trigger character."),p("suggest.insertMode.whenQuickSuggestion","Select a suggestion only when triggering IntelliSense as you type.")],default:e.selectionMode,markdownDescription:p("suggest.selectionMode","Controls whether a suggestion is selected when the widget shows. Note that this only applies to automatically triggered suggestions (`#editor.quickSuggestions#` and `#editor.suggestOnTriggerCharacters#`) and that a suggestion is always selected when explicitly invoked, e.g via `Ctrl+Space`.")},"editor.suggest.snippetsPreventQuickSuggestions":{type:"boolean",default:e.snippetsPreventQuickSuggestions,description:p("suggest.snippetsPreventQuickSuggestions","Controls whether an active snippet prevents quick suggestions.")},"editor.suggest.showIcons":{type:"boolean",default:e.showIcons,description:p("suggest.showIcons","Controls whether to show or hide icons in suggestions.")},"editor.suggest.showStatusBar":{type:"boolean",default:e.showStatusBar,description:p("suggest.showStatusBar","Controls the visibility of the status bar at the bottom of the suggest widget.")},"editor.suggest.preview":{type:"boolean",default:e.preview,description:p("suggest.preview","Controls whether to preview the suggestion outcome in the editor.")},"editor.suggest.showInlineDetails":{type:"boolean",default:e.showInlineDetails,description:p("suggest.showInlineDetails","Controls whether suggest details show inline with the label or only in the details widget.")},"editor.suggest.maxVisibleSuggestions":{type:"number",deprecationMessage:p("suggest.maxVisibleSuggestions.dep","This setting is deprecated. The suggest widget can now be resized.")},"editor.suggest.filteredTypes":{type:"object",deprecationMessage:p("deprecated","This setting is deprecated, please use separate settings like 'editor.suggest.showKeywords' or 'editor.suggest.showSnippets' instead.")},"editor.suggest.showMethods":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showMethods","When enabled IntelliSense shows `method`-suggestions.")},"editor.suggest.showFunctions":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showFunctions","When enabled IntelliSense shows `function`-suggestions.")},"editor.suggest.showConstructors":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showConstructors","When enabled IntelliSense shows `constructor`-suggestions.")},"editor.suggest.showDeprecated":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showDeprecated","When enabled IntelliSense shows `deprecated`-suggestions.")},"editor.suggest.matchOnWordStartOnly":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.matchOnWordStartOnly","When enabled IntelliSense filtering requires that the first character matches on a word start. For example, `c` on `Console` or `WebContext` but _not_ on `description`. When disabled IntelliSense will show more results but still sorts them by match quality.")},"editor.suggest.showFields":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showFields","When enabled IntelliSense shows `field`-suggestions.")},"editor.suggest.showVariables":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showVariables","When enabled IntelliSense shows `variable`-suggestions.")},"editor.suggest.showClasses":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showClasss","When enabled IntelliSense shows `class`-suggestions.")},"editor.suggest.showStructs":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showStructs","When enabled IntelliSense shows `struct`-suggestions.")},"editor.suggest.showInterfaces":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showInterfaces","When enabled IntelliSense shows `interface`-suggestions.")},"editor.suggest.showModules":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showModules","When enabled IntelliSense shows `module`-suggestions.")},"editor.suggest.showProperties":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showPropertys","When enabled IntelliSense shows `property`-suggestions.")},"editor.suggest.showEvents":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showEvents","When enabled IntelliSense shows `event`-suggestions.")},"editor.suggest.showOperators":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showOperators","When enabled IntelliSense shows `operator`-suggestions.")},"editor.suggest.showUnits":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showUnits","When enabled IntelliSense shows `unit`-suggestions.")},"editor.suggest.showValues":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showValues","When enabled IntelliSense shows `value`-suggestions.")},"editor.suggest.showConstants":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showConstants","When enabled IntelliSense shows `constant`-suggestions.")},"editor.suggest.showEnums":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showEnums","When enabled IntelliSense shows `enum`-suggestions.")},"editor.suggest.showEnumMembers":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showEnumMembers","When enabled IntelliSense shows `enumMember`-suggestions.")},"editor.suggest.showKeywords":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showKeywords","When enabled IntelliSense shows `keyword`-suggestions.")},"editor.suggest.showWords":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showTexts","When enabled IntelliSense shows `text`-suggestions.")},"editor.suggest.showColors":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showColors","When enabled IntelliSense shows `color`-suggestions.")},"editor.suggest.showFiles":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showFiles","When enabled IntelliSense shows `file`-suggestions.")},"editor.suggest.showReferences":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showReferences","When enabled IntelliSense shows `reference`-suggestions.")},"editor.suggest.showCustomcolors":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showCustomcolors","When enabled IntelliSense shows `customcolor`-suggestions.")},"editor.suggest.showFolders":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showFolders","When enabled IntelliSense shows `folder`-suggestions.")},"editor.suggest.showTypeParameters":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showTypeParameters","When enabled IntelliSense shows `typeParameter`-suggestions.")},"editor.suggest.showSnippets":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showSnippets","When enabled IntelliSense shows `snippet`-suggestions.")},"editor.suggest.showUsers":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showUsers","When enabled IntelliSense shows `user`-suggestions.")},"editor.suggest.showIssues":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showIssues","When enabled IntelliSense shows `issues`-suggestions.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{insertMode:Ii(t.insertMode,this.defaultValue.insertMode,["insert","replace"]),filterGraceful:xe(t.filterGraceful,this.defaultValue.filterGraceful),snippetsPreventQuickSuggestions:xe(t.snippetsPreventQuickSuggestions,this.defaultValue.filterGraceful),localityBonus:xe(t.localityBonus,this.defaultValue.localityBonus),shareSuggestSelections:xe(t.shareSuggestSelections,this.defaultValue.shareSuggestSelections),selectionMode:Ii(t.selectionMode,this.defaultValue.selectionMode,["always","never","whenQuickSuggestion","whenTriggerCharacter"]),showIcons:xe(t.showIcons,this.defaultValue.showIcons),showStatusBar:xe(t.showStatusBar,this.defaultValue.showStatusBar),preview:xe(t.preview,this.defaultValue.preview),previewMode:Ii(t.previewMode,this.defaultValue.previewMode,["prefix","subword","subwordSmart"]),showInlineDetails:xe(t.showInlineDetails,this.defaultValue.showInlineDetails),showMethods:xe(t.showMethods,this.defaultValue.showMethods),showFunctions:xe(t.showFunctions,this.defaultValue.showFunctions),showConstructors:xe(t.showConstructors,this.defaultValue.showConstructors),showDeprecated:xe(t.showDeprecated,this.defaultValue.showDeprecated),matchOnWordStartOnly:xe(t.matchOnWordStartOnly,this.defaultValue.matchOnWordStartOnly),showFields:xe(t.showFields,this.defaultValue.showFields),showVariables:xe(t.showVariables,this.defaultValue.showVariables),showClasses:xe(t.showClasses,this.defaultValue.showClasses),showStructs:xe(t.showStructs,this.defaultValue.showStructs),showInterfaces:xe(t.showInterfaces,this.defaultValue.showInterfaces),showModules:xe(t.showModules,this.defaultValue.showModules),showProperties:xe(t.showProperties,this.defaultValue.showProperties),showEvents:xe(t.showEvents,this.defaultValue.showEvents),showOperators:xe(t.showOperators,this.defaultValue.showOperators),showUnits:xe(t.showUnits,this.defaultValue.showUnits),showValues:xe(t.showValues,this.defaultValue.showValues),showConstants:xe(t.showConstants,this.defaultValue.showConstants),showEnums:xe(t.showEnums,this.defaultValue.showEnums),showEnumMembers:xe(t.showEnumMembers,this.defaultValue.showEnumMembers),showKeywords:xe(t.showKeywords,this.defaultValue.showKeywords),showWords:xe(t.showWords,this.defaultValue.showWords),showColors:xe(t.showColors,this.defaultValue.showColors),showFiles:xe(t.showFiles,this.defaultValue.showFiles),showReferences:xe(t.showReferences,this.defaultValue.showReferences),showFolders:xe(t.showFolders,this.defaultValue.showFolders),showTypeParameters:xe(t.showTypeParameters,this.defaultValue.showTypeParameters),showSnippets:xe(t.showSnippets,this.defaultValue.showSnippets),showUsers:xe(t.showUsers,this.defaultValue.showUsers),showIssues:xe(t.showIssues,this.defaultValue.showIssues)}}}class Ioe extends hi{constructor(){super(113,"smartSelect",{selectLeadingAndTrailingWhitespace:!0,selectSubwords:!0},{"editor.smartSelect.selectLeadingAndTrailingWhitespace":{description:p("selectLeadingAndTrailingWhitespace","Whether leading and trailing whitespace should always be selected."),default:!0,type:"boolean"},"editor.smartSelect.selectSubwords":{description:p("selectSubwords","Whether subwords (like 'foo' in 'fooBar' or 'foo_bar') should be selected."),default:!0,type:"boolean"}})}validate(e){return!e||typeof e!="object"?this.defaultValue:{selectLeadingAndTrailingWhitespace:xe(e.selectLeadingAndTrailingWhitespace,this.defaultValue.selectLeadingAndTrailingWhitespace),selectSubwords:xe(e.selectSubwords,this.defaultValue.selectSubwords)}}}class Toe extends hi{constructor(){const e=[];super(130,"wordSegmenterLocales",e,{anyOf:[{description:p("wordSegmenterLocales","Locales to be used for word segmentation when doing word related navigations or operations. Specify the BCP 47 language tag of the word you wish to recognize (e.g., ja, zh-CN, zh-Hant-TW, etc.)."),type:"string"},{description:p("wordSegmenterLocales","Locales to be used for word segmentation when doing word related navigations or operations. Specify the BCP 47 language tag of the word you wish to recognize (e.g., ja, zh-CN, zh-Hant-TW, etc.)."),type:"array",items:{type:"string"}}]})}validate(e){if(typeof e=="string"&&(e=[e]),Array.isArray(e)){const t=[];for(const i of e)if(typeof i=="string")try{Intl.Segmenter.supportedLocalesOf(i).length>0&&t.push(i)}catch{}return t}return this.defaultValue}}class Noe extends hi{constructor(){super(138,"wrappingIndent",1,{"editor.wrappingIndent":{type:"string",enum:["none","same","indent","deepIndent"],enumDescriptions:[p("wrappingIndent.none","No indentation. Wrapped lines begin at column 1."),p("wrappingIndent.same","Wrapped lines get the same indentation as the parent."),p("wrappingIndent.indent","Wrapped lines get +1 indentation toward the parent."),p("wrappingIndent.deepIndent","Wrapped lines get +2 indentation toward the parent.")],description:p("wrappingIndent","Controls the indentation of wrapped lines."),default:"same"}})}validate(e){switch(e){case"none":return 0;case"same":return 1;case"indent":return 2;case"deepIndent":return 3}return 1}compute(e,t,i){return t.get(2)===2?0:i}}class Aoe extends a1{constructor(){super(146)}compute(e,t,i){const n=t.get(145);return{isDominatedByLongLines:e.isDominatedByLongLines,isWordWrapMinified:n.isWordWrapMinified,isViewportWrapping:n.isViewportWrapping,wrappingColumn:n.wrappingColumn}}}class Moe extends hi{constructor(){const e={enabled:!0,showDropSelector:"afterDrop"};super(36,"dropIntoEditor",e,{"editor.dropIntoEditor.enabled":{type:"boolean",default:e.enabled,markdownDescription:p("dropIntoEditor.enabled","Controls whether you can drag and drop a file into a text editor by holding down the `Shift` key (instead of opening the file in an editor).")},"editor.dropIntoEditor.showDropSelector":{type:"string",markdownDescription:p("dropIntoEditor.showDropSelector","Controls if a widget is shown when dropping files into the editor. This widget lets you control how the file is dropped."),enum:["afterDrop","never"],enumDescriptions:[p("dropIntoEditor.showDropSelector.afterDrop","Show the drop selector widget after a file is dropped into the editor."),p("dropIntoEditor.showDropSelector.never","Never show the drop selector widget. Instead the default drop provider is always used.")],default:"afterDrop"}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:xe(t.enabled,this.defaultValue.enabled),showDropSelector:Ii(t.showDropSelector,this.defaultValue.showDropSelector,["afterDrop","never"])}}}class Roe extends hi{constructor(){const e={enabled:!0,showPasteSelector:"afterPaste"};super(85,"pasteAs",e,{"editor.pasteAs.enabled":{type:"boolean",default:e.enabled,markdownDescription:p("pasteAs.enabled","Controls whether you can paste content in different ways.")},"editor.pasteAs.showPasteSelector":{type:"string",markdownDescription:p("pasteAs.showPasteSelector","Controls if a widget is shown when pasting content in to the editor. This widget lets you control how the file is pasted."),enum:["afterPaste","never"],enumDescriptions:[p("pasteAs.showPasteSelector.afterPaste","Show the paste selector widget after content is pasted into the editor."),p("pasteAs.showPasteSelector.never","Never show the paste selector widget. Instead the default pasting behavior is always used.")],default:"afterPaste"}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:xe(t.enabled,this.defaultValue.enabled),showPasteSelector:Ii(t.showPasteSelector,this.defaultValue.showPasteSelector,["afterPaste","never"])}}}const Poe="Consolas, 'Courier New', monospace",Foe="Menlo, Monaco, 'Courier New', monospace",Ooe="'Droid Sans Mono', 'monospace', monospace",co={fontFamily:lt?Foe:$s?Ooe:Poe,fontWeight:"normal",fontSize:lt?12:14,lineHeight:0,letterSpacing:0},Jp=[];function ie(s){return Jp[s.id]=s,s}const hl={acceptSuggestionOnCommitCharacter:ie(new Ct(0,"acceptSuggestionOnCommitCharacter",!0,{markdownDescription:p("acceptSuggestionOnCommitCharacter","Controls whether suggestions should be accepted on commit characters. For example, in JavaScript, the semi-colon (`;`) can be a commit character that accepts a suggestion and types that character.")})),acceptSuggestionOnEnter:ie(new yi(1,"acceptSuggestionOnEnter","on",["on","smart","off"],{markdownEnumDescriptions:["",p("acceptSuggestionOnEnterSmart","Only accept a suggestion with `Enter` when it makes a textual change."),""],markdownDescription:p("acceptSuggestionOnEnter","Controls whether suggestions should be accepted on `Enter`, in addition to `Tab`. Helps to avoid ambiguity between inserting new lines or accepting suggestions.")})),accessibilitySupport:ie(new Xse),accessibilityPageSize:ie(new zt(3,"accessibilityPageSize",10,1,1073741824,{description:p("accessibilityPageSize","Controls the number of lines in the editor that can be read out by a screen reader at once. When we detect a screen reader we automatically set the default to be 500. Warning: this has a performance implication for numbers larger than the default."),tags:["accessibility"]})),ariaLabel:ie(new ks(4,"ariaLabel",p("editorViewAccessibleLabel","Editor content"))),ariaRequired:ie(new Ct(5,"ariaRequired",!1,void 0)),screenReaderAnnounceInlineSuggestion:ie(new Ct(8,"screenReaderAnnounceInlineSuggestion",!0,{description:p("screenReaderAnnounceInlineSuggestion","Control whether inline suggestions are announced by a screen reader."),tags:["accessibility"]})),autoClosingBrackets:ie(new yi(6,"autoClosingBrackets","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",p("editor.autoClosingBrackets.languageDefined","Use language configurations to determine when to autoclose brackets."),p("editor.autoClosingBrackets.beforeWhitespace","Autoclose brackets only when the cursor is to the left of whitespace."),""],description:p("autoClosingBrackets","Controls whether the editor should automatically close brackets after the user adds an opening bracket.")})),autoClosingComments:ie(new yi(7,"autoClosingComments","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",p("editor.autoClosingComments.languageDefined","Use language configurations to determine when to autoclose comments."),p("editor.autoClosingComments.beforeWhitespace","Autoclose comments only when the cursor is to the left of whitespace."),""],description:p("autoClosingComments","Controls whether the editor should automatically close comments after the user adds an opening comment.")})),autoClosingDelete:ie(new yi(9,"autoClosingDelete","auto",["always","auto","never"],{enumDescriptions:["",p("editor.autoClosingDelete.auto","Remove adjacent closing quotes or brackets only if they were automatically inserted."),""],description:p("autoClosingDelete","Controls whether the editor should remove adjacent closing quotes or brackets when deleting.")})),autoClosingOvertype:ie(new yi(10,"autoClosingOvertype","auto",["always","auto","never"],{enumDescriptions:["",p("editor.autoClosingOvertype.auto","Type over closing quotes or brackets only if they were automatically inserted."),""],description:p("autoClosingOvertype","Controls whether the editor should type over closing quotes or brackets.")})),autoClosingQuotes:ie(new yi(11,"autoClosingQuotes","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",p("editor.autoClosingQuotes.languageDefined","Use language configurations to determine when to autoclose quotes."),p("editor.autoClosingQuotes.beforeWhitespace","Autoclose quotes only when the cursor is to the left of whitespace."),""],description:p("autoClosingQuotes","Controls whether the editor should automatically close quotes after the user adds an opening quote.")})),autoIndent:ie(new dw(12,"autoIndent",4,"full",["none","keep","brackets","advanced","full"],Zse,{enumDescriptions:[p("editor.autoIndent.none","The editor will not insert indentation automatically."),p("editor.autoIndent.keep","The editor will keep the current line's indentation."),p("editor.autoIndent.brackets","The editor will keep the current line's indentation and honor language defined brackets."),p("editor.autoIndent.advanced","The editor will keep the current line's indentation, honor language defined brackets and invoke special onEnterRules defined by languages."),p("editor.autoIndent.full","The editor will keep the current line's indentation, honor language defined brackets, invoke special onEnterRules defined by languages, and honor indentationRules defined by languages.")],description:p("autoIndent","Controls whether the editor should automatically adjust the indentation when users type, paste, move or indent lines.")})),automaticLayout:ie(new Ct(13,"automaticLayout",!1)),autoSurround:ie(new yi(14,"autoSurround","languageDefined",["languageDefined","quotes","brackets","never"],{enumDescriptions:[p("editor.autoSurround.languageDefined","Use language configurations to determine when to automatically surround selections."),p("editor.autoSurround.quotes","Surround with quotes but not brackets."),p("editor.autoSurround.brackets","Surround with brackets but not quotes."),""],description:p("autoSurround","Controls whether the editor should automatically surround selections when typing quotes or brackets.")})),bracketPairColorization:ie(new xoe),bracketPairGuides:ie(new koe),stickyTabStops:ie(new Ct(116,"stickyTabStops",!1,{description:p("stickyTabStops","Emulate selection behavior of tab characters when using spaces for indentation. Selection will stick to tab stops.")})),codeLens:ie(new Ct(17,"codeLens",!0,{description:p("codeLens","Controls whether the editor shows CodeLens.")})),codeLensFontFamily:ie(new ks(18,"codeLensFontFamily","",{description:p("codeLensFontFamily","Controls the font family for CodeLens.")})),codeLensFontSize:ie(new zt(19,"codeLensFontSize",0,0,100,{type:"number",default:0,minimum:0,maximum:100,markdownDescription:p("codeLensFontSize","Controls the font size in pixels for CodeLens. When set to 0, 90% of `#editor.fontSize#` is used.")})),colorDecorators:ie(new Ct(20,"colorDecorators",!0,{description:p("colorDecorators","Controls whether the editor should render the inline color decorators and color picker.")})),colorDecoratorActivatedOn:ie(new yi(148,"colorDecoratorsActivatedOn","clickAndHover",["clickAndHover","hover","click"],{enumDescriptions:[p("editor.colorDecoratorActivatedOn.clickAndHover","Make the color picker appear both on click and hover of the color decorator"),p("editor.colorDecoratorActivatedOn.hover","Make the color picker appear on hover of the color decorator"),p("editor.colorDecoratorActivatedOn.click","Make the color picker appear on click of the color decorator")],description:p("colorDecoratorActivatedOn","Controls the condition to make a color picker appear from a color decorator")})),colorDecoratorsLimit:ie(new zt(21,"colorDecoratorsLimit",500,1,1e6,{markdownDescription:p("colorDecoratorsLimit","Controls the max number of color decorators that can be rendered in an editor at once.")})),columnSelection:ie(new Ct(22,"columnSelection",!1,{description:p("columnSelection","Enable that the selection with the mouse and keys is doing column selection.")})),comments:ie(new Yse),contextmenu:ie(new Ct(24,"contextmenu",!0)),copyWithSyntaxHighlighting:ie(new Ct(25,"copyWithSyntaxHighlighting",!0,{description:p("copyWithSyntaxHighlighting","Controls whether syntax highlighting should be copied into the clipboard.")})),cursorBlinking:ie(new dw(26,"cursorBlinking",1,"blink",["blink","smooth","phase","expand","solid"],Qse,{description:p("cursorBlinking","Control the cursor animation style.")})),cursorSmoothCaretAnimation:ie(new yi(27,"cursorSmoothCaretAnimation","off",["off","explicit","on"],{enumDescriptions:[p("cursorSmoothCaretAnimation.off","Smooth caret animation is disabled."),p("cursorSmoothCaretAnimation.explicit","Smooth caret animation is enabled only when the user moves the cursor with an explicit gesture."),p("cursorSmoothCaretAnimation.on","Smooth caret animation is always enabled.")],description:p("cursorSmoothCaretAnimation","Controls whether the smooth caret animation should be enabled.")})),cursorStyle:ie(new dw(28,"cursorStyle",Hn.Line,"line",["line","block","underline","line-thin","block-outline","underline-thin"],Jse,{description:p("cursorStyle","Controls the cursor style.")})),cursorSurroundingLines:ie(new zt(29,"cursorSurroundingLines",0,0,1073741824,{description:p("cursorSurroundingLines","Controls the minimal number of visible leading lines (minimum 0) and trailing lines (minimum 1) surrounding the cursor. Known as 'scrollOff' or 'scrollOffset' in some other editors.")})),cursorSurroundingLinesStyle:ie(new yi(30,"cursorSurroundingLinesStyle","default",["default","all"],{enumDescriptions:[p("cursorSurroundingLinesStyle.default","`cursorSurroundingLines` is enforced only when triggered via the keyboard or API."),p("cursorSurroundingLinesStyle.all","`cursorSurroundingLines` is enforced always.")],markdownDescription:p("cursorSurroundingLinesStyle","Controls when `#editor.cursorSurroundingLines#` should be enforced.")})),cursorWidth:ie(new zt(31,"cursorWidth",0,0,1073741824,{markdownDescription:p("cursorWidth","Controls the width of the cursor when `#editor.cursorStyle#` is set to `line`.")})),disableLayerHinting:ie(new Ct(32,"disableLayerHinting",!1)),disableMonospaceOptimizations:ie(new Ct(33,"disableMonospaceOptimizations",!1)),domReadOnly:ie(new Ct(34,"domReadOnly",!1)),dragAndDrop:ie(new Ct(35,"dragAndDrop",!0,{description:p("dragAndDrop","Controls whether the editor should allow moving selections via drag and drop.")})),emptySelectionClipboard:ie(new toe),dropIntoEditor:ie(new Moe),stickyScroll:ie(new doe),experimentalWhitespaceRendering:ie(new yi(38,"experimentalWhitespaceRendering","svg",["svg","font","off"],{enumDescriptions:[p("experimentalWhitespaceRendering.svg","Use a new rendering method with svgs."),p("experimentalWhitespaceRendering.font","Use a new rendering method with font characters."),p("experimentalWhitespaceRendering.off","Use the stable rendering method.")],description:p("experimentalWhitespaceRendering","Controls whether whitespace is rendered with a new, experimental method.")})),extraEditorClassName:ie(new ks(39,"extraEditorClassName","")),fastScrollSensitivity:ie(new kr(40,"fastScrollSensitivity",5,s=>s<=0?5:s,{markdownDescription:p("fastScrollSensitivity","Scrolling speed multiplier when pressing `Alt`.")})),find:ie(new ioe),fixedOverflowWidgets:ie(new Ct(42,"fixedOverflowWidgets",!1)),folding:ie(new Ct(43,"folding",!0,{description:p("folding","Controls whether the editor has code folding enabled.")})),foldingStrategy:ie(new yi(44,"foldingStrategy","auto",["auto","indentation"],{enumDescriptions:[p("foldingStrategy.auto","Use a language-specific folding strategy if available, else the indentation-based one."),p("foldingStrategy.indentation","Use the indentation-based folding strategy.")],description:p("foldingStrategy","Controls the strategy for computing folding ranges.")})),foldingHighlight:ie(new Ct(45,"foldingHighlight",!0,{description:p("foldingHighlight","Controls whether the editor should highlight folded ranges.")})),foldingImportsByDefault:ie(new Ct(46,"foldingImportsByDefault",!1,{description:p("foldingImportsByDefault","Controls whether the editor automatically collapses import ranges.")})),foldingMaximumRegions:ie(new zt(47,"foldingMaximumRegions",5e3,10,65e3,{description:p("foldingMaximumRegions","The maximum number of foldable regions. Increasing this value may result in the editor becoming less responsive when the current source has a large number of foldable regions.")})),unfoldOnClickAfterEndOfLine:ie(new Ct(48,"unfoldOnClickAfterEndOfLine",!1,{description:p("unfoldOnClickAfterEndOfLine","Controls whether clicking on the empty content after a folded line will unfold the line.")})),fontFamily:ie(new ks(49,"fontFamily",co.fontFamily,{description:p("fontFamily","Controls the font family.")})),fontInfo:ie(new noe),fontLigatures2:ie(new Zo),fontSize:ie(new soe),fontWeight:ie(new Vl),fontVariations:ie(new $a),formatOnPaste:ie(new Ct(55,"formatOnPaste",!1,{description:p("formatOnPaste","Controls whether the editor should automatically format the pasted content. A formatter must be available and the formatter should be able to format a range in a document.")})),formatOnType:ie(new Ct(56,"formatOnType",!1,{description:p("formatOnType","Controls whether the editor should automatically format the line after typing.")})),glyphMargin:ie(new Ct(57,"glyphMargin",!0,{description:p("glyphMargin","Controls whether the editor should render the vertical glyph margin. Glyph margin is mostly used for debugging.")})),gotoLocation:ie(new ooe),hideCursorInOverviewRuler:ie(new Ct(59,"hideCursorInOverviewRuler",!1,{description:p("hideCursorInOverviewRuler","Controls whether the cursor should be hidden in the overview ruler.")})),hover:ie(new roe),inDiffEditor:ie(new Ct(61,"inDiffEditor",!1)),letterSpacing:ie(new kr(64,"letterSpacing",co.letterSpacing,s=>kr.clamp(s,-5,20),{description:p("letterSpacing","Controls the letter spacing in pixels.")})),lightbulb:ie(new loe),lineDecorationsWidth:ie(new uoe),lineHeight:ie(new hoe),lineNumbers:ie(new boe),lineNumbersMinChars:ie(new zt(69,"lineNumbersMinChars",5,1,300)),linkedEditing:ie(new Ct(70,"linkedEditing",!1,{description:p("linkedEditing","Controls whether the editor has linked editing enabled. Depending on the language, related symbols such as HTML tags, are updated while editing.")})),links:ie(new Ct(71,"links",!0,{description:p("links","Controls whether the editor should detect links and make them clickable.")})),matchBrackets:ie(new yi(72,"matchBrackets","always",["always","near","never"],{description:p("matchBrackets","Highlight matching brackets.")})),minimap:ie(new goe),mouseStyle:ie(new yi(74,"mouseStyle","text",["text","default","copy"])),mouseWheelScrollSensitivity:ie(new kr(75,"mouseWheelScrollSensitivity",1,s=>s===0?1:s,{markdownDescription:p("mouseWheelScrollSensitivity","A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.")})),mouseWheelZoom:ie(new Ct(76,"mouseWheelZoom",!1,{markdownDescription:lt?p("mouseWheelZoom.mac","Zoom the font of the editor when using mouse wheel and holding `Cmd`."):p("mouseWheelZoom","Zoom the font of the editor when using mouse wheel and holding `Ctrl`.")})),multiCursorMergeOverlapping:ie(new Ct(77,"multiCursorMergeOverlapping",!0,{description:p("multiCursorMergeOverlapping","Merge multiple cursors when they are overlapping.")})),multiCursorModifier:ie(new dw(78,"multiCursorModifier","altKey","alt",["ctrlCmd","alt"],foe,{markdownEnumDescriptions:[p("multiCursorModifier.ctrlCmd","Maps to `Control` on Windows and Linux and to `Command` on macOS."),p("multiCursorModifier.alt","Maps to `Alt` on Windows and Linux and to `Option` on macOS.")],markdownDescription:p({},"The modifier to be used to add multiple cursors with the mouse. The Go to Definition and Open Link mouse gestures will adapt such that they do not conflict with the [multicursor modifier](https://code.visualstudio.com/docs/editor/codebasics#_multicursor-modifier).")})),multiCursorPaste:ie(new yi(79,"multiCursorPaste","spread",["spread","full"],{markdownEnumDescriptions:[p("multiCursorPaste.spread","Each cursor pastes a single line of the text."),p("multiCursorPaste.full","Each cursor pastes the full text.")],markdownDescription:p("multiCursorPaste","Controls pasting when the line count of the pasted text matches the cursor count.")})),multiCursorLimit:ie(new zt(80,"multiCursorLimit",1e4,1,1e5,{markdownDescription:p("multiCursorLimit","Controls the max number of cursors that can be in an active editor at once.")})),occurrencesHighlight:ie(new yi(81,"occurrencesHighlight","singleFile",["off","singleFile","multiFile"],{markdownEnumDescriptions:[p("occurrencesHighlight.off","Does not highlight occurrences."),p("occurrencesHighlight.singleFile","Highlights occurrences only in the current file."),p("occurrencesHighlight.multiFile","Experimental: Highlights occurrences across all valid open files.")],markdownDescription:p("occurrencesHighlight","Controls whether occurrences should be highlighted across open files.")})),overviewRulerBorder:ie(new Ct(82,"overviewRulerBorder",!0,{description:p("overviewRulerBorder","Controls whether a border should be drawn around the overview ruler.")})),overviewRulerLanes:ie(new zt(83,"overviewRulerLanes",3,0,3)),padding:ie(new poe),pasteAs:ie(new Roe),parameterHints:ie(new moe),peekWidgetDefaultFocus:ie(new yi(87,"peekWidgetDefaultFocus","tree",["tree","editor"],{enumDescriptions:[p("peekWidgetDefaultFocus.tree","Focus the tree when opening peek"),p("peekWidgetDefaultFocus.editor","Focus the editor when opening peek")],description:p("peekWidgetDefaultFocus","Controls whether to focus the inline editor or the tree in the peek widget.")})),definitionLinkOpensInPeek:ie(new Ct(88,"definitionLinkOpensInPeek",!1,{description:p("definitionLinkOpensInPeek","Controls whether the Go to Definition mouse gesture always opens the peek widget.")})),quickSuggestions:ie(new voe),quickSuggestionsDelay:ie(new zt(90,"quickSuggestionsDelay",10,0,1073741824,{description:p("quickSuggestionsDelay","Controls the delay in milliseconds after which quick suggestions will show up.")})),readOnly:ie(new Ct(91,"readOnly",!1)),readOnlyMessage:ie(new woe),renameOnType:ie(new Ct(93,"renameOnType",!1,{description:p("renameOnType","Controls whether the editor auto renames on type."),markdownDeprecationMessage:p("renameOnTypeDeprecate","Deprecated, use `editor.linkedEditing` instead.")})),renderControlCharacters:ie(new Ct(94,"renderControlCharacters",!0,{description:p("renderControlCharacters","Controls whether the editor should render control characters."),restricted:!0})),renderFinalNewline:ie(new yi(95,"renderFinalNewline",$s?"dimmed":"on",["off","on","dimmed"],{description:p("renderFinalNewline","Render last line number when the file ends with a newline.")})),renderLineHighlight:ie(new yi(96,"renderLineHighlight","line",["none","gutter","line","all"],{enumDescriptions:["","","",p("renderLineHighlight.all","Highlights both the gutter and the current line.")],description:p("renderLineHighlight","Controls how the editor should render the current line highlight.")})),renderLineHighlightOnlyWhenFocus:ie(new Ct(97,"renderLineHighlightOnlyWhenFocus",!1,{description:p("renderLineHighlightOnlyWhenFocus","Controls if the editor should render the current line highlight only when the editor is focused.")})),renderValidationDecorations:ie(new yi(98,"renderValidationDecorations","editable",["editable","on","off"])),renderWhitespace:ie(new yi(99,"renderWhitespace","selection",["none","boundary","selection","trailing","all"],{enumDescriptions:["",p("renderWhitespace.boundary","Render whitespace characters except for single spaces between words."),p("renderWhitespace.selection","Render whitespace characters only on selected text."),p("renderWhitespace.trailing","Render only trailing whitespace characters."),""],description:p("renderWhitespace","Controls how the editor should render whitespace characters.")})),revealHorizontalRightPadding:ie(new zt(100,"revealHorizontalRightPadding",15,0,1e3)),roundedSelection:ie(new Ct(101,"roundedSelection",!0,{description:p("roundedSelection","Controls whether selections should have rounded corners.")})),rulers:ie(new Coe),scrollbar:ie(new yoe),scrollBeyondLastColumn:ie(new zt(104,"scrollBeyondLastColumn",4,0,1073741824,{description:p("scrollBeyondLastColumn","Controls the number of extra characters beyond which the editor will scroll horizontally.")})),scrollBeyondLastLine:ie(new Ct(105,"scrollBeyondLastLine",!0,{description:p("scrollBeyondLastLine","Controls whether the editor will scroll beyond the last line.")})),scrollPredominantAxis:ie(new Ct(106,"scrollPredominantAxis",!0,{description:p("scrollPredominantAxis","Scroll only along the predominant axis when scrolling both vertically and horizontally at the same time. Prevents horizontal drift when scrolling vertically on a trackpad.")})),selectionClipboard:ie(new Ct(107,"selectionClipboard",!0,{description:p("selectionClipboard","Controls whether the Linux primary clipboard should be supported."),included:$s})),selectionHighlight:ie(new Ct(108,"selectionHighlight",!0,{description:p("selectionHighlight","Controls whether the editor should highlight matches similar to the selection.")})),selectOnLineNumbers:ie(new Ct(109,"selectOnLineNumbers",!0)),showFoldingControls:ie(new yi(110,"showFoldingControls","mouseover",["always","never","mouseover"],{enumDescriptions:[p("showFoldingControls.always","Always show the folding controls."),p("showFoldingControls.never","Never show the folding controls and reduce the gutter size."),p("showFoldingControls.mouseover","Only show the folding controls when the mouse is over the gutter.")],description:p("showFoldingControls","Controls when the folding controls on the gutter are shown.")})),showUnused:ie(new Ct(111,"showUnused",!0,{description:p("showUnused","Controls fading out of unused code.")})),showDeprecated:ie(new Ct(140,"showDeprecated",!0,{description:p("showDeprecated","Controls strikethrough deprecated variables.")})),inlayHints:ie(new coe),snippetSuggestions:ie(new yi(112,"snippetSuggestions","inline",["top","bottom","inline","none"],{enumDescriptions:[p("snippetSuggestions.top","Show snippet suggestions on top of other suggestions."),p("snippetSuggestions.bottom","Show snippet suggestions below other suggestions."),p("snippetSuggestions.inline","Show snippets suggestions with other suggestions."),p("snippetSuggestions.none","Do not show snippet suggestions.")],description:p("snippetSuggestions","Controls whether snippets are shown with other suggestions and how they are sorted.")})),smartSelect:ie(new Ioe),smoothScrolling:ie(new Ct(114,"smoothScrolling",!1,{description:p("smoothScrolling","Controls whether the editor will scroll using an animation.")})),stopRenderingLineAfter:ie(new zt(117,"stopRenderingLineAfter",1e4,-1,1073741824)),suggest:ie(new Eoe),inlineSuggest:ie(new Doe),inlineEdit:ie(new Loe),inlineCompletionsAccessibilityVerbose:ie(new Ct(149,"inlineCompletionsAccessibilityVerbose",!1,{description:p("inlineCompletionsAccessibilityVerbose","Controls whether the accessibility hint should be provided to screen reader users when an inline completion is shown.")})),suggestFontSize:ie(new zt(119,"suggestFontSize",0,0,1e3,{markdownDescription:p("suggestFontSize","Font size for the suggest widget. When set to {0}, the value of {1} is used.","`0`","`#editor.fontSize#`")})),suggestLineHeight:ie(new zt(120,"suggestLineHeight",0,0,1e3,{markdownDescription:p("suggestLineHeight","Line height for the suggest widget. When set to {0}, the value of {1} is used. The minimum value is 8.","`0`","`#editor.lineHeight#`")})),suggestOnTriggerCharacters:ie(new Ct(121,"suggestOnTriggerCharacters",!0,{description:p("suggestOnTriggerCharacters","Controls whether suggestions should automatically show up when typing trigger characters.")})),suggestSelection:ie(new yi(122,"suggestSelection","first",["first","recentlyUsed","recentlyUsedByPrefix"],{markdownEnumDescriptions:[p("suggestSelection.first","Always select the first suggestion."),p("suggestSelection.recentlyUsed","Select recent suggestions unless further typing selects one, e.g. `console.| -> console.log` because `log` has been completed recently."),p("suggestSelection.recentlyUsedByPrefix","Select suggestions based on previous prefixes that have completed those suggestions, e.g. `co -> console` and `con -> const`.")],description:p("suggestSelection","Controls how suggestions are pre-selected when showing the suggest list.")})),tabCompletion:ie(new yi(123,"tabCompletion","off",["on","off","onlySnippets"],{enumDescriptions:[p("tabCompletion.on","Tab complete will insert the best matching suggestion when pressing tab."),p("tabCompletion.off","Disable tab completions."),p("tabCompletion.onlySnippets","Tab complete snippets when their prefix match. Works best when 'quickSuggestions' aren't enabled.")],description:p("tabCompletion","Enables tab completions.")})),tabIndex:ie(new zt(124,"tabIndex",0,-1,1073741824)),unicodeHighlight:ie(new Soe),unusualLineTerminators:ie(new yi(126,"unusualLineTerminators","prompt",["auto","off","prompt"],{enumDescriptions:[p("unusualLineTerminators.auto","Unusual line terminators are automatically removed."),p("unusualLineTerminators.off","Unusual line terminators are ignored."),p("unusualLineTerminators.prompt","Unusual line terminators prompt to be removed.")],description:p("unusualLineTerminators","Remove unusual line terminators that might cause problems.")})),useShadowDOM:ie(new Ct(127,"useShadowDOM",!0)),useTabStops:ie(new Ct(128,"useTabStops",!0,{description:p("useTabStops","Spaces and tabs are inserted and deleted in alignment with tab stops.")})),wordBreak:ie(new yi(129,"wordBreak","normal",["normal","keepAll"],{markdownEnumDescriptions:[p("wordBreak.normal","Use the default line break rule."),p("wordBreak.keepAll","Word breaks should not be used for Chinese/Japanese/Korean (CJK) text. Non-CJK text behavior is the same as for normal.")],description:p("wordBreak","Controls the word break rules used for Chinese/Japanese/Korean (CJK) text.")})),wordSegmenterLocales:ie(new Toe),wordSeparators:ie(new ks(131,"wordSeparators",BV,{description:p("wordSeparators","Characters that will be used as word separators when doing word related navigations or operations.")})),wordWrap:ie(new yi(132,"wordWrap","off",["off","on","wordWrapColumn","bounded"],{markdownEnumDescriptions:[p("wordWrap.off","Lines will never wrap."),p("wordWrap.on","Lines will wrap at the viewport width."),p({},"Lines will wrap at `#editor.wordWrapColumn#`."),p({},"Lines will wrap at the minimum of viewport and `#editor.wordWrapColumn#`.")],description:p({},"Controls how lines should wrap.")})),wordWrapBreakAfterCharacters:ie(new ks(133,"wordWrapBreakAfterCharacters"," })]?|/&.,;¢°′″‰℃、。。、¢,.:;?!%・・ゝゞヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻ァィゥェォャュョッー”〉》」』】〕)]}」")),wordWrapBreakBeforeCharacters:ie(new ks(134,"wordWrapBreakBeforeCharacters","([{‘“〈《「『【〔([{「£¥$£¥++")),wordWrapColumn:ie(new zt(135,"wordWrapColumn",80,1,1073741824,{markdownDescription:p({},"Controls the wrapping column of the editor when `#editor.wordWrap#` is `wordWrapColumn` or `bounded`.")})),wordWrapOverride1:ie(new yi(136,"wordWrapOverride1","inherit",["off","on","inherit"])),wordWrapOverride2:ie(new yi(137,"wordWrapOverride2","inherit",["off","on","inherit"])),editorClassName:ie(new eoe),defaultColorDecorators:ie(new Ct(147,"defaultColorDecorators",!1,{markdownDescription:p("defaultColorDecorators","Controls whether inline color decorations should be shown using the default document color provider")})),pixelRatio:ie(new _oe),tabFocusMode:ie(new Ct(144,"tabFocusMode",!1,{markdownDescription:p("tabFocusMode","Controls whether the editor receives tabs or defers them to the workbench for navigation.")})),layoutInfo:ie(new Lm),wrappingInfo:ie(new Aoe),wrappingIndent:ie(new Noe),wrappingStrategy:ie(new aoe)};class Boe{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?s_.isErrorNoTelemetry(e)?new s_(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 zV=new Boe;function Xe(s){Id(s)||zV.onUnexpectedError(s)}function Ai(s){Id(s)||zV.onUnexpectedExternalError(s)}function e3(s){if(s instanceof Error){const{name:e,message:t}=s,i=s.stacktrace||s.stack;return{$isError:!0,name:e,message:t,stack:i,noTelemetry:s_.isErrorNoTelemetry(s)}}return s}const NS="Canceled";function Id(s){return s instanceof sl?!0:s instanceof Error&&s.name===NS&&s.message===NS}class sl extends Error{constructor(){super(NS),this.name=this.message}}function Woe(){const s=new Error(NS);return s.name=s.message,s}function Mr(s){return s?new Error(`Illegal argument: ${s}`):new Error("Illegal argument")}function UP(s){return s?new Error(`Illegal state: ${s}`):new Error("Illegal state")}class Hoe extends Error{constructor(e){super("NotSupported"),e&&(this.message=e)}}class s_ extends Error{constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof s_)return e;const t=new s_;return t.message=e.message,t.stack=e.stack,t}static isErrorNoTelemetry(e){return e.name==="CodeExpectedError"}}class Ut extends Error{constructor(e){super(e||"An unexpected bug occurred."),Object.setPrototypeOf(this,Ut.prototype)}}function o_(s,e){const t=this;let i=!1,n;return function(){return i||(i=!0,n=s.apply(t,arguments)),n}}function jL(s){return typeof s=="object"&&s!==null&&typeof s.dispose=="function"&&s.dispose.length===0}function jt(s){if(ft.is(s)){const e=[];for(const t of s)if(t)try{t.dispose()}catch(i){e.push(i)}if(e.length===1)throw e[0];if(e.length>1)throw new AggregateError(e,"Encountered errors while disposing of store");return Array.isArray(s)?[]:s}else if(s)return s.dispose(),s}function ha(...s){return Ie(()=>jt(s))}function Ie(s){return{dispose:o_(()=>{s()})}}class Y{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{jt(this._toDispose)}finally{this._toDispose.clear()}}add(e){if(!e)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?Y.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}deleteAndLeak(e){e&&this._toDispose.has(e)&&this._toDispose.delete(e)}}Y.DISABLE_DISPOSED_WARNING=!1;class H{constructor(){this._store=new Y,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)}}H.None=Object.freeze({dispose(){}});class $n{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(e){var t;this._isDisposed||e===this._value||((t=this._value)===null||t===void 0||t.dispose(),this._value=e)}clear(){this.value=void 0}dispose(){var e;this._isDisposed=!0,(e=this._value)===null||e===void 0||e.dispose(),this._value=void 0}}class Voe{constructor(e){this._disposable=e,this._counter=1}acquire(){return this._counter++,this}release(){return--this._counter===0&&this._disposable.dispose(),this}}class zoe{constructor(e){this.object=e}dispose(){}}class $P{constructor(){this._store=new Map,this._isDisposed=!1}dispose(){this._isDisposed=!0,this.clearAndDisposeAll()}clearAndDisposeAll(){if(this._store.size)try{jt(this._store.values())}finally{this._store.clear()}}get(e){return this._store.get(e)}set(e,t,i=!1){var n;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||(n=this._store.get(e))===null||n===void 0||n.dispose(),this._store.set(e,t)}deleteAndDispose(e){var t;(t=this._store.get(e))===null||t===void 0||t.dispose(),this._store.delete(e)}[Symbol.iterator](){return this._store[Symbol.iterator]()}}const Uoe=globalThis.performance&&typeof globalThis.performance.now=="function";class Jn{static create(e){return new Jn(e)}constructor(e){this._now=Uoe&&e===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),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 le;(function(s){s.None=()=>H.None;function e(R,P){return u(R,()=>{},0,void 0,!0,void 0,P)}s.defer=e;function t(R){return(P,F=null,V)=>{let U=!1,J;return J=R(pe=>{if(!U)return J?J.dispose():U=!0,P.call(F,pe)},null,V),U&&J.dispose(),J}}s.once=t;function i(R,P,F){return d((V,U=null,J)=>R(pe=>V.call(U,P(pe)),null,J),F)}s.map=i;function n(R,P,F){return d((V,U=null,J)=>R(pe=>{P(pe),V.call(U,pe)},null,J),F)}s.forEach=n;function o(R,P,F){return d((V,U=null,J)=>R(pe=>P(pe)&&V.call(U,pe),null,J),F)}s.filter=o;function r(R){return R}s.signal=r;function a(...R){return(P,F=null,V)=>{const U=ha(...R.map(J=>J(pe=>P.call(F,pe))));return c(U,V)}}s.any=a;function l(R,P,F,V){let U=F;return i(R,J=>(U=P(U,J),U),V)}s.reduce=l;function d(R,P){let F;const V={onWillAddFirstListener(){F=R(U.fire,U)},onDidRemoveLastListener(){F==null||F.dispose()}},U=new B(V);return P==null||P.add(U),U.event}function c(R,P){return P instanceof Array?P.push(R):P&&P.add(R),R}function u(R,P,F=100,V=!1,U=!1,J,pe){let De,ge,We,ye=0,ve;const ce={leakWarningThreshold:J,onWillAddFirstListener(){De=R(Ui=>{ye++,ge=P(ge,Ui),V&&!We&&(Qt.fire(ge),ge=void 0),ve=()=>{const Gi=ge;ge=void 0,We=void 0,(!V||ye>1)&&Qt.fire(Gi),ye=0},typeof F=="number"?(clearTimeout(We),We=setTimeout(ve,F)):We===void 0&&(We=0,queueMicrotask(ve))})},onWillRemoveListener(){U&&ye>0&&(ve==null||ve())},onDidRemoveLastListener(){ve=void 0,De.dispose()}},Qt=new B(ce);return pe==null||pe.add(Qt),Qt.event}s.debounce=u;function h(R,P=0,F){return s.debounce(R,(V,U)=>V?(V.push(U),V):[U],P,void 0,!0,void 0,F)}s.accumulate=h;function g(R,P=(V,U)=>V===U,F){let V=!0,U;return o(R,J=>{const pe=V||!P(J,U);return V=!1,U=J,pe},F)}s.latch=g;function f(R,P,F){return[s.filter(R,P,F),s.filter(R,V=>!P(V),F)]}s.split=f;function m(R,P=!1,F=[],V){let U=F.slice(),J=R(ge=>{U?U.push(ge):De.fire(ge)});V&&V.add(J);const pe=()=>{U==null||U.forEach(ge=>De.fire(ge)),U=null},De=new B({onWillAddFirstListener(){J||(J=R(ge=>De.fire(ge)),V&&V.add(J))},onDidAddFirstListener(){U&&(P?setTimeout(pe):pe())},onDidRemoveLastListener(){J&&J.dispose(),J=null}});return V&&V.add(De),De.event}s.buffer=m;function _(R,P){return(V,U,J)=>{const pe=P(new b);return R(function(De){const ge=pe.evaluate(De);ge!==v&&V.call(U,ge)},void 0,J)}}s.chain=_;const v=Symbol("HaltChainable");class b{constructor(){this.steps=[]}map(P){return this.steps.push(P),this}forEach(P){return this.steps.push(F=>(P(F),F)),this}filter(P){return this.steps.push(F=>P(F)?F:v),this}reduce(P,F){let V=F;return this.steps.push(U=>(V=P(V,U),V)),this}latch(P=(F,V)=>F===V){let F=!0,V;return this.steps.push(U=>{const J=F||!P(U,V);return F=!1,V=U,J?U:v}),this}evaluate(P){for(const F of this.steps)if(P=F(P),P===v)break;return P}}function C(R,P,F=V=>V){const V=(...De)=>pe.fire(F(...De)),U=()=>R.on(P,V),J=()=>R.removeListener(P,V),pe=new B({onWillAddFirstListener:U,onDidRemoveLastListener:J});return pe.event}s.fromNodeEventEmitter=C;function w(R,P,F=V=>V){const V=(...De)=>pe.fire(F(...De)),U=()=>R.addEventListener(P,V),J=()=>R.removeEventListener(P,V),pe=new B({onWillAddFirstListener:U,onDidRemoveLastListener:J});return pe.event}s.fromDOMEventEmitter=w;function y(R){return new Promise(P=>t(R)(P))}s.toPromise=y;function D(R){const P=new B;return R.then(F=>{P.fire(F)},()=>{P.fire(void 0)}).finally(()=>{P.dispose()}),P.event}s.fromPromise=D;function L(R,P,F){return P(F),R(V=>P(V))}s.runAndSubscribe=L;class k{constructor(P,F){this._observable=P,this._counter=0,this._hasChanged=!1;const V={onWillAddFirstListener:()=>{P.addObserver(this)},onDidRemoveLastListener:()=>{P.removeObserver(this)}};this.emitter=new B(V),F&&F.add(this.emitter)}beginUpdate(P){this._counter++}handlePossibleChange(P){}handleChange(P,F){this._hasChanged=!0}endUpdate(P){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function I(R,P){return new k(R,P).emitter.event}s.fromObservable=I;function O(R){return(P,F,V)=>{let U=0,J=!1;const pe={beginUpdate(){U++},endUpdate(){U--,U===0&&(R.reportChanges(),J&&(J=!1,P.call(F)))},handlePossibleChange(){},handleChange(){J=!0}};R.addObserver(pe),R.reportChanges();const De={dispose(){R.removeObserver(pe)}};return V instanceof Y?V.add(De):Array.isArray(V)&&V.push(De),De}}s.fromObservableLight=O})(le||(le={}));class r_{constructor(e){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${e}_${r_._idPool++}`,r_.all.add(this)}start(e){this._stopWatch=new Jn,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}}}r_.all=new Set;r_._idPool=0;let $oe=-1;class joe{constructor(e,t=Math.random().toString(18).slice(2,5)){this.threshold=e,this.name=t,this._warnCountdown=0}dispose(){var e;(e=this._stacks)===null||e===void 0||e.clear()}check(e,t){const i=this.threshold;if(i<=0||t{const o=this._stacks.get(e.value)||0;this._stacks.set(e.value,o-1)}}}class jP{static create(){var e;return new jP((e=new Error().stack)!==null&&e!==void 0?e:"")}constructor(e){this.value=e}print(){console.warn(this.value.split(` `).slice(2).join(` `))}}class NE{constructor(e){this.value=e}}const Koe=2;let B=class{constructor(e){var t,i,n,o,r;this._size=0,this._options=e,this._leakageMon=!((t=this._options)===null||t===void 0)&&t.leakWarningThreshold?new joe((n=(i=this._options)===null||i===void 0?void 0:i.leakWarningThreshold)!==null&&n!==void 0?n:$oe):void 0,this._perfMon=!((o=this._options)===null||o===void 0)&&o._profName?new r_(this._options._profName):void 0,this._deliveryQueue=(r=this._options)===null||r===void 0?void 0:r.deliveryQueue}dispose(){var e,t,i,n;this._disposed||(this._disposed=!0,((e=this._deliveryQueue)===null||e===void 0?void 0:e.current)===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),(i=(t=this._options)===null||t===void 0?void 0:t.onDidRemoveLastListener)===null||i===void 0||i.call(t),(n=this._leakageMon)===null||n===void 0||n.dispose())}get event(){var e;return(e=this._event)!==null&&e!==void 0||(this._event=(t,i,n)=>{var o,r,a,l,d;if(this._leakageMon&&this._size>this._leakageMon.threshold*3)return console.warn(`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far`),H.None;if(this._disposed)return H.None;i&&(t=t.bind(i));const c=new NE(t);let u;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(c.stack=jP.create(),u=this._leakageMon.check(c.stack,this._size+1)),this._listeners?this._listeners instanceof NE?((d=this._deliveryQueue)!==null&&d!==void 0||(this._deliveryQueue=new UV),this._listeners=[this._listeners,c]):this._listeners.push(c):((r=(o=this._options)===null||o===void 0?void 0:o.onWillAddFirstListener)===null||r===void 0||r.call(o,this),this._listeners=c,(l=(a=this._options)===null||a===void 0?void 0:a.onDidAddFirstListener)===null||l===void 0||l.call(a,this)),this._size++;const h=Ie(()=>{u==null||u(),this._removeListener(c)});return n instanceof Y?n.add(h):Array.isArray(n)&&n.push(h),h}),this._event}_removeListener(e){var t,i,n,o;if((i=(t=this._options)===null||t===void 0?void 0:t.onWillRemoveListener)===null||i===void 0||i.call(t,this),!this._listeners)return;if(this._size===1){this._listeners=void 0,(o=(n=this._options)===null||n===void 0?void 0:n.onDidRemoveLastListener)===null||o===void 0||o.call(n,this),this._size=0;return}const r=this._listeners,a=r.indexOf(e);if(a===-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--,r[a]=void 0;const l=this._deliveryQueue.current===this;if(this._size*Koe<=r.length){let d=0;for(let c=0;c0}};const qoe=()=>new UV;class UV{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 bf extends B{constructor(e){super(e),this._isPaused=0,this._eventQueue=new Rs,this._mergeFn=e==null?void 0: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 $V extends bf{constructor(e){var t;super(e),this._delay=(t=e.delay)!==null&&t!==void 0?t:100}fire(e){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(e)}}class Goe extends B{constructor(e){super(e),this._queuedEvents=[],this._mergeFn=e==null?void 0: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 Zoe{constructor(){this.hasListeners=!1,this.events=[],this.emitter=new B({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),Ie(o_(()=>{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){var t;(t=e.listener)===null||t===void 0||t.dispose(),e.listener=null}dispose(){var e;this.emitter.dispose();for(const t of this.events)(e=t.listener)===null||e===void 0||e.dispose();this.events=[]}}class KP{constructor(){this.buffers=[]}wrapEvent(e){return(t,i,n)=>e(o=>{const r=this.buffers[this.buffers.length-1];r?r.push(()=>t.call(i,o)):t.call(i,o)},void 0,n)}bufferEvents(e){const t=[];this.buffers.push(t);const i=e();return this.buffers.pop(),t.forEach(n=>n()),i}}class t3{constructor(){this.listening=!1,this.inputEvent=le.None,this.inputEventListener=H.None,this.emitter=new B({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 jV=Object.freeze(function(s,e){const t=setTimeout(s.bind(e),0);return{dispose(){clearTimeout(t)}}});var dt;(function(s){function e(t){return t===s.None||t===s.Cancelled||t instanceof Fy?!0:!t||typeof t!="object"?!1:typeof t.isCancellationRequested=="boolean"&&typeof t.onCancellationRequested=="function"}s.isCancellationToken=e,s.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:le.None}),s.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:jV})})(dt||(dt={}));class Fy{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?jV:(this._emitter||(this._emitter=new B),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}}let Vi=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 Fy),this._token}cancel(){this._token?this._token instanceof Fy&&this._token.cancel():this._token=dt.Cancelled}dispose(e=!1){var t;e&&this.cancel(),(t=this._parentListener)===null||t===void 0||t.dispose(),this._token?this._token instanceof Fy&&this._token.dispose():this._token=dt.None}};function i3(s){const e=new Vi;return s.add({dispose(){e.cancel()}}),e.token}class qP{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 Oy=new qP,XT=new qP,YT=new qP,KV=new Array(230),Xoe=Object.create(null),Yoe=Object.create(null),GP=[];for(let s=0;s<=193;s++)GP[s]=-1;(function(){const s="",e=[[1,0,"None",0,"unknown",0,"VK_UNKNOWN",s,s],[1,1,"Hyper",0,s,0,s,s,s],[1,2,"Super",0,s,0,s,s,s],[1,3,"Fn",0,s,0,s,s,s],[1,4,"FnLock",0,s,0,s,s,s],[1,5,"Suspend",0,s,0,s,s,s],[1,6,"Resume",0,s,0,s,s,s],[1,7,"Turbo",0,s,0,s,s,s],[1,8,"Sleep",0,s,0,"VK_SLEEP",s,s],[1,9,"WakeUp",0,s,0,s,s,s],[0,10,"KeyA",31,"A",65,"VK_A",s,s],[0,11,"KeyB",32,"B",66,"VK_B",s,s],[0,12,"KeyC",33,"C",67,"VK_C",s,s],[0,13,"KeyD",34,"D",68,"VK_D",s,s],[0,14,"KeyE",35,"E",69,"VK_E",s,s],[0,15,"KeyF",36,"F",70,"VK_F",s,s],[0,16,"KeyG",37,"G",71,"VK_G",s,s],[0,17,"KeyH",38,"H",72,"VK_H",s,s],[0,18,"KeyI",39,"I",73,"VK_I",s,s],[0,19,"KeyJ",40,"J",74,"VK_J",s,s],[0,20,"KeyK",41,"K",75,"VK_K",s,s],[0,21,"KeyL",42,"L",76,"VK_L",s,s],[0,22,"KeyM",43,"M",77,"VK_M",s,s],[0,23,"KeyN",44,"N",78,"VK_N",s,s],[0,24,"KeyO",45,"O",79,"VK_O",s,s],[0,25,"KeyP",46,"P",80,"VK_P",s,s],[0,26,"KeyQ",47,"Q",81,"VK_Q",s,s],[0,27,"KeyR",48,"R",82,"VK_R",s,s],[0,28,"KeyS",49,"S",83,"VK_S",s,s],[0,29,"KeyT",50,"T",84,"VK_T",s,s],[0,30,"KeyU",51,"U",85,"VK_U",s,s],[0,31,"KeyV",52,"V",86,"VK_V",s,s],[0,32,"KeyW",53,"W",87,"VK_W",s,s],[0,33,"KeyX",54,"X",88,"VK_X",s,s],[0,34,"KeyY",55,"Y",89,"VK_Y",s,s],[0,35,"KeyZ",56,"Z",90,"VK_Z",s,s],[0,36,"Digit1",22,"1",49,"VK_1",s,s],[0,37,"Digit2",23,"2",50,"VK_2",s,s],[0,38,"Digit3",24,"3",51,"VK_3",s,s],[0,39,"Digit4",25,"4",52,"VK_4",s,s],[0,40,"Digit5",26,"5",53,"VK_5",s,s],[0,41,"Digit6",27,"6",54,"VK_6",s,s],[0,42,"Digit7",28,"7",55,"VK_7",s,s],[0,43,"Digit8",29,"8",56,"VK_8",s,s],[0,44,"Digit9",30,"9",57,"VK_9",s,s],[0,45,"Digit0",21,"0",48,"VK_0",s,s],[1,46,"Enter",3,"Enter",13,"VK_RETURN",s,s],[1,47,"Escape",9,"Escape",27,"VK_ESCAPE",s,s],[1,48,"Backspace",1,"Backspace",8,"VK_BACK",s,s],[1,49,"Tab",2,"Tab",9,"VK_TAB",s,s],[1,50,"Space",10,"Space",32,"VK_SPACE",s,s],[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,s,0,s,s,s],[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",s,s],[1,64,"F1",59,"F1",112,"VK_F1",s,s],[1,65,"F2",60,"F2",113,"VK_F2",s,s],[1,66,"F3",61,"F3",114,"VK_F3",s,s],[1,67,"F4",62,"F4",115,"VK_F4",s,s],[1,68,"F5",63,"F5",116,"VK_F5",s,s],[1,69,"F6",64,"F6",117,"VK_F6",s,s],[1,70,"F7",65,"F7",118,"VK_F7",s,s],[1,71,"F8",66,"F8",119,"VK_F8",s,s],[1,72,"F9",67,"F9",120,"VK_F9",s,s],[1,73,"F10",68,"F10",121,"VK_F10",s,s],[1,74,"F11",69,"F11",122,"VK_F11",s,s],[1,75,"F12",70,"F12",123,"VK_F12",s,s],[1,76,"PrintScreen",0,s,0,s,s,s],[1,77,"ScrollLock",84,"ScrollLock",145,"VK_SCROLL",s,s],[1,78,"Pause",7,"PauseBreak",19,"VK_PAUSE",s,s],[1,79,"Insert",19,"Insert",45,"VK_INSERT",s,s],[1,80,"Home",14,"Home",36,"VK_HOME",s,s],[1,81,"PageUp",11,"PageUp",33,"VK_PRIOR",s,s],[1,82,"Delete",20,"Delete",46,"VK_DELETE",s,s],[1,83,"End",13,"End",35,"VK_END",s,s],[1,84,"PageDown",12,"PageDown",34,"VK_NEXT",s,s],[1,85,"ArrowRight",17,"RightArrow",39,"VK_RIGHT","Right",s],[1,86,"ArrowLeft",15,"LeftArrow",37,"VK_LEFT","Left",s],[1,87,"ArrowDown",18,"DownArrow",40,"VK_DOWN","Down",s],[1,88,"ArrowUp",16,"UpArrow",38,"VK_UP","Up",s],[1,89,"NumLock",83,"NumLock",144,"VK_NUMLOCK",s,s],[1,90,"NumpadDivide",113,"NumPad_Divide",111,"VK_DIVIDE",s,s],[1,91,"NumpadMultiply",108,"NumPad_Multiply",106,"VK_MULTIPLY",s,s],[1,92,"NumpadSubtract",111,"NumPad_Subtract",109,"VK_SUBTRACT",s,s],[1,93,"NumpadAdd",109,"NumPad_Add",107,"VK_ADD",s,s],[1,94,"NumpadEnter",3,s,0,s,s,s],[1,95,"Numpad1",99,"NumPad1",97,"VK_NUMPAD1",s,s],[1,96,"Numpad2",100,"NumPad2",98,"VK_NUMPAD2",s,s],[1,97,"Numpad3",101,"NumPad3",99,"VK_NUMPAD3",s,s],[1,98,"Numpad4",102,"NumPad4",100,"VK_NUMPAD4",s,s],[1,99,"Numpad5",103,"NumPad5",101,"VK_NUMPAD5",s,s],[1,100,"Numpad6",104,"NumPad6",102,"VK_NUMPAD6",s,s],[1,101,"Numpad7",105,"NumPad7",103,"VK_NUMPAD7",s,s],[1,102,"Numpad8",106,"NumPad8",104,"VK_NUMPAD8",s,s],[1,103,"Numpad9",107,"NumPad9",105,"VK_NUMPAD9",s,s],[1,104,"Numpad0",98,"NumPad0",96,"VK_NUMPAD0",s,s],[1,105,"NumpadDecimal",112,"NumPad_Decimal",110,"VK_DECIMAL",s,s],[0,106,"IntlBackslash",97,"OEM_102",226,"VK_OEM_102",s,s],[1,107,"ContextMenu",58,"ContextMenu",93,s,s,s],[1,108,"Power",0,s,0,s,s,s],[1,109,"NumpadEqual",0,s,0,s,s,s],[1,110,"F13",71,"F13",124,"VK_F13",s,s],[1,111,"F14",72,"F14",125,"VK_F14",s,s],[1,112,"F15",73,"F15",126,"VK_F15",s,s],[1,113,"F16",74,"F16",127,"VK_F16",s,s],[1,114,"F17",75,"F17",128,"VK_F17",s,s],[1,115,"F18",76,"F18",129,"VK_F18",s,s],[1,116,"F19",77,"F19",130,"VK_F19",s,s],[1,117,"F20",78,"F20",131,"VK_F20",s,s],[1,118,"F21",79,"F21",132,"VK_F21",s,s],[1,119,"F22",80,"F22",133,"VK_F22",s,s],[1,120,"F23",81,"F23",134,"VK_F23",s,s],[1,121,"F24",82,"F24",135,"VK_F24",s,s],[1,122,"Open",0,s,0,s,s,s],[1,123,"Help",0,s,0,s,s,s],[1,124,"Select",0,s,0,s,s,s],[1,125,"Again",0,s,0,s,s,s],[1,126,"Undo",0,s,0,s,s,s],[1,127,"Cut",0,s,0,s,s,s],[1,128,"Copy",0,s,0,s,s,s],[1,129,"Paste",0,s,0,s,s,s],[1,130,"Find",0,s,0,s,s,s],[1,131,"AudioVolumeMute",117,"AudioVolumeMute",173,"VK_VOLUME_MUTE",s,s],[1,132,"AudioVolumeUp",118,"AudioVolumeUp",175,"VK_VOLUME_UP",s,s],[1,133,"AudioVolumeDown",119,"AudioVolumeDown",174,"VK_VOLUME_DOWN",s,s],[1,134,"NumpadComma",110,"NumPad_Separator",108,"VK_SEPARATOR",s,s],[0,135,"IntlRo",115,"ABNT_C1",193,"VK_ABNT_C1",s,s],[1,136,"KanaMode",0,s,0,s,s,s],[0,137,"IntlYen",0,s,0,s,s,s],[1,138,"Convert",0,s,0,s,s,s],[1,139,"NonConvert",0,s,0,s,s,s],[1,140,"Lang1",0,s,0,s,s,s],[1,141,"Lang2",0,s,0,s,s,s],[1,142,"Lang3",0,s,0,s,s,s],[1,143,"Lang4",0,s,0,s,s,s],[1,144,"Lang5",0,s,0,s,s,s],[1,145,"Abort",0,s,0,s,s,s],[1,146,"Props",0,s,0,s,s,s],[1,147,"NumpadParenLeft",0,s,0,s,s,s],[1,148,"NumpadParenRight",0,s,0,s,s,s],[1,149,"NumpadBackspace",0,s,0,s,s,s],[1,150,"NumpadMemoryStore",0,s,0,s,s,s],[1,151,"NumpadMemoryRecall",0,s,0,s,s,s],[1,152,"NumpadMemoryClear",0,s,0,s,s,s],[1,153,"NumpadMemoryAdd",0,s,0,s,s,s],[1,154,"NumpadMemorySubtract",0,s,0,s,s,s],[1,155,"NumpadClear",131,"Clear",12,"VK_CLEAR",s,s],[1,156,"NumpadClearEntry",0,s,0,s,s,s],[1,0,s,5,"Ctrl",17,"VK_CONTROL",s,s],[1,0,s,4,"Shift",16,"VK_SHIFT",s,s],[1,0,s,6,"Alt",18,"VK_MENU",s,s],[1,0,s,57,"Meta",91,"VK_COMMAND",s,s],[1,157,"ControlLeft",5,s,0,"VK_LCONTROL",s,s],[1,158,"ShiftLeft",4,s,0,"VK_LSHIFT",s,s],[1,159,"AltLeft",6,s,0,"VK_LMENU",s,s],[1,160,"MetaLeft",57,s,0,"VK_LWIN",s,s],[1,161,"ControlRight",5,s,0,"VK_RCONTROL",s,s],[1,162,"ShiftRight",4,s,0,"VK_RSHIFT",s,s],[1,163,"AltRight",6,s,0,"VK_RMENU",s,s],[1,164,"MetaRight",57,s,0,"VK_RWIN",s,s],[1,165,"BrightnessUp",0,s,0,s,s,s],[1,166,"BrightnessDown",0,s,0,s,s,s],[1,167,"MediaPlay",0,s,0,s,s,s],[1,168,"MediaRecord",0,s,0,s,s,s],[1,169,"MediaFastForward",0,s,0,s,s,s],[1,170,"MediaRewind",0,s,0,s,s,s],[1,171,"MediaTrackNext",124,"MediaTrackNext",176,"VK_MEDIA_NEXT_TRACK",s,s],[1,172,"MediaTrackPrevious",125,"MediaTrackPrevious",177,"VK_MEDIA_PREV_TRACK",s,s],[1,173,"MediaStop",126,"MediaStop",178,"VK_MEDIA_STOP",s,s],[1,174,"Eject",0,s,0,s,s,s],[1,175,"MediaPlayPause",127,"MediaPlayPause",179,"VK_MEDIA_PLAY_PAUSE",s,s],[1,176,"MediaSelect",128,"LaunchMediaPlayer",181,"VK_MEDIA_LAUNCH_MEDIA_SELECT",s,s],[1,177,"LaunchMail",129,"LaunchMail",180,"VK_MEDIA_LAUNCH_MAIL",s,s],[1,178,"LaunchApp2",130,"LaunchApp2",183,"VK_MEDIA_LAUNCH_APP2",s,s],[1,179,"LaunchApp1",0,s,0,"VK_MEDIA_LAUNCH_APP1",s,s],[1,180,"SelectTask",0,s,0,s,s,s],[1,181,"LaunchScreenSaver",0,s,0,s,s,s],[1,182,"BrowserSearch",120,"BrowserSearch",170,"VK_BROWSER_SEARCH",s,s],[1,183,"BrowserHome",121,"BrowserHome",172,"VK_BROWSER_HOME",s,s],[1,184,"BrowserBack",122,"BrowserBack",166,"VK_BROWSER_BACK",s,s],[1,185,"BrowserForward",123,"BrowserForward",167,"VK_BROWSER_FORWARD",s,s],[1,186,"BrowserStop",0,s,0,"VK_BROWSER_STOP",s,s],[1,187,"BrowserRefresh",0,s,0,"VK_BROWSER_REFRESH",s,s],[1,188,"BrowserFavorites",0,s,0,"VK_BROWSER_FAVORITES",s,s],[1,189,"ZoomToggle",0,s,0,s,s,s],[1,190,"MailReply",0,s,0,s,s,s],[1,191,"MailForward",0,s,0,s,s,s],[1,192,"MailSend",0,s,0,s,s,s],[1,0,s,114,"KeyInComposition",229,s,s,s],[1,0,s,116,"ABNT_C2",194,"VK_ABNT_C2",s,s],[1,0,s,96,"OEM_8",223,"VK_OEM_8",s,s],[1,0,s,0,s,0,"VK_KANA",s,s],[1,0,s,0,s,0,"VK_HANGUL",s,s],[1,0,s,0,s,0,"VK_JUNJA",s,s],[1,0,s,0,s,0,"VK_FINAL",s,s],[1,0,s,0,s,0,"VK_HANJA",s,s],[1,0,s,0,s,0,"VK_KANJI",s,s],[1,0,s,0,s,0,"VK_CONVERT",s,s],[1,0,s,0,s,0,"VK_NONCONVERT",s,s],[1,0,s,0,s,0,"VK_ACCEPT",s,s],[1,0,s,0,s,0,"VK_MODECHANGE",s,s],[1,0,s,0,s,0,"VK_SELECT",s,s],[1,0,s,0,s,0,"VK_PRINT",s,s],[1,0,s,0,s,0,"VK_EXECUTE",s,s],[1,0,s,0,s,0,"VK_SNAPSHOT",s,s],[1,0,s,0,s,0,"VK_HELP",s,s],[1,0,s,0,s,0,"VK_APPS",s,s],[1,0,s,0,s,0,"VK_PROCESSKEY",s,s],[1,0,s,0,s,0,"VK_PACKET",s,s],[1,0,s,0,s,0,"VK_DBE_SBCSCHAR",s,s],[1,0,s,0,s,0,"VK_DBE_DBCSCHAR",s,s],[1,0,s,0,s,0,"VK_ATTN",s,s],[1,0,s,0,s,0,"VK_CRSEL",s,s],[1,0,s,0,s,0,"VK_EXSEL",s,s],[1,0,s,0,s,0,"VK_EREOF",s,s],[1,0,s,0,s,0,"VK_PLAY",s,s],[1,0,s,0,s,0,"VK_ZOOM",s,s],[1,0,s,0,s,0,"VK_NONAME",s,s],[1,0,s,0,s,0,"VK_PA1",s,s],[1,0,s,0,s,0,"VK_OEM_CLEAR",s,s]],t=[],i=[];for(const n of e){const[o,r,a,l,d,c,u,h,g]=n;if(i[r]||(i[r]=!0,Xoe[a]=r,Yoe[a.toLowerCase()]=r,o&&(GP[r]=l)),!t[l]){if(t[l]=!0,!d)throw new Error(`String representation missing for key code ${l} around scan code ${a}`);Oy.define(l,d),XT.define(l,h||d),YT.define(l,g||h||d)}c&&(KV[c]=l)}})();var sc;(function(s){function e(a){return Oy.keyCodeToStr(a)}s.toString=e;function t(a){return Oy.strToKeyCode(a)}s.fromString=t;function i(a){return XT.keyCodeToStr(a)}s.toUserSettingsUS=i;function n(a){return YT.keyCodeToStr(a)}s.toUserSettingsGeneral=n;function o(a){return XT.strToKeyCode(a)||YT.strToKeyCode(a)}s.fromUserSettings=o;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 Oy.keyCodeToStr(a)}s.toElectronAccelerator=r})(sc||(sc={}));function an(s,e){const t=(e&65535)<<16>>>0;return(s|t)>>>0}var n3={};let km;const AE=globalThis.vscode;if(typeof AE<"u"&&typeof AE.process<"u"){const s=AE.process;km={get platform(){return s.platform},get arch(){return s.arch},get env(){return s.env},cwd(){return s.cwd()}}}else typeof process<"u"?km={get platform(){return process.platform},get arch(){return process.arch},get env(){return n3},cwd(){return n3.VSCODE_CWD||process.cwd()}}:km={get platform(){return as?"win32":lt?"darwin":"linux"},get arch(){},get env(){return{}},cwd(){return"/"}};const AS=km.cwd,QT=km.env,Qoe=km.platform,Joe=65,ere=97,tre=90,ire=122,ih=46,gs=47,Vo=92,fu=58,nre=63;class qV 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 o=e.indexOf(".")!==-1?"property":"argument";let r=`The "${e}" ${o} ${n} of type ${t}`;r+=`. Received type ${typeof i}`,super(r),this.code="ERR_INVALID_ARG_TYPE"}}function sre(s,e){if(s===null||typeof s!="object")throw new qV(e,"Object",s)}function In(s,e){if(typeof s!="string")throw new qV(e,"string",s)}const eg=Qoe==="win32";function Pt(s){return s===gs||s===Vo}function JT(s){return s===gs}function pu(s){return s>=Joe&&s<=tre||s>=ere&&s<=ire}function MS(s,e,t,i){let n="",o=0,r=-1,a=0,l=0;for(let d=0;d<=s.length;++d){if(d2){const c=n.lastIndexOf(t);c===-1?(n="",o=0):(n=n.slice(0,c),o=n.length-1-n.lastIndexOf(t)),r=d,a=0;continue}else if(n.length!==0){n="",o=0,r=d,a=0;continue}}e&&(n+=n.length>0?`${t}..`:"..",o=2)}else n.length>0?n+=`${t}${s.slice(r+1,d)}`:n=s.slice(r+1,d),o=d-r-1;r=d,a=0}else l===ih&&a!==-1?++a:a=-1}return n}function GV(s,e){sre(e,"pathObject");const t=e.dir||e.root,i=e.base||`${e.name||""}${e.ext||""}`;return t?t===e.root?`${t}${i}`:`${t}${s}${i}`:i}const xo={resolve(...s){let e="",t="",i=!1;for(let n=s.length-1;n>=-1;n--){let o;if(n>=0){if(o=s[n],In(o,"path"),o.length===0)continue}else e.length===0?o=AS():(o=QT[`=${e}`]||AS(),(o===void 0||o.slice(0,2).toLowerCase()!==e.toLowerCase()&&o.charCodeAt(2)===Vo)&&(o=`${e}\\`));const r=o.length;let a=0,l="",d=!1;const c=o.charCodeAt(0);if(r===1)Pt(c)&&(a=1,d=!0);else if(Pt(c))if(d=!0,Pt(o.charCodeAt(1))){let u=2,h=u;for(;u2&&Pt(o.charCodeAt(2))&&(d=!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=`${o.slice(a)}\\${t}`,i=d,d&&e.length>0)break}return t=MS(t,!i,"\\",Pt),i?`${e}\\${t}`:`${e}${t}`||"."},normalize(s){In(s,"path");const e=s.length;if(e===0)return".";let t=0,i,n=!1;const o=s.charCodeAt(0);if(e===1)return JT(o)?"\\":s;if(Pt(o))if(n=!0,Pt(s.charCodeAt(1))){let a=2,l=a;for(;a2&&Pt(s.charCodeAt(2))&&(n=!0,t=3));let r=t0&&Pt(s.charCodeAt(e-1))&&(r+="\\"),i===void 0?n?`\\${r}`:r:n?`${i}\\${r}`:`${i}${r}`},isAbsolute(s){In(s,"path");const e=s.length;if(e===0)return!1;const t=s.charCodeAt(0);return Pt(t)||e>2&&pu(t)&&s.charCodeAt(1)===fu&&Pt(s.charCodeAt(2))},join(...s){if(s.length===0)return".";let e,t;for(let o=0;o0&&(e===void 0?e=t=r:e+=`\\${r}`)}if(e===void 0)return".";let i=!0,n=0;if(typeof t=="string"&&Pt(t.charCodeAt(0))){++n;const o=t.length;o>1&&Pt(t.charCodeAt(1))&&(++n,o>2&&(Pt(t.charCodeAt(2))?++n:i=!1))}if(i){for(;n=2&&(e=`\\${e.slice(n)}`)}return xo.normalize(e)},relative(s,e){if(In(s,"from"),In(e,"to"),s===e)return"";const t=xo.resolve(s),i=xo.resolve(e);if(t===i||(s=t.toLowerCase(),e=i.toLowerCase(),s===e))return"";let n=0;for(;nn&&s.charCodeAt(o-1)===Vo;)o--;const r=o-n;let a=0;for(;aa&&e.charCodeAt(l-1)===Vo;)l--;const d=l-a,c=rc){if(e.charCodeAt(a+h)===Vo)return i.slice(a+h+1);if(h===2)return i.slice(a+h)}r>c&&(s.charCodeAt(n+h)===Vo?u=h:h===2&&(u=3)),u===-1&&(u=0)}let g="";for(h=n+u+1;h<=o;++h)(h===o||s.charCodeAt(h)===Vo)&&(g+=g.length===0?"..":"\\..");return a+=u,g.length>0?`${g}${i.slice(a,l)}`:(i.charCodeAt(a)===Vo&&++a,i.slice(a,l))},toNamespacedPath(s){if(typeof s!="string"||s.length===0)return s;const e=xo.resolve(s);if(e.length<=2)return s;if(e.charCodeAt(0)===Vo){if(e.charCodeAt(1)===Vo){const t=e.charCodeAt(2);if(t!==nre&&t!==ih)return`\\\\?\\UNC\\${e.slice(2)}`}}else if(pu(e.charCodeAt(0))&&e.charCodeAt(1)===fu&&e.charCodeAt(2)===Vo)return`\\\\?\\${e}`;return s},dirname(s){In(s,"path");const e=s.length;if(e===0)return".";let t=-1,i=0;const n=s.charCodeAt(0);if(e===1)return Pt(n)?s:".";if(Pt(n)){if(t=i=1,Pt(s.charCodeAt(1))){let a=2,l=a;for(;a2&&Pt(s.charCodeAt(2))?3:2,i=t);let o=-1,r=!0;for(let a=e-1;a>=i;--a)if(Pt(s.charCodeAt(a))){if(!r){o=a;break}}else r=!1;if(o===-1){if(t===-1)return".";o=t}return s.slice(0,o)},basename(s,e){e!==void 0&&In(e,"ext"),In(s,"path");let t=0,i=-1,n=!0,o;if(s.length>=2&&pu(s.charCodeAt(0))&&s.charCodeAt(1)===fu&&(t=2),e!==void 0&&e.length>0&&e.length<=s.length){if(e===s)return"";let r=e.length-1,a=-1;for(o=s.length-1;o>=t;--o){const l=s.charCodeAt(o);if(Pt(l)){if(!n){t=o+1;break}}else a===-1&&(n=!1,a=o+1),r>=0&&(l===e.charCodeAt(r)?--r===-1&&(i=o):(r=-1,i=a))}return t===i?i=a:i===-1&&(i=s.length),s.slice(t,i)}for(o=s.length-1;o>=t;--o)if(Pt(s.charCodeAt(o))){if(!n){t=o+1;break}}else i===-1&&(n=!1,i=o+1);return i===-1?"":s.slice(t,i)},extname(s){In(s,"path");let e=0,t=-1,i=0,n=-1,o=!0,r=0;s.length>=2&&s.charCodeAt(1)===fu&&pu(s.charCodeAt(0))&&(e=i=2);for(let a=s.length-1;a>=e;--a){const l=s.charCodeAt(a);if(Pt(l)){if(!o){i=a+1;break}continue}n===-1&&(o=!1,n=a+1),l===ih?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?"":s.slice(t,n)},format:GV.bind(null,"\\"),parse(s){In(s,"path");const e={root:"",dir:"",base:"",ext:"",name:""};if(s.length===0)return e;const t=s.length;let i=0,n=s.charCodeAt(0);if(t===1)return Pt(n)?(e.root=e.dir=s,e):(e.base=e.name=s,e);if(Pt(n)){if(i=1,Pt(s.charCodeAt(1))){let u=2,h=u;for(;u0&&(e.root=s.slice(0,i));let o=-1,r=i,a=-1,l=!0,d=s.length-1,c=0;for(;d>=i;--d){if(n=s.charCodeAt(d),Pt(n)){if(!l){r=d+1;break}continue}a===-1&&(l=!1,a=d+1),n===ih?o===-1?o=d:c!==1&&(c=1):o!==-1&&(c=-1)}return a!==-1&&(o===-1||c===0||c===1&&o===a-1&&o===r+1?e.base=e.name=s.slice(r,a):(e.name=s.slice(r,o),e.base=s.slice(r,a),e.ext=s.slice(o,a))),r>0&&r!==i?e.dir=s.slice(0,r-1):e.dir=e.root,e},sep:"\\",delimiter:";",win32:null,posix:null},ore=(()=>{if(eg){const s=/\\/g;return()=>{const e=AS().replace(s,"/");return e.slice(e.indexOf("/"))}}return()=>AS()})(),Yi={resolve(...s){let e="",t=!1;for(let i=s.length-1;i>=-1&&!t;i--){const n=i>=0?s[i]:ore();In(n,"path"),n.length!==0&&(e=`${n}/${e}`,t=n.charCodeAt(0)===gs)}return e=MS(e,!t,"/",JT),t?`/${e}`:e.length>0?e:"."},normalize(s){if(In(s,"path"),s.length===0)return".";const e=s.charCodeAt(0)===gs,t=s.charCodeAt(s.length-1)===gs;return s=MS(s,!e,"/",JT),s.length===0?e?"/":t?"./":".":(t&&(s+="/"),e?`/${s}`:s)},isAbsolute(s){return In(s,"path"),s.length>0&&s.charCodeAt(0)===gs},join(...s){if(s.length===0)return".";let e;for(let t=0;t0&&(e===void 0?e=i:e+=`/${i}`)}return e===void 0?".":Yi.normalize(e)},relative(s,e){if(In(s,"from"),In(e,"to"),s===e||(s=Yi.resolve(s),e=Yi.resolve(e),s===e))return"";const t=1,i=s.length,n=i-t,o=1,r=e.length-o,a=na){if(e.charCodeAt(o+d)===gs)return e.slice(o+d+1);if(d===0)return e.slice(o+d)}else n>a&&(s.charCodeAt(t+d)===gs?l=d:d===0&&(l=0));let c="";for(d=t+l+1;d<=i;++d)(d===i||s.charCodeAt(d)===gs)&&(c+=c.length===0?"..":"/..");return`${c}${e.slice(o+l)}`},toNamespacedPath(s){return s},dirname(s){if(In(s,"path"),s.length===0)return".";const e=s.charCodeAt(0)===gs;let t=-1,i=!0;for(let n=s.length-1;n>=1;--n)if(s.charCodeAt(n)===gs){if(!i){t=n;break}}else i=!1;return t===-1?e?"/":".":e&&t===1?"//":s.slice(0,t)},basename(s,e){e!==void 0&&In(e,"ext"),In(s,"path");let t=0,i=-1,n=!0,o;if(e!==void 0&&e.length>0&&e.length<=s.length){if(e===s)return"";let r=e.length-1,a=-1;for(o=s.length-1;o>=0;--o){const l=s.charCodeAt(o);if(l===gs){if(!n){t=o+1;break}}else a===-1&&(n=!1,a=o+1),r>=0&&(l===e.charCodeAt(r)?--r===-1&&(i=o):(r=-1,i=a))}return t===i?i=a:i===-1&&(i=s.length),s.slice(t,i)}for(o=s.length-1;o>=0;--o)if(s.charCodeAt(o)===gs){if(!n){t=o+1;break}}else i===-1&&(n=!1,i=o+1);return i===-1?"":s.slice(t,i)},extname(s){In(s,"path");let e=-1,t=0,i=-1,n=!0,o=0;for(let r=s.length-1;r>=0;--r){const a=s.charCodeAt(r);if(a===gs){if(!n){t=r+1;break}continue}i===-1&&(n=!1,i=r+1),a===ih?e===-1?e=r:o!==1&&(o=1):e!==-1&&(o=-1)}return e===-1||i===-1||o===0||o===1&&e===i-1&&e===t+1?"":s.slice(e,i)},format:GV.bind(null,"/"),parse(s){In(s,"path");const e={root:"",dir:"",base:"",ext:"",name:""};if(s.length===0)return e;const t=s.charCodeAt(0)===gs;let i;t?(e.root="/",i=1):i=0;let n=-1,o=0,r=-1,a=!0,l=s.length-1,d=0;for(;l>=i;--l){const c=s.charCodeAt(l);if(c===gs){if(!a){o=l+1;break}continue}r===-1&&(a=!1,r=l+1),c===ih?n===-1?n=l:d!==1&&(d=1):n!==-1&&(d=-1)}if(r!==-1){const c=o===0&&t?1:o;n===-1||d===0||d===1&&n===r-1&&n===o+1?e.base=e.name=s.slice(c,r):(e.name=s.slice(c,n),e.base=s.slice(c,r),e.ext=s.slice(n,r))}return o>0?e.dir=s.slice(0,o-1):t&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null};Yi.win32=xo.win32=xo;Yi.posix=xo.posix=Yi;const ZV=eg?xo.normalize:Yi.normalize,rre=eg?xo.resolve:Yi.resolve,are=eg?xo.relative:Yi.relative,XV=eg?xo.dirname:Yi.dirname,nh=eg?xo.basename:Yi.basename,lre=eg?xo.extname:Yi.extname,sh=eg?xo.sep:Yi.sep,dre=/^\w[\w\d+.-]*$/,cre=/^\//,ure=/^\/\//;function hre(s,e){if(!s.scheme&&e)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${s.authority}", path: "${s.path}", query: "${s.query}", fragment: "${s.fragment}"}`);if(s.scheme&&!dre.test(s.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(s.path){if(s.authority){if(!cre.test(s.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(ure.test(s.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}function gre(s,e){return!s&&!e?"file":s}function fre(s,e){switch(s){case"https":case"http":case"file":e?e[0]!==Ha&&(e=Ha+e):e=Ha;break}return e}const $i="",Ha="/",pre=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class Ae{static isUri(e){return e instanceof Ae?!0:e?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":!1}constructor(e,t,i,n,o,r=!1){typeof e=="object"?(this.scheme=e.scheme||$i,this.authority=e.authority||$i,this.path=e.path||$i,this.query=e.query||$i,this.fragment=e.fragment||$i):(this.scheme=gre(e,r),this.authority=t||$i,this.path=fre(this.scheme,i||$i),this.query=n||$i,this.fragment=o||$i,hre(this,r))}get fsPath(){return RS(this,!1)}with(e){if(!e)return this;let{scheme:t,authority:i,path:n,query:o,fragment:r}=e;return t===void 0?t=this.scheme:t===null&&(t=$i),i===void 0?i=this.authority:i===null&&(i=$i),n===void 0?n=this.path:n===null&&(n=$i),o===void 0?o=this.query:o===null&&(o=$i),r===void 0?r=this.fragment:r===null&&(r=$i),t===this.scheme&&i===this.authority&&n===this.path&&o===this.query&&r===this.fragment?this:new Sp(t,i,n,o,r)}static parse(e,t=!1){const i=pre.exec(e);return i?new Sp(i[2]||$i,cw(i[4]||$i),cw(i[5]||$i),cw(i[7]||$i),cw(i[9]||$i),t):new Sp($i,$i,$i,$i,$i)}static file(e){let t=$i;if(as&&(e=e.replace(/\\/g,Ha)),e[0]===Ha&&e[1]===Ha){const i=e.indexOf(Ha,2);i===-1?(t=e.substring(2),e=Ha):(t=e.substring(2,i),e=e.substring(i)||Ha)}return new Sp("file",t,e,$i,$i)}static from(e,t){return new Sp(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 as&&e.scheme==="file"?i=Ae.file(xo.join(RS(e,!0),...t)).path:i=Yi.join(e.path,...t),e.with({path:i})}toString(e=!1){return eN(this,e)}toJSON(){return this}static revive(e){var t,i;if(e){if(e instanceof Ae)return e;{const n=new Sp(e);return n._formatted=(t=e.external)!==null&&t!==void 0?t:null,n._fsPath=e._sep===YV&&(i=e.fsPath)!==null&&i!==void 0?i:null,n}}else return e}}const YV=as?1:void 0;let Sp=class extends Ae{constructor(){super(...arguments),this._formatted=null,this._fsPath=null}get fsPath(){return this._fsPath||(this._fsPath=RS(this,!1)),this._fsPath}toString(e=!1){return e?eN(this,!0):(this._formatted||(this._formatted=eN(this,!1)),this._formatted)}toJSON(){const e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=YV),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 s3(s,e,t){let i,n=-1;for(let o=0;o=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(s.substring(n,o)),n=-1),i!==void 0&&(i+=s.charAt(o));else{i===void 0&&(i=s.substr(0,o));const a=QV[r];a!==void 0?(n!==-1&&(i+=encodeURIComponent(s.substring(n,o)),n=-1),i+=a):n===-1&&(n=o)}}return n!==-1&&(i+=encodeURIComponent(s.substring(n))),i!==void 0?i:s}function mre(s){let e;for(let t=0;t1&&s.scheme==="file"?t=`//${s.authority}${s.path}`:s.path.charCodeAt(0)===47&&(s.path.charCodeAt(1)>=65&&s.path.charCodeAt(1)<=90||s.path.charCodeAt(1)>=97&&s.path.charCodeAt(1)<=122)&&s.path.charCodeAt(2)===58?e?t=s.path.substr(1):t=s.path[1].toLowerCase()+s.path.substr(2):t=s.path,as&&(t=t.replace(/\//g,"\\")),t}function eN(s,e){const t=e?mre:s3;let i="",{scheme:n,authority:o,path:r,query:a,fragment:l}=s;if(n&&(i+=n,i+=":"),(o||n==="file")&&(i+=Ha,i+=Ha),o){let d=o.indexOf("@");if(d!==-1){const c=o.substr(0,d);o=o.substr(d+1),d=c.lastIndexOf(":"),d===-1?i+=t(c,!1,!1):(i+=t(c.substr(0,d),!1,!1),i+=":",i+=t(c.substr(d+1),!1,!0)),i+="@"}o=o.toLowerCase(),d=o.lastIndexOf(":"),d===-1?i+=t(o,!1,!0):(i+=t(o.substr(0,d),!1,!0),i+=o.substr(d))}if(r){if(r.length>=3&&r.charCodeAt(0)===47&&r.charCodeAt(2)===58){const d=r.charCodeAt(1);d>=65&&d<=90&&(r=`/${String.fromCharCode(d+32)}:${r.substr(3)}`)}else if(r.length>=2&&r.charCodeAt(1)===58){const d=r.charCodeAt(0);d>=65&&d<=90&&(r=`${String.fromCharCode(d+32)}:${r.substr(2)}`)}i+=t(r,!0,!1)}return a&&(i+="?",i+=t(a,!1,!1)),l&&(i+="#",i+=e?l:s3(l,!1,!1)),i}function JV(s){try{return decodeURIComponent(s)}catch{return s.length>3?s.substr(0,3)+JV(s.substr(3)):s}}const o3=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function cw(s){return s.match(o3)?s.replace(o3,e=>JV(e)):s}let W=class Eg{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 Eg(e,t)}delta(e=0,t=0){return this.with(this.lineNumber+e,this.column+t)}equals(e){return Eg.equals(this,e)}static equals(e,t){return!e&&!t?!0:!!e&&!!t&&e.lineNumber===t.lineNumber&&e.column===t.column}isBefore(e){return Eg.isBefore(this,e)}static isBefore(e,t){return e.lineNumberi||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 Fn.isEmpty(this)}static isEmpty(e){return e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn}containsPosition(e){return Fn.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 Fn.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 Fn.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 Fn.plusRange(this,e)}static plusRange(e,t){let i,n,o,r;return t.startLineNumbere.endLineNumber?(o=t.endLineNumber,r=t.endColumn):t.endLineNumber===e.endLineNumber?(o=t.endLineNumber,r=Math.max(t.endColumn,e.endColumn)):(o=e.endLineNumber,r=e.endColumn),new Fn(i,n,o,r)}intersectRanges(e){return Fn.intersectRanges(this,e)}static intersectRanges(e,t){let i=e.startLineNumber,n=e.startColumn,o=e.endLineNumber,r=e.endColumn;const a=t.startLineNumber,l=t.startColumn,d=t.endLineNumber,c=t.endColumn;return id?(o=d,r=c):o===d&&(r=Math.min(r,c)),i>o||i===o&&n>r?null:new Fn(i,n,o,r)}equalsRange(e){return Fn.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 Fn.getEndPosition(this)}static getEndPosition(e){return new W(e.endLineNumber,e.endColumn)}getStartPosition(){return Fn.getStartPosition(this)}static getStartPosition(e){return new W(e.startLineNumber,e.startColumn)}toString(){return"["+this.startLineNumber+","+this.startColumn+" -> "+this.endLineNumber+","+this.endColumn+"]"}setEndPosition(e,t){return new Fn(this.startLineNumber,this.startColumn,e,t)}setStartPosition(e,t){return new Fn(e,t,this.endLineNumber,this.endColumn)}collapseToStart(){return Fn.collapseToStart(this)}static collapseToStart(e){return new Fn(e.startLineNumber,e.startColumn,e.startLineNumber,e.startColumn)}collapseToEnd(){return Fn.collapseToEnd(this)}static collapseToEnd(e){return new Fn(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn)}delta(e){return new Fn(this.startLineNumber+e,this.startColumn,this.endLineNumber+e,this.endColumn)}static fromPositions(e,t=e){return new Fn(e.lineNumber,e.column,t.lineNumber,t.column)}static lift(e){return e?new Fn(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}},we=class Yr extends x{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 Yr.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 Yr(this.startLineNumber,this.startColumn,e,t):new Yr(e,t,this.startLineNumber,this.startColumn)}getPosition(){return new W(this.positionLineNumber,this.positionColumn)}getSelectionStart(){return new W(this.selectionStartLineNumber,this.selectionStartColumn)}setStartPosition(e,t){return this.getDirection()===0?new Yr(e,t,this.endLineNumber,this.endColumn):new Yr(this.endLineNumber,this.endColumn,e,t)}static fromPositions(e,t=e){return new Yr(e.lineNumber,e.column,t.lineNumber,t.column)}static fromRange(e,t){return t===0?new Yr(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn):new Yr(e.endLineNumber,e.endColumn,e.startLineNumber,e.startColumn)}static liftSelection(e){return new Yr(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;i{this._tokenizationSupports.get(e)===t&&(this._tokenizationSupports.delete(e),this.handleChange([e]))})}get(e){return this._tokenizationSupports.get(e)||null}registerFactory(e,t){var i;(i=this._factories.get(e))===null||i===void 0||i.dispose();const n=new Cre(this,e,t);return this._factories.set(e,n),Ie(()=>{const o=this._factories.get(e);!o||o!==n||(this._factories.delete(e),o.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 Cre extends H{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 Ib=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 ZP{constructor(e,t){this.tokens=e,this.endState=t,this._tokenizationResultBrand=void 0}}class KL{constructor(e,t){this.tokens=e,this.endState=t,this._encodedTokenizationResultBrand=void 0}}var ja;(function(s){s[s.Increase=0]="Increase",s[s.Decrease=1]="Decrease"})(ja||(ja={}));var Tb;(function(s){const e=new Map;e.set(0,oe.symbolMethod),e.set(1,oe.symbolFunction),e.set(2,oe.symbolConstructor),e.set(3,oe.symbolField),e.set(4,oe.symbolVariable),e.set(5,oe.symbolClass),e.set(6,oe.symbolStruct),e.set(7,oe.symbolInterface),e.set(8,oe.symbolModule),e.set(9,oe.symbolProperty),e.set(10,oe.symbolEvent),e.set(11,oe.symbolOperator),e.set(12,oe.symbolUnit),e.set(13,oe.symbolValue),e.set(15,oe.symbolEnum),e.set(14,oe.symbolConstant),e.set(15,oe.symbolEnum),e.set(16,oe.symbolEnumMember),e.set(17,oe.symbolKeyword),e.set(27,oe.symbolSnippet),e.set(18,oe.symbolText),e.set(19,oe.symbolColor),e.set(20,oe.symbolFile),e.set(21,oe.symbolReference),e.set(22,oe.symbolCustomColor),e.set(23,oe.symbolFolder),e.set(24,oe.symbolTypeParameter),e.set(25,oe.account),e.set(26,oe.issues);function t(o){let r=e.get(o);return r||(console.info("No codicon found for CompletionItemKind "+o),r=oe.symbolProperty),r}s.toIcon=t;const i=new Map;i.set("method",0),i.set("function",1),i.set("constructor",2),i.set("field",3),i.set("variable",4),i.set("class",5),i.set("struct",6),i.set("interface",7),i.set("module",8),i.set("property",9),i.set("event",10),i.set("operator",11),i.set("unit",12),i.set("value",13),i.set("constant",14),i.set("enum",15),i.set("enum-member",16),i.set("enumMember",16),i.set("keyword",17),i.set("snippet",27),i.set("text",18),i.set("color",19),i.set("file",20),i.set("reference",21),i.set("customcolor",22),i.set("folder",23),i.set("type-parameter",24),i.set("typeParameter",24),i.set("account",25),i.set("issue",26);function n(o,r){let a=i.get(o);return typeof a>"u"&&!r&&(a=9),a}s.fromString=n})(Tb||(Tb={}));var kc;(function(s){s[s.Automatic=0]="Automatic",s[s.Explicit=1]="Explicit"})(kc||(kc={}));class tz{constructor(e,t,i,n){this.range=e,this.text=t,this.completionKind=i,this.isSnippetText=n}equals(e){return x.lift(this.range).equalsRange(e.range)&&this.text===e.text&&this.completionKind===e.completionKind&&this.isSnippetText===e.isSnippetText}}var Nb;(function(s){s[s.Automatic=0]="Automatic",s[s.PasteAs=1]="PasteAs"})(Nb||(Nb={}));var ad;(function(s){s[s.Invoke=1]="Invoke",s[s.TriggerCharacter=2]="TriggerCharacter",s[s.ContentChange=3]="ContentChange"})(ad||(ad={}));var Ab;(function(s){s[s.Text=0]="Text",s[s.Read=1]="Read",s[s.Write=2]="Write"})(Ab||(Ab={}));function wre(s){return s&&Ae.isUri(s.uri)&&x.isIRange(s.range)&&(x.isIRange(s.originSelectionRange)||x.isIRange(s.targetSelectionRange))}p("Array","array"),p("Boolean","boolean"),p("Class","class"),p("Constant","constant"),p("Constructor","constructor"),p("Enum","enumeration"),p("EnumMember","enumeration member"),p("Event","event"),p("Field","field"),p("File","file"),p("Function","function"),p("Interface","interface"),p("Key","key"),p("Method","method"),p("Module","module"),p("Namespace","namespace"),p("Null","null"),p("Number","number"),p("Object","object"),p("Operator","operator"),p("Package","package"),p("Property","property"),p("String","string"),p("Struct","struct"),p("TypeParameter","type parameter"),p("Variable","variable");var iN;(function(s){const e=new Map;e.set(0,oe.symbolFile),e.set(1,oe.symbolModule),e.set(2,oe.symbolNamespace),e.set(3,oe.symbolPackage),e.set(4,oe.symbolClass),e.set(5,oe.symbolMethod),e.set(6,oe.symbolProperty),e.set(7,oe.symbolField),e.set(8,oe.symbolConstructor),e.set(9,oe.symbolEnum),e.set(10,oe.symbolInterface),e.set(11,oe.symbolFunction),e.set(12,oe.symbolVariable),e.set(13,oe.symbolConstant),e.set(14,oe.symbolString),e.set(15,oe.symbolNumber),e.set(16,oe.symbolBoolean),e.set(17,oe.symbolArray),e.set(18,oe.symbolObject),e.set(19,oe.symbolKey),e.set(20,oe.symbolNull),e.set(21,oe.symbolEnumMember),e.set(22,oe.symbolStruct),e.set(23,oe.symbolEvent),e.set(24,oe.symbolOperator),e.set(25,oe.symbolTypeParameter);function t(i){let n=e.get(i);return n||(console.info("No codicon found for SymbolKind "+i),n=oe.symbolProperty),n}s.toIcon=t})(iN||(iN={}));class Ps{static fromValue(e){switch(e){case"comment":return Ps.Comment;case"imports":return Ps.Imports;case"region":return Ps.Region}return new Ps(e)}constructor(e){this.value=e}}Ps.Comment=new Ps("comment");Ps.Imports=new Ps("imports");Ps.Region=new Ps("region");var nN;(function(s){s[s.AIGenerated=1]="AIGenerated"})(nN||(nN={}));var Mb;(function(s){s[s.Invoke=0]="Invoke",s[s.Automatic=1]="Automatic"})(Mb||(Mb={}));var sN;(function(s){function e(t){return!t||typeof t!="object"?!1:typeof t.id=="string"&&typeof t.title=="string"}s.is=e})(sN||(sN={}));var PS;(function(s){s[s.Type=1]="Type",s[s.Parameter=2]="Parameter"})(PS||(PS={}));class yre{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 Ki=new bre;var FS;(function(s){s[s.Invoke=0]="Invoke",s[s.Automatic=1]="Automatic"})(FS||(FS={}));var oN;(function(s){s[s.Unknown=0]="Unknown",s[s.Disabled=1]="Disabled",s[s.Enabled=2]="Enabled"})(oN||(oN={}));var rN;(function(s){s[s.Invoke=1]="Invoke",s[s.Auto=2]="Auto"})(rN||(rN={}));var aN;(function(s){s[s.None=0]="None",s[s.KeepWhitespace=1]="KeepWhitespace",s[s.InsertAsSnippet=4]="InsertAsSnippet"})(aN||(aN={}));var lN;(function(s){s[s.Method=0]="Method",s[s.Function=1]="Function",s[s.Constructor=2]="Constructor",s[s.Field=3]="Field",s[s.Variable=4]="Variable",s[s.Class=5]="Class",s[s.Struct=6]="Struct",s[s.Interface=7]="Interface",s[s.Module=8]="Module",s[s.Property=9]="Property",s[s.Event=10]="Event",s[s.Operator=11]="Operator",s[s.Unit=12]="Unit",s[s.Value=13]="Value",s[s.Constant=14]="Constant",s[s.Enum=15]="Enum",s[s.EnumMember=16]="EnumMember",s[s.Keyword=17]="Keyword",s[s.Text=18]="Text",s[s.Color=19]="Color",s[s.File=20]="File",s[s.Reference=21]="Reference",s[s.Customcolor=22]="Customcolor",s[s.Folder=23]="Folder",s[s.TypeParameter=24]="TypeParameter",s[s.User=25]="User",s[s.Issue=26]="Issue",s[s.Snippet=27]="Snippet"})(lN||(lN={}));var dN;(function(s){s[s.Deprecated=1]="Deprecated"})(dN||(dN={}));var cN;(function(s){s[s.Invoke=0]="Invoke",s[s.TriggerCharacter=1]="TriggerCharacter",s[s.TriggerForIncompleteCompletions=2]="TriggerForIncompleteCompletions"})(cN||(cN={}));var uN;(function(s){s[s.EXACT=0]="EXACT",s[s.ABOVE=1]="ABOVE",s[s.BELOW=2]="BELOW"})(uN||(uN={}));var hN;(function(s){s[s.NotSet=0]="NotSet",s[s.ContentFlush=1]="ContentFlush",s[s.RecoverFromMarkers=2]="RecoverFromMarkers",s[s.Explicit=3]="Explicit",s[s.Paste=4]="Paste",s[s.Undo=5]="Undo",s[s.Redo=6]="Redo"})(hN||(hN={}));var gN;(function(s){s[s.LF=1]="LF",s[s.CRLF=2]="CRLF"})(gN||(gN={}));var fN;(function(s){s[s.Text=0]="Text",s[s.Read=1]="Read",s[s.Write=2]="Write"})(fN||(fN={}));var pN;(function(s){s[s.None=0]="None",s[s.Keep=1]="Keep",s[s.Brackets=2]="Brackets",s[s.Advanced=3]="Advanced",s[s.Full=4]="Full"})(pN||(pN={}));var mN;(function(s){s[s.acceptSuggestionOnCommitCharacter=0]="acceptSuggestionOnCommitCharacter",s[s.acceptSuggestionOnEnter=1]="acceptSuggestionOnEnter",s[s.accessibilitySupport=2]="accessibilitySupport",s[s.accessibilityPageSize=3]="accessibilityPageSize",s[s.ariaLabel=4]="ariaLabel",s[s.ariaRequired=5]="ariaRequired",s[s.autoClosingBrackets=6]="autoClosingBrackets",s[s.autoClosingComments=7]="autoClosingComments",s[s.screenReaderAnnounceInlineSuggestion=8]="screenReaderAnnounceInlineSuggestion",s[s.autoClosingDelete=9]="autoClosingDelete",s[s.autoClosingOvertype=10]="autoClosingOvertype",s[s.autoClosingQuotes=11]="autoClosingQuotes",s[s.autoIndent=12]="autoIndent",s[s.automaticLayout=13]="automaticLayout",s[s.autoSurround=14]="autoSurround",s[s.bracketPairColorization=15]="bracketPairColorization",s[s.guides=16]="guides",s[s.codeLens=17]="codeLens",s[s.codeLensFontFamily=18]="codeLensFontFamily",s[s.codeLensFontSize=19]="codeLensFontSize",s[s.colorDecorators=20]="colorDecorators",s[s.colorDecoratorsLimit=21]="colorDecoratorsLimit",s[s.columnSelection=22]="columnSelection",s[s.comments=23]="comments",s[s.contextmenu=24]="contextmenu",s[s.copyWithSyntaxHighlighting=25]="copyWithSyntaxHighlighting",s[s.cursorBlinking=26]="cursorBlinking",s[s.cursorSmoothCaretAnimation=27]="cursorSmoothCaretAnimation",s[s.cursorStyle=28]="cursorStyle",s[s.cursorSurroundingLines=29]="cursorSurroundingLines",s[s.cursorSurroundingLinesStyle=30]="cursorSurroundingLinesStyle",s[s.cursorWidth=31]="cursorWidth",s[s.disableLayerHinting=32]="disableLayerHinting",s[s.disableMonospaceOptimizations=33]="disableMonospaceOptimizations",s[s.domReadOnly=34]="domReadOnly",s[s.dragAndDrop=35]="dragAndDrop",s[s.dropIntoEditor=36]="dropIntoEditor",s[s.emptySelectionClipboard=37]="emptySelectionClipboard",s[s.experimentalWhitespaceRendering=38]="experimentalWhitespaceRendering",s[s.extraEditorClassName=39]="extraEditorClassName",s[s.fastScrollSensitivity=40]="fastScrollSensitivity",s[s.find=41]="find",s[s.fixedOverflowWidgets=42]="fixedOverflowWidgets",s[s.folding=43]="folding",s[s.foldingStrategy=44]="foldingStrategy",s[s.foldingHighlight=45]="foldingHighlight",s[s.foldingImportsByDefault=46]="foldingImportsByDefault",s[s.foldingMaximumRegions=47]="foldingMaximumRegions",s[s.unfoldOnClickAfterEndOfLine=48]="unfoldOnClickAfterEndOfLine",s[s.fontFamily=49]="fontFamily",s[s.fontInfo=50]="fontInfo",s[s.fontLigatures=51]="fontLigatures",s[s.fontSize=52]="fontSize",s[s.fontWeight=53]="fontWeight",s[s.fontVariations=54]="fontVariations",s[s.formatOnPaste=55]="formatOnPaste",s[s.formatOnType=56]="formatOnType",s[s.glyphMargin=57]="glyphMargin",s[s.gotoLocation=58]="gotoLocation",s[s.hideCursorInOverviewRuler=59]="hideCursorInOverviewRuler",s[s.hover=60]="hover",s[s.inDiffEditor=61]="inDiffEditor",s[s.inlineSuggest=62]="inlineSuggest",s[s.inlineEdit=63]="inlineEdit",s[s.letterSpacing=64]="letterSpacing",s[s.lightbulb=65]="lightbulb",s[s.lineDecorationsWidth=66]="lineDecorationsWidth",s[s.lineHeight=67]="lineHeight",s[s.lineNumbers=68]="lineNumbers",s[s.lineNumbersMinChars=69]="lineNumbersMinChars",s[s.linkedEditing=70]="linkedEditing",s[s.links=71]="links",s[s.matchBrackets=72]="matchBrackets",s[s.minimap=73]="minimap",s[s.mouseStyle=74]="mouseStyle",s[s.mouseWheelScrollSensitivity=75]="mouseWheelScrollSensitivity",s[s.mouseWheelZoom=76]="mouseWheelZoom",s[s.multiCursorMergeOverlapping=77]="multiCursorMergeOverlapping",s[s.multiCursorModifier=78]="multiCursorModifier",s[s.multiCursorPaste=79]="multiCursorPaste",s[s.multiCursorLimit=80]="multiCursorLimit",s[s.occurrencesHighlight=81]="occurrencesHighlight",s[s.overviewRulerBorder=82]="overviewRulerBorder",s[s.overviewRulerLanes=83]="overviewRulerLanes",s[s.padding=84]="padding",s[s.pasteAs=85]="pasteAs",s[s.parameterHints=86]="parameterHints",s[s.peekWidgetDefaultFocus=87]="peekWidgetDefaultFocus",s[s.definitionLinkOpensInPeek=88]="definitionLinkOpensInPeek",s[s.quickSuggestions=89]="quickSuggestions",s[s.quickSuggestionsDelay=90]="quickSuggestionsDelay",s[s.readOnly=91]="readOnly",s[s.readOnlyMessage=92]="readOnlyMessage",s[s.renameOnType=93]="renameOnType",s[s.renderControlCharacters=94]="renderControlCharacters",s[s.renderFinalNewline=95]="renderFinalNewline",s[s.renderLineHighlight=96]="renderLineHighlight",s[s.renderLineHighlightOnlyWhenFocus=97]="renderLineHighlightOnlyWhenFocus",s[s.renderValidationDecorations=98]="renderValidationDecorations",s[s.renderWhitespace=99]="renderWhitespace",s[s.revealHorizontalRightPadding=100]="revealHorizontalRightPadding",s[s.roundedSelection=101]="roundedSelection",s[s.rulers=102]="rulers",s[s.scrollbar=103]="scrollbar",s[s.scrollBeyondLastColumn=104]="scrollBeyondLastColumn",s[s.scrollBeyondLastLine=105]="scrollBeyondLastLine",s[s.scrollPredominantAxis=106]="scrollPredominantAxis",s[s.selectionClipboard=107]="selectionClipboard",s[s.selectionHighlight=108]="selectionHighlight",s[s.selectOnLineNumbers=109]="selectOnLineNumbers",s[s.showFoldingControls=110]="showFoldingControls",s[s.showUnused=111]="showUnused",s[s.snippetSuggestions=112]="snippetSuggestions",s[s.smartSelect=113]="smartSelect",s[s.smoothScrolling=114]="smoothScrolling",s[s.stickyScroll=115]="stickyScroll",s[s.stickyTabStops=116]="stickyTabStops",s[s.stopRenderingLineAfter=117]="stopRenderingLineAfter",s[s.suggest=118]="suggest",s[s.suggestFontSize=119]="suggestFontSize",s[s.suggestLineHeight=120]="suggestLineHeight",s[s.suggestOnTriggerCharacters=121]="suggestOnTriggerCharacters",s[s.suggestSelection=122]="suggestSelection",s[s.tabCompletion=123]="tabCompletion",s[s.tabIndex=124]="tabIndex",s[s.unicodeHighlighting=125]="unicodeHighlighting",s[s.unusualLineTerminators=126]="unusualLineTerminators",s[s.useShadowDOM=127]="useShadowDOM",s[s.useTabStops=128]="useTabStops",s[s.wordBreak=129]="wordBreak",s[s.wordSegmenterLocales=130]="wordSegmenterLocales",s[s.wordSeparators=131]="wordSeparators",s[s.wordWrap=132]="wordWrap",s[s.wordWrapBreakAfterCharacters=133]="wordWrapBreakAfterCharacters",s[s.wordWrapBreakBeforeCharacters=134]="wordWrapBreakBeforeCharacters",s[s.wordWrapColumn=135]="wordWrapColumn",s[s.wordWrapOverride1=136]="wordWrapOverride1",s[s.wordWrapOverride2=137]="wordWrapOverride2",s[s.wrappingIndent=138]="wrappingIndent",s[s.wrappingStrategy=139]="wrappingStrategy",s[s.showDeprecated=140]="showDeprecated",s[s.inlayHints=141]="inlayHints",s[s.editorClassName=142]="editorClassName",s[s.pixelRatio=143]="pixelRatio",s[s.tabFocusMode=144]="tabFocusMode",s[s.layoutInfo=145]="layoutInfo",s[s.wrappingInfo=146]="wrappingInfo",s[s.defaultColorDecorators=147]="defaultColorDecorators",s[s.colorDecoratorsActivatedOn=148]="colorDecoratorsActivatedOn",s[s.inlineCompletionsAccessibilityVerbose=149]="inlineCompletionsAccessibilityVerbose"})(mN||(mN={}));var _N;(function(s){s[s.TextDefined=0]="TextDefined",s[s.LF=1]="LF",s[s.CRLF=2]="CRLF"})(_N||(_N={}));var vN;(function(s){s[s.LF=0]="LF",s[s.CRLF=1]="CRLF"})(vN||(vN={}));var bN;(function(s){s[s.Left=1]="Left",s[s.Center=2]="Center",s[s.Right=3]="Right"})(bN||(bN={}));var CN;(function(s){s[s.Increase=0]="Increase",s[s.Decrease=1]="Decrease"})(CN||(CN={}));var wN;(function(s){s[s.None=0]="None",s[s.Indent=1]="Indent",s[s.IndentOutdent=2]="IndentOutdent",s[s.Outdent=3]="Outdent"})(wN||(wN={}));var yN;(function(s){s[s.Both=0]="Both",s[s.Right=1]="Right",s[s.Left=2]="Left",s[s.None=3]="None"})(yN||(yN={}));var SN;(function(s){s[s.Type=1]="Type",s[s.Parameter=2]="Parameter"})(SN||(SN={}));var DN;(function(s){s[s.Automatic=0]="Automatic",s[s.Explicit=1]="Explicit"})(DN||(DN={}));var LN;(function(s){s[s.Invoke=0]="Invoke",s[s.Automatic=1]="Automatic"})(LN||(LN={}));var xN;(function(s){s[s.DependsOnKbLayout=-1]="DependsOnKbLayout",s[s.Unknown=0]="Unknown",s[s.Backspace=1]="Backspace",s[s.Tab=2]="Tab",s[s.Enter=3]="Enter",s[s.Shift=4]="Shift",s[s.Ctrl=5]="Ctrl",s[s.Alt=6]="Alt",s[s.PauseBreak=7]="PauseBreak",s[s.CapsLock=8]="CapsLock",s[s.Escape=9]="Escape",s[s.Space=10]="Space",s[s.PageUp=11]="PageUp",s[s.PageDown=12]="PageDown",s[s.End=13]="End",s[s.Home=14]="Home",s[s.LeftArrow=15]="LeftArrow",s[s.UpArrow=16]="UpArrow",s[s.RightArrow=17]="RightArrow",s[s.DownArrow=18]="DownArrow",s[s.Insert=19]="Insert",s[s.Delete=20]="Delete",s[s.Digit0=21]="Digit0",s[s.Digit1=22]="Digit1",s[s.Digit2=23]="Digit2",s[s.Digit3=24]="Digit3",s[s.Digit4=25]="Digit4",s[s.Digit5=26]="Digit5",s[s.Digit6=27]="Digit6",s[s.Digit7=28]="Digit7",s[s.Digit8=29]="Digit8",s[s.Digit9=30]="Digit9",s[s.KeyA=31]="KeyA",s[s.KeyB=32]="KeyB",s[s.KeyC=33]="KeyC",s[s.KeyD=34]="KeyD",s[s.KeyE=35]="KeyE",s[s.KeyF=36]="KeyF",s[s.KeyG=37]="KeyG",s[s.KeyH=38]="KeyH",s[s.KeyI=39]="KeyI",s[s.KeyJ=40]="KeyJ",s[s.KeyK=41]="KeyK",s[s.KeyL=42]="KeyL",s[s.KeyM=43]="KeyM",s[s.KeyN=44]="KeyN",s[s.KeyO=45]="KeyO",s[s.KeyP=46]="KeyP",s[s.KeyQ=47]="KeyQ",s[s.KeyR=48]="KeyR",s[s.KeyS=49]="KeyS",s[s.KeyT=50]="KeyT",s[s.KeyU=51]="KeyU",s[s.KeyV=52]="KeyV",s[s.KeyW=53]="KeyW",s[s.KeyX=54]="KeyX",s[s.KeyY=55]="KeyY",s[s.KeyZ=56]="KeyZ",s[s.Meta=57]="Meta",s[s.ContextMenu=58]="ContextMenu",s[s.F1=59]="F1",s[s.F2=60]="F2",s[s.F3=61]="F3",s[s.F4=62]="F4",s[s.F5=63]="F5",s[s.F6=64]="F6",s[s.F7=65]="F7",s[s.F8=66]="F8",s[s.F9=67]="F9",s[s.F10=68]="F10",s[s.F11=69]="F11",s[s.F12=70]="F12",s[s.F13=71]="F13",s[s.F14=72]="F14",s[s.F15=73]="F15",s[s.F16=74]="F16",s[s.F17=75]="F17",s[s.F18=76]="F18",s[s.F19=77]="F19",s[s.F20=78]="F20",s[s.F21=79]="F21",s[s.F22=80]="F22",s[s.F23=81]="F23",s[s.F24=82]="F24",s[s.NumLock=83]="NumLock",s[s.ScrollLock=84]="ScrollLock",s[s.Semicolon=85]="Semicolon",s[s.Equal=86]="Equal",s[s.Comma=87]="Comma",s[s.Minus=88]="Minus",s[s.Period=89]="Period",s[s.Slash=90]="Slash",s[s.Backquote=91]="Backquote",s[s.BracketLeft=92]="BracketLeft",s[s.Backslash=93]="Backslash",s[s.BracketRight=94]="BracketRight",s[s.Quote=95]="Quote",s[s.OEM_8=96]="OEM_8",s[s.IntlBackslash=97]="IntlBackslash",s[s.Numpad0=98]="Numpad0",s[s.Numpad1=99]="Numpad1",s[s.Numpad2=100]="Numpad2",s[s.Numpad3=101]="Numpad3",s[s.Numpad4=102]="Numpad4",s[s.Numpad5=103]="Numpad5",s[s.Numpad6=104]="Numpad6",s[s.Numpad7=105]="Numpad7",s[s.Numpad8=106]="Numpad8",s[s.Numpad9=107]="Numpad9",s[s.NumpadMultiply=108]="NumpadMultiply",s[s.NumpadAdd=109]="NumpadAdd",s[s.NUMPAD_SEPARATOR=110]="NUMPAD_SEPARATOR",s[s.NumpadSubtract=111]="NumpadSubtract",s[s.NumpadDecimal=112]="NumpadDecimal",s[s.NumpadDivide=113]="NumpadDivide",s[s.KEY_IN_COMPOSITION=114]="KEY_IN_COMPOSITION",s[s.ABNT_C1=115]="ABNT_C1",s[s.ABNT_C2=116]="ABNT_C2",s[s.AudioVolumeMute=117]="AudioVolumeMute",s[s.AudioVolumeUp=118]="AudioVolumeUp",s[s.AudioVolumeDown=119]="AudioVolumeDown",s[s.BrowserSearch=120]="BrowserSearch",s[s.BrowserHome=121]="BrowserHome",s[s.BrowserBack=122]="BrowserBack",s[s.BrowserForward=123]="BrowserForward",s[s.MediaTrackNext=124]="MediaTrackNext",s[s.MediaTrackPrevious=125]="MediaTrackPrevious",s[s.MediaStop=126]="MediaStop",s[s.MediaPlayPause=127]="MediaPlayPause",s[s.LaunchMediaPlayer=128]="LaunchMediaPlayer",s[s.LaunchMail=129]="LaunchMail",s[s.LaunchApp2=130]="LaunchApp2",s[s.Clear=131]="Clear",s[s.MAX_VALUE=132]="MAX_VALUE"})(xN||(xN={}));var kN;(function(s){s[s.Hint=1]="Hint",s[s.Info=2]="Info",s[s.Warning=4]="Warning",s[s.Error=8]="Error"})(kN||(kN={}));var EN;(function(s){s[s.Unnecessary=1]="Unnecessary",s[s.Deprecated=2]="Deprecated"})(EN||(EN={}));var IN;(function(s){s[s.Inline=1]="Inline",s[s.Gutter=2]="Gutter"})(IN||(IN={}));var TN;(function(s){s[s.Normal=1]="Normal",s[s.Underlined=2]="Underlined"})(TN||(TN={}));var NN;(function(s){s[s.UNKNOWN=0]="UNKNOWN",s[s.TEXTAREA=1]="TEXTAREA",s[s.GUTTER_GLYPH_MARGIN=2]="GUTTER_GLYPH_MARGIN",s[s.GUTTER_LINE_NUMBERS=3]="GUTTER_LINE_NUMBERS",s[s.GUTTER_LINE_DECORATIONS=4]="GUTTER_LINE_DECORATIONS",s[s.GUTTER_VIEW_ZONE=5]="GUTTER_VIEW_ZONE",s[s.CONTENT_TEXT=6]="CONTENT_TEXT",s[s.CONTENT_EMPTY=7]="CONTENT_EMPTY",s[s.CONTENT_VIEW_ZONE=8]="CONTENT_VIEW_ZONE",s[s.CONTENT_WIDGET=9]="CONTENT_WIDGET",s[s.OVERVIEW_RULER=10]="OVERVIEW_RULER",s[s.SCROLLBAR=11]="SCROLLBAR",s[s.OVERLAY_WIDGET=12]="OVERLAY_WIDGET",s[s.OUTSIDE_EDITOR=13]="OUTSIDE_EDITOR"})(NN||(NN={}));var AN;(function(s){s[s.AIGenerated=1]="AIGenerated"})(AN||(AN={}));var MN;(function(s){s[s.Invoke=0]="Invoke",s[s.Automatic=1]="Automatic"})(MN||(MN={}));var RN;(function(s){s[s.TOP_RIGHT_CORNER=0]="TOP_RIGHT_CORNER",s[s.BOTTOM_RIGHT_CORNER=1]="BOTTOM_RIGHT_CORNER",s[s.TOP_CENTER=2]="TOP_CENTER"})(RN||(RN={}));var PN;(function(s){s[s.Left=1]="Left",s[s.Center=2]="Center",s[s.Right=4]="Right",s[s.Full=7]="Full"})(PN||(PN={}));var FN;(function(s){s[s.Word=0]="Word",s[s.Line=1]="Line",s[s.Suggest=2]="Suggest"})(FN||(FN={}));var ON;(function(s){s[s.Left=0]="Left",s[s.Right=1]="Right",s[s.None=2]="None",s[s.LeftOfInjectedText=3]="LeftOfInjectedText",s[s.RightOfInjectedText=4]="RightOfInjectedText"})(ON||(ON={}));var BN;(function(s){s[s.Off=0]="Off",s[s.On=1]="On",s[s.Relative=2]="Relative",s[s.Interval=3]="Interval",s[s.Custom=4]="Custom"})(BN||(BN={}));var WN;(function(s){s[s.None=0]="None",s[s.Text=1]="Text",s[s.Blocks=2]="Blocks"})(WN||(WN={}));var HN;(function(s){s[s.Smooth=0]="Smooth",s[s.Immediate=1]="Immediate"})(HN||(HN={}));var VN;(function(s){s[s.Auto=1]="Auto",s[s.Hidden=2]="Hidden",s[s.Visible=3]="Visible"})(VN||(VN={}));var zN;(function(s){s[s.LTR=0]="LTR",s[s.RTL=1]="RTL"})(zN||(zN={}));var UN;(function(s){s.Off="off",s.OnCode="onCode",s.On="on"})(UN||(UN={}));var $N;(function(s){s[s.Invoke=1]="Invoke",s[s.TriggerCharacter=2]="TriggerCharacter",s[s.ContentChange=3]="ContentChange"})($N||($N={}));var jN;(function(s){s[s.File=0]="File",s[s.Module=1]="Module",s[s.Namespace=2]="Namespace",s[s.Package=3]="Package",s[s.Class=4]="Class",s[s.Method=5]="Method",s[s.Property=6]="Property",s[s.Field=7]="Field",s[s.Constructor=8]="Constructor",s[s.Enum=9]="Enum",s[s.Interface=10]="Interface",s[s.Function=11]="Function",s[s.Variable=12]="Variable",s[s.Constant=13]="Constant",s[s.String=14]="String",s[s.Number=15]="Number",s[s.Boolean=16]="Boolean",s[s.Array=17]="Array",s[s.Object=18]="Object",s[s.Key=19]="Key",s[s.Null=20]="Null",s[s.EnumMember=21]="EnumMember",s[s.Struct=22]="Struct",s[s.Event=23]="Event",s[s.Operator=24]="Operator",s[s.TypeParameter=25]="TypeParameter"})(jN||(jN={}));var KN;(function(s){s[s.Deprecated=1]="Deprecated"})(KN||(KN={}));var qN;(function(s){s[s.Hidden=0]="Hidden",s[s.Blink=1]="Blink",s[s.Smooth=2]="Smooth",s[s.Phase=3]="Phase",s[s.Expand=4]="Expand",s[s.Solid=5]="Solid"})(qN||(qN={}));var GN;(function(s){s[s.Line=1]="Line",s[s.Block=2]="Block",s[s.Underline=3]="Underline",s[s.LineThin=4]="LineThin",s[s.BlockOutline=5]="BlockOutline",s[s.UnderlineThin=6]="UnderlineThin"})(GN||(GN={}));var ZN;(function(s){s[s.AlwaysGrowsWhenTypingAtEdges=0]="AlwaysGrowsWhenTypingAtEdges",s[s.NeverGrowsWhenTypingAtEdges=1]="NeverGrowsWhenTypingAtEdges",s[s.GrowsOnlyWhenTypingBefore=2]="GrowsOnlyWhenTypingBefore",s[s.GrowsOnlyWhenTypingAfter=3]="GrowsOnlyWhenTypingAfter"})(ZN||(ZN={}));var XN;(function(s){s[s.None=0]="None",s[s.Same=1]="Same",s[s.Indent=2]="Indent",s[s.DeepIndent=3]="DeepIndent"})(XN||(XN={}));let l1=class{static chord(e,t){return an(e,t)}};l1.CtrlCmd=2048;l1.Shift=1024;l1.Alt=512;l1.WinCtrl=256;function iz(){return{editor:void 0,languages:void 0,CancellationTokenSource:Vi,Emitter:B,KeyCode:xN,KeyMod:l1,Position:W,Range:x,Selection:we,SelectionDirection:zN,MarkerSeverity:kN,MarkerTag:EN,Uri:Ae,Token:Ib}}function Sre(s,e){const t=s;typeof t.vscodeWindowId!="number"&&Object.defineProperty(t,"vscodeWindowId",{get:()=>e})}const Ht=window;function nz(s){return s}class Dre{constructor(e,t){this.lastCache=void 0,this.lastArgKey=void 0,typeof e=="function"?(this._fn=e,this._computeKey=nz):(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 r3{get cachedValues(){return this._map}constructor(e,t){this._map=new Map,this._map2=new Map,typeof e=="function"?(this._fn=e,this._computeKey=nz):(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}}class gl{constructor(e){this.executor=e,this._didRun=!1}get value(){if(!this._didRun)try{this._value=this.executor()}catch(e){this._error=e}finally{this._didRun=!0}if(this._error)throw this._error;return this._value}get rawValue(){return this._value}}var a_;function sz(s){return!s||typeof s!="string"?!0:s.trim().length===0}const Lre=/{(\d+)}/g;function l_(s,...e){return e.length===0?s:s.replace(Lre,function(t,i){const n=parseInt(i,10);return isNaN(n)||n<0||n>=e.length?t:e[n]})}function xre(s){return s.replace(/[<>"'&]/g,e=>{switch(e){case"<":return"<";case">":return">";case'"':return""";case"'":return"'";case"&":return"&"}return e})}function OS(s){return s.replace(/[<>&]/g,function(e){switch(e){case"<":return"<";case">":return">";case"&":return"&";default:return e}})}function rr(s){return s.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function qL(s,e){if(!s||!e)return s;const t=e.length;if(t===0||s.length===0)return s;let i=0;for(;s.indexOf(e,i)===i;)i=i+t;return s.substring(i)}function kre(s,e){if(!s)return s;const t=e.length,i=s.length;if(t===0||i===0)return s;let n=i,o=-1;for(;o=s.lastIndexOf(e,n-1),!(o===-1||o+t!==n);){if(o===0)return"";n=o}return s.substring(0,n)}function Ere(s){return s.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function oz(s,e,t={}){if(!s)throw new Error("Cannot create regex from empty string");e||(s=rr(s)),t.wholeWord&&(/\B/.test(s.charAt(0))||(s="\\b"+s),/\B/.test(s.charAt(s.length-1))||(s=s+"\\b"));let i="";return t.global&&(i+="g"),t.matchCase||(i+="i"),t.multiline&&(i+="m"),t.unicode&&(i+="u"),new RegExp(s,i)}function Ire(s){return s.source==="^"||s.source==="^$"||s.source==="$"||s.source==="^\\s*$"?!1:!!(s.exec("")&&s.lastIndex===0)}function Td(s){return s.split(/\r\n|\r|\n/)}function Tre(s){var e;const t=[],i=s.split(/(\r\n|\r|\n)/);for(let n=0;n=0;t--){const i=s.charCodeAt(t);if(i!==32&&i!==9)return t}return-1}function Rb(s,e){return se?1:0}function XP(s,e,t=0,i=s.length,n=0,o=e.length){for(;td)return 1}const r=i-t,a=o-n;return ra?1:0}function YN(s,e){return d1(s,e,0,s.length,0,e.length)}function d1(s,e,t=0,i=s.length,n=0,o=e.length){for(;t=128||d>=128)return XP(s.toLowerCase(),e.toLowerCase(),t,i,n,o);Bu(l)&&(l-=32),Bu(d)&&(d-=32);const c=l-d;if(c!==0)return c}const r=i-t,a=o-n;return ra?1:0}function uw(s){return s>=48&&s<=57}function Bu(s){return s>=97&&s<=122}function Fl(s){return s>=65&&s<=90}function em(s,e){return s.length===e.length&&d1(s,e)===0}function YP(s,e){const t=e.length;return e.length>s.length?!1:d1(s,e,0,t)===0}function Sh(s,e){const t=Math.min(s.length,e.length);let i;for(i=0;i1){const i=s.charCodeAt(e-2);if(Cn(i))return QP(i,t)}return t}class JP{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=Nre(this._str,this._offset);return this._offset-=e>=65536?2:1,e}nextCodePoint(){const e=WS(this._str,this._len,this._offset);return this._offset+=e>=65536?2:1,e}eol(){return this._offset>=this._len}}class HS{get offset(){return this._iterator.offset}constructor(e,t=0){this._iterator=new JP(e,t)}nextGraphemeLength(){const e=Wu.getInstance(),t=this._iterator,i=t.offset;let n=e.getGraphemeBreakType(t.nextCodePoint());for(;!t.eol();){const o=t.offset,r=e.getGraphemeBreakType(t.nextCodePoint());if(a3(n,r)){t.setOffset(o);break}n=r}return t.offset-i}prevGraphemeLength(){const e=Wu.getInstance(),t=this._iterator,i=t.offset;let n=e.getGraphemeBreakType(t.prevCodePoint());for(;t.offset>0;){const o=t.offset,r=e.getGraphemeBreakType(t.prevCodePoint());if(a3(r,n)){t.setOffset(o);break}n=r}return i-t.offset}eol(){return this._iterator.eol()}}function eF(s,e){return new HS(s,e).nextGraphemeLength()}function rz(s,e){return new HS(s,e).prevGraphemeLength()}function Are(s,e){e>0&&Cf(s.charCodeAt(e))&&e--;const t=e+eF(s,e);return[t-rz(s,t),t]}let ME;function Mre(){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 d_(s){return ME||(ME=Mre()),ME.test(s)}const Rre=/^[\t\n\r\x20-\x7E]*$/;function c1(s){return Rre.test(s)}const az=/[\u2028\u2029]/;function lz(s){return az.test(s)}function Dh(s){return s>=11904&&s<=55215||s>=63744&&s<=64255||s>=65281&&s<=65374}function tF(s){return s>=127462&&s<=127487||s===8986||s===8987||s===9200||s===9203||s>=9728&&s<=10175||s===11088||s===11093||s>=127744&&s<=128591||s>=128640&&s<=128764||s>=128992&&s<=129008||s>=129280&&s<=129535||s>=129648&&s<=129782}const Pre="\uFEFF";function iF(s){return!!(s&&s.length>0&&s.charCodeAt(0)===65279)}function Fre(s,e=!1){return s?(e&&(s=s.replace(/\\./g,"")),s.toLowerCase()!==s):!1}function dz(s){return s=s%(2*26),s<26?String.fromCharCode(97+s):String.fromCharCode(65+s-26)}function a3(s,e){return s===0?e!==5&&e!==7:s===2&&e===3?!1:s===4||s===2||s===3||e===4||e===2||e===3?!0:!(s===8&&(e===8||e===9||e===11||e===12)||(s===11||s===9)&&(e===9||e===10)||(s===12||s===10)&&e===10||e===5||e===13||e===7||s===1||s===13&&e===14||s===6&&e===6)}class Wu{static getInstance(){return Wu._INSTANCE||(Wu._INSTANCE=new Wu),Wu._INSTANCE}constructor(){this._data=Ore()}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}}Wu._INSTANCE=null;function Ore(){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 Bre(s,e){if(s===0)return 0;const t=Wre(s,e);if(t!==void 0)return t;const i=new JP(e,s);return i.prevCodePoint(),i.offset}function Wre(s,e){const t=new JP(e,s);let i=t.prevCodePoint();for(;Hre(i)||i===65039||i===8419;){if(t.offset===0)return;i=t.prevCodePoint()}if(!tF(i))return;let n=t.offset;return n>0&&t.prevCodePoint()===8205&&(n=t.offset),n}function Hre(s){return 127995<=s&&s<=127999}const cz=" ";class wf{static getInstance(e){return a_.cache.get(Array.from(e))}static getLocales(){return a_._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())}}a_=wf;wf.ambiguousCharacterData=new gl(()=>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,8218,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,8242,96,1370,96,1523,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,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,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,120786,52,120796,52,120806,52,120816,52,120826,52,130036,52,5070,52,71855,52,120787,53,120797,53,120807,53,120817,53,120827,53,130037,53,444,53,71867,53,120788,54,120798,54,120808,54,120818,54,120828,54,130038,54,11474,54,5102,54,71893,54,119314,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,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,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,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,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,71922,67,71913,67,65315,67,8557,67,8450,67,8493,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,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,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,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,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,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,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,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,120783,73,120793,73,120803,73,120813,73,120823,73,130033,73,65321,73,8544,73,8464,73,8465,73,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,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,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,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,120782,79,120792,79,120802,79,120812,79,120822,79,130032,79,65327,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,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,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,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,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,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,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,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,71919,87,71910,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,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,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,66293,90,71909,90,65338,90,8484,90,8488,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,65284,36,65285,37,65286,38,65290,42,65291,43,65294,46,65295,47,65296,48,65297,49,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,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,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"cs":[65374,126,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,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"de":[65374,126,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,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"es":[8211,45,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,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,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"fr":[65374,126,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,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"it":[160,32,8211,45,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,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"ja":[8211,45,65306,58,65281,33,8216,96,8217,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,65283,35,65292,44,65307,59],"ko":[8211,45,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,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"pl":[65374,126,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,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"pt-BR":[65374,126,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,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"qps-ploc":[160,32,8211,45,65374,126,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,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"ru":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,305,105,921,73,1009,112,215,120,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"tr":[160,32,8211,45,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,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,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"zh-hans":[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,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41],"zh-hant":[8211,45,65374,126,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,65283,35,65307,59]}'));wf.cache=new Dre({getCacheKey:JSON.stringify},s=>{function e(d){const c=new Map;for(let u=0;u!d.startsWith("_")&&d in n);o.length===0&&(o=["_default"]);let r;for(const d of o){const c=e(n[d]);r=i(r,c)}const a=e(n._common),l=t(a,r);return new a_(l)});wf._locales=new gl(()=>Object.keys(a_.ambiguousCharacterData.value).filter(s=>!s.startsWith("_")));class ld{static getRawData(){return JSON.parse("[9,10,11,12,13,32,127,160,173,847,1564,4447,4448,6068,6069,6155,6156,6157,6158,7355,7356,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8203,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,12288,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]")}static getData(){return this._data||(this._data=new Set(ld.getRawData())),this._data}static isInvisibleCharacter(e){return ld.getData().has(e)}static get codePoints(){return ld.getData()}}ld._data=void 0;class QN{constructor(){this.mapWindowIdToZoomFactor=new Map}getZoomFactor(e){var t;return(t=this.mapWindowIdToZoomFactor.get(this.getWindowId(e)))!==null&&t!==void 0?t:1}getWindowId(e){return e.vscodeWindowId}}QN.INSTANCE=new QN;function uz(s,e,t){typeof e=="string"&&(e=s.matchMedia(e)),e.addEventListener("change",t)}function Vre(s){return QN.INSTANCE.getZoomFactor(s)}const s0=navigator.userAgent,Fr=s0.indexOf("Firefox")>=0,GL=s0.indexOf("AppleWebKit")>=0,u1=s0.indexOf("Chrome")>=0,Lh=!u1&&s0.indexOf("Safari")>=0,hz=!u1&&!Lh&&GL;s0.indexOf("Electron/")>=0;const l3=s0.indexOf("Android")>=0;let RE=!1;if(typeof Ht.matchMedia=="function"){const s=Ht.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),e=Ht.matchMedia("(display-mode: fullscreen)");RE=s.matches,uz(Ht,s,({matches:t})=>{RE&&e.matches||(RE=t)})}const nF={clipboard:{writeText:md||document.queryCommandSupported&&document.queryCommandSupported("copy")||!!(navigator&&navigator.clipboard&&navigator.clipboard.writeText),readText:md||!!(navigator&&navigator.clipboard&&navigator.clipboard.readText)},pointerEvents:Ht.PointerEvent&&("ontouchstart"in Ht||navigator.maxTouchPoints>0)};function JN(s,e){if(typeof s=="number"){if(s===0)return null;const t=(s&65535)>>>0,i=(s&4294901760)>>>16;return i!==0?new PE([hw(t,e),hw(i,e)]):new PE([hw(t,e)])}else{const t=[];for(let i=0;i{const r=e.token.onCancellationRequested(()=>{r.dispose(),o(new sl)});Promise.resolve(t).then(a=>{r.dispose(),e.dispose(),n(a)},a=>{r.dispose(),e.dispose(),o(a)})});return new class{cancel(){e.cancel(),e.dispose()}then(n,o){return i.then(n,o)}catch(n){return this.then(void 0,n)}finally(n){return i.finally(n)}}}function h1(s,e,t){return new Promise((i,n)=>{const o=e.onCancellationRequested(()=>{o.dispose(),i(t)});s.then(i,n).finally(()=>o.dispose())})}class Yre{constructor(){this.isDisposed=!1,this.activePromise=null,this.queuedPromise=null,this.queuedPromiseFactory=null}queue(e){if(this.isDisposed)return Promise.reject(new Error("Throttler is disposed"));if(this.activePromise){if(this.queuedPromiseFactory=e,!this.queuedPromise){const t=()=>{if(this.queuedPromise=null,this.isDisposed)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(),new Promise((t,i)=>{this.activePromise.then(n=>{this.activePromise=null,t(n)},n=>{this.activePromise=null,i(n)})})}dispose(){this.isDisposed=!0}}const Qre=(s,e)=>{let t=!0;const i=setTimeout(()=>{t=!1,e()},s);return{isTriggered:()=>t,dispose:()=>{clearTimeout(i),t=!1}}},Jre=s=>{let e=!0;return queueMicrotask(()=>{e&&(e=!1,s())}),{isTriggered:()=>e,dispose:()=>{e=!1}}};class _a{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,o)=>{this.doResolve=n,this.doReject=o}).then(()=>{if(this.completionPromise=null,this.doResolve=null,this.task){const n=this.task;return this.task=null,n()}}));const i=()=>{var n;this.deferred=null,(n=this.doResolve)===null||n===void 0||n.call(this,null)};return this.deferred=t===gz?Jre(i):Qre(t,i),this.completionPromise}isTriggered(){var e;return!!(!((e=this.deferred)===null||e===void 0)&&e.isTriggered())}cancel(){var e;this.cancelTimeout(),this.completionPromise&&((e=this.doReject)===null||e===void 0||e.call(this,new sl),this.completionPromise=null)}cancelTimeout(){var e;(e=this.deferred)===null||e===void 0||e.dispose(),this.deferred=null}dispose(){this.cancel()}}class fz{constructor(e){this.delayer=new _a(e),this.throttler=new Yre}trigger(e,t){return this.delayer.trigger(()=>this.throttler.queue(e),t)}cancel(){this.delayer.cancel()}dispose(){this.delayer.dispose(),this.throttler.dispose()}}function xh(s,e){return e?new Promise((t,i)=>{const n=setTimeout(()=>{o.dispose(),t()},s),o=e.onCancellationRequested(()=>{clearTimeout(n),o.dispose(),i(new sl)})}):Dn(t=>xh(s,t))}function kh(s,e=0,t){const i=setTimeout(()=>{s(),t&&n.dispose()},e),n=Ie(()=>{clearTimeout(i),t==null||t.deleteAndLeak(n)});return t==null||t.add(n),n}function sF(s,e=i=>!!i,t=null){let i=0;const n=s.length,o=()=>{if(i>=n)return Promise.resolve(t);const r=s[i++];return Promise.resolve(r()).then(l=>e(l)?Promise.resolve(l):o())};return o()}class ya{constructor(e,t){this._token=-1,typeof e=="function"&&typeof t=="number"&&this.setIfNotSet(e,t)}dispose(){this.cancel()}cancel(){this._token!==-1&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(e,t){this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},t)}setIfNotSet(e,t){this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},t))}}class oF{constructor(){this.disposable=void 0}cancel(){var e;(e=this.disposable)===null||e===void 0||e.dispose(),this.disposable=void 0}cancelAndSet(e,t,i=globalThis){this.cancel();const n=i.setInterval(()=>{e()},t);this.disposable=Ie(()=>{i.clearInterval(n),this.disposable=void 0})}dispose(){this.cancel()}}class Wt{constructor(e,t){this.timeoutToken=-1,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=-1)}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!==-1}onTimeout(){this.timeoutToken=-1,this.runner&&this.doRun()}doRun(){var e;(e=this.runner)===null||e===void 0||e.call(this)}}let pz,Vv;(function(){typeof globalThis.requestIdleCallback!="function"||typeof globalThis.cancelIdleCallback!="function"?Vv=(s,e)=>{PV(()=>{if(t)return;const i=Date.now()+15;e(Object.freeze({didTimeout:!0,timeRemaining(){return Math.max(0,i-Date.now())}}))});let t=!1;return{dispose(){t||(t=!0)}}}:Vv=(s,e,t)=>{const i=s.requestIdleCallback(e,typeof t=="number"?{timeout:t}:void 0);let n=!1;return{dispose(){n||(n=!0,s.cancelIdleCallback(i))}}},pz=s=>Vv(globalThis,s)})();class mz{constructor(e,t){this._didRun=!1,this._executor=()=>{try{this._value=t()}catch(i){this._error=i}finally{this._didRun=!0}},this._handle=Vv(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 eae extends mz{constructor(e){super(globalThis,e)}}class ZL{get isRejected(){var e;return((e=this.outcome)===null||e===void 0?void 0:e.outcome)===1}get isSettled(){return!!this.outcome}constructor(){this.p=new Promise((e,t)=>{this.completeCallback=e,this.errorCallback=t})}complete(e){return new Promise(t=>{this.completeCallback(e),this.outcome={outcome:0,value:e},t()})}error(e){return new Promise(t=>{this.errorCallback(e),this.outcome={outcome:1,value:e},t()})}cancel(){return this.error(new sl)}}var tA;(function(s){async function e(i){let n;const o=await Promise.all(i.map(r=>r.then(a=>a,a=>{n||(n=a)})));if(typeof n<"u")throw n;return o}s.settled=e;function t(i){return new Promise(async(n,o)=>{try{await i(n,o)}catch(r){o(r)}})}s.withAsyncBody=t})(tA||(tA={}));class Xi{static fromArray(e){return new Xi(t=>{t.emitMany(e)})}static fromPromise(e){return new Xi(async t=>{t.emitMany(await e)})}static fromPromises(e){return new Xi(async t=>{await Promise.all(e.map(async i=>t.emitOne(await i)))})}static merge(e){return new Xi(async t=>{await Promise.all(e.map(async i=>{for await(const n of i)t.emitOne(n)}))})}constructor(e,t){this._state=0,this._results=[],this._error=null,this._onReturn=t,this._onStateChanged=new B,queueMicrotask(async()=>{const i={emitOne:n=>this.emitOne(n),emitMany:n=>this.emitMany(n),reject:n=>this.reject(n)};try{await Promise.resolve(e(i)),this.resolve()}catch(n){this.reject(n)}finally{i.emitOne=void 0,i.emitMany=void 0,i.reject=void 0}})}[Symbol.asyncIterator](){let e=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(e{var t;return(t=this._onReturn)===null||t===void 0||t.call(this),{done:!0,value:void 0}}}}static map(e,t){return new Xi(async i=>{for await(const n of e)i.emitOne(t(n))})}map(e){return Xi.map(this,e)}static filter(e,t){return new Xi(async i=>{for await(const n of e)t(n)&&i.emitOne(n)})}filter(e){return Xi.filter(this,e)}static coalesce(e){return Xi.filter(e,t=>!!t)}coalesce(){return Xi.coalesce(this)}static async toPromise(e){const t=[];for await(const i of e)t.push(i);return t}toPromise(){return Xi.toPromise(this)}emitOne(e){this._state===0&&(this._results.push(e),this._onStateChanged.fire())}emitMany(e){this._state===0&&(this._results=this._results.concat(e),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(e){this._state===0&&(this._state=2,this._error=e,this._onStateChanged.fire())}}Xi.EMPTY=Xi.fromArray([]);class tae extends Xi{constructor(e,t){super(t),this._source=e}cancel(){this._source.cancel()}}function iae(s){const e=new Vi,t=s(e.token);return new tae(e,async i=>{const n=e.token.onCancellationRequested(()=>{n.dispose(),e.dispose(),i.reject(new sl)});try{for await(const o of t){if(e.token.isCancellationRequested)return;i.emitOne(o)}n.dispose(),e.dispose()}catch(o){n.dispose(),e.dispose(),i.reject(o)}})}/*! @license DOMPurify 3.0.5 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.5/LICENSE */const{entries:_z,setPrototypeOf:c3,isFrozen:nae,getPrototypeOf:sae,getOwnPropertyDescriptor:oae}=Object;let{freeze:No,seal:ol,create:rae}=Object,{apply:iA,construct:nA}=typeof Reflect<"u"&&Reflect;iA||(iA=function(e,t,i){return e.apply(t,i)});No||(No=function(e){return e});ol||(ol=function(e){return e});nA||(nA=function(e,t){return new e(...t)});const aae=va(Array.prototype.forEach),u3=va(Array.prototype.pop),M0=va(Array.prototype.push),By=va(String.prototype.toLowerCase),FE=va(String.prototype.toString),lae=va(String.prototype.match),xa=va(String.prototype.replace),dae=va(String.prototype.indexOf),cae=va(String.prototype.trim),_r=va(RegExp.prototype.test),R0=uae(TypeError);function va(s){return function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n/gm),mae=ol(/\${[\w\W]*}/gm),_ae=ol(/^data-[\-\w.\u00B7-\uFFFF]/),vae=ol(/^aria-[\-\w]+$/),vz=ol(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),bae=ol(/^(?:\w+script|data):/i),Cae=ol(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),bz=ol(/^html$/i);var m3=Object.freeze({__proto__:null,MUSTACHE_EXPR:fae,ERB_EXPR:pae,TMPLIT_EXPR:mae,DATA_ATTR:_ae,ARIA_ATTR:vae,IS_ALLOWED_URI:vz,IS_SCRIPT_OR_DATA:bae,ATTR_WHITESPACE:Cae,DOCTYPE_NAME:bz});const wae=()=>typeof window>"u"?null:window,yae=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 o="dompurify"+(i?"#"+i:"");try{return e.createPolicy(o,{createHTML(r){return r},createScriptURL(r){return r}})}catch{return console.warn("TrustedTypes policy "+o+" could not be created."),null}};function Cz(){let s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:wae();const e=ct=>Cz(ct);if(e.version="3.0.5",e.removed=[],!s||!s.document||s.document.nodeType!==9)return e.isSupported=!1,e;const t=s.document,i=t.currentScript;let{document:n}=s;const{DocumentFragment:o,HTMLTemplateElement:r,Node:a,Element:l,NodeFilter:d,NamedNodeMap:c=s.NamedNodeMap||s.MozNamedAttrMap,HTMLFormElement:u,DOMParser:h,trustedTypes:g}=s,f=l.prototype,m=gw(f,"cloneNode"),_=gw(f,"nextSibling"),v=gw(f,"childNodes"),b=gw(f,"parentNode");if(typeof r=="function"){const ct=n.createElement("template");ct.content&&ct.content.ownerDocument&&(n=ct.content.ownerDocument)}let C,w="";const{implementation:y,createNodeIterator:D,createDocumentFragment:L,getElementsByTagName:k}=n,{importNode:I}=t;let O={};e.isSupported=typeof _z=="function"&&typeof b=="function"&&y&&y.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:R,ERB_EXPR:P,TMPLIT_EXPR:F,DATA_ATTR:V,ARIA_ATTR:U,IS_SCRIPT_OR_DATA:J,ATTR_WHITESPACE:pe}=m3;let{IS_ALLOWED_URI:De}=m3,ge=null;const We=Ft({},[...h3,...OE,...BE,...WE,...g3]);let ye=null;const ve=Ft({},[...f3,...HE,...p3,...fw]);let ce=Object.seal(Object.create(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}})),Qt=null,Ui=null,Gi=!0,St=!0,tn=!1,Pn=!0,ln=!1,$e=!1,dn=!1,qr=!1,Wo=!1,Fd=!1,xn=!1,Da=!0,Z1=!1;const aE="user-content-";let se=!0,X=!1,q={},A=null;const M=Ft({},["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 j=null;const z=Ft({},["audio","video","img","source","image","track"]);let ne=null;const _e=Ft({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Me="http://www.w3.org/1998/Math/MathML",Oe="http://www.w3.org/2000/svg",ot="http://www.w3.org/1999/xhtml";let tt=ot,Jt=!1,Vt=null;const qe=Ft({},[Me,Oe,ot],FE);let Mi;const Ri=["application/xhtml+xml","text/html"],Gr="text/html";let Mt,cn=null;const hg=n.createElement("form"),gg=function(Z){return Z instanceof RegExp||Z instanceof Function},La=function(Z){if(!(cn&&cn===Z)){if((!Z||typeof Z!="object")&&(Z={}),Z=Dp(Z),Mi=Ri.indexOf(Z.PARSER_MEDIA_TYPE)===-1?Mi=Gr:Mi=Z.PARSER_MEDIA_TYPE,Mt=Mi==="application/xhtml+xml"?FE:By,ge="ALLOWED_TAGS"in Z?Ft({},Z.ALLOWED_TAGS,Mt):We,ye="ALLOWED_ATTR"in Z?Ft({},Z.ALLOWED_ATTR,Mt):ve,Vt="ALLOWED_NAMESPACES"in Z?Ft({},Z.ALLOWED_NAMESPACES,FE):qe,ne="ADD_URI_SAFE_ATTR"in Z?Ft(Dp(_e),Z.ADD_URI_SAFE_ATTR,Mt):_e,j="ADD_DATA_URI_TAGS"in Z?Ft(Dp(z),Z.ADD_DATA_URI_TAGS,Mt):z,A="FORBID_CONTENTS"in Z?Ft({},Z.FORBID_CONTENTS,Mt):M,Qt="FORBID_TAGS"in Z?Ft({},Z.FORBID_TAGS,Mt):{},Ui="FORBID_ATTR"in Z?Ft({},Z.FORBID_ATTR,Mt):{},q="USE_PROFILES"in Z?Z.USE_PROFILES:!1,Gi=Z.ALLOW_ARIA_ATTR!==!1,St=Z.ALLOW_DATA_ATTR!==!1,tn=Z.ALLOW_UNKNOWN_PROTOCOLS||!1,Pn=Z.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ln=Z.SAFE_FOR_TEMPLATES||!1,$e=Z.WHOLE_DOCUMENT||!1,Wo=Z.RETURN_DOM||!1,Fd=Z.RETURN_DOM_FRAGMENT||!1,xn=Z.RETURN_TRUSTED_TYPE||!1,qr=Z.FORCE_BODY||!1,Da=Z.SANITIZE_DOM!==!1,Z1=Z.SANITIZE_NAMED_PROPS||!1,se=Z.KEEP_CONTENT!==!1,X=Z.IN_PLACE||!1,De=Z.ALLOWED_URI_REGEXP||vz,tt=Z.NAMESPACE||ot,ce=Z.CUSTOM_ELEMENT_HANDLING||{},Z.CUSTOM_ELEMENT_HANDLING&&gg(Z.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(ce.tagNameCheck=Z.CUSTOM_ELEMENT_HANDLING.tagNameCheck),Z.CUSTOM_ELEMENT_HANDLING&&gg(Z.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(ce.attributeNameCheck=Z.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),Z.CUSTOM_ELEMENT_HANDLING&&typeof Z.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(ce.allowCustomizedBuiltInElements=Z.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),ln&&(St=!1),Fd&&(Wo=!0),q&&(ge=Ft({},[...g3]),ye=[],q.html===!0&&(Ft(ge,h3),Ft(ye,f3)),q.svg===!0&&(Ft(ge,OE),Ft(ye,HE),Ft(ye,fw)),q.svgFilters===!0&&(Ft(ge,BE),Ft(ye,HE),Ft(ye,fw)),q.mathMl===!0&&(Ft(ge,WE),Ft(ye,p3),Ft(ye,fw))),Z.ADD_TAGS&&(ge===We&&(ge=Dp(ge)),Ft(ge,Z.ADD_TAGS,Mt)),Z.ADD_ATTR&&(ye===ve&&(ye=Dp(ye)),Ft(ye,Z.ADD_ATTR,Mt)),Z.ADD_URI_SAFE_ATTR&&Ft(ne,Z.ADD_URI_SAFE_ATTR,Mt),Z.FORBID_CONTENTS&&(A===M&&(A=Dp(A)),Ft(A,Z.FORBID_CONTENTS,Mt)),se&&(ge["#text"]=!0),$e&&Ft(ge,["html","head","body"]),ge.table&&(Ft(ge,["tbody"]),delete Qt.tbody),Z.TRUSTED_TYPES_POLICY){if(typeof Z.TRUSTED_TYPES_POLICY.createHTML!="function")throw R0('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof Z.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw R0('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');C=Z.TRUSTED_TYPES_POLICY,w=C.createHTML("")}else C===void 0&&(C=yae(g,i)),C!==null&&typeof w=="string"&&(w=C.createHTML(""));No&&No(Z),cn=Z}},cu=Ft({},["mi","mo","mn","ms","mtext"]),fg=Ft({},["foreignobject","desc","title","annotation-xml"]),pg=Ft({},["title","style","font","a","script"]),wp=Ft({},OE);Ft(wp,BE),Ft(wp,hae);const mg=Ft({},WE);Ft(mg,gae);const lE=function(Z){let ke=b(Z);(!ke||!ke.tagName)&&(ke={namespaceURI:tt,tagName:"template"});const ze=By(Z.tagName),Pi=By(ke.tagName);return Vt[Z.namespaceURI]?Z.namespaceURI===Oe?ke.namespaceURI===ot?ze==="svg":ke.namespaceURI===Me?ze==="svg"&&(Pi==="annotation-xml"||cu[Pi]):!!wp[ze]:Z.namespaceURI===Me?ke.namespaceURI===ot?ze==="math":ke.namespaceURI===Oe?ze==="math"&&fg[Pi]:!!mg[ze]:Z.namespaceURI===ot?ke.namespaceURI===Oe&&!fg[Pi]||ke.namespaceURI===Me&&!cu[Pi]?!1:!mg[ze]&&(pg[ze]||!wp[ze]):!!(Mi==="application/xhtml+xml"&&Vt[Z.namespaceURI]):!1},bl=function(Z){M0(e.removed,{element:Z});try{Z.parentNode.removeChild(Z)}catch{Z.remove()}},I0=function(Z,ke){try{M0(e.removed,{attribute:ke.getAttributeNode(Z),from:ke})}catch{M0(e.removed,{attribute:null,from:ke})}if(ke.removeAttribute(Z),Z==="is"&&!ye[Z])if(Wo||Fd)try{bl(ke)}catch{}else try{ke.setAttribute(Z,"")}catch{}},T0=function(Z){let ke,ze;if(qr)Z=""+Z;else{const Zr=lae(Z,/^[\r\n\t ]+/);ze=Zr&&Zr[0]}Mi==="application/xhtml+xml"&&tt===ot&&(Z=''+Z+"");const Pi=C?C.createHTML(Z):Z;if(tt===ot)try{ke=new h().parseFromString(Pi,Mi)}catch{}if(!ke||!ke.documentElement){ke=y.createDocument(tt,"template",null);try{ke.documentElement.innerHTML=Jt?w:Pi}catch{}}const cs=ke.body||ke.documentElement;return Z&&ze&&cs.insertBefore(n.createTextNode(ze),cs.childNodes[0]||null),tt===ot?k.call(ke,$e?"html":"body")[0]:$e?ke.documentElement:cs},X1=function(Z){return D.call(Z.ownerDocument||Z,Z,d.SHOW_ELEMENT|d.SHOW_COMMENT|d.SHOW_TEXT,null,!1)},TZ=function(Z){return Z instanceof u&&(typeof Z.nodeName!="string"||typeof Z.textContent!="string"||typeof Z.removeChild!="function"||!(Z.attributes instanceof c)||typeof Z.removeAttribute!="function"||typeof Z.setAttribute!="function"||typeof Z.namespaceURI!="string"||typeof Z.insertBefore!="function"||typeof Z.hasChildNodes!="function")},Y1=function(Z){return typeof a=="object"?Z instanceof a:Z&&typeof Z=="object"&&typeof Z.nodeType=="number"&&typeof Z.nodeName=="string"},Od=function(Z,ke,ze){O[Z]&&aae(O[Z],Pi=>{Pi.call(e,ke,ze,cn)})},n5=function(Z){let ke;if(Od("beforeSanitizeElements",Z,null),TZ(Z))return bl(Z),!0;const ze=Mt(Z.nodeName);if(Od("uponSanitizeElement",Z,{tagName:ze,allowedTags:ge}),Z.hasChildNodes()&&!Y1(Z.firstElementChild)&&(!Y1(Z.content)||!Y1(Z.content.firstElementChild))&&_r(/<[/\w]/g,Z.innerHTML)&&_r(/<[/\w]/g,Z.textContent))return bl(Z),!0;if(!ge[ze]||Qt[ze]){if(!Qt[ze]&&o5(ze)&&(ce.tagNameCheck instanceof RegExp&&_r(ce.tagNameCheck,ze)||ce.tagNameCheck instanceof Function&&ce.tagNameCheck(ze)))return!1;if(se&&!A[ze]){const Pi=b(Z)||Z.parentNode,cs=v(Z)||Z.childNodes;if(cs&&Pi){const Zr=cs.length;for(let vn=Zr-1;vn>=0;--vn)Pi.insertBefore(m(cs[vn],!0),_(Z))}}return bl(Z),!0}return Z instanceof l&&!lE(Z)||(ze==="noscript"||ze==="noembed"||ze==="noframes")&&_r(/<\/no(script|embed|frames)/i,Z.innerHTML)?(bl(Z),!0):(ln&&Z.nodeType===3&&(ke=Z.textContent,ke=xa(ke,R," "),ke=xa(ke,P," "),ke=xa(ke,F," "),Z.textContent!==ke&&(M0(e.removed,{element:Z.cloneNode()}),Z.textContent=ke)),Od("afterSanitizeElements",Z,null),!1)},s5=function(Z,ke,ze){if(Da&&(ke==="id"||ke==="name")&&(ze in n||ze in hg))return!1;if(!(St&&!Ui[ke]&&_r(V,ke))){if(!(Gi&&_r(U,ke))){if(!ye[ke]||Ui[ke]){if(!(o5(Z)&&(ce.tagNameCheck instanceof RegExp&&_r(ce.tagNameCheck,Z)||ce.tagNameCheck instanceof Function&&ce.tagNameCheck(Z))&&(ce.attributeNameCheck instanceof RegExp&&_r(ce.attributeNameCheck,ke)||ce.attributeNameCheck instanceof Function&&ce.attributeNameCheck(ke))||ke==="is"&&ce.allowCustomizedBuiltInElements&&(ce.tagNameCheck instanceof RegExp&&_r(ce.tagNameCheck,ze)||ce.tagNameCheck instanceof Function&&ce.tagNameCheck(ze))))return!1}else if(!ne[ke]){if(!_r(De,xa(ze,pe,""))){if(!((ke==="src"||ke==="xlink:href"||ke==="href")&&Z!=="script"&&dae(ze,"data:")===0&&j[Z])){if(!(tn&&!_r(J,xa(ze,pe,"")))){if(ze)return!1}}}}}}return!0},o5=function(Z){return Z.indexOf("-")>0},r5=function(Z){let ke,ze,Pi,cs;Od("beforeSanitizeAttributes",Z,null);const{attributes:Zr}=Z;if(!Zr)return;const vn={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ye};for(cs=Zr.length;cs--;){ke=Zr[cs];const{name:Cl,namespaceURI:dE}=ke;if(ze=Cl==="value"?ke.value:cae(ke.value),Pi=Mt(Cl),vn.attrName=Pi,vn.attrValue=ze,vn.keepAttr=!0,vn.forceKeepAttr=void 0,Od("uponSanitizeAttribute",Z,vn),ze=vn.attrValue,vn.forceKeepAttr||(I0(Cl,Z),!vn.keepAttr))continue;if(!Pn&&_r(/\/>/i,ze)){I0(Cl,Z);continue}ln&&(ze=xa(ze,R," "),ze=xa(ze,P," "),ze=xa(ze,F," "));const a5=Mt(Z.nodeName);if(s5(a5,Pi,ze)){if(Z1&&(Pi==="id"||Pi==="name")&&(I0(Cl,Z),ze=aE+ze),C&&typeof g=="object"&&typeof g.getAttributeType=="function"&&!dE)switch(g.getAttributeType(a5,Pi)){case"TrustedHTML":{ze=C.createHTML(ze);break}case"TrustedScriptURL":{ze=C.createScriptURL(ze);break}}try{dE?Z.setAttributeNS(dE,Cl,ze):Z.setAttribute(Cl,ze),u3(e.removed)}catch{}}}Od("afterSanitizeAttributes",Z,null)},NZ=function ct(Z){let ke;const ze=X1(Z);for(Od("beforeSanitizeShadowDOM",Z,null);ke=ze.nextNode();)Od("uponSanitizeShadowNode",ke,null),!n5(ke)&&(ke.content instanceof o&&ct(ke.content),r5(ke));Od("afterSanitizeShadowDOM",Z,null)};return e.sanitize=function(ct){let Z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ke,ze,Pi,cs;if(Jt=!ct,Jt&&(ct=""),typeof ct!="string"&&!Y1(ct))if(typeof ct.toString=="function"){if(ct=ct.toString(),typeof ct!="string")throw R0("dirty is not a string, aborting")}else throw R0("toString is not a function");if(!e.isSupported)return ct;if(dn||La(Z),e.removed=[],typeof ct=="string"&&(X=!1),X){if(ct.nodeName){const Cl=Mt(ct.nodeName);if(!ge[Cl]||Qt[Cl])throw R0("root node is forbidden and cannot be sanitized in-place")}}else if(ct instanceof a)ke=T0(""),ze=ke.ownerDocument.importNode(ct,!0),ze.nodeType===1&&ze.nodeName==="BODY"||ze.nodeName==="HTML"?ke=ze:ke.appendChild(ze);else{if(!Wo&&!ln&&!$e&&ct.indexOf("<")===-1)return C&&xn?C.createHTML(ct):ct;if(ke=T0(ct),!ke)return Wo?null:xn?w:""}ke&&qr&&bl(ke.firstChild);const Zr=X1(X?ct:ke);for(;Pi=Zr.nextNode();)n5(Pi)||(Pi.content instanceof o&&NZ(Pi.content),r5(Pi));if(X)return ct;if(Wo){if(Fd)for(cs=L.call(ke.ownerDocument);ke.firstChild;)cs.appendChild(ke.firstChild);else cs=ke;return(ye.shadowroot||ye.shadowrootmode)&&(cs=I.call(t,cs,!0)),cs}let vn=$e?ke.outerHTML:ke.innerHTML;return $e&&ge["!doctype"]&&ke.ownerDocument&&ke.ownerDocument.doctype&&ke.ownerDocument.doctype.name&&_r(bz,ke.ownerDocument.doctype.name)&&(vn=" `+vn),ln&&(vn=xa(vn,R," "),vn=xa(vn,P," "),vn=xa(vn,F," ")),C&&xn?C.createHTML(vn):vn},e.setConfig=function(ct){La(ct),dn=!0},e.clearConfig=function(){cn=null,dn=!1},e.isValidAttribute=function(ct,Z,ke){cn||La({});const ze=Mt(ct),Pi=Mt(Z);return s5(ze,Pi,ke)},e.addHook=function(ct,Z){typeof Z=="function"&&(O[ct]=O[ct]||[],M0(O[ct],Z))},e.removeHook=function(ct){if(O[ct])return u3(O[ct])},e.removeHooks=function(ct){O[ct]&&(O[ct]=[])},e.removeAllHooks=function(){O={}},e}var Nd=Cz();Nd.version;Nd.isSupported;const wz=Nd.sanitize;Nd.setConfig;Nd.clearConfig;Nd.isValidAttribute;const sA=Nd.addHook,yz=Nd.removeHook;Nd.removeHooks;Nd.removeAllHooks;var Ge;(function(s){s.inMemory="inmemory",s.vscode="vscode",s.internal="private",s.walkThrough="walkThrough",s.walkThroughSnippet="walkThroughSnippet",s.http="http",s.https="https",s.file="file",s.mailto="mailto",s.untitled="untitled",s.data="data",s.command="command",s.vscodeRemote="vscode-remote",s.vscodeRemoteResource="vscode-remote-resource",s.vscodeManagedRemoteResource="vscode-managed-remote-resource",s.vscodeUserData="vscode-userdata",s.vscodeCustomEditor="vscode-custom-editor",s.vscodeNotebookCell="vscode-notebook-cell",s.vscodeNotebookCellMetadata="vscode-notebook-cell-metadata",s.vscodeNotebookCellOutput="vscode-notebook-cell-output",s.vscodeInteractiveInput="vscode-interactive-input",s.vscodeSettings="vscode-settings",s.vscodeWorkspaceTrust="vscode-workspace-trust",s.vscodeTerminal="vscode-terminal",s.vscodeChatCodeBlock="vscode-chat-code-block",s.vscodeChatCodeCompreBlock="vscode-chat-code-compare-block",s.vscodeChatSesssion="vscode-chat-editor",s.webviewPanel="webview-panel",s.vscodeWebview="vscode-webview",s.extension="extension",s.vscodeFileResource="vscode-file",s.tmp="tmp",s.vsls="vsls",s.vscodeSourceControl="vscode-scm",s.commentsInput="comment",s.codeSetting="code-setting"})(Ge||(Ge={}));function rF(s,e){return Ae.isUri(s)?em(s.scheme,e):YP(s,e+":")}function _3(s,...e){return e.some(t=>rF(s,t))}const Sae="tkn";class Dae{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 Yi.join(this._serverRootPath,Ge.vscodeRemoteResource)}rewrite(e){if(this._delegate)try{return this._delegate(e)}catch(a){return Xe(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],o=this._connectionTokens[t];let r=`path=${encodeURIComponent(e.path)}`;return typeof o=="string"&&(r+=`&${Sae}=${encodeURIComponent(o)}`),Ae.from({scheme:Jh?this._preferredWebSchema:Ge.vscodeRemoteResource,authority:`${i}:${n}`,path:this._remoteResourcesPath,query:r})}}const Sz=new Dae,Lae="vscode-app";class Pb{uriToBrowserUri(e){return e.scheme===Ge.vscodeRemote?Sz.rewrite(e):e.scheme===Ge.file&&(md||Wse===`${Ge.vscodeFileResource}://${Pb.FALLBACK_AUTHORITY}`)?e.with({scheme:Ge.vscodeFileResource,authority:e.authority||Pb.FALLBACK_AUTHORITY,query:null,fragment:null}):e}}Pb.FALLBACK_AUTHORITY=Lae;const Dz=new Pb;var v3;(function(s){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"}]]);s.CoopAndCoep=Object.freeze(e.get("3"));const t="vscode-coi";function i(o){let r;typeof o=="string"?r=new URL(o).searchParams:o instanceof URL?r=o.searchParams:Ae.isUri(o)&&(r=new URL(o.toString(!0)).searchParams);const a=r==null?void 0:r.get(t);if(a)return e.get(a)}s.getHeadersFromQuery=i;function n(o,r,a){if(!globalThis.crossOriginIsolated)return;const l=r&&a?"3":a?"2":"1";o instanceof URLSearchParams?o.set(t,l):o[t]=l}s.addSearchParam=n})(v3||(v3={}));function XL(s){return YL(s,0)}function YL(s,e){switch(typeof s){case"object":return s===null?cc(349,e):Array.isArray(s)?kae(s,e):Eae(s,e);case"string":return aF(s,e);case"boolean":return xae(s,e);case"number":return cc(s,e);case"undefined":return cc(937,e);default:return cc(617,e)}}function cc(s,e){return(e<<5)-e+s|0}function xae(s,e){return cc(s?433:863,e)}function aF(s,e){e=cc(149417,e);for(let t=0,i=s.length;tYL(i,t),e)}function Eae(s,e){return e=cc(181387,e),Object.keys(s).sort().reduce((t,i)=>(t=aF(i,t),YL(s[i],t)),e)}function VE(s,e,t=32){const i=t-e,n=~((1<>>i)>>>0}function b3(s,e=0,t=s.byteLength,i=0){for(let n=0;nt.toString(16).padStart(2,"0")).join(""):Iae((s>>>0).toString(16),e/4)}class QL{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,o=this._leftoverHighSurrogate,r,a;for(o!==0?(r=o,a=-1,o=0):(r=e.charCodeAt(0),a=0);;){let l=r;if(Cn(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()),P0(this._h0)+P0(this._h1)+P0(this._h2)+P0(this._h3)+P0(this._h4)}_wrapUp(){this._buff[this._buffLen++]=128,b3(this._buff,this._buffLen),this._buffLen>56&&(this._step(),b3(this._buff));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=QL._bigBlock32,t=this._buffDV;for(let u=0;u<64;u+=4)e.setUint32(u,t.getUint32(u,!1),!1);for(let u=64;u<320;u+=4)e.setUint32(u,VE(e.getUint32(u-12,!1)^e.getUint32(u-32,!1)^e.getUint32(u-56,!1)^e.getUint32(u-64,!1),1),!1);let i=this._h0,n=this._h1,o=this._h2,r=this._h3,a=this._h4,l,d,c;for(let u=0;u<80;u++)u<20?(l=n&o|~n&r,d=1518500249):u<40?(l=n^o^r,d=1859775393):u<60?(l=n&o|n&r|o&r,d=2400959708):(l=n^o^r,d=3395469782),c=VE(i,5)+l+a+d+e.getUint32(u*4,!1)&4294967295,a=r,r=o,o=VE(n,30),n=i,i=c;this._h0=this._h0+i&4294967295,this._h1=this._h1+n&4294967295,this._h2=this._h2+o&4294967295,this._h3=this._h3+r&4294967295,this._h4=this._h4+a&4294967295}}QL._bigBlock32=new DataView(new ArrayBuffer(320));const{getWindow:Te,getWindows:Lz,getWindowsCount:Tae,getWindowId:VS,getWindowById:C3,onDidRegisterWindow:JL,onWillUnregisterWindow:Nae,onDidUnregisterWindow:Aae}=function(){const s=new Map;Sre(Ht,1);const e={window:Ht,disposables:new Y};s.set(Ht.vscodeWindowId,e);const t=new B,i=new B,n=new B;function o(r,a){const l=typeof r=="number"?s.get(r):void 0;return l??(a?e:void 0)}return{onDidRegisterWindow:t.event,onWillUnregisterWindow:n.event,onDidUnregisterWindow:i.event,registerWindow(r){if(s.has(r.vscodeWindowId))return H.None;const a=new Y,l={window:r,disposables:a.add(new Y)};return s.set(r.vscodeWindowId,l),a.add(Ie(()=>{s.delete(r.vscodeWindowId),i.fire(r)})),a.add(K(r,ee.BEFORE_UNLOAD,()=>{n.fire(r)})),t.fire(l),a},getWindows(){return s.values()},getWindowsCount(){return s.size},getWindowId(r){return r.vscodeWindowId},hasWindow(r){return s.has(r)},getWindowById:o,getWindow(r){var a;const l=r;if(!((a=l==null?void 0:l.ownerDocument)===null||a===void 0)&&a.defaultView)return l.ownerDocument.defaultView.window;const d=r;return d!=null&&d.view?d.view.window:Ht},getDocument(r){return Te(r).document}}}();function zn(s){for(;s.firstChild;)s.firstChild.remove()}class Mae{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 K(s,e,t,i){return new Mae(s,e,t,i)}function xz(s,e){return function(t){return e(new ra(s,t))}}function Rae(s){return function(e){return s(new Kt(e))}}const Ni=function(e,t,i,n){let o=i;return t==="click"||t==="mousedown"?o=xz(Te(e),i):(t==="keydown"||t==="keypress"||t==="keyup")&&(o=Rae(i)),K(e,t,o,n)},Pae=function(e,t,i){const n=xz(Te(e),t);return Fae(e,n,i)};function Fae(s,e,t){return K(s,_d&&nF.pointerEvents?ee.POINTER_DOWN:ee.MOUSE_DOWN,e,t)}function uv(s,e,t){return Vv(s,e,t)}class zE extends mz{constructor(e,t){super(e,t)}}let zS,Ao;class lF extends oF{constructor(e){super(),this.defaultTarget=e&&Te(e)}cancelAndSet(e,t,i){return super.cancelAndSet(e,t,i??this.defaultTarget)}}class UE{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){Xe(e)}}static sort(e,t){return t.priority-e.priority}}(function(){const s=new Map,e=new Map,t=new Map,i=new Map,n=o=>{var r;t.set(o,!1);const a=(r=s.get(o))!==null&&r!==void 0?r:[];for(e.set(o,a),s.set(o,[]),i.set(o,!0);a.length>0;)a.sort(UE.sort),a.shift().execute();i.set(o,!1)};Ao=(o,r,a=0)=>{const l=VS(o),d=new UE(r,a);let c=s.get(l);return c||(c=[],s.set(l,c)),c.push(d),t.get(l)||(t.set(l,!0),o.requestAnimationFrame(()=>n(l))),d},zS=(o,r,a)=>{const l=VS(o);if(i.get(l)){const d=new UE(r,a);let c=e.get(l);return c||(c=[],e.set(l,c)),c.push(d),d}else return Ao(o,r,a)}})();function ex(s){return Te(s).getComputedStyle(s,null)}function Eh(s,e){const t=Te(s),i=t.document;if(s!==i.body)return new Dt(s.clientWidth,s.clientHeight);if(_d&&(t!=null&&t.visualViewport))return new Dt(t.visualViewport.width,t.visualViewport.height);if(t!=null&&t.innerWidth&&t.innerHeight)return new Dt(t.innerWidth,t.innerHeight);if(i.body&&i.body.clientWidth&&i.body.clientHeight)return new Dt(i.body.clientWidth,i.body.clientHeight);if(i.documentElement&&i.documentElement.clientWidth&&i.documentElement.clientHeight)return new Dt(i.documentElement.clientWidth,i.documentElement.clientHeight);throw new Error("Unable to figure out browser width and height")}class Oi{static convertToPixels(e,t){return parseFloat(t)||0}static getDimension(e,t,i){const n=ex(e),o=n?n.getPropertyValue(t):"0";return Oi.convertToPixels(e,o)}static getBorderLeftWidth(e){return Oi.getDimension(e,"border-left-width","borderLeftWidth")}static getBorderRightWidth(e){return Oi.getDimension(e,"border-right-width","borderRightWidth")}static getBorderTopWidth(e){return Oi.getDimension(e,"border-top-width","borderTopWidth")}static getBorderBottomWidth(e){return Oi.getDimension(e,"border-bottom-width","borderBottomWidth")}static getPaddingLeft(e){return Oi.getDimension(e,"padding-left","paddingLeft")}static getPaddingRight(e){return Oi.getDimension(e,"padding-right","paddingRight")}static getPaddingTop(e){return Oi.getDimension(e,"padding-top","paddingTop")}static getPaddingBottom(e){return Oi.getDimension(e,"padding-bottom","paddingBottom")}static getMarginLeft(e){return Oi.getDimension(e,"margin-left","marginLeft")}static getMarginTop(e){return Oi.getDimension(e,"margin-top","marginTop")}static getMarginRight(e){return Oi.getDimension(e,"margin-right","marginRight")}static getMarginBottom(e){return Oi.getDimension(e,"margin-bottom","marginBottom")}}class Dt{constructor(e,t){this.width=e,this.height=t}with(e=this.width,t=this.height){return e!==this.width||t!==this.height?new Dt(e,t):this}static is(e){return typeof e=="object"&&typeof e.height=="number"&&typeof e.width=="number"}static lift(e){return e instanceof Dt?e:new Dt(e.width,e.height)}static equals(e,t){return e===t?!0:!e||!t?!1:e.width===t.width&&e.height===t.height}}Dt.None=new Dt(0,0);function kz(s){let e=s.offsetParent,t=s.offsetTop,i=s.offsetLeft;for(;(s=s.parentNode)!==null&&s!==s.ownerDocument.body&&s!==s.ownerDocument.documentElement;){t-=s.scrollTop;const n=Iz(s)?null:ex(s);n&&(i-=n.direction!=="rtl"?s.scrollLeft:-s.scrollLeft),s===e&&(i+=Oi.getBorderLeftWidth(s),t+=Oi.getBorderTopWidth(s),t+=s.offsetTop,i+=s.offsetLeft,e=s.offsetParent)}return{left:i,top:t}}function Oae(s,e,t){typeof e=="number"&&(s.style.width=`${e}px`),typeof t=="number"&&(s.style.height=`${t}px`)}function qi(s){const e=s.getBoundingClientRect(),t=Te(s);return{left:e.left+t.scrollX,top:e.top+t.scrollY,width:e.width,height:e.height}}function Ez(s){let e=s,t=1;do{const i=ex(e).zoom;i!=null&&i!=="1"&&(t*=i),e=e.parentElement}while(e!==null&&e!==e.ownerDocument.documentElement);return t}function wo(s){const e=Oi.getMarginLeft(s)+Oi.getMarginRight(s);return s.offsetWidth+e}function $E(s){const e=Oi.getBorderLeftWidth(s)+Oi.getBorderRightWidth(s),t=Oi.getPaddingLeft(s)+Oi.getPaddingRight(s);return s.offsetWidth-e-t}function Bae(s){const e=Oi.getBorderTopWidth(s)+Oi.getBorderBottomWidth(s),t=Oi.getPaddingTop(s)+Oi.getPaddingBottom(s);return s.offsetHeight-e-t}function uc(s){const e=Oi.getMarginTop(s)+Oi.getMarginBottom(s);return s.offsetHeight+e}function An(s,e){return!!(e!=null&&e.contains(s))}function Wae(s,e,t){for(;s&&s.nodeType===s.ELEMENT_NODE;){if(s.classList.contains(e))return s;if(t){if(typeof t=="string"){if(s.classList.contains(t))return null}else if(s===t)return null}s=s.parentNode}return null}function jE(s,e,t){return!!Wae(s,e,t)}function Iz(s){return s&&!!s.host&&!!s.mode}function US(s){return!!Sf(s)}function Sf(s){for(var e;s.parentNode;){if(s===((e=s.ownerDocument)===null||e===void 0?void 0:e.body))return null;s=s.parentNode}return Iz(s)?s:null}function Xn(){let s=o0().activeElement;for(;s!=null&&s.shadowRoot;)s=s.shadowRoot.activeElement;return s}function tx(s){return Xn()===s}function Tz(s){return An(Xn(),s)}function o0(){var s;return Tae()<=1?Ht.document:(s=Array.from(Lz()).map(({window:t})=>t.document).find(t=>t.hasFocus()))!==null&&s!==void 0?s:Ht.document}function Hae(){var s,e;return(e=(s=o0().defaultView)===null||s===void 0?void 0:s.window)!==null&&e!==void 0?e:Ht}const dF=new Map;function Nz(){return new Vae}class Vae{constructor(){this._currentCssStyle="",this._styleSheet=void 0}setStyle(e){e!==this._currentCssStyle&&(this._currentCssStyle=e,this._styleSheet?this._styleSheet.innerText=e:this._styleSheet=ar(Ht.document.head,t=>t.innerText=e))}dispose(){this._styleSheet&&(this._styleSheet.remove(),this._styleSheet=void 0)}}function ar(s=Ht.document.head,e,t){const i=document.createElement("style");if(i.type="text/css",i.media="screen",e==null||e(i),s.appendChild(i),t&&t.add(Ie(()=>s.removeChild(i))),s===Ht.document.head){const n=new Set;dF.set(i,n);for(const{window:o,disposables:r}of Lz()){if(o===Ht)continue;const a=r.add(zae(i,n,o));t==null||t.add(a)}}return i}function zae(s,e,t){var i,n;const o=new Y,r=s.cloneNode(!0);t.document.head.appendChild(r),o.add(Ie(()=>t.document.head.removeChild(r)));for(const a of Mz(s))(i=r.sheet)===null||i===void 0||i.insertRule(a.cssText,(n=r.sheet)===null||n===void 0?void 0:n.cssRules.length);return o.add(Uae.observe(s,o,{childList:!0})(()=>{r.textContent=s.textContent})),e.add(r),o.add(Ie(()=>e.delete(r))),o}const Uae=new class{constructor(){this.mutationObservers=new Map}observe(s,e,t){let i=this.mutationObservers.get(s);i||(i=new Map,this.mutationObservers.set(s,i));const n=XL(t);let o=i.get(n);if(o)o.users+=1;else{const r=new B,a=new MutationObserver(d=>r.fire(d));a.observe(s,t);const l=o={users:1,observer:a,onDidMutate:r.event};e.add(Ie(()=>{l.users-=1,l.users===0&&(r.dispose(),a.disconnect(),i==null||i.delete(n),(i==null?void 0:i.size)===0&&this.mutationObservers.delete(s))})),i.set(n,o)}return o.onDidMutate}};let KE=null;function Az(){return KE||(KE=ar()),KE}function Mz(s){var e,t;return!((e=s==null?void 0:s.sheet)===null||e===void 0)&&e.rules?s.sheet.rules:!((t=s==null?void 0:s.sheet)===null||t===void 0)&&t.cssRules?s.sheet.cssRules:[]}function $S(s,e,t=Az()){var i,n;if(!(!t||!e)){(i=t.sheet)===null||i===void 0||i.insertRule(`${s} {${e}}`,0);for(const o of(n=dF.get(t))!==null&&n!==void 0?n:[])$S(s,e,o)}}function oA(s,e=Az()){var t,i;if(!e)return;const n=Mz(e),o=[];for(let r=0;r=0;r--)(t=e.sheet)===null||t===void 0||t.deleteRule(o[r]);for(const r of(i=dF.get(e))!==null&&i!==void 0?i:[])oA(s,r)}function $ae(s){return typeof s.selectorText=="string"}function cF(s){return s instanceof MouseEvent||s instanceof Te(s).MouseEvent}function Iu(s){return s instanceof KeyboardEvent||s instanceof Te(s).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",CHANGE:"change",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 jae(s){const e=s;return!!(e&&typeof e.preventDefault=="function"&&typeof e.stopPropagation=="function")}const nt={stop:(s,e)=>(s.preventDefault(),e&&s.stopPropagation(),s)};function Kae(s){const e=[];for(let t=0;s&&s.nodeType===s.ELEMENT_NODE;t++)e[t]=s.scrollTop,s=s.parentNode;return e}function qae(s,e){for(let t=0;s&&s.nodeType===s.ELEMENT_NODE;t++)s.scrollTop!==e[t]&&(s.scrollTop=e[t]),s=s.parentNode}class jS extends H{static hasFocusWithin(e){if(e instanceof HTMLElement){const t=Sf(e),i=t?t.activeElement:e.ownerDocument.activeElement;return An(i,e)}else{const t=e;return An(t.document.activeElement,t.document)}}constructor(e){super(),this._onDidFocus=this._register(new B),this.onDidFocus=this._onDidFocus.event,this._onDidBlur=this._register(new B),this.onDidBlur=this._onDidBlur.event;let t=jS.hasFocusWithin(e),i=!1;const n=()=>{i=!1,t||(t=!0,this._onDidFocus.fire())},o=()=>{t&&(i=!0,(e instanceof HTMLElement?Te(e):e).setTimeout(()=>{i&&(i=!1,t=!1,this._onDidBlur.fire())},0))};this._refreshStateHandler=()=>{jS.hasFocusWithin(e)!==t&&(t?o():n())},this._register(K(e,ee.FOCUS,n,!0)),this._register(K(e,ee.BLUR,o,!0)),e instanceof HTMLElement&&(this._register(K(e,ee.FOCUS_IN,()=>this._refreshStateHandler())),this._register(K(e,ee.FOCUS_OUT,()=>this._refreshStateHandler())))}}function ba(s){return new jS(s)}function Gae(s,e){return s.after(e),e}function Q(s,...e){if(s.append(...e),e.length===1&&typeof e[0]!="string")return e[0]}function uF(s,e){return s.insertBefore(e,s.firstChild),e}function Yn(s,...e){s.innerText="",Q(s,...e)}const Zae=/([\w\-]+)?(#([\w\-]+))?((\.([\w\-]+))*)/;var Fb;(function(s){s.HTML="http://www.w3.org/1999/xhtml",s.SVG="http://www.w3.org/2000/svg"})(Fb||(Fb={}));function Rz(s,e,t,...i){const n=Zae.exec(e);if(!n)throw new Error("Bad use of emmet");const o=n[1]||"div";let r;return s!==Fb.HTML?r=document.createElementNS(s,o):r=document.createElement(o),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 he(s,e,...t){return Rz(Fb.HTML,s,e,...t)}he.SVG=function(s,e,...t){return Rz(Fb.SVG,s,e,...t)};function Xae(s,...e){s?Do(...e):Es(...e)}function Do(...s){for(const e of s)e.style.display="",e.removeAttribute("aria-hidden")}function Es(...s){for(const e of s)e.style.display="none",e.setAttribute("aria-hidden","true")}function w3(s,e){const t=s.devicePixelRatio*e;return Math.max(1,Math.floor(t))/s.devicePixelRatio}function Pz(s){Ht.open(s,"_blank","noopener")}function Yae(s,e){const t=()=>{e(),i=Ao(s,t)};let i=Ao(s,t);return Ie(()=>i.dispose())}Sz.setPreferredWebSchema(/^https:/.test(Ht.location.href)?"https":"http");function Ih(s){return s?`url('${Dz.uriToBrowserUri(s).toString(!0).replace(/'/g,"%27")}')`:"url('')"}function qE(s){return`'${s.replace(/'/g,"%27")}'`}function Ec(s,e){if(s!==void 0){const t=s.match(/^\s*var\((.+)\)$/);if(t){const i=t[1].split(",",2);return i.length===2&&(e=Ec(i[1].trim(),e)),`var(${i[0]}, ${e})`}return s}return e}function Qae(s,e=!1){const t=document.createElement("a");return sA("afterSanitizeAttributes",i=>{for(const n of["href","src"])if(i.hasAttribute(n)){const o=i.getAttribute(n);if(n==="href"&&o.startsWith("#"))continue;if(t.href=o,!s.includes(t.protocol.replace(/:$/,""))){if(e&&n==="src"&&t.href.startsWith("data:"))continue;i.removeAttribute(n)}}}),Ie(()=>{yz("afterSanitizeAttributes")})}const Jae=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","input","ins","kbd","label","li","mark","ol","p","pre","q","rp","rt","ruby","samp","small","small","source","span","strike","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","time","tr","tt","u","ul","var","video","wbr"]);class hc extends B{constructor(){super(),this._subscriptions=new Y,this._keyStatus={altKey:!1,shiftKey:!1,ctrlKey:!1,metaKey:!1},this._subscriptions.add(le.runAndSubscribe(JL,({window:e,disposables:t})=>this.registerListeners(e,t),{window:Ht,disposables:this._subscriptions}))}registerListeners(e,t){t.add(K(e,"keydown",i=>{if(i.defaultPrevented)return;const n=new Kt(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(K(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(K(e.document.body,"mousedown",()=>{this._keyStatus.lastKeyPressed=void 0},!0)),t.add(K(e.document.body,"mouseup",()=>{this._keyStatus.lastKeyPressed=void 0},!0)),t.add(K(e.document.body,"mousemove",i=>{i.buttons&&(this._keyStatus.lastKeyPressed=void 0)},!0)),t.add(K(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 hc.instance||(hc.instance=new hc),hc.instance}dispose(){super.dispose(),this._subscriptions.dispose()}}class ele extends H{constructor(e,t){super(),this.element=e,this.callbacks=t,this.counter=0,this.dragStartTime=0,this.registerListeners()}registerListeners(){this.callbacks.onDragStart&&this._register(K(this.element,ee.DRAG_START,e=>{var t,i;(i=(t=this.callbacks).onDragStart)===null||i===void 0||i.call(t,e)})),this.callbacks.onDrag&&this._register(K(this.element,ee.DRAG,e=>{var t,i;(i=(t=this.callbacks).onDrag)===null||i===void 0||i.call(t,e)})),this._register(K(this.element,ee.DRAG_ENTER,e=>{var t,i;this.counter++,this.dragStartTime=e.timeStamp,(i=(t=this.callbacks).onDragEnter)===null||i===void 0||i.call(t,e)})),this._register(K(this.element,ee.DRAG_OVER,e=>{var t,i;e.preventDefault(),(i=(t=this.callbacks).onDragOver)===null||i===void 0||i.call(t,e,e.timeStamp-this.dragStartTime)})),this._register(K(this.element,ee.DRAG_LEAVE,e=>{var t,i;this.counter--,this.counter===0&&(this.dragStartTime=0,(i=(t=this.callbacks).onDragLeave)===null||i===void 0||i.call(t,e))})),this._register(K(this.element,ee.DRAG_END,e=>{var t,i;this.counter=0,this.dragStartTime=0,(i=(t=this.callbacks).onDragEnd)===null||i===void 0||i.call(t,e)})),this._register(K(this.element,ee.DROP,e=>{var t,i;this.counter=0,this.dragStartTime=0,(i=(t=this.callbacks).onDrop)===null||i===void 0||i.call(t,e)}))}}const tle=/(?[\w\-]+)?(?:#(?[\w\-]+))?(?(?:\.(?:[\w\-]+))*)(?:@(?(?:[\w\_])+))?/;function Nt(s,...e){let t,i;Array.isArray(e[0])?(t={},i=e[0]):(t=e[0]||{},i=e[1]);const n=tle.exec(s);if(!n||!n.groups)throw new Error("Bad use of h");const o=n.groups.tag||"div",r=document.createElement(o);n.groups.id&&(r.id=n.groups.id);const a=[];if(n.groups.class)for(const d of n.groups.class.split("."))d!==""&&a.push(d);if(t.className!==void 0)for(const d of t.className.split("."))d!==""&&a.push(d);a.length>0&&(r.className=a.join(" "));const l={};if(n.groups.name&&(l[n.groups.name]=r),i)for(const d of i)d instanceof HTMLElement?r.appendChild(d):typeof d=="string"?r.append(d):"root"in d&&(Object.assign(l,d),r.appendChild(d.root));for(const[d,c]of Object.entries(t))if(d!=="className")if(d==="style")for(const[u,h]of Object.entries(c))r.style.setProperty(y3(u),typeof h=="number"?h+"px":""+h);else d==="tabIndex"?r.tabIndex=c:r.setAttribute(y3(d),c.toString());return l.root=r,l}function y3(s){return s.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}class ile extends H{constructor(e){super(),this._onDidChange=this._register(new B),this.onDidChange=this._onDidChange.event,this._listener=()=>this._handleChange(e,!0),this._mediaQueryList=null,this._handleChange(e,!1)}_handleChange(e,t){var i;(i=this._mediaQueryList)===null||i===void 0||i.removeEventListener("change",this._listener),this._mediaQueryList=e.matchMedia(`(resolution: ${e.devicePixelRatio}dppx)`),this._mediaQueryList.addEventListener("change",this._listener),t&&this._onDidChange.fire()}}class nle extends H{get value(){return this._value}constructor(e){super(),this._onDidChange=this._register(new B),this.onDidChange=this._onDidChange.event,this._value=this._getPixelRatio(e);const t=this._register(new ile(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 sle{constructor(){this.mapWindowIdToPixelRatioMonitor=new Map}_getOrCreatePixelRatioMonitor(e){const t=VS(e);let i=this.mapWindowIdToPixelRatioMonitor.get(t);return i||(i=new nle(e),this.mapWindowIdToPixelRatioMonitor.set(t,i),le.once(Aae)(({vscodeWindowId:n})=>{n===t&&(i==null||i.dispose(),this.mapWindowIdToPixelRatioMonitor.delete(t))})),i}getInstance(e){return this._getOrCreatePixelRatioMonitor(e)}}const Ob=new sle;class Fz{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=""}setMaxWidth(e){const t=ka(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){const t=ka(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){const t=ka(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){const t=ka(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){const t=ka(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){const t=ka(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){const t=ka(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingLeft(e){const t=ka(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=ka(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=ka(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){const t=ka(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 ka(s){return typeof s=="number"?`${s}px`:s}function It(s){return new Fz(s)}function Un(s,e){s instanceof Fz?(s.setFontFamily(e.getMassagedFontFamily()),s.setFontWeight(e.fontWeight),s.setFontSize(e.fontSize),s.setFontFeatureSettings(e.fontFeatureSettings),s.setFontVariationSettings(e.fontVariationSettings),s.setLineHeight(e.lineHeight),s.setLetterSpacing(e.letterSpacing)):(s.style.fontFamily=e.getMassagedFontFamily(),s.style.fontWeight=e.fontWeight,s.style.fontSize=e.fontSize+"px",s.style.fontFeatureSettings=e.fontFeatureSettings,s.style.fontVariationSettings=e.fontVariationSettings,s.style.lineHeight=e.lineHeight+"px",s.style.letterSpacing=e.letterSpacing+"px")}class ole{constructor(e,t){this.chr=e,this.type=t,this.width=0}fulfill(e){this.width=e}}class hF{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(),e.document.body.removeChild(this._container),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");Un(t,this._bareFontInfo),e.appendChild(t);const i=document.createElement("div");Un(i,this._bareFontInfo),i.style.fontWeight="bold",e.appendChild(i);const n=document.createElement("div");Un(n,this._bareFontInfo),n.style.fontStyle="italic",e.appendChild(n);const o=[];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");hF._render(l,r),a.appendChild(l),o.push(l)}this._container=e,this._testElements=o}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{this._evictUntrustedReadingsTimeout=-1,this._evictUntrustedReadings(e)},5e3))}_evictUntrustedReadings(e){const t=this._ensureCache(e),i=t.getValues();let n=!1;for(const o of i)o.isTrusted||(n=!0,t.remove(o));n&&this._onDidChange.fire()}readFontInfo(e,t){const i=this._ensureCache(e);if(!i.has(t)){let n=this._actualReadFontInfo(e,t);(n.typicalHalfwidthCharacterWidth<=2||n.typicalFullwidthCharacterWidth<=2||n.spaceWidth<=2||n.maxDigitWidth<=2)&&(n=new rA({pixelRatio:Ob.getInstance(e).value,fontFamily:n.fontFamily,fontWeight:n.fontWeight,fontSize:n.fontSize,fontFeatureSettings:n.fontFeatureSettings,fontVariationSettings:n.fontVariationSettings,lineHeight:n.lineHeight,letterSpacing:n.letterSpacing,isMonospace:n.isMonospace,typicalHalfwidthCharacterWidth:Math.max(n.typicalHalfwidthCharacterWidth,5),typicalFullwidthCharacterWidth:Math.max(n.typicalFullwidthCharacterWidth,5),canUseHalfwidthRightwardsArrow:n.canUseHalfwidthRightwardsArrow,spaceWidth:Math.max(n.spaceWidth,5),middotWidth:Math.max(n.middotWidth,5),wsmiddotWidth:Math.max(n.wsmiddotWidth,5),maxDigitWidth:Math.max(n.maxDigitWidth,5)},!1)),this._writeToCache(e,t,n)}return i.get(t)}_createRequest(e,t,i,n){const o=new ole(e,t);return i.push(o),n==null||n.push(o),o}_actualReadFontInfo(e,t){const i=[],n=[],o=this._createRequest("n",0,i,n),r=this._createRequest("m",0,i,null),a=this._createRequest(" ",0,i,n),l=this._createRequest("0",0,i,n),d=this._createRequest("1",0,i,n),c=this._createRequest("2",0,i,n),u=this._createRequest("3",0,i,n),h=this._createRequest("4",0,i,n),g=this._createRequest("5",0,i,n),f=this._createRequest("6",0,i,n),m=this._createRequest("7",0,i,n),_=this._createRequest("8",0,i,n),v=this._createRequest("9",0,i,n),b=this._createRequest("→",0,i,n),C=this._createRequest("→",0,i,null),w=this._createRequest("·",0,i,n),y=this._createRequest("⸱",0,i,null),D="|/-_ilm%";for(let R=0,P=D.length;R.001){k=!1;break}}let O=!0;return k&&C.width!==I&&(O=!1),C.width>b.width&&(O=!1),new rA({pixelRatio:Ob.getInstance(e).value,fontFamily:t.fontFamily,fontWeight:t.fontWeight,fontSize:t.fontSize,fontFeatureSettings:t.fontFeatureSettings,fontVariationSettings:t.fontVariationSettings,lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,isMonospace:k,typicalHalfwidthCharacterWidth:o.width,typicalFullwidthCharacterWidth:r.width,canUseHalfwidthRightwardsArrow:O,spaceWidth:a.width,middotWidth:w.width,wsmiddotWidth:y.width,maxDigitWidth:L},!0)}}class cle{constructor(){this._keys=Object.create(null),this._values=Object.create(null)}has(e){const t=e.getId();return!!this._values[t]}get(e){const t=e.getId();return this._values[t]}put(e,t){const i=e.getId();this._keys[i]=e,this._values[i]=t}remove(e){const t=e.getId();delete this._keys[t],delete this._values[t]}getValues(){return Object.keys(this._keys).map(e=>this._values[e])}}const aA=new dle;var qa;(function(s){s.serviceIds=new Map,s.DI_TARGET="$di$target",s.DI_DEPENDENCIES="$di$dependencies";function e(t){return t[s.DI_DEPENDENCIES]||[]}s.getServiceDependencies=e})(qa||(qa={}));const Ne=ut("instantiationService");function ule(s,e,t){e[qa.DI_TARGET]===e?e[qa.DI_DEPENDENCIES].push({id:s,index:t}):(e[qa.DI_DEPENDENCIES]=[{id:s,index:t}],e[qa.DI_TARGET]=e)}function ut(s){if(qa.serviceIds.has(s))return qa.serviceIds.get(s);const e=function(t,i,n){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");ule(e,t,n)};return e.toString=()=>s,qa.serviceIds.set(s,e),e}const xt=ut("codeEditorService"),_i=ut("modelService"),mo=ut("textModelService");class Eo extends H{constructor(e,t="",i="",n=!0,o){super(),this._onDidChange=this._register(new B),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=e,this._label=t,this._cssClass=i,this._enabled=n,this._actionCallback=o}get id(){return this._id}get label(){return this._label}set label(e){this._setLabel(e)}_setLabel(e){this._label!==e&&(this._label=e,this._onDidChange.fire({label:e}))}get tooltip(){return this._tooltip||""}set tooltip(e){this._setTooltip(e)}_setTooltip(e){this._tooltip!==e&&(this._tooltip=e,this._onDidChange.fire({tooltip:e}))}get class(){return this._cssClass}set class(e){this._setClass(e)}_setClass(e){this._cssClass!==e&&(this._cssClass=e,this._onDidChange.fire({class:e}))}get enabled(){return this._enabled}set enabled(e){this._setEnabled(e)}_setEnabled(e){this._enabled!==e&&(this._enabled=e,this._onDidChange.fire({enabled:e}))}get checked(){return this._checked}set checked(e){this._setChecked(e)}_setChecked(e){this._checked!==e&&(this._checked=e,this._onDidChange.fire({checked:e}))}async run(e,t){this._actionCallback&&await this._actionCallback(e)}}class Df extends H{constructor(){super(...arguments),this._onWillRun=this._register(new B),this.onWillRun=this._onWillRun.event,this._onDidRun=this._register(new B),this.onDidRun=this._onDidRun.event}async run(e,t){if(!e.enabled)return;this._onWillRun.fire({action:e});let i;try{await this.runAction(e,t)}catch(n){i=n}this._onDidRun.fire({action:e,error:i})}async runAction(e,t){await e.run(t)}}class rn{constructor(){this.id=rn.ID,this.label="",this.tooltip="",this.class="separator",this.enabled=!1,this.checked=!1}static join(...e){let t=[];for(const i of e)i.length&&(t.length?t=[...t,new rn,...i]:t=i);return t}async run(){}}rn.ID="vs.actions.separator";class c_{get actions(){return this._actions}constructor(e,t,i,n){this.tooltip="",this.enabled=!0,this.checked=void 0,this.id=e,this.label=t,this.class=n,this._actions=i}async run(){}}class ix extends Eo{constructor(){super(ix.ID,p("submenu.empty","(empty)"),void 0,!1)}}ix.ID="vs.actions.empty";function af(s){var e;return{id:s.id,label:s.label,class:s.class,enabled:(e=s.enabled)!==null&&e!==void 0?e:!0,checked:s.checked,run:async(...t)=>s.run(...t),tooltip:s.label}}var lA;(function(s){function e(t){return t&&typeof t=="object"&&typeof t.id=="string"}s.isThemeColor=e})(lA||(lA={}));var Pe;(function(s){s.iconNameSegment="[A-Za-z0-9]+",s.iconNameExpression="[A-Za-z0-9-]+",s.iconModifierExpression="~[A-Za-z]+",s.iconNameCharacter="[A-Za-z0-9~-]";const e=new RegExp(`^(${s.iconNameExpression})(${s.iconModifierExpression})?$`);function t(h){const g=e.exec(h.id);if(!g)return t(oe.error);const[,f,m]=g,_=["codicon","codicon-"+f];return m&&_.push("codicon-modifier-"+m.substring(1)),_}s.asClassNameArray=t;function i(h){return t(h).join(" ")}s.asClassName=i;function n(h){return"."+t(h).join(".")}s.asCSSSelector=n;function o(h){return h&&typeof h=="object"&&typeof h.id=="string"&&(typeof h.color>"u"||lA.isThemeColor(h.color))}s.isThemeIcon=o;const r=new RegExp(`^\\$\\((${s.iconNameExpression}(?:${s.iconModifierExpression})?)\\)$`);function a(h){const g=r.exec(h);if(!g)return;const[,f]=g;return{id:f}}s.fromString=a;function l(h){return{id:h}}s.fromId=l;function d(h,g){let f=h.id;const m=f.lastIndexOf("~");return m!==-1&&(f=f.substring(0,m)),g&&(f=`${f}~${g}`),{id:f}}s.modify=d;function c(h){const g=h.id.lastIndexOf("~");if(g!==-1)return h.id.substring(g+1)}s.getModifier=c;function u(h,g){var f,m;return h.id===g.id&&((f=h.color)===null||f===void 0?void 0:f.id)===((m=g.color)===null||m===void 0?void 0:m.id)}s.isEqual=u})(Pe||(Pe={}));const gi=ut("commandService"),pt=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new B,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(s,e){if(!s)throw new Error("invalid command");if(typeof s=="string"){if(!e)throw new Error("invalid command");return this.registerCommand({id:s,handler:e})}if(s.metadata&&Array.isArray(s.metadata.args)){const r=[];for(const l of s.metadata.args)r.push(l.constraint);const a=s.handler;s.handler=function(l,...d){return Ise(d,r),a(l,...d)}}const{id:t}=s;let i=this._commands.get(t);i||(i=new Rs,this._commands.set(t,i));const n=i.unshift(s),o=Ie(()=>{n();const r=this._commands.get(t);r!=null&&r.isEmpty()&&this._commands.delete(t)});return this._onDidRegisterCommand.fire(t),o}registerCommandAlias(s,e){return pt.registerCommand(s,(t,...i)=>t.get(gi).executeCommand(e,...i))}getCommand(s){const e=this._commands.get(s);if(!(!e||e.isEmpty()))return ft.first(e)}getCommands(){const s=new Map;for(const e of this._commands.keys()){const t=this.getCommand(e);t&&s.set(e,t)}return s}};pt.registerCommand("noop",()=>{});function ZE(...s){switch(s.length){case 1:return p("contextkey.scanner.hint.didYouMean1","Did you mean {0}?",s[0]);case 2:return p("contextkey.scanner.hint.didYouMean2","Did you mean {0} or {1}?",s[0],s[1]);case 3:return p("contextkey.scanner.hint.didYouMean3","Did you mean {0}, {1} or {2}?",s[0],s[1],s[2]);default:return}}const hle=p("contextkey.scanner.hint.didYouForgetToOpenOrCloseQuote","Did you forget to open or close the quote?"),gle=p("contextkey.scanner.hint.didYouForgetToEscapeSlash","Did you forget to escape the '/' (slash) character? Put two backslashes before it to escape, e.g., '\\\\/'.");let Rg=class dA{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 UP(`unhandled token type: ${JSON.stringify(e)}; have you forgotten to add a case?`)}}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(ZE("==","=~"));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(ZE("&&"));break;case 124:this._match(124)?this._addToken(16):this._error(ZE("||"));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=dA._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(hle);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(gle);return}const o=this._input.charCodeAt(e);if(t)t=!1;else if(o===47&&!i){e++;break}else o===91?i=!0:o===92?t=!0:o===93&&(i=!1);e++}for(;e=this._input.length}};Rg._regexFlags=new Set(["i","g","s","m","y","u"].map(s=>s.charCodeAt(0)));Rg._keywords=new Map([["not",14],["in",13],["false",12],["true",11]]);const ls=new Map;ls.set("false",!1);ls.set("true",!0);ls.set("isMac",lt);ls.set("isLinux",$s);ls.set("isWindows",as);ls.set("isWeb",Jh);ls.set("isMacNative",lt&&!Jh);ls.set("isEdge",$se);ls.set("isFirefox",zse);ls.set("isChrome",OV);ls.set("isSafari",Use);const fle=Object.prototype.hasOwnProperty,ple={regexParsingWithErrorRecovery:!0},mle=p("contextkey.parser.error.emptyString","Empty context key expression"),_le=p("contextkey.parser.error.emptyString.hint","Did you forget to write an expression? You can also put 'false' or 'true' to always evaluate to false or true, respectively."),vle=p("contextkey.parser.error.noInAfterNot","'in' after 'not'."),S3=p("contextkey.parser.error.closingParenthesis","closing parenthesis ')'"),ble=p("contextkey.parser.error.unexpectedToken","Unexpected token"),Cle=p("contextkey.parser.error.unexpectedToken.hint","Did you forget to put && or || before the token?"),wle=p("contextkey.parser.error.unexpectedEOF","Unexpected end of expression"),yle=p("contextkey.parser.error.unexpectedEOF.hint","Did you forget to put a context key?");let Oz=class hv{constructor(e=ple){this._config=e,this._scanner=new Rg,this._tokens=[],this._current=0,this._parsingErrors=[],this._flagsGYRe=/g|y/g}parse(e){if(e===""){this._parsingErrors.push({message:mle,offset:0,lexeme:"",additionalInfo:_le});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?Cle:void 0;throw this._parsingErrors.push({message:ble,offset:i.offset,lexeme:Rg.getLexeme(i),additionalInfo:n}),hv._parseError}return t}catch(t){if(t!==hv._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]:G.or(...e)}_and(){const e=[this._term()];for(;this._matchOne(15);){const t=this._term();e.push(t)}return e.length===1?e[0]:G.and(...e)}_term(){if(this._matchOne(2)){const e=this._peek();switch(e.type){case 11:return this._advance(),js.INSTANCE;case 12:return this._advance(),ho.INSTANCE;case 0:{this._advance();const t=this._expr();return this._consume(1,S3),t==null?void 0:t.negate()}case 17:return this._advance(),op.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(),G.true();case 12:return this._advance(),G.false();case 0:{this._advance();const t=this._expr();return this._consume(1,S3),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 o=n.lexeme,r=o.lastIndexOf("/"),a=r===o.length-1?void 0:this._removeFlagsGY(o.substring(r+1));let l;try{l=new RegExp(o.substring(1,r),a)}catch{throw this._errExpectedButGot("REGEX",n)}return Bb.create(t,l)}switch(n.type){case 10:case 19:{const o=[n.lexeme];this._advance();let r=this._peek(),a=0;for(let h=0;h=0){const d=o.slice(a+1,l),c=o[l+1]==="i"?"i":"";try{r=new RegExp(d,c)}catch{throw this._errExpectedButGot("REGEX",n)}}}if(r===null)throw this._errExpectedButGot("REGEX",n);return Bb.create(t,r)}default:throw this._errExpectedButGot("REGEX",this._peek())}}if(this._matchOne(14)){this._consume(13,vle);const n=this._value();return G.notIn(t,n)}switch(this._peek().type){case 3:{this._advance();const n=this._value();if(this._previous().type===18)return G.equals(t,n);switch(n){case"true":return G.has(t);case"false":return G.not(t);default:return G.equals(t,n)}}case 4:{this._advance();const n=this._value();if(this._previous().type===18)return G.notEquals(t,n);switch(n){case"true":return G.not(t);case"false":return G.has(t);default:return G.notEquals(t,n)}}case 5:return this._advance(),dx.create(t,this._value());case 6:return this._advance(),cx.create(t,this._value());case 7:return this._advance(),ax.create(t,this._value());case 8:return this._advance(),lx.create(t,this._value());case 13:return this._advance(),G.in(t,this._value());default:return G.has(t)}}case 20:throw this._parsingErrors.push({message:wle,offset:e.offset,lexeme:"",additionalInfo:yle}),hv._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=p("contextkey.parser.error.expectedButGot",`Expected: {0} Received: '{1}'.`,e,Rg.getLexeme(t)),o=t.offset,r=Rg.getLexeme(t);return this._parsingErrors.push({message:n,offset:o,lexeme:r,additionalInfo:i}),hv._parseError}_check(e){return this._peek().type===e}_peek(){return this._tokens[this._current]}_isAtEnd(){return this._peek().type===20}};Oz._parseError=new Error;class G{static false(){return js.INSTANCE}static true(){return ho.INSTANCE}static has(e){return sp.create(e)}static equals(e,t){return r0.create(e,t)}static notEquals(e,t){return ox.create(e,t)}static regex(e,t){return Bb.create(e,t)}static in(e,t){return nx.create(e,t)}static notIn(e,t){return sx.create(e,t)}static not(e){return op.create(e)}static and(...e){return Gg.create(e,null,!0)}static or(...e){return oc.create(e,null,!0)}static deserialize(e){return e==null?void 0:this._parser.parse(e)}}G._parser=new Oz({regexParsingWithErrorRecovery:!1});function Sle(s,e){const t=s?s.substituteConstants():void 0,i=e?e.substituteConstants():void 0;return!t&&!i?!0:!t||!i?!1:t.equals(i)}function zv(s,e){return s.cmp(e)}class js{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 ho.INSTANCE}}js.INSTANCE=new js;class ho{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 js.INSTANCE}}ho.INSTANCE=new ho;class sp{static create(e,t=null){const i=ls.get(e);return typeof i=="boolean"?i?ho.INSTANCE:js.INSTANCE:new sp(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:Wz(this.key,e.key)}equals(e){return e.type===this.type?this.key===e.key:!1}substituteConstants(){const e=ls.get(this.key);return typeof e=="boolean"?e?ho.INSTANCE:js.INSTANCE:this}evaluate(e){return!!e.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=op.create(this.key,this)),this.negated}}class r0{static create(e,t,i=null){if(typeof t=="boolean")return t?sp.create(e,i):op.create(e,i);const n=ls.get(e);return typeof n=="boolean"?t===(n?"true":"false")?ho.INSTANCE:js.INSTANCE:new r0(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:rp(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=ls.get(this.key);if(typeof e=="boolean"){const t=e?"true":"false";return this.value===t?ho.INSTANCE:js.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=ox.create(this.key,this.value,this)),this.negated}}class nx{static create(e,t){return new nx(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:rp(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?fle.call(t,i):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=sx.create(this.key,this.valueKey)),this.negated}}class sx{static create(e,t){return new sx(e,t)}constructor(e,t){this.key=e,this.valueKey=t,this.type=11,this._negated=nx.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 ox{static create(e,t,i=null){if(typeof t=="boolean")return t?op.create(e,i):sp.create(e,i);const n=ls.get(e);return typeof n=="boolean"?t===(n?"true":"false")?js.INSTANCE:ho.INSTANCE:new ox(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:rp(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=ls.get(this.key);if(typeof e=="boolean"){const t=e?"true":"false";return this.value===t?js.INSTANCE:ho.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=r0.create(this.key,this.value,this)),this.negated}}class op{static create(e,t=null){const i=ls.get(e);return typeof i=="boolean"?i?js.INSTANCE:ho.INSTANCE:new op(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:Wz(this.key,e.key)}equals(e){return e.type===this.type?this.key===e.key:!1}substituteConstants(){const e=ls.get(this.key);return typeof e=="boolean"?e?js.INSTANCE:ho.INSTANCE:this}evaluate(e){return!e.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=sp.create(this.key,this)),this.negated}}function rx(s,e){if(typeof s=="string"){const t=parseFloat(s);isNaN(t)||(s=t)}return typeof s=="string"||typeof s=="number"?e(s):js.INSTANCE}class ax{static create(e,t,i=null){return rx(t,n=>new ax(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:rp(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=cx.create(this.key,this.value,this)),this.negated}}class lx{static create(e,t,i=null){return rx(t,n=>new lx(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:rp(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=dx.create(this.key,this.value,this)),this.negated}}class dx{static create(e,t,i=null){return rx(t,n=>new dx(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:rp(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 cx(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:rp(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=ax.create(this.key,this.value,this)),this.negated}}class Bb{static create(e,t){return new Bb(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=gF.create(this)),this.negated}}class gF{static create(e){return new gF(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 Bz(s){let e=null;for(let t=0,i=s.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,d=oc.create(r.expr.map(c=>Gg.create([c,a],null,i)),null,l);d&&(n.push(d),n.sort(zv))}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=oc.create(e,this,!0)}return this.negated}}class oc{static create(e,t,i){return oc._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 o of L3(t))for(const r of L3(i))n.push(Gg.create([o,r],null,!1));e.unshift(oc.create(n,null,!1))}this.negated=oc.create(e,this,!0)}return this.negated}}class ue extends sp{static all(){return ue._info.values()}constructor(e,t,i){super(e,null),this._defaultValue=t,typeof i=="object"?ue._info.push({...i,key:e}):i!==!0&&ue._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 r0.create(this.key,e)}}ue._info=[];const Be=ut("contextKeyService");function Wz(s,e){return se?1:0}function rp(s,e,t,i){return st?1:ei?1:0}function cA(s,e){if(s.type===0||e.type===1)return!0;if(s.type===9)return e.type===9?D3(s.expr,e.expr):!1;if(e.type===9){for(const t of e.expr)if(cA(s,t))return!0;return!1}if(s.type===6){if(e.type===6)return D3(e.expr,s.expr);for(const t of s.expr)if(cA(t,e))return!0;return!1}return s.equals(e)}function D3(s,e){let t=0,i=0;for(;t{a(),this._cachedMergedKeybindings=null})}getDefaultKeybindings(){return this._cachedMergedKeybindings||(this._cachedMergedKeybindings=Array.from(this._coreKeybindings).concat(this._extensionKeybindings),this._cachedMergedKeybindings.sort(xle)),this._cachedMergedKeybindings.slice(0)}}const go=new pF,Lle={EditorModes:"platform.keybindingsRegistry"};Ji.add(Lle.EditorModes,go);function xle(s,e){if(s.weight1!==e.weight1)return s.weight1-e.weight1;if(s.command&&e.command){if(s.commande.command)return 1}return s.weight2-e.weight2}var kle=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},k3=function(s,e){return function(t,i){e(t,i,s)}},Wy;function tm(s){return s.command!==void 0}function Ele(s){return s.submenu!==void 0}class E{constructor(e){if(E._instances.has(e))throw new TypeError(`MenuId with identifier '${e}' already exists. Use MenuId.for(ident) or a unique identifier`);E._instances.set(e,this),this.id=e}}E._instances=new Map;E.CommandPalette=new E("CommandPalette");E.DebugBreakpointsContext=new E("DebugBreakpointsContext");E.DebugCallStackContext=new E("DebugCallStackContext");E.DebugConsoleContext=new E("DebugConsoleContext");E.DebugVariablesContext=new E("DebugVariablesContext");E.NotebookVariablesContext=new E("NotebookVariablesContext");E.DebugHoverContext=new E("DebugHoverContext");E.DebugWatchContext=new E("DebugWatchContext");E.DebugToolBar=new E("DebugToolBar");E.DebugToolBarStop=new E("DebugToolBarStop");E.EditorContext=new E("EditorContext");E.SimpleEditorContext=new E("SimpleEditorContext");E.EditorContent=new E("EditorContent");E.EditorLineNumberContext=new E("EditorLineNumberContext");E.EditorContextCopy=new E("EditorContextCopy");E.EditorContextPeek=new E("EditorContextPeek");E.EditorContextShare=new E("EditorContextShare");E.EditorTitle=new E("EditorTitle");E.EditorTitleRun=new E("EditorTitleRun");E.EditorTitleContext=new E("EditorTitleContext");E.EditorTitleContextShare=new E("EditorTitleContextShare");E.EmptyEditorGroup=new E("EmptyEditorGroup");E.EmptyEditorGroupContext=new E("EmptyEditorGroupContext");E.EditorTabsBarContext=new E("EditorTabsBarContext");E.EditorTabsBarShowTabsSubmenu=new E("EditorTabsBarShowTabsSubmenu");E.EditorTabsBarShowTabsZenModeSubmenu=new E("EditorTabsBarShowTabsZenModeSubmenu");E.EditorActionsPositionSubmenu=new E("EditorActionsPositionSubmenu");E.ExplorerContext=new E("ExplorerContext");E.ExplorerContextShare=new E("ExplorerContextShare");E.ExtensionContext=new E("ExtensionContext");E.GlobalActivity=new E("GlobalActivity");E.CommandCenter=new E("CommandCenter");E.CommandCenterCenter=new E("CommandCenterCenter");E.LayoutControlMenuSubmenu=new E("LayoutControlMenuSubmenu");E.LayoutControlMenu=new E("LayoutControlMenu");E.MenubarMainMenu=new E("MenubarMainMenu");E.MenubarAppearanceMenu=new E("MenubarAppearanceMenu");E.MenubarDebugMenu=new E("MenubarDebugMenu");E.MenubarEditMenu=new E("MenubarEditMenu");E.MenubarCopy=new E("MenubarCopy");E.MenubarFileMenu=new E("MenubarFileMenu");E.MenubarGoMenu=new E("MenubarGoMenu");E.MenubarHelpMenu=new E("MenubarHelpMenu");E.MenubarLayoutMenu=new E("MenubarLayoutMenu");E.MenubarNewBreakpointMenu=new E("MenubarNewBreakpointMenu");E.PanelAlignmentMenu=new E("PanelAlignmentMenu");E.PanelPositionMenu=new E("PanelPositionMenu");E.ActivityBarPositionMenu=new E("ActivityBarPositionMenu");E.MenubarPreferencesMenu=new E("MenubarPreferencesMenu");E.MenubarRecentMenu=new E("MenubarRecentMenu");E.MenubarSelectionMenu=new E("MenubarSelectionMenu");E.MenubarShare=new E("MenubarShare");E.MenubarSwitchEditorMenu=new E("MenubarSwitchEditorMenu");E.MenubarSwitchGroupMenu=new E("MenubarSwitchGroupMenu");E.MenubarTerminalMenu=new E("MenubarTerminalMenu");E.MenubarViewMenu=new E("MenubarViewMenu");E.MenubarHomeMenu=new E("MenubarHomeMenu");E.OpenEditorsContext=new E("OpenEditorsContext");E.OpenEditorsContextShare=new E("OpenEditorsContextShare");E.ProblemsPanelContext=new E("ProblemsPanelContext");E.SCMInputBox=new E("SCMInputBox");E.SCMChangesSeparator=new E("SCMChangesSeparator");E.SCMIncomingChanges=new E("SCMIncomingChanges");E.SCMIncomingChangesContext=new E("SCMIncomingChangesContext");E.SCMIncomingChangesSetting=new E("SCMIncomingChangesSetting");E.SCMOutgoingChanges=new E("SCMOutgoingChanges");E.SCMOutgoingChangesContext=new E("SCMOutgoingChangesContext");E.SCMOutgoingChangesSetting=new E("SCMOutgoingChangesSetting");E.SCMIncomingChangesAllChangesContext=new E("SCMIncomingChangesAllChangesContext");E.SCMIncomingChangesHistoryItemContext=new E("SCMIncomingChangesHistoryItemContext");E.SCMOutgoingChangesAllChangesContext=new E("SCMOutgoingChangesAllChangesContext");E.SCMOutgoingChangesHistoryItemContext=new E("SCMOutgoingChangesHistoryItemContext");E.SCMChangeContext=new E("SCMChangeContext");E.SCMResourceContext=new E("SCMResourceContext");E.SCMResourceContextShare=new E("SCMResourceContextShare");E.SCMResourceFolderContext=new E("SCMResourceFolderContext");E.SCMResourceGroupContext=new E("SCMResourceGroupContext");E.SCMSourceControl=new E("SCMSourceControl");E.SCMSourceControlInline=new E("SCMSourceControlInline");E.SCMSourceControlTitle=new E("SCMSourceControlTitle");E.SCMTitle=new E("SCMTitle");E.SearchContext=new E("SearchContext");E.SearchActionMenu=new E("SearchActionContext");E.StatusBarWindowIndicatorMenu=new E("StatusBarWindowIndicatorMenu");E.StatusBarRemoteIndicatorMenu=new E("StatusBarRemoteIndicatorMenu");E.StickyScrollContext=new E("StickyScrollContext");E.TestItem=new E("TestItem");E.TestItemGutter=new E("TestItemGutter");E.TestMessageContext=new E("TestMessageContext");E.TestMessageContent=new E("TestMessageContent");E.TestPeekElement=new E("TestPeekElement");E.TestPeekTitle=new E("TestPeekTitle");E.TouchBarContext=new E("TouchBarContext");E.TitleBarContext=new E("TitleBarContext");E.TitleBarTitleContext=new E("TitleBarTitleContext");E.TunnelContext=new E("TunnelContext");E.TunnelPrivacy=new E("TunnelPrivacy");E.TunnelProtocol=new E("TunnelProtocol");E.TunnelPortInline=new E("TunnelInline");E.TunnelTitle=new E("TunnelTitle");E.TunnelLocalAddressInline=new E("TunnelLocalAddressInline");E.TunnelOriginInline=new E("TunnelOriginInline");E.ViewItemContext=new E("ViewItemContext");E.ViewContainerTitle=new E("ViewContainerTitle");E.ViewContainerTitleContext=new E("ViewContainerTitleContext");E.ViewTitle=new E("ViewTitle");E.ViewTitleContext=new E("ViewTitleContext");E.CommentEditorActions=new E("CommentEditorActions");E.CommentThreadTitle=new E("CommentThreadTitle");E.CommentThreadActions=new E("CommentThreadActions");E.CommentThreadAdditionalActions=new E("CommentThreadAdditionalActions");E.CommentThreadTitleContext=new E("CommentThreadTitleContext");E.CommentThreadCommentContext=new E("CommentThreadCommentContext");E.CommentTitle=new E("CommentTitle");E.CommentActions=new E("CommentActions");E.CommentsViewThreadActions=new E("CommentsViewThreadActions");E.InteractiveToolbar=new E("InteractiveToolbar");E.InteractiveCellTitle=new E("InteractiveCellTitle");E.InteractiveCellDelete=new E("InteractiveCellDelete");E.InteractiveCellExecute=new E("InteractiveCellExecute");E.InteractiveInputExecute=new E("InteractiveInputExecute");E.IssueReporter=new E("IssueReporter");E.NotebookToolbar=new E("NotebookToolbar");E.NotebookStickyScrollContext=new E("NotebookStickyScrollContext");E.NotebookCellTitle=new E("NotebookCellTitle");E.NotebookCellDelete=new E("NotebookCellDelete");E.NotebookCellInsert=new E("NotebookCellInsert");E.NotebookCellBetween=new E("NotebookCellBetween");E.NotebookCellListTop=new E("NotebookCellTop");E.NotebookCellExecute=new E("NotebookCellExecute");E.NotebookCellExecuteGoTo=new E("NotebookCellExecuteGoTo");E.NotebookCellExecutePrimary=new E("NotebookCellExecutePrimary");E.NotebookDiffCellInputTitle=new E("NotebookDiffCellInputTitle");E.NotebookDiffCellMetadataTitle=new E("NotebookDiffCellMetadataTitle");E.NotebookDiffCellOutputsTitle=new E("NotebookDiffCellOutputsTitle");E.NotebookOutputToolbar=new E("NotebookOutputToolbar");E.NotebookOutlineFilter=new E("NotebookOutlineFilter");E.NotebookOutlineActionMenu=new E("NotebookOutlineActionMenu");E.NotebookEditorLayoutConfigure=new E("NotebookEditorLayoutConfigure");E.NotebookKernelSource=new E("NotebookKernelSource");E.BulkEditTitle=new E("BulkEditTitle");E.BulkEditContext=new E("BulkEditContext");E.TimelineItemContext=new E("TimelineItemContext");E.TimelineTitle=new E("TimelineTitle");E.TimelineTitleContext=new E("TimelineTitleContext");E.TimelineFilterSubMenu=new E("TimelineFilterSubMenu");E.AccountsContext=new E("AccountsContext");E.SidebarTitle=new E("SidebarTitle");E.PanelTitle=new E("PanelTitle");E.AuxiliaryBarTitle=new E("AuxiliaryBarTitle");E.AuxiliaryBarHeader=new E("AuxiliaryBarHeader");E.TerminalInstanceContext=new E("TerminalInstanceContext");E.TerminalEditorInstanceContext=new E("TerminalEditorInstanceContext");E.TerminalNewDropdownContext=new E("TerminalNewDropdownContext");E.TerminalTabContext=new E("TerminalTabContext");E.TerminalTabEmptyAreaContext=new E("TerminalTabEmptyAreaContext");E.TerminalStickyScrollContext=new E("TerminalStickyScrollContext");E.WebviewContext=new E("WebviewContext");E.InlineCompletionsActions=new E("InlineCompletionsActions");E.InlineEditActions=new E("InlineEditActions");E.NewFile=new E("NewFile");E.MergeInput1Toolbar=new E("MergeToolbar1Toolbar");E.MergeInput2Toolbar=new E("MergeToolbar2Toolbar");E.MergeBaseToolbar=new E("MergeBaseToolbar");E.MergeInputResultToolbar=new E("MergeToolbarResultToolbar");E.InlineSuggestionToolbar=new E("InlineSuggestionToolbar");E.InlineEditToolbar=new E("InlineEditToolbar");E.ChatContext=new E("ChatContext");E.ChatCodeBlock=new E("ChatCodeblock");E.ChatCompareBlock=new E("ChatCompareBlock");E.ChatMessageTitle=new E("ChatMessageTitle");E.ChatExecute=new E("ChatExecute");E.ChatExecuteSecondary=new E("ChatExecuteSecondary");E.ChatInputSide=new E("ChatInputSide");E.AccessibleView=new E("AccessibleView");E.MultiDiffEditorFileToolbar=new E("MultiDiffEditorFileToolbar");E.DiffEditorHunkToolbar=new E("DiffEditorHunkToolbar");E.DiffEditorSelectionToolbar=new E("DiffEditorSelectionToolbar");const hr=ut("menuService");class rc{static for(e){let t=this._all.get(e);return t||(t=new rc(e),this._all.set(e,t)),t}static merge(e){const t=new Set;for(const i of e)i instanceof rc&&t.add(i.id);return t}constructor(e){this.id=e,this.has=t=>t===e}}rc._all=new Map;const yn=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new Goe({merge:rc.merge}),this.onDidChangeMenu=this._onDidChangeMenu.event}addCommand(s){return this._commands.set(s.id,s),this._onDidChangeMenu.fire(rc.for(E.CommandPalette)),Ie(()=>{this._commands.delete(s.id)&&this._onDidChangeMenu.fire(rc.for(E.CommandPalette))})}getCommand(s){return this._commands.get(s)}getCommands(){const s=new Map;return this._commands.forEach((e,t)=>s.set(t,e)),s}appendMenuItem(s,e){let t=this._menuItems.get(s);t||(t=new Rs,this._menuItems.set(s,t));const i=t.push(e);return this._onDidChangeMenu.fire(rc.for(s)),Ie(()=>{i(),this._onDidChangeMenu.fire(rc.for(s))})}appendMenuItems(s){const e=new Y;for(const{id:t,item:i}of s)e.add(this.appendMenuItem(t,i));return e}getMenuItems(s){let e;return this._menuItems.has(s)?e=[...this._menuItems.get(s)]:e=[],s===E.CommandPalette&&this._appendImplicitItems(e),e}_appendImplicitItems(s){const e=new Set;for(const t of s)tm(t)&&(e.add(t.command.id),t.alt&&e.add(t.alt.id));this._commands.forEach((t,i)=>{e.has(i)||s.push({command:t})})}};class Em extends c_{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 Io=Wy=class{static label(e,t){return t!=null&&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,o,r,a){var l,d;this.hideActions=n,this.menuKeybinding=o,this._commandService=a,this.id=e.id,this.label=Wy.label(e,i),this.tooltip=(d=typeof e.tooltip=="string"?e.tooltip:(l=e.tooltip)===null||l===void 0?void 0:l.value)!==null&&d!==void 0?d:"",this.enabled=!e.precondition||r.contextMatchesRules(e.precondition),this.checked=void 0;let c;if(e.toggled){const u=e.toggled.condition?e.toggled:{condition:e.toggled};this.checked=r.contextMatchesRules(u.condition),this.checked&&u.tooltip&&(this.tooltip=typeof u.tooltip=="string"?u.tooltip:u.tooltip.value),this.checked&&Pe.isThemeIcon(u.icon)&&(c=u.icon),this.checked&&u.title&&(this.label=typeof u.title=="string"?u.title:u.title.value)}c||(c=Pe.isThemeIcon(e.icon)?e.icon:void 0),this.item=e,this.alt=t?new Wy(t,void 0,i,n,void 0,r,a):void 0,this._options=i,this.class=c&&Pe.asClassName(c)}run(...e){var t,i;let n=[];return!((t=this._options)===null||t===void 0)&&t.arg&&(n=[...n,this._options.arg]),!((i=this._options)===null||i===void 0)&&i.shouldForwardArgs&&(n=[...n,...e]),this._commandService.executeCommand(this.id,...n)}};Io=Wy=kle([k3(5,Be),k3(6,gi)],Io);class qs{constructor(e){this.desc=e}}function qt(s){const e=new Y,t=new s,{f1:i,menu:n,keybinding:o,...r}=t.desc;if(pt.getCommand(r.id))throw new Error(`Cannot register two commands with the same id: ${r.id}`);if(e.add(pt.registerCommand({id:r.id,handler:(a,...l)=>t.run(a,...l),metadata:r.metadata})),Array.isArray(n))for(const a of n)e.add(yn.appendMenuItem(a.id,{command:{...r,precondition:a.precondition===null?void 0:r.precondition},...a}));else n&&e.add(yn.appendMenuItem(n.id,{command:{...r,precondition:n.precondition===null?void 0:r.precondition},...n}));if(i&&(e.add(yn.appendMenuItem(E.CommandPalette,{command:r,when:r.precondition})),e.add(yn.addCommand(r))),Array.isArray(o))for(const a of o)e.add(go.registerKeybindingRule({...a,id:r.id,when:r.precondition?G.and(r.precondition,a.when):a.when}));else o&&e.add(go.registerKeybindingRule({...o,id:r.id,when:r.precondition?G.and(r.precondition,o.when):o.when}));return e}const Gs=ut("telemetryService"),ys=ut("logService");var Zn;(function(s){s[s.Off=0]="Off",s[s.Trace=1]="Trace",s[s.Debug=2]="Debug",s[s.Info=3]="Info",s[s.Warning=4]="Warning",s[s.Error=5]="Error"})(Zn||(Zn={}));const Hz=Zn.Info;class Vz extends H{constructor(){super(...arguments),this.level=Hz,this._onDidChangeLogLevel=this._register(new B),this.onDidChangeLogLevel=this._onDidChangeLogLevel.event}setLevel(e){this.level!==e&&(this.level=e,this._onDidChangeLogLevel.fire(this.level))}getLevel(){return this.level}checkLogLevel(e){return this.level!==Zn.Off&&this.level<=e}}class Ile extends Vz{constructor(e=Hz,t=!0){super(),this.useColors=t,this.setLevel(e)}trace(e,...t){this.checkLogLevel(Zn.Trace)&&(this.useColors?console.log("%cTRACE","color: #888",e,...t):console.log(e,...t))}debug(e,...t){this.checkLogLevel(Zn.Debug)&&(this.useColors?console.log("%cDEBUG","background: #eee; color: #888",e,...t):console.log(e,...t))}info(e,...t){this.checkLogLevel(Zn.Info)&&(this.useColors?console.log("%c INFO","color: #33f",e,...t):console.log(e,...t))}warn(e,...t){this.checkLogLevel(Zn.Warning)&&(this.useColors?console.log("%c WARN","color: #993",e,...t):console.log(e,...t))}error(e,...t){this.checkLogLevel(Zn.Error)&&(this.useColors?console.log("%c ERR","color: #f33",e,...t):console.error(e,...t))}}class Tle extends Vz{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()}}function Nle(s){switch(s){case Zn.Trace:return"trace";case Zn.Debug:return"debug";case Zn.Info:return"info";case Zn.Warning:return"warn";case Zn.Error:return"error";case Zn.Off:return"off"}}new ue("logLevel",Nle(Zn.Info));class hx{constructor(e){this.id=e.id,this.precondition=e.precondition,this._kbOpts=e.kbOpts,this._menuOpts=e.menuOpts,this.metadata=e.metadata}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=G.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};go.registerKeybindingRule(n)}}pt.registerCommand({id:this.id,handler:(e,t)=>this.runCommand(e,t),metadata:this.metadata})}_registerMenuItem(e){yn.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 a0 extends hx{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((o,r)=>r.priority-o.priority),{dispose:()=>{for(let o=0;o{if(a.get(Be).contextMatchesRules(i??void 0))return n(a,r,t)})}runCommand(e,t){return mn.runEditorCommand(e,t,this.precondition,(i,n,o)=>this.runEditorCommand(i,n,o))}}class me extends mn{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=E.EditorContext),n.title||(n.title=e.label),n.when=G.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(me.convertOptions(e)),this.label=e.label,this.alias=e.alias}runEditorCommand(e,t,i){return this.reportTelemetry(e,t),this.run(e,t,i||{})}reportTelemetry(e,t){e.get(Gs).publicLog2("editorActionInvoked",{name:this.label,id:this.id})}}class Uz extends me{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{var r,a;const l=o.get(Be),d=o.get(ys);if(!l.contextMatchesRules((r=this.desc.precondition)!==null&&r!==void 0?r:void 0)){d.debug("[EditorAction2] NOT running command because its precondition is FALSE",this.desc.id,(a=this.desc.precondition)===null||a===void 0?void 0:a.serialize());return}return this.runEditorCommand(o,n,...t)})}}function Ad(s,e){pt.registerCommand(s,function(t,...i){const n=t.get(Ne),[o,r]=i;yt(Ae.isUri(o)),yt(W.isIPosition(r));const a=t.get(_i).getModel(o);if(a){const l=W.lift(r);return n.invokeFunction(e,a,l,...i.slice(2))}return t.get(mo).createModelReference(o).then(l=>new Promise((d,c)=>{try{const u=n.invokeFunction(e,l.object.textEditorModel,W.lift(r),i.slice(2));d(u)}catch(u){c(u)}}).finally(()=>{l.dispose()}))})}function de(s){return Dr.INSTANCE.registerEditorCommand(s),s}function te(s){const e=new s;return Dr.INSTANCE.registerEditorAction(e),e}function $z(s){return Dr.INSTANCE.registerEditorAction(s),s}function Ale(s){Dr.INSTANCE.registerEditorAction(s)}function kt(s,e,t){Dr.INSTANCE.registerEditorContribution(s,e,t)}var Im;(function(s){function e(r){return Dr.INSTANCE.getEditorCommand(r)}s.getEditorCommand=e;function t(){return Dr.INSTANCE.getEditorActions()}s.getEditorActions=t;function i(){return Dr.INSTANCE.getEditorContributions()}s.getEditorContributions=i;function n(r){return Dr.INSTANCE.getEditorContributions().filter(a=>r.indexOf(a.id)>=0)}s.getSomeEditorContributions=n;function o(){return Dr.INSTANCE.getDiffEditorContributions()}s.getDiffEditorContributions=o})(Im||(Im={}));const Mle={EditorCommonContributions:"editor.contributions"};class Dr{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}}Dr.INSTANCE=new Dr;Ji.add(Mle.EditorCommonContributions,Dr.INSTANCE);function g1(s){return s.register(),s}const jz=g1(new a0({id:"undo",precondition:void 0,kbOpts:{weight:0,primary:2104},menuOpts:[{menuId:E.MenubarEditMenu,group:"1_do",title:p({},"&&Undo"),order:1},{menuId:E.CommandPalette,group:"",title:p("undo","Undo"),order:1}]}));g1(new zz(jz,{id:"default:undo",precondition:void 0}));const Kz=g1(new a0({id:"redo",precondition:void 0,kbOpts:{weight:0,primary:2103,secondary:[3128],mac:{primary:3128}},menuOpts:[{menuId:E.MenubarEditMenu,group:"1_do",title:p({},"&&Redo"),order:2},{menuId:E.CommandPalette,group:"",title:p("redo","Redo"),order:1}]}));g1(new zz(Kz,{id:"default:redo",precondition:void 0}));const Rle=g1(new a0({id:"editor.action.selectAll",precondition:void 0,kbOpts:{weight:0,kbExpr:null,primary:2079},menuOpts:[{menuId:E.MenubarSelectionMenu,group:"1_basic",title:p({},"&&Select All"),order:1},{menuId:E.CommandPalette,group:"",title:p("selectAll","Select All"),order:1}]})),Ple="$initialize";let E3=!1;function uA(s){Jh&&(E3||(E3=!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(s.message))}class Fle{constructor(e,t,i,n){this.vsWorker=e,this.req=t,this.method=i,this.args=n,this.type=0}}class I3{constructor(e,t,i,n){this.vsWorker=e,this.seq=t,this.res=i,this.err=n,this.type=1}}class Ole{constructor(e,t,i,n){this.vsWorker=e,this.req=t,this.eventName=i,this.arg=n,this.type=2}}class Ble{constructor(e,t,i){this.vsWorker=e,this.req=t,this.event=i,this.type=3}}class Wle{constructor(e,t){this.vsWorker=e,this.req=t,this.type=4}}class Hle{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}sendMessage(e,t){const i=String(++this._lastSentReq);return new Promise((n,o)=>{this._pendingReplies[i]={resolve:n,reject:o},this._send(new Fle(this._workerId,i,e,t))})}listen(e,t){let i=null;const n=new B({onWillAddFirstListener:()=>{i=String(++this._lastSentReq),this._pendingEmitters.set(i,n),this._send(new Ole(this._workerId,i,e,t))},onDidRemoveLastListener:()=>{this._pendingEmitters.delete(i),this._send(new Wle(this._workerId,i)),i=null}});return n.event}handleMessage(e){!e||!e.vsWorker||this._workerId!==-1&&e.vsWorker!==this._workerId||this._handleMessage(e)}_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;e.err.$isError&&(i=new Error,i.name=e.err.name,i.message=e.err.message,i.stack=e.err.stack),t.reject(i);return}t.resolve(e.res)}_handleRequestMessage(e){const t=e.req;this._handler.handleMessage(e.method,e.args).then(n=>{this._send(new I3(this._workerId,t,n,void 0))},n=>{n.detail instanceof Error&&(n.detail=e3(n.detail)),this._send(new I3(this._workerId,t,void 0,e3(n)))})}_handleSubscribeEventMessage(e){const t=e.req,i=this._handler.handleEvent(e.eventName,e.arg)(n=>{this._send(new Ble(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(c)},c=>{n==null||n(c)})),this._protocol=new Hle({sendMessage:(c,u)=>{this._worker.postMessage(c,u)},handleMessage:(c,u)=>{if(typeof i[c]!="function")return Promise.reject(new Error("Missing method "+c+" on main thread host."));try{return Promise.resolve(i[c].apply(i,u))}catch(h){return Promise.reject(h)}},handleEvent:(c,u)=>{if(Gz(c)){const h=i[c].call(i,u);if(typeof h!="function")throw new Error(`Missing dynamic event ${c} on main thread host.`);return h}if(qz(c)){const h=i[c];if(typeof h!="function")throw new Error(`Missing event ${c} on main thread host.`);return h}throw new Error(`Malformed event name ${c}`)}}),this._protocol.setWorkerId(this._worker.getId());let o=null;const r=globalThis.require;typeof r<"u"&&typeof r.getConfig=="function"?o=r.getConfig():typeof globalThis.requirejs<"u"&&(o=globalThis.requirejs.s.contexts._.config);const a=BP(i);this._onModuleLoaded=this._protocol.sendMessage(Ple,[this._worker.getId(),JSON.parse(JSON.stringify(o)),t,a]);const l=(c,u)=>this._request(c,u),d=(c,u)=>this._protocol.listen(c,u);this._lazyProxy=new Promise((c,u)=>{n=u,this._onModuleLoaded.then(h=>{c(zle(h,l,d))},h=>{u(h),this._onError("Worker failed to load "+t,h)})})}getProxyObject(){return this._lazyProxy}_request(e,t){return new Promise((i,n)=>{this._onModuleLoaded.then(()=>{this._protocol.sendMessage(e,t).then(i,n)},n)})}_onError(e,t){console.error(e),console.info(t)}}function qz(s){return s[0]==="o"&&s[1]==="n"&&Fl(s.charCodeAt(2))}function Gz(s){return/^onDynamic/.test(s)&&Fl(s.charCodeAt(9))}function zle(s,e,t){const i=r=>function(){const a=Array.prototype.slice.call(arguments,0);return e(r,a)},n=r=>function(a){return t(r,a)},o={};for(const r of s){if(Gz(r)){o[r]=n(r);continue}if(qz(r)){o[r]=t(r,void 0);continue}o[r]=i(r)}return o}function tu(s,e){var t;const i=globalThis.MonacoEnvironment;if(i!=null&&i.createTrustedTypesPolicy)try{return i.createTrustedTypesPolicy(s,e)}catch(n){Xe(n);return}try{return(t=Ht.trustedTypes)===null||t===void 0?void 0:t.createPolicy(s,e)}catch(n){Xe(n);return}}const T3=tu("defaultWorkerFactory",{createScriptURL:s=>s});function Ule(s){const e=globalThis.MonacoEnvironment;if(e){if(typeof e.getWorker=="function")return e.getWorker("workerMain.js",s);if(typeof e.getWorkerUrl=="function"){const t=e.getWorkerUrl("workerMain.js",s);return new Worker(T3?T3.createScriptURL(t):t,{name:s})}}throw new Error("You must define a function MonacoEnvironment.getWorkerUrl or MonacoEnvironment.getWorker")}function $le(s){return typeof s.then=="function"}class jle extends H{constructor(e,t,i,n,o){super(),this.id=t,this.label=i;const r=Ule(i);$le(r)?this.worker=r:this.worker=Promise.resolve(r),this.postMessage(e,[]),this.worker.then(a=>{a.onmessage=function(l){n(l.data)},a.onmessageerror=o,typeof a.addEventListener=="function"&&a.addEventListener("error",o)}),this._register(Ie(()=>{var a;(a=this.worker)===null||a===void 0||a.then(l=>{l.onmessage=null,l.onmessageerror=null,l.removeEventListener("error",o),l.terminate()}),this.worker=null}))}getId(){return this.id}postMessage(e,t){var i;(i=this.worker)===null||i===void 0||i.then(n=>{try{n.postMessage(e,t)}catch(o){Xe(o),Xe(new Error(`FAILED to post message to '${this.label}'-worker`,{cause:o}))}})}}class gx{constructor(e){this._label=e,this._webWorkerFailedBeforeError=!1}create(e,t,i){const n=++gx.LAST_WORKER_ID;if(this._webWorkerFailedBeforeError)throw this._webWorkerFailedBeforeError;return new jle(e,n,this._label||"anonymous"+n,t,o=>{uA(o),this._webWorkerFailedBeforeError=o,i(o)})}}gx.LAST_WORKER_ID=0;var Qi;(function(s){s[s.None=0]="None",s[s.Indent=1]="Indent",s[s.IndentOutdent=2]="IndentOutdent",s[s.Outdent=3]="Outdent"})(Qi||(Qi={}));class YE{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;t0&&s.getLanguageId(r-1)===n;)r--;return new qle(s,n,r,o+1,s.getStartOffset(r),s.getEndOffset(o))}class qle{constructor(e,t,i,n,o,r){this._scopedLineTokensBrand=void 0,this._actual=e,this.languageId=t,this._firstTokenIndex=i,this._lastTokenIndex=n,this.firstCharOffset=o,this._lastCharOffset=r}getLineContent(){return this._actual.getLineContent().substring(this.firstCharOffset,this._lastCharOffset)}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)}}function Il(s){return(s&3)!==0}class u_{constructor(e){if(e.autoClosingPairs?this._autoClosingPairs=e.autoClosingPairs.map(t=>new YE(t)):e.brackets?this._autoClosingPairs=e.brackets.map(t=>new YE({open:t[0],close:t[1]})):this._autoClosingPairs=[],e.__electricCharacterSupport&&e.__electricCharacterSupport.docComment){const t=e.__electricCharacterSupport.docComment;this._autoClosingPairs.push(new YE({open:t.open,close:t.close||""}))}this._autoCloseBeforeForQuotes=typeof e.autoCloseBefore=="string"?e.autoCloseBefore:u_.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_QUOTES,this._autoCloseBeforeForBrackets=typeof e.autoCloseBefore=="string"?e.autoCloseBefore:u_.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}}u_.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_QUOTES=`;:.,=}])> `;u_.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_BRACKETS=`'"\`;:.,=}])> `;const N3=typeof Buffer<"u";let QE;class px{static wrap(e){return N3&&!Buffer.isBuffer(e)&&(e=Buffer.from(e.buffer,e.byteOffset,e.byteLength)),new px(e)}constructor(e){this.buffer=e,this.byteLength=this.buffer.byteLength}toString(){return N3?this.buffer.toString():(QE||(QE=new TextDecoder),QE.decode(this.buffer))}}function Gle(s,e){return s[e+0]<<0>>>0|s[e+1]<<8>>>0}function Zle(s,e,t){s[t+0]=e&255,e=e>>>8,s[t+1]=e&255}function Pa(s,e){return s[e]*2**24+s[e+1]*2**16+s[e+2]*2**8+s[e+3]}function Fa(s,e,t){s[t+3]=e,e=e>>>8,s[t+2]=e,e=e>>>8,s[t+1]=e,e=e>>>8,s[t]=e}function A3(s,e){return s[e]}function M3(s,e,t){s[t]=e}let JE;function Zz(){return JE||(JE=new TextDecoder("UTF-16LE")),JE}let eI;function Xle(){return eI||(eI=new TextDecoder("UTF-16BE")),eI}let tI;function Xz(){return tI||(tI=FV()?Zz():Xle()),tI}function Yle(s,e,t){const i=new Uint16Array(s.buffer,e,t);return t>0&&(i[0]===65279||i[0]===65534)?Qle(s,e,t):Zz().decode(i)}function Qle(s,e,t){const i=[];let n=0;for(let o=0;o=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,d]=r,[c,u]=a;return l===c||l===u||d===c||d===u},n=(r,a)=>{const l=Math.min(r,a),d=Math.max(r,a);for(let c=0;c0&&o.push({open:a,close:l})}return o}class ede{constructor(e,t){this._richEditBracketsBrand=void 0;const i=Jle(t);this.brackets=i.map((n,o)=>new KS(e,o,n.open,n.close,tde(n.open,n.close,i,o),ide(n.open,n.close,i,o))),this.forwardRegex=nde(this.brackets),this.reversedRegex=sde(this.brackets),this.textIsBracket={},this.textIsOpenBracket={},this.maxBracketLength=0;for(const n of this.brackets){for(const o of n.open)this.textIsBracket[o]=n,this.textIsOpenBracket[o]=!0,this.maxBracketLength=Math.max(this.maxBracketLength,o.length);for(const o of n.close)this.textIsBracket[o]=n,this.textIsOpenBracket[o]=!1,this.maxBracketLength=Math.max(this.maxBracketLength,o.length)}}}function Yz(s,e,t,i){for(let n=0,o=e.length;n=0&&i.push(a);for(const a of r.close)a.indexOf(s)>=0&&i.push(a)}}function Qz(s,e){return s.length-e.length}function mx(s){if(s.length<=1)return s;const e=[],t=new Set;for(const i of s)t.has(i)||(e.push(i),t.add(i));return e}function tde(s,e,t,i){let n=[];n=n.concat(s),n=n.concat(e);for(let o=0,r=n.length;o=0;r--)n[o++]=i.charCodeAt(r);return Xz().decode(n)}let e=null,t=null;return function(n){return e!==n&&(e=n,t=s(e)),t}}();class Qr{static _findPrevBracketInText(e,t,i,n){const o=i.match(e);if(!o)return null;const r=i.length-(o.index||0),a=o[0].length,l=n+r;return new x(t,l-a+1,t,l+1)}static findPrevBracketInRange(e,t,i,n,o){const a=mF(i).substring(i.length-o,i.length-n);return this._findPrevBracketInText(e,t,a,n)}static findNextBracketInText(e,t,i,n){const o=i.match(e);if(!o)return null;const r=o.index||0,a=o[0].length;if(a===0)return null;const l=n+r;return new x(t,l+1,t,l+1+a)}static findNextBracketInRange(e,t,i,n,o){const r=i.substring(n,o);return this.findNextBracketInText(e,t,r,n)}}class rde{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 Wc(e)}onElectricCharacter(e,t,i){if(!this._richEditBrackets||this._richEditBrackets.brackets.length===0)return null;const n=t.findTokenIndexAtOffset(i-1);if(Il(t.getStandardTokenType(n)))return null;const o=this._richEditBrackets.reversedRegex,r=t.getLineContent().substring(0,i-1)+e,a=Qr.findPrevBracketInRange(o,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 c=t.getActualLineContentBefore(a.startColumn-1);return/^\s*$/.test(c)?{matchOpenBracket:l}:null}}function pw(s){return s.global&&(s.lastIndex=0),!0}class ade{constructor(e){this._indentationRules=e}shouldIncrease(e){return!!(this._indentationRules&&this._indentationRules.increaseIndentPattern&&pw(this._indentationRules.increaseIndentPattern)&&this._indentationRules.increaseIndentPattern.test(e))}shouldDecrease(e){return!!(this._indentationRules&&this._indentationRules.decreaseIndentPattern&&pw(this._indentationRules.decreaseIndentPattern)&&this._indentationRules.decreaseIndentPattern.test(e))}shouldIndentNextLine(e){return!!(this._indentationRules&&this._indentationRules.indentNextLinePattern&&pw(this._indentationRules.indentNextLinePattern)&&this._indentationRules.indentNextLinePattern.test(e))}shouldIgnore(e){return!!(this._indentationRules&&this._indentationRules.unIndentedLinePattern&&pw(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 im{constructor(e){e=e||{},e.brackets=e.brackets||[["(",")"],["{","}"],["[","]"]],this._brackets=[],e.brackets.forEach(t=>{const i=im._createOpenBracketRegExp(t[0]),n=im._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 o=0,r=this._regExpRules.length;od.reg?(d.reg.lastIndex=0,d.reg.test(d.text)):!0))return a.action}if(e>=2&&i.length>0&&n.length>0)for(let o=0,r=this._brackets.length;o=2&&i.length>0){for(let o=0,r=this._brackets.length;o"u"?t:o}function dde(s){return s.replace(/[\[\]]/g,"")}const vi=ut("languageService");class Ol{constructor(e,t=[],i=!1){this.ctor=e,this.staticArguments=t,this.supportsDelayedInstantiation=i}}const tU=[];function mt(s,e,t){e instanceof Ol||(e=new Ol(e,[],!!t)),tU.push([s,e])}function P3(){return tU}const Ti=Object.freeze({text:"text/plain",binary:"application/octet-stream",unknown:"application/unknown",markdown:"text/markdown",latex:"text/latex",uriList:"text/uri-list"}),vx={JSONContribution:"base.contributions.json"};function cde(s){return s.length>0&&s.charAt(s.length-1)==="#"?s.substring(0,s.length-1):s}class ude{constructor(){this._onDidChangeSchema=new B,this.schemasById={}}registerSchema(e,t){this.schemasById[cde(e)]=t,this._onDidChangeSchema.fire(e)}notifySchemaChanged(e){this._onDidChangeSchema.fire(e)}}const hde=new ude;Ji.add(vx.JSONContribution,hde);const pl={Configuration:"base.contributions.configuration"},mw="vscode://schemas/settings/resourceLanguage",F3=Ji.as(vx.JSONContribution);class gde{constructor(){this.overrideIdentifiers=new Set,this._onDidSchemaChange=new B,this._onDidUpdateConfiguration=new B,this.configurationDefaultsOverrides=new Map,this.defaultLanguageConfigurationOverridesNode={id:"defaultOverrides",title:p("defaultLanguageConfigurationOverrides.title","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={},F3.registerSchema(mw,this.resourceLanguageSettingsSchema),this.registerOverridePropertyPatternKey()}registerConfiguration(e,t=!0){this.registerConfigurations([e],t)}registerConfigurations(e,t=!0){const i=new Set;this.doRegisterConfigurations(e,t,i),F3.registerSchema(mw,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){var i;const n=[];for(const{overrides:o,source:r}of e)for(const a in o)if(t.add(a),Th.test(a)){const l=this.configurationDefaultsOverrides.get(a),d=(i=l==null?void 0:l.valuesSources)!==null&&i!==void 0?i:new Map;if(r)for(const g of Object.keys(o[a]))d.set(g,r);const c={...(l==null?void 0:l.value)||{},...o[a]};this.configurationDefaultsOverrides.set(a,{source:r,value:c,valuesSources:d});const u=dde(a),h={type:"object",default:c,description:p("defaultLanguageConfiguration.description","Configure settings to be overridden for the {0} language.",u),$ref:mw,defaultDefaultValue:c,source:lo(r)?void 0:r,defaultValueSource:r};n.push(...qS(a)),this.configurationProperties[a]=h,this.defaultLanguageConfigurationOverridesNode.properties[a]=h}else{this.configurationDefaultsOverrides.set(a,{value:o[a],source:r});const l=this.configurationProperties[a];l&&(this.updatePropertyDefaultValue(a,l),this.updateSchema(a,l))}this.doRegisterOverrideIdentifiers(n)}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,o=3,r){var a;o=Go(e.scope)?o:e.scope;const l=e.properties;if(l)for(const c in l){const u=l[c];if(t&&mde(c,u)){delete l[c];continue}if(u.source=i,u.defaultDefaultValue=l[c].default,this.updatePropertyDefaultValue(c,u),Th.test(c)?u.scope=void 0:(u.scope=Go(u.scope)?o:u.scope,u.restricted=Go(u.restricted)?!!(n!=null&&n.includes(c)):u.restricted),l[c].hasOwnProperty("included")&&!l[c].included){this.excludedConfigurationProperties[c]=l[c],delete l[c];continue}else this.configurationProperties[c]=l[c],!((a=l[c].policy)===null||a===void 0)&&a.name&&this.policyConfigurations.set(l[c].policy.name,c);!l[c].deprecationMessage&&l[c].markdownDeprecationMessage&&(l[c].deprecationMessage=l[c].markdownDeprecationMessage),r.add(c)}const d=e.allOf;if(d)for(const c of d)this.validateAndRegisterProperties(c,t,i,n,o,r)}getConfigurationProperties(){return this.configurationProperties}getPolicyConfigurations(){return this.policyConfigurations}registerJSONConfiguration(e){const t=i=>{const n=i.properties;if(n)for(const r in n)this.updateSchema(r,n[r]);const o=i.allOf;o==null||o.forEach(t)};t(e)}updateSchema(e,t){switch(t.scope){case 1:break;case 2:break;case 6:break;case 3:break;case 4:break;case 5:this.resourceLanguageSettingsSchema.properties[e]=t;break}}updateOverridePropertyPatternKey(){for(const e of this.overrideIdentifiers.values()){const t=`[${e}]`,i={type:"object",description:p("overrideSettings.defaultDescription","Configure editor settings to be overridden for a language."),errorMessage:p("overrideSettings.errorMessage","This setting does not support per-language configuration."),$ref:mw};this.updatePropertyDefaultValue(t,i)}}registerOverridePropertyPatternKey(){p("overrideSettings.defaultDescription","Configure editor settings to be overridden for a language."),p("overrideSettings.errorMessage","This setting does not support per-language configuration."),this._onDidSchemaChange.fire()}updatePropertyDefaultValue(e,t){const i=this.configurationDefaultsOverrides.get(e);let n=i==null?void 0:i.value,o=i==null?void 0:i.source;oo(n)&&(n=t.defaultDefaultValue,o=void 0),oo(n)&&(n=pde(t.type)),t.default=n,t.defaultValueSource=o}}const iU="\\[([^\\]]+)\\]",O3=new RegExp(iU,"g"),fde=`^(${iU})+$`,Th=new RegExp(fde);function qS(s){const e=[];if(Th.test(s)){let t=O3.exec(s);for(;t!=null&&t.length;){const i=t[1].trim();i&&e.push(i),t=O3.exec(s)}}return Wc(e)}function pde(s){switch(Array.isArray(s)?s[0]:s){case"boolean":return!1;case"integer":case"number":return 0;case"string":return"";case"array":return[];case"object":return{};default:return null}}const Hy=new gde;Ji.add(pl.Configuration,Hy);function mde(s,e){var t,i,n,o;return s.trim()?Th.test(s)?p("config.property.languageDefault","Cannot register '{0}'. This matches property pattern '\\\\[.*\\\\]$' for describing language specific editor settings. Use 'configurationDefaults' contribution.",s):Hy.getConfigurationProperties()[s]!==void 0?p("config.property.duplicate","Cannot register '{0}'. This property is already registered.",s):!((t=e.policy)===null||t===void 0)&&t.name&&Hy.getPolicyConfigurations().get((i=e.policy)===null||i===void 0?void 0:i.name)!==void 0?p("config.policy.duplicate","Cannot register '{0}'. The associated policy {1} is already registered with {2}.",s,(n=e.policy)===null||n===void 0?void 0:n.name,Hy.getPolicyConfigurations().get((o=e.policy)===null||o===void 0?void 0:o.name)):null:p("config.property.empty","Cannot register an empty property")}const _de={ModesRegistry:"editor.modesRegistry"};class vde{constructor(){this._onDidChangeLanguages=new B,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 wde(this,a,l),closing:l}}),o=new r3(a=>{const l=new Set,d=new Set;return{info:new yde(this,a,l,d),opening:l,openingColorized:d}});for(const[a,l]of i){const d=n.get(a),c=o.get(l);d.closing.add(c.info),c.opening.add(d.info)}const r=t.colorizedBracketPairs?B3(t.colorizedBracketPairs):i.filter(a=>!(a[0]==="<"&&a[1]===">"));for(const[a,l]of r){const d=n.get(a),c=o.get(l);d.closing.add(c.info),c.openingColorized.add(d.info),c.opening.add(d.info)}this._openingBrackets=new Map([...n.cachedValues].map(([a,l])=>[a,l.info])),this._closingBrackets=new Map([...o.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)}}function B3(s){return s.filter(([e,t])=>e!==""&&t!=="")}class nU{constructor(e,t){this.config=e,this.bracketText=t}get languageId(){return this.config.languageId}}class wde extends nU{constructor(e,t,i){super(e,t),this.openedBrackets=i,this.isOpeningBracket=!0}}class yde extends nU{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 Sde=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},W3=function(s,e){return function(t,i){e(t,i,s)}};class iI{constructor(e){this.languageId=e}affects(e){return this.languageId?this.languageId===e:!0}}const Yt=ut("languageConfigurationService");let gA=class extends H{constructor(e,t){super(),this.configurationService=e,this.languageService=t,this._registry=this._register(new kde),this.onDidChangeEmitter=this._register(new B),this.onDidChange=this.onDidChangeEmitter.event,this.configurations=new Map;const i=new Set(Object.values(fA));this._register(this.configurationService.onDidChangeConfiguration(n=>{const o=n.change.keys.some(a=>i.has(a)),r=n.change.overrides.filter(([a,l])=>l.some(d=>i.has(d))).map(([a])=>a);if(o)this.configurations.clear(),this.onDidChangeEmitter.fire(new iI(void 0));else for(const a of r)this.languageService.isRegisteredLanguageId(a)&&(this.configurations.delete(a),this.onDidChangeEmitter.fire(new iI(a)))})),this._register(this._registry.onDidChange(n=>{this.configurations.delete(n.languageId),this.onDidChangeEmitter.fire(new iI(n.languageId))}))}register(e,t,i){return this._registry.register(e,t,i)}getLanguageConfiguration(e){let t=this.configurations.get(e);return t||(t=Dde(e,this._registry,this.configurationService,this.languageService),this.configurations.set(e,t)),t}};gA=Sde([W3(0,rt),W3(1,vi)],gA);function Dde(s,e,t,i){let n=e.getLanguageConfiguration(s);if(!n){if(!i.isRegisteredLanguageId(s))return new Nm(s,{});n=new Nm(s,{})}const o=Lde(n.languageId,t),r=oU([n.underlyingConfig,o]);return new Nm(n.languageId,r)}const fA={brackets:"editor.language.brackets",colorizedBracketPairs:"editor.language.colorizedBracketPairs"};function Lde(s,e){const t=e.getValue(fA.brackets,{overrideIdentifier:s}),i=e.getValue(fA.colorizedBracketPairs,{overrideIdentifier:s});return{brackets:H3(t),colorizedBracketPairs:H3(i)}}function H3(s){if(Array.isArray(s))return s.map(e=>{if(!(!Array.isArray(e)||e.length!==2))return[e[0],e[1]]}).filter(e=>!!e)}function sU(s,e,t){const i=s.getLineContent(e);let n=Zt(i);return n.length>t-1&&(n=n.substring(0,t-1)),n}function Tm(s,e,t){s.tokenization.forceTokenization(e);const i=s.tokenization.getLineTokens(e),n=typeof t>"u"?s.getLineMaxColumn(e)-1:t-1;return fx(i,n)}class xde{constructor(e){this.languageId=e,this._resolved=null,this._entries=[],this._order=0,this._resolved=null}register(e,t){const i=new V3(e,t,++this._order);return this._entries.push(i),this._resolved=null,Ie(()=>{for(let n=0;ne.configuration)))}}function oU(s){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 s)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 V3{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 z3{constructor(e){this.languageId=e}}class kde extends H{constructor(){super(),this._entries=new Map,this._onDidChange=this._register(new B),this.onDidChange=this._onDidChange.event,this._register(this.register(ir,{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 xde(e),this._entries.set(e,n));const o=n.register(t,i);return this._onDidChange.fire(new z3(e)),Ie(()=>{o.dispose(),this._onDidChange.fire(new z3(e))})}getLanguageConfiguration(e){const t=this._entries.get(e);return(t==null?void 0:t.getResolvedConfiguration())||null}}class Nm{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 im(this.underlyingConfig):null,this.comments=Nm._handleComments(this.underlyingConfig),this.characterPair=new u_(this.underlyingConfig),this.wordDefinition=this.underlyingConfig.wordPattern||VP,this.indentationRules=this.underlyingConfig.indentationRules,this.underlyingConfig.indentationRules?this.indentRulesSupport=new ade(this.underlyingConfig.indentationRules):this.indentRulesSupport=null,this.foldingRules=this.underlyingConfig.folding||{},this.bracketsNew=new Cde(e,this.underlyingConfig)}getWordDefinition(){return zP(this.wordDefinition)}get brackets(){return!this._brackets&&this.underlyingConfig.brackets&&(this._brackets=new ede(this.languageId,this.underlyingConfig.brackets)),this._brackets}get electricCharacter(){return this._electricCharacter||(this._electricCharacter=new rde(this.brackets)),this._electricCharacter}onEnter(e,t,i,n){return this._onEnterSupport?this._onEnterSupport.onEnter(e,t,i,n):null}getAutoClosingPairs(){return new Kle(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&&(i.lineCommentToken=t.lineComment),t.blockComment){const[n,o]=t.blockComment;i.blockCommentStartToken=n,i.blockCommentEndToken=o}return i}}mt(Yt,gA,1);class Cu{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 U3{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 Cu(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 zl{constructor(e,t,i=null){this.ContinueProcessingPredicate=i,this._originalSequence=e,this._modifiedSequence=t;const[n,o,r]=zl._getElements(e),[a,l,d]=zl._getElements(t);this._hasStrings=r&&d,this._originalStringElements=n,this._originalElementsOrHash=o,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(zl._isStringArray(t)){const i=new Int32Array(t.length);for(let n=0,o=t.length;n=e&&n>=i&&this.ElementsAreEqual(t,n);)t--,n--;if(e>t||i>n){let u;return i<=n?(Lp.Assert(e===t+1,"originalStart should only be one more than originalEnd"),u=[new Cu(e,0,i,n-i+1)]):e<=t?(Lp.Assert(i===n+1,"modifiedStart should only be one more than modifiedEnd"),u=[new Cu(e,t-e+1,i,0)]):(Lp.Assert(e===t+1,"originalStart should only be one more than originalEnd"),Lp.Assert(i===n+1,"modifiedStart should only be one more than modifiedEnd"),u=[]),u}const r=[0],a=[0],l=this.ComputeRecursionPoint(e,t,i,n,r,a,o),d=r[0],c=a[0];if(l!==null)return l;if(!o[0]){const u=this.ComputeDiffRecursive(e,d,i,c,o);let h=[];return o[0]?h=[new Cu(d+1,t-(d+1)+1,c+1,n-(c+1)+1)]:h=this.ComputeDiffRecursive(d+1,t,c+1,n,o),this.ConcatenateChanges(u,h)}return[new Cu(e,t-e+1,i,n-i+1)]}WALKTRACE(e,t,i,n,o,r,a,l,d,c,u,h,g,f,m,_,v,b){let C=null,w=null,y=new $3,D=t,L=i,k=g[0]-_[0]-n,I=-1073741824,O=this.m_forwardHistory.length-1;do{const R=k+e;R===D||R=0&&(d=this.m_forwardHistory[O],e=d[0],D=1,L=d.length-1)}while(--O>=-1);if(C=y.getReverseChanges(),b[0]){let R=g[0]+1,P=_[0]+1;if(C!==null&&C.length>0){const F=C[C.length-1];R=Math.max(R,F.getOriginalEnd()),P=Math.max(P,F.getModifiedEnd())}w=[new Cu(R,h-R+1,P,m-P+1)]}else{y=new $3,D=r,L=a,k=g[0]-_[0]-l,I=1073741824,O=v?this.m_reverseHistory.length-1:this.m_reverseHistory.length-2;do{const R=k+o;R===D||R=c[R+1]?(u=c[R+1]-1,f=u-k-l,u>I&&y.MarkNextChange(),I=u+1,y.AddOriginalElement(u+1,f+1),k=R+1-o):(u=c[R-1],f=u-k-l,u>I&&y.MarkNextChange(),I=u,y.AddModifiedElement(u+1,f+1),k=R-1-o),O>=0&&(c=this.m_reverseHistory[O],o=c[0],D=1,L=c.length-1)}while(--O>=-1);w=y.getChanges()}return this.ConcatenateChanges(C,w)}ComputeRecursionPoint(e,t,i,n,o,r,a){let l=0,d=0,c=0,u=0,h=0,g=0;e--,i--,o[0]=0,r[0]=0,this.m_forwardHistory=[],this.m_reverseHistory=[];const f=t-e+(n-i),m=f+1,_=new Int32Array(m),v=new Int32Array(m),b=n-i,C=t-e,w=e-i,y=t-n,L=(C-b)%2===0;_[b]=e,v[C]=t,a[0]=!1;for(let k=1;k<=f/2+1;k++){let I=0,O=0;c=this.ClipDiagonalBound(b-k,k,b,m),u=this.ClipDiagonalBound(b+k,k,b,m);for(let P=c;P<=u;P+=2){P===c||PI+O&&(I=l,O=d),!L&&Math.abs(P-C)<=k-1&&l>=v[P])return o[0]=l,r[0]=d,F<=v[P]&&k<=1448?this.WALKTRACE(b,c,u,w,C,h,g,y,_,v,l,t,o,d,n,r,L,a):null}const R=(I-e+(O-i)-k)/2;if(this.ContinueProcessingPredicate!==null&&!this.ContinueProcessingPredicate(I,R))return a[0]=!0,o[0]=I,r[0]=O,R>0&&k<=1448?this.WALKTRACE(b,c,u,w,C,h,g,y,_,v,l,t,o,d,n,r,L,a):(e++,i++,[new Cu(e,t-e+1,i,n-i+1)]);h=this.ClipDiagonalBound(C-k,k,C,m),g=this.ClipDiagonalBound(C+k,k,C,m);for(let P=h;P<=g;P+=2){P===h||P=v[P+1]?l=v[P+1]-1:l=v[P-1],d=l-(P-C)-y;const F=l;for(;l>e&&d>i&&this.ElementsAreEqual(l,d);)l--,d--;if(v[P]=l,L&&Math.abs(P-b)<=k&&l<=_[P])return o[0]=l,r[0]=d,F>=_[P]&&k<=1448?this.WALKTRACE(b,c,u,w,C,h,g,y,_,v,l,t,o,d,n,r,L,a):null}if(k<=1447){let P=new Int32Array(u-c+2);P[0]=b-c+1,xp.Copy2(_,c,P,1,u-c+1),this.m_forwardHistory.push(P),P=new Int32Array(g-h+2),P[0]=C-h+1,xp.Copy2(v,h,P,1,g-h+1),this.m_reverseHistory.push(P)}}return this.WALKTRACE(b,c,u,w,C,h,g,y,_,v,l,t,o,d,n,r,L,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,o=0;if(t>0){const u=e[t-1];n=u.originalStart+u.originalLength,o=u.modifiedStart+u.modifiedLength}const r=i.originalLength>0,a=i.modifiedLength>0;let l=0,d=this._boundaryScore(i.originalStart,i.originalLength,i.modifiedStart,i.modifiedLength);for(let u=1;;u++){const h=i.originalStart-u,g=i.modifiedStart-u;if(hd&&(d=m,l=u)}i.originalStart-=l,i.modifiedStart-=l;const c=[null];if(t>0&&this.ChangesOverlap(e[t-1],e[t],c)){e[t-1]=c[0],e.splice(t,1),t++;continue}}if(this._hasStrings)for(let t=1,i=e.length;t0&&g>l&&(l=g,d=u,c=h)}return l>0?[d,c]:null}_contiguousSequenceScore(e,t,i){let n=0;for(let o=0;o=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 o=this._OriginalRegionIsBoundary(e,t)?1:0,r=this._ModifiedRegionIsBoundary(i,n)?1:0;return o+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 xp.Copy(e,0,n,0,e.length-1),n[e.length-1]=i[0],xp.Copy(t,1,n,e.length,t.length-1),n}else{const n=new Array(e.length+t.length);return xp.Copy(e,0,n,0,e.length),xp.Copy(t,0,n,e.length,t.length),n}}ChangesOverlap(e,t,i){if(Lp.Assert(e.originalStart<=t.originalStart,"Left change is not less than or equal to right change"),Lp.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 o=e.originalLength;const r=e.modifiedStart;let a=e.modifiedLength;return e.originalStart+e.originalLength>=t.originalStart&&(o=t.originalStart+t.originalLength-e.originalStart),e.modifiedStart+e.modifiedLength>=t.modifiedStart&&(a=t.modifiedStart+t.modifiedLength-e.modifiedStart),i[0]=new Cu(n,o,r,a),!0}else return i[0]=null,!1}ClipDiagonalBound(e,t,i,n){if(e>=0&&e255?255:s|0}function kp(s){return s<0?0:s>4294967295?4294967295:s|0}class Ide{constructor(e){this.values=e,this.prefixSum=new Uint32Array(e.length),this.prefixSumValidIndex=new Int32Array(1),this.prefixSumValidIndex[0]=-1}insertValues(e,t){e=kp(e);const i=this.values,n=this.prefixSum,o=t.length;return o===0?!1:(this.values=new Uint32Array(i.length+o),this.values.set(i.subarray(0,e),0),this.values.set(i.subarray(e),e+o),this.values.set(t,e),e-1=0&&this.prefixSum.set(n.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}setValue(e,t){return e=kp(e),t=kp(t),this.values[e]===t?!1:(this.values[e]=t,e-1=i.length)return!1;const o=i.length-e;return t>=o&&(t=o),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=kp(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,o=0,r=0;for(;t<=i;)if(n=t+(i-t)/2|0,o=this.prefixSum[n],r=o-this.values[n],e=o)t=n+1;else break;return new rU(n,e-r)}}class Tde{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 rU(t,e-i)}removeValues(e,t){this._values.splice(e,t),this._invalidate(e)}insertValues(e,t){this._values=zL(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 o=0;o=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 ZS{constructor(){this._actual=new d0(0)}add(e){this._actual.set(e,1)}has(e){return this._actual.get(e)===1}clear(){return this._actual.clear()}}class Ade{constructor(e,t,i){const n=new Uint8Array(e*t);for(let o=0,r=e*t;ot&&(t=l),a>i&&(i=a),d>i&&(i=d)}t++,i++;const n=new Ade(i,t,0);for(let o=0,r=e.length;o=this._maxCharCode?0:this._states.get(e,t)}}let nI=null;function Rde(){return nI===null&&(nI=new Mde([[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]])),nI}let O0=null;function Pde(){if(O0===null){O0=new d0(0);const s=` <>'"、。。、,.:;‘〈「『〔([{「」}])〕』」〉’`~…`;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=Rde()){const i=Pde(),n=[];for(let o=1,r=e.getLineCount();o<=r;o++){const a=e.getLineContent(o),l=a.length;let d=0,c=0,u=0,h=1,g=!1,f=!1,m=!1,_=!1;for(;d=0?(n+=i?1:-1,n<0?n=e.length-1:n%=e.length,e[n]):null}}pA.INSTANCE=new pA;var j3,K3;class Ode{constructor(e,t){this.uri=e,this.value=t}}function Bde(s){return Array.isArray(s)}class Wi{constructor(e,t){if(this[j3]="ResourceMap",e instanceof Wi)this.map=new Map(e.map),this.toKey=t??Wi.defaultToKey;else if(Bde(e)){this.map=new Map,this.toKey=t??Wi.defaultToKey;for(const[i,n]of e)this.set(i,n)}else this.map=new Map,this.toKey=e??Wi.defaultToKey}set(e,t){return this.map.set(this.toKey(e),new Ode(e,t)),this}get(e){var t;return(t=this.map.get(this.toKey(e)))===null||t===void 0?void 0:t.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]}*[(j3=Symbol.toStringTag,Symbol.iterator)](){for(const[,e]of this.map)yield[e.uri,e.value]}}Wi.defaultToKey=s=>s.toString();class Wde{constructor(){this[K3]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){var e;return(e=this._head)===null||e===void 0?void 0:e.value}get last(){var e;return(e=this._tail)===null||e===void 0?void 0:e.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 o={value:i.key,done:!1};return i=i.next,o}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 o={value:i.value,done:!1};return i=i.next,o}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 o={value:[i.key,i.value],done:!1};return i=i.next,o}else return{value:void 0,done:!0}}};return n}[(K3=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 Hde extends Wde{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 iu extends Hde{constructor(e,t=1){super(e,t)}trim(e){this.trimOld(e)}set(e,t){return super.set(e,t),this.checkTrim(),this}}class Vde{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 _F{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)}get(e){const t=this.map.get(e);return t||new Set}}class zde extends d0{constructor(e,t){super(0),this._segmenter=null,this._cachedLine=null,this._cachedSegments=[],this.intlSegmenterLocales=t,this.intlSegmenterLocales.length>0?this._segmenter=new Intl.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;let t=null;try{t=oz(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 $de(t,this.wordSeparators?Or(this.wordSeparators,[]):null,i?this.searchString:null)}}function qde(s){if(!s||s.length===0)return!1;for(let e=0,t=s.length;e=t)break;const n=s.charCodeAt(e);if(n===110||n===114||n===87)return!0}}return!1}function Pg(s,e,t){if(!t)return new Wb(s,null);const i=[];for(let n=0,o=e.length;n>0);t[o]>=e?n=o-1:t[o+1]>=e?(i=o,n=o):i=o+1}return i+1}}class _w{static findMatches(e,t,i,n,o){const r=t.parseSearchRequest();return r?r.regex.multiline?this._doFindMatchesMultiline(e,i,new nm(r.wordSeparators,r.regex),n,o):this._doFindMatchesLineByLine(e,i,r,n,o):[]}static _getMultilineMatchRange(e,t,i,n,o,r){let a,l=0;n?(l=n.findLineFeedCountBeforeOffset(o),a=t+o+l):a=t+o;let d;if(n){const g=n.findLineFeedCountBeforeOffset(o+r.length)-l;d=a+r.length+g}else d=a+r.length;const c=e.getPositionAt(a),u=e.getPositionAt(d);return new x(c.lineNumber,c.column,u.lineNumber,u.column)}static _doFindMatchesMultiline(e,t,i,n,o){const r=e.getOffsetAt(t.getStartPosition()),a=e.getValueInRange(t,1),l=e.getEOL()===`\r `?new G3(a):null,d=[];let c=0,u;for(i.reset(0);u=i.next(a);)if(d[c++]=Pg(this._getMultilineMatchRange(e,r,a,l,u.index,u[0]),u,n),c>=o)return d;return d}static _doFindMatchesLineByLine(e,t,i,n,o){const r=[];let a=0;if(t.startLineNumber===t.endLineNumber){const d=e.getLineContent(t.startLineNumber).substring(t.startColumn-1,t.endColumn-1);return a=this._findMatchesInLine(i,d,t.startLineNumber,t.startColumn-1,a,r,n,o),r}const l=e.getLineContent(t.startLineNumber).substring(t.startColumn-1);a=this._findMatchesInLine(i,l,t.startLineNumber,t.startColumn-1,a,r,n,o);for(let d=t.startLineNumber+1;d=l))return o;return o}const c=new nm(e.wordSeparators,e.regex);let u;c.reset(0);do if(u=c.next(t),u&&(r[o++]=Pg(new x(i,u.index+1+n,i,u.index+1+u[0].length+n),u,a),o>=l))return o;while(u);return o}static findNextMatch(e,t,i,n){const o=t.parseSearchRequest();if(!o)return null;const r=new nm(o.wordSeparators,o.regex);return o.regex.multiline?this._doFindNextMatchMultiline(e,i,r,n):this._doFindNextMatchLineByLine(e,i,r,n)}static _doFindNextMatchMultiline(e,t,i,n){const o=new W(t.lineNumber,1),r=e.getOffsetAt(o),a=e.getLineCount(),l=e.getValueInRange(new x(o.lineNumber,o.column,a,e.getLineMaxColumn(a)),1),d=e.getEOL()===`\r `?new G3(l):null;i.reset(t.column-1);const c=i.next(l);return c?Pg(this._getMultilineMatchRange(e,r,l,d,c.index,c[0]),c,n):t.lineNumber!==1||t.column!==1?this._doFindNextMatchMultiline(e,new W(1,1),i,n):null}static _doFindNextMatchLineByLine(e,t,i,n){const o=e.getLineCount(),r=t.lineNumber,a=e.getLineContent(r),l=this._findFirstMatchInLine(i,a,r,t.column,n);if(l)return l;for(let d=1;d<=o;d++){const c=(r+d-1)%o,u=e.getLineContent(c+1),h=this._findFirstMatchInLine(i,u,c+1,1,n);if(h)return h}return null}static _findFirstMatchInLine(e,t,i,n,o){e.reset(n-1);const r=e.next(t);return r?Pg(new x(i,r.index+1,i,r.index+1+r[0].length),r,o):null}static findPreviousMatch(e,t,i,n){const o=t.parseSearchRequest();if(!o)return null;const r=new nm(o.wordSeparators,o.regex);return o.regex.multiline?this._doFindPreviousMatchMultiline(e,i,r,n):this._doFindPreviousMatchLineByLine(e,i,r,n)}static _doFindPreviousMatchMultiline(e,t,i,n){const o=this._doFindMatchesMultiline(e,new x(1,1,t.lineNumber,t.column),i,n,10*Kde);if(o.length>0)return o[o.length-1];const r=e.getLineCount();return t.lineNumber!==r||t.column!==e.getLineMaxColumn(r)?this._doFindPreviousMatchMultiline(e,new W(r,e.getLineMaxColumn(r)),i,n):null}static _doFindPreviousMatchLineByLine(e,t,i,n){const o=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 d=1;d<=o;d++){const c=(o+r-d-1)%o,u=e.getLineContent(c+1),h=this._findLastMatchInLine(i,u,c+1,n);if(h)return h}return null}static _findLastMatchInLine(e,t,i,n){let o=null,r;for(e.reset(0);r=e.next(t);)o=Pg(new x(i,r.index+1,i,r.index+1+r[0].length),r,n);return o}}function Gde(s,e,t,i,n){if(i===0)return!0;const o=e.charCodeAt(i-1);if(s.get(o)!==0||o===13||o===10)return!0;if(n>0){const r=e.charCodeAt(i);if(s.get(r)!==0)return!0}return!1}function Zde(s,e,t,i,n){if(i+n===t)return!0;const o=e.charCodeAt(i+n);if(s.get(o)!==0||o===13||o===10)return!0;if(n>0){const r=e.charCodeAt(i+n-1);if(s.get(r)!==0)return!0}return!1}function vF(s,e,t,i,n){return Gde(s,e,t,i,n)&&Zde(s,e,t,i,n)}class nm{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,o=i[0].length;if(n===this._prevMatchStartIndex&&o===this._prevMatchLength){if(o===0){WS(e,t,this._searchRegex.lastIndex)>65535?this._searchRegex.lastIndex+=2:this._searchRegex.lastIndex+=1;continue}return null}if(this._prevMatchStartIndex=n,this._prevMatchLength=o,!this._wordSeparators||vF(this._wordSeparators,e,t,n,o))return i}while(i);return null}}class bF{static computeUnicodeHighlights(e,t,i){const n=i?i.startLineNumber:1,o=i?i.endLineNumber:e.getLineCount(),r=new Z3(t),a=r.getCandidateCodePoints();let l;a==="allNonBasicAscii"?l=new RegExp("[^\\t\\n\\r\\x20-\\x7E]","g"):l=new RegExp(`${Xde(Array.from(a))}`,"g");const d=new nm(null,l),c=[];let u=!1,h,g=0,f=0,m=0;e:for(let _=n,v=o;_<=v;_++){const b=e.getLineContent(_),C=b.length;d.reset(0);do if(h=d.next(b),h){let w=h.index,y=h.index+h[0].length;if(w>0){const I=b.charCodeAt(w-1);Cn(I)&&w--}if(y+1=1e3){u=!0;break e}c.push(new x(_,w+1,_,y+1))}}while(h)}return{ranges:c,hasMore:u,ambiguousCharacterCount:g,invisibleCharacterCount:f,nonBasicAsciiCharacterCount:m}}static computeUnicodeHighlightReason(e,t){const i=new Z3(t);switch(i.shouldHighlightNonBasicASCII(e,null)){case 0:return null;case 2:return{kind:1};case 3:{const o=e.codePointAt(0),r=i.ambiguousCharacters.getPrimaryConfusable(o),a=wf.getLocales().filter(l=>!wf.getInstance(new Set([...t.allowedLocales,l])).isAmbiguous(o));return{kind:0,confusableWith:String.fromCodePoint(r),notAmbiguousInLocales:a}}case 1:return{kind:2}}}}function Xde(s,e){return`[${rr(s.map(i=>String.fromCodePoint(i)).join(""))}]`}class Z3{constructor(e){this.options=e,this.allowedCodePoints=new Set(e.allowedCodePoints),this.ambiguousCharacters=wf.getInstance(new Set(e.allowedLocales))}getCandidateCodePoints(){if(this.options.nonBasicASCII)return"allNonBasicAscii";const e=new Set;if(this.options.invisibleCharacters)for(const t of ld.codePoints)X3(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,o=!1;if(t)for(const r of t){const a=r.codePointAt(0),l=c1(r);n=n||l,!l&&!this.ambiguousCharacters.isAmbiguous(a)&&!ld.isInvisibleCharacter(a)&&(o=!0)}return!n&&o?0:this.options.invisibleCharacters&&!X3(e)&&ld.isInvisibleCharacter(i)?2:this.options.ambiguousCharacters&&this.ambiguousCharacters.isAmbiguous(i)?3:0}}function X3(s){return s===" "||s===` `||s===" "}class zy{constructor(e,t,i){this.changes=e,this.moves=t,this.hitTimeout=i}}class lU{constructor(e,t){this.lineRangeMapping=e,this.changes=t}}class et{static addRange(e,t){let i=0;for(;it))return new et(e,t)}static ofLength(e){return new et(0,e)}static ofStartAndLength(e,t){return new et(e,e+t)}constructor(e,t){if(this.start=e,this.endExclusive=t,e>t)throw new Ut(`Invalid range: ${this.toString()}`)}get isEmpty(){return this.start===this.endExclusive}delta(e){return new et(this.start+e,this.endExclusive+e)}deltaStart(e){return new et(this.start+e,this.endExclusive)}deltaEnd(e){return new et(this.start,this.endExclusive+e)}get length(){return this.endExclusive-this.start}toString(){return`[${this.start}, ${this.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 Ut(`Invalid clipping range: ${this.toString()}`);return Math.max(this.start,Math.min(this.endExclusive-1,e))}clipCyclic(e){if(this.isEmpty)throw new Ut(`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)}}function YS(s,e){const t=Yde(s,e);if(t!==-1)return s[t]}function Yde(s,e,t=s.length-1){for(let i=t;i>=0;i--){const n=s[i];if(e(n))return i}return-1}function g_(s,e){const t=Hb(s,e);return t===-1?void 0:s[t]}function Hb(s,e,t=0,i=s.length){let n=t,o=i;for(;n0&&(t=n)}return t}function Jde(s,e){if(s.length===0)return;let t=s[0];for(let i=1;i=0&&(t=n)}return t}function ece(s,e){return wF(s,(t,i)=>-e(t,i))}function tce(s,e){if(s.length===0)return-1;let t=0;for(let i=1;i0&&(t=i)}return t}function ice(s,e){for(const t of s){const i=e(t);if(i!==void 0)return i}}let Je=class Kd{static fromRangeInclusive(e){return new Kd(e.startLineNumber,e.endLineNumber+1)}static joinMany(e){if(e.length===0)return[];let t=new Lr(e[0].slice());for(let i=1;it)throw new Ut(`startLineNumber ${e} cannot be after endLineNumberExclusive ${t}`);this.startLineNumber=e,this.endLineNumberExclusive=t}contains(e){return this.startLineNumber<=e&&en.endLineNumberExclusive>=e.startLineNumber),i=Hb(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=g_(this._normalizedRanges,i=>i.startLineNumber<=e);return!!t&&t.endLineNumberExclusive>e}intersects(e){const t=g_(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,o=null;for(;i=r.startLineNumber?o=new Je(o.startLineNumber,Math.max(o.endLineNumberExclusive,r.endLineNumberExclusive)):(t.push(o),o=r)}return o!==null&&t.push(o),new Lr(t)}subtractFrom(e){const t=Vb(this._normalizedRanges,r=>r.endLineNumberExclusive>=e.startLineNumber),i=Hb(this._normalizedRanges,r=>r.startLineNumber<=e.endLineNumberExclusive)+1;if(t===i)return new Lr([e]);const n=[];let o=e.startLineNumber;for(let r=t;ro&&n.push(new Je(o,a.startLineNumber)),o=a.endLineNumberExclusive}return oe.toString()).join(", ")}getIntersection(e){const t=[];let i=0,n=0;for(;it.delta(e)))}}class Fs{static betweenPositions(e,t){return e.lineNumber===t.lineNumber?new Fs(0,t.column-e.column):new Fs(t.lineNumber-e.lineNumber,t.column-1)}static ofRange(e){return Fs.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 Fs(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}createRange(e){return this.lineCount===0?new x(e.lineNumber,e.column,e.lineNumber,e.column+this.columnCount):new x(e.lineNumber,e.column,e.lineNumber+this.lineCount,this.columnCount+1)}addToPosition(e){return this.lineCount===0?new W(e.lineNumber,e.column+this.columnCount):new W(e.lineNumber+this.lineCount,this.columnCount+1)}toString(){return`${this.lineCount},${this.columnCount}`}}Fs.zero=new Fs(0,0);class nce{constructor(e){this.text=e,this.lineStartOffsetByLineIdx=[],this.lineStartOffsetByLineIdx.push(0);for(let t=0;tfF(e,(t,i)=>t.range.getEndPosition().isBeforeOrEqual(i.range.getStartPosition())))}apply(e){let t="",i=new W(1,1);for(const o of this.edits){const r=o.range,a=r.getStartPosition(),l=r.getEndPosition(),d=Y3(i,a);d.isEmpty()||(t+=e.getValueOfRange(d)),t+=o.text,i=l}const n=Y3(i,e.endPositionExclusive);return n.isEmpty()||(t+=e.getValueOfRange(n)),t}applyToString(e){const t=new sce(e);return this.apply(t)}getNewRanges(){const e=[];let t=0,i=0,n=0;for(const o of this.edits){const r=Fs.ofText(o.text),a=W.lift({lineNumber:o.range.startLineNumber+i,column:o.range.startColumn+(o.range.startLineNumber===t?n:0)}),l=r.createRange(a);e.push(l),i=l.endLineNumber-o.range.endLineNumber,n=l.endColumn-o.range.endColumn,t=o.range.endLineNumber}return e}}class zc{constructor(e,t){this.range=e,this.text=t}}function Y3(s,e){if(s.lineNumber===e.lineNumber&&s.column===Number.MAX_SAFE_INTEGER)return x.fromPositions(e,e);if(!s.isBeforeOrEqual(e))throw new Ut("start must be before end");return new x(s.lineNumber,s.column,e.lineNumber,e.column)}class dU{get endPositionExclusive(){return this.length.addToPosition(new W(1,1))}}class sce extends dU{constructor(e){super(),this.value=e,this._t=new nce(this.value)}getValueOfRange(e){return this._t.getOffsetRange(e).substring(this.value)}get length(){return this._t.textLength}}class Ns{static inverse(e,t,i){const n=[];let o=1,r=1;for(const l of e){const d=new Ns(new Je(o,l.original.startLineNumber),new Je(r,l.modified.startLineNumber));d.modified.isEmpty||n.push(d),o=l.original.endLineNumberExclusive,r=l.modified.endLineNumberExclusive}const a=new Ns(new Je(o,t+1),new Je(r,i+1));return a.modified.isEmpty||n.push(a),n}static clip(e,t,i){const n=[];for(const o of e){const r=o.original.intersect(t),a=o.modified.intersect(i);r&&!r.isEmpty&&a&&!a.isEmpty&&n.push(new Ns(r,a))}return n}constructor(e,t){this.original=e,this.modified=t}toString(){return`{${this.original.toString()}->${this.modified.toString()}}`}flip(){return new Ns(this.modified,this.original)}join(e){return new Ns(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 Qa(e,t);if(this.original.startLineNumber===1||this.modified.startLineNumber===1){if(!(this.modified.startLineNumber===1&&this.original.startLineNumber===1))throw new Ut("not a valid diff");return new Qa(new x(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new x(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1))}else return new Qa(new x(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),new x(this.modified.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER))}}class nr extends Ns{static fromRangeMappings(e){const t=Je.join(e.map(n=>Je.fromRangeInclusive(n.originalRange))),i=Je.join(e.map(n=>Je.fromRangeInclusive(n.modifiedRange)));return new nr(t,i,e)}constructor(e,t,i){super(e,t),this.innerChanges=i}flip(){var e;return new nr(this.modified,this.original,(e=this.innerChanges)===null||e===void 0?void 0:e.map(t=>t.flip()))}withInnerChangesFromLineRanges(){return new nr(this.original,this.modified,[this.toRangeMapping()])}}class Qa{constructor(e,t){this.originalRange=e,this.modifiedRange=t}toString(){return`{${this.originalRange.toString()}->${this.modifiedRange.toString()}}`}flip(){return new Qa(this.modifiedRange,this.originalRange)}toTextEdit(e){const t=e.getValueOfRange(this.modifiedRange);return new zc(this.originalRange,t)}}const oce=3;class rce{computeDiff(e,t,i){var n;const r=new dce(e,t,{maxComputationTime:i.maxComputationTimeMs,shouldIgnoreTrimWhitespace:i.ignoreTrimWhitespace,shouldComputeCharChanges:!0,shouldMakePrettyDiff:!0,shouldPostProcessCharChanges:!0}).computeDiff(),a=[];let l=null;for(const d of r.changes){let c;d.originalEndLineNumber===0?c=new Je(d.originalStartLineNumber+1,d.originalStartLineNumber+1):c=new Je(d.originalStartLineNumber,d.originalEndLineNumber+1);let u;d.modifiedEndLineNumber===0?u=new Je(d.modifiedStartLineNumber+1,d.modifiedStartLineNumber+1):u=new Je(d.modifiedStartLineNumber,d.modifiedEndLineNumber+1);let h=new nr(c,u,(n=d.charChanges)===null||n===void 0?void 0:n.map(g=>new Qa(new x(g.originalStartLineNumber,g.originalStartColumn,g.originalEndLineNumber,g.originalEndColumn),new x(g.modifiedStartLineNumber,g.modifiedStartColumn,g.modifiedEndLineNumber,g.modifiedEndColumn))));l&&(l.modified.endLineNumberExclusive===h.modified.startLineNumber||l.original.endLineNumberExclusive===h.original.startLineNumber)&&(h=new nr(l.original.join(h.original),l.modified.join(h.modified),l.innerChanges&&h.innerChanges?l.innerChanges.concat(h.innerChanges):void 0),a.pop()),a.push(h),l=h}return Lf(()=>fF(a,(d,c)=>c.original.startLineNumber-d.original.endLineNumberExclusive===c.modified.startLineNumber-d.modified.endLineNumberExclusive&&d.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 Am{constructor(e,t,i,n,o,r,a,l){this.originalStartLineNumber=e,this.originalStartColumn=t,this.originalEndLineNumber=i,this.originalEndColumn=n,this.modifiedStartLineNumber=o,this.modifiedStartColumn=r,this.modifiedEndLineNumber=a,this.modifiedEndColumn=l}static createFromDiffChange(e,t,i){const n=t.getStartLineNumber(e.originalStart),o=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),d=i.getStartColumn(e.modifiedStart),c=i.getEndLineNumber(e.modifiedStart+e.modifiedLength-1),u=i.getEndColumn(e.modifiedStart+e.modifiedLength-1);return new Am(n,o,r,a,l,d,c,u)}}function lce(s){if(s.length<=1)return s;const e=[s[0]];let t=e[0];for(let i=1,n=s.length;i0&&t.originalLength<20&&t.modifiedLength>0&&t.modifiedLength<20&&o()){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 m=cU(g,f,o,!0).changes;a&&(m=lce(m)),h=[];for(let _=0,v=m.length;_1&&m>1;){const _=h.charCodeAt(f-2),v=g.charCodeAt(m-2);if(_!==v)break;f--,m--}(f>1||m>1)&&this._pushTrimWhitespaceCharChange(n,o+1,1,f,r+1,1,m)}{let f=_A(h,1),m=_A(g,1);const _=h.length+1,v=g.length+1;for(;f<_&&m!0;const e=Date.now();return()=>Date.now()-e{i.push(bn.fromOffsetPairs(n?n.getEndExclusives():Er.zero,o?o.getStarts():new Er(t,(n?n.seq2Range.endExclusive-n.seq1Range.endExclusive:0)+t)))}),i}static fromOffsetPairs(e,t){return new bn(new et(e.offset1,t.offset1),new et(e.offset2,t.offset2))}constructor(e,t){this.seq1Range=e,this.seq2Range=t}swap(){return new bn(this.seq2Range,this.seq1Range)}toString(){return`${this.seq1Range} <-> ${this.seq2Range}`}join(e){return new bn(this.seq1Range.join(e.seq1Range),this.seq2Range.join(e.seq2Range))}delta(e){return e===0?this:new bn(this.seq1Range.delta(e),this.seq2Range.delta(e))}deltaStart(e){return e===0?this:new bn(this.seq1Range.deltaStart(e),this.seq2Range.deltaStart(e))}deltaEnd(e){return e===0?this:new bn(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 bn(t,i)}getStarts(){return new Er(this.seq1Range.start,this.seq2Range.start)}getEndExclusives(){return new Er(this.seq1Range.endExclusive,this.seq2Range.endExclusive)}}class Er{constructor(e,t){this.offset1=e,this.offset2=t}toString(){return`${this.offset1} <-> ${this.offset2}`}delta(e){return e===0?this:new Er(this.offset1+e,this.offset2+e)}equals(e){return this.offset1===e.offset1&&this.offset2===e.offset2}}Er.zero=new Er(0,0);Er.max=new Er(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER);class zb{isValid(){return!0}}zb.instance=new zb;class cce{constructor(e){if(this.timeout=e,this.startTime=Date.now(),this.valid=!0,e<=0)throw new Ut("timeout must be positive")}isValid(){if(!(Date.now()-this.startTime0&&m>0&&r.get(f-1,m-1)===3&&(b+=a.get(f-1,m-1)),b+=n?n(f,m):1):b=-1;const C=Math.max(_,v,b);if(C===b){const w=f>0&&m>0?a.get(f-1,m-1):0;a.set(f,m,w+1),r.set(f,m,3)}else C===_?(a.set(f,m,0),r.set(f,m,1)):C===v&&(a.set(f,m,0),r.set(f,m,2));o.set(f,m,C)}const l=[];let d=e.length,c=t.length;function u(f,m){(f+1!==d||m+1!==c)&&l.push(new bn(new et(f+1,d),new et(m+1,c))),d=f,c=m}let h=e.length-1,g=t.length-1;for(;h>=0&&g>=0;)r.get(h,g)===3?(u(h,g),h--,g--):r.get(h,g)===1?h--:g--;return u(-1,-1),l.reverse(),new Ic(l,!1)}}class uU{compute(e,t,i=zb.instance){if(e.length===0||t.length===0)return Ic.trivial(e,t);const n=e,o=t;function r(m,_){for(;mn.length||w>o.length)continue;const y=r(C,w);l.set(c,y);const D=C===v?d.get(c+1):d.get(c-1);if(d.set(c,y!==C?new eB(D,C,w,y-C):D),l.get(c)===n.length&&l.get(c)-c===o.length)break e}}let u=d.get(c);const h=[];let g=n.length,f=o.length;for(;;){const m=u?u.x+u.length:0,_=u?u.y+u.length:0;if((m!==g||_!==f)&&h.push(new bn(new et(m,g),new et(_,f))),!u)break;g=u.x,f=u.y,u=u.prev}return h.reverse(),new Ic(h,!1)}}class eB{constructor(e,t,i,n){this.prev=e,this.x=t,this.y=i,this.length=n}}class hce{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 gce{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 QS{constructor(e,t,i){this.lines=e,this.considerWhitespaceChanges=i,this.elements=[],this.firstCharOffsetByLine=[],this.additionalOffsetByLine=[];let n=!1;t.start>0&&t.endExclusive>=e.length&&(t=new et(t.start-1,t.endExclusive),n=!0),this.lineRange=t,this.firstCharOffsetByLine[0]=0;for(let o=this.lineRange.start;oString.fromCharCode(t)).join("")}getElement(e){return this.elements[e]}get length(){return this.elements.length}getBoundaryScore(e){const t=iB(e>0?this.elements[e-1]:-1),i=iB(ei<=e);return new W(this.lineRange.start+t+1,e-this.firstCharOffsetByLine[t]+this.additionalOffsetByLine[t]+1)}translateRange(e){return x.fromPositions(this.translateOffset(e.start),this.translateOffset(e.endExclusive))}findWordContaining(e){if(e<0||e>=this.elements.length||!rI(this.elements[e]))return;let t=e;for(;t>0&&rI(this.elements[t-1]);)t--;let i=e;for(;ir<=e.start))!==null&&t!==void 0?t:0,o=(i=Qde(this.firstCharOffsetByLine,r=>e.endExclusive<=r))!==null&&i!==void 0?i:this.elements.length;return new et(n,o)}}function rI(s){return s>=97&&s<=122||s>=65&&s<=90||s>=48&&s<=57}const fce={0:0,1:0,2:0,3:10,4:2,5:30,6:3,7:10,8:10};function tB(s){return fce[s]}function iB(s){return s===10?8:s===13?7:vA(s)?6:s>=97&&s<=122?0:s>=65&&s<=90?1:s>=48&&s<=57?2:s===-1?3:s===44||s===59?5:4}function pce(s,e,t,i,n,o){let{moves:r,excludedChanges:a}=_ce(s,e,t,o);if(!o.isValid())return[];const l=s.filter(c=>!a.has(c)),d=vce(l,i,n,e,t,o);return qT(r,d),r=bce(r),r=r.filter(c=>{const u=c.original.toOffsetRange().slice(e).map(g=>g.trim());return u.join(` `).length>=15&&mce(u,g=>g.length>=2)>=2}),r=Cce(s,r),r}function mce(s,e){let t=0;for(const i of s)e(i)&&t++;return t}function _ce(s,e,t,i){const n=[],o=s.filter(l=>l.modified.isEmpty&&l.original.length>=3).map(l=>new f_(l.original,e,l)),r=new Set(s.filter(l=>l.original.isEmpty&&l.modified.length>=3).map(l=>new f_(l.modified,t,l))),a=new Set;for(const l of o){let d=-1,c;for(const u of r){const h=l.computeSimilarity(u);h>d&&(d=h,c=u)}if(d>.9&&c&&(r.delete(c),n.push(new Ns(l.range,c.range)),a.add(l.source),a.add(c.source)),!i.isValid())return{moves:n,excludedChanges:a}}return{moves:n,excludedChanges:a}}function vce(s,e,t,i,n,o){const r=[],a=new _F;for(const h of s)for(let g=h.original.startLineNumber;gh.modified.startLineNumber,ua));for(const h of s){let g=[];for(let f=h.modified.startLineNumber;f{for(const w of g)if(w.originalLineRange.endLineNumberExclusive+1===b.endLineNumberExclusive&&w.modifiedLineRange.endLineNumberExclusive+1===_.endLineNumberExclusive){w.originalLineRange=new Je(w.originalLineRange.startLineNumber,b.endLineNumberExclusive),w.modifiedLineRange=new Je(w.modifiedLineRange.startLineNumber,_.endLineNumberExclusive),v.push(w);return}const C={modifiedLineRange:_,originalLineRange:b};l.push(C),v.push(C)}),g=v}if(!o.isValid())return[]}l.sort(kV(ao(h=>h.modifiedLineRange.length,ua)));const d=new Lr,c=new Lr;for(const h of l){const g=h.modifiedLineRange.startLineNumber-h.originalLineRange.startLineNumber,f=d.subtractFrom(h.modifiedLineRange),m=c.subtractFrom(h.originalLineRange).getWithDelta(g),_=f.getIntersection(m);for(const v of _.ranges){if(v.length<3)continue;const b=v,C=v.delta(-g);r.push(new Ns(C,b)),d.addRange(b),c.addRange(C)}}r.sort(ao(h=>h.original.startLineNumber,ua));const u=new f1(s);for(let h=0;hD.original.startLineNumber<=g.original.startLineNumber),m=g_(s,D=>D.modified.startLineNumber<=g.modified.startLineNumber),_=Math.max(g.original.startLineNumber-f.original.startLineNumber,g.modified.startLineNumber-m.modified.startLineNumber),v=u.findLastMonotonous(D=>D.original.startLineNumberD.modified.startLineNumberi.length||L>n.length||d.contains(L)||c.contains(D)||!nB(i[D-1],n[L-1],o))break}w>0&&(c.addRange(new Je(g.original.startLineNumber-w,g.original.startLineNumber)),d.addRange(new Je(g.modified.startLineNumber-w,g.modified.startLineNumber)));let y;for(y=0;yi.length||L>n.length||d.contains(L)||c.contains(D)||!nB(i[D-1],n[L-1],o))break}y>0&&(c.addRange(new Je(g.original.endLineNumberExclusive,g.original.endLineNumberExclusive+y)),d.addRange(new Je(g.modified.endLineNumberExclusive,g.modified.endLineNumberExclusive+y))),(w>0||y>0)&&(r[h]=new Ns(new Je(g.original.startLineNumber-w,g.original.endLineNumberExclusive+y),new Je(g.modified.startLineNumber-w,g.modified.endLineNumberExclusive+y)))}return r}function nB(s,e,t){if(s.trim()===e.trim())return!0;if(s.length>300&&e.length>300)return!1;const n=new uU().compute(new QS([s],new et(0,1),!1),new QS([e],new et(0,1),!1),t);let o=0;const r=bn.invert(n.diffs,s.length);for(const c of r)c.seq1Range.forEach(u=>{vA(s.charCodeAt(u))||o++});function a(c){let u=0;for(let h=0;he.length?s:e);return o/l>.6&&l>10}function bce(s){if(s.length===0)return s;s.sort(ao(t=>t.original.startLineNumber,ua));const e=[s[0]];for(let t=1;t=0&&r>=0&&o+r<=2){e[e.length-1]=i.join(n);continue}e.push(n)}return e}function Cce(s,e){const t=new f1(s);return e=e.filter(i=>{const n=t.findLastMonotonous(a=>a.original.startLineNumbera.modified.startLineNumber0&&(a=a.delta(d))}n.push(a)}return i.length>0&&n.push(i[i.length-1]),n}function wce(s,e,t){if(!s.getBoundaryScore||!e.getBoundaryScore)return t;for(let i=0;i0?t[i-1]:void 0,o=t[i],r=i+1=i.start&&s.seq2Range.start-r>=n.start&&t.isStronglyEqual(s.seq2Range.start-r,s.seq2Range.endExclusive-r)&&r<100;)r++;r--;let a=0;for(;s.seq1Range.start+ad&&(d=f,l=c)}return s.delta(l)}function yce(s,e,t){const i=[];for(const n of t){const o=i[i.length-1];if(!o){i.push(n);continue}n.seq1Range.start-o.seq1Range.endExclusive<=2||n.seq2Range.start-o.seq2Range.endExclusive<=2?i[i.length-1]=new bn(o.seq1Range.join(n.seq1Range),o.seq2Range.join(n.seq2Range)):i.push(n)}return i}function Sce(s,e,t){const i=bn.invert(t,s.length),n=[];let o=new Er(0,0);function r(l,d){if(l.offset10;){const _=i[0];if(!(_.seq1Range.intersects(h.seq1Range)||_.seq2Range.intersects(h.seq2Range)))break;const b=s.findWordContaining(_.seq1Range.start),C=e.findWordContaining(_.seq2Range.start),w=new bn(b,C),y=w.intersect(_);if(f+=y.seq1Range.length,m+=y.seq2Range.length,h=h.join(w),h.seq1Range.endExclusive>=_.seq1Range.endExclusive)i.shift();else break}f+m<(h.seq1Range.length+h.seq2Range.length)*2/3&&n.push(h),o=h.getEndExclusives()}for(;i.length>0;){const l=i.shift();l.seq1Range.isEmpty||(r(l.getStarts(),l),r(l.getEndExclusives().delta(-1),l))}return Dce(t,n)}function Dce(s,e){const t=[];for(;s.length>0||e.length>0;){const i=s[0],n=e[0];let o;i&&(!n||i.seq1Range.start0&&t[t.length-1].seq1Range.endExclusive>=o.seq1Range.start?t[t.length-1]=t[t.length-1].join(o):t.push(o)}return t}function Lce(s,e,t){let i=t;if(i.length===0)return i;let n=0,o;do{o=!1;const r=[i[0]];for(let a=1;a5||g.seq1Range.length+g.seq2Range.length>5)};const l=i[a],d=r[r.length-1];c(d,l)?(o=!0,r[r.length-1]=r[r.length-1].join(l)):r.push(l)}i=r}while(n++<10&&o);return i}function xce(s,e,t){let i=t;if(i.length===0)return i;let n=0,o;do{o=!1;const a=[i[0]];for(let l=1;l5||m.length>500)return!1;const v=s.getText(m).trim();if(v.length>20||v.split(/\r\n|\r|\n/).length>1)return!1;const b=s.countLinesIn(g.seq1Range),C=g.seq1Range.length,w=e.countLinesIn(g.seq2Range),y=g.seq2Range.length,D=s.countLinesIn(f.seq1Range),L=f.seq1Range.length,k=e.countLinesIn(f.seq2Range),I=f.seq2Range.length,O=2*40+50;function R(P){return Math.min(P,O)}return Math.pow(Math.pow(R(b*40+C),1.5)+Math.pow(R(w*40+y),1.5),1.5)+Math.pow(Math.pow(R(D*40+L),1.5)+Math.pow(R(k*40+I),1.5),1.5)>(O**1.5)**1.5*1.3};const d=i[l],c=a[a.length-1];u(c,d)?(o=!0,a[a.length-1]=a[a.length-1].join(d)):a.push(d)}i=a}while(n++<10&&o);const r=[];return Dse(i,(a,l,d)=>{let c=l;function u(v){return v.length>0&&v.trim().length<=3&&l.seq1Range.length+l.seq2Range.length>100}const h=s.extendToFullLines(l.seq1Range),g=s.getText(new et(h.start,l.seq1Range.start));u(g)&&(c=c.deltaStart(-g.length));const f=s.getText(new et(l.seq1Range.endExclusive,h.endExclusive));u(f)&&(c=c.deltaEnd(f.length));const m=bn.fromOffsetPairs(a?a.getEndExclusives():Er.zero,d?d.getStarts():Er.max),_=c.intersect(m);r.length>0&&_.getStarts().equals(r[r.length-1].getEndExclusives())?r[r.length-1]=r[r.length-1].join(_):r.push(_)}),r}class rB{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:aB(this.lines[e-1]),i=e===this.lines.length?0:aB(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 aB(s){let e=0;for(;ey===D))return new zy([],[],!1);if(e.length===1&&e[0].length===0||t.length===1&&t[0].length===0)return new zy([new nr(new Je(1,e.length+1),new Je(1,t.length+1),[new Qa(new x(1,1,e.length,e[e.length-1].length+1),new x(1,1,t.length,t[t.length-1].length+1))])],[],!1);const n=i.maxComputationTimeMs===0?zb.instance:new cce(i.maxComputationTimeMs),o=!i.ignoreTrimWhitespace,r=new Map;function a(y){let D=r.get(y);return D===void 0&&(D=r.size,r.set(y,D)),D}const l=e.map(y=>a(y.trim())),d=t.map(y=>a(y.trim())),c=new rB(l,e),u=new rB(d,t),h=c.length+u.length<1700?this.dynamicProgrammingDiffing.compute(c,u,n,(y,D)=>e[y]===t[D]?t[D].length===0?.1:1+Math.log(1+t[D].length):.99):this.myersDiffingAlgorithm.compute(c,u);let g=h.diffs,f=h.hitTimeout;g=bA(c,u,g),g=Lce(c,u,g);const m=[],_=y=>{if(o)for(let D=0;Dy.seq1Range.start-v===y.seq2Range.start-b);const D=y.seq1Range.start-v;_(D),v=y.seq1Range.endExclusive,b=y.seq2Range.endExclusive;const L=this.refineDiff(e,t,y,n,o);L.hitTimeout&&(f=!0);for(const k of L.mappings)m.push(k)}_(e.length-v);const C=lB(m,e,t);let w=[];return i.computeMoves&&(w=this.computeMoves(C,e,t,l,d,n,o)),Lf(()=>{function y(L,k){if(L.lineNumber<1||L.lineNumber>k.length)return!1;const I=k[L.lineNumber-1];return!(L.column<1||L.column>I.length+1)}function D(L,k){return!(L.startLineNumber<1||L.startLineNumber>k.length+1||L.endLineNumberExclusive<1||L.endLineNumberExclusive>k.length+1)}for(const L of C){if(!L.innerChanges)return!1;for(const k of L.innerChanges)if(!(y(k.modifiedRange.getStartPosition(),t)&&y(k.modifiedRange.getEndPosition(),t)&&y(k.originalRange.getStartPosition(),e)&&y(k.originalRange.getEndPosition(),e)))return!1;if(!D(L.modified,t)||!D(L.original,e))return!1}return!0}),new zy(C,w,f)}computeMoves(e,t,i,n,o,r,a){return pce(e,t,i,n,o,r).map(c=>{const u=this.refineDiff(t,i,new bn(c.original.toOffsetRange(),c.modified.toOffsetRange()),r,a),h=lB(u.mappings,t,i,!0);return new lU(c,h)})}refineDiff(e,t,i,n,o){const r=new QS(e,i.seq1Range,o),a=new QS(t,i.seq2Range,o),l=r.length+a.length<500?this.dynamicProgrammingDiffing.compute(r,a,n):this.myersDiffingAlgorithm.compute(r,a,n);let d=l.diffs;return d=bA(r,a,d),d=Sce(r,a,d),d=yce(r,a,d),d=xce(r,a,d),{mappings:d.map(u=>new Qa(r.translateRange(u.seq1Range),a.translateRange(u.seq2Range))),hitTimeout:l.hitTimeout}}}function lB(s,e,t,i=!1){const n=[];for(const o of PP(s.map(r=>kce(r,e,t)),(r,a)=>r.original.overlapOrTouch(a.original)||r.modified.overlapOrTouch(a.modified))){const r=o[0],a=o[o.length-1];n.push(new nr(r.original.join(a.original),r.modified.join(a.modified),o.map(l=>l.innerChanges[0])))}return Lf(()=>!i&&n.length>0&&(n[0].modified.startLineNumber!==n[0].original.startLineNumber||t.length-n[n.length-1].modified.endLineNumberExclusive!==e.length-n[n.length-1].original.endLineNumberExclusive)?!1:fF(n,(o,r)=>r.original.startLineNumber-o.original.endLineNumberExclusive===r.modified.startLineNumber-o.modified.endLineNumberExclusive&&o.original.endLineNumberExclusive=t[s.modifiedRange.startLineNumber-1].length&&s.originalRange.startColumn-1>=e[s.originalRange.startLineNumber-1].length&&s.originalRange.startLineNumber<=s.originalRange.endLineNumber+n&&s.modifiedRange.startLineNumber<=s.modifiedRange.endLineNumber+n&&(i=1);const o=new Je(s.originalRange.startLineNumber+i,s.originalRange.endLineNumber+1+n),r=new Je(s.modifiedRange.startLineNumber+i,s.modifiedRange.endLineNumber+1+n);return new nr(o,r,[s])}const dB={getLegacy:()=>new rce,getDefault:()=>new hU};function oh(s,e){const t=Math.pow(10,e);return Math.round(s*t)/t}class bt{constructor(e,t,i,n=1){this._rgbaBrand=void 0,this.r=Math.min(255,Math.max(0,e))|0,this.g=Math.min(255,Math.max(0,t))|0,this.b=Math.min(255,Math.max(0,i))|0,this.a=oh(Math.max(Math.min(1,n),0),3)}static equals(e,t){return e.r===t.r&&e.g===t.g&&e.b===t.b&&e.a===t.a}}class na{constructor(e,t,i,n){this._hslaBrand=void 0,this.h=Math.max(Math.min(360,e),0)|0,this.s=oh(Math.max(Math.min(1,t),0),3),this.l=oh(Math.max(Math.min(1,i),0),3),this.a=oh(Math.max(Math.min(1,n),0),3)}static equals(e,t){return e.h===t.h&&e.s===t.s&&e.l===t.l&&e.a===t.a}static fromRGBA(e){const t=e.r/255,i=e.g/255,n=e.b/255,o=e.a,r=Math.max(t,i,n),a=Math.min(t,i,n);let l=0,d=0;const c=(a+r)/2,u=r-a;if(u>0){switch(d=Math.min(c<=.5?u/(2*c):u/(2-2*c),1),r){case t:l=(i-n)/u+(i1&&(i-=1),i<1/6?e+(t-e)*6*i:i<1/2?t:i<2/3?e+(t-e)*(2/3-i)*6:e}static toRGBA(e){const t=e.h/360,{s:i,l:n,a:o}=e;let r,a,l;if(i===0)r=a=l=n;else{const d=n<.5?n*(1+i):n+i-n*i,c=2*n-d;r=na._hue2rgb(c,d,t+1/3),a=na._hue2rgb(c,d,t),l=na._hue2rgb(c,d,t-1/3)}return new bt(Math.round(r*255),Math.round(a*255),Math.round(l*255),o)}}class Yl{constructor(e,t,i,n){this._hsvaBrand=void 0,this.h=Math.max(Math.min(360,e),0)|0,this.s=oh(Math.max(Math.min(1,t),0),3),this.v=oh(Math.max(Math.min(1,i),0),3),this.a=oh(Math.max(Math.min(1,n),0),3)}static equals(e,t){return e.h===t.h&&e.s===t.s&&e.v===t.v&&e.a===t.a}static fromRGBA(e){const t=e.r/255,i=e.g/255,n=e.b/255,o=Math.max(t,i,n),r=Math.min(t,i,n),a=o-r,l=o===0?0:a/o;let d;return a===0?d=0:o===t?d=((i-n)/a%6+6)%6:o===i?d=(n-t)/a+2:d=(t-i)/a+4,new Yl(Math.round(d*60),l,o,e.a)}static toRGBA(e){const{h:t,s:i,v:n,a:o}=e,r=n*i,a=r*(1-Math.abs(t/60%2-1)),l=n-r;let[d,c,u]=[0,0,0];return t<60?(d=r,c=a):t<120?(d=a,c=r):t<180?(c=r,u=a):t<240?(c=a,u=r):t<300?(d=a,u=r):t<=360&&(d=r,u=a),d=Math.round((d+l)*255),c=Math.round((c+l)*255),u=Math.round((u+l)*255),new bt(d,c,u,o)}}class ${static fromHex(e){return $.Format.CSS.parseHex(e)||$.red}static equals(e,t){return!e&&!t?!0:!e||!t?!1:e.equals(t)}get hsla(){return this._hsla?this._hsla:na.fromRGBA(this.rgba)}get hsva(){return this._hsva?this._hsva:Yl.fromRGBA(this.rgba)}constructor(e){if(e)if(e instanceof bt)this.rgba=e;else if(e instanceof na)this._hsla=e,this.rgba=na.toRGBA(e);else if(e instanceof Yl)this._hsva=e,this.rgba=Yl.toRGBA(e);else throw new Error("Invalid color ctor argument");else throw new Error("Color needs a value")}equals(e){return!!e&&bt.equals(this.rgba,e.rgba)&&na.equals(this.hsla,e.hsla)&&Yl.equals(this.hsva,e.hsva)}getRelativeLuminance(){const e=$._relativeLuminanceForComponent(this.rgba.r),t=$._relativeLuminanceForComponent(this.rgba.g),i=$._relativeLuminanceForComponent(this.rgba.b),n=.2126*e+.7152*t+.0722*i;return oh(n,4)}static _relativeLuminanceForComponent(e){const t=e/255;return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)}isLighter(){return(this.rgba.r*299+this.rgba.g*587+this.rgba.b*114)/1e3>=128}isLighterThan(e){const t=this.getRelativeLuminance(),i=e.getRelativeLuminance();return t>i}isDarkerThan(e){const t=this.getRelativeLuminance(),i=e.getRelativeLuminance();return t0)for(const n of i){const o=n.filter(d=>d!==void 0),r=o[1],a=o[2];if(!a)continue;let l;if(r==="rgb"){const d=/^\(\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=cB(B0(s,n),W0(a,d),!1)}else if(r==="rgba"){const d=/^\(\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=cB(B0(s,n),W0(a,d),!0)}else if(r==="hsl"){const d=/^\(\s*(36[0]|3[0-5][0-9]|[12][0-9][0-9]|[1-9]?[0-9])\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*\)$/gm;l=uB(B0(s,n),W0(a,d),!1)}else if(r==="hsla"){const d=/^\(\s*(36[0]|3[0-5][0-9]|[12][0-9][0-9]|[1-9]?[0-9])\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*,\s*(0[.][0-9]+|[.][0-9]+|[01][.]|[01])\s*\)$/gm;l=uB(B0(s,n),W0(a,d),!0)}else r==="#"&&(l=Ece(B0(s,n),r+a));l&&e.push(l)}return e}function Tce(s){return!s||typeof s.getValue!="function"||typeof s.positionAt!="function"?[]:Ice(s)}const hB=new RegExp("\\bMARK:\\s*(.*)$","d"),Nce=/^-+|-+$/g;function Ace(s,e){var t;let i=[];if(e.findRegionSectionHeaders&&(!((t=e.foldingRules)===null||t===void 0)&&t.markers)){const n=Mce(s,e);i=i.concat(n)}if(e.findMarkSectionHeaders){const n=Rce(s);i=i.concat(n)}return i}function Mce(s,e){const t=[],i=s.getLineCount();for(let n=1;n<=i;n++){const o=s.getLineContent(n),r=o.match(e.foldingRules.markers.start);if(r){const a={startLineNumber:n,startColumn:r[0].length+1,endLineNumber:n,endColumn:o.length+1};if(a.endColumn>a.startColumn){const l={range:a,...fU(o.substring(r[0].length)),shouldBeInComments:!1};(l.text||l.hasSeparatorLine)&&t.push(l)}}}return t}function Rce(s){const e=[],t=s.getLineCount();for(let i=1;i<=t;i++){const n=s.getLineContent(i);Pce(n,i,e)}return e}function Pce(s,e,t){hB.lastIndex=0;const i=hB.exec(s);if(i){const n=i.indices[1][0]+1,o=i.indices[1][1]+1,r={startLineNumber:e,startColumn:n,endLineNumber:e,endColumn:o};if(r.endColumn>r.startColumn){const a={range:r,...fU(i[1]),shouldBeInComments:!0};(a.text||a.hasSeparatorLine)&&t.push(a)}}}function fU(s){s=s.trim();const e=s.startsWith("-");return s=s.replace(Nce,""),{text:s,hasSeparatorLine:e}}class Fce extends Nde{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 o=this._lines[t-1].length+1;i<1?(i=1,n=!0):i>o&&(i=o,n=!0)}return n?{lineNumber:t,column:i}:e}}class rh{constructor(e,t){this._host=e,this._models=Object.create(null),this._foreignModuleFactory=t,this._foreignModule=null}dispose(){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 Fce(Ae.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]}async computeUnicodeHighlights(e,t,i){const n=this._getModel(e);return n?bF.computeUnicodeHighlights(n,t,i):{ranges:[],hasMore:!1,ambiguousCharacterCount:0,invisibleCharacterCount:0,nonBasicAsciiCharacterCount:0}}async findSectionHeaders(e,t){const i=this._getModel(e);return i?Ace(i,t):[]}async computeDiff(e,t,i,n){const o=this._getModel(e),r=this._getModel(t);return!o||!r?null:rh.computeDiff(o,r,i,n)}static computeDiff(e,t,i,n){const o=n==="advanced"?dB.getDefault():dB.getLegacy(),r=e.getLinesContent(),a=t.getLinesContent(),l=o.computeDiff(r,a,i),d=l.changes.length>0?!1:this._modelsAreIdentical(e,t);function c(u){return u.map(h=>{var g;return[h.original.startLineNumber,h.original.endLineNumberExclusive,h.modified.startLineNumber,h.modified.endLineNumberExclusive,(g=h.innerChanges)===null||g===void 0?void 0:g.map(f=>[f.originalRange.startLineNumber,f.originalRange.startColumn,f.originalRange.endLineNumber,f.originalRange.endColumn,f.modifiedRange.startLineNumber,f.modifiedRange.startColumn,f.modifiedRange.endLineNumber,f.modifiedRange.endColumn])]})}return{identical:d,quitEarly:l.hitTimeout,changes:c(l.changes),moves:l.moves.map(u=>[u.lineRangeMapping.original.startLineNumber,u.lineRangeMapping.original.endLineNumberExclusive,u.lineRangeMapping.modified.startLineNumber,u.lineRangeMapping.modified.endLineNumberExclusive,c(u.changes)])}}static _modelsAreIdentical(e,t){const i=e.getLineCount(),n=t.getLineCount();if(i!==n)return!1;for(let o=1;o<=i;o++){const r=e.getLineContent(o),a=t.getLineContent(o);if(r!==a)return!1}return!0}async computeMoreMinimalEdits(e,t,i){const n=this._getModel(e);if(!n)return t;const o=[];let r;t=t.slice(0).sort((l,d)=>{if(l.range&&d.range)return x.compareRangesUsingStarts(l.range,d.range);const c=l.range?0:1,u=d.range?0:1;return c-u});let a=0;for(let l=1;lrh._diffLimit){o.push({range:l,text:d});continue}const h=Ede(u,d,i),g=n.offsetAt(x.lift(l).getStartPosition());for(const f of h){const m=n.positionAt(g+f.originalStart),_=n.positionAt(g+f.originalStart+f.originalLength),v={text:d.substr(f.modifiedStart,f.modifiedLength),range:{startLineNumber:m.lineNumber,startColumn:m.column,endLineNumber:_.lineNumber,endColumn:_.column}};n.getValueInRange(v.range)!==v.text&&o.push(v)}}return typeof r=="number"&&o.push({eol:r,text:"",range:{startLineNumber:0,startColumn:0,endLineNumber:0,endColumn:0}}),o}async computeLinks(e){const t=this._getModel(e);return t?Fde(t):null}async computeDefaultDocumentColors(e){const t=this._getModel(e);return t?Tce(t):null}async textualSuggest(e,t,i,n){const o=new Jn,r=new RegExp(i,n),a=new Set;e:for(const l of e){const d=this._getModel(l);if(d){for(const c of d.words(r))if(!(c===t||!isNaN(Number(c)))&&(a.add(c),a.size>rh._suggestionsLimit))break e}}return{words:Array.from(a),duration:o.elapsed()}}async computeWordRanges(e,t,i,n){const o=this._getModel(e);if(!o)return Object.create(null);const r=new RegExp(i,n),a=Object.create(null);for(let l=t.startLineNumber;lthis._host.fhr(a,l)),getMirrorModels:()=>this._getModels()};return this._foreignModuleFactory?(this._foreignModule=this._foreignModuleFactory(r,t),Promise.resolve(BP(this._foreignModule))):Promise.reject(new Error("Unexpected usage"))}fmr(e,t){if(!this._foreignModule||typeof this._foreignModule[e]!="function")return Promise.reject(new Error("Missing requestHandler or method: "+e));try{return Promise.resolve(this._foreignModule[e].apply(this._foreignModule,t))}catch(i){return Promise.reject(i)}}}rh._diffLimit=1e5;rh._suggestionsLimit=1e4;typeof importScripts=="function"&&(globalThis.monaco=iz());const DF=ut("textResourceConfigurationService"),pU=ut("textResourcePropertiesService"),Ce=ut("ILanguageFeaturesService");var Oce=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},H0=function(s,e){return function(t,i){e(t,i,s)}};const gB=60*1e3,fB=5*60*1e3;function Fg(s,e){const t=s.getModel(e);return!(!t||t.isTooLargeForSyncing())}let CA=class extends H{constructor(e,t,i,n,o){super(),this._modelService=e,this._workerManager=this._register(new Wce(this._modelService,n)),this._logService=i,this._register(o.linkProvider.register({language:"*",hasAccessToAllModels:!0},{provideLinks:(r,a)=>Fg(this._modelService,r.uri)?this._workerManager.withWorker().then(l=>l.computeLinks(r.uri)).then(l=>l&&{links:l}):Promise.resolve({links:[]})})),this._register(o.completionProvider.register("*",new Bce(this._workerManager,t,this._modelService,n)))}dispose(){super.dispose()}canComputeUnicodeHighlights(e){return Fg(this._modelService,e)}computedUnicodeHighlights(e,t,i){return this._workerManager.withWorker().then(n=>n.computedUnicodeHighlights(e,t,i))}async computeDiff(e,t,i,n){const o=await this._workerManager.withWorker().then(l=>l.computeDiff(e,t,i,n));if(!o)return null;return{identical:o.identical,quitEarly:o.quitEarly,changes:a(o.changes),moves:o.moves.map(l=>new lU(new Ns(new Je(l[0],l[1]),new Je(l[2],l[3])),a(l[4])))};function a(l){return l.map(d=>{var c;return new nr(new Je(d[0],d[1]),new Je(d[2],d[3]),(c=d[4])===null||c===void 0?void 0:c.map(u=>new Qa(new x(u[0],u[1],u[2],u[3]),new x(u[4],u[5],u[6],u[7]))))})}}computeMoreMinimalEdits(e,t,i=!1){if(rs(t)){if(!Fg(this._modelService,e))return Promise.resolve(t);const n=Jn.create(),o=this._workerManager.withWorker().then(r=>r.computeMoreMinimalEdits(e,t,i));return o.finally(()=>this._logService.trace("FORMAT#computeMoreMinimalEdits",e.toString(!0),n.elapsed())),Promise.race([o,xh(1e3).then(()=>t)])}else return Promise.resolve(void 0)}canNavigateValueSet(e){return Fg(this._modelService,e)}navigateValueSet(e,t,i){return this._workerManager.withWorker().then(n=>n.navigateValueSet(e,t,i))}canComputeWordRanges(e){return Fg(this._modelService,e)}computeWordRanges(e,t){return this._workerManager.withWorker().then(i=>i.computeWordRanges(e,t))}findSectionHeaders(e,t){return this._workerManager.withWorker().then(i=>i.findSectionHeaders(e,t))}};CA=Oce([H0(0,_i),H0(1,DF),H0(2,ys),H0(3,Yt),H0(4,Ce)],CA);class Bce{constructor(e,t,i,n){this.languageConfigurationService=n,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")Fg(this._modelService,e.uri)&&n.push(e.uri);else for(const u of this._modelService.getModels())Fg(this._modelService,u.uri)&&(u===e?n.unshift(u.uri):(i.wordBasedSuggestions==="allDocuments"||u.getLanguageId()===e.getLanguageId())&&n.push(u.uri));if(n.length===0)return;const o=this.languageConfigurationService.getLanguageConfiguration(e.getLanguageId()).getWordDefinition(),r=e.getWordAtPosition(t),a=r?new x(t.lineNumber,r.startColumn,t.lineNumber,r.endColumn):x.fromPositions(t),l=a.setEndPosition(t.lineNumber,t.column),c=await(await this._workerManager.withWorker()).textualSuggest(n,r==null?void 0:r.word,o);if(c)return{duration:c.duration,suggestions:c.words.map(u=>({kind:18,label:u,insertText:u,range:{insert:l,replace:a}}))}}}class Wce extends H{constructor(e,t){super(),this.languageConfigurationService=t,this._modelService=e,this._editorWorkerClient=null,this._lastWorkerUsedTime=new Date().getTime(),this._register(new lF).cancelAndSet(()=>this._checkStopIdleWorker(),Math.round(fB/2),Ht),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>fB&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null)}withWorker(){return this._lastWorkerUsedTime=new Date().getTime(),this._editorWorkerClient||(this._editorWorkerClient=new LF(this._modelService,!1,"editorWorkerService",this.languageConfigurationService)),Promise.resolve(this._editorWorkerClient)}}class Hce extends H{constructor(e,t,i){if(super(),this._syncedModels=Object.create(null),this._syncedModelsLastUsedTime=Object.create(null),this._proxy=e,this._modelService=t,!i){const n=new oF;n.cancelAndSet(()=>this._checkStopModelSync(),Math.round(gB/2)),this._register(n)}}dispose(){for(const e in this._syncedModels)jt(this._syncedModels[e]);this._syncedModels=Object.create(null),this._syncedModelsLastUsedTime=Object.create(null),super.dispose()}ensureSyncedResources(e,t){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]>gB&&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 o=new Y;o.add(i.onDidChangeContent(r=>{this._proxy.acceptModelChanged(n.toString(),r)})),o.add(i.onWillDispose(()=>{this._stopModelSync(n)})),o.add(Ie(()=>{this._proxy.acceptRemovedModel(n)})),this._syncedModels[n]=o}_stopModelSync(e){const t=this._syncedModels[e];delete this._syncedModels[e],delete this._syncedModelsLastUsedTime[e],jt(t)}}class pB{constructor(e){this._instance=e,this._proxyObj=Promise.resolve(this._instance)}dispose(){this._instance.dispose()}getProxyObject(){return this._proxyObj}}class aI{constructor(e){this._workerClient=e}fhr(e,t){return this._workerClient.fhr(e,t)}}class LF extends H{constructor(e,t,i,n){super(),this.languageConfigurationService=n,this._disposed=!1,this._modelService=e,this._keepIdleModels=t,this._workerFactory=new gx(i),this._worker=null,this._modelManager=null}fhr(e,t){throw new Error("Not implemented!")}_getOrCreateWorker(){if(!this._worker)try{this._worker=this._register(new Vle(this._workerFactory,"vs/editor/common/services/editorSimpleWorker",new aI(this)))}catch(e){uA(e),this._worker=new pB(new rh(new aI(this),null))}return this._worker}_getProxy(){return this._getOrCreateWorker().getProxyObject().then(void 0,e=>(uA(e),this._worker=new pB(new rh(new aI(this),null)),this._getOrCreateWorker().getProxyObject()))}_getOrCreateModelManager(e){return this._modelManager||(this._modelManager=this._register(new Hce(e,this._modelService,this._keepIdleModels))),this._modelManager}async _withSyncedResources(e,t=!1){return this._disposed?Promise.reject(Woe()):this._getProxy().then(i=>(this._getOrCreateModelManager(i).ensureSyncedResources(e,t),i))}computedUnicodeHighlights(e,t,i){return this._withSyncedResources([e]).then(n=>n.computeUnicodeHighlights(e.toString(),t,i))}computeDiff(e,t,i,n){return this._withSyncedResources([e,t],!0).then(o=>o.computeDiff(e.toString(),t.toString(),i,n))}computeMoreMinimalEdits(e,t,i){return this._withSyncedResources([e]).then(n=>n.computeMoreMinimalEdits(e.toString(),t,i))}computeLinks(e){return this._withSyncedResources([e]).then(t=>t.computeLinks(e.toString()))}computeDefaultDocumentColors(e){return this._withSyncedResources([e]).then(t=>t.computeDefaultDocumentColors(e.toString()))}async textualSuggest(e,t,i){const n=await this._withSyncedResources(e),o=i.source,r=i.flags;return n.textualSuggest(e.map(a=>a.toString()),t,o,r)}computeWordRanges(e,t){return this._withSyncedResources([e]).then(i=>{const n=this._modelService.getModel(e);if(!n)return Promise.resolve(null);const o=this.languageConfigurationService.getLanguageConfiguration(n.getLanguageId()).getWordDefinition(),r=o.source,a=o.flags;return i.computeWordRanges(e.toString(),t,r,a)})}navigateValueSet(e,t,i){return this._withSyncedResources([e]).then(n=>{const o=this._modelService.getModel(e);if(!o)return null;const r=this.languageConfigurationService.getLanguageConfiguration(o.getLanguageId()).getWordDefinition(),a=r.source,l=r.flags;return n.navigateValueSet(e.toString(),t,i,a,l)})}findSectionHeaders(e,t){return this._withSyncedResources([e]).then(i=>i.findSectionHeaders(e.toString(),t))}dispose(){super.dispose(),this._disposed=!0}}function Vce(s,e,t){return new zce(s,e,t)}class zce extends LF{constructor(e,t,i){super(e,i.keepIdleModels||!1,i.label,t),this._foreignModuleId=i.moduleId,this._foreignModuleCreateData=i.createData||null,this._foreignModuleHost=i.host||null,this._foreignProxy=null}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)}}_getForeignProxy(){return this._foreignProxy||(this._foreignProxy=this._getProxy().then(e=>{const t=this._foreignModuleHost?BP(this._foreignModuleHost):[];return e.loadForeignModule(this._foreignModuleId,this._foreignModuleCreateData,t).then(i=>{this._foreignModuleCreateData=null;const n=(a,l)=>e.fmr(a,l),o=(a,l)=>function(){const d=Array.prototype.slice.call(arguments,0);return l(a,d)},r={};for(const a of i)r[a]=o(a,n);return r})})),this._foreignProxy}getProxy(){return this._getForeignProxy()}withSyncedResources(e){return this._withSyncedResources(e).then(t=>this.getProxy())}}const p1={ICodeEditor:"vs.editor.ICodeEditor",IDiffEditor:"vs.editor.IDiffEditor"},Ub=new class{clone(){return this}equals(s){return this===s}};function mU(s,e){return new ZP([new Ib(0,"",s)],e)}function xF(s,e){const t=new Uint32Array(2);return t[0]=0,t[1]=(s<<0|0|0|32768|2<<24)>>>0,new KL(t,e===null?Ub:e)}class yo{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 o=`color: ${t[i]};`;n&1&&(o+="font-style: italic;"),n&2&&(o+="font-weight: bold;");let r="";return n&4&&(r+=" underline"),n&8&&(r+=" line-through"),r&&(o+=`text-decoration:${r};`),o}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 wn{static createEmpty(e,t){const i=wn.defaultTokenMetadata,n=new Uint32Array(2);return n[0]=e.length,n[1]=i,new wn(n,e,t)}constructor(e,t,i){this._lineTokensBrand=void 0,this._tokens=e,this._tokensCount=this._tokens.length>>>1,this._text=t,this._languageIdCodec=i}equals(e){return e instanceof wn?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,o=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=yo.getLanguageId(t);return this._languageIdCodec.decodeLanguageId(i)}getStandardTokenType(e){const t=this._tokens[(e<<1)+1];return yo.getTokenType(t)}getForeground(e){const t=this._tokens[(e<<1)+1];return yo.getForeground(t)}getClassName(e){const t=this._tokens[(e<<1)+1];return yo.getClassNameFromMetadata(t)}getInlineStyle(e,t){const i=this._tokens[(e<<1)+1];return yo.getInlineStyleFromMetadata(i,t)}getPresentation(e){const t=this._tokens[(e<<1)+1];return yo.getPresentationFromMetadata(t)}getEndOffset(e){return this._tokens[e<<1]}findTokenIndexAtOffset(e){return wn.findIndexInTokensArray(this._tokens,e)}inflate(){return this}sliceAndInflate(e,t,i){return new kF(this,e,t,i)}static convertToEndOffset(e,t){const n=(e.length>>>1)-1;for(let o=0;o>>1)-1;for(;it&&(n=o)}return i}withInserted(e){if(e.length===0)return this;let t=0,i=0,n="";const o=new Array;let r=0;for(;;){const a=tr){n+=this._text.substring(r,l.offset);const d=this._tokens[(t<<1)+1];o.push(n.length,d),r=l.offset}n+=l.text,o.push(n.length,l.tokenMetadata),i++}else break}return new wn(new Uint32Array(o),n,this._languageIdCodec)}}wn.defaultTokenMetadata=(32768|2<<24)>>>0;class kF{constructor(e,t,i,n){this._source=e,this._startOffset=t,this._endOffset=i,this._deltaOffset=n,this._firstTokenIndex=e.findTokenIndexAtOffset(t),this._tokensCount=0;for(let o=this._firstTokenIndex,r=e.getCount();o=i);o++)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 kF?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}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}}class Os{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 o=0;o=o||(a[l++]=new Os(Math.max(1,d.startColumn-n+1),Math.min(r+1,d.endColumn-n+1),d.className,d.type));return a}static filter(e,t,i,n){if(e.length===0)return[];const o=[];let r=0;for(let a=0,l=e.length;at||c.isEmpty()&&(d.type===0||d.type===3))continue;const u=c.startLineNumber===t?c.startColumn:i,h=c.endLineNumber===t?c.endColumn:n;o[r++]=new Os(u,h,d.inlineClassName,d.type)}return o}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=Os._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 Uce{static normalize(e,t){if(t.length===0)return[];const i=[],n=new JS;let o=0;for(let r=0,a=t.length;r1){const m=e.charCodeAt(d-2);Cn(m)&&d--}if(c>1){const m=e.charCodeAt(c-2);Cn(m)&&c--}const g=d-1,f=c-2;o=n.consumeLowerThan(g,o,i),n.count===0&&(o=g),n.insert(f,u,h)}return n.consumeLowerThan(1073741824,o,i),i}}class Tn{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 _U{constructor(e,t){this.startOffset=e,this.endOffset=t}equals(e){return this.startOffset===e.startOffset&&this.endOffset===e.endOffset}}class tg{constructor(e,t,i,n,o,r,a,l,d,c,u,h,g,f,m,_,v,b,C){this.useMonospaceOptimizations=e,this.canUseHalfwidthRightwardsArrow=t,this.lineContent=i,this.continuesWithWrappedLine=n,this.isBasicASCII=o,this.containsRTL=r,this.fauxIndentLength=a,this.lineTokens=l,this.lineDecorations=d.sort(Os.compare),this.tabSize=c,this.startVisibleColumn=u,this.spaceWidth=h,this.stopRenderingLineAfter=m,this.renderWhitespace=_==="all"?4:_==="boundary"?1:_==="selection"?2:_==="trailing"?3:0,this.renderControlCharacters=v,this.fontLigatures=b,this.selectionsOnLine=C&&C.sort((D,L)=>D.startOffset>>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 o=(t<<16|i<<0)>>>0;this._data[e-1]=o,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=Bl.getPartIndex(t),n=Bl.getCharIndex(t);return new vU(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 o=0,r=this.length-1;for(;o+1>>1,_=this._data[m];if(_===n)return m;_>n?r=m:o=m}if(o===r)return o;const a=this._data[o],l=this._data[r];if(a===n)return o;if(l===n)return r;const d=Bl.getPartIndex(a),c=Bl.getCharIndex(a),u=Bl.getPartIndex(l);let h;d!==u?h=t:h=Bl.getCharIndex(l);const g=i-c,f=h-i;return g<=f?o:r}}class wA{constructor(e,t,i){this._renderLineOutputBrand=void 0,this.characterMapping=e,this.containsRTL=t,this.containsForeignElements=i}}function m1(s,e){if(s.lineContent.length===0){if(s.lineDecorations.length>0){e.appendString("");let t=0,i=0,n=0;for(const r of s.lineDecorations)(r.type===1||r.type===2)&&(e.appendString(''),r.type===1&&(n|=1,t++),r.type===2&&(n|=2,i++));e.appendString("");const o=new Bl(1,t+i);return o.setColumnInfo(1,t,0,0),new wA(o,!1,n)}return e.appendString(""),new wA(new Bl(0,0),!1,0)}return Qce(Kce(s),e)}class $ce{constructor(e,t,i,n){this.characterMapping=e,this.html=t,this.containsRTL=i,this.containsForeignElements=n}}function bx(s){const e=new l0(1e4),t=m1(s,e);return new $ce(t.characterMapping,e.build(),t.containsRTL,t.containsForeignElements)}class jce{constructor(e,t,i,n,o,r,a,l,d,c,u,h,g,f,m,_){this.fontIsMonospace=e,this.canUseHalfwidthRightwardsArrow=t,this.lineContent=i,this.len=n,this.isOverflowing=o,this.overflowingCharCount=r,this.parts=a,this.containsForeignElements=l,this.fauxIndentLength=d,this.tabSize=c,this.startVisibleColumn=u,this.containsRTL=h,this.spaceWidth=g,this.renderSpaceCharCode=f,this.renderWhitespace=m,this.renderControlCharacters=_}}function Kce(s){const e=s.lineContent;let t,i,n;s.stopRenderingLineAfter!==-1&&s.stopRenderingLineAfter0){for(let a=0,l=s.lineDecorations.length;a0&&(o[r++]=new Tn(i,"",0,!1));let a=i;for(let l=0,d=t.getCount();l=n){const g=e?d_(s.substring(a,n)):!1;o[r++]=new Tn(n,u,0,g);break}const h=e?d_(s.substring(a,c)):!1;o[r++]=new Tn(c,u,0,h),a=c}return o}function Gce(s,e,t){let i=0;const n=[];let o=0;if(t)for(let r=0,a=e.length;r=50&&(n[o++]=new Tn(g+1,c,u,h),f=g+1,g=-1);f!==d&&(n[o++]=new Tn(d,c,u,h))}else n[o++]=l;i=d}else for(let r=0,a=e.length;r50){const u=l.type,h=l.metadata,g=l.containsRTL,f=Math.ceil(c/50);for(let m=1;m=8234&&s<=8238||s>=8294&&s<=8297||s>=8206&&s<=8207||s===1564}function Zce(s,e){const t=[];let i=new Tn(0,"",0,!1),n=0;for(const o of e){const r=o.endIndex;for(;ni.endIndex&&(i=new Tn(n,o.type,o.metadata,o.containsRTL),t.push(i)),i=new Tn(n+1,"mtkcontrol",o.metadata,!1),t.push(i))}n>i.endIndex&&(i=new Tn(r,o.type,o.metadata,o.containsRTL),t.push(i))}return t}function Xce(s,e,t,i){const n=s.continuesWithWrappedLine,o=s.fauxIndentLength,r=s.tabSize,a=s.startVisibleColumn,l=s.useMonospaceOptimizations,d=s.selectionsOnLine,c=s.renderWhitespace===1,u=s.renderWhitespace===3,h=s.renderSpaceWidth!==s.spaceWidth,g=[];let f=0,m=0,_=i[m].type,v=i[m].containsRTL,b=i[m].endIndex;const C=i.length;let w=!1,y=Cs(e),D;y===-1?(w=!0,y=t,D=t):D=Ya(e);let L=!1,k=0,I=d&&d[k],O=a%r;for(let P=o;P=I.endOffset&&(k++,I=d&&d[k]);let V;if(PD)V=!0;else if(F===9)V=!0;else if(F===32)if(c)if(L)V=!0;else{const U=P+1P),V&&u&&(V=w||P>D),V&&v&&P>=y&&P<=D&&(V=!1),L){if(!V||!l&&O>=r){if(h){const U=f>0?g[f-1].endIndex:o;for(let J=U+1;J<=P;J++)g[f++]=new Tn(J,"mtkw",1,!1)}else g[f++]=new Tn(P,"mtkw",1,!1);O=O%r}}else(P===b||V&&P>o)&&(g[f++]=new Tn(P,_,0,v),O=O%r);for(F===9?O=r:Dh(F)?O+=2:O++,L=V;P===b&&(m++,m0?e.charCodeAt(t-1):0,F=t>1?e.charCodeAt(t-2):0;P===32&&F!==32&&F!==9||(R=!0)}else R=!0;if(R)if(h){const P=f>0?g[f-1].endIndex:o;for(let F=P+1;F<=t;F++)g[f++]=new Tn(F,"mtkw",1,!1)}else g[f++]=new Tn(t,"mtkw",1,!1);else g[f++]=new Tn(t,_,0,v);return g}function Yce(s,e,t,i){i.sort(Os.compare);const n=Uce.normalize(s,i),o=n.length;let r=0;const a=[];let l=0,d=0;for(let u=0,h=t.length;ud&&(d=b.startOffset,a[l++]=new Tn(d,m,_,v)),b.endOffset+1<=f)d=b.endOffset+1,a[l++]=new Tn(d,m+" "+b.className,_|b.metadata,v),r++;else{d=f,a[l++]=new Tn(d,m+" "+b.className,_|b.metadata,v);break}}f>d&&(d=f,a[l++]=new Tn(d,m,_,v))}const c=t[t.length-1].endIndex;if(r'):e.appendString("");for(let I=0,O=d.length;I=c&&(We+=ve)}}for(J&&(e.appendString(' style="width:'),e.appendString(String(f*De)),e.appendString('px"')),e.appendASCIICharCode(62);w1?e.appendCharCode(8594):e.appendCharCode(65515);for(let ve=2;ve<=ye;ve++)e.appendCharCode(160)}else We=2,ye=1,e.appendCharCode(m),e.appendCharCode(8204);D+=We,L+=ye,w>=c&&(y+=ye)}}else for(e.appendASCIICharCode(62);w=c&&(y+=We)}pe?k++:k=0,w>=r&&!C&&R.isPseudoAfter()&&(C=!0,b.setColumnInfo(w+1,I,D,L)),e.appendString("")}return C||b.setColumnInfo(r+1,d.length-1,D,L),a&&(e.appendString(''),e.appendString(p("showMore","Show more ({0})",eue(l))),e.appendString("")),e.appendString(""),new wA(b,g,n)}function Jce(s){return s.toString(16).toUpperCase().padStart(4,"0")}function eue(s){return s<1024?p("overflow.chars","{0} chars",s):s<1024*1024?`${(s/1024).toFixed(1)} KB`:`${(s/1024/1024).toFixed(1)} MB`}class _B{constructor(e,t,i,n){this._viewportBrand=void 0,this.top=e|0,this.left=t|0,this.width=i|0,this.height=n|0}}class tue{constructor(e,t){this.tabSize=e,this.data=t}}class EF{constructor(e,t,i,n,o,r,a){this._viewLineDataBrand=void 0,this.content=e,this.continuesWithWrappedLine=t,this.minColumn=i,this.maxColumn=n,this.startVisibleColumn=o,this.tokens=r,this.inlineDecorations=a}}class lr{constructor(e,t,i,n,o,r,a,l,d,c){this.minColumn=e,this.maxColumn=t,this.content=i,this.continuesWithWrappedLine=n,this.isBasicASCII=lr.isBasicASCII(i,r),this.containsRTL=lr.containsRTL(i,this.isBasicASCII,o),this.tokens=a,this.inlineDecorations=l,this.tabSize=d,this.startVisibleColumn=c}static isBasicASCII(e,t){return t?c1(e):!0}static containsRTL(e,t,i){return!t&&i?d_(e):!1}}class $v{constructor(e,t,i){this.range=e,this.inlineClassName=t,this.type=i}}class iue{constructor(e,t,i,n){this.startOffset=e,this.endOffset=t,this.inlineClassName=i,this.inlineClassNameAffectsLetterSpacing=n}toInlineDecoration(e){return new $v(new x(e,this.startOffset+1,e,this.endOffset+1),this.inlineClassName,this.inlineClassNameAffectsLetterSpacing?3:0)}}class CU{constructor(e,t){this._viewModelDecorationBrand=void 0,this.range=e,this.options=t}}class $b{constructor(e,t,i){this.color=e,this.zIndex=t,this.data=i}static compareByRenderingProps(e,t){return e.zIndex===t.zIndex?e.colort.color?1:0:e.zIndex-t.zIndex}static equals(e,t){return e.color===t.color&&e.zIndex===t.zIndex&&Ci(e.data,t.data)}static equalsArr(e,t){return Ci(e,t,$b.equals)}}function nue(s){return Array.isArray(s)}function sue(s){return!nue(s)}function wU(s){return typeof s=="string"}function vB(s){return!wU(s)}function Og(s){return!s}function Tc(s,e){return s.ignoreCase&&e?e.toLowerCase():e}function bB(s){return s.replace(/[&<>'"_]/g,"-")}function oue(s,e){console.log(`${s.languageId}: ${e}`)}function ai(s,e){return new Error(`${s.languageId}: ${e}`)}function Tu(s,e,t,i,n){const o=/\$((\$)|(#)|(\d\d?)|[sS](\d\d?)|@(\w+))/g;let r=null;return e.replace(o,function(a,l,d,c,u,h,g,f,m){return Og(d)?Og(c)?!Og(u)&&u0;){const i=s.tokenizer[t];if(i)return i;const n=t.lastIndexOf(".");n<0?t=null:t=t.substr(0,n)}return null}function aue(s,e){let t=e;for(;t&&t.length>0;){if(s.stateNames[t])return!0;const n=t.lastIndexOf(".");n<0?t=null:t=t.substr(0,n)}return!1}var lue=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},due=function(s,e){return function(t,i){e(t,i,s)}},yA;const yU=5;class jb{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)}}jb._INSTANCE=new jb(yU);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 jb.create(this,e)}pop(){return this.parent}popall(){let e=this;for(;e.parent;)e=e.parent;return e}switchTo(e){return jb.create(this.parent,e)}}class sm{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 sm(this.languageId,this.state)}}class Nu{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 jv(e,t);if(e!==null&&e.depth>=this._maxCacheDepth)return new jv(e,t);const i=Mm.getStackElementId(e);let n=this._entries[i];return n||(n=new jv(e,null),this._entries[i]=n,n)}}Nu._INSTANCE=new Nu(yU);class jv{constructor(e,t){this.stack=e,this.embeddedLanguageData=t}clone(){return(this.embeddedLanguageData?this.embeddedLanguageData.clone():null)===this.embeddedLanguageData?this:Nu.create(this.stack,this.embeddedLanguageData)}equals(e){return!(e instanceof jv)||!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 cue{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 Ib(e,t,this._languageId)))}nestedLanguageTokenize(e,t,i,n){const o=i.languageId,r=i.state,a=Ki.get(o);if(!a)return this.enterLanguage(o),this.emit(n,""),r;const l=a.tokenize(e,t,r);if(n!==0)for(const d of l.tokens)this._tokens.push(new Ib(d.offset+n,d.type,d.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 ZP(this._tokens,e)}}class eD{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,o=t.length,r=i!==null?i.length:0;if(n===0&&o===0&&r===0)return new Uint32Array(0);if(n===0&&o===0)return i;if(o===0&&r===0)return e;const a=new Uint32Array(n+o+r);e!==null&&a.set(e);for(let l=0;l{if(r)return;let l=!1;for(let d=0,c=a.changedLanguages.length;d{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=Ki.get(t);if(i){if(i instanceof yA){const n=i.getLoadStatus();n.loaded===!1&&e.push(n.promise)}continue}Ki.isResolved(t)||e.push(Ki.getOrCreate(t))}return e.length===0?{loaded:!0}:{loaded:!1,promise:Promise.all(e).then(t=>{})}}getInitialState(){const e=jb.create(null,this._lexer.start);return Nu.create(e,null)}tokenize(e,t,i){if(e.length>=this._maxTokenizationLineLength)return mU(this._languageId,i);const n=new cue,o=this._tokenize(e,t,i,n);return n.finalize(o)}tokenizeEncoded(e,t,i){if(e.length>=this._maxTokenizationLineLength)return xF(this._languageService.languageIdCodec.encodeLanguageId(this._languageId),i);const n=new eD(this._languageService,this._standaloneThemeService.getColorTheme().tokenTheme),o=this._tokenize(e,t,i,n);return n.finalize(o)}_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=vw(this._lexer,t.stack.state),!i))throw ai(this._lexer,"tokenizer state is not defined: "+t.stack.state);let n=-1,o=!1;for(const r of i){if(!vB(r.action)||r.action.nextEmbedded!=="@pop")continue;o=!0;let a=r.resolveRegex(t.stack.state);const l=a.source;if(l.substr(0,4)==="^(?:"&&l.substr(l.length-1,1)===")"){const c=(a.ignoreCase?"i":"")+(a.unicode?"u":"");a=new RegExp(l.substr(4,l.length-5),c)}const d=e.search(a);d===-1||d!==0&&r.matchOnlyAtLineStart||(n===-1||d0&&o.nestedLanguageTokenize(a,!1,i.embeddedLanguageData,n);const l=e.substring(r);return this._myTokenize(l,t,i,n+r,o)}_safeRuleName(e){return e?e.name:"(unknown)"}_myTokenize(e,t,i,n,o){o.enterLanguage(this._languageId);const r=e.length,a=t&&this._lexer.includeLF?e+` `:e,l=a.length;let d=i.embeddedLanguageData,c=i.stack,u=0,h=null,g=!0;for(;g||u=l)break;g=!1;let I=this._lexer.tokenizer[v];if(!I&&(I=vw(this._lexer,v),!I))throw ai(this._lexer,"tokenizer state is not defined: "+v);const O=a.substr(u);for(const R of I)if((u===0||!R.matchOnlyAtLineStart)&&(b=O.match(R.resolveRegex(v)),b)){C=b[0],w=R.action;break}}if(b||(b=[""],C=""),w||(u=this._lexer.maxStack)throw ai(this._lexer,"maximum tokenizer stack size reached: ["+c.state+","+c.parent.state+",...]");c=c.push(v)}else if(w.next==="@pop"){if(c.depth<=1)throw ai(this._lexer,"trying to pop an empty stack in rule: "+this._safeRuleName(y));c=c.pop()}else if(w.next==="@popall")c=c.popall();else{let I=Tu(this._lexer,w.next,C,b,v);if(I[0]==="@"&&(I=I.substr(1)),vw(this._lexer,I))c=c.push(I);else throw ai(this._lexer,"trying to set a next state '"+I+"' that is undefined in rule: "+this._safeRuleName(y))}}w.log&&typeof w.log=="string"&&oue(this._lexer,this._lexer.languageId+": "+Tu(this._lexer,w.log,C,b,v))}if(L===null)throw ai(this._lexer,"lexer rule has no well-defined action in rule: "+this._safeRuleName(y));const k=I=>{const O=this._languageService.getLanguageIdByLanguageName(I)||this._languageService.getLanguageIdByMimeType(I)||I,R=this._getNestedEmbeddedLanguageData(O);if(u0)throw ai(this._lexer,"groups cannot be nested: "+this._safeRuleName(y));if(b.length!==L.length+1)throw ai(this._lexer,"matched number of groups does not match the number of actions in rule: "+this._safeRuleName(y));let I=0;for(let O=1;Os});class IF{static colorizeElement(e,t,i,n){n=n||{};const o=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(o);const l=i.firstChild?i.firstChild.nodeValue:"";i.className+=" "+o;const d=c=>{var u;const h=(u=lI==null?void 0:lI.createHTML(c))!==null&&u!==void 0?u:c;i.innerHTML=h};return this.colorize(t,l||"",a,n).then(d,c=>console.error(c))}static async colorize(e,t,i,n){const o=e.languageIdCodec;let r=4;n&&typeof n.tabSize=="number"&&(r=n.tabSize),iF(t)&&(t=t.substr(1));const a=Td(t);if(!e.isRegisteredLanguageId(i))return CB(a,r,o);const l=await Ki.getOrCreate(i);return l?hue(a,r,l,o):CB(a,r,o)}static colorizeLine(e,t,i,n,o=4){const r=lr.isBasicASCII(e,t),a=lr.containsRTL(e,r,i);return bx(new tg(!1,!0,e,!1,r,a,0,n,[],o,0,0,0,0,-1,"none",!1,!1,null)).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 hue(s,e,t,i){return new Promise((n,o)=>{const r=()=>{const a=gue(s,e,t,i);if(t instanceof Kb){const l=t.getLoadStatus();if(l.loaded===!1){l.promise.then(r,o);return}}n(a)};r()})}function CB(s,e,t){let i=[];const o=new Uint32Array(2);o[0]=0,o[1]=33587200;for(let r=0,a=s.length;r")}return i.join("")}function gue(s,e,t,i){let n=[],o=t.getInitialState();for(let r=0,a=s.length;r"),o=d.endState}return n.join("")}const wB=2e4;let Bg,Uy,SA,$y,DA;function fue(s){Bg=document.createElement("div"),Bg.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"),Bg.appendChild(i),i};Uy=e(),SA=e();const t=()=>{const i=document.createElement("div");return i.className="monaco-status",i.setAttribute("aria-live","polite"),i.setAttribute("aria-atomic","true"),Bg.appendChild(i),i};$y=t(),DA=t(),s.appendChild(Bg)}function fo(s){Bg&&(Uy.textContent!==s?(zn(SA),tD(Uy,s)):(zn(Uy),tD(SA,s)))}function Uc(s){Bg&&($y.textContent!==s?(zn(DA),tD($y,s)):(zn($y),tD(DA,s)))}function tD(s,e){zn(s),e.length>wB&&(e=e.substr(0,wB)),s.textContent=e,s.style.visibility="hidden",s.style.visibility="visible"}const TF=ut("markerDecorationsService");var pue=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},mue=function(s,e){return function(t,i){e(t,i,s)}};let qb=class{constructor(e,t){}dispose(){}};qb.ID="editor.contrib.markerDecorations";qb=pue([mue(1,TF)],qb);kt(qb.ID,qb,0);class SU extends H{constructor(e,t){super(),this._onDidChange=this._register(new B),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 o=()=>{if(i&&!n)try{i=!1,n=!0,t()}finally{Ao(Te(this._referenceDomElement),()=>{n=!1,o()})}};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,o()}),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 ah{constructor(e,t){this.key=e,this.migrate=t}apply(e){const t=ah._read(e,this.key),i=o=>ah._read(e,o),n=(o,r)=>ah._write(e,o,r);this.migrate(t,i,n)}static _read(e,t){if(typeof e>"u")return;const i=t.indexOf(".");if(i>=0){const n=t.substring(0,i);return this._read(e[n],t.substring(i+1))}return e[t]}static _write(e,t,i){const n=t.indexOf(".");if(n>=0){const o=t.substring(0,n);e[o]=e[o]||{},this._write(e[o],t.substring(n+1),i);return}e[t]=i}}ah.items=[];function ml(s,e){ah.items.push(new ah(s,e))}function Po(s,e){ml(s,(t,i,n)=>{if(typeof t<"u"){for(const[o,r]of e)if(t===o){n(s,r);return}}})}function _ue(s){ah.items.forEach(e=>e.apply(s))}Po("wordWrap",[[!0,"on"],[!1,"off"]]);Po("lineNumbers",[[!0,"on"],[!1,"off"]]);Po("cursorBlinking",[["visible","solid"]]);Po("renderWhitespace",[[!0,"boundary"],[!1,"none"]]);Po("renderLineHighlight",[[!0,"line"],[!1,"none"]]);Po("acceptSuggestionOnEnter",[[!0,"on"],[!1,"off"]]);Po("tabCompletion",[[!1,"off"],[!0,"onlySnippets"]]);Po("hover",[[!0,{enabled:!0}],[!1,{enabled:!1}]]);Po("parameterHints",[[!0,{enabled:!0}],[!1,{enabled:!1}]]);Po("autoIndent",[[!1,"advanced"],[!0,"full"]]);Po("matchBrackets",[[!0,"always"],[!1,"never"]]);Po("renderFinalNewline",[[!0,"on"],[!1,"off"]]);Po("cursorSmoothCaretAnimation",[[!0,"on"],[!1,"off"]]);Po("occurrencesHighlight",[[!0,"singleFile"],[!1,"off"]]);Po("wordBasedSuggestions",[[!0,"matchingDocuments"],[!1,"off"]]);ml("autoClosingBrackets",(s,e,t)=>{s===!1&&(t("autoClosingBrackets","never"),typeof e("autoClosingQuotes")>"u"&&t("autoClosingQuotes","never"),typeof e("autoSurround")>"u"&&t("autoSurround","never"))});ml("renderIndentGuides",(s,e,t)=>{typeof s<"u"&&(t("renderIndentGuides",void 0),typeof e("guides.indentation")>"u"&&t("guides.indentation",!!s))});ml("highlightActiveIndentGuide",(s,e,t)=>{typeof s<"u"&&(t("highlightActiveIndentGuide",void 0),typeof e("guides.highlightActiveIndentation")>"u"&&t("guides.highlightActiveIndentation",!!s))});const vue={method:"showMethods",function:"showFunctions",constructor:"showConstructors",deprecated:"showDeprecated",field:"showFields",variable:"showVariables",class:"showClasses",struct:"showStructs",interface:"showInterfaces",module:"showModules",property:"showProperties",event:"showEvents",operator:"showOperators",unit:"showUnits",value:"showValues",constant:"showConstants",enum:"showEnums",enumMember:"showEnumMembers",keyword:"showKeywords",text:"showWords",color:"showColors",file:"showFiles",reference:"showReferences",folder:"showFolders",typeParameter:"showTypeParameters",snippet:"showSnippets"};ml("suggest.filteredTypes",(s,e,t)=>{if(s&&typeof s=="object"){for(const i of Object.entries(vue))s[i[0]]===!1&&typeof e(`suggest.${i[1]}`)>"u"&&t(`suggest.${i[1]}`,!1);t("suggest.filteredTypes",void 0)}});ml("quickSuggestions",(s,e,t)=>{if(typeof s=="boolean"){const i=s?"on":"off";t("quickSuggestions",{comments:i,strings:i,other:i})}});ml("experimental.stickyScroll.enabled",(s,e,t)=>{typeof s=="boolean"&&(t("experimental.stickyScroll.enabled",void 0),typeof e("stickyScroll.enabled")>"u"&&t("stickyScroll.enabled",s))});ml("experimental.stickyScroll.maxLineCount",(s,e,t)=>{typeof s=="number"&&(t("experimental.stickyScroll.maxLineCount",void 0),typeof e("stickyScroll.maxLineCount")>"u"&&t("stickyScroll.maxLineCount",s))});ml("codeActionsOnSave",(s,e,t)=>{if(s&&typeof s=="object"){let i=!1;const n={};for(const o of Object.entries(s))typeof o[1]=="boolean"?(i=!0,n[o[0]]=o[1]?"explicit":"never"):n[o[0]]=o[1];i&&t("codeActionsOnSave",n)}});ml("codeActionWidget.includeNearbyQuickfixes",(s,e,t)=>{typeof s=="boolean"&&(t("codeActionWidget.includeNearbyQuickfixes",void 0),typeof e("codeActionWidget.includeNearbyQuickFixes")>"u"&&t("codeActionWidget.includeNearbyQuickFixes",s))});ml("lightbulb.enabled",(s,e,t)=>{typeof s=="boolean"&&t("lightbulb.enabled",s?void 0:"off")});class bue{constructor(){this._tabFocus=!1,this._onDidChangeTabFocus=new B,this.onDidChangeTabFocus=this._onDidChangeTabFocus.event}getTabFocusMode(){return this._tabFocus}setTabFocusMode(e){this._tabFocus=e,this._onDidChangeTabFocus.fire(this._tabFocus)}}const p_=new bue,gr=ut("accessibilityService"),_1=new ue("accessibilityModeEnabled",!1);var Cue=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},wue=function(s,e){return function(t,i){e(t,i,s)}};let LA=class extends H{constructor(e,t,i,n,o){super(),this._accessibilityService=o,this._onDidChange=this._register(new B),this.onDidChange=this._onDidChange.event,this._onDidChangeFast=this._register(new B),this.onDidChangeFast=this._onDidChangeFast.event,this._isDominatedByLongLines=!1,this._viewLineCount=1,this._lineNumbersDigitCount=1,this._reservedHeight=0,this._glyphMarginDecorationLaneCount=1,this._computeOptionsMemory=new VV,this.isSimpleWidget=e,this.contextMenuId=t,this._containerObserver=this._register(new SU(n,i.dimension)),this._targetWindowId=Te(n).vscodeWindowId,this._rawOptions=yB(i),this._validatedOptions=Au.validateOptions(this._rawOptions),this.options=this._computeOptions(),this.options.get(13)&&this._containerObserver.startObserving(),this._register(Sr.onDidChangeZoomLevel(()=>this._recomputeOptions())),this._register(p_.onDidChangeTabFocus(()=>this._recomputeOptions())),this._register(this._containerObserver.onDidChange(()=>this._recomputeOptions())),this._register(aA.onDidChange(()=>this._recomputeOptions())),this._register(Ob.getInstance(Te(n)).onDidChange(()=>this._recomputeOptions())),this._register(this._accessibilityService.onDidChangeScreenReaderOptimized(()=>this._recomputeOptions()))}_recomputeOptions(){const e=this._computeOptions(),t=Au.checkEquals(this.options,e);t!==null&&(this.options=e,this._onDidChangeFast.fire(t),this._onDidChange.fire(t))}_computeOptions(){const e=this._readEnvConfiguration(),t=rf.createFromValidatedSettings(this._validatedOptions,e.pixelRatio,this.isSimpleWidget),i=this._readFontInfo(t),n={memory:this._computeOptionsMemory,outerWidth:e.outerWidth,outerHeight:e.outerHeight-this._reservedHeight,fontInfo:i,extraEditorClassName:e.extraEditorClassName,isDominatedByLongLines:this._isDominatedByLongLines,viewLineCount:this._viewLineCount,lineNumbersDigitCount:this._lineNumbersDigitCount,emptySelectionClipboard:e.emptySelectionClipboard,pixelRatio:e.pixelRatio,tabFocusMode:p_.getTabFocusMode(),accessibilitySupport:e.accessibilitySupport,glyphMarginDecorationLaneCount:this._glyphMarginDecorationLaneCount};return Au.computeOptions(this._validatedOptions,n)}_readEnvConfiguration(){return{extraEditorClassName:Sue(),outerWidth:this._containerObserver.getWidth(),outerHeight:this._containerObserver.getHeight(),emptySelectionClipboard:GL||Fr,pixelRatio:Ob.getInstance(C3(this._targetWindowId,!0).window).value,accessibilitySupport:this._accessibilityService.isScreenReaderOptimized()?2:this._accessibilityService.getAccessibilitySupport()}}_readFontInfo(e){return aA.readFontInfo(C3(this._targetWindowId,!0).window,e)}getRawOptions(){return this._rawOptions}updateOptions(e){const t=yB(e);Au.applyUpdate(this._rawOptions,t)&&(this._validatedOptions=Au.validateOptions(this._rawOptions),this._recomputeOptions())}observeContainer(e){this._containerObserver.observe(e)}setIsDominatedByLongLines(e){this._isDominatedByLongLines!==e&&(this._isDominatedByLongLines=e,this._recomputeOptions())}setModelLineCount(e){const t=yue(e);this._lineNumbersDigitCount!==t&&(this._lineNumbersDigitCount=t,this._recomputeOptions())}setViewLineCount(e){this._viewLineCount!==e&&(this._viewLineCount=e,this._recomputeOptions())}setReservedHeight(e){this._reservedHeight!==e&&(this._reservedHeight=e,this._recomputeOptions())}setGlyphMarginDecorationLaneCount(e){this._glyphMarginDecorationLaneCount!==e&&(this._glyphMarginDecorationLaneCount=e,this._recomputeOptions())}};LA=Cue([wue(4,gr)],LA);function yue(s){let e=0;for(;s;)s=Math.floor(s/10),e++;return e||1}function Sue(){let s="";return!Lh&&!hz&&(s+="no-user-select "),Lh&&(s+="no-minimap-shadow ",s+="enable-user-select "),lt&&(s+="mac "),s}class Due{constructor(){this._values=[]}_read(e){return this._values[e]}get(e){return this._values[e]}_write(e,t){this._values[e]=t}}class Lue{constructor(){this._values=[]}_read(e){if(e>=this._values.length)throw new Error("Cannot read uninitialized value");return this._values[e]}get(e){return this._read(e)}_write(e,t){this._values[e]=t}}class Au{static validateOptions(e){const t=new Due;for(const i of Jp){const n=i.name==="_never_"?void 0:e[i.name];t._write(i.id,i.validate(n))}return t}static computeOptions(e,t){const i=new Lue;for(const n of Jp)i._write(n.id,n.compute(t,i,e._read(n.id)));return i}static _deepEquals(e,t){if(typeof e!="object"||typeof t!="object"||!e||!t)return e===t;if(Array.isArray(e)||Array.isArray(t))return Array.isArray(e)&&Array.isArray(t)?Ci(e,t):!1;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const i in e)if(!Au._deepEquals(e[i],t[i]))return!1;return!0}static checkEquals(e,t){const i=[];let n=!1;for(const o of Jp){const r=!Au._deepEquals(e._read(o.id),t._read(o.id));i[o.id]=r,r&&(n=!0)}return n?new HV(i):null}static applyUpdate(e,t){let i=!1;for(const n of Jp)if(t.hasOwnProperty(n.name)){const o=n.applyUpdate(e[n.name],t[n.name]);e[n.name]=o.newValue,i=i||o.didChange}return i}}function yB(s){const e=Jd(s);return _ue(e),e}var Hu;(function(s){const e={total:0,min:Number.MAX_VALUE,max:0},t={...e},i={...e},n={...e};let o=0;const r={keydown:0,input:0,render:0};function a(){v(),performance.mark("inputlatency/start"),performance.mark("keydown/start"),r.keydown=1,queueMicrotask(l)}s.onKeyDown=a;function l(){r.keydown===1&&(performance.mark("keydown/end"),r.keydown=2)}function d(){performance.mark("input/start"),r.input=1,_()}s.onBeforeInput=d;function c(){r.input===0&&d(),queueMicrotask(u)}s.onInput=c;function u(){r.input===1&&(performance.mark("input/end"),r.input=2)}function h(){v()}s.onKeyUp=h;function g(){v()}s.onSelectionChange=g;function f(){r.keydown===2&&r.input===2&&r.render===0&&(performance.mark("render/start"),r.render=1,queueMicrotask(m),_())}s.onRenderStart=f;function m(){r.render===1&&(performance.mark("render/end"),r.render=2)}function _(){setTimeout(v)}function v(){r.keydown===2&&r.input===2&&r.render===2&&(performance.mark("inputlatency/end"),performance.measure("keydown","keydown/start","keydown/end"),performance.measure("input","input/start","input/end"),performance.measure("render","render/start","render/end"),performance.measure("inputlatency","inputlatency/start","inputlatency/end"),b("keydown",e),b("input",t),b("render",i),b("inputlatency",n),o++,C())}function b(L,k){const I=performance.getEntriesByName(L)[0].duration;k.total+=I,k.min=Math.min(k.min,I),k.max=Math.max(k.max,I)}function C(){performance.clearMarks("keydown/start"),performance.clearMarks("keydown/end"),performance.clearMarks("input/start"),performance.clearMarks("input/end"),performance.clearMarks("render/start"),performance.clearMarks("render/end"),performance.clearMarks("inputlatency/start"),performance.clearMarks("inputlatency/end"),performance.clearMeasures("keydown"),performance.clearMeasures("input"),performance.clearMeasures("render"),performance.clearMeasures("inputlatency"),r.keydown=0,r.input=0,r.render=0}function w(){if(o===0)return;const L={keydown:y(e),input:y(t),render:y(i),total:y(n),sampleCount:o};return D(e),D(t),D(i),D(n),o=0,L}s.getAndClearMeasurements=w;function y(L){return{average:L.total/o,max:L.max,min:L.min}}function D(L){L.total=0,L.min=Number.MAX_VALUE,L.max=0}})(Hu||(Hu={}));class c0{constructor(){this._hooks=new Y,this._pointerMoveCallback=null,this._onStopCallback=null}dispose(){this.stopMonitoring(!1),this._hooks.dispose()}stopMonitoring(e,t){if(!this.isMonitoring())return;this._hooks.clear(),this._pointerMoveCallback=null;const i=this._onStopCallback;this._onStopCallback=null,e&&i&&i(t)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(e,t,i,n,o){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=n,this._onStopCallback=o;let r=e;try{e.setPointerCapture(t),this._hooks.add(Ie(()=>{try{e.releasePointerCapture(t)}catch{}}))}catch{r=Te(e)}this._hooks.add(K(r,ee.POINTER_MOVE,a=>{if(a.buttons!==i){this.stopMonitoring(!0);return}a.preventDefault(),this._pointerMoveCallback(a)})),this._hooks.add(K(r,ee.POINTER_UP,a=>this.stopMonitoring(!0)))}}function NF(s){return`--vscode-${s.replace(/\./g,"-")}`}function fe(s){return`var(${NF(s)})`}function xue(s,e){return`var(${NF(s)}, ${e})`}const DU={ColorContribution:"base.contributions.colors"};class kue{constructor(){this._onDidChangeSchema=new B,this.onDidChangeSchema=this._onDidChangeSchema.event,this.colorSchema={type:"object",properties:{}},this.colorReferenceSchema={type:"string",enum:[],enumDescriptions:[]},this.colorsById={}}registerColor(e,t,i,n=!1,o){const r={id:e,description:i,defaults:t,needsTransparency:n,deprecationMessage:o};this.colorsById[e]=r;const a={type:"string",description:i,format:"color-hex",defaultSnippets:[{body:"${1:#ff0000}"}]};return o&&(a.deprecationMessage=o),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="This color must be transparent or it will obscure content"),this.colorSchema.properties[e]=a,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&&i.defaults){const n=i.defaults[t.type];return Na(n,t)}}getColorSchema(){return this.colorSchema}toString(){const e=(t,i)=>{const n=t.indexOf(".")===-1?0:1,o=i.indexOf(".")===-1?0:1;return n!==o?n-o:t.localeCompare(i)};return Object.keys(this.colorsById).sort(e).map(t=>`- \`${t}\`: ${this.colorsById[t].description}`).join(` `)}}const Cx=new kue;Ji.add(DU.ColorContribution,Cx);function N(s,e,t,i,n){return Cx.registerColor(s,e,t,i,n)}function Eue(s,e){var t,i,n,o;switch(s.op){case 0:return(t=Na(s.value,e))===null||t===void 0?void 0:t.darken(s.factor);case 1:return(i=Na(s.value,e))===null||i===void 0?void 0:i.lighten(s.factor);case 2:return(n=Na(s.value,e))===null||n===void 0?void 0:n.transparent(s.factor);case 3:{const r=Na(s.background,e);return r?(o=Na(s.value,e))===null||o===void 0?void 0:o.makeOpaque(r):Na(s.value,e)}case 4:for(const r of s.values){const a=Na(r,e);if(a)return a}return;case 6:return Na(e.defines(s.if)?s.then:s.else,e);case 5:{const r=Na(s.value,e);if(!r)return;const a=Na(s.background,e);return a?r.isDarkerThan(a)?$.getLighterColor(r,a,s.factor).transparent(s.transparency):$.getDarkerColor(r,a,s.factor).transparent(s.transparency):r.transparent(s.factor*s.transparency)}default:throw ux()}}function ap(s,e){return{op:0,value:s,factor:e}}function Ja(s,e){return{op:1,value:s,factor:e}}function Ee(s,e){return{op:2,value:s,factor:e}}function Gb(...s){return{op:4,values:s}}function Iue(s,e,t){return{op:6,if:s,then:e,else:t}}function SB(s,e,t,i){return{op:5,value:s,background:e,factor:t,transparency:i}}function Na(s,e){if(s!==null){if(typeof s=="string")return s[0]==="#"?$.fromHex(s):e.getColor(s);if(s instanceof $)return s;if(typeof s=="object")return Eue(s,e)}}const LU="vscode://schemas/workbench-colors",xU=Ji.as(vx.JSONContribution);xU.registerSchema(LU,Cx.getColorSchema());const DB=new Wt(()=>xU.notifySchemaChanged(LU),200);Cx.onDidChangeSchema(()=>{DB.isScheduled()||DB.schedule()});const ae=N("foreground",{dark:"#CCCCCC",light:"#616161",hcDark:"#FFFFFF",hcLight:"#292929"},p("foreground","Overall foreground color. This color is only used if not overridden by a component."));N("disabledForeground",{dark:"#CCCCCC80",light:"#61616180",hcDark:"#A5A5A5",hcLight:"#7F7F7F"},p("disabledForeground","Overall foreground for disabled elements. This color is only used if not overridden by a component."));N("errorForeground",{dark:"#F48771",light:"#A1260D",hcDark:"#F48771",hcLight:"#B5200D"},p("errorForeground","Overall foreground color for error messages. This color is only used if not overridden by a component."));N("descriptionForeground",{light:"#717171",dark:Ee(ae,.7),hcDark:Ee(ae,.7),hcLight:Ee(ae,.7)},p("descriptionForeground","Foreground color for description text providing additional information, for example for a label."));const Ql=N("icon.foreground",{dark:"#C5C5C5",light:"#424242",hcDark:"#FFFFFF",hcLight:"#292929"},p("iconForeground","The default color for icons in the workbench.")),Ir=N("focusBorder",{dark:"#007FD4",light:"#0090F1",hcDark:"#F38518",hcLight:"#006BBD"},p("focusBorder","Overall border color for focused elements. This color is only used if not overridden by a component.")),gt=N("contrastBorder",{light:null,dark:null,hcDark:"#6FC3DF",hcLight:"#0F4A85"},p("contrastBorder","An extra border around elements to separate them from others for greater contrast.")),di=N("contrastActiveBorder",{light:null,dark:null,hcDark:Ir,hcLight:Ir},p("activeContrastBorder","An extra border around active elements to separate them from others for greater contrast."));N("selection.background",{light:null,dark:null,hcDark:null,hcLight:null},p("selectionBackground","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 Tue=N("textLink.foreground",{light:"#006AB1",dark:"#3794FF",hcDark:"#21A6FF",hcLight:"#0F4A85"},p("textLinkForeground","Foreground color for links in text."));N("textLink.activeForeground",{light:"#006AB1",dark:"#3794FF",hcDark:"#21A6FF",hcLight:"#0F4A85"},p("textLinkActiveForeground","Foreground color for links in text when clicked on and on mouse hover."));N("textSeparator.foreground",{light:"#0000002e",dark:"#ffffff2e",hcDark:$.black,hcLight:"#292929"},p("textSeparatorForeground","Color for text separators."));N("textPreformat.foreground",{light:"#A31515",dark:"#D7BA7D",hcDark:"#000000",hcLight:"#FFFFFF"},p("textPreformatForeground","Foreground color for preformatted text segments."));N("textPreformat.background",{light:"#0000001A",dark:"#FFFFFF1A",hcDark:"#FFFFFF",hcLight:"#09345f"},p("textPreformatBackground","Background color for preformatted text segments."));N("textBlockQuote.background",{light:"#f2f2f2",dark:"#222222",hcDark:null,hcLight:"#F2F2F2"},p("textBlockQuoteBackground","Background color for block quotes in text."));N("textBlockQuote.border",{light:"#007acc80",dark:"#007acc80",hcDark:$.white,hcLight:"#292929"},p("textBlockQuoteBorder","Border color for block quotes in text."));N("textCodeBlock.background",{light:"#dcdcdc66",dark:"#0a0a0a66",hcDark:$.black,hcLight:"#F2F2F2"},p("textCodeBlockBackground","Background color for code blocks in text."));N("sash.hoverBorder",{dark:Ir,light:Ir,hcDark:Ir,hcLight:Ir},p("sashActiveBorder","Border color of active sashes."));const jy=N("badge.background",{dark:"#4D4D4D",light:"#C4C4C4",hcDark:$.black,hcLight:"#0F4A85"},p("badgeBackground","Badge background color. Badges are small information labels, e.g. for search results count.")),Nue=N("badge.foreground",{dark:$.white,light:"#333",hcDark:$.white,hcLight:$.white},p("badgeForeground","Badge foreground color. Badges are small information labels, e.g. for search results count.")),gv=N("scrollbar.shadow",{dark:"#000000",light:"#DDDDDD",hcDark:null,hcLight:null},p("scrollbarShadow","Scrollbar shadow to indicate that the view is scrolled.")),fv=N("scrollbarSlider.background",{dark:$.fromHex("#797979").transparent(.4),light:$.fromHex("#646464").transparent(.4),hcDark:Ee(gt,.6),hcLight:Ee(gt,.4)},p("scrollbarSliderBackground","Scrollbar slider background color.")),pv=N("scrollbarSlider.hoverBackground",{dark:$.fromHex("#646464").transparent(.7),light:$.fromHex("#646464").transparent(.7),hcDark:Ee(gt,.8),hcLight:Ee(gt,.8)},p("scrollbarSliderHoverBackground","Scrollbar slider background color when hovering.")),mv=N("scrollbarSlider.activeBackground",{dark:$.fromHex("#BFBFBF").transparent(.4),light:$.fromHex("#000000").transparent(.6),hcDark:gt,hcLight:gt},p("scrollbarSliderActiveBackground","Scrollbar slider background color when clicked on.")),Aue=N("progressBar.background",{dark:$.fromHex("#0E70C0"),light:$.fromHex("#0E70C0"),hcDark:gt,hcLight:gt},p("progressBarBackground","Background color of the progress bar that can show for long running operations.")),Sn=N("editor.background",{light:"#ffffff",dark:"#1E1E1E",hcDark:$.black,hcLight:$.white},p("editorBackground","Editor background color.")),Tr=N("editor.foreground",{light:"#333333",dark:"#BBBBBB",hcDark:$.white,hcLight:ae},p("editorForeground","Editor default foreground color."));N("editorStickyScroll.background",{light:Sn,dark:Sn,hcDark:Sn,hcLight:Sn},p("editorStickyScrollBackground","Background color of sticky scroll in the editor"));N("editorStickyScrollHover.background",{dark:"#2A2D2E",light:"#F0F0F0",hcDark:null,hcLight:$.fromHex("#0F4A85").transparent(.1)},p("editorStickyScrollHoverBackground","Background color of sticky scroll on hover in the editor"));N("editorStickyScroll.border",{dark:null,light:null,hcDark:gt,hcLight:gt},p("editorStickyScrollBorder","Border color of sticky scroll in the editor"));N("editorStickyScroll.shadow",{dark:gv,light:gv,hcDark:gv,hcLight:gv},p("editorStickyScrollShadow"," Shadow color of sticky scroll in the editor"));const Hi=N("editorWidget.background",{dark:"#252526",light:"#F3F3F3",hcDark:"#0C141F",hcLight:$.white},p("editorWidgetBackground","Background color of editor widgets, such as find/replace.")),gc=N("editorWidget.foreground",{dark:ae,light:ae,hcDark:ae,hcLight:ae},p("editorWidgetForeground","Foreground color of editor widgets, such as find/replace.")),fc=N("editorWidget.border",{dark:"#454545",light:"#C8C8C8",hcDark:gt,hcLight:gt},p("editorWidgetBorder","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."));N("editorWidget.resizeBorder",{light:null,dark:null,hcDark:null,hcLight:null},p("editorWidgetResizeBorder","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."));N("editorError.background",{dark:null,light:null,hcDark:null,hcLight:null},p("editorError.background","Background color of error text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0);const Jl=N("editorError.foreground",{dark:"#F14C4C",light:"#E51400",hcDark:"#F48771",hcLight:"#B5200D"},p("editorError.foreground","Foreground color of error squigglies in the editor.")),Mue=N("editorError.border",{dark:null,light:null,hcDark:$.fromHex("#E47777").transparent(.8),hcLight:"#B5200D"},p("errorBorder","If set, color of double underlines for errors in the editor.")),bw=N("editorWarning.background",{dark:null,light:null,hcDark:null,hcLight:null},p("editorWarning.background","Background color of warning text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0),vs=N("editorWarning.foreground",{dark:"#CCA700",light:"#BF8803",hcDark:"#FFD370",hcLight:"#895503"},p("editorWarning.foreground","Foreground color of warning squigglies in the editor.")),Zb=N("editorWarning.border",{dark:null,light:null,hcDark:$.fromHex("#FFCC00").transparent(.8),hcLight:$.fromHex("#FFCC00").transparent(.8)},p("warningBorder","If set, color of double underlines for warnings in the editor."));N("editorInfo.background",{dark:null,light:null,hcDark:null,hcLight:null},p("editorInfo.background","Background color of info text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0);const ro=N("editorInfo.foreground",{dark:"#3794FF",light:"#1a85ff",hcDark:"#3794FF",hcLight:"#1a85ff"},p("editorInfo.foreground","Foreground color of info squigglies in the editor.")),Xb=N("editorInfo.border",{dark:null,light:null,hcDark:$.fromHex("#3794FF").transparent(.8),hcLight:"#292929"},p("infoBorder","If set, color of double underlines for infos in the editor.")),Rue=N("editorHint.foreground",{dark:$.fromHex("#eeeeee").transparent(.7),light:"#6c6c6c",hcDark:null,hcLight:null},p("editorHint.foreground","Foreground color of hint squigglies in the editor."));N("editorHint.border",{dark:null,light:null,hcDark:$.fromHex("#eeeeee").transparent(.8),hcLight:"#292929"},p("hintBorder","If set, color of double underlines for hints in the editor."));const Pue=N("editorLink.activeForeground",{dark:"#4E94CE",light:$.blue,hcDark:$.cyan,hcLight:"#292929"},p("activeLinkForeground","Color of active links.")),Vu=N("editor.selectionBackground",{light:"#ADD6FF",dark:"#264F78",hcDark:"#f3f518",hcLight:"#0F4A85"},p("editorSelectionBackground","Color of the editor selection.")),Fue=N("editor.selectionForeground",{light:null,dark:null,hcDark:"#000000",hcLight:$.white},p("editorSelectionForeground","Color of the selected text for high contrast.")),kU=N("editor.inactiveSelectionBackground",{light:Ee(Vu,.5),dark:Ee(Vu,.5),hcDark:Ee(Vu,.7),hcLight:Ee(Vu,.5)},p("editorInactiveSelection","Color of the selection in an inactive editor. The color must not be opaque so as not to hide underlying decorations."),!0),AF=N("editor.selectionHighlightBackground",{light:SB(Vu,Sn,.3,.6),dark:SB(Vu,Sn,.3,.6),hcDark:null,hcLight:null},p("editorSelectionHighlight","Color for regions with the same content as the selection. The color must not be opaque so as not to hide underlying decorations."),!0);N("editor.selectionHighlightBorder",{light:null,dark:null,hcDark:di,hcLight:di},p("editorSelectionHighlightBorder","Border color for regions with the same content as the selection."));N("editor.findMatchBackground",{light:"#A8AC94",dark:"#515C6A",hcDark:null,hcLight:null},p("editorFindMatch","Color of the current search match."));const pc=N("editor.findMatchHighlightBackground",{light:"#EA5C0055",dark:"#EA5C0055",hcDark:null,hcLight:null},p("findMatchHighlight","Color of the other search matches. The color must not be opaque so as not to hide underlying decorations."),!0);N("editor.findRangeHighlightBackground",{dark:"#3a3d4166",light:"#b4b4b44d",hcDark:null,hcLight:null},p("findRangeHighlight","Color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."),!0);N("editor.findMatchBorder",{light:null,dark:null,hcDark:di,hcLight:di},p("editorFindMatchBorder","Border color of the current search match."));const zu=N("editor.findMatchHighlightBorder",{light:null,dark:null,hcDark:di,hcLight:di},p("findMatchHighlightBorder","Border color of the other search matches.")),Oue=N("editor.findRangeHighlightBorder",{dark:null,light:null,hcDark:Ee(di,.4),hcLight:Ee(di,.4)},p("findRangeHighlightBorder","Border color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."),!0);N("editor.hoverHighlightBackground",{light:"#ADD6FF26",dark:"#264f7840",hcDark:"#ADD6FF26",hcLight:null},p("hoverHighlight","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 iD=N("editorHoverWidget.background",{light:Hi,dark:Hi,hcDark:Hi,hcLight:Hi},p("hoverBackground","Background color of the editor hover."));N("editorHoverWidget.foreground",{light:gc,dark:gc,hcDark:gc,hcLight:gc},p("hoverForeground","Foreground color of the editor hover."));const EU=N("editorHoverWidget.border",{light:fc,dark:fc,hcDark:fc,hcLight:fc},p("hoverBorder","Border color of the editor hover."));N("editorHoverWidget.statusBarBackground",{dark:Ja(iD,.2),light:ap(iD,.05),hcDark:Hi,hcLight:Hi},p("statusBarBackground","Background color of the editor hover status bar."));const mc=N("editorInlayHint.foreground",{dark:"#969696",light:"#969696",hcDark:$.white,hcLight:$.black},p("editorInlayHintForeground","Foreground color of inline hints")),_c=N("editorInlayHint.background",{dark:Ee(jy,.1),light:Ee(jy,.1),hcDark:Ee($.white,.1),hcLight:Ee(jy,.1)},p("editorInlayHintBackground","Background color of inline hints")),Bue=N("editorInlayHint.typeForeground",{dark:mc,light:mc,hcDark:mc,hcLight:mc},p("editorInlayHintForegroundTypes","Foreground color of inline hints for types")),Wue=N("editorInlayHint.typeBackground",{dark:_c,light:_c,hcDark:_c,hcLight:_c},p("editorInlayHintBackgroundTypes","Background color of inline hints for types")),Hue=N("editorInlayHint.parameterForeground",{dark:mc,light:mc,hcDark:mc,hcLight:mc},p("editorInlayHintForegroundParameter","Foreground color of inline hints for parameters")),Vue=N("editorInlayHint.parameterBackground",{dark:_c,light:_c,hcDark:_c,hcLight:_c},p("editorInlayHintBackgroundParameter","Background color of inline hints for parameters")),Cw=N("editorLightBulb.foreground",{dark:"#FFCC00",light:"#DDB100",hcDark:"#FFCC00",hcLight:"#007ACC"},p("editorLightBulbForeground","The color used for the lightbulb actions icon."));N("editorLightBulbAutoFix.foreground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},p("editorLightBulbAutoFixForeground","The color used for the lightbulb auto fix actions icon."));N("editorLightBulbAi.foreground",{dark:Cw,light:Cw,hcDark:Cw,hcLight:Cw},p("editorLightBulbAiForeground","The color used for the lightbulb AI icon."));N("editor.snippetTabstopHighlightBackground",{dark:new $(new bt(124,124,124,.3)),light:new $(new bt(10,50,100,.2)),hcDark:new $(new bt(124,124,124,.3)),hcLight:new $(new bt(10,50,100,.2))},p("snippetTabstopHighlightBackground","Highlight background color of a snippet tabstop."));N("editor.snippetTabstopHighlightBorder",{dark:null,light:null,hcDark:null,hcLight:null},p("snippetTabstopHighlightBorder","Highlight border color of a snippet tabstop."));N("editor.snippetFinalTabstopHighlightBackground",{dark:null,light:null,hcDark:null,hcLight:null},p("snippetFinalTabstopHighlightBackground","Highlight background color of the final tabstop of a snippet."));N("editor.snippetFinalTabstopHighlightBorder",{dark:"#525252",light:new $(new bt(10,50,100,.5)),hcDark:"#525252",hcLight:"#292929"},p("snippetFinalTabstopHighlightBorder","Highlight border color of the final tabstop of a snippet."));const xA=new $(new bt(155,185,85,.2)),kA=new $(new bt(255,0,0,.2)),zue=N("diffEditor.insertedTextBackground",{dark:"#9ccc2c33",light:"#9ccc2c40",hcDark:null,hcLight:null},p("diffEditorInserted","Background color for text that got inserted. The color must not be opaque so as not to hide underlying decorations."),!0),Uue=N("diffEditor.removedTextBackground",{dark:"#ff000033",light:"#ff000033",hcDark:null,hcLight:null},p("diffEditorRemoved","Background color for text that got removed. The color must not be opaque so as not to hide underlying decorations."),!0);N("diffEditor.insertedLineBackground",{dark:xA,light:xA,hcDark:null,hcLight:null},p("diffEditorInsertedLines","Background color for lines that got inserted. The color must not be opaque so as not to hide underlying decorations."),!0);N("diffEditor.removedLineBackground",{dark:kA,light:kA,hcDark:null,hcLight:null},p("diffEditorRemovedLines","Background color for lines that got removed. The color must not be opaque so as not to hide underlying decorations."),!0);N("diffEditorGutter.insertedLineBackground",{dark:null,light:null,hcDark:null,hcLight:null},p("diffEditorInsertedLineGutter","Background color for the margin where lines got inserted."));N("diffEditorGutter.removedLineBackground",{dark:null,light:null,hcDark:null,hcLight:null},p("diffEditorRemovedLineGutter","Background color for the margin where lines got removed."));const $ue=N("diffEditorOverview.insertedForeground",{dark:null,light:null,hcDark:null,hcLight:null},p("diffEditorOverviewInserted","Diff overview ruler foreground for inserted content.")),jue=N("diffEditorOverview.removedForeground",{dark:null,light:null,hcDark:null,hcLight:null},p("diffEditorOverviewRemoved","Diff overview ruler foreground for removed content."));N("diffEditor.insertedTextBorder",{dark:null,light:null,hcDark:"#33ff2eff",hcLight:"#374E06"},p("diffEditorInsertedOutline","Outline color for the text that got inserted."));N("diffEditor.removedTextBorder",{dark:null,light:null,hcDark:"#FF008F",hcLight:"#AD0707"},p("diffEditorRemovedOutline","Outline color for text that got removed."));N("diffEditor.border",{dark:null,light:null,hcDark:gt,hcLight:gt},p("diffEditorBorder","Border color between the two text editors."));N("diffEditor.diagonalFill",{dark:"#cccccc33",light:"#22222233",hcDark:null,hcLight:null},p("diffDiagonalFill","Color of the diff editor's diagonal fill. The diagonal fill is used in side-by-side diff views."));N("diffEditor.unchangedRegionBackground",{dark:"sideBar.background",light:"sideBar.background",hcDark:"sideBar.background",hcLight:"sideBar.background"},p("diffEditor.unchangedRegionBackground","The background color of unchanged blocks in the diff editor."));N("diffEditor.unchangedRegionForeground",{dark:"foreground",light:"foreground",hcDark:"foreground",hcLight:"foreground"},p("diffEditor.unchangedRegionForeground","The foreground color of unchanged blocks in the diff editor."));N("diffEditor.unchangedCodeBackground",{dark:"#74747429",light:"#b8b8b829",hcDark:null,hcLight:null},p("diffEditor.unchangedCodeBackground","The background color of unchanged code in the diff editor."));const vc=N("widget.shadow",{dark:Ee($.black,.36),light:Ee($.black,.16),hcDark:null,hcLight:null},p("widgetShadow","Shadow color of widgets such as find/replace inside the editor.")),IU=N("widget.border",{dark:null,light:null,hcDark:gt,hcLight:gt},p("widgetBorder","Border color of widgets such as find/replace inside the editor.")),LB=N("toolbar.hoverBackground",{dark:"#5a5d5e50",light:"#b8b8b850",hcDark:null,hcLight:null},p("toolbarHoverBackground","Toolbar background when hovering over actions using the mouse"));N("toolbar.hoverOutline",{dark:null,light:null,hcDark:di,hcLight:di},p("toolbarHoverOutline","Toolbar outline when hovering over actions using the mouse"));N("toolbar.activeBackground",{dark:Ja(LB,.1),light:ap(LB,.1),hcDark:null,hcLight:null},p("toolbarActiveBackground","Toolbar background when holding the mouse over actions"));const Kue=N("breadcrumb.foreground",{light:Ee(ae,.8),dark:Ee(ae,.8),hcDark:Ee(ae,.8),hcLight:Ee(ae,.8)},p("breadcrumbsFocusForeground","Color of focused breadcrumb items.")),que=N("breadcrumb.background",{light:Sn,dark:Sn,hcDark:Sn,hcLight:Sn},p("breadcrumbsBackground","Background color of breadcrumb items.")),xB=N("breadcrumb.focusForeground",{light:ap(ae,.2),dark:Ja(ae,.1),hcDark:Ja(ae,.1),hcLight:Ja(ae,.1)},p("breadcrumbsFocusForeground","Color of focused breadcrumb items.")),Gue=N("breadcrumb.activeSelectionForeground",{light:ap(ae,.2),dark:Ja(ae,.1),hcDark:Ja(ae,.1),hcLight:Ja(ae,.1)},p("breadcrumbsSelectedForeground","Color of selected breadcrumb items."));N("breadcrumbPicker.background",{light:Hi,dark:Hi,hcDark:Hi,hcLight:Hi},p("breadcrumbsSelectedBackground","Background color of breadcrumb item picker."));const TU=.5,kB=$.fromHex("#40C8AE").transparent(TU),EB=$.fromHex("#40A6FF").transparent(TU),IB=$.fromHex("#606060").transparent(.4),la=.4,m_=1,om=N("merge.currentHeaderBackground",{dark:kB,light:kB,hcDark:null,hcLight:null},p("mergeCurrentHeaderBackground","Current header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);N("merge.currentContentBackground",{dark:Ee(om,la),light:Ee(om,la),hcDark:Ee(om,la),hcLight:Ee(om,la)},p("mergeCurrentContentBackground","Current content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);const rm=N("merge.incomingHeaderBackground",{dark:EB,light:EB,hcDark:null,hcLight:null},p("mergeIncomingHeaderBackground","Incoming header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);N("merge.incomingContentBackground",{dark:Ee(rm,la),light:Ee(rm,la),hcDark:Ee(rm,la),hcLight:Ee(rm,la)},p("mergeIncomingContentBackground","Incoming content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);const am=N("merge.commonHeaderBackground",{dark:IB,light:IB,hcDark:null,hcLight:null},p("mergeCommonHeaderBackground","Common ancestor header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);N("merge.commonContentBackground",{dark:Ee(am,la),light:Ee(am,la),hcDark:Ee(am,la),hcLight:Ee(am,la)},p("mergeCommonContentBackground","Common ancestor content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);const __=N("merge.border",{dark:null,light:null,hcDark:"#C3DF6F",hcLight:"#007ACC"},p("mergeBorder","Border color on headers and the splitter in inline merge-conflicts."));N("editorOverviewRuler.currentContentForeground",{dark:Ee(om,m_),light:Ee(om,m_),hcDark:__,hcLight:__},p("overviewRulerCurrentContentForeground","Current overview ruler foreground for inline merge-conflicts."));N("editorOverviewRuler.incomingContentForeground",{dark:Ee(rm,m_),light:Ee(rm,m_),hcDark:__,hcLight:__},p("overviewRulerIncomingContentForeground","Incoming overview ruler foreground for inline merge-conflicts."));N("editorOverviewRuler.commonContentForeground",{dark:Ee(am,m_),light:Ee(am,m_),hcDark:__,hcLight:__},p("overviewRulerCommonContentForeground","Common ancestor overview ruler foreground for inline merge-conflicts."));const MF=N("editorOverviewRuler.findMatchForeground",{dark:"#d186167e",light:"#d186167e",hcDark:"#AB5A00",hcLight:""},p("overviewRulerFindMatchForeground","Overview ruler marker color for find matches. The color must not be opaque so as not to hide underlying decorations."),!0),_v=N("editorOverviewRuler.selectionHighlightForeground",{dark:"#A0A0A0CC",light:"#A0A0A0CC",hcDark:"#A0A0A0CC",hcLight:"#A0A0A0CC"},p("overviewRulerSelectionHighlightForeground","Overview ruler marker color for selection highlights. The color must not be opaque so as not to hide underlying decorations."),!0),Zue=N("problemsErrorIcon.foreground",{dark:Jl,light:Jl,hcDark:Jl,hcLight:Jl},p("problemsErrorIconForeground","The color used for the problems error icon.")),Xue=N("problemsWarningIcon.foreground",{dark:vs,light:vs,hcDark:vs,hcLight:vs},p("problemsWarningIconForeground","The color used for the problems warning icon.")),Yue=N("problemsInfoIcon.foreground",{dark:ro,light:ro,hcDark:ro,hcLight:ro},p("problemsInfoIconForeground","The color used for the problems info icon.")),lm=N("minimap.findMatchHighlight",{light:"#d18616",dark:"#d18616",hcDark:"#AB5A00",hcLight:"#0F4A85"},p("minimapFindMatchHighlight","Minimap marker color for find matches."),!0),wx=N("minimap.selectionOccurrenceHighlight",{light:"#c9c9c9",dark:"#676767",hcDark:"#ffffff",hcLight:"#0F4A85"},p("minimapSelectionOccurrenceHighlight","Minimap marker color for repeating editor selections."),!0),TB=N("minimap.selectionHighlight",{light:"#ADD6FF",dark:"#264F78",hcDark:"#ffffff",hcLight:"#0F4A85"},p("minimapSelectionHighlight","Minimap marker color for the editor selection."),!0),Que=N("minimap.infoHighlight",{dark:ro,light:ro,hcDark:Xb,hcLight:Xb},p("minimapInfo","Minimap marker color for infos.")),Jue=N("minimap.warningHighlight",{dark:vs,light:vs,hcDark:Zb,hcLight:Zb},p("overviewRuleWarning","Minimap marker color for warnings.")),ehe=N("minimap.errorHighlight",{dark:new $(new bt(255,18,18,.7)),light:new $(new bt(255,18,18,.7)),hcDark:new $(new bt(255,50,50,1)),hcLight:"#B5200D"},p("minimapError","Minimap marker color for errors.")),the=N("minimap.background",{dark:null,light:null,hcDark:null,hcLight:null},p("minimapBackground","Minimap background color.")),ihe=N("minimap.foregroundOpacity",{dark:$.fromHex("#000f"),light:$.fromHex("#000f"),hcDark:$.fromHex("#000f"),hcLight:$.fromHex("#000f")},p("minimapForegroundOpacity",'Opacity of foreground elements rendered in the minimap. For example, "#000000c0" will render the elements with 75% opacity.'));N("minimapSlider.background",{light:Ee(fv,.5),dark:Ee(fv,.5),hcDark:Ee(fv,.5),hcLight:Ee(fv,.5)},p("minimapSliderBackground","Minimap slider background color."));N("minimapSlider.hoverBackground",{light:Ee(pv,.5),dark:Ee(pv,.5),hcDark:Ee(pv,.5),hcLight:Ee(pv,.5)},p("minimapSliderHoverBackground","Minimap slider background color when hovering."));N("minimapSlider.activeBackground",{light:Ee(mv,.5),dark:Ee(mv,.5),hcDark:Ee(mv,.5),hcLight:Ee(mv,.5)},p("minimapSliderActiveBackground","Minimap slider background color when clicked on."));N("charts.foreground",{dark:ae,light:ae,hcDark:ae,hcLight:ae},p("chartsForeground","The foreground color used in charts."));N("charts.lines",{dark:Ee(ae,.5),light:Ee(ae,.5),hcDark:Ee(ae,.5),hcLight:Ee(ae,.5)},p("chartsLines","The color used for horizontal lines in charts."));N("charts.red",{dark:Jl,light:Jl,hcDark:Jl,hcLight:Jl},p("chartsRed","The red color used in chart visualizations."));N("charts.blue",{dark:ro,light:ro,hcDark:ro,hcLight:ro},p("chartsBlue","The blue color used in chart visualizations."));N("charts.yellow",{dark:vs,light:vs,hcDark:vs,hcLight:vs},p("chartsYellow","The yellow color used in chart visualizations."));N("charts.orange",{dark:lm,light:lm,hcDark:lm,hcLight:lm},p("chartsOrange","The orange color used in chart visualizations."));N("charts.green",{dark:"#89D185",light:"#388A34",hcDark:"#89D185",hcLight:"#374e06"},p("chartsGreen","The green color used in chart visualizations."));N("charts.purple",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},p("chartsPurple","The purple color used in chart visualizations."));const EA=N("input.background",{dark:"#3C3C3C",light:$.white,hcDark:$.black,hcLight:$.white},p("inputBoxBackground","Input box background.")),NU=N("input.foreground",{dark:ae,light:ae,hcDark:ae,hcLight:ae},p("inputBoxForeground","Input box foreground.")),AU=N("input.border",{dark:null,light:null,hcDark:gt,hcLight:gt},p("inputBoxBorder","Input box border.")),RF=N("inputOption.activeBorder",{dark:"#007ACC",light:"#007ACC",hcDark:gt,hcLight:gt},p("inputBoxActiveOptionBorder","Border color of activated options in input fields."));N("inputOption.hoverBackground",{dark:"#5a5d5e80",light:"#b8b8b850",hcDark:null,hcLight:null},p("inputOption.hoverBackground","Background color of activated options in input fields."));const Zg=N("inputOption.activeBackground",{dark:Ee(Ir,.4),light:Ee(Ir,.2),hcDark:$.transparent,hcLight:$.transparent},p("inputOption.activeBackground","Background hover color of options in input fields.")),PF=N("inputOption.activeForeground",{dark:$.white,light:$.black,hcDark:ae,hcLight:ae},p("inputOption.activeForeground","Foreground color of activated options in input fields."));N("input.placeholderForeground",{light:Ee(ae,.5),dark:Ee(ae,.5),hcDark:Ee(ae,.7),hcLight:Ee(ae,.7)},p("inputPlaceholderForeground","Input box foreground color for placeholder text."));const nhe=N("inputValidation.infoBackground",{dark:"#063B49",light:"#D6ECF2",hcDark:$.black,hcLight:$.white},p("inputValidationInfoBackground","Input validation background color for information severity.")),she=N("inputValidation.infoForeground",{dark:null,light:null,hcDark:null,hcLight:ae},p("inputValidationInfoForeground","Input validation foreground color for information severity.")),ohe=N("inputValidation.infoBorder",{dark:"#007acc",light:"#007acc",hcDark:gt,hcLight:gt},p("inputValidationInfoBorder","Input validation border color for information severity.")),rhe=N("inputValidation.warningBackground",{dark:"#352A05",light:"#F6F5D2",hcDark:$.black,hcLight:$.white},p("inputValidationWarningBackground","Input validation background color for warning severity.")),ahe=N("inputValidation.warningForeground",{dark:null,light:null,hcDark:null,hcLight:ae},p("inputValidationWarningForeground","Input validation foreground color for warning severity.")),lhe=N("inputValidation.warningBorder",{dark:"#B89500",light:"#B89500",hcDark:gt,hcLight:gt},p("inputValidationWarningBorder","Input validation border color for warning severity.")),dhe=N("inputValidation.errorBackground",{dark:"#5A1D1D",light:"#F2DEDE",hcDark:$.black,hcLight:$.white},p("inputValidationErrorBackground","Input validation background color for error severity.")),che=N("inputValidation.errorForeground",{dark:null,light:null,hcDark:null,hcLight:ae},p("inputValidationErrorForeground","Input validation foreground color for error severity.")),uhe=N("inputValidation.errorBorder",{dark:"#BE1100",light:"#BE1100",hcDark:gt,hcLight:gt},p("inputValidationErrorBorder","Input validation border color for error severity.")),ed=N("dropdown.background",{dark:"#3C3C3C",light:$.white,hcDark:$.black,hcLight:$.white},p("dropdownBackground","Dropdown background.")),hhe=N("dropdown.listBackground",{dark:null,light:null,hcDark:$.black,hcLight:$.white},p("dropdownListBackground","Dropdown list background.")),bc=N("dropdown.foreground",{dark:"#F0F0F0",light:ae,hcDark:$.white,hcLight:ae},p("dropdownForeground","Dropdown foreground.")),dm=N("dropdown.border",{dark:ed,light:"#CECECE",hcDark:gt,hcLight:gt},p("dropdownBorder","Dropdown border.")),vv=N("button.foreground",{dark:$.white,light:$.white,hcDark:$.white,hcLight:$.white},p("buttonForeground","Button foreground color.")),ghe=N("button.separator",{dark:Ee(vv,.4),light:Ee(vv,.4),hcDark:Ee(vv,.4),hcLight:Ee(vv,.4)},p("buttonSeparator","Button separator color.")),bv=N("button.background",{dark:"#0E639C",light:"#007ACC",hcDark:null,hcLight:"#0F4A85"},p("buttonBackground","Button background color.")),fhe=N("button.hoverBackground",{dark:Ja(bv,.2),light:ap(bv,.2),hcDark:bv,hcLight:bv},p("buttonHoverBackground","Button background color when hovering.")),phe=N("button.border",{dark:gt,light:gt,hcDark:gt,hcLight:gt},p("buttonBorder","Button border color.")),mhe=N("button.secondaryForeground",{dark:$.white,light:$.white,hcDark:$.white,hcLight:ae},p("buttonSecondaryForeground","Secondary button foreground color.")),IA=N("button.secondaryBackground",{dark:"#3A3D41",light:"#5F6A79",hcDark:null,hcLight:$.white},p("buttonSecondaryBackground","Secondary button background color.")),_he=N("button.secondaryHoverBackground",{dark:Ja(IA,.2),light:ap(IA,.2),hcDark:null,hcLight:null},p("buttonSecondaryHoverBackground","Secondary button background color when hovering.")),vhe=N("checkbox.background",{dark:ed,light:ed,hcDark:ed,hcLight:ed},p("checkbox.background","Background color of checkbox widget."));N("checkbox.selectBackground",{dark:Hi,light:Hi,hcDark:Hi,hcLight:Hi},p("checkbox.select.background","Background color of checkbox widget when the element it's in is selected."));const bhe=N("checkbox.foreground",{dark:bc,light:bc,hcDark:bc,hcLight:bc},p("checkbox.foreground","Foreground color of checkbox widget.")),Che=N("checkbox.border",{dark:dm,light:dm,hcDark:dm,hcLight:dm},p("checkbox.border","Border color of checkbox widget."));N("checkbox.selectBorder",{dark:Ql,light:Ql,hcDark:Ql,hcLight:Ql},p("checkbox.select.border","Border color of checkbox widget when the element it's in is selected."));const whe=N("keybindingLabel.background",{dark:new $(new bt(128,128,128,.17)),light:new $(new bt(221,221,221,.4)),hcDark:$.transparent,hcLight:$.transparent},p("keybindingLabelBackground","Keybinding label background color. The keybinding label is used to represent a keyboard shortcut.")),yhe=N("keybindingLabel.foreground",{dark:$.fromHex("#CCCCCC"),light:$.fromHex("#555555"),hcDark:$.white,hcLight:ae},p("keybindingLabelForeground","Keybinding label foreground color. The keybinding label is used to represent a keyboard shortcut.")),She=N("keybindingLabel.border",{dark:new $(new bt(51,51,51,.6)),light:new $(new bt(204,204,204,.4)),hcDark:new $(new bt(111,195,223)),hcLight:gt},p("keybindingLabelBorder","Keybinding label border color. The keybinding label is used to represent a keyboard shortcut.")),Dhe=N("keybindingLabel.bottomBorder",{dark:new $(new bt(68,68,68,.6)),light:new $(new bt(187,187,187,.4)),hcDark:new $(new bt(111,195,223)),hcLight:ae},p("keybindingLabelBottomBorder","Keybinding label border bottom color. The keybinding label is used to represent a keyboard shortcut.")),Lhe=N("list.focusBackground",{dark:null,light:null,hcDark:null,hcLight:null},p("listFocusBackground","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.")),xhe=N("list.focusForeground",{dark:null,light:null,hcDark:null,hcLight:null},p("listFocusForeground","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.")),khe=N("list.focusOutline",{dark:Ir,light:Ir,hcDark:di,hcLight:di},p("listFocusOutline","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.")),Ehe=N("list.focusAndSelectionOutline",{dark:null,light:null,hcDark:null,hcLight:null},p("listFocusAndSelectionOutline","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.")),Cc=N("list.activeSelectionBackground",{dark:"#04395E",light:"#0060C0",hcDark:null,hcLight:$.fromHex("#0F4A85").transparent(.1)},p("listActiveSelectionBackground","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.")),td=N("list.activeSelectionForeground",{dark:$.white,light:$.white,hcDark:null,hcLight:null},p("listActiveSelectionForeground","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.")),Cv=N("list.activeSelectionIconForeground",{dark:null,light:null,hcDark:null,hcLight:null},p("listActiveSelectionIconForeground","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.")),Ihe=N("list.inactiveSelectionBackground",{dark:"#37373D",light:"#E4E6F1",hcDark:null,hcLight:$.fromHex("#0F4A85").transparent(.1)},p("listInactiveSelectionBackground","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.")),The=N("list.inactiveSelectionForeground",{dark:null,light:null,hcDark:null,hcLight:null},p("listInactiveSelectionForeground","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.")),Nhe=N("list.inactiveSelectionIconForeground",{dark:null,light:null,hcDark:null,hcLight:null},p("listInactiveSelectionIconForeground","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.")),Ahe=N("list.inactiveFocusBackground",{dark:null,light:null,hcDark:null,hcLight:null},p("listInactiveFocusBackground","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.")),Mhe=N("list.inactiveFocusOutline",{dark:null,light:null,hcDark:null,hcLight:null},p("listInactiveFocusOutline","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.")),MU=N("list.hoverBackground",{dark:"#2A2D2E",light:"#F0F0F0",hcDark:$.white.transparent(.1),hcLight:$.fromHex("#0F4A85").transparent(.1)},p("listHoverBackground","List/Tree background when hovering over items using the mouse.")),RU=N("list.hoverForeground",{dark:null,light:null,hcDark:null,hcLight:null},p("listHoverForeground","List/Tree foreground when hovering over items using the mouse.")),Rhe=N("list.dropBackground",{dark:"#062F4A",light:"#D6EBFF",hcDark:null,hcLight:null},p("listDropBackground","List/Tree drag and drop background when moving items over other items when using the mouse.")),Phe=N("list.dropBetweenBackground",{dark:Ql,light:Ql,hcDark:null,hcLight:null},p("listDropBetweenBackground","List/Tree drag and drop border color when moving items between items when using the mouse.")),da=N("list.highlightForeground",{dark:"#2AAAFF",light:"#0066BF",hcDark:Ir,hcLight:Ir},p("highlight","List/Tree foreground color of the match highlights when searching inside the list/tree.")),ww=N("list.focusHighlightForeground",{dark:da,light:Iue(Cc,da,"#BBE7FF"),hcDark:da,hcLight:da},p("listFocusHighlightForeground","List/Tree foreground color of the match highlights on actively focused items when searching inside the list/tree."));N("list.invalidItemForeground",{dark:"#B89500",light:"#B89500",hcDark:"#B89500",hcLight:"#B5200D"},p("invalidItemForeground","List/Tree foreground color for invalid items, for example an unresolved root in explorer."));N("list.errorForeground",{dark:"#F88070",light:"#B01011",hcDark:null,hcLight:null},p("listErrorForeground","Foreground color of list items containing errors."));N("list.warningForeground",{dark:"#CCA700",light:"#855F00",hcDark:null,hcLight:null},p("listWarningForeground","Foreground color of list items containing warnings."));const Fhe=N("listFilterWidget.background",{light:ap(Hi,0),dark:Ja(Hi,0),hcDark:Hi,hcLight:Hi},p("listFilterWidgetBackground","Background color of the type filter widget in lists and trees.")),Ohe=N("listFilterWidget.outline",{dark:$.transparent,light:$.transparent,hcDark:"#f38518",hcLight:"#007ACC"},p("listFilterWidgetOutline","Outline color of the type filter widget in lists and trees.")),Bhe=N("listFilterWidget.noMatchesOutline",{dark:"#BE1100",light:"#BE1100",hcDark:gt,hcLight:gt},p("listFilterWidgetNoMatchesOutline","Outline color of the type filter widget in lists and trees, when there are no matches.")),Whe=N("listFilterWidget.shadow",{dark:vc,light:vc,hcDark:vc,hcLight:vc},p("listFilterWidgetShadow","Shadow color of the type filter widget in lists and trees."));N("list.filterMatchBackground",{dark:pc,light:pc,hcDark:null,hcLight:null},p("listFilterMatchHighlight","Background color of the filtered match."));N("list.filterMatchBorder",{dark:zu,light:zu,hcDark:gt,hcLight:di},p("listFilterMatchHighlightBorder","Border color of the filtered match."));N("list.deemphasizedForeground",{dark:"#8C8C8C",light:"#8E8E90",hcDark:"#A7A8A9",hcLight:"#666666"},p("listDeemphasizedForeground","List/Tree foreground color for items that are deemphasized."));const wv=N("tree.indentGuidesStroke",{dark:"#585858",light:"#a9a9a9",hcDark:"#a9a9a9",hcLight:"#a5a5a5"},p("treeIndentGuidesStroke","Tree stroke color for the indentation guides.")),Hhe=N("tree.inactiveIndentGuidesStroke",{dark:Ee(wv,.4),light:Ee(wv,.4),hcDark:Ee(wv,.4),hcLight:Ee(wv,.4)},p("treeInactiveIndentGuidesStroke","Tree stroke color for the indentation guides that are not active.")),Vhe=N("tree.tableColumnsBorder",{dark:"#CCCCCC20",light:"#61616120",hcDark:null,hcLight:null},p("tableColumnsBorder","Table border color between columns.")),zhe=N("tree.tableOddRowsBackground",{dark:Ee(ae,.04),light:Ee(ae,.04),hcDark:null,hcLight:null},p("tableOddRowsBackgroundColor","Background color for odd table rows.")),Uhe=N("menu.border",{dark:null,light:null,hcDark:gt,hcLight:gt},p("menuBorder","Border color of menus.")),$he=N("menu.foreground",{dark:bc,light:bc,hcDark:bc,hcLight:bc},p("menuForeground","Foreground color of menu items.")),jhe=N("menu.background",{dark:ed,light:ed,hcDark:ed,hcLight:ed},p("menuBackground","Background color of menu items.")),Khe=N("menu.selectionForeground",{dark:td,light:td,hcDark:td,hcLight:td},p("menuSelectionForeground","Foreground color of the selected menu item in menus.")),qhe=N("menu.selectionBackground",{dark:Cc,light:Cc,hcDark:Cc,hcLight:Cc},p("menuSelectionBackground","Background color of the selected menu item in menus.")),Ghe=N("menu.selectionBorder",{dark:null,light:null,hcDark:di,hcLight:di},p("menuSelectionBorder","Border color of the selected menu item in menus.")),Zhe=N("menu.separatorBackground",{dark:"#606060",light:"#D4D4D4",hcDark:gt,hcLight:gt},p("menuSeparatorBackground","Color of a separator menu item in menus.")),NB=N("quickInput.background",{dark:Hi,light:Hi,hcDark:Hi,hcLight:Hi},p("pickerBackground","Quick picker background color. The quick picker widget is the container for pickers like the command palette.")),Xhe=N("quickInput.foreground",{dark:gc,light:gc,hcDark:gc,hcLight:gc},p("pickerForeground","Quick picker foreground color. The quick picker widget is the container for pickers like the command palette.")),Yhe=N("quickInputTitle.background",{dark:new $(new bt(255,255,255,.105)),light:new $(new bt(0,0,0,.06)),hcDark:"#000000",hcLight:$.white},p("pickerTitleBackground","Quick picker title background color. The quick picker widget is the container for pickers like the command palette.")),PU=N("pickerGroup.foreground",{dark:"#3794FF",light:"#0066BF",hcDark:$.white,hcLight:"#0F4A85"},p("pickerGroupForeground","Quick picker color for grouping labels.")),Qhe=N("pickerGroup.border",{dark:"#3F3F46",light:"#CCCEDB",hcDark:$.white,hcLight:"#0F4A85"},p("pickerGroupBorder","Quick picker color for grouping borders.")),AB=N("quickInput.list.focusBackground",{dark:null,light:null,hcDark:null,hcLight:null},"",void 0,p("quickInput.list.focusBackground deprecation","Please use quickInputList.focusBackground instead")),Uu=N("quickInputList.focusForeground",{dark:td,light:td,hcDark:td,hcLight:td},p("quickInput.listFocusForeground","Quick picker foreground color for the focused item.")),cm=N("quickInputList.focusIconForeground",{dark:Cv,light:Cv,hcDark:Cv,hcLight:Cv},p("quickInput.listFocusIconForeground","Quick picker icon foreground color for the focused item.")),$u=N("quickInputList.focusBackground",{dark:Gb(AB,Cc),light:Gb(AB,Cc),hcDark:null,hcLight:null},p("quickInput.listFocusBackground","Quick picker background color for the focused item."));N("search.resultsInfoForeground",{light:ae,dark:Ee(ae,.65),hcDark:ae,hcLight:ae},p("search.resultsInfoForeground","Color of the text in the search viewlet's completion message."));N("searchEditor.findMatchBackground",{light:Ee(pc,.66),dark:Ee(pc,.66),hcDark:pc,hcLight:pc},p("searchEditor.queryMatch","Color of the Search Editor query matches."));N("searchEditor.findMatchBorder",{light:Ee(zu,.66),dark:Ee(zu,.66),hcDark:zu,hcLight:zu},p("searchEditor.editorFindMatchBorder","Border color of the Search Editor query matches."));class yx{constructor(e,t){this.x=e,this.y=t,this._pageCoordinatesBrand=void 0}toClientCoordinates(e){return new FU(this.x-e.scrollX,this.y-e.scrollY)}}class FU{constructor(e,t){this.clientX=e,this.clientY=t,this._clientCoordinatesBrand=void 0}toPageCoordinates(e){return new yx(this.clientX+e.scrollX,this.clientY+e.scrollY)}}class Jhe{constructor(e,t,i,n){this.x=e,this.y=t,this.width=i,this.height=n,this._editorPagePositionBrand=void 0}}class ege{constructor(e,t){this.x=e,this.y=t,this._positionRelativeToEditorBrand=void 0}}function FF(s){const e=qi(s);return new Jhe(e.left,e.top,e.width,e.height)}function OF(s,e,t){const i=e.width/s.offsetWidth,n=e.height/s.offsetHeight,o=(t.x-e.x)/i,r=(t.y-e.y)/n;return new ege(o,r)}class Nh extends ra{constructor(e,t,i){super(Te(i),e),this._editorMouseEventBrand=void 0,this.isFromPointerCapture=t,this.pos=new yx(this.posx,this.posy),this.editorPos=FF(i),this.relativePos=OF(i,this.editorPos,this.pos)}}class tge{constructor(e){this._editorViewDomNode=e}_create(e){return new Nh(e,!1,this._editorViewDomNode)}onContextMenu(e,t){return K(e,"contextmenu",i=>{t(this._create(i))})}onMouseUp(e,t){return K(e,"mouseup",i=>{t(this._create(i))})}onMouseDown(e,t){return K(e,ee.MOUSE_DOWN,i=>{t(this._create(i))})}onPointerDown(e,t){return K(e,ee.POINTER_DOWN,i=>{t(this._create(i),i.pointerId)})}onMouseLeave(e,t){return K(e,ee.MOUSE_LEAVE,i=>{t(this._create(i))})}onMouseMove(e,t){return K(e,"mousemove",i=>t(this._create(i)))}}class ige{constructor(e){this._editorViewDomNode=e}_create(e){return new Nh(e,!1,this._editorViewDomNode)}onPointerUp(e,t){return K(e,"pointerup",i=>{t(this._create(i))})}onPointerDown(e,t){return K(e,ee.POINTER_DOWN,i=>{t(this._create(i),i.pointerId)})}onPointerLeave(e,t){return K(e,ee.POINTER_LEAVE,i=>{t(this._create(i))})}onPointerMove(e,t){return K(e,"pointermove",i=>t(this._create(i)))}}class nge extends H{constructor(e){super(),this._editorViewDomNode=e,this._globalPointerMoveMonitor=this._register(new c0),this._keydownListener=null}startMonitoring(e,t,i,n,o){this._keydownListener=Ni(e.ownerDocument,"keydown",r=>{r.toKeyCodeChord().isModifierKey()||this._globalPointerMoveMonitor.stopMonitoring(!0,r.browserEvent)},!0),this._globalPointerMoveMonitor.startMonitoring(e,t,i,r=>{n(new Nh(r,!0,this._editorViewDomNode))},r=>{this._keydownListener.dispose(),o(r)})}stopMonitoring(){this._globalPointerMoveMonitor.stopMonitoring(!0)}}class v1{constructor(e){this._editor=e,this._instanceId=++v1._idPool,this._counter=0,this._rules=new Map,this._garbageCollectionScheduler=new Wt(()=>this.garbageCollect(),1e3)}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 sge(t,`dyn-rule-${this._instanceId}-${n}`,US(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.delete(e.key),e.dispose())}}v1._idPool=0;class sge{constructor(e,t,i,n){this.key=e,this.className=t,this.properties=n,this._referenceCount=0,this._styleElementDisposables=new Y,this._styleElement=ar(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 o=t[n];let r;typeof o=="object"?r=fe(o.id):r=o;const a=oge(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 oge(s){return s.replace(/(^[A-Z])/,([e])=>e.toLowerCase()).replace(/([A-Z])/g,([e])=>`-${e.toLowerCase()}`)}class b1 extends H{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;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 o=0,r=e.length;ol)return null;if(t=Math.min(l,Math.max(0,t)),n=Math.min(l,Math.max(0,n)),t===n&&i===o&&i===0&&!e.children[t].firstChild){const h=e.children[t].getClientRects();return r.markDidDomLayout(),this._createHorizontalRangesFromClientRects(h,r.clientRectDeltaLeft,r.clientRectScale)}t!==n&&n>0&&o===0&&(n--,o=1073741824);let d=e.children[t].firstChild,c=e.children[n].firstChild;if((!d||!c)&&(!d&&i===0&&t>0&&(d=e.children[t-1].firstChild,i=1073741824),!c&&o===0&&n>0&&(c=e.children[n-1].firstChild,o=1073741824)),!d||!c)return null;i=Math.min(d.textContent.length,Math.max(0,i)),o=Math.min(c.textContent.length,Math.max(0,o));const u=this._readClientRects(d,i,c,o,r.endNode);return r.markDidDomLayout(),this._createHorizontalRangesFromClientRects(u,r.clientRectDeltaLeft,r.clientRectScale)}}var Nr;(function(s){s.DARK="dark",s.LIGHT="light",s.HIGH_CONTRAST_DARK="hcDark",s.HIGH_CONTRAST_LIGHT="hcLight"})(Nr||(Nr={}));function dd(s){return s===Nr.HIGH_CONTRAST_DARK||s===Nr.HIGH_CONTRAST_LIGHT}function Dx(s){return s===Nr.DARK||s===Nr.HIGH_CONTRAST_DARK}const cge=function(){return md?!0:!($s||Fr||Lh)}();let Rm=!0;class RB{constructor(e,t){this.themeType=t;const i=e.options,n=i.get(50);i.get(38)==="off"?this.renderWhitespace=i.get(99):this.renderWhitespace="none",this.renderControlCharacters=i.get(94),this.spaceWidth=n.spaceWidth,this.middotWidth=n.middotWidth,this.wsmiddotWidth=n.wsmiddotWidth,this.useMonospaceOptimizations=n.isMonospace&&!i.get(33),this.canUseHalfwidthRightwardsArrow=n.canUseHalfwidthRightwardsArrow,this.lineHeight=i.get(67),this.stopRenderingLineAfter=i.get(117),this.fontLigatures=i.get(51)}equals(e){return this.themeType===e.themeType&&this.renderWhitespace===e.renderWhitespace&&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}}class Ul{constructor(e){this._options=e,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=It(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 dd(this._options.themeType)||this._options.renderWhitespace==="selection"?(this._isMaybeInvalid=!0,!0):!1}renderLine(e,t,i,n,o){if(this._isMaybeInvalid===!1)return!1;this._isMaybeInvalid=!1;const r=n.getViewLineRenderingData(e),a=this._options,l=Os.filter(r.inlineDecorations,e,r.minColumn,r.maxColumn);let d=null;if(dd(a.themeType)||this._options.renderWhitespace==="selection"){const g=n.selections;for(const f of g){if(f.endLineNumbere)continue;const m=f.startLineNumber===e?f.startColumn:r.minColumn,_=f.endLineNumber===e?f.endColumn:r.maxColumn;m<_&&(dd(a.themeType)&&l.push(new Os(m,_,"inline-selected-text",0)),this._options.renderWhitespace==="selection"&&(d||(d=[]),d.push(new _U(m-1,_-1))))}}const c=new tg(a.useMonospaceOptimizations,a.canUseHalfwidthRightwardsArrow,r.content,r.continuesWithWrappedLine,r.isBasicASCII,r.containsRTL,r.minColumn-1,r.tokens,l,r.tabSize,r.startVisibleColumn,a.spaceWidth,a.middotWidth,a.wsmiddotWidth,a.stopRenderingLineAfter,a.renderWhitespace,a.renderControlCharacters,a.fontLigatures!==Zo.OFF,d);if(this._renderedViewLine&&this._renderedViewLine.input.equals(c))return!1;o.appendString('
');const u=m1(c,o);o.appendString("
");let h=null;return Rm&&cge&&r.isBasicASCII&&a.useMonospaceOptimizations&&u.containsForeignElements===0&&(h=new yw(this._renderedViewLine?this._renderedViewLine.domNode:null,c,u.characterMapping)),h||(h=BU(this._renderedViewLine?this._renderedViewLine.domNode:null,c,u.characterMapping,u.containsRTL,u.containsForeignElements)),this._renderedViewLine=h,!0}layoutLine(e,t,i){this._renderedViewLine&&this._renderedViewLine.domNode&&(this._renderedViewLine.domNode.setTop(t),this._renderedViewLine.domNode.setHeight(i))}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 yw:!1}monospaceAssumptionsAreValid(){return this._renderedViewLine&&this._renderedViewLine instanceof yw?this._renderedViewLine.monospaceAssumptionsAreValid():Rm}onMonospaceAssumptionsInvalidated(){this._renderedViewLine&&this._renderedViewLine instanceof yw&&(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 o=this._renderedViewLine.input.stopRenderingLineAfter;if(o!==-1&&t>o+1&&i>o+1)return new MB(!0,[new lf(this.getWidth(n),0)]);o!==-1&&t>o+1&&(t=o+1),o!==-1&&i>o+1&&(i=o+1);const r=this._renderedViewLine.getVisibleRangesForRange(e,t,i,n);return r&&r.length>0?new MB(!1,r):null}getColumnOfNodeOffset(e,t){return this._renderedViewLine?this._renderedViewLine.getColumnOfNodeOffset(e,t):1}}Ul.CLASS_NAME="view-line";class yw{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 o=0;o=2&&(console.warn("monospace assumptions have been violated, therefore disabling monospace optimizations!"),Rm=!1)}return Rm}toSlowRenderedLine(){return BU(this.domNode,this.input,this._characterMapping,!1,0)}getVisibleRangesForRange(e,t,i,n){const o=this._getColumnPixelOffset(e,t,n),r=this._getColumnPixelOffset(e,i,n);return[new lf(o,r-o)]}_getColumnPixelOffset(e,t,i){if(t<=300){const d=this._characterMapping.getHorizontalOffset(t);return this._charWidth*d}const n=Math.floor((t-1)/300)-1,o=(n+1)*300+1;let r=-1;if(this._keyColumnPixelOffsetCache&&(r=this._keyColumnPixelOffsetCache[n],r===-1&&(r=this._actualReadPixelOffset(e,o,i),this._keyColumnPixelOffsetCache[n]=r)),r===-1){const d=this._characterMapping.getHorizontalOffset(t);return this._charWidth*d}const a=this._characterMapping.getHorizontalOffset(o),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),o=Ky.readHorizontalRanges(this._getReadingTarget(this.domNode),n.partIndex,n.charIndex,n.partIndex,n.charIndex,i);return!o||o.length===0?-1:o[0].left}getColumnOfNodeOffset(e,t){return BF(this._characterMapping,e,t)}}class OU{constructor(e,t,i,n,o){if(this.domNode=e,this.input=t,this._characterMapping=i,this._isWhitespaceOnly=/^\s*$/.test(t.lineContent),this._containsForeignElements=o,this._cachedWidth=-1,this._pixelOffsetCache=null,!n||this._characterMapping.length===0){this._pixelOffsetCache=new Float32Array(Math.max(2,this._characterMapping.length+1));for(let r=0,a=this._characterMapping.length;r<=a;r++)this._pixelOffsetCache[r]=-1}}_getReadingTarget(e){return e.domNode.firstChild}getWidth(e){return this.domNode?(this._cachedWidth===-1&&(this._cachedWidth=this._getReadingTarget(this.domNode).offsetWidth,e==null||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 o=this._readPixelOffset(this.domNode,e,t,n);if(o===-1)return null;const r=this._readPixelOffset(this.domNode,e,i,n);return r===-1?null:[new lf(o,r-o)]}return this._readVisibleRangesForRange(this.domNode,e,t,i,n)}_readVisibleRangesForRange(e,t,i,n,o){if(i===n){const r=this._readPixelOffset(e,t,i,o);return r===-1?null:[new lf(r,0)]}else return this._readRawVisibleRangesForRange(e,i,n,o)}_readPixelOffset(e,t,i,n){if(this._characterMapping.length===0){if(this._containsForeignElements===0||this._containsForeignElements===2)return 0;if(this._containsForeignElements===1)return this.getWidth(n);const o=this._getReadingTarget(e);return o.firstChild?(n.markDidDomLayout(),o.firstChild.offsetWidth):0}if(this._pixelOffsetCache!==null){const o=this._pixelOffsetCache[i];if(o!==-1)return o;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=Ky.readHorizontalRanges(this._getReadingTarget(e),0,0,0,0,n);return!l||l.length===0?-1:l[0].left}if(i===this._characterMapping.length&&this._isWhitespaceOnly&&this._containsForeignElements===0)return this.getWidth(n);const o=this._characterMapping.getDomPosition(i),r=Ky.readHorizontalRanges(this._getReadingTarget(e),o.partIndex,o.charIndex,o.partIndex,o.charIndex,n);if(!r||r.length===0)return-1;const a=r[0].left;if(this.input.isBasicASCII){const l=this._characterMapping.getHorizontalOffset(i),d=Math.round(this.input.spaceWidth*l);if(Math.abs(d-a)<=1)return d}return a}_readRawVisibleRangesForRange(e,t,i,n){if(t===1&&i===this._characterMapping.length)return[new lf(0,this.getWidth(n))];const o=this._characterMapping.getDomPosition(t),r=this._characterMapping.getDomPosition(i);return Ky.readHorizontalRanges(this._getReadingTarget(e),o.partIndex,o.charIndex,r.partIndex,r.charIndex,n)}getColumnOfNodeOffset(e,t){return BF(this._characterMapping,e,t)}}class uge extends OU{_readVisibleRangesForRange(e,t,i,n,o){const r=super._readVisibleRangesForRange(e,t,i,n,o);if(!r||r.length===0||i===n||i===1&&n===this._characterMapping.length)return r;if(!this.input.containsRTL){const a=this._readPixelOffset(e,t,n,o);if(a!==-1){const l=r[r.length-1];l.left=t){const u=t-r;return d-t=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 v_{constructor(e,t,i){this.viewModel=e.viewModel;const n=e.configuration.options;this.layoutInfo=n.get(145),this.viewDomNode=t.viewDomNode,this.lineHeight=n.get(67),this.stickyTabStops=n.get(116),this.typicalHalfwidthCharacterWidth=n.get(50).typicalHalfwidthCharacterWidth,this.lastRenderData=i,this._context=e,this._viewHelper=t}getZoneAtCoord(e){return v_.getZoneAtCoord(this._context,e)}static getZoneAtCoord(e,t){const i=e.viewLayout.getWhitespaceAtVerticalOffset(t);if(i){const n=i.verticalOffset+i.height/2,o=e.viewModel.getLineCount();let r=null,a,l=null;return i.afterLineNumber!==o&&(l=new W(i.afterLineNumber+1,1)),i.afterLineNumber>0&&(r=new W(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,fs._getMouseColumn(this.mouseContentHorizontalOffset,e.typicalHalfwidthCharacterWidth))}}class mge extends pge{get target(){return this._useHitTestTarget?this.hitTestResult.value.hitTarget:this._eventTarget}get targetPath(){return this._targetPathCacheElement!==this.target&&(this._targetPathCacheElement=this.target,this._targetPathCacheValue=rl.collect(this.target,this._ctx.viewDomNode)),this._targetPathCacheValue}constructor(e,t,i,n,o){super(e,t,i,n),this.hitTestResult=new gl(()=>fs.doHitTest(this._ctx,this)),this._targetPathCacheElement=null,this._targetPathCacheValue=new Uint8Array(0),this._ctx=e,this._eventTarget=o;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<=o&&o<=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 Ds.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 o=Math.abs(t.relativePos.x);const r={isAfterLines:i.isAfterLines,glyphMarginLeft:e.layoutInfo.glyphMarginLeft,glyphMarginWidth:e.layoutInfo.glyphMarginWidth,lineNumbersWidth:e.layoutInfo.lineNumbersWidth,offsetX:o};if(o-=e.layoutInfo.glyphMarginLeft,o<=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(o/e.lineHeight)],t.fulfillMargin(2,n,i.range,r)}return o-=e.layoutInfo.glyphMarginWidth,o<=e.layoutInfo.lineNumbersWidth?t.fulfillMargin(3,n,i.range,r):(o-=e.layoutInfo.lineNumbersWidth,t.fulfillMargin(4,n,i.range,r))}return null}static _hitTestViewLines(e,t){if(!Ds.isChildOfViewLines(t.targetPath))return null;if(e.isInTopPadding(t.mouseVerticalOffset))return t.fulfillContentEmpty(new W(1,1),PB);if(e.isAfterLines(t.mouseVerticalOffset)||e.isInBottomPadding(t.mouseVerticalOffset)){const n=e.viewModel.getLineCount(),o=e.viewModel.getLineMaxColumn(n);return t.fulfillContentEmpty(new W(n,o),PB)}if(Ds.isStrictChildOfViewLines(t.targetPath)){const n=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset);if(e.viewModel.getLineLength(n)===0){const r=e.getLineWidth(n),a=dI(t.mouseContentHorizontalOffset-r);return t.fulfillContentEmpty(new W(n,1),a)}const o=e.getLineWidth(n);if(t.mouseContentHorizontalOffset>=o){const r=dI(t.mouseContentHorizontalOffset-o),a=new W(n,e.viewModel.getLineMaxColumn(n));return t.fulfillContentEmpty(a,r)}}const i=t.hitTestResult.value;return i.type===1?fs.createMouseTargetFromHitTestPosition(e,t,i.spanNode,i.position,i.injectedText):t.wouldBenefitFromHitTestTargetSwitch?(t.switchToHitTestTarget(),this._createMouseTarget(e,t)):t.fulfillUnknown()}static _hitTestMinimap(e,t){if(Ds.isChildOfMinimap(t.targetPath)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),n=e.viewModel.getLineMaxColumn(i);return t.fulfillScrollbar(new W(i,n))}return null}static _hitTestScrollbarSlider(e,t){if(Ds.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),o=e.viewModel.getLineMaxColumn(n);return t.fulfillScrollbar(new W(n,o))}}return null}static _hitTestScrollbar(e,t){if(Ds.isChildOfScrollableElement(t.targetPath)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),n=e.viewModel.getLineMaxColumn(i);return t.fulfillScrollbar(new W(i,n))}return null}getMouseColumn(e){const t=this._context.configuration.options,i=t.get(145),n=this._context.viewLayout.getCurrentScrollLeft()+e.x-i.contentLeft;return fs._getMouseColumn(n,t.get(50).typicalHalfwidthCharacterWidth)}static _getMouseColumn(e,t){return e<0?1:Math.round(e/t)+1}static createMouseTargetFromHitTestPosition(e,t,i,n,o){const r=n.lineNumber,a=n.column,l=e.getLineWidth(r);if(t.mouseContentHorizontalOffset>l){const v=dI(t.mouseContentHorizontalOffset-l);return t.fulfillContentEmpty(n,v)}const d=e.visibleRangeForPosition(r,a);if(!d)return t.fulfillUnknown(n);const c=d.left;if(Math.abs(t.mouseContentHorizontalOffset-c)<1)return t.fulfillContentText(n,null,{mightBeForeignElement:!!o,injectedText:o});const u=[];if(u.push({offset:d.left,column:a}),a>1){const v=e.visibleRangeForPosition(r,a-1);v&&u.push({offset:v.left,column:a-1})}const h=e.viewModel.getLineMaxColumn(r);if(av.offset-b.offset);const g=t.pos.toClientCoordinates(Te(e.viewDomNode)),f=i.getBoundingClientRect(),m=f.left<=g.clientX&&g.clientX<=f.right;let _=null;for(let v=1;vo)){const a=Math.floor((n+o)/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 d=new yx(t.pos.x,l),c=this._actualDoHitTestWithCaretRangeFromPoint(e,d.toClientCoordinates(Te(e.viewDomNode)));if(c.type===1)return c}return this._actualDoHitTestWithCaretRangeFromPoint(e,t.pos.toClientCoordinates(Te(e.viewDomNode)))}static _actualDoHitTestWithCaretRangeFromPoint(e,t){const i=Sf(e.viewDomNode);let n;if(i?typeof i.caretRangeFromPoint>"u"?n=_ge(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 wu;const o=n.startContainer;if(o.nodeType===o.TEXT_NODE){const r=o.parentNode,a=r?r.parentNode:null,l=a?a.parentNode:null;return(l&&l.nodeType===l.ELEMENT_NODE?l.className:null)===Ul.CLASS_NAME?Wg.createFromDOMInfo(e,r,n.startOffset):new wu(o.parentNode)}else if(o.nodeType===o.ELEMENT_NODE){const r=o.parentNode,a=r?r.parentNode:null;return(a&&a.nodeType===a.ELEMENT_NODE?a.className:null)===Ul.CLASS_NAME?Wg.createFromDOMInfo(e,o,o.textContent.length):new wu(o)}return new wu}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,o=n?n.parentNode:null,r=o?o.parentNode:null;return(r&&r.nodeType===r.ELEMENT_NODE?r.className:null)===Ul.CLASS_NAME?Wg.createFromDOMInfo(e,i.offsetNode.parentNode,i.offset):new wu(i.offsetNode.parentNode)}if(i.offsetNode.nodeType===i.offsetNode.ELEMENT_NODE){const n=i.offsetNode.parentNode,o=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(o===Ul.CLASS_NAME){const l=i.offsetNode.childNodes[Math.min(i.offset,i.offsetNode.childNodes.length-1)];if(l)return Wg.createFromDOMInfo(e,l,0)}else if(a===Ul.CLASS_NAME)return Wg.createFromDOMInfo(e,i.offsetNode,0)}return new wu(i.offsetNode)}static _snapToSoftTabBoundary(e,t){const i=t.getLineContent(e.lineNumber),{tabSize:n}=t.model.getOptions(),o=Yb.atomicPosition(i,e.column-1,n,2);return o!==-1?new W(e.lineNumber,o+1):e}static doHitTest(e,t){let i=new wu;if(typeof e.viewDomNode.ownerDocument.caretRangeFromPoint=="function"?i=this._doHitTestWithCaretRangeFromPoint(e,t):e.viewDomNode.ownerDocument.caretPositionFromPoint&&(i=this._doHitTestWithCaretPositionFromPoint(e,t.pos.toClientCoordinates(Te(e.viewDomNode)))),i.type===1){const n=e.viewModel.getInjectedTextAt(i.position),o=e.viewModel.normalizePosition(i.position,2);(n||!o.equals(i.position))&&(i=new WU(o,i.spanNode,n))}return i}}function _ge(s,e,t){const i=document.createRange();let n=s.elementFromPoint(e,t);if(n!==null){for(;n&&n.firstChild&&n.firstChild.nodeType!==n.firstChild.TEXT_NODE&&n.lastChild&&n.lastChild.firstChild;)n=n.lastChild;const o=n.getBoundingClientRect(),r=Te(n),a=r.getComputedStyle(n,null).getPropertyValue("font-style"),l=r.getComputedStyle(n,null).getPropertyValue("font-variant"),d=r.getComputedStyle(n,null).getPropertyValue("font-weight"),c=r.getComputedStyle(n,null).getPropertyValue("font-size"),u=r.getComputedStyle(n,null).getPropertyValue("line-height"),h=r.getComputedStyle(n,null).getPropertyValue("font-family"),g=`${a} ${l} ${d} ${c}/${u} ${h}`,f=n.innerText;let m=o.left,_=0,v;if(e>o.left+o.width)_=f.length;else{const b=Xg.getInstance();for(let C=0;C=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Xt;(function(s){s.Tap="-monaco-gesturetap",s.Change="-monaco-gesturechange",s.Start="-monaco-gesturestart",s.End="-monaco-gesturesend",s.Contextmenu="-monaco-gesturecontextmenu"})(Xt||(Xt={}));class Gt extends H{constructor(){super(),this.dispatched=!1,this.targets=new Rs,this.ignoreTargets=new Rs,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(le.runAndSubscribe(JL,({window:e,disposables:t})=>{t.add(K(e.document,"touchstart",i=>this.onTouchStart(i),{passive:!1})),t.add(K(e.document,"touchend",i=>this.onTouchEnd(e,i))),t.add(K(e.document,"touchmove",i=>this.onTouchMove(i),{passive:!1}))},{window:Ht,disposables:this._store}))}static addTarget(e){if(!Gt.isTouchDevice())return H.None;Gt.INSTANCE||(Gt.INSTANCE=new Gt);const t=Gt.INSTANCE.targets.push(e);return Ie(t)}static ignoreTarget(e){if(!Gt.isTouchDevice())return H.None;Gt.INSTANCE||(Gt.INSTANCE=new Gt);const t=Gt.INSTANCE.ignoreTargets.push(e);return Ie(t)}static isTouchDevice(){return"ontouchstart"in Ht||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=Gt.HOLD_DELAY&&Math.abs(l.initialPageX-mr(l.rollingPageX))<30&&Math.abs(l.initialPageY-mr(l.rollingPageY))<30){const c=this.newGestureEvent(Xt.Contextmenu,l.initialTarget);c.pageX=mr(l.rollingPageX),c.pageY=mr(l.rollingPageY),this.dispatchEvent(c)}else if(n===1){const c=mr(l.rollingPageX),u=mr(l.rollingPageY),h=mr(l.rollingTimestamps)-l.rollingTimestamps[0],g=c-l.rollingPageX[0],f=u-l.rollingPageY[0],m=[...this.targets].filter(_=>l.initialTarget instanceof Node&&_.contains(l.initialTarget));this.inertia(e,m,i,Math.abs(g)/h,g>0?1:-1,c,Math.abs(f)/h,f>0?1:-1,u)}this.dispatchEvent(this.newGestureEvent(Xt.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===Xt.Tap){const t=new Date().getTime();let i=0;t-this._lastSetTapCountTime>Gt.CLEAR_TAP_COUNT_TIME?i=1:i=2,this._lastSetTapCountTime=t,e.tapCount=i}else(e.type===Xt.Change||e.type===Xt.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,o=e.initialTarget;for(;o&&o!==i;)n++,o=o.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,o,r,a,l,d){this.handle=Ao(e,()=>{const c=Date.now(),u=c-i;let h=0,g=0,f=!0;n+=Gt.SCROLL_FRICTION*u,a+=Gt.SCROLL_FRICTION*u,n>0&&(f=!1,h=o*n*u),a>0&&(f=!1,g=l*a*u);const m=this.newGestureEvent(Xt.Change);m.translationX=h,m.translationY=g,t.forEach(_=>_.dispatchEvent(m)),f||this.inertia(e,t,c,n,o,r+h,a,l,d+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(o.pageX),r.rollingPageY.push(o.pageY),r.rollingTimestamps.push(t)}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}}Gt.SCROLL_FRICTION=-.005;Gt.HOLD_DELAY=700;Gt.CLEAR_TAP_COUNT_TIME=400;vge([zi],Gt,"isTouchDevice",null);let fr=class extends H{onclick(e,t){this._register(K(e,ee.CLICK,i=>t(new ra(Te(e),i))))}onmousedown(e,t){this._register(K(e,ee.MOUSE_DOWN,i=>t(new ra(Te(e),i))))}onmouseover(e,t){this._register(K(e,ee.MOUSE_OVER,i=>t(new ra(Te(e),i))))}onmouseleave(e,t){this._register(K(e,ee.MOUSE_LEAVE,i=>t(new ra(Te(e),i))))}onkeydown(e,t){this._register(K(e,ee.KEY_DOWN,i=>t(new Kt(i))))}onkeyup(e,t){this._register(K(e,ee.KEY_UP,i=>t(new Kt(i))))}oninput(e,t){this._register(K(e,ee.INPUT,t))}onblur(e,t){this._register(K(e,ee.BLUR,t))}onfocus(e,t){this._register(K(e,ee.FOCUS,t))}ignoreGesture(e){return Gt.ignoreTarget(e)}};const b_=11;class bge extends fr{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(...Pe.asClassNameArray(e.icon)),this.domNode.style.position="absolute",this.domNode.style.width=b_+"px",this.domNode.style.height=b_+"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 c0),this._register(Ni(this.bgDomNode,ee.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._register(Ni(this.domNode,ee.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._pointerdownRepeatTimer=this._register(new lF),this._pointerdownScheduleRepeatTimer=this._register(new ya)}_arrowPointerDown(e){if(!e.target||!(e.target instanceof Element))return;const t=()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,Te(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 Cge extends H{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 ya)}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(()=>{var e;(e=this._domNode)===null||e===void 0||e.setClassName(this._visibleClassName)},0))}_hide(e){var t;this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,(t=this._domNode)===null||t===void 0||t.setClassName(this._invisibleClassName+(e?" fade":"")))}}const wge=140;class HU extends fr{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 Cge(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new c0),this._shouldRender=!0,this.domNode=It(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(K(this.domNode.domNode,ee.POINTER_DOWN,t=>this._domNodePointerDown(t)))}_createArrow(e){const t=this._register(new bge(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,i,n){this.slider=It(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(K(this.slider.domNode,ee.POINTER_DOWN,o=>{o.button===0&&(o.preventDefault(),this._sliderPointerDown(o))})),this.onclick(this.slider.domNode,o=>{o.leftButton&&o.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(),o=this._sliderPointerPosition(e);i<=o&&o<=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 o=qi(this.domNode.domNode);t=e.pageX-o.left,i=e.pageY-o.top}const n=this._pointerDownRelativePosition(t,i);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(n):this._scrollbarState.getDesiredScrollPositionFromOffset(n)),e.button===0&&(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,o=>{const r=this._sliderOrthogonalPointerPosition(o),a=Math.abs(r-i);if(as&&a>wge){this._setDesiredScrollPositionNow(n.getScrollPosition());return}const d=this._sliderPointerPosition(o)-t;this._setDesiredScrollPositionNow(n.getDesiredScrollPositionFromDelta(d))},()=>{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 yge=20;class C_{constructor(e,t,i,n,o,r){this._scrollbarSize=Math.round(t),this._oppositeScrollbarSize=Math.round(i),this._arrowSize=Math.round(e),this._visibleSize=n,this._scrollSize=o,this._scrollPosition=r,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new C_(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,o){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 d=Math.round(Math.max(yge,Math.floor(i*a/n))),c=(a-d)/(n-i),u=o*c;return{computedAvailableSize:Math.round(r),computedIsNeeded:l,computedSliderSize:Math.round(d),computedSliderRatio:c,computedSliderPosition:Math.round(u)}}_refreshComputedValues(){const e=C_._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 yf(null,1,0))}),this._createArrow({className:"scra",icon:oe.scrollbarButtonRight,top:a,left:void 0,bottom:void 0,right:r,bgWidth:t.arrowSize,bgHeight:t.horizontalScrollbarSize,onActivate:()=>this._host.onMouseWheel(new yf(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 Dge extends HU{constructor(e,t,i){const n=e.getScrollDimensions(),o=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:i,scrollbarState:new C_(t.verticalHasArrows?t.arrowSize:0,t.vertical===2?0:t.verticalScrollbarSize,0,n.height,n.scrollHeight,o.scrollTop),visibility:t.vertical,extraScrollbarClassName:"vertical",scrollable:e,scrollByPage:t.scrollByPage}),t.verticalHasArrows){const r=(t.arrowSize-b_)/2,a=(t.verticalScrollbarSize-b_)/2;this._createArrow({className:"scra",icon:oe.scrollbarButtonUp,top:r,left:a,bottom:void 0,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new yf(null,0,1))}),this._createArrow({className:"scra",icon:oe.scrollbarButtonDown,top:void 0,left:a,bottom:r,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new yf(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 nD{constructor(e,t,i,n,o,r,a){this._forceIntegerValues=e,this._scrollStateBrand=void 0,this._forceIntegerValues&&(t=t|0,i=i|0,n=n|0,o=o|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),o<0&&(o=0),a+o>r&&(a=r-o),a<0&&(a=0),this.width=t,this.scrollWidth=i,this.scrollLeft=n,this.height=o,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 nD(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 nD(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,o=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:o,heightChanged:r,scrollHeightChanged:a,scrollTopChanged:l}}}class u0 extends H{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new B),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new nD(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){var i;const n=this._state.withScrollDimensions(e,t);this._setState(n,!!this._smoothScrolling),(i=this._smoothScrolling)===null||i===void 0||i.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 Qb(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=Qb.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 FB{constructor(e,t,i){this.scrollLeft=e,this.scrollTop=t,this.isDone=i}}function cI(s,e){const t=e-s;return function(i){return s+t*kge(i)}}function Lge(s,e,t){return function(i){return i2.5*i){let o,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),o=Math.abs(e.deltaY),r=Math.abs(t.deltaX),a=Math.abs(t.deltaY),l=Math.max(Math.min(n,r),1),d=Math.max(Math.min(o,a),1),c=Math.max(n,r),u=Math.max(o,a);c%l===0&&u%d===0&&(i-=.5)}return Math.min(Math.max(i,0),1)}_isAlmostInt(e){return Math.abs(Math.round(e)-e)<.01}}sD.INSTANCE=new sD;class WF extends fr{get options(){return this._options}constructor(e,t,i){super(),this._onScroll=this._register(new B),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new B),e.style.overflow="hidden",this._options=Tge(t),this._scrollable=i,this._register(this._scrollable.onScroll(o=>{this._onWillScroll.fire(o),this._onDidScroll(o),this._onScroll.fire(o)}));const n={onMouseWheel:o=>this._onMouseWheel(o),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new Dge(this._scrollable,this._options,n)),this._horizontalScrollbar=this._register(new Sge(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=It(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=It(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=It(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,o=>this._onMouseOver(o)),this.onmouseleave(this._listenOnDomNode,o=>this._onMouseLeave(o)),this._hideTimeout=this._register(new ya),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}dispose(){this._mouseWheelToDispose=jt(this._mouseWheelToDispose),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,lt&&(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 yf(e))}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=jt(this._mouseWheelToDispose),e)){const i=n=>{this._onMouseWheel(new yf(n))};this._mouseWheelToDispose.push(K(this._listenOnDomNode,ee.MOUSE_WHEEL,i,{passive:!1}))}}_onMouseWheel(e){var t;if(!((t=e.browserEvent)===null||t===void 0)&&t.defaultPrevented)return;const i=sD.INSTANCE;i.acceptStandardWheelEvent(e);let n=!1;if(e.deltaY||e.deltaX){let r=e.deltaY*this._options.mouseWheelScrollSensitivity,a=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&a+r===0?a=r=0:Math.abs(r)>=Math.abs(a)?a=0:r=0),this._options.flipAxes&&([r,a]=[a,r]);const l=!lt&&e.browserEvent&&e.browserEvent.shiftKey;(this._options.scrollYToX||l)&&!a&&(a=r,r=0),e.browserEvent&&e.browserEvent.altKey&&(a=a*this._options.fastScrollSensitivity,r=r*this._options.fastScrollSensitivity);const d=this._scrollable.getFutureScrollPosition();let c={};if(r){const u=OB*r,h=d.scrollTop-(u<0?Math.floor(u):Math.ceil(u));this._verticalScrollbar.writeScrollPosition(c,h)}if(a){const u=OB*a,h=d.scrollLeft-(u<0?Math.floor(u):Math.ceil(u));this._horizontalScrollbar.writeScrollPosition(c,h)}c=this._scrollable.validateScrollPosition(c),(d.scrollLeft!==c.scrollLeft||d.scrollTop!==c.scrollTop)&&(this._options.mouseWheelSmoothScroll&&i.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(c):this._scrollable.setScrollPositionNow(c),n=!0)}let o=n;!o&&this._options.alwaysConsumeMouseWheel&&(o=!0),!o&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(o=!0),o&&(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":"",o=t?" top":"",r=i||t?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${n}`),this._topShadowDomNode.setClassName(`shadow${o}`),this._topLeftShadowDomNode.setClassName(`shadow${r}${o}${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(),Ege)}}class VU extends WF{constructor(e,t){t=t||{},t.mouseWheelSmoothScroll=!1;const i=new u0({forceIntegerValues:!0,smoothScrollDuration:0,scheduleAtNextAnimationFrame:n=>Ao(Te(e),n)});super(e,t,i),this._register(i)}setScrollPosition(e){this._scrollable.setScrollPositionNow(e)}}class Lx extends WF{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 C1 extends WF{constructor(e,t){t=t||{},t.mouseWheelSmoothScroll=!1;const i=new u0({forceIntegerValues:!1,smoothScrollDuration:0,scheduleAtNextAnimationFrame:n=>Ao(Te(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 Tge(s){const e={lazyRender:typeof s.lazyRender<"u"?s.lazyRender:!1,className:typeof s.className<"u"?s.className:"",useShadows:typeof s.useShadows<"u"?s.useShadows:!0,handleMouseWheel:typeof s.handleMouseWheel<"u"?s.handleMouseWheel:!0,flipAxes:typeof s.flipAxes<"u"?s.flipAxes:!1,consumeMouseWheelIfScrollbarIsNeeded:typeof s.consumeMouseWheelIfScrollbarIsNeeded<"u"?s.consumeMouseWheelIfScrollbarIsNeeded:!1,alwaysConsumeMouseWheel:typeof s.alwaysConsumeMouseWheel<"u"?s.alwaysConsumeMouseWheel:!1,scrollYToX:typeof s.scrollYToX<"u"?s.scrollYToX:!1,mouseWheelScrollSensitivity:typeof s.mouseWheelScrollSensitivity<"u"?s.mouseWheelScrollSensitivity:1,fastScrollSensitivity:typeof s.fastScrollSensitivity<"u"?s.fastScrollSensitivity:5,scrollPredominantAxis:typeof s.scrollPredominantAxis<"u"?s.scrollPredominantAxis:!0,mouseWheelSmoothScroll:typeof s.mouseWheelSmoothScroll<"u"?s.mouseWheelSmoothScroll:!0,arrowSize:typeof s.arrowSize<"u"?s.arrowSize:11,listenOnDomNode:typeof s.listenOnDomNode<"u"?s.listenOnDomNode:null,horizontal:typeof s.horizontal<"u"?s.horizontal:1,horizontalScrollbarSize:typeof s.horizontalScrollbarSize<"u"?s.horizontalScrollbarSize:10,horizontalSliderSize:typeof s.horizontalSliderSize<"u"?s.horizontalSliderSize:0,horizontalHasArrows:typeof s.horizontalHasArrows<"u"?s.horizontalHasArrows:!1,vertical:typeof s.vertical<"u"?s.vertical:1,verticalScrollbarSize:typeof s.verticalScrollbarSize<"u"?s.verticalScrollbarSize:10,verticalHasArrows:typeof s.verticalHasArrows<"u"?s.verticalHasArrows:!1,verticalSliderSize:typeof s.verticalSliderSize<"u"?s.verticalSliderSize:0,scrollByPage:typeof s.scrollByPage<"u"?s.scrollByPage:!1};return e.horizontalSliderSize=typeof s.horizontalSliderSize<"u"?s.horizontalSliderSize:e.horizontalScrollbarSize,e.verticalSliderSize=typeof s.verticalSliderSize<"u"?s.verticalSliderSize:e.verticalScrollbarSize,lt&&(e.className+=" mac"),e}class HF extends b1{constructor(e,t,i){super(),this._mouseLeaveMonitor=null,this._context=e,this.viewController=t,this.viewHelper=i,this.mouseTargetFactory=new fs(this._context,i),this._mouseDownOperation=this._register(new Nge(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(145).height;const n=new tge(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=K(this.viewHelper.viewDomNode.ownerDocument,"mousemove",a=>{this.viewHelper.viewDomNode.contains(a.target)||this._onMouseLeave(new Nh(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 o=0;this._register(n.onPointerDown(this.viewHelper.viewDomNode,(r,a)=>{o=a})),this._register(K(this.viewHelper.viewDomNode,ee.POINTER_UP,r=>{this._mouseDownOperation.onPointerUp()})),this._register(n.onMouseDown(this.viewHelper.viewDomNode,r=>this._onMouseDown(r,o))),this._setupMouseWheelZoomListener(),this._context.addEventHandler(this)}_setupMouseWheelZoomListener(){const e=sD.INSTANCE;let t=0,i=Sr.getZoomLevel(),n=!1,o=0;const r=l=>{if(this.viewController.emitMouseWheel(l),!this._context.configuration.options.get(76))return;const d=new yf(l);if(e.acceptStandardWheelEvent(d),e.isPhysicalMouseWheel()){if(a(l)){const c=Sr.getZoomLevel(),u=d.deltaY>0?1:-1;Sr.setZoomLevel(c+u),d.preventDefault(),d.stopPropagation()}}else Date.now()-t>50&&(i=Sr.getZoomLevel(),n=a(l),o=0),t=Date.now(),o+=d.deltaY,n&&(Sr.setZoomLevel(i+o/5),d.preventDefault(),d.stopPropagation())};this._register(K(this.viewHelper.viewDomNode,ee.MOUSE_WHEEL,r,{capture:!0,passive:!1}));function a(l){return lt?(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(145)){const t=this._context.configuration.options.get(145).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 FU(e,t).toPageCoordinates(Te(this.viewHelper.viewDomNode)),o=FF(this.viewHelper.viewDomNode);if(n.yo.y+o.height||n.xo.x+o.width)return null;const r=OF(this.viewHelper.viewDomNode,o,n);return this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(),o,n,r,null)}_createMouseTarget(e,t){let i=e.target;if(!this.viewHelper.viewDomNode.contains(i)){const n=Sf(this.viewHelper.viewDomNode);n&&(i=n.elementsFromPoint(e.posx,e.posy).find(o=>this.viewHelper.viewDomNode.contains(o)))}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(c&&(n||r&&a))u(),this._mouseDownOperation.start(i.type,e,t);else if(o)e.preventDefault();else if(l){const h=i.detail;c&&this.viewHelper.shouldSuppressMouseDownOnViewZone(h.viewZoneId)&&(u(),this._mouseDownOperation.start(i.type,e,t),e.preventDefault())}else d&&this.viewHelper.shouldSuppressMouseDownOnWidget(i.detail)&&(u(),e.preventDefault());this.viewController.emitMouseDown({event:e,target:i})}}class Nge extends H{constructor(e,t,i,n,o,r){super(),this._context=e,this._viewController=t,this._viewHelper=i,this._mouseTargetFactory=n,this._createMouseTarget=o,this._getMouseColumn=r,this._mouseMoveMonitor=this._register(new nge(this._viewHelper.viewDomNode)),this._topBottomDragScrolling=this._register(new Age(this._context,this._viewHelper,this._mouseTargetFactory,(a,l,d)=>this._dispatchMouse(a,l,d))),this._mouseState=new xx,this._currentSelection=new we(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._topBottomDragScrolling.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 o=this._context.configuration.options;if(!o.get(91)&&o.get(35)&&!o.get(22)&&!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);Iu(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()}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,o=this._getMouseColumn(e);if(e.posyt.y+t.height){const a=e.posy-t.y-t.height,l=n.getCurrentScrollTop()+e.relativePos.y,d=v_.getZoneAtCoord(this._context,l);if(d){const u=this._helpPositionJumpOverViewZone(d);if(u)return ms.createOutsideEditor(o,u,"below",a)}const c=n.getLineNumberAtVerticalOffset(l);return ms.createOutsideEditor(o,new W(c,i.getLineMaxColumn(c)),"below",a)}const r=n.getLineNumberAtVerticalOffset(n.getCurrentScrollTop()+e.relativePos.y);if(e.posxt.x+t.width){const a=e.posx-t.x-t.width;return ms.createOutsideEditor(o,new W(r,i.getLineMaxColumn(r)),"right",a)}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 ms.createViewZone(n.type,n.element,n.mouseColumn,r,n.detail)}return n}_helpPositionJumpOverViewZone(e){const t=new W(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 Age extends H{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=new Mge(this._context,this._viewHelper,this._mouseTargetFactory,this._dispatchMouse,e,t)}stop(){this._operation&&(this._operation.dispose(),this._operation=null)}}class Mge extends H{constructor(e,t,i,n,o,r){super(),this._context=e,this._viewHelper=t,this._mouseTargetFactory=i,this._dispatchMouse=n,this._position=o,this._mouseEvent=r,this._lastTime=Date.now(),this._animationFrameDisposable=Ao(Te(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}_getScrollSpeed(){const e=this._context.configuration.options.get(67),t=this._context.configuration.options.get(145).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(67),t=this._getScrollSpeed(),i=this._tick(),n=t*(i/1e3)*e,o=this._position.outsidePosition==="above"?-n:n;this._context.viewModel.viewLayout.deltaScrollNow(0,o),this._viewHelper.renderNow();const r=this._context.viewLayout.getLinesViewportData(),a=this._position.outsidePosition==="above"?r.startLineNumber:r.endLineNumber;let l;{const d=FF(this._viewHelper.viewDomNode),c=this._context.configuration.options.get(145).horizontalScrollbarHeight,u=new yx(this._mouseEvent.pos.x,d.y+d.height-c-.1),h=OF(this._viewHelper.viewDomNode,d,u);l=this._mouseTargetFactory.createMouseTarget(this._viewHelper.getLastRenderData(),d,u,h,null)}(!l.position||l.position.lineNumber!==a)&&(this._position.outsidePosition==="above"?l=ms.createOutsideEditor(this._position.mouseColumn,new W(a,1),"above",this._position.outsideDistance):l=ms.createOutsideEditor(this._position.mouseColumn,new W(a,this._context.viewModel.getLineMaxColumn(a)),"below",this._position.outsideDistance)),this._dispatchMouse(l,!0,2),this._animationFrameDisposable=Ao(Te(l.element),()=>this._execute())}}class xx{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>xx.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)}}xx.CLEAR_MOUSE_DOWN_COUNT_TIME=400;class ht{get event(){return this.emitter.event}constructor(e,t,i){const n=o=>this.emitter.fire(o);this.emitter=new B({onWillAddFirstListener:()=>e.addEventListener(t,n,i),onDidRemoveLastListener:()=>e.removeEventListener(t,n,i)})}dispose(){this.emitter.dispose()}}class Bn{constructor(e,t,i,n,o){this.value=e,this.selectionStart=t,this.selectionEnd=i,this.selection=n,this.newlineCountBeforeSelection=o}toString(){return`[ <${this.value}>, selectionStart: ${this.selectionStart}, selectionEnd: ${this.selectionEnd}]`}static readFromTextArea(e,t){const i=e.getValue(),n=e.getSelectionStart(),o=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 Bn(i,n,o,null,r)}collapseSelection(){return this.selectionStart===this.value.length?this:new Bn(this.value,this.value.length,this.value.length,null,void 0)}writeToTextArea(e,t,i){t.setValue(e,this.value),i&&t.setSelectionRange(e,this.selectionStart,this.selectionEnd)}deduceEditorPosition(e){var t,i,n,o,r,a,l,d;if(e<=this.selectionStart){const h=this.value.substring(e,this.selectionStart);return this._finishDeduceEditorPosition((i=(t=this.selection)===null||t===void 0?void 0:t.getStartPosition())!==null&&i!==void 0?i:null,h,-1)}if(e>=this.selectionEnd){const h=this.value.substring(this.selectionEnd,e);return this._finishDeduceEditorPosition((o=(n=this.selection)===null||n===void 0?void 0:n.getEndPosition())!==null&&o!==void 0?o:null,h,1)}const c=this.value.substring(this.selectionStart,e);if(c.indexOf("…")===-1)return this._finishDeduceEditorPosition((a=(r=this.selection)===null||r===void 0?void 0:r.getStartPosition())!==null&&a!==void 0?a:null,c,1);const u=this.value.substring(e,this.selectionEnd);return this._finishDeduceEditorPosition((d=(l=this.selection)===null||l===void 0?void 0:l.getEndPosition())!==null&&d!==void 0?d:null,u,-1)}_finishDeduceEditorPosition(e,t,i){let n=0,o=-1;for(;(o=t.indexOf(` `,o+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(Sh(e.value,t.value),e.selectionStart,t.selectionStart),o=Math.min(BS(e.value,t.value),e.value.length-e.selectionEnd,t.value.length-t.selectionEnd);e.value.substring(n,e.value.length-o);const r=t.value.substring(n,t.value.length-o),a=e.selectionStart-n,l=e.selectionEnd-n,d=t.selectionStart-n,c=t.selectionEnd-n;if(d===c){const h=e.selectionStart-n;return{text:r,replacePrevCharCnt:h,replaceNextCharCnt:0,positionDelta:0}}const u=l-a;return{text:r,replacePrevCharCnt:u,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(Sh(e.value,t.value),e.selectionEnd),n=Math.min(BS(e.value,t.value),e.value.length-e.selectionEnd),o=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:o.length-a,positionDelta:l-r.length}}}Bn.EMPTY=new Bn("",0,0,null,void 0);class um{static _getPageOfLine(e,t){return Math.floor((e-1)/t)}static _getRangeForPage(e,t){const i=e*t,n=i+1,o=i+t;return new x(n,1,o+1,1)}static fromEditorSelection(e,t,i,n){const r=um._getPageOfLine(t.startLineNumber,i),a=um._getRangeForPage(r,i),l=um._getPageOfLine(t.endLineNumber,i),d=um._getRangeForPage(l,i);let c=a.intersectRanges(new x(1,1,t.startLineNumber,t.startColumn));if(n&&e.getValueLengthInRange(c,1)>500){const v=e.modifyPosition(c.getEndPosition(),-500);c=x.fromPositions(v,c.getEndPosition())}const u=e.getValueInRange(c,1),h=e.getLineCount(),g=e.getLineMaxColumn(h);let f=d.intersectRanges(new x(t.endLineNumber,t.endColumn,h,g));if(n&&e.getValueLengthInRange(f,1)>500){const v=e.modifyPosition(f.getStartPosition(),500);f=x.fromPositions(f.getStartPosition(),v)}const m=e.getValueInRange(f,1);let _;if(r===l||r+1===l)_=e.getValueInRange(t,1);else{const v=a.intersectRanges(t),b=d.intersectRanges(t);_=e.getValueInRange(v,1)+"…"+e.getValueInRange(b,1)}return n&&_.length>2*500&&(_=_.substring(0,500)+"…"+_.substring(_.length-500,_.length)),new Bn(u+_+m,u.length,u.length+_.length,t,c.endLineNumber-c.startLineNumber)}}var Rge=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},BB=function(s,e){return function(t,i){e(t,i,s)}},oD;(function(s){s.Tap="-monaco-textarea-synthetic-tap"})(oD||(oD={}));const TA={forceCopyWithSyntaxHighlighting:!1};class Jb{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)}}Jb.INSTANCE=new Jb;class Pge{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 NA=class extends H{get textAreaState(){return this._textAreaState}constructor(e,t,i,n,o,r){super(),this._host=e,this._textArea=t,this._OS=i,this._browser=n,this._accessibilityService=o,this._logService=r,this._onFocus=this._register(new B),this.onFocus=this._onFocus.event,this._onBlur=this._register(new B),this.onBlur=this._onBlur.event,this._onKeyDown=this._register(new B),this.onKeyDown=this._onKeyDown.event,this._onKeyUp=this._register(new B),this.onKeyUp=this._onKeyUp.event,this._onCut=this._register(new B),this.onCut=this._onCut.event,this._onPaste=this._register(new B),this.onPaste=this._onPaste.event,this._onType=this._register(new B),this.onType=this._onType.event,this._onCompositionStart=this._register(new B),this.onCompositionStart=this._onCompositionStart.event,this._onCompositionUpdate=this._register(new B),this.onCompositionUpdate=this._onCompositionUpdate.event,this._onCompositionEnd=this._register(new B),this.onCompositionEnd=this._onCompositionEnd.event,this._onSelectionChangeRequest=this._register(new B),this.onSelectionChangeRequest=this._onSelectionChangeRequest.event,this._asyncFocusGainWriteScreenReaderContent=this._register(new $n),this._asyncTriggerCut=this._register(new Wt(()=>this._onCut.fire(),0)),this._textAreaState=Bn.EMPTY,this._selectionChangeListener=null,this._accessibilityService.isScreenReaderOptimized()&&this.writeNativeTextAreaContent("ctor"),this._register(le.runAndSubscribe(this._accessibilityService.onDidChangeScreenReaderOptimized,()=>{this._accessibilityService.isScreenReaderOptimized()&&!this._asyncFocusGainWriteScreenReaderContent.value?this._asyncFocusGainWriteScreenReaderContent.value=this._register(new Wt(()=>this.writeNativeTextAreaContent("asyncFocusGain"),0)):this._asyncFocusGainWriteScreenReaderContent.clear()})),this._hasFocus=!1,this._currentComposition=null;let a=null;this._register(this._textArea.onKeyDown(l=>{const d=new Kt(l);(d.keyCode===114||this._currentComposition&&d.keyCode===1)&&d.stopPropagation(),d.equals(9)&&d.preventDefault(),a=d,this._onKeyDown.fire(d)})),this._register(this._textArea.onKeyUp(l=>{const d=new Kt(l);this._onKeyUp.fire(d)})),this._register(this._textArea.onCompositionStart(l=>{const d=new Pge;if(this._currentComposition){this._currentComposition=d;return}if(this._currentComposition=d,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")){d.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 d=this._currentComposition;if(!d)return;if(this._browser.isAndroid){const u=Bn.readFromTextArea(this._textArea,this._textAreaState),h=Bn.deduceAndroidCompositionInput(this._textAreaState,u);this._textAreaState=u,this._onType.fire(h),this._onCompositionUpdate.fire(l);return}const c=d.handleCompositionUpdate(l.data);this._textAreaState=Bn.readFromTextArea(this._textArea,this._textAreaState),this._onType.fire(c),this._onCompositionUpdate.fire(l)})),this._register(this._textArea.onCompositionEnd(l=>{const d=this._currentComposition;if(!d)return;if(this._currentComposition=null,this._browser.isAndroid){const u=Bn.readFromTextArea(this._textArea,this._textAreaState),h=Bn.deduceAndroidCompositionInput(this._textAreaState,u);this._textAreaState=u,this._onType.fire(h),this._onCompositionEnd.fire();return}const c=d.handleCompositionUpdate(l.data);this._textAreaState=Bn.readFromTextArea(this._textArea,this._textAreaState),this._onType.fire(c),this._onCompositionEnd.fire()})),this._register(this._textArea.onInput(l=>{if(this._textArea.setIgnoreSelectionChangeTime("received input event"),this._currentComposition)return;const d=Bn.readFromTextArea(this._textArea,this._textAreaState),c=Bn.deduceInput(this._textAreaState,d,this._OS===2);c.replacePrevCharCnt===0&&c.text.length===1&&(Cn(c.text.charCodeAt(0))||c.text.charCodeAt(0)===127)||(this._textAreaState=d,(c.text!==""||c.replacePrevCharCnt!==0||c.replaceNextCharCnt!==0||c.positionDelta!==0)&&this._onType.fire(c))})),this._register(this._textArea.onCut(l=>{this._textArea.setIgnoreSelectionChangeTime("received cut event"),this._ensureClipboardGetsEditorSelection(l),this._asyncTriggerCut.schedule()})),this._register(this._textArea.onCopy(l=>{this._ensureClipboardGetsEditorSelection(l)})),this._register(this._textArea.onPaste(l=>{if(this._textArea.setIgnoreSelectionChangeTime("received paste event"),l.preventDefault(),!l.clipboardData)return;let[d,c]=AA.getTextData(l.clipboardData);d&&(c=c||Jb.INSTANCE.get(d),this._onPaste.fire({text:d,metadata:c}))})),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 Wt(()=>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 K(this._textArea.ownerDocument,"selectionchange",t=>{if(Hu.onSelectionChange(),!this._hasFocus||this._currentComposition||!this._browser.isChrome)return;const i=Date.now(),n=i-e;if(e=i,n<5)return;const o=i-this._textArea.getIgnoreSelectionChangeTime();if(this._textArea.resetSelectionChangeTime(),o<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 d=this._textAreaState.deduceEditorPosition(a),c=this._host.deduceModelPosition(d[0],d[1],d[2]),u=this._textAreaState.deduceEditorPosition(l),h=this._host.deduceModelPosition(u[0],u[1],u[2]),g=new we(c.lineNumber,c.column,h.lineNumber,h.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.writeToTextArea(e,this._textArea,this._hasFocus),this._textAreaState=t}writeNativeTextAreaContent(e){!this._accessibilityService.isScreenReaderOptimized()&&e==="render"||this._currentComposition||(this._logService.trace(`writeTextAreaState(reason: ${e})`),this._setAndWriteTextAreaState(e,this._host.getScreenReaderContent()))}_ensureClipboardGetsEditorSelection(e){const t=this._host.getDataToCopy(),i={version:1,isFromEmptySelection:t.isFromEmptySelection,multicursorText:t.multicursorText,mode:t.mode};Jb.INSTANCE.set(this._browser.isFirefox?t.text.replace(/\r\n/g,` `):t.text,i),e.preventDefault(),e.clipboardData&&AA.setTextData(e.clipboardData,t.text,t.html,i)}};NA=Rge([BB(4,gr),BB(5,ys)],NA);const AA={getTextData(s){const e=s.getData(Ti.text);let t=null;const i=s.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&&s.files.length>0?[Array.prototype.slice.call(s.files,0).map(o=>o.name).join(` `),null]:[e,t]},setTextData(s,e,t,i){s.setData(Ti.text,e),typeof t=="string"&&s.setData("text/html",t),s.setData("vscode-editor-data",JSON.stringify(i))}};class Fge extends H{get ownerDocument(){return this._actual.ownerDocument}constructor(e){super(),this._actual=e,this.onKeyDown=this._register(new ht(this._actual,"keydown")).event,this.onKeyUp=this._register(new ht(this._actual,"keyup")).event,this.onCompositionStart=this._register(new ht(this._actual,"compositionstart")).event,this.onCompositionUpdate=this._register(new ht(this._actual,"compositionupdate")).event,this.onCompositionEnd=this._register(new ht(this._actual,"compositionend")).event,this.onBeforeInput=this._register(new ht(this._actual,"beforeinput")).event,this.onInput=this._register(new ht(this._actual,"input")).event,this.onCut=this._register(new ht(this._actual,"cut")).event,this.onCopy=this._register(new ht(this._actual,"copy")).event,this.onPaste=this._register(new ht(this._actual,"paste")).event,this.onFocus=this._register(new ht(this._actual,"focus")).event,this.onBlur=this._register(new ht(this._actual,"blur")).event,this._onSyntheticTap=this._register(new B),this.onSyntheticTap=this._onSyntheticTap.event,this._ignoreSelectionChangeTime=0,this._register(this.onKeyDown(()=>Hu.onKeyDown())),this._register(this.onBeforeInput(()=>Hu.onBeforeInput())),this._register(this.onInput(()=>Hu.onInput())),this._register(this.onKeyUp(()=>Hu.onKeyUp())),this._register(K(this._actual,oD.Tap,()=>this._onSyntheticTap.fire()))}hasFocus(){const e=Sf(this._actual);return e?e.activeElement===this._actual:this._actual.isConnected?Xn()===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 o=null;const r=Sf(n);r?o=r.activeElement:o=Xn();const a=Te(o),l=o===n,d=n.selectionStart,c=n.selectionEnd;if(l&&d===t&&c===i){Fr&&a.parent!==a&&n.focus();return}if(l){this.setIgnoreSelectionChangeTime("setSelectionRange"),n.setSelectionRange(t,i),Fr&&a.parent!==a&&n.focus();return}try{const u=Kae(n);this.setIgnoreSelectionChangeTime("setSelectionRange"),n.focus(),n.setSelectionRange(t,i),qae(n,u)}catch{}}}class Oge extends HF{constructor(e,t,i){super(e,t,i),this._register(Gt.addTarget(this.viewHelper.linesContentDomNode)),this._register(K(this.viewHelper.linesContentDomNode,Xt.Tap,o=>this.onTap(o))),this._register(K(this.viewHelper.linesContentDomNode,Xt.Change,o=>this.onChange(o))),this._register(K(this.viewHelper.linesContentDomNode,Xt.Contextmenu,o=>this._onContextMenu(new Nh(o,!1,this.viewHelper.viewDomNode),!1))),this._lastPointerType="mouse",this._register(K(this.viewHelper.linesContentDomNode,"pointerdown",o=>{const r=o.pointerType;if(r==="mouse"){this._lastPointerType="mouse";return}else r==="touch"?this._lastPointerType="touch":this._lastPointerType="pen"}));const n=new ige(this.viewHelper.viewDomNode);this._register(n.onPointerMove(this.viewHelper.viewDomNode,o=>this._onMouseMove(o))),this._register(n.onPointerUp(this.viewHelper.viewDomNode,o=>this._onMouseUp(o))),this._register(n.onPointerLeave(this.viewHelper.viewDomNode,o=>this._onMouseLeave(o))),this._register(n.onPointerDown(this.viewHelper.viewDomNode,(o,r)=>this._onMouseDown(o,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 Nh(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 Bge extends HF{constructor(e,t,i){super(e,t,i),this._register(Gt.addTarget(this.viewHelper.linesContentDomNode)),this._register(K(this.viewHelper.linesContentDomNode,Xt.Tap,n=>this.onTap(n))),this._register(K(this.viewHelper.linesContentDomNode,Xt.Change,n=>this.onChange(n))),this._register(K(this.viewHelper.linesContentDomNode,Xt.Contextmenu,n=>this._onContextMenu(new Nh(n,!1,this.viewHelper.viewDomNode),!1)))}onTap(e){e.preventDefault(),this.viewHelper.focusTextArea();const t=this._createMouseTarget(new Nh(e,!1,this.viewHelper.viewDomNode),!1);if(t.position){const i=document.createEvent("CustomEvent");i.initEvent(oD.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 Wge extends H{constructor(e,t,i){super(),(_d||jse&&RV)&&nF.pointerEvents?this.handler=this._register(new Oge(e,t,i)):Ht.TouchEvent?this.handler=this._register(new Bge(e,t,i)):this.handler=this._register(new HF(e,t,i))}getTargetAtClientPoint(e,t){return this.handler.getTargetAtClientPoint(e,t)}}class lp extends b1{}const _n=ut("themeService");function Ei(s){return{id:s}}function MA(s){switch(s){case Nr.DARK:return"vs-dark";case Nr.HIGH_CONTRAST_DARK:return"hc-black";case Nr.HIGH_CONTRAST_LIGHT:return"hc-light";default:return"vs"}}const zU={ThemingContribution:"base.contributions.theming"};class Hge{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new B}onColorThemeChange(e){return this.themingParticipants.push(e),this.onThemingParticipantAddedEmitter.fire(e),Ie(()=>{const t=this.themingParticipants.indexOf(e);this.themingParticipants.splice(t,1)})}getThemingParticipants(){return this.themingParticipants}}const UU=new Hge;Ji.add(zU.ThemingContribution,UU);function zr(s){return UU.onColorThemeChange(s)}class Vge extends H{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 $U=N("editor.lineHighlightBackground",{dark:null,light:null,hcDark:null,hcLight:null},p("lineHighlight","Background color for the highlight of line at the cursor position.")),WB=N("editor.lineHighlightBorder",{dark:"#282828",light:"#eeeeee",hcDark:"#f38518",hcLight:gt},p("lineHighlightBorderBox","Background color for the border around the line at the cursor position."));N("editor.rangeHighlightBackground",{dark:"#ffffff0b",light:"#fdff0033",hcDark:null,hcLight:null},p("rangeHighlight","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);N("editor.rangeHighlightBorder",{dark:null,light:null,hcDark:di,hcLight:di},p("rangeHighlightBorder","Background color of the border around highlighted ranges."));N("editor.symbolHighlightBackground",{dark:pc,light:pc,hcDark:null,hcLight:null},p("symbolHighlight","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);N("editor.symbolHighlightBorder",{dark:null,light:null,hcDark:di,hcLight:di},p("symbolHighlightBorder","Background color of the border around highlighted symbols."));const id=N("editorCursor.foreground",{dark:"#AEAFAD",light:$.black,hcDark:$.white,hcLight:"#0F4A85"},p("caret","Color of the editor cursor.")),wc=N("editorCursor.background",null,p("editorCursorBackground","The background color of the editor cursor. Allows customizing the color of a character overlapped by a block cursor.")),jU=N("editorMultiCursor.primary.foreground",{dark:id,light:id,hcDark:id,hcLight:id},p("editorMultiCursorPrimaryForeground","Color of the primary editor cursor when multiple cursors are present.")),zge=N("editorMultiCursor.primary.background",{dark:wc,light:wc,hcDark:wc,hcLight:wc},p("editorMultiCursorPrimaryBackground","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.")),KU=N("editorMultiCursor.secondary.foreground",{dark:id,light:id,hcDark:id,hcLight:id},p("editorMultiCursorSecondaryForeground","Color of secondary editor cursors when multiple cursors are present.")),Uge=N("editorMultiCursor.secondary.background",{dark:wc,light:wc,hcDark:wc,hcLight:wc},p("editorMultiCursorSecondaryBackground","The background color of secondary editor cursors when multiple cursors are present. Allows customizing the color of a character overlapped by a block cursor.")),yc=N("editorWhitespace.foreground",{dark:"#e3e4e229",light:"#33333333",hcDark:"#e3e4e229",hcLight:"#CCCCCC"},p("editorWhitespaces","Color of whitespace characters in the editor.")),$ge=N("editorLineNumber.foreground",{dark:"#858585",light:"#237893",hcDark:$.white,hcLight:"#292929"},p("editorLineNumbers","Color of editor line numbers.")),Sw=N("editorIndentGuide.background",{dark:yc,light:yc,hcDark:yc,hcLight:yc},p("editorIndentGuides","Color of the editor indentation guides."),!1,p("deprecatedEditorIndentGuides","'editorIndentGuide.background' is deprecated. Use 'editorIndentGuide.background1' instead.")),Dw=N("editorIndentGuide.activeBackground",{dark:yc,light:yc,hcDark:yc,hcLight:yc},p("editorActiveIndentGuide","Color of the active editor indentation guides."),!1,p("deprecatedEditorActiveIndentGuide","'editorIndentGuide.activeBackground' is deprecated. Use 'editorIndentGuide.activeBackground1' instead.")),w1=N("editorIndentGuide.background1",{dark:Sw,light:Sw,hcDark:Sw,hcLight:Sw},p("editorIndentGuides1","Color of the editor indentation guides (1).")),jge=N("editorIndentGuide.background2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},p("editorIndentGuides2","Color of the editor indentation guides (2).")),Kge=N("editorIndentGuide.background3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},p("editorIndentGuides3","Color of the editor indentation guides (3).")),qge=N("editorIndentGuide.background4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},p("editorIndentGuides4","Color of the editor indentation guides (4).")),Gge=N("editorIndentGuide.background5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},p("editorIndentGuides5","Color of the editor indentation guides (5).")),Zge=N("editorIndentGuide.background6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},p("editorIndentGuides6","Color of the editor indentation guides (6).")),y1=N("editorIndentGuide.activeBackground1",{dark:Dw,light:Dw,hcDark:Dw,hcLight:Dw},p("editorActiveIndentGuide1","Color of the active editor indentation guides (1).")),Xge=N("editorIndentGuide.activeBackground2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},p("editorActiveIndentGuide2","Color of the active editor indentation guides (2).")),Yge=N("editorIndentGuide.activeBackground3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},p("editorActiveIndentGuide3","Color of the active editor indentation guides (3).")),Qge=N("editorIndentGuide.activeBackground4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},p("editorActiveIndentGuide4","Color of the active editor indentation guides (4).")),Jge=N("editorIndentGuide.activeBackground5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},p("editorActiveIndentGuide5","Color of the active editor indentation guides (5).")),efe=N("editorIndentGuide.activeBackground6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},p("editorActiveIndentGuide6","Color of the active editor indentation guides (6).")),Lw=N("editorActiveLineNumber.foreground",{dark:"#c6c6c6",light:"#0B216F",hcDark:di,hcLight:di},p("editorActiveLineNumber","Color of editor active line number"),!1,p("deprecatedEditorActiveLineNumber","Id is deprecated. Use 'editorLineNumber.activeForeground' instead."));N("editorLineNumber.activeForeground",{dark:Lw,light:Lw,hcDark:Lw,hcLight:Lw},p("editorActiveLineNumber","Color of editor active line number"));const tfe=N("editorLineNumber.dimmedForeground",{dark:null,light:null,hcDark:null,hcLight:null},p("editorDimmedLineNumber","Color of the final editor line when editor.renderFinalNewline is set to dimmed."));N("editorRuler.foreground",{dark:"#5A5A5A",light:$.lightgrey,hcDark:$.white,hcLight:"#292929"},p("editorRuler","Color of the editor rulers."));N("editorCodeLens.foreground",{dark:"#999999",light:"#919191",hcDark:"#999999",hcLight:"#292929"},p("editorCodeLensForeground","Foreground color of editor CodeLens"));N("editorBracketMatch.background",{dark:"#0064001a",light:"#0064001a",hcDark:"#0064001a",hcLight:"#0000"},p("editorBracketMatchBackground","Background color behind matching brackets"));N("editorBracketMatch.border",{dark:"#888",light:"#B9B9B9",hcDark:gt,hcLight:gt},p("editorBracketMatchBorder","Color for matching brackets boxes"));const ife=N("editorOverviewRuler.border",{dark:"#7f7f7f4d",light:"#7f7f7f4d",hcDark:"#7f7f7f4d",hcLight:"#666666"},p("editorOverviewRulerBorder","Color of the overview ruler border.")),nfe=N("editorOverviewRuler.background",null,p("editorOverviewRulerBackground","Background color of the editor overview ruler."));N("editorGutter.background",{dark:Sn,light:Sn,hcDark:Sn,hcLight:Sn},p("editorGutter","Background color of the editor gutter. The gutter contains the glyph margins and the line numbers."));N("editorUnnecessaryCode.border",{dark:null,light:null,hcDark:$.fromHex("#fff").transparent(.8),hcLight:gt},p("unnecessaryCodeBorder","Border color of unnecessary (unused) source code in the editor."));const sfe=N("editorUnnecessaryCode.opacity",{dark:$.fromHex("#000a"),light:$.fromHex("#0007"),hcDark:null,hcLight:null},p("unnecessaryCodeOpacity",`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.`));N("editorGhostText.border",{dark:null,light:null,hcDark:$.fromHex("#fff").transparent(.8),hcLight:$.fromHex("#292929").transparent(.8)},p("editorGhostTextBorder","Border color of ghost text in the editor."));N("editorGhostText.foreground",{dark:$.fromHex("#ffffff56"),light:$.fromHex("#0007"),hcDark:null,hcLight:null},p("editorGhostTextForeground","Foreground color of the ghost text in the editor."));N("editorGhostText.background",{dark:null,light:null,hcDark:null,hcLight:null},p("editorGhostTextBackground","Background color of the ghost text in the editor."));const xw=new $(new bt(0,122,204,.6)),ofe=N("editorOverviewRuler.rangeHighlightForeground",{dark:xw,light:xw,hcDark:xw,hcLight:xw},p("overviewRulerRangeHighlight","Overview ruler marker color for range highlights. The color must not be opaque so as not to hide underlying decorations."),!0),rfe=N("editorOverviewRuler.errorForeground",{dark:new $(new bt(255,18,18,.7)),light:new $(new bt(255,18,18,.7)),hcDark:new $(new bt(255,50,50,1)),hcLight:"#B5200D"},p("overviewRuleError","Overview ruler marker color for errors.")),afe=N("editorOverviewRuler.warningForeground",{dark:vs,light:vs,hcDark:Zb,hcLight:Zb},p("overviewRuleWarning","Overview ruler marker color for warnings.")),lfe=N("editorOverviewRuler.infoForeground",{dark:ro,light:ro,hcDark:Xb,hcLight:Xb},p("overviewRuleInfo","Overview ruler marker color for infos.")),qU=N("editorBracketHighlight.foreground1",{dark:"#FFD700",light:"#0431FAFF",hcDark:"#FFD700",hcLight:"#0431FAFF"},p("editorBracketHighlightForeground1","Foreground color of brackets (1). Requires enabling bracket pair colorization.")),GU=N("editorBracketHighlight.foreground2",{dark:"#DA70D6",light:"#319331FF",hcDark:"#DA70D6",hcLight:"#319331FF"},p("editorBracketHighlightForeground2","Foreground color of brackets (2). Requires enabling bracket pair colorization.")),ZU=N("editorBracketHighlight.foreground3",{dark:"#179FFF",light:"#7B3814FF",hcDark:"#87CEFA",hcLight:"#7B3814FF"},p("editorBracketHighlightForeground3","Foreground color of brackets (3). Requires enabling bracket pair colorization.")),XU=N("editorBracketHighlight.foreground4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},p("editorBracketHighlightForeground4","Foreground color of brackets (4). Requires enabling bracket pair colorization.")),YU=N("editorBracketHighlight.foreground5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},p("editorBracketHighlightForeground5","Foreground color of brackets (5). Requires enabling bracket pair colorization.")),QU=N("editorBracketHighlight.foreground6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},p("editorBracketHighlightForeground6","Foreground color of brackets (6). Requires enabling bracket pair colorization.")),dfe=N("editorBracketHighlight.unexpectedBracket.foreground",{dark:new $(new bt(255,18,18,.8)),light:new $(new bt(255,18,18,.8)),hcDark:new $(new bt(255,50,50,1)),hcLight:""},p("editorBracketHighlightUnexpectedBracketForeground","Foreground color of unexpected brackets.")),cfe=N("editorBracketPairGuide.background1",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},p("editorBracketPairGuide.background1","Background color of inactive bracket pair guides (1). Requires enabling bracket pair guides.")),ufe=N("editorBracketPairGuide.background2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},p("editorBracketPairGuide.background2","Background color of inactive bracket pair guides (2). Requires enabling bracket pair guides.")),hfe=N("editorBracketPairGuide.background3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},p("editorBracketPairGuide.background3","Background color of inactive bracket pair guides (3). Requires enabling bracket pair guides.")),gfe=N("editorBracketPairGuide.background4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},p("editorBracketPairGuide.background4","Background color of inactive bracket pair guides (4). Requires enabling bracket pair guides.")),ffe=N("editorBracketPairGuide.background5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},p("editorBracketPairGuide.background5","Background color of inactive bracket pair guides (5). Requires enabling bracket pair guides.")),pfe=N("editorBracketPairGuide.background6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},p("editorBracketPairGuide.background6","Background color of inactive bracket pair guides (6). Requires enabling bracket pair guides.")),mfe=N("editorBracketPairGuide.activeBackground1",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},p("editorBracketPairGuide.activeBackground1","Background color of active bracket pair guides (1). Requires enabling bracket pair guides.")),_fe=N("editorBracketPairGuide.activeBackground2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},p("editorBracketPairGuide.activeBackground2","Background color of active bracket pair guides (2). Requires enabling bracket pair guides.")),vfe=N("editorBracketPairGuide.activeBackground3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},p("editorBracketPairGuide.activeBackground3","Background color of active bracket pair guides (3). Requires enabling bracket pair guides.")),bfe=N("editorBracketPairGuide.activeBackground4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},p("editorBracketPairGuide.activeBackground4","Background color of active bracket pair guides (4). Requires enabling bracket pair guides.")),Cfe=N("editorBracketPairGuide.activeBackground5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},p("editorBracketPairGuide.activeBackground5","Background color of active bracket pair guides (5). Requires enabling bracket pair guides.")),wfe=N("editorBracketPairGuide.activeBackground6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},p("editorBracketPairGuide.activeBackground6","Background color of active bracket pair guides (6). Requires enabling bracket pair guides."));N("editorUnicodeHighlight.border",{dark:vs,light:vs,hcDark:vs,hcLight:vs},p("editorUnicodeHighlight.border","Border color used to highlight unicode characters."));N("editorUnicodeHighlight.background",{dark:bw,light:bw,hcDark:bw,hcLight:bw},p("editorUnicodeHighlight.background","Background color used to highlight unicode characters."));zr((s,e)=>{const t=s.getColor(Sn),i=s.getColor($U),n=i&&!i.isTransparent()?i:t;n&&e.addRule(`.monaco-editor .inputarea.ime-input { background-color: ${n}; }`)});class S1 extends lp{constructor(e){super(),this._context=e,this._readConfig(),this._lastCursorModelPosition=new W(1,1),this._renderResult=null,this._activeLineNumber=1,this._context.addEventHandler(this)}_readConfig(){const e=this._context.configuration.options;this._lineHeight=e.get(67);const t=e.get(68);this._renderLineNumbers=t.renderType,this._renderCustomLineNumbers=t.renderFn,this._renderFinalNewline=e.get(95);const i=e.get(145);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._activeLineNumber!==t.lineNumber&&(this._activeLineNumber=t.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 W(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=$s?this._lineHeight%2===0?" lh-even":" lh-odd":"",i=e.visibleRange.startLineNumber,n=e.visibleRange.endLineNumber,o=this._context.viewModel.getDecorationsInViewport(e.visibleRange).filter(d=>!!d.options.lineNumberClassName);o.sort((d,c)=>x.compareRangesUsingEnds(d.range,c.range));let r=0;const a=this._context.viewModel.getLineCount(),l=[];for(let d=i;d<=n;d++){const c=d-i;let u=this._getLineRenderLineNumber(d),h="";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]}}S1.CLASS_NAME="line-numbers";zr((s,e)=>{const t=s.getColor($ge),i=s.getColor(tfe);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)}; }`)});class xf extends Fo{constructor(e){super(e);const t=this._context.configuration.options,i=t.get(145);this._canUseLayerHinting=!t.get(32),this._contentLeft=i.contentLeft,this._glyphMarginLeft=i.glyphMarginLeft,this._glyphMarginWidth=i.glyphMarginWidth,this._domNode=It(document.createElement("div")),this._domNode.setClassName(xf.OUTER_CLASS_NAME),this._domNode.setPosition("absolute"),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._glyphMarginBackgroundDomNode=It(document.createElement("div")),this._glyphMarginBackgroundDomNode.setClassName(xf.CLASS_NAME),this._domNode.appendChild(this._glyphMarginBackgroundDomNode)}dispose(){super.dispose()}getDomNode(){return this._domNode}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(145);return this._canUseLayerHinting=!t.get(32),this._contentLeft=i.contentLeft,this._glyphMarginLeft=i.glyphMarginLeft,this._glyphMarginWidth=i.glyphMarginWidth,!0}onScrollChanged(e){return super.onScrollChanged(e)||e.scrollTopChanged}prepareRender(e){}render(e){this._domNode.setLayerHinting(this._canUseLayerHinting),this._domNode.setContain("strict");const t=e.scrollTop-e.bigNumbersDelta;this._domNode.setTop(-t);const i=Math.min(e.scrollHeight,1e6);this._domNode.setHeight(i),this._domNode.setWidth(this._contentLeft),this._glyphMarginBackgroundDomNode.setLeft(this._glyphMarginLeft),this._glyphMarginBackgroundDomNode.setWidth(this._glyphMarginWidth),this._glyphMarginBackgroundDomNode.setHeight(i)}}xf.CLASS_NAME="glyph-margin";xf.OUTER_CLASS_NAME="margin";const Pm="monaco-mouse-cursor-text";class yfe{constructor(){this._onDidChange=new B,this.onDidChange=this._onDidChange.event,this._enabled=!0}get enabled(){return this._enabled}enable(){this._enabled=!0,this._onDidChange.fire()}disable(){this._enabled=!1,this._onDidChange.fire()}}const Kv=new yfe,At=ut("keybindingService");var Sfe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},HB=function(s,e){return function(t,i){e(t,i,s)}};class Dfe{constructor(e,t,i,n,o){this._context=e,this.modelLineNumber=t,this.distanceToModelLineStart=i,this.widthOfHiddenLineTextBefore=n,this.distanceToModelLineEnd=o,this._visibleTextAreaBrand=void 0,this.startPosition=null,this.endPosition=null,this.visibleTextareaStart=null,this.visibleTextareaEnd=null,this._previousPresentation=null}prepareRender(e){const t=new W(this.modelLineNumber,this.distanceToModelLineStart+1),i=new W(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 uI=Fr;let RA=class extends Fo{constructor(e,t,i,n,o){super(e),this._keybindingService=n,this._instantiationService=o,this._primaryCursorPosition=new W(1,1),this._primaryCursorVisibleRange=null,this._viewController=t,this._visibleRangeProvider=i,this._scrollLeft=0,this._scrollTop=0;const r=this._context.configuration.options,a=r.get(145);this._setAccessibilityOptions(r),this._contentLeft=a.contentLeft,this._contentWidth=a.contentWidth,this._contentHeight=a.height,this._fontInfo=r.get(50),this._lineHeight=r.get(67),this._emptySelectionClipboard=r.get(37),this._copyWithSyntaxHighlighting=r.get(25),this._visibleTextArea=null,this._selections=[new we(1,1,1,1)],this._modelSelections=[new we(1,1,1,1)],this._lastRenderPosition=null,this.textArea=It(document.createElement("textarea")),rl.write(this.textArea,7),this.textArea.setClassName(`inputarea ${Pm}`),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off");const{tabSize:l}=this._context.viewModel.model.getOptions();this.textArea.domNode.style.tabSize=`${l*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",this._getAriaLabel(r)),this.textArea.setAttribute("aria-required",r.get(5)?"true":"false"),this.textArea.setAttribute("tabindex",String(r.get(124))),this.textArea.setAttribute("role","textbox"),this.textArea.setAttribute("aria-roledescription",p("editor","editor")),this.textArea.setAttribute("aria-multiline","true"),this.textArea.setAttribute("aria-autocomplete",r.get(91)?"none":"both"),this._ensureReadOnlyAttribute(),this.textAreaCover=It(document.createElement("div")),this.textAreaCover.setPosition("absolute");const d={getLineCount:()=>this._context.viewModel.getLineCount(),getLineMaxColumn:h=>this._context.viewModel.getLineMaxColumn(h),getValueInRange:(h,g)=>this._context.viewModel.getValueInRange(h,g),getValueLengthInRange:(h,g)=>this._context.viewModel.getValueLengthInRange(h,g),modifyPosition:(h,g)=>this._context.viewModel.modifyPosition(h,g)},c={getDataToCopy:()=>{const h=this._context.viewModel.getPlainTextToCopy(this._modelSelections,this._emptySelectionClipboard,as),g=this._context.viewModel.model.getEOL(),f=this._emptySelectionClipboard&&this._modelSelections.length===1&&this._modelSelections[0].isEmpty(),m=Array.isArray(h)?h:null,_=Array.isArray(h)?h.join(g):h;let v,b=null;if(TA.forceCopyWithSyntaxHighlighting||this._copyWithSyntaxHighlighting&&_.length<65536){const C=this._context.viewModel.getRichTextToCopy(this._modelSelections,this._emptySelectionClipboard);C&&(v=C.html,b=C.mode)}return{isFromEmptySelection:f,multicursorText:m,text:_,html:v,mode:b}},getScreenReaderContent:()=>{if(this._accessibilitySupport===1){const h=this._selections[0];if(lt&&h.isEmpty()){const f=h.getStartPosition();let m=this._getWordBeforePosition(f);if(m.length===0&&(m=this._getCharacterBeforePosition(f)),m.length>0)return new Bn(m,m.length,m.length,x.fromPositions(f),0)}if(lt&&!h.isEmpty()&&d.getValueLengthInRange(h,0)<500){const f=d.getValueInRange(h,0);return new Bn(f,0,f.length,h,0)}if(Lh&&!h.isEmpty()){const f="vscode-placeholder";return new Bn(f,0,f.length,null,void 0)}return Bn.EMPTY}if(l3){const h=this._selections[0];if(h.isEmpty()){const g=h.getStartPosition(),[f,m]=this._getAndroidWordAtPosition(g);if(f.length>0)return new Bn(f,m,m,x.fromPositions(g),0)}return Bn.EMPTY}return um.fromEditorSelection(d,this._selections[0],this._accessibilityPageSize,this._accessibilitySupport===0)},deduceModelPosition:(h,g,f)=>this._context.viewModel.deduceModelPositionRelativeToViewPosition(h,g,f)},u=this._register(new Fge(this.textArea.domNode));this._textAreaInput=this._register(this._instantiationService.createInstance(NA,c,u,Lo,{isAndroid:l3,isChrome:u1,isFirefox:Fr,isSafari:Lh})),this._register(this._textAreaInput.onKeyDown(h=>{this._viewController.emitKeyDown(h)})),this._register(this._textAreaInput.onKeyUp(h=>{this._viewController.emitKeyUp(h)})),this._register(this._textAreaInput.onPaste(h=>{let g=!1,f=null,m=null;h.metadata&&(g=this._emptySelectionClipboard&&!!h.metadata.isFromEmptySelection,f=typeof h.metadata.multicursorText<"u"?h.metadata.multicursorText:null,m=h.metadata.mode),this._viewController.paste(h.text,g,f,m)})),this._register(this._textAreaInput.onCut(()=>{this._viewController.cut()})),this._register(this._textAreaInput.onType(h=>{h.replacePrevCharCnt||h.replaceNextCharCnt||h.positionDelta?this._viewController.compositionType(h.text,h.replacePrevCharCnt,h.replaceNextCharCnt,h.positionDelta):this._viewController.type(h.text)})),this._register(this._textAreaInput.onSelectionChangeRequest(h=>{this._viewController.setSelection(h)})),this._register(this._textAreaInput.onCompositionStart(h=>{const g=this.textArea.domNode,f=this._modelSelections[0],{distanceToModelLineStart:m,widthOfHiddenTextBefore:_}=(()=>{const b=g.value.substring(0,Math.min(g.selectionStart,g.selectionEnd)),C=b.lastIndexOf(` `),w=b.substring(C+1),y=w.lastIndexOf(" "),D=w.length-y-1,L=f.getStartPosition(),k=Math.min(L.column-1,D),I=L.column-1-k,O=w.substring(0,w.length-k),{tabSize:R}=this._context.viewModel.model.getOptions(),P=Lfe(this.textArea.domNode.ownerDocument,O,this._fontInfo,R);return{distanceToModelLineStart:I,widthOfHiddenTextBefore:P}})(),{distanceToModelLineEnd:v}=(()=>{const b=g.value.substring(Math.max(g.selectionStart,g.selectionEnd)),C=b.indexOf(` `),w=C===-1?b:b.substring(0,C),y=w.indexOf(" "),D=y===-1?w.length:w.length-y-1,L=f.getEndPosition(),k=Math.min(this._context.viewModel.model.getLineMaxColumn(L.lineNumber)-L.column,D);return{distanceToModelLineEnd:this._context.viewModel.model.getLineMaxColumn(L.lineNumber)-L.column-k}})();this._context.viewModel.revealRange("keyboard",!0,x.fromPositions(this._selections[0].getStartPosition()),0,1),this._visibleTextArea=new Dfe(this._context,f.startLineNumber,m,_,v),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off"),this._visibleTextArea.prepareRender(this._visibleRangeProvider),this._render(),this.textArea.setClassName(`inputarea ${Pm} ime-input`),this._viewController.compositionStart(),this._context.viewModel.onCompositionStart()})),this._register(this._textAreaInput.onCompositionUpdate(h=>{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 ${Pm}`),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(Kv.onDidChange(()=>{this._ensureReadOnlyAttribute()}))}writeScreenReaderContent(e){this._textAreaInput.writeNativeTextAreaContent(e)}dispose(){super.dispose()}_getAndroidWordAtPosition(e){const t='`~!@#$%^&*()-=+[{]}\\|;:",.<>/?',i=this._context.viewModel.getLineContent(e.lineNumber),n=Or(t,[]);let o=!0,r=e.column,a=!0,l=e.column,d=0;for(;d<50&&(o||a);){if(o&&r<=1&&(o=!1),o){const c=i.charCodeAt(r-2);n.get(c)!==0?o=!1:r--}if(a&&l>i.length&&(a=!1),a){const c=i.charCodeAt(l-1);n.get(c)!==0?a=!1:l++}d++}return[i.substring(r-1,l-1),e.column-r]}_getWordBeforePosition(e){const t=this._context.viewModel.getLineContent(e.lineNumber),i=Or(this._context.configuration.options.get(131),[]);let n=e.column,o=0;for(;n>1;){const r=t.charCodeAt(n-2);if(i.get(r)!==0||o>50)return t.substring(n-1,e.column-1);o++,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(!Cn(i.charCodeAt(0)))return i}return""}_getAriaLabel(e){var t,i,n;if(e.get(2)===1){const r=(t=this._keybindingService.lookupKeybinding("editor.action.toggleScreenReaderAccessibilityMode"))===null||t===void 0?void 0:t.getAriaLabel(),a=(i=this._keybindingService.lookupKeybinding("workbench.action.showCommands"))===null||i===void 0?void 0:i.getAriaLabel(),l=(n=this._keybindingService.lookupKeybinding("workbench.action.openGlobalKeybindings"))===null||n===void 0?void 0:n.getAriaLabel(),d=p("accessibilityModeOff","The editor is not accessible at this time.");return r?p("accessibilityOffAriaLabel","{0} To enable screen reader optimized mode, use {1}",d,r):a?p("accessibilityOffAriaLabelNoKb","{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.",d,a):l?p("accessibilityOffAriaLabelNoKbs","{0} Please assign a keybinding for the command Toggle Screen Reader Accessibility Mode by accessing the keybindings editor with {1} and run it.",d,l):d}return e.get(4)}_setAccessibilityOptions(e){this._accessibilitySupport=e.get(2);const t=e.get(3);this._accessibilitySupport===2&&t===hl.accessibilityPageSize.defaultValue?this._accessibilityPageSize=500:this._accessibilityPageSize=t;const n=e.get(145).wrappingColumn;if(n!==-1&&this._accessibilitySupport!==1){const o=e.get(50);this._textAreaWrapping=!0,this._textAreaWidth=Math.round(n*o.typicalHalfwidthCharacterWidth)}else this._textAreaWrapping=!1,this._textAreaWidth=uI?0:1}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(145);this._setAccessibilityOptions(t),this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,this._contentHeight=i.height,this._fontInfo=t.get(50),this._lineHeight=t.get(67),this._emptySelectionClipboard=t.get(37),this._copyWithSyntaxHighlighting=t.get(25),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",this._getAriaLabel(t)),this.textArea.setAttribute("aria-required",t.get(5)?"true":"false"),this.textArea.setAttribute("tabindex",String(t.get(124))),(e.hasChanged(34)||e.hasChanged(91))&&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()}focusTextArea(){this._textAreaInput.focusTextArea()}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;!Kv.enabled||e.get(34)&&e.get(91)?this.textArea.setAttribute("readonly","true"):this.textArea.removeAttribute("readonly")}prepareRender(e){var t;this._primaryCursorPosition=new W(this._selections[0].positionLineNumber,this._selections[0].positionColumn),this._primaryCursorVisibleRange=e.visibleRangeForPosition(this._primaryCursorPosition),(t=this._visibleTextArea)===null||t===void 0||t.prepareRender(e)}render(e){this._textAreaInput.writeNativeTextAreaContent("render"),this._render()}_render(){var e;if(this._visibleTextArea){const n=this._visibleTextArea.visibleTextareaStart,o=this._visibleTextArea.visibleTextareaEnd,r=this._visibleTextArea.startPosition,a=this._visibleTextArea.endPosition;if(r&&a&&n&&o&&o.left>=this._scrollLeft&&n.left<=this._scrollLeft+this._contentWidth){const l=this._context.viewLayout.getVerticalOffsetForLineNumber(this._primaryCursorPosition.lineNumber)-this._scrollTop,d=this._newlinecount(this.textArea.domNode.value.substr(0,this.textArea.domNode.selectionStart));let c=this._visibleTextArea.widthOfHiddenLineTextBefore,u=this._contentLeft+n.left-this._scrollLeft,h=o.left-n.left+1;if(uthis._contentWidth&&(h=this._contentWidth);const g=this._context.viewModel.getViewLineData(r.lineNumber),f=g.tokens.findTokenIndexAtOffset(r.column-1),m=g.tokens.findTokenIndexAtOffset(a.column-1),_=f===m,v=this._visibleTextArea.definePresentation(_?g.tokens.getPresentation(f):null);this.textArea.domNode.scrollTop=d*this._lineHeight,this.textArea.domNode.scrollLeft=c,this._doRender({lastRenderPosition:null,top:l,left:u,width:h,height:this._lineHeight,useCover:!1,color:(Ki.getColorMap()||[])[v.foreground],italic:v.italic,bold:v.bold,underline:v.underline,strikethrough:v.strikethrough})}return}if(!this._primaryCursorVisibleRange){this._renderAtTopLeft();return}const t=this._contentLeft+this._primaryCursorVisibleRange.left-this._scrollLeft;if(tthis._contentLeft+this._contentWidth){this._renderAtTopLeft();return}const i=this._context.viewLayout.getVerticalOffsetForLineNumber(this._selections[0].positionLineNumber)-this._scrollTop;if(i<0||i>this._contentHeight){this._renderAtTopLeft();return}if(lt||this._accessibilitySupport===2){this._doRender({lastRenderPosition:this._primaryCursorPosition,top:i,left:this._textAreaWrapping?this._contentLeft:t,width:this._textAreaWidth,height:this._lineHeight,useCover:!1}),this.textArea.domNode.scrollLeft=this._primaryCursorVisibleRange.left;const n=(e=this._textAreaInput.textAreaState.newlineCountBeforeSelection)!==null&&e!==void 0?e:this._newlinecount(this.textArea.domNode.value.substr(0,this.textArea.domNode.selectionStart));this.textArea.domNode.scrollTop=n*this._lineHeight;return}this._doRender({lastRenderPosition:this._primaryCursorPosition,top:i,left:this._textAreaWrapping?this._contentLeft:t,width:this._textAreaWidth,height:uI?0:1,useCover:!1})}_newlinecount(e){let t=0,i=-1;do{if(i=e.indexOf(` `,i+1),i===-1)break;t++}while(!0);return t}_renderAtTopLeft(){this._doRender({lastRenderPosition:null,top:0,left:0,width:this._textAreaWidth,height:uI?0:1,useCover:!0})}_doRender(e){this._lastRenderPosition=e.lastRenderPosition;const t=this.textArea,i=this.textAreaCover;Un(t,this._fontInfo),t.setTop(e.top),t.setLeft(e.left),t.setWidth(e.width),t.setHeight(e.height),t.setColor(e.color?$.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(57)?i.setClassName("monaco-editor-background textAreaCover "+xf.OUTER_CLASS_NAME):n.get(68).renderType!==0?i.setClassName("monaco-editor-background textAreaCover "+S1.CLASS_NAME):i.setClassName("monaco-editor-background textAreaCover")}};RA=Sfe([HB(3,At),HB(4,Ne)],RA);function Lfe(s,e,t,i){if(e.length===0)return 0;const n=s.createElement("div");n.style.position="absolute",n.style.top="-50000px",n.style.width="50000px";const o=s.createElement("span");Un(o,t),o.style.whiteSpace="pre",o.style.tabSize=`${i*t.spaceWidth}px`,o.append(e),n.appendChild(o),s.body.appendChild(n);const r=o.offsetWidth;return s.body.removeChild(n),r}function xfe(s,e,t){let i=0;for(let o=0;o!0,Efe=()=>!1,Ife=s=>s===" "||s===" ";class Ep{static shouldRecreate(e){return e.hasChanged(145)||e.hasChanged(131)||e.hasChanged(37)||e.hasChanged(77)||e.hasChanged(79)||e.hasChanged(80)||e.hasChanged(6)||e.hasChanged(7)||e.hasChanged(11)||e.hasChanged(9)||e.hasChanged(10)||e.hasChanged(14)||e.hasChanged(128)||e.hasChanged(50)||e.hasChanged(91)||e.hasChanged(130)}constructor(e,t,i,n){var o;this.languageConfigurationService=n,this._cursorMoveConfigurationBrand=void 0,this._languageId=e;const r=i.options,a=r.get(145),l=r.get(50);this.readOnly=r.get(91),this.tabSize=t.tabSize,this.indentSize=t.indentSize,this.insertSpaces=t.insertSpaces,this.stickyTabStops=r.get(116),this.lineHeight=l.lineHeight,this.typicalHalfwidthCharacterWidth=l.typicalHalfwidthCharacterWidth,this.pageSize=Math.max(1,Math.floor(a.height/this.lineHeight)-2),this.useTabStops=r.get(128),this.wordSeparators=r.get(131),this.emptySelectionClipboard=r.get(37),this.copyWithSyntaxHighlighting=r.get(25),this.multiCursorMergeOverlapping=r.get(77),this.multiCursorPaste=r.get(79),this.multiCursorLimit=r.get(80),this.autoClosingBrackets=r.get(6),this.autoClosingComments=r.get(7),this.autoClosingQuotes=r.get(11),this.autoClosingDelete=r.get(9),this.autoClosingOvertype=r.get(10),this.autoSurround=r.get(14),this.autoIndent=r.get(12),this.wordSegmenterLocales=r.get(130),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 d=this.languageConfigurationService.getLanguageConfiguration(e).getSurroundingPairs();if(d)for(const u of d)this.surroundingPairs[u.open]=u.close;const c=this.languageConfigurationService.getLanguageConfiguration(e).comments;this.blockCommentStartToken=(o=c==null?void 0:c.blockCommentStartToken)!==null&&o!==void 0?o:null}get electricChars(){var e;if(!this._electricChars){this._electricChars={};const t=(e=this.languageConfigurationService.getLanguageConfiguration(this._languageId).electricCharacter)===null||e===void 0?void 0:e.getElectricCharacters();if(t)for(const i of t)this._electricChars[i]=!0}return this._electricChars}onElectricCharacter(e,t,i){const n=fx(t,i-1),o=this.languageConfigurationService.getLanguageConfiguration(n.languageId).electricCharacter;return o?o.onElectricCharacter(e,n,i-n.firstCharOffset):null}normalizeIndentation(e){return VF(e,this.indentSize,this.insertSpaces)}_getShouldAutoClose(e,t,i){switch(t){case"beforeWhitespace":return Ife;case"languageDefined":return this._getLanguageDefinedShouldAutoClose(e,i);case"always":return kfe;case"never":return Efe}}_getLanguageDefinedShouldAutoClose(e,t){const i=this.languageConfigurationService.getLanguageConfiguration(e).getAutoCloseBeforeSet(t);return n=>i.indexOf(n)!==-1}visibleColumnFromColumn(e,t){return hn.visibleColumnFromColumn(e.getLineContent(t.lineNumber),t.column,this.tabSize)}columnFromVisibleColumn(e,t,i){const n=hn.columnFromVisibleColumn(e.getLineContent(t),i,this.tabSize),o=e.getLineMinColumn(t);if(nr?r:n}}let wt=class JU{static fromModelState(e){return new Tfe(e)}static fromViewState(e){return new Nfe(e)}static fromModelSelection(e){const t=we.liftSelection(e),i=new Wn(x.fromPositions(t.getSelectionStart()),0,0,t.getPosition(),0);return JU.fromModelState(i)}static fromModelSelections(e){const t=[];for(let i=0,n=e.length;io,d=n>r,c=nr||vn||_0&&n--,Hg.columnSelect(e,t,i.fromViewLineNumber,i.fromViewVisualColumn,i.toViewLineNumber,n)}static columnSelectRight(e,t,i){let n=0;const o=Math.min(i.fromViewLineNumber,i.toViewLineNumber),r=Math.max(i.fromViewLineNumber,i.toViewLineNumber);for(let l=o;l<=r;l++){const d=t.getLineMaxColumn(l),c=e.visibleColumnFromColumn(t,new W(l,d));n=Math.max(n,c)}let a=i.toViewVisualColumn;return ae.getLineMinColumn(t.lineNumber))return t.delta(void 0,-rz(e.getLineContent(t.lineNumber),t.column-1));if(t.lineNumber>1){const i=t.lineNumber-1;return new W(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),o=e.getLineContent(t.lineNumber),r=Yb.atomicPosition(o,t.column-1,i,0);if(r!==-1&&r+1>=n)return new W(t.lineNumber,r+1)}return this.leftPosition(e,t)}static left(e,t,i){const n=e.stickyTabStops?Tt.leftPositionAtomicSoftTabs(t,i,e.tabSize):Tt.leftPosition(t,i);return new hI(n.lineNumber,n.column,0)}static moveLeft(e,t,i,n,o){let r,a;if(i.hasSelection()&&!n)r=i.selection.startLineNumber,a=i.selection.startColumn;else{const l=i.position.delta(void 0,-(o-1)),d=t.normalizePosition(Tt.clipPositionColumn(l,t),0),c=Tt.left(e,t,d);r=c.lineNumber,a=c.column}return i.move(n,r,a,0)}static clipPositionColumn(e,t){return new W(e.lineNumber,Tt.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 ic?(i=c,a?n=t.getLineMaxColumn(i):n=Math.min(t.getLineMaxColumn(i),n)):n=e.columnFromVisibleColumn(t,i,d),g?o=0:o=d-hn.visibleColumnFromColumn(t.getLineContent(i),n,e.tabSize),l!==void 0){const f=new W(i,n),m=t.normalizePosition(f,l);o=o+(n-m.column),i=m.lineNumber,n=m.column}return new hI(i,n,o)}static down(e,t,i,n,o,r,a){return this.vertical(e,t,i,n,o,i+r,a,4)}static moveDown(e,t,i,n,o){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,d;do if(d=Tt.down(e,t,r+l,a,i.leftoverVisibleColumns,o,!0),t.normalizePosition(new W(d.lineNumber,d.column),2).lineNumber>r)break;while(l++<10&&r+l1&&this._isBlankLine(t,o);)o--;for(;o>1&&!this._isBlankLine(t,o);)o--;return i.move(n,o,t.getLineMinColumn(o),0)}static moveToNextBlankLine(e,t,i,n){const o=t.getLineCount();let r=i.position.lineNumber;for(;r=h.length+1)return!1;const g=h.charAt(u.column-2),f=n.get(g);if(!f)return!1;if(yu(g)){if(i==="never")return!1}else if(t==="never")return!1;const m=h.charAt(u.column-1);let _=!1;for(const v of f)v.open===g&&v.close===m&&(_=!0);if(!_)return!1;if(e==="auto"){let v=!1;for(let b=0,C=a.length;b1){const o=t.getLineContent(n.lineNumber),r=Cs(o),a=r===-1?o.length+1:r+1;if(n.column<=a){const l=i.visibleColumnFromColumn(t,n),d=hn.prevIndentTabStop(l,i.indentSize),c=i.columnFromVisibleColumn(t,n.lineNumber,d);return new x(n.lineNumber,c,n.lineNumber,n.column)}}return x.fromPositions(kf.getPositionAfterDeleteLeft(n,t),n)}static getPositionAfterDeleteLeft(e,t){if(e.column>1){const i=Bre(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 W(i,t.getLineMaxColumn(i))}else return e}static cut(e,t,i){const n=[];let o=null;i.sort((r,a)=>W.compare(r.getStartPosition(),a.getEndPosition()));for(let r=0,a=i.length;r1&&(o==null?void 0:o.endLineNumber)!==d.lineNumber?(c=d.lineNumber-1,u=t.getLineMaxColumn(d.lineNumber-1),h=d.lineNumber,g=t.getLineMaxColumn(d.lineNumber)):(c=d.lineNumber,u=1,h=d.lineNumber,g=t.getLineMaxColumn(d.lineNumber));const f=new x(c,u,h,g);o=f,f.isEmpty()?n[r]=null:n[r]=new qn(f,"")}else n[r]=null;else n[r]=new qn(l,"")}return new Js(0,n,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}}class Et{static _createWord(e,t,i,n,o){return{start:n,end:o,wordType:t,nextCharClass:i}}static _createIntlWord(e,t){return{start:e.index,end:e.index+e.segment.length,wordType:1,nextCharClass:t}}static _findPreviousWordOnLine(e,t,i){const n=t.getLineContent(i.lineNumber);return this._doFindPreviousWordOnLine(n,e,i)}static _doFindPreviousWordOnLine(e,t,i){let n=0;const o=t.findPrevIntlWordBeforeOrAtOffset(e,i.column-2);for(let r=i.column-2;r>=0;r--){const a=e.charCodeAt(r),l=t.get(a);if(o&&r===o.index)return this._createIntlWord(o,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 o=t.findNextIntlWordAtOrAfterOffset(e,n),r=e.length;for(let a=n;a=0;r--){const a=e.charCodeAt(r),l=t.get(a);if(o&&r===o.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){let o=i.lineNumber,r=i.column;r===1&&o>1&&(o=o-1,r=t.getLineMaxColumn(o));let a=Et._findPreviousWordOnLine(e,t,new W(o,r));if(n===0)return new W(o,a?a.start+1:1);if(n===1)return a&&a.wordType===2&&a.end-a.start===1&&a.nextCharClass===0&&(a=Et._findPreviousWordOnLine(e,t,new W(o,a.start+1))),new W(o,a?a.start+1:1);if(n===3){for(;a&&a.wordType===2;)a=Et._findPreviousWordOnLine(e,t,new W(o,a.start+1));return new W(o,a?a.start+1:1)}return a&&r<=a.end+1&&(a=Et._findPreviousWordOnLine(e,t,new W(o,a.start+1))),new W(o,a?a.end+1:1)}static _moveWordPartLeft(e,t){const i=t.lineNumber,n=e.getLineMaxColumn(i);if(t.column===1)return i>1?new W(i-1,e.getLineMaxColumn(i-1)):t;const o=e.getLineContent(i);for(let r=t.column-1;r>1;r--){const a=o.charCodeAt(r-2),l=o.charCodeAt(r-1);if(a===95&&l!==95)return new W(i,r);if(a===45&&l!==45)return new W(i,r);if((Bu(a)||uw(a))&&Fl(l))return new W(i,r);if(Fl(a)&&Fl(l)&&r+1=l.start+1&&(l=Et._findNextWordOnLine(e,t,new W(o,l.end+1))),l?r=l.start+1:r=t.getLineMaxColumn(o);return new W(o,r)}static _moveWordPartRight(e,t){const i=t.lineNumber,n=e.getLineMaxColumn(i);if(t.column===n)return i1?d=1:(l--,d=n.getLineMaxColumn(l)):(c&&d<=c.end+1&&(c=Et._findPreviousWordOnLine(i,n,new W(l,c.start+1))),c?d=c.end+1:d>1?d=1:(l--,d=n.getLineMaxColumn(l))),new x(l,d,a.lineNumber,a.column)}static deleteInsideWord(e,t,i){if(!i.isEmpty())return i;const n=new W(i.positionLineNumber,i.positionColumn),o=this._deleteInsideWordWhitespace(t,n);return o||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 o=Math.max(t.column-2,0);if(!this._charAtIsWhitespace(i,o))return null;let r=Math.min(t.column-1,n-1);if(!this._charAtIsWhitespace(i,r))return null;for(;o>0&&this._charAtIsWhitespace(i,o-1);)o--;for(;r+11?new x(i.lineNumber-1,t.getLineMaxColumn(i.lineNumber-1),i.lineNumber,1):i.lineNumberu.start+1<=i.column&&i.column<=u.end+1,a=(u,h)=>(u=Math.min(u,i.column),h=Math.max(h,i.column),new x(i.lineNumber,u,i.lineNumber,h)),l=u=>{let h=u.start+1,g=u.end+1,f=!1;for(;g-11&&this._charAtIsWhitespace(n,h-2);)h--;return a(h,g)},d=Et._findPreviousWordOnLine(e,t,i);if(d&&r(d))return l(d);const c=Et._findNextWordOnLine(e,t,i);return c&&r(c)?l(c):d&&c?a(d.end+1,c.start+1):d?a(d.start+1,d.end+1):c?a(c.start+1,c.end+1):a(1,o+1)}static _deleteWordPartLeft(e,t){if(!t.isEmpty())return t;const i=t.getPosition(),n=Et._moveWordPartLeft(e,i);return new x(i.lineNumber,i.column,n.lineNumber,n.column)}static _findFirstNonWhitespaceChar(e,t){const i=e.length;for(let n=t;n=h.start+1&&(h=Et._findNextWordOnLine(i,n,new W(l,h.end+1))),h?d=h.start+1:d!!e)}class On{static addCursorDown(e,t,i){const n=[];let o=0;for(let r=0,a=t.length;rd&&(c=d,u=e.model.getLineMaxColumn(c)),wt.fromModelState(new Wn(new x(r.lineNumber,1,c,u),2,0,new W(c,u),0))}const l=t.modelState.selectionStart.getStartPosition().lineNumber;if(r.lineNumberl){const d=e.getLineCount();let c=a.lineNumber+1,u=1;return c>d&&(c=d,u=e.getLineMaxColumn(c)),wt.fromViewState(t.viewState.move(!0,c,u,0))}else{const d=t.modelState.selectionStart.getEndPosition();return wt.fromModelState(t.modelState.move(!0,d.lineNumber,d.column,0))}}static word(e,t,i,n){const o=e.model.validatePosition(n);return wt.fromModelState(Et.word(e.cursorConfig,e.model,t.modelState,i,o))}static cancelSelection(e,t){if(!t.modelState.hasSelection())return new wt(t.modelState,t.viewState);const i=t.viewState.position.lineNumber,n=t.viewState.position.column;return wt.fromViewState(new Wn(new x(i,n,i,n),0,0,new W(i,n),0))}static moveTo(e,t,i,n,o){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,o)}const r=e.model.validatePosition(n),a=o?e.coordinatesConverter.validateViewPosition(new W(o.lineNumber,o.column),r):e.coordinatesConverter.convertModelPositionToViewPosition(r);return wt.fromViewState(t.viewState.move(i,a.lineNumber,a.column,0))}static simpleMove(e,t,i,n,o,r){switch(i){case 0:return r===4?this._moveHalfLineLeft(e,t,n):this._moveLeft(e,t,n,o);case 1:return r===4?this._moveHalfLineRight(e,t,n):this._moveRight(e,t,n,o);case 2:return r===2?this._moveUpByViewLines(e,t,n,o):this._moveUpByModelLines(e,t,n,o);case 3:return r===2?this._moveDownByViewLines(e,t,n,o):this._moveDownByModelLines(e,t,n,o);case 4:return r===2?t.map(a=>wt.fromViewState(Tt.moveToPrevBlankLine(e.cursorConfig,e,a.viewState,n))):t.map(a=>wt.fromModelState(Tt.moveToPrevBlankLine(e.cursorConfig,e.model,a.modelState,n)));case 5:return r===2?t.map(a=>wt.fromViewState(Tt.moveToNextBlankLine(e.cursorConfig,e,a.viewState,n))):t.map(a=>wt.fromModelState(Tt.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,o){const r=e.getCompletelyVisibleViewRange(),a=e.coordinatesConverter.convertViewRangeToModelRange(r);switch(i){case 11:{const l=this._firstLineNumberInRange(e.model,a,o),d=e.model.getLineFirstNonWhitespaceColumn(l);return[this._moveToModelPosition(e,t[0],n,l,d)]}case 13:{const l=this._lastLineNumberInRange(e.model,a,o),d=e.model.getLineFirstNonWhitespaceColumn(l);return[this._moveToModelPosition(e,t[0],n,l,d)]}case 12:{const l=Math.round((a.startLineNumber+a.endLineNumber)/2),d=e.model.getLineFirstNonWhitespaceColumn(l);return[this._moveToModelPosition(e,t[0],n,l,d)]}case 14:{const l=[];for(let d=0,c=t.length;di.endLineNumber-1?r=i.endLineNumber-1:owt.fromViewState(Tt.moveLeft(e.cursorConfig,e,o.viewState,i,n)))}static _moveHalfLineLeft(e,t,i){const n=[];for(let o=0,r=t.length;owt.fromViewState(Tt.moveRight(e.cursorConfig,e,o.viewState,i,n)))}static _moveHalfLineRight(e,t,i){const n=[];for(let o=0,r=t.length;o1&&n.firstCharOffset===0){const m=Tm(e,t.startLineNumber-1);m.languageId===n.languageId&&(d=m.getLineContent())}const c=o.onEnter(s,d,a,l);if(!c)return null;const u=c.indentAction;let h=c.appendText;const g=c.removeText||0;h?u===Qi.Indent&&(h=" "+h):u===Qi.Indent||u===Qi.IndentOutdent?h=" ":h="";let f=sU(e,t.startLineNumber,t.startColumn);return g&&(f=f.substring(0,f.length-g)),{indentAction:u,appendText:h,removeText:g,indentation:f}}var Mfe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Rfe=function(s,e){return function(t,i){e(t,i,s)}},Gy;const gI=Object.create(null);function _g(s,e){if(e<=0)return"";gI[s]||(gI[s]=["",s]);const t=gI[s];for(let i=t.length;i<=e;i++)t[i]=t[i-1]+s;return t[e]}let xr=Gy=class{static unshiftIndent(e,t,i,n,o){const r=hn.visibleColumnFromColumn(e,t,i);if(o){const a=_g(" ",n),d=hn.prevIndentTabStop(r,n)/n;return _g(a,d)}else{const a=" ",d=hn.prevRenderTabStop(r,i)/i;return _g(a,d)}}static shiftIndent(e,t,i,n,o){const r=hn.visibleColumnFromColumn(e,t,i);if(o){const a=_g(" ",n),d=hn.nextIndentTabStop(r,n)/n;return _g(a,d)}else{const a=" ",d=hn.nextRenderTabStop(r,i)/i;return _g(a,d)}}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:o,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 d=0,c=0;for(let u=i;u<=n;u++,d=c){c=0;const h=e.getLineContent(u);let g=Cs(h);if(this._opts.isUnshift&&(h.length===0||g===0)||!l&&!this._opts.isUnshift&&h.length===0)continue;if(g===-1&&(g=h.length),u>1&&hn.visibleColumnFromColumn(h,g+1,o)%r!==0&&e.tokenization.isCheapToTokenize(u-1)){const _=Fm(this._opts.autoIndent,e,new x(u-1,e.getLineMaxColumn(u-1),u-1,e.getLineMaxColumn(u-1)),this._languageConfigurationService);if(_){if(c=d,_.appendText)for(let v=0,b=_.appendText.length;v1){let n,o=-1;for(n=e-1;n>=1;n--){if(s.tokenization.getLanguageIdAtPosition(n,0)!==i)return o;const r=s.getLineContent(n);if(t.shouldIgnore(r)||/^\s+$/.test(r)||r===""){o=n;continue}return n}}return-1}function Ex(s,e,t,i=!0,n){if(s<4)return null;const o=n.getLanguageConfiguration(e.tokenization.getLanguageId()).indentRulesSupport;if(!o)return null;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 r=Ofe(e,t,o);if(r<0)return null;if(r<1)return{indentation:"",action:null};const a=e.getLineContent(r);if(o.shouldIncrease(a)||o.shouldIndentNextLine(a))return{indentation:Zt(a),action:Qi.Indent,line:r};if(o.shouldDecrease(a))return{indentation:Zt(a),action:null,line:r};{if(r===1)return{indentation:Zt(e.getLineContent(r)),action:null,line:r};const l=r-1,d=o.getIndentMetadata(e.getLineContent(l));if(!(d&3)&&d&4){let c=0;for(let u=l-1;u>0;u--)if(!o.shouldIndentNextLine(e.getLineContent(u))){c=u;break}return{indentation:Zt(e.getLineContent(c+1)),action:null,line:c+1}}if(i)return{indentation:Zt(e.getLineContent(r)),action:null,line:r};for(let c=r;c>0;c--){const u=e.getLineContent(c);if(o.shouldIncrease(u))return{indentation:Zt(u),action:Qi.Indent,line:c};if(o.shouldIndentNextLine(u)){let h=0;for(let g=c-1;g>0;g--)if(!o.shouldIndentNextLine(e.getLineContent(c))){h=g;break}return{indentation:Zt(e.getLineContent(h+1)),action:null,line:h+1}}else if(o.shouldDecrease(u))return{indentation:Zt(u),action:null,line:c}}return{indentation:Zt(e.getLineContent(1)),action:null,line:1}}}function qv(s,e,t,i,n,o){if(s<4)return null;const r=o.getLanguageConfiguration(t);if(!r)return null;const a=o.getLanguageConfiguration(t).indentRulesSupport;if(!a)return null;const l=Ex(s,e,i,void 0,o),d=e.getLineContent(i);if(l){const c=l.line;if(c!==void 0){let u=!0;for(let h=c;h0&&o.getLanguageId(0)!==r.languageId?(l=!0,d=a.substr(0,t.startColumn-1-r.firstCharOffset)):d=o.getLineContent().substring(0,t.startColumn-1);let c;t.isEmpty()?c=a.substr(t.startColumn-1-r.firstCharOffset):c=Tm(e,t.endLineNumber,t.endColumn).getLineContent().substr(t.endColumn-1-r.firstCharOffset);const u=n.getLanguageConfiguration(r.languageId).indentRulesSupport;if(!u)return null;const h=d,g=Zt(d),f={tokenization:{getLineTokens:b=>e.tokenization.getLineTokens(b),getLanguageId:()=>e.getLanguageId(),getLanguageIdAtPosition:(b,C)=>e.getLanguageIdAtPosition(b,C)},getLineContent:b=>b===t.startLineNumber?h:e.getLineContent(b)},m=Zt(o.getLineContent()),_=Ex(s,f,t.startLineNumber+1,void 0,n);if(!_){const b=l?m:g;return{beforeEnter:b,afterEnter:b}}let v=l?m:_.indentation;return _.action===Qi.Indent&&(v=i.shiftIndent(v)),u.shouldDecrease(c)&&(v=i.unshiftIndent(v)),{beforeEnter:l?m:g,afterEnter:v}}function Wfe(s,e,t,i,n,o){if(s<4)return null;const r=Tm(e,t.startLineNumber,t.startColumn);if(r.firstCharOffset)return null;const a=o.getLanguageConfiguration(r.languageId).indentRulesSupport;if(!a)return null;const l=r.getLineContent(),d=l.substr(0,t.startColumn-1-r.firstCharOffset);let c;if(t.isEmpty()?c=l.substr(t.startColumn-1-r.firstCharOffset):c=Tm(e,t.endLineNumber,t.endColumn).getLineContent().substr(t.endColumn-1-r.firstCharOffset),!a.shouldDecrease(d+c)&&a.shouldDecrease(d+i+c)){const u=Ex(s,e,t.startLineNumber,!1,o);if(!u)return null;let h=u.indentation;return u.action!==Qi.Indent&&(h=n.unshiftIndent(h)),h}return null}function e$(s,e,t){const i=t.getLanguageConfiguration(s.getLanguageId()).indentRulesSupport;return!i||e<1||e>s.getLineCount()?null:i.getIndentMetadata(s.getLineContent(e))}class bi{static indent(e,t,i){if(t===null||i===null)return[];const n=[];for(let o=0,r=i.length;o1){let a;for(a=i-1;a>=1;a--){const c=t.getLineContent(a);if(Ya(c)>=0)break}if(a<1)return null;const l=t.getLineMaxColumn(a),d=Fm(e.autoIndent,t,new x(a,l,a,l),e.languageConfigurationService);d&&(o=d.indentation+d.appendText)}return n&&(n===Qi.Indent&&(o=bi.shiftIndent(e,o)),n===Qi.Outdent&&(o=bi.unshiftIndent(e,o)),o=e.normalizeIndentation(o)),o||null}static _replaceJumpToNextIndent(e,t,i,n){let o="";const r=i.getStartPosition();if(e.insertSpaces){const a=e.visibleColumnFromColumn(t,r),l=e.indentSize,d=l-a%l;for(let c=0;cthis._compositionType(i,c,o,r,a,l));return new Js(4,d,{shouldPushStackElementBefore:Iw(e,4),shouldPushStackElementAfter:!1})}static _compositionType(e,t,i,n,o,r){if(!t.isEmpty())return null;const a=t.getPosition(),l=Math.max(1,a.column-n),d=Math.min(e.getLineMaxColumn(a.lineNumber),a.column+o),c=new x(a.lineNumber,l,a.lineNumber,d);return e.getValueInRange(c)===i&&r===0?null:new qy(c,i,0,r)}static _typeCommand(e,t,i){return i?new kw(e,t,!0):new qn(e,t,!0)}static _enter(e,t,i,n){if(e.autoIndent===0)return bi._typeCommand(n,` `,i);if(!t.tokenization.isCheapToTokenize(n.getStartPosition().lineNumber)||e.autoIndent===1){const l=t.getLineContent(n.startLineNumber),d=Zt(l).substring(0,n.startColumn-1);return bi._typeCommand(n,` `+e.normalizeIndentation(d),i)}const o=Fm(e.autoIndent,t,n,e.languageConfigurationService);if(o){if(o.indentAction===Qi.None)return bi._typeCommand(n,` `+e.normalizeIndentation(o.indentation+o.appendText),i);if(o.indentAction===Qi.Indent)return bi._typeCommand(n,` `+e.normalizeIndentation(o.indentation+o.appendText),i);if(o.indentAction===Qi.IndentOutdent){const l=e.normalizeIndentation(o.indentation),d=e.normalizeIndentation(o.indentation+o.appendText),c=` `+d+` `+l;return i?new kw(n,c,!0):new qy(n,c,-1,d.length-l.length,!0)}else if(o.indentAction===Qi.Outdent){const l=bi.unshiftIndent(e,o.indentation);return bi._typeCommand(n,` `+e.normalizeIndentation(l+o.appendText),i)}}const r=t.getLineContent(n.startLineNumber),a=Zt(r).substring(0,n.startColumn-1);if(e.autoIndent>=4){const l=Bfe(e.autoIndent,t,n,{unshiftIndent:d=>bi.unshiftIndent(e,d),shiftIndent:d=>bi.shiftIndent(e,d),normalizeIndentation:d=>e.normalizeIndentation(d)},e.languageConfigurationService);if(l){let d=e.visibleColumnFromColumn(t,n.getEndPosition());const c=n.endColumn,u=t.getLineContent(n.endLineNumber),h=Cs(u);if(h>=0?n=n.setEndPosition(n.endLineNumber,Math.max(n.endColumn,h+1)):n=n.setEndPosition(n.endLineNumber,t.getLineMaxColumn(n.endLineNumber)),i)return new kw(n,` `+e.normalizeIndentation(l.afterEnter),!0);{let g=0;return c<=h+1&&(e.insertSpaces||(d=Math.ceil(d/e.indentSize)),g=Math.min(d+1-e.normalizeIndentation(l.afterEnter).length-1,0)),new qy(n,` `+e.normalizeIndentation(l.afterEnter),0,g,!0)}}}return bi._typeCommand(n,` `+e.normalizeIndentation(a),i)}static _isAutoIndentType(e,t,i){if(e.autoIndent<4)return!1;for(let n=0,o=i.length;nbi.shiftIndent(e,a),unshiftIndent:a=>bi.unshiftIndent(e,a)},e.languageConfigurationService);if(r===null)return null;if(r!==e.normalizeIndentation(o)){const a=t.getLineFirstNonWhitespaceColumn(i.startLineNumber);return a===0?bi._typeCommand(new x(i.startLineNumber,1,i.endLineNumber,i.endColumn),e.normalizeIndentation(r)+n,!1):bi._typeCommand(new x(i.startLineNumber,1,i.endLineNumber,i.endColumn),e.normalizeIndentation(r)+t.getLineContent(i.startLineNumber).substring(a-1,i.startColumn-1)+n,!1)}return null}static _isAutoClosingOvertype(e,t,i,n,o){if(e.autoClosingOvertype==="never"||!e.autoClosingPairs.autoClosingPairsCloseSingleChar.has(o))return!1;for(let r=0,a=i.length;r2?c.charCodeAt(d.column-2):0)===92&&h)return!1;if(e.autoClosingOvertype==="auto"){let f=!1;for(let m=0,_=n.length;m<_;m++){const v=n[m];if(d.lineNumber===v.startLineNumber&&d.column===v.startColumn){f=!0;break}}if(!f)return!1}}return!0}static _runAutoClosingOvertype(e,t,i,n,o){const r=[];for(let a=0,l=n.length;at.startsWith(l.open)),a=o.some(l=>t.startsWith(l.close));return!r&&a}static _findAutoClosingPairOpen(e,t,i,n){const o=e.autoClosingPairs.autoClosingPairsOpenByEnd.get(n);if(!o)return null;let r=null;for(const a of o)if(r===null||a.open.length>r.open.length){let l=!0;for(const d of i)if(t.getValueInRange(new x(d.lineNumber,d.column-a.open.length+1,d.lineNumber,d.column))+n!==a.open){l=!1;break}l&&(r=a)}return r}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 o=null;for(const r of n)r.open!==t.open&&t.open.includes(r.open)&&t.close.endsWith(r.close)&&(!o||r.open.length>o.open.length)&&(o=r);return o}static _getAutoClosingPairClose(e,t,i,n,o){for(const f of i)if(!f.isEmpty())return null;const r=i.map(f=>{const m=f.getPosition();return o?{lineNumber:m.lineNumber,beforeColumn:m.column-n.length,afterColumn:m.column}:{lineNumber:m.lineNumber,beforeColumn:m.column,afterColumn:m.column}}),a=this._findAutoClosingPairOpen(e,t,r.map(f=>new W(f.lineNumber,f.beforeColumn)),n);if(!a)return null;let l,d;if(yu(n)?(l=e.autoClosingQuotes,d=e.shouldAutoCloseBefore.quote):(e.blockCommentStartToken?a.open.includes(e.blockCommentStartToken):!1)?(l=e.autoClosingComments,d=e.shouldAutoCloseBefore.comment):(l=e.autoClosingBrackets,d=e.shouldAutoCloseBefore.bracket),l==="never")return null;const u=this._findContainedAutoClosingPair(e,a),h=u?u.close:"";let g=!0;for(const f of r){const{lineNumber:m,beforeColumn:_,afterColumn:v}=f,b=t.getLineContent(m),C=b.substring(0,_-1),w=b.substring(v-1);if(w.startsWith(h)||(g=!1),w.length>0){const k=w.charAt(0);if(!bi._isBeforeClosingBrace(e,w)&&!d(k))return null}if(a.open.length===1&&(n==="'"||n==='"')&&l!=="always"){const k=Or(e.wordSeparators,[]);if(C.length>0){const I=C.charCodeAt(C.length-1);if(k.get(I)===0)return null}}if(!t.tokenization.isCheapToTokenize(m))return null;t.tokenization.forceTokenization(m);const y=t.tokenization.getLineTokens(m),D=fx(y,_-1);if(!a.shouldAutoClose(D,_-D.firstCharOffset))return null;const L=a.findNeutralCharacter();if(L){const k=t.tokenization.getTokenTypeIfInsertingCharacter(m,_,L);if(!a.isOK(k))return null}}return g?a.close.substring(0,a.close.length-h.length):a.close}static _runAutoClosingOpenCharType(e,t,i,n,o,r,a){const l=[];for(let d=0,c=n.length;dnew qn(new x(h.positionLineNumber,h.positionColumn,h.positionLineNumber,h.positionColumn+1),"",!1));return new Js(4,u,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}const c=this._getAutoClosingPairClose(t,i,o,l,!0);return c!==null?this._runAutoClosingOpenCharType(e,t,i,o,l,!0,c):null}static typeWithInterceptors(e,t,i,n,o,r,a){if(!e&&a===` `){const c=[];for(let u=0,h=o.length;u{const n=t.get(xt).getFocusedCodeEditor();return n&&n.hasTextFocus()?this._runEditorCommand(t,n,i):!1}),e.addImplementation(1e3,"generic-dom-input-textarea",(t,i)=>{const n=Xn();return n&&["input","textarea"].indexOf(n.tagName.toLowerCase())>=0?(this.runDOMCommand(n),!0):!1}),e.addImplementation(0,"generic-dom",(t,i)=>{const n=t.get(xt).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 kn;(function(s){class e extends ki{constructor(b){super(b),this._inSelectionMode=b.inSelectionMode}runCoreEditorCommand(b,C){if(!C.position)return;b.model.pushStackElement(),b.setCursorStates(C.source,3,[On.moveTo(b,b.getPrimaryCursorState(),this._inSelectionMode,C.position,C.viewPosition)])&&C.revealType!==2&&b.revealAllCursors(C.source,!0,!0)}}s.MoveTo=de(new e({id:"_moveTo",inSelectionMode:!1,precondition:void 0})),s.MoveToSelect=de(new e({id:"_moveToSelect",inSelectionMode:!0,precondition:void 0}));class t extends ki{runCoreEditorCommand(b,C){b.model.pushStackElement();const w=this._getColumnSelectResult(b,b.getPrimaryCursorState(),b.getCursorColumnSelectData(),C);w!==null&&(b.setCursorStates(C.source,3,w.viewStates.map(y=>wt.fromViewState(y))),b.setCursorColumnSelectData({isReal:!0,fromViewLineNumber:w.fromLineNumber,fromViewVisualColumn:w.fromVisualColumn,toViewLineNumber:w.toLineNumber,toViewVisualColumn:w.toVisualColumn}),w.reversed?b.revealTopMostCursor(C.source):b.revealBottomMostCursor(C.source))}}s.ColumnSelect=de(new class extends t{constructor(){super({id:"columnSelect",precondition:void 0})}_getColumnSelectResult(v,b,C,w){if(typeof w.position>"u"||typeof w.viewPosition>"u"||typeof w.mouseColumn>"u")return null;const y=v.model.validatePosition(w.position),D=v.coordinatesConverter.validateViewPosition(new W(w.viewPosition.lineNumber,w.viewPosition.column),y),L=w.doColumnSelect?C.fromViewLineNumber:D.lineNumber,k=w.doColumnSelect?C.fromViewVisualColumn:w.mouseColumn-1;return Hg.columnSelect(v.cursorConfig,v,L,k,D.lineNumber,w.mouseColumn-1)}}),s.CursorColumnSelectLeft=de(new class extends t{constructor(){super({id:"cursorColumnSelectLeft",precondition:void 0,kbOpts:{weight:Lt,kbExpr:T.textInputFocus,primary:3599,linux:{primary:0}}})}_getColumnSelectResult(v,b,C,w){return Hg.columnSelectLeft(v.cursorConfig,v,C)}}),s.CursorColumnSelectRight=de(new class extends t{constructor(){super({id:"cursorColumnSelectRight",precondition:void 0,kbOpts:{weight:Lt,kbExpr:T.textInputFocus,primary:3601,linux:{primary:0}}})}_getColumnSelectResult(v,b,C,w){return Hg.columnSelectRight(v.cursorConfig,v,C)}});class i extends t{constructor(b){super(b),this._isPaged=b.isPaged}_getColumnSelectResult(b,C,w,y){return Hg.columnSelectUp(b.cursorConfig,b,w,this._isPaged)}}s.CursorColumnSelectUp=de(new i({isPaged:!1,id:"cursorColumnSelectUp",precondition:void 0,kbOpts:{weight:Lt,kbExpr:T.textInputFocus,primary:3600,linux:{primary:0}}})),s.CursorColumnSelectPageUp=de(new i({isPaged:!0,id:"cursorColumnSelectPageUp",precondition:void 0,kbOpts:{weight:Lt,kbExpr:T.textInputFocus,primary:3595,linux:{primary:0}}}));class n extends t{constructor(b){super(b),this._isPaged=b.isPaged}_getColumnSelectResult(b,C,w,y){return Hg.columnSelectDown(b.cursorConfig,b,w,this._isPaged)}}s.CursorColumnSelectDown=de(new n({isPaged:!1,id:"cursorColumnSelectDown",precondition:void 0,kbOpts:{weight:Lt,kbExpr:T.textInputFocus,primary:3602,linux:{primary:0}}})),s.CursorColumnSelectPageDown=de(new n({isPaged:!0,id:"cursorColumnSelectPageDown",precondition:void 0,kbOpts:{weight:Lt,kbExpr:T.textInputFocus,primary:3596,linux:{primary:0}}}));class o extends ki{constructor(){super({id:"cursorMove",precondition:void 0,metadata:rD.metadata})}runCoreEditorCommand(b,C){const w=rD.parse(C);w&&this._runCursorMove(b,C.source,w)}_runCursorMove(b,C,w){b.model.pushStackElement(),b.setCursorStates(C,3,o._move(b,b.getCursorStates(),w)),b.revealAllCursors(C,!0)}static _move(b,C,w){const y=w.select,D=w.value;switch(w.direction){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:return On.simpleMove(b,C,w.direction,y,D,w.unit);case 11:case 13:case 12:case 14:return On.viewportMove(b,C,w.direction,y,D);default:return null}}}s.CursorMoveImpl=o,s.CursorMove=de(new o);class r extends ki{constructor(b){super(b),this._staticArgs=b.args}runCoreEditorCommand(b,C){let w=this._staticArgs;this._staticArgs.value===-1&&(w={direction:this._staticArgs.direction,unit:this._staticArgs.unit,select:this._staticArgs.select,value:C.pageSize||b.cursorConfig.pageSize}),b.model.pushStackElement(),b.setCursorStates(C.source,3,On.simpleMove(b,b.getCursorStates(),w.direction,w.select,w.value,w.unit)),b.revealAllCursors(C.source,!0)}}s.CursorLeft=de(new r({args:{direction:0,unit:0,select:!1,value:1},id:"cursorLeft",precondition:void 0,kbOpts:{weight:Lt,kbExpr:T.textInputFocus,primary:15,mac:{primary:15,secondary:[288]}}})),s.CursorLeftSelect=de(new r({args:{direction:0,unit:0,select:!0,value:1},id:"cursorLeftSelect",precondition:void 0,kbOpts:{weight:Lt,kbExpr:T.textInputFocus,primary:1039}})),s.CursorRight=de(new r({args:{direction:1,unit:0,select:!1,value:1},id:"cursorRight",precondition:void 0,kbOpts:{weight:Lt,kbExpr:T.textInputFocus,primary:17,mac:{primary:17,secondary:[292]}}})),s.CursorRightSelect=de(new r({args:{direction:1,unit:0,select:!0,value:1},id:"cursorRightSelect",precondition:void 0,kbOpts:{weight:Lt,kbExpr:T.textInputFocus,primary:1041}})),s.CursorUp=de(new r({args:{direction:2,unit:2,select:!1,value:1},id:"cursorUp",precondition:void 0,kbOpts:{weight:Lt,kbExpr:T.textInputFocus,primary:16,mac:{primary:16,secondary:[302]}}})),s.CursorUpSelect=de(new r({args:{direction:2,unit:2,select:!0,value:1},id:"cursorUpSelect",precondition:void 0,kbOpts:{weight:Lt,kbExpr:T.textInputFocus,primary:1040,secondary:[3088],mac:{primary:1040},linux:{primary:1040}}})),s.CursorPageUp=de(new r({args:{direction:2,unit:2,select:!1,value:-1},id:"cursorPageUp",precondition:void 0,kbOpts:{weight:Lt,kbExpr:T.textInputFocus,primary:11}})),s.CursorPageUpSelect=de(new r({args:{direction:2,unit:2,select:!0,value:-1},id:"cursorPageUpSelect",precondition:void 0,kbOpts:{weight:Lt,kbExpr:T.textInputFocus,primary:1035}})),s.CursorDown=de(new r({args:{direction:3,unit:2,select:!1,value:1},id:"cursorDown",precondition:void 0,kbOpts:{weight:Lt,kbExpr:T.textInputFocus,primary:18,mac:{primary:18,secondary:[300]}}})),s.CursorDownSelect=de(new r({args:{direction:3,unit:2,select:!0,value:1},id:"cursorDownSelect",precondition:void 0,kbOpts:{weight:Lt,kbExpr:T.textInputFocus,primary:1042,secondary:[3090],mac:{primary:1042},linux:{primary:1042}}})),s.CursorPageDown=de(new r({args:{direction:3,unit:2,select:!1,value:-1},id:"cursorPageDown",precondition:void 0,kbOpts:{weight:Lt,kbExpr:T.textInputFocus,primary:12}})),s.CursorPageDownSelect=de(new r({args:{direction:3,unit:2,select:!0,value:-1},id:"cursorPageDownSelect",precondition:void 0,kbOpts:{weight:Lt,kbExpr:T.textInputFocus,primary:1036}})),s.CreateCursor=de(new class extends ki{constructor(){super({id:"createCursor",precondition:void 0})}runCoreEditorCommand(v,b){if(!b.position)return;let C;b.wholeLine?C=On.line(v,v.getPrimaryCursorState(),!1,b.position,b.viewPosition):C=On.moveTo(v,v.getPrimaryCursorState(),!1,b.position,b.viewPosition);const w=v.getCursorStates();if(w.length>1){const y=C.modelState?C.modelState.position:null,D=C.viewState?C.viewState.position:null;for(let L=0,k=w.length;LD&&(y=D);const L=new x(y,1,y,v.model.getLineMaxColumn(y));let k=0;if(C.at)switch(C.at){case hm.RawAtArgument.Top:k=3;break;case hm.RawAtArgument.Center:k=1;break;case hm.RawAtArgument.Bottom:k=4;break}const I=v.coordinatesConverter.convertModelRangeToViewRange(L);v.revealRange(b.source,!1,I,k,0)}}),s.SelectAll=new class extends PA{constructor(){super(Rle)}runDOMCommand(v){Fr&&(v.focus(),v.select()),v.ownerDocument.execCommand("selectAll")}runEditorCommand(v,b,C){const w=b._getViewModel();w&&this.runCoreEditorCommand(w,C)}runCoreEditorCommand(v,b){v.model.pushStackElement(),v.setCursorStates("keyboard",3,[On.selectAll(v,v.getPrimaryCursorState())])}},s.SetSelection=de(new class extends ki{constructor(){super({id:"setSelection",precondition:void 0})}runCoreEditorCommand(v,b){b.selection&&(v.model.pushStackElement(),v.setCursorStates(b.source,3,[wt.fromModelSelection(b.selection)]))}})})(kn||(kn={}));const Vfe=G.and(T.textInputFocus,T.columnSelection);function h0(s,e){go.registerKeybindingRule({id:s,primary:e,when:Vfe,weight:Lt+1})}h0(kn.CursorColumnSelectLeft.id,1039);h0(kn.CursorColumnSelectRight.id,1041);h0(kn.CursorColumnSelectUp.id,1040);h0(kn.CursorColumnSelectPageUp.id,1035);h0(kn.CursorColumnSelectDown.id,1042);h0(kn.CursorColumnSelectPageDown.id,1036);function UB(s){return s.register(),s}var Om;(function(s){class e extends mn{runEditorCommand(i,n,o){const r=n._getViewModel();r&&this.runCoreEditingCommand(n,r,o||{})}}s.CoreEditingCommand=e,s.LineBreakInsert=de(new class extends e{constructor(){super({id:"lineBreakInsert",precondition:T.writable,kbOpts:{weight:Lt,kbExpr:T.textInputFocus,primary:0,mac:{primary:301}}})}runCoreEditingCommand(t,i,n){t.pushUndoStop(),t.executeCommands(this.id,bi.lineBreakInsert(i.cursorConfig,i.model,i.getCursorStates().map(o=>o.modelState.selection)))}}),s.Outdent=de(new class extends e{constructor(){super({id:"outdent",precondition:T.writable,kbOpts:{weight:Lt,kbExpr:G.and(T.editorTextFocus,T.tabDoesNotMoveFocus),primary:1026}})}runCoreEditingCommand(t,i,n){t.pushUndoStop(),t.executeCommands(this.id,bi.outdent(i.cursorConfig,i.model,i.getCursorStates().map(o=>o.modelState.selection))),t.pushUndoStop()}}),s.Tab=de(new class extends e{constructor(){super({id:"tab",precondition:T.writable,kbOpts:{weight:Lt,kbExpr:G.and(T.editorTextFocus,T.tabDoesNotMoveFocus),primary:2}})}runCoreEditingCommand(t,i,n){t.pushUndoStop(),t.executeCommands(this.id,bi.tab(i.cursorConfig,i.model,i.getCursorStates().map(o=>o.modelState.selection))),t.pushUndoStop()}}),s.DeleteLeft=de(new class extends e{constructor(){super({id:"deleteLeft",precondition:void 0,kbOpts:{weight:Lt,kbExpr:T.textInputFocus,primary:1,secondary:[1025],mac:{primary:1,secondary:[1025,294,257]}}})}runCoreEditingCommand(t,i,n){const[o,r]=kf.deleteLeft(i.getPrevEditOperationType(),i.cursorConfig,i.model,i.getCursorStates().map(a=>a.modelState.selection),i.getCursorAutoClosedCharacters());o&&t.pushUndoStop(),t.executeCommands(this.id,r),i.setPrevEditOperationType(2)}}),s.DeleteRight=de(new class extends e{constructor(){super({id:"deleteRight",precondition:void 0,kbOpts:{weight:Lt,kbExpr:T.textInputFocus,primary:20,mac:{primary:20,secondary:[290,276]}}})}runCoreEditingCommand(t,i,n){const[o,r]=kf.deleteRight(i.getPrevEditOperationType(),i.cursorConfig,i.model,i.getCursorStates().map(a=>a.modelState.selection));o&&t.pushUndoStop(),t.executeCommands(this.id,r),i.setPrevEditOperationType(3)}}),s.Undo=new class extends PA{constructor(){super(jz)}runDOMCommand(t){t.ownerDocument.execCommand("undo")}runEditorCommand(t,i,n){if(!(!i.hasModel()||i.getOption(91)===!0))return i.getModel().undo()}},s.Redo=new class extends PA{constructor(){super(Kz)}runDOMCommand(t){t.ownerDocument.execCommand("redo")}runEditorCommand(t,i,n){if(!(!i.hasModel()||i.getOption(91)===!0))return i.getModel().redo()}}})(Om||(Om={}));class $B extends hx{constructor(e,t,i){super({id:e,precondition:void 0,metadata:i}),this._handlerId=t}runCommand(e,t){const i=e.get(xt).getFocusedCodeEditor();i&&i.trigger("keyboard",this._handlerId,t)}}function dp(s,e){UB(new $B("default:"+s,s)),UB(new $B(s,s,e))}dp("type",{description:"Type",args:[{name:"args",schema:{type:"object",required:["text"],properties:{text:{type:"string"}}}}]});dp("replacePreviousChar");dp("compositionType");dp("compositionStart");dp("compositionEnd");dp("paste");dp("cut");class zfe{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){kn.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){kn.MoveTo.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_moveToSelect(e,t){kn.MoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_columnSelect(e,t,i){e=this._validateViewColumn(e),kn.ColumnSelect.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,mouseColumn:t,doColumnSelect:i})}_createCursor(e,t){e=this._validateViewColumn(e),kn.CreateCursor.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,wholeLine:t})}_lastCursorMoveToSelect(e,t){kn.LastCursorMoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_wordSelect(e,t){kn.WordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_wordSelectDrag(e,t){kn.WordSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorWordSelect(e,t){kn.LastCursorWordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lineSelect(e,t){kn.LineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lineSelectDrag(e,t){kn.LineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorLineSelect(e,t){kn.LastCursorLineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorLineSelectDrag(e,t){kn.LastCursorLineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_selectAll(){kn.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)}}class i${constructor(e){this._createLine=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 Ut("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 o=0,r=0;for(let l=i;l<=n;l++){const d=l-this._rendLineNumberStart;e<=l&&l<=t&&(r===0?(o=d,r=1):r++)}if(e=n&&a<=o&&(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(),o=this.getEndLineNumber();if(e<=n)return this._rendLineNumberStart+=i,null;if(e>o)return null;if(i+e>o)return this._lines.splice(e-this._rendLineNumberStart,o-e+1);const r=[];for(let u=0;ui)continue;const l=Math.max(t,a.fromLineNumber),d=Math.min(i,a.toLineNumber);for(let c=l;c<=d;c++){const u=c-this._rendLineNumberStart;this._lines[u].onTokensChanged(),n=!0}}return n}}class n${constructor(e){this._host=e,this.domNode=this._createDomNode(),this._linesCollection=new i$(()=>this._host.createVisibleLine())}_createDomNode(){const e=It(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(145)}onFlushed(e){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;it){const r=t,a=Math.min(i,o.rendLineNumberStart-1);r<=a&&(this._insertLinesBefore(o,r,a,n,t),o.linesLength+=a-r+1)}else if(o.rendLineNumberStart0&&(this._removeLinesBefore(o,r),o.linesLength-=r)}if(o.rendLineNumberStart=t,o.rendLineNumberStart+o.linesLength-1i){const r=Math.max(0,i-o.rendLineNumberStart+1),l=o.linesLength-1-r+1;l>0&&(this._removeLinesAfter(o,l),o.linesLength-=l)}return this._finishRendering(o,!1,n),o}_renderUntouchedLines(e,t,i,n,o){const r=e.rendLineNumberStart,a=e.lines;for(let l=t;l<=i;l++){const d=r+l;a[l].layoutLine(d,n[d-o],this.viewportData.lineHeight)}}_insertLinesBefore(e,t,i,n,o){const r=[];let a=0;for(let l=t;l<=i;l++)r[a++]=this.host.createVisibleLine();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");ac._ttPolicy&&(t=ac._ttPolicy.createHTML(t)),n.innerHTML=t;for(let o=0;os});ac._sb=new l0(1e5);class s$ extends Fo{constructor(e){super(e),this._visibleLines=new n$(this),this.domNode=this._visibleLines.domNode;const i=this._context.configuration.options.get(50);Un(this.domNode,i),this._dynamicOverlays=[],this._isFocused=!1,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'),o.appendString(r),o.appendString(""),!0)}layoutLine(e,t,i){this._domNode&&(this._domNode.setTop(t),this._domNode.setHeight(i))}}class $fe extends s${constructor(e){super(e);const i=this._context.configuration.options.get(145);this._contentWidth=i.contentWidth,this.domNode.setHeight(0)}onConfigurationChanged(e){const i=this._context.configuration.options.get(145);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 jfe extends s${constructor(e){super(e);const t=this._context.configuration.options,i=t.get(145);this._contentLeft=i.contentLeft,this.domNode.setClassName("margin-view-overlays"),this.domNode.setWidth(1),Un(this.domNode,t.get(50))}onConfigurationChanged(e){const t=this._context.configuration.options;Un(this.domNode,t.get(50));const i=t.get(145);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 Ix{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){var t;(t=this.onKeyDown)===null||t===void 0||t.call(this,e)}emitKeyUp(e){var t;(t=this.onKeyUp)===null||t===void 0||t.call(this,e)}emitContextMenu(e){var t;(t=this.onContextMenu)===null||t===void 0||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseMove(e){var t;(t=this.onMouseMove)===null||t===void 0||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseLeave(e){var t;(t=this.onMouseLeave)===null||t===void 0||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseDown(e){var t;(t=this.onMouseDown)===null||t===void 0||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseUp(e){var t;(t=this.onMouseUp)===null||t===void 0||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseDrag(e){var t;(t=this.onMouseDrag)===null||t===void 0||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseDrop(e){var t;(t=this.onMouseDrop)===null||t===void 0||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseDropCanceled(){var e;(e=this.onMouseDropCanceled)===null||e===void 0||e.call(this)}emitMouseWheel(e){var t;(t=this.onMouseWheel)===null||t===void 0||t.call(this,e)}_convertViewToModelMouseEvent(e){return e.target?{event:e.event,target:this._convertViewToModelMouseTarget(e.target)}:e}_convertViewToModelMouseTarget(e){return Ix.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 W(e.afterLineNumber,1)).lineNumber}}}class Kfe extends Fo{constructor(e){super(e),this.blocks=[],this.contentWidth=-1,this.contentLeft=0,this.domNode=It(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(145),n=i.contentWidth-i.verticalScrollbarWidth;this.contentWidth!==n&&(this.contentWidth=n,e=!0);const o=i.contentLeft;return this.contentLeft!==o&&(this.contentLeft=o,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){var t;let i=0;const n=e.getDecorationsInViewport();for(const o of n){if(!o.options.blockClassName)continue;let r=this.blocks[i];r||(r=this.blocks[i]=It(document.createElement("div")),this.domNode.appendChild(r));let a,l;o.options.blockIsAfterEnd?(a=e.getVerticalOffsetAfterLineNumber(o.range.endLineNumber,!1),l=e.getVerticalOffsetAfterLineNumber(o.range.endLineNumber,!0)):(a=e.getVerticalOffsetForLineNumber(o.range.startLineNumber,!0),l=o.range.isEmpty()&&!o.options.blockDoesNotCollapse?e.getVerticalOffsetForLineNumber(o.range.startLineNumber,!1):e.getVerticalOffsetAfterLineNumber(o.range.endLineNumber,!0));const[d,c,u,h]=(t=o.options.blockPadding)!==null&&t!==void 0?t:[0,0,0,0];r.setClassName("blockDecorations-block "+o.options.blockClassName),r.setLeft(this.contentLeft-h),r.setWidth(this.contentWidth+h+c),r.setTop(a-e.scrollTop-d),r.setHeight(l-a+d+u),i++}for(let o=i;o0?this.domNode.setDisplay("block"):this.domNode.setDisplay("none"),this._cachedDomNodeOffsetWidth=-1,this._cachedDomNodeOffsetHeight=-1}_layoutBoxInViewport(e,t,i,n){const o=e.top,r=o,a=e.top+e.height,l=n.viewportHeight-a,d=o-i,c=r>=i,u=a,h=l>=i;let g=e.left;return g+t>n.scrollLeft+n.viewportWidth&&(g=n.scrollLeft+n.viewportWidth-t),gd){const g=h-(d-n);h-=g,i-=g}if(h=v,w=g+i<=f.height-b;return this._fixedOverflowWidgets?{fitsAbove:C,aboveTop:Math.max(h,v),fitsBelow:w,belowTop:g,left:_}:{fitsAbove:C,aboveTop:a,fitsBelow:w,belowTop:l,left:m}}_prepareRenderWidgetAtExactPositionOverflowing(e){return new z0(e.top,e.left+this._contentLeft)}_getAnchorsCoordinates(e){var t,i;const n=a(this._primaryAnchor.viewPosition,this._affinity,this._lineHeight),o=((t=this._secondaryAnchor.viewPosition)===null||t===void 0?void 0:t.lineNumber)===((i=this._primaryAnchor.viewPosition)===null||i===void 0?void 0:i.lineNumber)?this._secondaryAnchor.viewPosition:null,r=a(o,this._affinity,this._lineHeight);return{primary:n,secondary:r};function a(l,d,c){if(!l)return null;const u=e.visibleRangeForPosition(l);if(!u)return null;const h=l.column===1&&d===3?0:u.left,g=e.getVerticalOffsetForLineNumber(l.lineNumber)-e.scrollTop;return new jB(g,h,c)}}_reduceAnchorCoordinates(e,t,i){if(!t)return e;const n=this._context.configuration.options.get(50);let o=t.left;return oe.endLineNumber||this.domNode.setMaxWidth(this._maxWidth)}prepareRender(e){this._renderData=this._prepareRenderWidget(e)}render(e){if(!this._renderData){this._isVisible&&(this.domNode.removeAttribute("monaco-visible-content-widget"),this._isVisible=!1,this.domNode.setVisibility("hidden")),typeof this._actual.afterRender=="function"&&pI(this._actual.afterRender,this._actual,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"&&pI(this._actual.afterRender,this._actual,this._renderData.position)}}class V0{constructor(e,t){this.modelPosition=e,this.viewPosition=t}}class z0{constructor(e,t){this.top=e,this.left=t,this._coordinateBrand=void 0}}class jB{constructor(e,t,i){this.top=e,this.left=t,this.height=i,this._anchorCoordinateBrand=void 0}}function pI(s,e,...t){try{return s.call(e,...t)}catch{return null}}class o$ extends lp{constructor(e){super(),this._context=e;const t=this._context.configuration.options,i=t.get(145);this._renderLineHighlight=t.get(96),this._renderLineHighlightOnlyWhenFocus=t.get(97),this._wordWrap=i.isViewportWrapping,this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,this._selectionIsEmpty=!0,this._focused=!1,this._cursorLineNumbers=[1],this._selections=[new we(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 o of this._selections)t.add(o.positionLineNumber);const i=Array.from(t);i.sort((o,r)=>o-r),Ci(this._cursorLineNumbers,i)||(this._cursorLineNumbers=i,e=!0);const n=this._selections.every(o=>o.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(145);return this._renderLineHighlight=t.get(96),this._renderLineHighlightOnlyWhenFocus=t.get(97),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,d=l.convertViewPositionToModelPosition(new W(a,1)).lineNumber,c=l.convertModelPositionToViewPosition(new W(d,1)).lineNumber,u=l.convertModelPositionToViewPosition(new W(d,this._context.viewModel.model.getLineMaxColumn(d))).lineNumber,h=Math.max(c,t),g=Math.min(u,i);for(let f=h;f<=g;f++){const m=f-t;n[m]=r}}}const o=this._renderOne(e,!0);for(const r of this._cursorLineNumbers){if(ri)continue;const a=r-t;n[a]=o}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 Zfe extends o${_renderOne(e,t){return`
`}_shouldRenderThis(){return this._shouldRenderInContent()}_shouldRenderOther(){return this._shouldRenderInMargin()}}class Xfe extends o${_renderOne(e,t){return`
`}_shouldRenderThis(){return!0}_shouldRenderOther(){return this._shouldRenderInContent()}}zr((s,e)=>{const t=s.getColor($U);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()||s.defines(WB)){const i=s.getColor(WB);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}; }`),dd(s.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 Yfe extends lp{constructor(e){super(),this._context=e;const t=this._context.configuration.options;this._typicalHalfwidthCharacterWidth=t.get(50).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(50).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,d=t.length;l{if(l.options.zIndexd.options.zIndex)return 1;const c=l.options.className,u=d.options.className;return cu?1:x.compareRangesUsingStarts(l.range,d.range)});const o=e.visibleRange.startLineNumber,r=e.visibleRange.endLineNumber,a=[];for(let l=o;l<=r;l++){const d=l-o;a[d]=""}this._renderWholeLineDecorations(e,i,a),this._renderNormalDecorations(e,i,a),this._renderResult=a}_renderWholeLineDecorations(e,t,i){const n=e.visibleRange.startLineNumber,o=e.visibleRange.endLineNumber;for(let r=0,a=t.length;r',c=Math.max(l.range.startLineNumber,n),u=Math.min(l.range.endLineNumber,o);for(let h=c;h<=u;h++){const g=h-n;i[g]+=d}}}_renderNormalDecorations(e,t,i){var n;const o=e.visibleRange.startLineNumber;let r=null,a=!1,l=null,d=!1;for(let c=0,u=t.length;c';a[h]+=v}}}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}class Qfe extends Fo{constructor(e,t,i,n){super(e);const o=this._context.configuration.options,r=o.get(103),a=o.get(75),l=o.get(40),d=o.get(106),c={listenOnDomNode:i.domNode,className:"editor-scrollable "+MA(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:d,scrollByPage:r.scrollByPage};this.scrollbar=this._register(new Lx(t.domNode,c,this._context.viewLayout.getScrollable())),rl.write(this.scrollbar.getDomNode(),6),this.scrollbarDomNode=It(this.scrollbar.getDomNode()),this.scrollbarDomNode.setPosition("absolute"),this._setLayout();const u=(h,g,f)=>{const m={};{const _=h.scrollTop;_&&(m.scrollTop=this._context.viewLayout.getCurrentScrollTop()+_,h.scrollTop=0)}if(f){const _=h.scrollLeft;_&&(m.scrollLeft=this._context.viewLayout.getCurrentScrollLeft()+_,h.scrollLeft=0)}this._context.viewModel.viewLayout.setScrollPosition(m,1)};this._register(K(i.domNode,"scroll",h=>u(i.domNode,!0,!0))),this._register(K(t.domNode,"scroll",h=>u(t.domNode,!0,!1))),this._register(K(n.domNode,"scroll",h=>u(n.domNode,!0,!1))),this._register(K(this.scrollbarDomNode.domNode,"scroll",h=>u(this.scrollbarDomNode.domNode,!0,!1)))}dispose(){super.dispose()}_setLayout(){const e=this._context.configuration.options,t=e.get(145);this.scrollbarDomNode.setLeft(t.contentLeft),e.get(73).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(103)||e.hasChanged(75)||e.hasChanged(40)){const t=this._context.configuration.options,i=t.get(103),n=t.get(75),o=t.get(40),r=t.get(106),a={vertical:i.vertical,horizontal:i.horizontal,verticalScrollbarSize:i.verticalScrollbarSize,horizontalScrollbarSize:i.horizontalScrollbarSize,scrollByPage:i.scrollByPage,handleMouseWheel:i.handleMouseWheel,mouseWheelScrollSensitivity:n,fastScrollSensitivity:o,scrollPredominantAxis:r};this.scrollbar.updateOptions(a)}return e.hasChanged(145)&&this._setLayout(),!0}onScrollChanged(e){return!0}onThemeChanged(e){return this.scrollbar.updateClassName("editor-scrollable "+MA(this._context.theme.type)),!0}prepareRender(e){}render(e){this.scrollbar.renderNow()}}class FA{constructor(e,t,i,n,o){this.startLineNumber=e,this.endLineNumber=t,this.className=i,this.tooltip=n,this._decorationToRenderBrand=void 0,this.zIndex=o??0}}class Jfe{constructor(e,t,i){this.className=e,this.zIndex=t,this.tooltip=i}}class epe{constructor(){this.decorations=[]}add(e){this.decorations.push(e)}getDecorations(){return this.decorations}}class r$ extends lp{_render(e,t,i){const n=[];for(let a=e;a<=t;a++){const l=a-e;n[l]=new epe}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 d=Math.max(a,i),c=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new W(d,0)),u=this._context.viewModel.glyphLanes.getLanesAtLine(c.lineNumber).indexOf(o.preference.lane);t.push(new npe(d,u,o.preference.zIndex,o))}}_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 o=t.takeWhile(a=>a.lineNumber===n.lineNumber&&a.laneIndex===n.laneIndex);if(!o||o.length===0)break;const r=o[0];if(r.type===0){const a=[];for(const l of o){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;){const i=this._managedDomNodes.pop();i==null||i.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],o=this._glyphMarginLeft+i.renderInfo.laneIndex*this._lineHeight;i.domNode.setDisplay("block"),i.domNode.setTop(n),i.domNode.setLeft(o),i.domNode.setWidth(t),i.domNode.setHeight(this._lineHeight)}for(let i=0;ithis._decorationGlyphsToRender.length;){const i=this._managedDomNodes.pop();i==null||i.domNode.remove()}}}class ipe{constructor(e,t,i,n){this.lineNumber=e,this.laneIndex=t,this.zIndex=i,this.className=n,this.type=0}accept(e){return new spe(this.lineNumber,this.laneIndex,e)}}class npe{constructor(e,t,i,n){this.lineNumber=e,this.laneIndex=t,this.zIndex=i,this.widget=n,this.type=1}}class spe{constructor(e,t,i){this.lineNumber=e,this.laneIndex=t,this.combinedClassName=i}}class a$ extends H{constructor(){super(...arguments),this._isDisposed=!1}dispose(){super.dispose(),this._isDisposed=!0}assertNotDisposed(){if(this._isDisposed)throw new Error("TextModelPart is disposed!")}}function Tx(s,e){let t=0,i=0;const n=s.length;for(;in)throw new Ut("Illegal value for lineNumber");const o=this.getLanguageConfiguration(this.textModel.getLanguageId()).foldingRules,r=!!(o&&o.offSide);let a=-2,l=-1,d=-2,c=-1;const u=L=>{if(a!==-1&&(a===-2||a>L-1)){a=-1,l=-1;for(let k=L-2;k>=0;k--){const I=this._computeIndentLevel(k);if(I>=0){a=k,l=I;break}}}if(d===-2){d=-1,c=-1;for(let k=L;k=0){d=k,c=I;break}}}};let h=-2,g=-1,f=-2,m=-1;const _=L=>{if(h===-2){h=-1,g=-1;for(let k=L-2;k>=0;k--){const I=this._computeIndentLevel(k);if(I>=0){h=k,g=I;break}}}if(f!==-1&&(f===-2||f=0){f=k,m=I;break}}}};let v=0,b=!0,C=0,w=!0,y=0,D=0;for(let L=0;b||w;L++){const k=e-L,I=e+L;L>1&&(k<1||k1&&(I>n||I>i)&&(w=!1),L>5e4&&(b=!1,w=!1);let O=-1;if(b&&k>=1){const P=this._computeIndentLevel(k-1);P>=0?(d=k-1,c=P,O=Math.ceil(P/this.textModel.getOptions().indentSize)):(u(k),O=this._getIndentLevelForWhitespaceLine(r,l,c))}let R=-1;if(w&&I<=n){const P=this._computeIndentLevel(I-1);P>=0?(h=I-1,g=P,R=Math.ceil(P/this.textModel.getOptions().indentSize)):(_(I),R=this._getIndentLevelForWhitespaceLine(r,g,m))}if(L===0){D=O;continue}if(L===1){if(I<=n&&R>=0&&D+1===R){b=!1,v=I,C=I,y=R;continue}if(k>=1&&O>=0&&O-1===D){w=!1,v=k,C=k,y=O;continue}if(v=e,C=e,y=D,y===0)return{startLineNumber:v,endLineNumber:C,indent:y}}b&&(O>=y?v=k:b=!1),w&&(R>=y?C=I:w=!1)}return{startLineNumber:v,endLineNumber:C,indent:y}}getLinesBracketGuides(e,t,i,n){var o;const r=[];for(let h=e;h<=t;h++)r.push([]);const a=!0,l=this.textModel.bracketPairs.getBracketPairsInRangeWithMinIndentation(new x(e,1,t,this.textModel.getLineMaxColumn(t))).toArray();let d;if(i&&l.length>0){const h=(e<=i.lineNumber&&i.lineNumber<=t?l:this.textModel.bracketPairs.getBracketPairsInRange(x.fromPositions(i)).toArray()).filter(g=>x.strictContainsPosition(g.range,i));d=(o=YS(h,g=>a))===null||o===void 0?void 0:o.range}const c=this.textModel.getOptions().bracketPairColorizationOptions.independentColorPoolPerBracketType,u=new l$;for(const h of l){if(!h.closingBracketRange)continue;const g=d&&h.range.equalsRange(d);if(!g&&!n.includeInactive)continue;const f=u.getInlineClassName(h.nestingLevel,h.nestingLevelOfEqualBracketType,c)+(n.highlightActive&&g?" "+u.activeClassName:""),m=h.openingBracketRange.getStartPosition(),_=h.closingBracketRange.getStartPosition(),v=n.horizontalGuides===df.Enabled||n.horizontalGuides===df.EnabledForActive&&g;if(h.range.startLineNumber===h.range.endLineNumber){v&&r[h.range.startLineNumber-e].push(new Yg(-1,h.openingBracketRange.getEndPosition().column,f,new Gv(!1,_.column),-1,-1));continue}const b=this.getVisibleColumnFromPosition(_),C=this.getVisibleColumnFromPosition(h.openingBracketRange.getStartPosition()),w=Math.min(C,b,h.minVisibleColumnIndentation+1);let y=!1;Cs(this.textModel.getLineContent(h.closingBracketRange.startLineNumber))=e&&C>w&&r[m.lineNumber-e].push(new Yg(w,-1,f,new Gv(!1,m.column),-1,-1)),_.lineNumber<=t&&b>w&&r[_.lineNumber-e].push(new Yg(w,-1,f,new Gv(!y,_.column),-1,-1)))}for(const h of r)h.sort((g,f)=>g.visibleColumn-f.visibleColumn);return r}getVisibleColumnFromPosition(e){return hn.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(),o=this.getLanguageConfiguration(this.textModel.getLanguageId()).foldingRules,r=!!(o&&o.offSide),a=new Array(t-e+1);let l=-2,d=-1,c=-2,u=-1;for(let h=e;h<=t;h++){const g=h-e,f=this._computeIndentLevel(h-1);if(f>=0){l=h-1,d=f,a[g]=Math.ceil(f/n.indentSize);continue}if(l===-2){l=-1,d=-1;for(let m=h-2;m>=0;m--){const _=this._computeIndentLevel(m);if(_>=0){l=m,d=_;break}}}if(c!==-1&&(c===-2||c=0){c=m,u=_;break}}}a[g]=this._getIndentLevelForWhitespaceLine(r,d,u)}return a}_getIndentLevelForWhitespaceLine(e,t,i){const n=this.textModel.getOptions();return t===-1||i===-1?0:tl||this._maxIndentLeft>0&&b>this._maxIndentLeft)break;const C=v.horizontalLine?v.horizontalLine.top?"horizontal-top":"horizontal-bottom":"vertical",w=v.horizontalLine?((o=(n=e.visibleRangeForPosition(new W(h,v.horizontalLine.endColumn)))===null||n===void 0?void 0:n.left)!==null&&o!==void 0?o:b+this._spaceWidth)-b:this._spaceWidth;m+=`
`}u[g]=m}this._renderResult=u}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?df.Enabled:this._bracketPairGuideOptions.bracketPairsHorizontal==="active"?df.EnabledForActive:df.Disabled,includeInactive:this._bracketPairGuideOptions.bracketPairs===!0}):null,o=this._bracketPairGuideOptions.indentation?this._context.viewModel.getLinesIndentGuides(e,t):null;let r=0,a=0,l=0;if(this._bracketPairGuideOptions.highlightActiveIndentation!==!1&&i){const u=this._context.viewModel.getActiveIndentGuide(i.lineNumber,e,t);r=u.startLineNumber,a=u.endLineNumber,l=u.indent}const{indentSize:d}=this._context.viewModel.model.getOptions(),c=[];for(let u=e;u<=t;u++){const h=new Array;c.push(h);const g=n?n[u-e]:[],f=new Hc(g),m=o?o[u-e]:0;for(let _=1;_<=m;_++){const v=(_-1)*d+1,b=(this._bracketPairGuideOptions.highlightActiveIndentation==="always"||g.length===0)&&r<=u&&u<=a&&_===l;h.push(...f.takeWhile(w=>w.visibleColumn!0)||[])}return c}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}function Ip(s){if(!(s&&s.isTransparent()))return s}zr((s,e)=>{const t=[{bracketColor:qU,guideColor:cfe,guideColorActive:mfe},{bracketColor:GU,guideColor:ufe,guideColorActive:_fe},{bracketColor:ZU,guideColor:hfe,guideColorActive:vfe},{bracketColor:XU,guideColor:gfe,guideColorActive:bfe},{bracketColor:YU,guideColor:ffe,guideColorActive:Cfe},{bracketColor:QU,guideColor:pfe,guideColorActive:wfe}],i=new l$,n=[{indentColor:w1,indentColorActive:y1},{indentColor:jge,indentColorActive:Xge},{indentColor:Kge,indentColorActive:Yge},{indentColor:qge,indentColorActive:Qge},{indentColor:Gge,indentColorActive:Jge},{indentColor:Zge,indentColorActive:efe}],o=t.map(a=>{var l,d;const c=s.getColor(a.bracketColor),u=s.getColor(a.guideColor),h=s.getColor(a.guideColorActive),g=Ip((l=Ip(u))!==null&&l!==void 0?l:c==null?void 0:c.transparent(.3)),f=Ip((d=Ip(h))!==null&&d!==void 0?d:c);if(!(!g||!f))return{guideColor:g,guideColorActive:f}}).filter(rd),r=n.map(a=>{const l=s.getColor(a.indentColor),d=s.getColor(a.indentColorActive),c=Ip(l),u=Ip(d);if(!(!c||!u))return{indentColor:c,indentColorActive:u}}).filter(rd);if(o.length>0){for(let a=0;a<30;a++){const l=o[a%o.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 mI{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 ape{constructor(){this._currentVisibleRange=new x(1,1,1,1)}getCurrentVisibleRange(){return this._currentVisibleRange}setCurrentVisibleRange(e){this._currentVisibleRange=e}}class lpe{constructor(e,t,i,n,o,r,a){this.minimalReveal=e,this.lineNumber=t,this.startColumn=i,this.endColumn=n,this.startScrollTop=o,this.stopScrollTop=r,this.scrollType=a,this.type="range",this.minLineNumber=t,this.maxLineNumber=t}}class dpe{constructor(e,t,i,n,o){this.minimalReveal=e,this.selections=t,this.startScrollTop=i,this.stopScrollTop=n,this.scrollType=o,this.type="selections";let r=t[0].startLineNumber,a=t[0].endLineNumber;for(let l=1,d=t.length;l{this._updateLineWidthsSlow()},200),this._asyncCheckMonospaceFontAssumptions=new Wt(()=>{this._checkMonospaceFontAssumptions()},2e3),this._lastRenderedData=new ape,this._horizontalRevealRequest=null,this._stickyScrollEnabled=n.get(115).enabled,this._maxNumberStickyLines=n.get(115).maxLineCount}dispose(){this._asyncUpdateLineWidths.dispose(),this._asyncCheckMonospaceFontAssumptions.dispose(),super.dispose()}getDomNode(){return this.domNode}createVisibleLine(){return new Ul(this._viewLineOptions)}onConfigurationChanged(e){this._visibleLines.onConfigurationChanged(e),e.hasChanged(146)&&(this._maxLineWidth=0);const t=this._context.configuration.options,i=t.get(50),n=t.get(146);return this._lineHeight=t.get(67),this._typicalHalfwidthCharacterWidth=i.typicalHalfwidthCharacterWidth,this._isViewportWrapping=n.isViewportWrapping,this._revealHorizontalRightPadding=t.get(100),this._cursorSurroundingLines=t.get(29),this._cursorSurroundingLinesStyle=t.get(30),this._canUseLayerHinting=!t.get(32),this._stickyScrollEnabled=t.get(115).enabled,this._maxNumberStickyLines=t.get(115).maxLineCount,Un(this.domNode,i),this._onOptionsMaybeChanged(),e.hasChanged(145)&&(this._maxLineWidth=0),!0}_onOptionsMaybeChanged(){const e=this._context.configuration,t=new RB(e,this._context.theme.type);if(!this._viewLineOptions.equals(t)){this._viewLineOptions=t;const i=this._visibleLines.getStartLineNumber(),n=this._visibleLines.getEndLineNumber();for(let o=i;o<=n;o++)this._visibleLines.getVisibleLine(o).onOptionsChanged(this._viewLineOptions);return!0}return!1}onCursorStateChanged(e){const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();let n=!1;for(let o=t;o<=i;o++)n=this._visibleLines.getVisibleLine(o).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);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 lpe(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 dpe(e.minimalReveal,e.selections,this._context.viewLayout.getCurrentScrollTop(),i.scrollTop,e.scrollType)):this._horizontalRevealRequest=null;const o=Math.abs(this._context.viewLayout.getCurrentScrollTop()-i.scrollTop)<=this._lineHeight?1:e.scrollType;return this._context.viewModel.viewLayout.setScrollPosition(i,o),!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 W(n,1);const o=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 mI(this.domNode.domNode,this._textRangeRestingSpot),o=this._visibleLines.getVisibleLine(e).getWidth(n);return this._updateLineWidthsSlowIfDomDidLayout(n),o}linesVisibleRangesForRange(e,t){if(this.shouldRender())return null;const i=e.endLineNumber,n=x.intersectRanges(e,this._lastRenderedData.getCurrentVisibleRange());if(!n)return null;const o=[];let r=0;const a=new mI(this.domNode.domNode,this._textRangeRestingSpot);let l=0;t&&(l=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new W(n.startLineNumber,1)).lineNumber);const d=this._visibleLines.getStartLineNumber(),c=this._visibleLines.getEndLineNumber();for(let u=n.startLineNumber;u<=n.endLineNumber;u++){if(uc)continue;const h=u===n.startLineNumber?n.startColumn:1,g=u!==n.endLineNumber,f=g?this._context.viewModel.getLineMaxColumn(u):n.endColumn,m=this._visibleLines.getVisibleLine(u).getVisibleRangesForRange(u,h,f,a);if(m){if(t&&uthis._visibleLines.getEndLineNumber())return null;const n=new mI(this.domNode.domNode,this._textRangeRestingSpot),o=this._visibleLines.getVisibleLine(e).getVisibleRangesForRange(e,t,i,n);return this._updateLineWidthsSlowIfDomDidLayout(n),o}visibleRangeForPosition(e){const t=this._visibleRangesForLineRange(e.lineNumber,e.column,e.column);return t?new dge(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,o=!0;for(let r=t;r<=i;r++){const a=this._visibleLines.getVisibleLine(r);if(e&&!a.getWidthIsFast()){o=!1;continue}n=Math.max(n,a.getWidth(null))}return o&&t===1&&i===this._context.viewModel.getLineCount()&&(this._maxLineWidth=0),this._ensureMaxLineWidth(n),o}_checkMonospaceFontAssumptions(){let e=-1,t=-1;const i=this._visibleLines.getStartLineNumber(),n=this._visibleLines.getEndLineNumber();for(let o=i;o<=n;o++){const r=this._visibleLines.getVisibleLine(o);if(r.needsMonospaceFontCheck()){const a=r.getWidth(null);a>t&&(t=a,e=o)}}if(e!==-1&&!this._visibleLines.getVisibleLine(e).monospaceAssumptionsAreValid())for(let o=i;o<=n;o++)this._visibleLines.getVisibleLine(o).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||this._ensureMaxLineWidth(n.maxHorizontalOffset),this._context.viewModel.viewLayout.setScrollPosition({scrollLeft:n.scrollLeft},i.scrollType))}}if(this._updateLineWidthsFast()?this._asyncUpdateLineWidths.cancel():this._asyncUpdateLineWidths.schedule(),$s&&!this._asyncCheckMonospaceFontAssumptions.isScheduled()){const i=this._visibleLines.getStartLineNumber(),n=this._visibleLines.getEndLineNumber();for(let o=i;o<=n;o++)if(this._visibleLines.getVisibleLine(o).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 v=o[0].startLineNumber,b=o[0].endLineNumber;for(let C=1,w=o.length;Cl){if(!c)return-1;_=u}else if(r===5||r===6)if(r===6&&a<=u&&h<=d)_=a;else{const v=Math.max(5*this._lineHeight,l*.2),b=u-v,C=h-l;_=Math.max(C,b)}else if(r===1||r===2)if(r===2&&a<=u&&h<=d)_=a;else{const v=(u+h)/2;_=Math.max(0,v-l/2)}else _=this._computeMinimumScrolling(a,d,u,h,r===3,r===4);return _}_computeScrollLeftToReveal(e){const t=this._context.viewLayout.getCurrentViewport(),i=this._context.configuration.options.get(145),n=t.left,o=n+t.width-i.verticalScrollbarWidth;let r=1073741824,a=0;if(e.type==="range"){const d=this._visibleRangesForLineRange(e.lineNumber,e.startColumn,e.endColumn);if(!d)return null;for(const c of d.ranges)r=Math.min(r,Math.round(c.left)),a=Math.max(a,Math.round(c.left+c.width))}else for(const d of e.selections){if(d.startLineNumber!==d.endLineNumber)return null;const c=this._visibleRangesForLineRange(d.startLineNumber,d.startColumn,d.endColumn);if(!c)return null;for(const u of c.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-Nx.HORIZONTAL_EXTRA_PX),a+=this._revealHorizontalRightPadding),e.type==="selections"&&a-r>t.width?null:{scrollLeft:this._computeMinimumScrolling(n,o,r,a),maxHorizontalOffset:a}}_computeMinimumScrolling(e,t,i,n,o,r){e=e|0,t=t|0,i=i|0,n=n|0,o=!!o,r=!!r;const a=t-e;if(n-it)return Math.max(0,n-a)}else return i;return e}}Nx.HORIZONTAL_EXTRA_PX=30;class cpe extends r${constructor(e){super(),this._context=e;const i=this._context.configuration.options.get(145);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(145);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){var t,i;const n=e.getDecorationsInViewport(),o=[];let r=0;for(let a=0,l=n.length;a',l=[];for(let d=t;d<=i;d++){const c=d-t,u=n[c].getDecorations();let h="";for(const g of u){let f='
';o[a]=d}this._renderResult=o}render(e,t){return this._renderResult?this._renderResult[t-e]:""}}class Qo{constructor(e,t,i,n){this._rgba8Brand=void 0,this.r=Qo._clamp(e),this.g=Qo._clamp(t),this.b=Qo._clamp(i),this.a=Qo._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}}Qo.Empty=new Qo(0,0,0,0);class D1 extends H{static getInstance(){return this._INSTANCE||(this._INSTANCE=new D1),this._INSTANCE}constructor(){super(),this._onDidChange=new B,this.onDidChange=this._onDidChange.event,this._updateColorMap(),this._register(Ki.onDidChange(e=>{e.changedColorMap&&this._updateColorMap()}))}_updateColorMap(){const e=Ki.getColorMap();if(!e){this._colors=[Qo.Empty],this._backgroundIsLight=!0;return}this._colors=[Qo.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}}D1._INSTANCE=null;const hpe=(()=>{const s=[];for(let e=32;e<=126;e++)s.push(e);return s.push(65533),s})(),gpe=(s,e)=>(s-=32,s<0||s>96?e<=2?(s+96)%96:95:s);class eC{constructor(e,t){this.scale=t,this._minimapCharRendererBrand=void 0,this.charDataNormal=eC.soften(e,12/15),this.charDataLight=eC.soften(e,50/60)}static soften(e,t){const i=new Uint8ClampedArray(e.length);for(let n=0,o=e.length;ne.width||i+f>e.height){console.warn("bad render request outside image data");return}const m=c?this.charDataLight:this.charDataNormal,_=gpe(n,d),v=e.width*4,b=a.r,C=a.g,w=a.b,y=o.r-b,D=o.g-C,L=o.b-w,k=Math.max(r,l),I=e.data;let O=_*h*g,R=i*v+t*4;for(let P=0;Pe.width||i+u>e.height){console.warn("bad render request outside image data");return}const h=e.width*4,g=.5*(o/255),f=r.r,m=r.g,_=r.b,v=n.r-f,b=n.g-m,C=n.b-_,w=f+v*g,y=m+b*g,D=_+C*g,L=Math.max(o,a),k=e.data;let I=i*h+t*4;for(let O=0;O{const e=new Uint8ClampedArray(s.length/2);for(let t=0;t>1]=KB[s[t]]<<4|KB[s[t+1]]&15;return e},GB={1:o_(()=>qB("0000511D6300CF609C709645A78432005642574171487021003C451900274D35D762755E8B629C5BA856AF57BA649530C167D1512A272A3F6038604460398526BCA2A968DB6F8957C768BE5FBE2FB467CF5D8D5B795DC7625B5DFF50DE64C466DB2FC47CD860A65E9A2EB96CB54CE06DA763AB2EA26860524D3763536601005116008177A8705E53AB738E6A982F88BAA35B5F5B626D9C636B449B737E5B7B678598869A662F6B5B8542706C704C80736A607578685B70594A49715A4522E792")),2:o_(()=>qB("000000000000000055394F383D2800008B8B1F210002000081B1CBCBCC820000847AAF6B9AAF2119BE08B8881AD60000A44FD07DCCF107015338130C00000000385972265F390B406E2437634B4B48031B12B8A0847000001E15B29A402F0000000000004B33460B00007A752C2A0000000000004D3900000084394B82013400ABA5CFC7AD9C0302A45A3E5A98AB000089A43382D97900008BA54AA087A70A0248A6A7AE6DBE0000BF6F94987EA40A01A06DCFA7A7A9030496C32F77891D0000A99FB1A0AFA80603B29AB9CA75930D010C0948354D3900000C0948354F37460D0028BE673D8400000000AF9D7B6E00002B007AA8933400007AA642675C2700007984CFB9C3985B768772A8A6B7B20000CAAECAAFC4B700009F94A6009F840009D09F9BA4CA9C0000CC8FC76DC87F0000C991C472A2000000A894A48CA7B501079BA2C9C69BA20000B19A5D3FA89000005CA6009DA2960901B0A7F0669FB200009D009E00B7890000DAD0F5D092820000D294D4C48BD10000B5A7A4A3B1A50402CAB6CBA6A2000000B5A7A4A3B1A8044FCDADD19D9CB00000B7778F7B8AAE0803C9AB5D3F5D3F00009EA09EA0BAB006039EA0989A8C7900009B9EF4D6B7C00000A9A7816CACA80000ABAC84705D3F000096DA635CDC8C00006F486F266F263D4784006124097B00374F6D2D6D2D6D4A3A95872322000000030000000000008D8939130000000000002E22A5C9CBC70600AB25C0B5C9B400061A2DB04CA67001082AA6BEBEBFC606002321DACBC19E03087AA08B6768380000282FBAC0B8CA7A88AD25BBA5A29900004C396C5894A6000040485A6E356E9442A32CD17EADA70000B4237923628600003E2DE9C1D7B500002F25BBA5A2990000231DB6AFB4A804023025C0B5CAB588062B2CBDBEC0C706882435A75CA20000002326BD6A82A908048B4B9A5A668000002423A09CB4BB060025259C9D8A7900001C1FCAB2C7C700002A2A9387ABA200002626A4A47D6E9D14333163A0C87500004B6F9C2D643A257049364936493647358A34438355497F1A0000A24C1D590000D38DFFBDD4CD3126"))};class Zv{static create(e,t){if(this.lastCreated&&e===this.lastCreated.scale&&t===this.lastFontFamily)return this.lastCreated;let i;return GB[e]?i=new eC(GB[e](),e):i=Zv.createFromSampleData(Zv.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=96*10,t.style.width=96*10+"px",i.fillStyle="#ffffff",i.font=`bold 16px ${e}`,i.textBaseline="middle";let n=0;for(const o of hpe)i.fillText(String.fromCharCode(o),n,16/2),n+=10;return i.getImageData(0,0,96*10,16)}static createFromSampleData(e,t){if(e.length!==61440)throw new Error("Unexpected source in MinimapCharRenderer");const n=Zv._downsample(e,t);return new eC(n,t)}static _downsampleChar(e,t,i,n,o){const r=1*o,a=2*o;let l=n,d=0;for(let c=0;c0){const d=255/l;for(let c=0;cZv.create(this.fontScale,l.fontFamily)),this.defaultBackgroundColor=i.getColor(2),this.backgroundColor=Bm._getMinimapBackground(t,this.defaultBackgroundColor),this.foregroundAlpha=Bm._getMinimapForegroundOpacity(t)}static _getMinimapBackground(e,t){const i=e.getColor(the);return i?new Qo(i.rgba.r,i.rgba.g,i.rgba.b,Math.round(255*i.rgba.a)):t}static _getMinimapForegroundOpacity(e){const t=e.getColor(ihe);return t?Qo._clamp(Math.round(255*t.rgba.a)):255}static _getSectionHeaderColor(e,t){const i=e.getColor(Tr);return i?new Qo(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.defaultBackgroundColor&&this.defaultBackgroundColor.equals(e.defaultBackgroundColor)&&this.backgroundColor&&this.backgroundColor.equals(e.backgroundColor)&&this.foregroundAlpha===e.foregroundAlpha}}class Xv{constructor(e,t,i,n,o,r,a,l,d){this.scrollTop=e,this.scrollHeight=t,this.sliderNeeded=i,this._computedSliderRatio=n,this.sliderTop=o,this.sliderHeight=r,this.topPaddingLineCount=a,this.startLineNumber=l,this.endLineNumber=d}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,o,r,a,l,d,c,u){const h=e.pixelRatio,g=e.minimapLineHeight,f=Math.floor(e.canvasInnerHeight/g),m=e.lineHeight;if(e.minimapHeightIsEditorHeight){let D=l*e.lineHeight+e.paddingTop+e.paddingBottom;e.scrollBeyondLastLine&&(D+=Math.max(0,o-e.lineHeight-e.paddingBottom));const L=Math.max(1,Math.floor(o*o/D)),k=Math.max(0,e.minimapHeight-L),I=k/(c-o),O=d*I,R=k>0,P=Math.floor(e.canvasInnerHeight/e.minimapLineHeight),F=Math.floor(e.paddingTop/e.lineHeight);return new Xv(d,c,R,I,O,L,F,1,Math.min(a,P))}let _;if(r&&i!==a){const D=i-t+1;_=Math.floor(D*g/h)}else{const D=o/m;_=Math.floor(D*g/h)}const v=Math.floor(e.paddingTop/m);let b=Math.floor(e.paddingBottom/m);if(e.scrollBeyondLastLine){const D=o/m;b=Math.max(b,D-1)}let C;if(b>0){const D=o/m;C=(v+a+b-D-1)*g/h}else C=Math.max(0,(v+a)*g/h-_);C=Math.min(e.minimapHeight-_,C);const w=C/(c-o),y=d*w;if(f>=v+a+b){const D=C>0;return new Xv(d,c,D,w,y,_,v,1,a)}else{let D;t>1?D=t+v:D=Math.max(1,d/m);let L,k=Math.max(1,Math.floor(D-y*h/g));kd&&(k=Math.min(k,u.startLineNumber),L=Math.max(L,u.topPaddingLineCount)),u.scrollTop=e.paddingTop?R=(t-k+L+O)*g/h:R=d/e.paddingTop*(L+O)*g/h,new Xv(d,c,!0,w,R,_,L,k,I)}}}class aD{constructor(e){this.dy=e}onContentChanged(){this.dy=-1}onTokensChanged(){this.dy=-1}}aD.INVALID=new aD(-1);class ZB{constructor(e,t,i){this.renderedLayout=e,this._imageData=t,this._renderedLines=new i$(()=>aD.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,o=i.length;n1){for(let v=0,b=n-1;v0&&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 o=this.minimapLines.length-1;o>=0&&!(this.minimapLines[o]=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]=tC.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 o=0,r=t-e+1;o{var o;return!(!((o=n.options.minimap)===null||o===void 0)&&o.sectionHeaderStyle)});if(this._samplingState){const n=[];for(const o of i){if(!o.options.minimap)continue;const r=o.range,a=this._samplingState.modelLineToMinimapLine(r.startLineNumber),l=this._samplingState.modelLineToMinimapLine(r.endLineNumber);n.push(new CU(new x(a,r.startColumn,l,r.endColumn),o.options))}return n}return i}getSectionHeaderDecorationsInViewport(e,t){const i=this.options.minimapLineHeight,o=this.options.sectionHeaderFontSize/i;return e=Math.floor(Math.max(1,e-o)),this._getMinimapDecorationsInViewport(e,t).filter(r=>{var a;return!!(!((a=r.options.minimap)===null||a===void 0)&&a.sectionHeaderStyle)})}_getMinimapDecorationsInViewport(e,t){let i;if(this._samplingState){const n=this._samplingState.minimapLines[e-1],o=this._samplingState.minimapLines[t-1];i=new x(n,1,o,this._context.viewModel.getLineMaxColumn(o))}else i=new x(e,1,t,this._context.viewModel.getLineMaxColumn(t));return this._context.viewModel.getMinimapDecorationsInRange(i)}getSectionHeaderText(e,t){var i;const n=(i=e.options.minimap)===null||i===void 0?void 0:i.sectionHeaderText;if(!n)return null;const o=this._sectionHeaderCache.get(n);if(o)return o;const r=t(n);return this._sectionHeaderCache.set(n,r),r}getOptions(){return this._context.viewModel.model.getOptions()}revealLineNumber(e){this._samplingState&&(e=this._samplingState.minimapLines[e-1]),this._context.viewModel.revealRange("mouse",!1,new x(e,1,e,1),1,0)}setScrollTop(e){this._context.viewModel.viewLayout.setScrollPosition({scrollTop:e},1)}}class gm extends H{constructor(e,t){super(),this._renderDecorations=!1,this._gestureInProgress=!1,this._theme=e,this._model=t,this._lastRenderData=null,this._buffers=null,this._selectionColor=this._theme.getColor(TB),this._domNode=It(document.createElement("div")),rl.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=It(document.createElement("div")),this._shadow.setClassName("minimap-shadow-hidden"),this._domNode.appendChild(this._shadow),this._canvas=It(document.createElement("canvas")),this._canvas.setPosition("absolute"),this._canvas.setLeft(0),this._domNode.appendChild(this._canvas),this._decorationsCanvas=It(document.createElement("canvas")),this._decorationsCanvas.setPosition("absolute"),this._decorationsCanvas.setClassName("minimap-decorations-layer"),this._decorationsCanvas.setLeft(0),this._domNode.appendChild(this._decorationsCanvas),this._slider=It(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=It(document.createElement("div")),this._sliderHorizontal.setPosition("absolute"),this._sliderHorizontal.setClassName("minimap-slider-horizontal"),this._slider.appendChild(this._sliderHorizontal),this._applyLayout(),this._pointerDownListener=Ni(this._domNode.domNode,ee.POINTER_DOWN,i=>{if(i.preventDefault(),this._model.options.renderMinimap===0||!this._lastRenderData)return;if(this._model.options.size!=="proportional"){if(i.button===0&&this._lastRenderData){const d=qi(this._slider.domNode),c=d.top+d.height/2;this._startSliderDragging(i,c,this._lastRenderData.renderedLayout)}return}const o=this._model.options.minimapLineHeight,r=this._model.options.canvasInnerHeight/this._model.options.canvasOuterHeight*i.offsetY;let l=Math.floor(r/o)+this._lastRenderData.renderedLayout.startLineNumber-this._lastRenderData.renderedLayout.topPaddingLineCount;l=Math.min(l,this._model.getLineCount()),this._model.revealLineNumber(l)}),this._sliderPointerMoveMonitor=new c0,this._sliderPointerDownListener=Ni(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=Gt.addTarget(this._domNode.domNode),this._sliderTouchStartListener=K(this._domNode.domNode,Xt.Start,i=>{i.preventDefault(),i.stopPropagation(),this._lastRenderData&&(this._slider.toggleClassName("active",!0),this._gestureInProgress=!0,this.scrollDueToTouchEvent(i))},{passive:!1}),this._sliderTouchMoveListener=K(this._domNode.domNode,Xt.Change,i=>{i.preventDefault(),i.stopPropagation(),this._lastRenderData&&this._gestureInProgress&&this.scrollDueToTouchEvent(i)},{passive:!1}),this._sliderTouchEndListener=Ni(this._domNode.domNode,Xt.End,i=>{i.preventDefault(),i.stopPropagation(),this._gestureInProgress=!1,this._slider.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 o=(r,a)=>{const l=qi(this._domNode.domNode),d=Math.min(Math.abs(a-n),Math.abs(a-l.left),Math.abs(a-l.left-l.width));if(as&&d>ppe){this._model.setScrollTop(i.scrollTop);return}const c=r-t;this._model.setScrollTop(i.getDesiredScrollTopFromDelta(c))};e.pageY!==t&&o(e.pageY,n),this._sliderPointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,r=>o(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&&e.push("autohide"),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 UF(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){var i;return(i=this._lastRenderData)===null||i===void 0||i.onLinesDeleted(e,t),!0}onLinesInserted(e,t){var i;return(i=this._lastRenderData)===null||i===void 0||i.onLinesInserted(e,t),!0}onScrollChanged(){return this._renderDecorations=!0,!0}onThemeChanged(){return this._selectionColor=this._theme.getColor(TB),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=Xv.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(x.compareRangesUsingStarts);const i=this._model.getMinimapDecorationsInViewport(e.startLineNumber,e.endLineNumber);i.sort((h,g)=>(h.options.zIndex||0)-(g.options.zIndex||0));const{canvasInnerWidth:n,canvasInnerHeight:o}=this._model.options,r=this._model.options.minimapLineHeight,a=this._model.options.minimapCharWidth,l=this._model.getOptions().tabSize,d=this._decorationsCanvas.domNode.getContext("2d");d.clearRect(0,0,n,o);const c=new XB(e.startLineNumber,e.endLineNumber,!1);this._renderSelectionLineHighlights(d,t,c,e,r),this._renderDecorationsLineHighlights(d,i,c,e,r);const u=new XB(e.startLineNumber,e.endLineNumber,null);this._renderSelectionsHighlights(d,t,u,e,r,l,a,n),this._renderDecorationsHighlights(d,i,u,e,r,l,a,n),this._renderSectionHeaders(e)}}_renderSelectionLineHighlights(e,t,i,n,o){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 d=n.intersectWithViewport(l);if(!d)continue;const[c,u]=d;for(let f=c;f<=u;f++)i.set(f,!0);const h=n.getYForLineNumber(c,o),g=n.getYForLineNumber(u,o);a>=h||(a>r&&e.fillRect(El,r,e.canvas.width,a-r),r=h),a=g}a>r&&e.fillRect(El,r,e.canvas.width,a-r)}_renderDecorationsLineHighlights(e,t,i,n,o){const r=new Map;for(let a=t.length-1;a>=0;a--){const l=t[a],d=l.options.minimap;if(!d||d.position!==1)continue;const c=n.intersectWithViewport(l.range);if(!c)continue;const[u,h]=c,g=d.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 m=u;m<=h;m++){if(i.has(m))continue;i.set(m,!0);const _=n.getYForLineNumber(u,o);e.fillRect(El,_,e.canvas.width,o)}}}_renderSelectionsHighlights(e,t,i,n,o,r,a,l){if(!(!this._selectionColor||this._selectionColor.isTransparent()))for(const d of t){const c=n.intersectWithViewport(d);if(!c)continue;const[u,h]=c;for(let g=u;g<=h;g++)this.renderDecorationOnLine(e,i,d,this._selectionColor,n,g,o,o,r,a,l)}}_renderDecorationsHighlights(e,t,i,n,o,r,a,l){for(const d of t){const c=d.options.minimap;if(!c)continue;const u=n.intersectWithViewport(d.range);if(!u)continue;const[h,g]=u,f=c.getColor(this._theme.value);if(!(!f||f.isTransparent()))for(let m=h;m<=g;m++)switch(c.position){case 1:this.renderDecorationOnLine(e,i,d.range,f,n,m,o,o,r,a,l);continue;case 2:{const _=n.getYForLineNumber(m,o);this.renderDecoration(e,f,2,_,mpe,o);continue}}}}renderDecorationOnLine(e,t,i,n,o,r,a,l,d,c,u){const h=o.getYForLineNumber(r,l);if(h+a<0||h>this._model.options.canvasInnerHeight)return;const{startLineNumber:g,endLineNumber:f}=i,m=g===r?i.startColumn:1,_=f===r?i.endColumn:this._model.getLineMaxColumn(r),v=this.getXOffsetForPosition(t,r,m,d,c,u),b=this.getXOffsetForPosition(t,r,_,d,c,u);this.renderDecoration(e,n,v,h,b-v,a)}getXOffsetForPosition(e,t,i,n,o,r){if(i===1)return El;if((i-1)*o>=r)return r;let l=e.get(t);if(!l){const d=this._model.getLineContent(t);l=[El];let c=El;for(let u=1;u=r){l[u]=r;break}l[u]=f,c=f}e.set(t,l)}return i-1m.range.startLineNumber-_.range.startLineNumber);const f=gm._fitSectionHeader.bind(null,h,r-El);for(const m of g){const _=e.getYForLineNumber(m.range.startLineNumber,i)+n,v=_-n,b=v+2,C=this._model.getSectionHeaderText(m,f);gm._renderSectionLabel(h,C,((t=m.options.minimap)===null||t===void 0?void 0:t.sectionHeaderStyle)===2,l,c,r,v,o,_,b)}}static _fitSectionHeader(e,t,i){if(!i)return i;const n="…",o=e.measureText(i).width,r=e.measureText(n).width;if(o<=t||o<=r)return i;const a=i.length,l=o/i.length,d=Math.floor((t-r)/l)-1;let c=Math.ceil(d/2);for(;c>0&&/\s/.test(i[c-1]);)--c;return i.substring(0,c)+n+i.substring(a-(d-c))}static _renderSectionLabel(e,t,i,n,o,r,a,l,d,c){t&&(e.fillStyle=n,e.fillRect(0,a,r,l),e.fillStyle=o,e.fillText(t,El,d)),i&&(e.beginPath(),e.moveTo(0,c),e.lineTo(r,c),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 U=this._lastRenderData._get();return new ZB(e,U.imageData,U.lines)}const o=this._getBuffer();if(!o)return null;const[r,a,l]=gm._renderUntouchedLines(o,e.topPaddingLineCount,t,i,n,this._lastRenderData),d=this._model.getMinimapLinesRenderingData(t,i,l),c=this._model.getOptions().tabSize,u=this._model.options.defaultBackgroundColor,h=this._model.options.backgroundColor,g=this._model.options.foregroundAlpha,f=this._model.tokensColorTracker,m=f.backgroundIsLight(),_=this._model.options.renderMinimap,v=this._model.options.charRenderer(),b=this._model.options.fontScale,C=this._model.options.minimapCharWidth,y=(_===1?2:3)*b,D=n>y?Math.floor((n-y)/2):0,L=h.a/255,k=new Qo(Math.round((h.r-u.r)*L+u.r),Math.round((h.g-u.g)*L+u.g),Math.round((h.b-u.b)*L+u.b),255);let I=e.topPaddingLineCount*n;const O=[];for(let U=0,J=i-t+1;U=0&&Rb)return;const P=_.charCodeAt(y);if(P===9){const F=h-(y+D)%h;D+=F-1,w+=F*r}else if(P===32)w+=r;else{const F=Dh(P)?2:1;for(let V=0;Vb)return}}}}}class XB{constructor(e,t,i){this._startLineNumber=e,this._endLineNumber=t,this._defaultValue=i,this._values=[];for(let n=0,o=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 vpe extends Fo{constructor(e,t){super(e),this._viewDomNode=t;const n=this._context.configuration.options.get(145);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=It(document.createElement("div")),rl.write(this._domNode,4),this._domNode.setClassName("overlayWidgets"),this.overflowingOverlayWidgetsDomNode=It(document.createElement("div")),rl.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(145);return this._verticalScrollbarWidth=i.verticalScrollbarWidth,this._minimapWidth=i.minimap.minimapWidth,this._horizontalScrollbarHeight=i.horizontalScrollbarHeight,this._editorHeight=i.height,this._editorWidth=i.width,!0}addWidget(e){const t=It(e.getDomNode());this._widgets[e.getId()]={widget:e,preference:null,domNode:t},t.setPosition("absolute"),t.setAttribute("widgetId",e.getId()),e.allowEditorOverflow?this.overflowingOverlayWidgetsDomNode.appendChild(t):this._domNode.appendChild(t),this.setShouldRender(),this._updateMaxMinWidth()}setWidgetPosition(e,t){const i=this._widgets[e.getId()];return i.preference===t?(this._updateMaxMinWidth(),!1):(i.preference=t,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(){var e,t;let i=0;const n=Object.keys(this._widgets);for(let o=0,r=n.length;o=3){const o=Math.floor(n/3),r=Math.floor(n/3),a=n-o-r,l=e,d=l+o,c=l+o+a;return[[0,l,d,l,c,l,d,l],[0,o,a,o+a,r,o+a+r,a+r,o+a+r]]}else if(i===2){const o=Math.floor(n/2),r=n-o,a=e,l=a+o;return[[0,a,a,a,l,a,a,a],[0,o,o,o,r,o+r,o+r,o+r]]}else{const o=e,r=n;return[[0,o,o,o,o,o,o,o],[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&&$.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 Cpe extends Fo{constructor(e){super(e),this._actualShouldRender=0,this._renderedDecorations=[],this._renderedCursorPositions=[],this._domNode=It(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=Ki.onDidChange(t=>{t.changedColorMap&&this._updateSettings(!0)}),this._cursorPositions=[{position:new W(1,1),color:this._settings.cursorColorSingle}]}dispose(){super.dispose(),this._tokensColorTrackerListener.dispose()}_updateSettings(e){const t=new bpe(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)=>W.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?$.Format.CSS.formatHexA(e):""),this._domNode.setDisplay("none");return}const t=this._context.viewModel.getAllOverviewRulerDecorations(this._context.theme);if(t.sort($b.compareByRenderingProps),this._actualShouldRender===1&&!$b.equalsArr(this._renderedDecorations,t)&&(this._actualShouldRender=2),this._actualShouldRender===1&&!Ci(this._renderedCursorPositions,this._cursorPositions,(f,m)=>f.position.lineNumber===m.position.lineNumber&&f.color===m.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,o=this._settings.lineHeight,r=this._context.viewLayout,a=this._context.viewLayout.getScrollHeight(),l=n/a,d=6*this._settings.pixelRatio|0,c=d/2|0,u=this._domNode.domNode.getContext("2d");e?e.isOpaque()?(u.fillStyle=$.Format.CSS.formatHexA(e),u.fillRect(0,0,i,n)):(u.clearRect(0,0,i,n),u.fillStyle=$.Format.CSS.formatHexA(e),u.fillRect(0,0,i,n)):u.clearRect(0,0,i,n);const h=this._settings.x,g=this._settings.w;for(const f of t){const m=f.color,_=f.data;u.fillStyle=m;let v=0,b=0,C=0;for(let w=0,y=_.length/3;wn&&(P=n-c),I=P-c,O=P+c}I>C+1||D!==v?(w!==0&&u.fillRect(h[v],b,g[v],C-b),v=D,b=I,C=O):O>C&&(C=O)}u.fillRect(h[v],b,g[v],C-b)}if(!this._settings.hideCursor){const f=2*this._settings.pixelRatio|0,m=f/2|0,_=this._settings.x[7],v=this._settings.w[7];let b=-100,C=-100,w=null;for(let y=0,D=this._cursorPositions.length;yn&&(I=n-m);const O=I-m,R=O+f;O>C+1||L!==w?(y!==0&&w&&u.fillRect(_,b,v,C-b),b=O,C=R):R>C&&(C=R),w=L,u.fillStyle=L}w&&u.fillRect(_,b,v,C-b)}this._settings.renderBorder&&this._settings.borderColor&&this._settings.overviewRulerLanes>0&&(u.beginPath(),u.lineWidth=1,u.strokeStyle=this._settings.borderColor,u.moveTo(0,0),u.lineTo(0,n),u.stroke(),u.moveTo(0,0),u.lineTo(i,0),u.stroke())}}class YB{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 d${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&&(m=i-_);const v=c.color;let b=this._color2Id[v];b||(b=++this._lastAssignedId,this._color2Id[v]=b,this._id2Color[b]=v);const C=new YB(m-_,m+_,b);c.setColorZone(C),a.push(C)}return this._colorZonesInvalid=!1,a.sort(YB.compare),a}}class ype extends b1{constructor(e,t){super(),this._context=e;const i=this._context.configuration.options;this._domNode=It(document.createElement("canvas")),this._domNode.setClassName(t),this._domNode.setPosition("absolute"),this._domNode.setLayerHinting(!0),this._domNode.setContain("strict"),this._zoneManager=new wpe(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(67)),this._zoneManager.setPixelRatio(i.get(143)),this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return e.hasChanged(67)&&(this._zoneManager.setLineHeight(t.get(67)),this._render()),e.hasChanged(143)&&(this._zoneManager.setPixelRatio(t.get(143)),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(),o=this._domNode.domNode.getContext("2d");return o.clearRect(0,0,e,t),i.length>0&&this._renderOneLane(o,i,n,e),!0}_renderOneLane(e,t,i,n){let o=0,r=0,a=0;for(const l of t){const d=l.colorId,c=l.from,u=l.to;d!==o?(e.fillRect(0,r,n,a-r),o=d,e.fillStyle=i[o],r=c,a=u):a>=c?a=Math.max(a,u):(e.fillRect(0,r,n,a-r),r=c,a=u)}e.fillRect(0,r,n,a-r)}}class Spe extends Fo{constructor(e){super(e),this.domNode=It(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(102),this._typicalHalfwidthCharacterWidth=t.get(50).typicalHalfwidthCharacterWidth}dispose(){super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return this._rulers=t.get(102),this._typicalHalfwidthCharacterWidth=t.get(50).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=It(document.createElement("div"));a.setClassName("view-ruler"),a.setWidth(o),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(145);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(103);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 Lpe{constructor(e){this.left=e.left,this.width=e.width,this.startStyle=null,this.endStyle=null}}class xpe{constructor(e,t){this.lineNumber=e,this.ranges=t}}function kpe(s){return new Lpe(s)}function Epe(s){return new xpe(s.lineNumber,s.ranges.map(kpe))}class Fi extends lp{constructor(e){super(),this._previousFrameVisibleRangesWithStyle=[],this._context=e;const t=this._context.configuration.options;this._roundedSelection=t.get(101),this._typicalHalfwidthCharacterWidth=t.get(50).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(101),this._typicalHalfwidthCharacterWidth=t.get(50).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 o=null,r=null;if(i&&i.length>0&&t.length>0){const a=t[0].lineNumber;if(a===e.startLineNumber)for(let d=0;!o&&d=0;d--)i[d].lineNumber===l&&(r=i[d].ranges[0]);o&&!o.startStyle&&(o=null),r&&!r.startStyle&&(r=null)}for(let a=0,l=t.length;a0){const f=t[a-1].ranges[0].left,m=t[a-1].ranges[0].left+t[a-1].ranges[0].width;Tw(c-f)f&&(h.top=1),Tw(u-m)'}_actualRenderOneSelection(e,t,i,n){if(n.length===0)return;const o=!!n[0].ranges[0].startStyle,r=n[0].lineNumber,a=n[n.length-1].lineNumber;for(let l=0,d=n.length;l1,d)}this._previousFrameVisibleRangesWithStyle=o,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]}}Fi.SELECTION_CLASS_NAME="selected-text";Fi.SELECTION_TOP_LEFT="top-left-radius";Fi.SELECTION_BOTTOM_LEFT="bottom-left-radius";Fi.SELECTION_TOP_RIGHT="top-right-radius";Fi.SELECTION_BOTTOM_RIGHT="bottom-right-radius";Fi.EDITOR_BACKGROUND_CLASS_NAME="monaco-editor-background";Fi.ROUNDED_PIECE_WIDTH=10;zr((s,e)=>{const t=s.getColor(Fue);t&&!t.isTransparent()&&e.addRule(`.monaco-editor .view-line span.inline-selected-text { color: ${t}; }`)});function Tw(s){return s<0?-s:s}class QB{constructor(e,t,i,n,o,r,a){this.top=e,this.left=t,this.paddingLeft=i,this.width=n,this.height=o,this.textContent=r,this.textContentClassName=a}}var Sc;(function(s){s[s.Single=0]="Single",s[s.MultiPrimary=1]="MultiPrimary",s[s.MultiSecondary=2]="MultiSecondary"})(Sc||(Sc={}));class JB{constructor(e,t){this._context=e;const i=this._context.configuration.options,n=i.get(50);this._cursorStyle=i.get(28),this._lineHeight=i.get(67),this._typicalHalfwidthCharacterWidth=n.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(i.get(31),this._typicalHalfwidthCharacterWidth),this._isVisible=!0,this._domNode=It(document.createElement("div")),this._domNode.setClassName(`cursor ${Pm}`),this._domNode.setHeight(this._lineHeight),this._domNode.setTop(0),this._domNode.setLeft(0),Un(this._domNode,n),this._domNode.setDisplay("none"),this._position=new W(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 Sc.Single:this._pluralityClass="";break;case Sc.MultiPrimary:this._pluralityClass="cursor-primary";break;case Sc.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(50);return this._cursorStyle=t.get(28),this._lineHeight=t.get(67),this._typicalHalfwidthCharacterWidth=i.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(t.get(31),this._typicalHalfwidthCharacterWidth),Un(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,o]=Are(i,t-1);return[new W(e,n+1),i.substring(n,o)]}_prepareRender(e){let t="",i="";const[n,o]=this._getGraphemeAwarePosition();if(this._cursorStyle===Hn.Line||this._cursorStyle===Hn.LineThin){const h=e.visibleRangeForPosition(n);if(!h||h.outsideRenderedLine)return null;const g=Te(this._domNode.domNode);let f;this._cursorStyle===Hn.Line?(f=w3(g,this._lineCursorWidth>0?this._lineCursorWidth:2),f>2&&(t=o,i=this._getTokenClassName(n))):f=w3(g,1);let m=h.left,_=0;f>=2&&m>=1&&(_=1,m-=_);const v=e.getVerticalOffsetForLineNumber(n.lineNumber)-e.bigNumbersDelta;return new QB(v,m,_,f,this._lineHeight,t,i)}const r=e.linesVisibleRangesForRange(new x(n.lineNumber,n.column,n.lineNumber,n.column+o.length),!1);if(!r||r.length===0)return null;const a=r[0];if(a.outsideRenderedLine||a.ranges.length===0)return null;const l=a.ranges[0],d=o===" "?this._typicalHalfwidthCharacterWidth:l.width<1?this._typicalHalfwidthCharacterWidth:l.width;this._cursorStyle===Hn.Block&&(t=o,i=this._getTokenClassName(n));let c=e.getVerticalOffsetForLineNumber(n.lineNumber)-e.bigNumbersDelta,u=this._lineHeight;return(this._cursorStyle===Hn.Underline||this._cursorStyle===Hn.UnderlineThin)&&(c+=this._lineHeight-2,u=2),new QB(c,l.left,0,d,u,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} ${Pm} ${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 iC extends Fo{constructor(e){super(e);const t=this._context.configuration.options;this._readOnly=t.get(91),this._cursorBlinking=t.get(26),this._cursorStyle=t.get(28),this._cursorSmoothCaretAnimation=t.get(27),this._selectionIsEmpty=!0,this._isComposingInput=!1,this._isVisible=!1,this._primaryCursor=new JB(this._context,Sc.Single),this._secondaryCursors=[],this._renderData=[],this._domNode=It(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 ya,this._cursorFlatBlinkInterval=new lF,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(91),this._cursorBlinking=t.get(26),this._cursorStyle=t.get(28),this._cursorSmoothCaretAnimation=t.get(27),this._updateBlinking(),this._updateDomClassName(),this._primaryCursor.onConfigurationChanged(e);for(let i=0,n=this._secondaryCursors.length;it.length){const o=this._secondaryCursors.length-t.length;for(let r=0;r{for(let n=0,o=e.ranges.length;n{this._isVisible?this._hide():this._show()},iC.BLINK_INTERVAL,Te(this._domNode.domNode)):this._startCursorBlinkAnimation.setIfNotSet(()=>{this._blinkingEnabled=!0,this._updateDomClassName()},iC.BLINK_INTERVAL))}_updateDomClassName(){this._domNode.setClassName(this._getClassName())}_getClassName(){let e="cursors-layer";switch(this._selectionIsEmpty||(e+=" has-selection"),this._cursorStyle){case Hn.Line:e+=" cursor-line-style";break;case Hn.Block:e+=" cursor-block-style";break;case Hn.Underline:e+=" cursor-underline-style";break;case Hn.LineThin:e+=" cursor-line-thin-style";break;case Hn.BlockOutline:e+=" cursor-block-outline-style";break;case Hn.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:id,background:wc},{class:".cursor-primary",foreground:jU,background:zge},{class:".cursor-secondary",foreground:KU,background:Uge}];for(const i of t){const n=s.getColor(i.foreground);if(n){let o=s.getColor(i.background);o||(o=n.opposite()),e.addRule(`.monaco-editor .cursors-layer ${i.class} { background-color: ${n}; border-color: ${n}; color: ${o}; }`),dd(s.type)&&e.addRule(`.monaco-editor .cursors-layer.has-selection ${i.class} { border-left: 1px solid ${o}; border-right: 1px solid ${o}; }`)}}});const _I=()=>{throw new Error("Invalid change accessor")};class Ipe extends Fo{constructor(e){super(e);const t=this._context.configuration.options,i=t.get(145);this._lineHeight=t.get(67),this._contentWidth=i.contentWidth,this._contentLeft=i.contentLeft,this.domNode=It(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=It(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 o=Object.keys(this._zones);for(let r=0,a=o.length;r{const n={addZone:o=>(t=!0,this._addZone(i,o)),removeZone:o=>{o&&(t=this._removeZone(i,o)||t)},layoutZone:o=>{o&&(t=this._layoutZone(i,o)||t)}};Tpe(e,n),n.addZone=_I,n.removeZone=_I,n.layoutZone=_I}),t}_addZone(e,t){const i=this._computeWhitespaceProps(t),o={whitespaceId:e.insertWhitespace(i.afterViewLineNumber,this._getZoneOrdinal(t),i.heightInPx,i.minWidthInPx),delegate:t,isInHiddenArea:i.isInHiddenArea,isVisible:!1,domNode:It(t.domNode),marginDomNode:t.marginDomNode?It(t.marginDomNode):null};return this._safeCallOnComputedHeight(o.delegate,i.heightInPx),o.domNode.setPosition("absolute"),o.domNode.domNode.style.width="100%",o.domNode.setDisplay("none"),o.domNode.setAttribute("monaco-view-zone",o.whitespaceId),this.domNode.appendChild(o.domNode),o.marginDomNode&&(o.marginDomNode.setPosition("absolute"),o.marginDomNode.domNode.style.width="100%",o.marginDomNode.setDisplay("none"),o.marginDomNode.setAttribute("monaco-view-zone",o.whitespaceId),this.marginDomNode.appendChild(o.marginDomNode)),this._zones[o.whitespaceId]=o,this.setShouldRender(),o.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.parentNode.removeChild(i.domNode.domNode),i.marginDomNode&&(i.marginDomNode.removeAttribute("monaco-visible-view-zone"),i.marginDomNode.removeAttribute("monaco-view-zone"),i.marginDomNode.domNode.parentNode.removeChild(i.marginDomNode.domNode)),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){Xe(i)}}_safeCallOnDomNodeTop(e,t){if(typeof e.onDomNodeTop=="function")try{e.onDomNodeTop(t)}catch(i){Xe(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 o=Object.keys(this._zones);for(let r=0,a=o.length;ra)continue;const g=h.startLineNumber===a?h.startColumn:d.minColumn,f=h.endLineNumber===a?h.endColumn:d.maxColumn;g=O.endOffset&&(I++,O=i&&i[I]),F!==9&&F!==32||h&&!D&&P<=k)continue;if(u&&P>=L&&P<=k&&F===32){const U=P-1>=0?a.charCodeAt(P-1):0,J=P+1=0?a.charCodeAt(P-1):0;if(F===32&&U!==32&&U!==9)continue}if(i&&(!O||O.startOffset>P||O.endOffset<=P))continue;const V=e.visibleRangeForPosition(new W(t,P+1));V&&(r?(R=Math.max(R,V.left),F===9?y+=this._renderArrow(g,_,V.left):y+=``):F===9?y+=`
${w?"→":"→"}
`:y+=`
${String.fromCharCode(C)}
`)}return r?(R=Math.round(R+_),``+y+""):y}_renderArrow(e,t,i){const n=t/7,o=t,r=e/2,a=i,l={x:0,y:n/2},d={x:100/125*o,y:l.y},c={x:d.x-.2*d.x,y:d.y+.2*d.x},u={x:c.x+.1*d.x,y:c.y+.1*d.x},h={x:u.x+.35*d.x,y:u.y-.35*d.x},g={x:h.x,y:-h.y},f={x:u.x,y:-u.y},m={x:c.x,y:-c.y},_={x:d.x,y:-d.y},v={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 e8{constructor(e){const t=e.options,i=t.get(50),n=t.get(38);n==="off"?(this.renderWhitespace="none",this.renderWithSVG=!1):n==="svg"?(this.renderWhitespace=t.get(99),this.renderWithSVG=!0):(this.renderWhitespace=t.get(99),this.renderWithSVG=!1),this.spaceWidth=i.spaceWidth,this.middotWidth=i.middotWidth,this.wsmiddotWidth=i.wsmiddotWidth,this.canUseHalfwidthRightwardsArrow=i.canUseHalfwidthRightwardsArrow,this.lineHeight=t.get(67),this.stopRenderingLineAfter=t.get(117)}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 Ape{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 x(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 Mpe{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 Rpe{constructor(e,t,i){this.configuration=e,this.theme=new Mpe(t),this.viewModel=i,this.viewLayout=i.viewLayout}addEventHandler(e){this.viewModel.addViewEventHandler(e)}removeEventHandler(e){this.viewModel.removeViewEventHandler(e)}}var Ppe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Fpe=function(s,e){return function(t,i){e(t,i,s)}};let OA=class extends b1{constructor(e,t,i,n,o,r,a){super(),this._instantiationService=a,this._shouldRecomputeGlyphMarginLanes=!1,this._selections=[new we(1,1,1,1)],this._renderAnimationFrame=null;const l=new zfe(t,n,o,e);this._context=new Rpe(t,i,n),this._context.addEventHandler(this),this._viewParts=[],this._textAreaHandler=this._instantiationService.createInstance(RA,this._context,l,this._createTextAreaHandlerHelper()),this._viewParts.push(this._textAreaHandler),this._linesContent=It(document.createElement("div")),this._linesContent.setClassName("lines-content monaco-editor-background"),this._linesContent.setPosition("absolute"),this.domNode=It(document.createElement("div")),this.domNode.setClassName(this._getEditorClassName()),this.domNode.setAttribute("role","code"),this._overflowGuardContainer=It(document.createElement("div")),rl.write(this._overflowGuardContainer,3),this._overflowGuardContainer.setClassName("overflow-guard"),this._scrollbar=new Qfe(this._context,this._linesContent,this.domNode,this._overflowGuardContainer),this._viewParts.push(this._scrollbar),this._viewLines=new Nx(this._context,this._linesContent),this._viewZones=new Ipe(this._context),this._viewParts.push(this._viewZones);const d=new Cpe(this._context);this._viewParts.push(d);const c=new Dpe(this._context);this._viewParts.push(c);const u=new $fe(this._context);this._viewParts.push(u),u.addDynamicOverlay(new Zfe(this._context)),u.addDynamicOverlay(new Fi(this._context)),u.addDynamicOverlay(new rpe(this._context)),u.addDynamicOverlay(new Yfe(this._context)),u.addDynamicOverlay(new Npe(this._context));const h=new jfe(this._context);this._viewParts.push(h),h.addDynamicOverlay(new Xfe(this._context)),h.addDynamicOverlay(new upe(this._context)),h.addDynamicOverlay(new cpe(this._context)),h.addDynamicOverlay(new S1(this._context)),this._glyphMarginWidgets=new tpe(this._context),this._viewParts.push(this._glyphMarginWidgets);const g=new xf(this._context);g.getDomNode().appendChild(this._viewZones.marginDomNode),g.getDomNode().appendChild(h.getDomNode()),g.getDomNode().appendChild(this._glyphMarginWidgets.domNode),this._viewParts.push(g),this._contentWidgets=new qfe(this._context,this.domNode),this._viewParts.push(this._contentWidgets),this._viewCursors=new iC(this._context),this._viewParts.push(this._viewCursors),this._overlayWidgets=new vpe(this._context,this.domNode),this._viewParts.push(this._overlayWidgets);const f=new Spe(this._context);this._viewParts.push(f);const m=new Kfe(this._context);this._viewParts.push(m);const _=new _pe(this._context);if(this._viewParts.push(_),d){const v=this._scrollbar.getOverviewRulerLayoutInfo();v.parent.insertBefore(d.getDomNode(),v.insertBefore)}this._linesContent.appendChild(u.getDomNode()),this._linesContent.appendChild(f.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(g.getDomNode()),this._overflowGuardContainer.appendChild(this._scrollbar.getDomNode()),this._overflowGuardContainer.appendChild(c.getDomNode()),this._overflowGuardContainer.appendChild(this._textAreaHandler.textArea),this._overflowGuardContainer.appendChild(this._textAreaHandler.textAreaCover),this._overflowGuardContainer.appendChild(this._overlayWidgets.getDomNode()),this._overflowGuardContainer.appendChild(_.getDomNode()),this._overflowGuardContainer.appendChild(m.domNode),this.domNode.appendChild(this._overflowGuardContainer),r?(r.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode.domNode),r.appendChild(this._overlayWidgets.overflowingOverlayWidgetsDomNode.domNode)):(this.domNode.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode),this.domNode.appendChild(this._overlayWidgets.overflowingOverlayWidgetsDomNode)),this._applyLayout(),this._pointerHandler=this._register(new Wge(this._context,l,this._createPointerHandlerHelper()))}_computeGlyphMarginLanes(){const e=this._context.viewModel.model,t=this._context.viewModel.glyphLanes;let i=[],n=0;i=i.concat(e.getAllMarginDecorations().map(o=>{var r,a,l;const d=(a=(r=o.options.glyphMargin)===null||r===void 0?void 0:r.position)!==null&&a!==void 0?a:bd.Center;return n=Math.max(n,o.range.endLineNumber),{range:o.range,lane:d,persist:(l=o.options.glyphMargin)===null||l===void 0?void 0:l.persistLane}})),i=i.concat(this._glyphMarginWidgets.getWidgets().map(o=>{const r=e.validateRange(o.preference.range);return n=Math.max(n,r.endLineNumber),{range:r,lane:o.preference.lane}})),i.sort((o,r)=>x.compareRangesUsingStarts(o.range,r.range)),t.reset(n);for(const o of i)t.push(o.lane,o.range,o.persist);return t}_createPointerHandlerHelper(){return{viewDomNode:this.domNode.domNode,linesContentDomNode:this._linesContent.domNode,viewLinesDomNode:this._viewLines.getDomNode().domNode,focusTextArea:()=>{this.focus()},dispatchTextAreaEvent:e=>{this._textAreaHandler.textArea.domNode.dispatchEvent(e)},getLastRenderData:()=>{const e=this._viewCursors.getLastRenderData()||[],t=this._textAreaHandler.getLastRenderData();return new fge(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(),this._viewLines.visibleRangeForPosition(new W(e,t))),getLineWidth:e=>(this._flushAccumulatedAndRenderNow(),this._viewLines.getLineWidth(e))}}_createTextAreaHandlerHelper(){return{visibleRangeForPosition:e=>(this._flushAccumulatedAndRenderNow(),this._viewLines.visibleRangeForPosition(e))}}_applyLayout(){const t=this._context.configuration.options.get(145);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._textAreaHandler.isFocused()?" focused":"";return this._context.configuration.options.get(142)+" "+MA(this._context.theme.type)+e}handleEvents(e){super.handleEvents(e),this._scheduleRender()}onConfigurationChanged(e){return this.domNode.setClassName(this._getEditorClassName()),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._context.removeEventHandler(this),this._viewLines.dispose();for(const e of this._viewParts)e.dispose();super.dispose()}_scheduleRender(){if(this._store.isDisposed)throw new Ut;if(this._renderAnimationFrame===null){const e=this._createCoordinatedRendering();this._renderAnimationFrame=BA.INSTANCE.scheduleCoordinatedRendering({window:Te(this.domNode.domNode),prepareRenderText:()=>{if(this._store.isDisposed)throw new Ut;try{return e.prepareRenderText()}finally{this._renderAnimationFrame=null}},renderText:()=>{if(this._store.isDisposed)throw new Ut;return e.renderText()},prepareRender:(t,i)=>{if(this._store.isDisposed)throw new Ut;return e.prepareRender(t,i)},render:(t,i)=>{if(this._store.isDisposed)throw new Ut;return e.render(t,i)}})}}_flushAccumulatedAndRenderNow(){const e=this._createCoordinatedRendering();ju(()=>e.prepareRenderText());const t=ju(()=>e.renderText());if(t){const[i,n]=t;ju(()=>e.prepareRender(i,n)),ju(()=>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)}Hu.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 Ape(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()),[e,new age(this._context.viewLayout,i,this._viewLines)]},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 o=this._viewLines.visibleRangeForPosition(new W(n.lineNumber,n.column));return o?o.left:-1}getTargetAtClientPoint(e,t){const i=this._pointerHandler.getTargetAtClientPoint(e,t);return i?Ix.convertViewToModelMouseTarget(i,this._context.viewModel.coordinatesConverter):null}createOverviewRuler(e){return new ype(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._textAreaHandler.writeScreenReaderContent(e)}focus(){this._textAreaHandler.focusTextArea()}isFocused(){return this._textAreaHandler.isFocused()}setAriaOptions(e){this._textAreaHandler.setAriaOptions(e)}addContentWidget(e){this._contentWidgets.addWidget(e.widget),this.layoutContentWidget(e),this._scheduleRender()}layoutContentWidget(e){var t,i,n,o,r,a,l,d;this._contentWidgets.setWidgetPosition(e.widget,(i=(t=e.position)===null||t===void 0?void 0:t.position)!==null&&i!==void 0?i:null,(o=(n=e.position)===null||n===void 0?void 0:n.secondaryPosition)!==null&&o!==void 0?o:null,(a=(r=e.position)===null||r===void 0?void 0:r.preference)!==null&&a!==void 0?a:null,(d=(l=e.position)===null||l===void 0?void 0:l.positionAffinity)!==null&&d!==void 0?d: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){const t=e.position?e.position.preference:null;this._overlayWidgets.setWidgetPosition(e.widget,t)&&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()}};OA=Ppe([Fpe(6,Ne)],OA);function ju(s){try{return s()}catch(e){return Xe(e),null}}class BA{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,zS(e,t,100))}}_onRenderScheduled(){const e=this._coordinatedRenderings.slice(0);this._coordinatedRenderings=[];for(const i of e)ju(()=>i.prepareRenderText());const t=[];for(let i=0,n=e.length;io.renderText())}for(let i=0,n=e.length;io.prepareRender(a,l))}for(let i=0,n=e.length;io.render(a,l))}}}BA.INSTANCE=new BA;class Yv{constructor(e,t,i,n,o){this.injectionOffsets=e,this.injectionOptions=t,this.breakOffsets=i,this.breakOffsetsVisibleColumn=n,this.wrappedTextIndentLength=o}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 o=0;othis.injectionOffsets[o];o++)n0?this.breakOffsets[o-1]:0,t===0)if(e<=r)n=o-1;else if(e>l)i=o+1;else break;else if(e=l)i=o+1;else break}let a=e-r;return o>0&&(a+=this.wrappedTextIndentLength),new Nw(o,a)}normalizeOutputPosition(e,t,i){if(this.injectionOffsets!==null){const n=this.outputPositionToOffsetInInputWithInjections(e,t),o=this.normalizeOffsetInInputWithInjectionsAroundInjections(n,i);if(o!==n)return this.offsetInInputWithInjectionsToOutputPosition(o,i)}if(i===0){if(e>0&&t===this.getMinOutputOffset(e))return new Nw(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&&t8(this.injectionOptions[i.injectedTextIndex].cursorStops))return i.offsetInInputWithInjections+i.length;{let n=i.offsetInInputWithInjections;if(i8(this.injectionOptions[i.injectedTextIndex].cursorStops))return n;let o=i.injectedTextIndex-1;for(;o>=0&&this.injectionOffsets[o]===this.injectionOffsets[i.injectedTextIndex]&&!(t8(this.injectionOptions[o].cursorStops)||(n-=this.injectionOptions[o].content.length,i8(this.injectionOptions[o].cursorStops)));)o--;return n}}else if(t===1||t===4){let n=i.offsetInInputWithInjections+i.length,o=i.injectedTextIndex;for(;o+1=0&&this.injectionOffsets[o-1]===this.injectionOffsets[o];)n-=this.injectionOptions[o-1].content.length,o--;return n}ux()}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 o=0;oe)break;if(e<=l)return{injectedTextIndex:o,offsetInInputWithInjections:a,length:r};n+=r}}}}function t8(s){return s==null?!0:s===aa.Right||s===aa.Both}function i8(s){return s==null?!0:s===aa.Left||s===aa.Both}class Nw{constructor(e,t){this.outputLineIndex=e,this.outputOffset=t}toString(){return`${this.outputLineIndex}:${this.outputOffset}`}toPosition(e){return new W(e+this.outputLineIndex,this.outputOffset+1)}}class Ope{constructor(){this.changeType=1}}class al{static applyInjectedText(e,t){if(!t||t.length===0)return e;let i="",n=0;for(const o of t)i+=e.substring(n,o.column-1),n=o.column-1,i+=o.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 al(i.ownerId,i.range.startLineNumber,i.range.startColumn,i.options.before,0)),i.options.after&&i.options.after.content.length>0&&t.push(new al(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,o){this.ownerId=e,this.lineNumber=t,this.column=i,this.options=n,this.order=o}}class n8{constructor(e,t,i){this.changeType=2,this.lineNumber=e,this.detail=t,this.injectedText=i}}class Bpe{constructor(e,t){this.changeType=3,this.fromLineNumber=e,this.toLineNumber=t}}class Wpe{constructor(e,t,i,n){this.changeType=4,this.injectedTexts=n,this.fromLineNumber=e,this.toLineNumber=t,this.detail=i}}class Hpe{constructor(){this.changeType=5}}class Wm{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;ts});class $F{static create(e){return new $F(new WeakRef(e))}constructor(e){this.targetWindow=e}createLineBreaksComputer(e,t,i,n,o){const r=[],a=[];return{addRequest:(l,d,c)=>{r.push(l),a.push(d)},finalize:()=>Vpe(Ou(this.targetWindow.deref()),r,e,t,i,n,o,a)}}}function Vpe(s,e,t,i,n,o,r,a){var l;function d(O){const R=a[O];if(R){const P=al.applyInjectedText(e[O],R),F=R.map(U=>U.options),V=R.map(U=>U.column-1);return new Yv(V,F,[P.length],[],0)}else return null}if(n===-1){const O=[];for(let R=0,P=e.length;Rc?(P=0,F=0):V=c-pe}const U=R.substr(P),J=zpe(U,F,i,V,m,g);_[O]=P,v[O]=F,b[O]=U,C[O]=J[0],w[O]=J[1]}const y=m.build(),D=(l=vI==null?void 0:vI.createHTML(y))!==null&&l!==void 0?l:y;f.innerHTML=D,f.style.position="absolute",f.style.top="10000",r==="keepAll"?(f.style.wordBreak="keep-all",f.style.overflowWrap="anywhere"):(f.style.wordBreak="inherit",f.style.overflowWrap="break-word"),s.document.body.appendChild(f);const L=document.createRange(),k=Array.prototype.slice.call(f.children,0),I=[];for(let O=0;OWe.options),De=ge.map(We=>We.column-1)):(pe=null,De=null),I[O]=new Yv(De,pe,P,J,V)}return s.document.body.removeChild(f),I}function zpe(s,e,t,i,n,o){if(o!==0){const h=String(o);n.appendString('
');const r=s.length;let a=e,l=0;const d=[],c=[];let u=0");for(let h=0;h"),d[h]=l,c[h]=a;const g=u;u=h+1"),d[s.length]=l,c[s.length]=a,n.appendString("
"),[d,c]}function Upe(s,e,t,i){if(t.length<=1)return null;const n=Array.prototype.slice.call(e.children,0),o=[];try{WA(s,n,i,0,null,t.length-1,null,o)}catch(r){return console.log(r),null}return o.length===0?null:(o.push(t.length),o)}function WA(s,e,t,i,n,o,r,a){if(i===o||(n=n||bI(s,e,t[i],t[i+1]),r=r||bI(s,e,t[o],t[o+1]),Math.abs(n[0].top-r[0].top)<=.1))return;if(i+1===o){a.push(o);return}const l=i+(o-i)/2|0,d=bI(s,e,t[l],t[l+1]);WA(s,e,t,i,n,l,d,a),WA(s,e,t,l,d,o,r,a)}function bI(s,e,t,i){return s.setStart(e[t/16384|0].firstChild,t%16384),s.setEnd(e[i/16384|0].firstChild,i%16384),s.getClientRects()}class $pe extends H{constructor(){super(),this._editor=null,this._instantiationService=null,this._instances=this._register(new $P),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)){Xe(new Error(`Cannot have two contributions with the same id ${n.id}`));continue}this._pending.set(n.id,n)}this._instantiateSome(0),this._register(uv(Te(this._editor.getDomNode()),()=>{this._instantiateSome(1)})),this._register(uv(Te(this._editor.getDomNode()),()=>{this._instantiateSome(2)})),this._register(uv(Te(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(){var e;return uv(Te((e=this._editor)===null||e===void 0?void 0:e.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){Xe(i)}}}}class u${constructor(e,t,i,n,o,r,a){this.id=e,this.label=t,this.alias=i,this.metadata=n,this._precondition=o,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)}}function Ah(s){let e=0,t=0,i=0,n=0;for(let o=0,r=s.length;o=Jo&&(t=t-s%Jo),t}function Zpe(s,e){return s.reduce((t,i)=>Di(t,e(i)),Bs)}function h$(s,e){return s===e}function nC(s,e){const t=s,i=e;if(i-t<=0)return Bs;const o=Math.floor(t/Jo),r=Math.floor(i/Jo),a=i-r*Jo;if(o===r){const l=t-o*Jo;return ji(0,a-l)}else return ji(r-o,a)}function Hm(s,e){return s=e}function fm(s){return ji(s.lineNumber-1,s.column-1)}function uf(s,e){const t=s,i=Math.floor(t/Jo),n=t-i*Jo,o=e,r=Math.floor(o/Jo),a=o-r*Jo;return new x(i+1,n+1,r+1,a+1)}function Xpe(s){const e=Td(s);return ji(e.length-1,e[e.length-1].length)}class Dc{static fromModelContentChanges(e){return e.map(i=>{const n=x.lift(i.range);return new Dc(fm(n.getStartPosition()),fm(n.getEndPosition()),Xpe(i.text))}).reverse()}constructor(e,t,i){this.startOffset=e,this.endOffset=t,this.newLength=i}toString(){return`[${Rr(this.startOffset)}...${Rr(this.endOffset)}) -> ${Rr(this.newLength)}`}}class Ype{constructor(e){this.nextEditIdx=0,this.deltaOldToNewLineCount=0,this.deltaOldToNewColumnCount=0,this.deltaLineIdxInOld=-1,this.edits=e.map(t=>jF.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:nC(e,i)}translateOldToCur(e){return e.lineCount===this.deltaLineIdxInOld?ji(e.lineCount+this.deltaOldToNewLineCount,e.columnCount+this.deltaOldToNewColumnCount):ji(e.lineCount+this.deltaOldToNewLineCount,e.columnCount)}translateCurToOld(e){const t=Rr(e);return t.lineCount-this.deltaOldToNewLineCount===this.deltaLineIdxInOld?ji(t.lineCount-this.deltaOldToNewLineCount,t.columnCount-this.deltaOldToNewColumnCount):ji(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 o=this.lineTokens,r=o.getCount();let a=null;if(this.lineTokenOffset1e3))break;if(i>1500)break}const n=qpe(e,t,this.lineIdx,this.lineCharOffset);return new Mu(n,0,-1,on.getEmpty(),new Vg(n))}}class nme{constructor(e,t){this.text=e,this._offset=Bs,this.idx=0;const i=t.getRegExpStr(),n=i?new RegExp(i+`| `,"gi"):null,o=[];let r,a=0,l=0,d=0,c=0;const u=[];for(let f=0;f<60;f++)u.push(new Mu(ji(0,f),0,-1,on.getEmpty(),new Vg(ji(0,f))));const h=[];for(let f=0;f<60;f++)h.push(new Mu(ji(1,f),0,-1,on.getEmpty(),new Vg(ji(1,f))));if(n)for(n.lastIndex=0;(r=n.exec(e))!==null;){const f=r.index,m=r[0];if(m===` `)a++,l=f+1;else{if(d!==f){let _;if(c===a){const v=f-d;if(vsme(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 sme(s){let e=rr(s);return/^[\w ]+/.test(s)&&(e=`\\b${e}`),/[\w ]+$/.test(s)&&(e=`${e}\\b`),e}class p${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=GF.createFromLanguage(this.getLanguageConfiguration(e),this.denseKeyProvider),this.languageIdToBracketTokens.set(e,t)),t}}function ome(s){if(s.length===0)return null;if(s.length===1)return s[0];let e=0;function t(){if(e>=s.length)return null;const r=e,a=s[r].listHeight;for(e++;e=2?m$(r===0&&e===s.length?s:s.slice(r,e),!1):s[r]}let i=t(),n=t();if(!n)return i;for(let r=t();r;r=t())r8(i,n)<=r8(n,r)?(i=CI(i,n),n=r):n=CI(n,r);return CI(i,n)}function m$(s,e=!1){if(s.length===0)return null;if(s.length===1)return s[0];let t=s.length;for(;t>3;){const i=t>>1;for(let n=0;n=3?s[2]:null,e)}function r8(s,e){return Math.abs(s.listHeight-e.listHeight)}function CI(s,e){return s.listHeight===e.listHeight?Cd.create23(s,e,null,!1):s.listHeight>e.listHeight?rme(s,e):ame(e,s)}function rme(s,e){s=s.toMutable();let t=s;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 o=i.length-1;o>=0;o--){const r=i[o];n?r.childrenLength>=3?n=Cd.create23(r.unappendChild(),n,null,!1):(r.appendChildOfSameHeight(n),n=void 0):r.handleChildrenChanged()}return n?Cd.create23(s,n,null,!1):s}function ame(s,e){s=s.toMutable();let t=s;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 o=i.length-1;o>=0;o--){const r=i[o];n?r.childrenLength>=3?n=Cd.create23(n,r.unprependChild(),null,!1):(r.prependChildOfSameHeight(n),n=void 0):r.handleChildrenChanged()}return n?Cd.create23(n,s,null,!1):s}class lme{constructor(e){this.lastOffset=Bs,this.nextNodes=[e],this.offsets=[Bs],this.idxs=[]}readLongestNodeAt(e,t){if(Hm(e,this.lastOffset))throw new Error("Invalid offset");for(this.lastOffset=e;;){const i=U0(this.nextNodes);if(!i)return;const n=U0(this.offsets);if(Hm(e,n))return;if(Hm(n,e))if(Di(n,i.length)<=e)this.nextNodeAfterCurrent();else{const o=wI(i);o!==-1?(this.nextNodes.push(i.getChild(o)),this.offsets.push(n),this.idxs.push(o)):this.nextNodeAfterCurrent()}else{if(t(i))return this.nextNodeAfterCurrent(),i;{const o=wI(i);if(o===-1){this.nextNodeAfterCurrent();return}else this.nextNodes.push(i.getChild(o)),this.offsets.push(n),this.idxs.push(o)}}}}nextNodeAfterCurrent(){for(;;){const e=U0(this.offsets),t=U0(this.nextNodes);if(this.nextNodes.pop(),this.offsets.pop(),this.idxs.length===0)break;const i=U0(this.nextNodes),n=wI(i,this.idxs[this.idxs.length-1]);if(n!==-1){this.nextNodes.push(i.getChild(n)),this.offsets.push(Di(e,t.length)),this.idxs[this.idxs.length-1]=n;break}else this.idxs.pop()}}}function wI(s,e=-1){for(;;){if(e++,e>=s.childrenLength)return-1;if(s.getChild(e))return e}}function U0(s){return s.length>0?s[s.length-1]:void 0}function HA(s,e,t,i){return new dme(s,e,t,i).parseDocument()}class dme{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 lme(i):void 0,this.positionMapper=new Ype(t)}parseDocument(){this._itemsConstructed=0,this._itemsFromCache=0;let e=this.parseList(on.getEmpty(),0);return e||(e=Cd.getEmpty()),e}parseList(e,t){const i=[];for(;;){let o=this.tryReadChildFromCache(e);if(!o){const r=this.tokenizer.peek();if(!r||r.kind===2&&r.bracketIds.intersects(e))break;o=this.parseChild(e,t+1)}o.kind===4&&o.childrenLength===0||i.push(o)}return this.oldNodeReader?ome(i):m$(i,this.createImmutableLists)}tryReadChildFromCache(e){if(this.oldNodeReader){const t=this.positionMapper.getDistanceToNextChange(this.tokenizer.offset);if(t===null||!lD(t)){const i=this.oldNodeReader.readLongestNodeAt(this.positionMapper.getOffsetBeforeChange(this.tokenizer.offset),n=>t!==null&&!Hm(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 tme(i.bracketIds,i.length);case 0:return i.astNode;case 1:{if(t>300)return new Vg(i.length);const n=e.merge(i.bracketIds),o=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(),sC.create(i.astNode,o,r.astNode)):sC.create(i.astNode,o,null)}default:throw new Error("unexpected")}}}function uD(s,e){if(s.length===0)return e;if(e.length===0)return s;const t=new Hc(a8(s)),i=a8(e);i.push({modified:!1,lengthBefore:void 0,lengthAfter:void 0});let n=t.dequeue();function o(d){if(d===void 0){const u=t.takeWhile(h=>!0)||[];return n&&u.unshift(n),u}const c=[];for(;n&&!lD(d);){const[u,h]=n.splitAt(d);c.push(u),d=nC(u.lengthAfter,d),n=h??t.dequeue()}return lD(d)||c.push(new Ku(!1,d,d)),c}const r=[];function a(d,c,u){if(r.length>0&&h$(r[r.length-1].endOffset,d)){const h=r[r.length-1];r[r.length-1]=new Dc(h.startOffset,c,Di(h.newLength,u))}else r.push({startOffset:d,endOffset:c,newLength:u})}let l=Bs;for(const d of i){const c=o(d.lengthBefore);if(d.modified){const u=Zpe(c,g=>g.lengthBefore),h=Di(l,u);a(l,h,d.lengthAfter),l=h}else for(const u of c){const h=l;l=Di(l,u.lengthBefore),u.modified&&a(h,l,u.lengthAfter)}}return r}class Ku{constructor(e,t,i){this.modified=e,this.lengthBefore=t,this.lengthAfter=i}splitAt(e){const t=nC(e,this.lengthAfter);return h$(t,Bs)?[this,void 0]:this.modified?[new Ku(this.modified,this.lengthBefore,e),new Ku(this.modified,Bs,t)]:[new Ku(this.modified,e,e),new Ku(this.modified,t,t)]}toString(){return`${this.modified?"M":"U"}:${Rr(this.lengthBefore)} -> ${Rr(this.lengthAfter)}`}}function a8(s){const e=[];let t=Bs;for(const i of s){const n=nC(t,i.startOffset);lD(n)||e.push(new Ku(!1,n,n));const o=nC(i.startOffset,i.endOffset);e.push(new Ku(!0,o,i.newLength)),t=i.endOffset}return e}class cme extends H{didLanguageChange(e){return this.brackets.didLanguageChange(e)}constructor(e,t){if(super(),this.textModel=e,this.getLanguageConfiguration=t,this.didChangeEmitter=new B,this.denseKeyProvider=new g$,this.brackets=new p$(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 nme(this.textModel.getValue(),i);this.initialAstWithoutTokens=HA(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 Dc(ji(i.fromLineNumber-1,0),ji(i.toLineNumber,0),ji(i.toLineNumber-i.fromLineNumber+1,0)));this.handleEdits(t,!0),this.initialAstWithoutTokens||this.didChangeEmitter.fire()}handleContentChanged(e){const t=Dc.fromModelContentChanges(e.changes);this.handleEdits(t,!1)}handleEdits(e,t){const i=uD(this.queuedTextEdits,e);this.queuedTextEdits=i,this.initialAstWithoutTokens&&!t&&(this.queuedTextEditsForInitialAstWithoutTokens=uD(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,o=new f$(this.textModel,this.brackets);return HA(o,e,n,i)}getBracketsInRange(e,t){this.flushQueue();const i=ji(e.startLineNumber-1,e.startColumn-1),n=ji(e.endLineNumber-1,e.endColumn-1);return new od(o=>{const r=this.initialAstWithoutTokens||this.astWithTokens;VA(r,Bs,r.length,i,n,o,0,0,new Map,t)})}getBracketPairsInRange(e,t){this.flushQueue();const i=fm(e.getStartPosition()),n=fm(e.getEndPosition());return new od(o=>{const r=this.initialAstWithoutTokens||this.astWithTokens,a=new ume(o,t,this.textModel);zA(r,Bs,r.length,i,n,a,0,new Map)})}getFirstBracketAfter(e){this.flushQueue();const t=this.initialAstWithoutTokens||this.astWithTokens;return v$(t,Bs,t.length,fm(e))}getFirstBracketBefore(e){this.flushQueue();const t=this.initialAstWithoutTokens||this.astWithTokens;return _$(t,Bs,t.length,fm(e))}}function _$(s,e,t,i){if(s.kind===4||s.kind===2){const n=[];for(const o of s.children)t=Di(e,o.length),n.push({nodeOffsetStart:e,nodeOffsetEnd:t}),e=t;for(let o=n.length-1;o>=0;o--){const{nodeOffsetStart:r,nodeOffsetEnd:a}=n[o];if(Hm(r,i)){const l=_$(s.children[o],r,a,i);if(l)return l}}return null}else{if(s.kind===3)return null;if(s.kind===1){const n=uf(e,t);return{bracketInfo:s.bracketInfo,range:n}}}return null}function v$(s,e,t,i){if(s.kind===4||s.kind===2){for(const n of s.children){if(t=Di(e,n.length),Hm(i,t)){const o=v$(n,e,t,i);if(o)return o}e=t}return null}else{if(s.kind===3)return null;if(s.kind===1){const n=uf(e,t);return{bracketInfo:s.bracketInfo,range:n}}}return null}function VA(s,e,t,i,n,o,r,a,l,d,c=!1){if(r>200)return!0;e:for(;;)switch(s.kind){case 4:{const u=s.childrenLength;for(let h=0;h200)return!0;let d=!0;if(s.kind===2){let c=0;if(a){let g=a.get(s.openingBracket.text);g===void 0&&(g=0),c=g,g++,a.set(s.openingBracket.text,g)}const u=Di(e,s.openingBracket.length);let h=-1;if(o.includeMinIndentation&&(h=s.computeMinIndentation(e,o.textModel)),d=o.push(new Kpe(uf(e,t),uf(e,u),s.closingBracket?uf(Di(u,((l=s.child)===null||l===void 0?void 0:l.length)||Bs),t):void 0,r,c,s,h)),e=u,d&&s.child){const g=s.child;if(t=Di(e,g.length),Vm(e,n)&&yv(t,i)&&(d=zA(g,e,t,i,n,o,r+1,a),!d))return!1}a==null||a.set(s.openingBracket.text,c)}else{let c=e;for(const u of s.children){const h=c;if(c=Di(c,u.length),Vm(h,n)&&Vm(i,c)&&(d=zA(u,h,c,i,n,o,r,a),!d))return!1}}return d}class hme extends H{get canBuildAST(){return this.textModel.getValueLength()<=5e6}constructor(e,t){super(),this.textModel=e,this.languageConfigurationService=t,this.bracketPairsTree=this._register(new $n),this.onDidChangeEmitter=new B,this.onDidChange=this.onDidChangeEmitter.event,this.bracketsRequested=!1,this._register(this.languageConfigurationService.onDidChange(i=>{var n;(!i.languageId||!((n=this.bracketPairsTree.value)===null||n===void 0)&&n.object.didLanguageChange(i.languageId))&&(this.bracketPairsTree.clear(),this.updateBracketPairsTree())}))}handleDidChangeOptions(e){this.bracketPairsTree.clear(),this.updateBracketPairsTree()}handleDidChangeLanguage(e){this.bracketPairsTree.clear(),this.updateBracketPairsTree()}handleDidChangeContent(e){var t;(t=this.bracketPairsTree.value)===null||t===void 0||t.object.handleContentChanged(e)}handleDidChangeBackgroundTokenizationState(){var e;(e=this.bracketPairsTree.value)===null||e===void 0||e.object.handleDidChangeBackgroundTokenizationState()}handleDidChangeTokens(e){var t;(t=this.bracketPairsTree.value)===null||t===void 0||t.object.handleDidChangeTokens(e)}updateBracketPairsTree(){if(this.bracketsRequested&&this.canBuildAST){if(!this.bracketPairsTree.value){const e=new Y;this.bracketPairsTree.value=gme(e.add(new cme(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){var t;return this.bracketsRequested=!0,this.updateBracketPairsTree(),((t=this.bracketPairsTree.value)===null||t===void 0?void 0:t.object.getBracketPairsInRange(e,!1))||od.empty}getBracketPairsInRangeWithMinIndentation(e){var t;return this.bracketsRequested=!0,this.updateBracketPairsTree(),((t=this.bracketPairsTree.value)===null||t===void 0?void 0:t.object.getBracketPairsInRange(e,!0))||od.empty}getBracketsInRange(e,t=!1){var i;return this.bracketsRequested=!0,this.updateBracketPairsTree(),((i=this.bracketPairsTree.value)===null||i===void 0?void 0:i.object.getBracketsInRange(e,t))||od.empty}findMatchingBracketUp(e,t,i){const n=this.textModel.validatePosition(t),o=this.textModel.getLanguageIdAtPosition(n.lineNumber,n.column);if(this.canBuildAST){const r=this.languageConfigurationService.getLanguageConfiguration(o).bracketsNew.getClosingBracketInfo(e);if(!r)return null;const a=this.getBracketPairsInRange(x.fromPositions(t,t)).findLast(l=>r.closes(l.openingBracketInfo));return a?a.openingBracketRange:null}else{const r=e.toLowerCase(),a=this.languageConfigurationService.getLanguageConfiguration(o).brackets;if(!a)return null;const l=a.textIsBracket[r];return l?Aw(this._findMatchingBracketUp(l,n,yI(i))):null}}matchBracket(e,t){if(this.canBuildAST){const i=this.getBracketPairsInRange(x.fromPositions(e,e)).filter(n=>n.closingBracketRange!==void 0&&(n.openingBracketRange.containsPosition(e)||n.closingBracketRange.containsPosition(e))).findLastMaxBy(ao(n=>n.openingBracketRange.containsPosition(e)?n.openingBracketRange:n.closingBracketRange,x.compareRangesUsingStarts));return i?[i.openingBracketRange,i.closingBracketRange]:null}else{const i=yI(t);return this._matchBracket(this.textModel.validatePosition(e),i)}}_establishBracketSearchOffsets(e,t,i,n){const o=t.getCount(),r=t.getLanguageId(n);let a=Math.max(0,e.column-1-i.maxBracketLength);for(let d=n-1;d>=0;d--){const c=t.getEndOffset(d);if(c<=a)break;if(Il(t.getStandardTokenType(d))||t.getLanguageId(d)!==r){a=c;break}}let l=Math.min(t.getLineContent().length,e.column-1+i.maxBracketLength);for(let d=n+1;d=l)break;if(Il(t.getStandardTokenType(d))||t.getLanguageId(d)!==r){l=c;break}}return{searchStartOffset:a,searchEndOffset:l}}_matchBracket(e,t){const i=e.lineNumber,n=this.textModel.tokenization.getLineTokens(i),o=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&&!Il(n.getStandardTokenType(r))){let{searchStartOffset:l,searchEndOffset:d}=this._establishBracketSearchOffsets(e,n,a,r),c=null;for(;;){const u=Qr.findNextBracketInRange(a.forwardRegex,i,o,l,d);if(!u)break;if(u.startColumn<=e.column&&e.column<=u.endColumn){const h=o.substring(u.startColumn-1,u.endColumn-1).toLowerCase(),g=this._matchFoundBracket(u,a.textIsBracket[h],a.textIsOpenBracket[h],t);if(g){if(g instanceof ec)return null;c=g}}l=u.endColumn-1}if(c)return c}if(r>0&&n.getStartOffset(r)===e.column-1){const l=r-1,d=this.languageConfigurationService.getLanguageConfiguration(n.getLanguageId(l)).brackets;if(d&&!Il(n.getStandardTokenType(l))){const{searchStartOffset:c,searchEndOffset:u}=this._establishBracketSearchOffsets(e,n,d,l),h=Qr.findPrevBracketInRange(d.reversedRegex,i,o,c,u);if(h&&h.startColumn<=e.column&&e.column<=h.endColumn){const g=o.substring(h.startColumn-1,h.endColumn-1).toLowerCase(),f=this._matchFoundBracket(h,d.textIsBracket[g],d.textIsOpenBracket[g],t);if(f)return f instanceof ec?null:f}}}return null}_matchFoundBracket(e,t,i,n){if(!t)return null;const o=i?this._findMatchingBracketDown(t,e.getEndPosition(),n):this._findMatchingBracketUp(t,e.getStartPosition(),n);return o?o instanceof ec?o:[e,o]:null}_findMatchingBracketUp(e,t,i){const n=e.languageId,o=e.reversedRegex;let r=-1,a=0;const l=(d,c,u,h)=>{for(;;){if(i&&++a%100===0&&!i())return ec.INSTANCE;const g=Qr.findPrevBracketInRange(o,d,c,u,h);if(!g)break;const f=c.substring(g.startColumn-1,g.endColumn-1).toLowerCase();if(e.isOpen(f)?r++:e.isClose(f)&&r--,r===0)return g;h=g.startColumn-1}return null};for(let d=t.lineNumber;d>=1;d--){const c=this.textModel.tokenization.getLineTokens(d),u=c.getCount(),h=this.textModel.getLineContent(d);let g=u-1,f=h.length,m=h.length;d===t.lineNumber&&(g=c.findTokenIndexAtOffset(t.column-1),f=t.column-1,m=t.column-1);let _=!0;for(;g>=0;g--){const v=c.getLanguageId(g)===n&&!Il(c.getStandardTokenType(g));if(v)_?f=c.getStartOffset(g):(f=c.getStartOffset(g),m=c.getEndOffset(g));else if(_&&f!==m){const b=l(d,h,f,m);if(b)return b}_=v}if(_&&f!==m){const v=l(d,h,f,m);if(v)return v}}return null}_findMatchingBracketDown(e,t,i){const n=e.languageId,o=e.forwardRegex;let r=1,a=0;const l=(c,u,h,g)=>{for(;;){if(i&&++a%100===0&&!i())return ec.INSTANCE;const f=Qr.findNextBracketInRange(o,c,u,h,g);if(!f)break;const m=u.substring(f.startColumn-1,f.endColumn-1).toLowerCase();if(e.isOpen(m)?r++:e.isClose(m)&&r--,r===0)return f;h=f.endColumn-1}return null},d=this.textModel.getLineCount();for(let c=t.lineNumber;c<=d;c++){const u=this.textModel.tokenization.getLineTokens(c),h=u.getCount(),g=this.textModel.getLineContent(c);let f=0,m=0,_=0;c===t.lineNumber&&(f=u.findTokenIndexAtOffset(t.column-1),m=t.column-1,_=t.column-1);let v=!0;for(;f=1;a--){const l=this.textModel.tokenization.getLineTokens(a),d=l.getCount(),c=this.textModel.getLineContent(a);let u=d-1,h=c.length,g=c.length;if(a===i.lineNumber){u=l.findTokenIndexAtOffset(i.column-1),h=i.column-1,g=i.column-1;const m=l.getLanguageId(u);n!==m&&(n=m,o=this.languageConfigurationService.getLanguageConfiguration(n).brackets,r=this.languageConfigurationService.getLanguageConfiguration(n).bracketsNew)}let f=!0;for(;u>=0;u--){const m=l.getLanguageId(u);if(n!==m){if(o&&r&&f&&h!==g){const v=Qr.findPrevBracketInRange(o.reversedRegex,a,c,h,g);if(v)return this._toFoundBracket(r,v);f=!1}n=m,o=this.languageConfigurationService.getLanguageConfiguration(n).brackets,r=this.languageConfigurationService.getLanguageConfiguration(n).bracketsNew}const _=!!o&&!Il(l.getStandardTokenType(u));if(_)f?h=l.getStartOffset(u):(h=l.getStartOffset(u),g=l.getEndOffset(u));else if(r&&o&&f&&h!==g){const v=Qr.findPrevBracketInRange(o.reversedRegex,a,c,h,g);if(v)return this._toFoundBracket(r,v)}f=_}if(r&&o&&f&&h!==g){const m=Qr.findPrevBracketInRange(o.reversedRegex,a,c,h,g);if(m)return this._toFoundBracket(r,m)}}return null}findNextBracket(e){var t;const i=this.textModel.validatePosition(e);if(this.canBuildAST)return this.bracketsRequested=!0,this.updateBracketPairsTree(),((t=this.bracketPairsTree.value)===null||t===void 0?void 0:t.object.getFirstBracketAfter(i))||null;const n=this.textModel.getLineCount();let o=null,r=null,a=null;for(let l=i.lineNumber;l<=n;l++){const d=this.textModel.tokenization.getLineTokens(l),c=d.getCount(),u=this.textModel.getLineContent(l);let h=0,g=0,f=0;if(l===i.lineNumber){h=d.findTokenIndexAtOffset(i.column-1),g=i.column-1,f=i.column-1;const _=d.getLanguageId(h);o!==_&&(o=_,r=this.languageConfigurationService.getLanguageConfiguration(o).brackets,a=this.languageConfigurationService.getLanguageConfiguration(o).bracketsNew)}let m=!0;for(;hm.closingBracketRange!==void 0&&m.range.strictContainsRange(g));return f?[f.openingBracketRange,f.closingBracketRange]:null}const n=yI(t),o=this.textModel.getLineCount(),r=new Map;let a=[];const l=(g,f)=>{if(!r.has(g)){const m=[];for(let _=0,v=f?f.brackets.length:0;_{for(;;){if(n&&++d%100===0&&!n())return ec.INSTANCE;const b=Qr.findNextBracketInRange(g.forwardRegex,f,m,_,v);if(!b)break;const C=m.substring(b.startColumn-1,b.endColumn-1).toLowerCase(),w=g.textIsBracket[C];if(w&&(w.isOpen(C)?a[w.index]++:w.isClose(C)&&a[w.index]--,a[w.index]===-1))return this._matchFoundBracket(b,w,!1,n);_=b.endColumn-1}return null};let u=null,h=null;for(let g=i.lineNumber;g<=o;g++){const f=this.textModel.tokenization.getLineTokens(g),m=f.getCount(),_=this.textModel.getLineContent(g);let v=0,b=0,C=0;if(g===i.lineNumber){v=f.findTokenIndexAtOffset(i.column-1),b=i.column-1,C=i.column-1;const y=f.getLanguageId(v);u!==y&&(u=y,h=this.languageConfigurationService.getLanguageConfiguration(u).brackets,l(u,h))}let w=!0;for(;ve==null?void 0:e.dispose()}}function yI(s){if(typeof s>"u")return()=>!0;{const e=Date.now();return()=>Date.now()-e<=s}}class ec{constructor(){this._searchCanceledBrand=void 0}}ec.INSTANCE=new ec;function Aw(s){return s instanceof ec?null:s}class fme extends H{constructor(e){super(),this.textModel=e,this.colorProvider=new b$,this.onDidChangeEmitter=new B,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 x(1,1,this.textModel.getLineCount(),1),e,t):[]}}class b${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}`}}zr((s,e)=>{const t=[qU,GU,ZU,XU,YU,QU],i=new b$;e.addRule(`.monaco-editor .${i.unexpectedClosingBracketClassName} { color: ${s.getColor(dfe)}; }`);const n=t.map(o=>s.getColor(o)).filter(o=>!!o).filter(o=>!o.isTransparent());for(let o=0;o<30;o++){const r=n[o%n.length];e.addRule(`.monaco-editor .${i.getInlineClassNameOfLevel(o)} { color: ${r}; }`)}});function Mw(s){return s.replace(/\n/g,"\\n").replace(/\r/g,"\\r")}class Gn{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} "${Mw(this.newText)}")`:this.newText.length===0?`(delete@${this.oldPosition} "${Mw(this.oldText)}")`:`(replace@${this.oldPosition} "${Mw(this.oldText)}" with "${Mw(this.newText)}")`}static _writeStringSize(e){return 4+2*e.length}static _writeString(e,t,i){const n=t.length;Fa(e,n,i),i+=4;for(let o=0;os.length)return!1;if(t){if(!YP(s,e))return!1;if(e.length===s.length)return!0;let o=e.length;return e.charAt(e.length-1)===i&&o--,s.charAt(o)===i}return e.charAt(e.length-1)!==i&&(e+=i),s.indexOf(e)===0}function w$(s){return s>=65&&s<=90||s>=97&&s<=122}function _me(s,e=as){return e?w$(s.charCodeAt(0))&&s.charCodeAt(1)===58:!1}function Tl(s){return RS(s,!0)}class vme{constructor(e){this._ignorePathCasing=e}compare(e,t,i=!1){return e===t?0:Rb(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===Ge.file)return UA(Tl(e),Tl(t),this._ignorePathCasing(e))&&e.query===t.query&&(i||e.fragment===t.fragment);if(c8(e.authority,t.authority))return UA(e.path,t.path,this._ignorePathCasing(e),"/")&&e.query===t.query&&(i||e.fragment===t.fragment)}return!1}joinPath(e,...t){return Ae.joinPath(e,...t)}basenameOrAuthority(e){return Wr(e)||e.authority}basename(e){return Yi.basename(e.path)}extname(e){return Yi.extname(e.path)}dirname(e){if(e.path.length===0)return e;let t;return e.scheme===Ge.file?t=Ae.file(XV(Tl(e))).path:(t=Yi.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===Ge.file?t=Ae.file(ZV(Tl(e))).path:t=Yi.normalize(e.path),e.with({path:t})}relativePath(e,t){if(e.scheme!==t.scheme||!c8(e.authority,t.authority))return;if(e.scheme===Ge.file){const o=are(Tl(e),Tl(t));return as?C$(o):o}let i=e.path||"/";const n=t.path||"/";if(this._ignorePathCasing(e)){let o=0;for(const r=Math.min(i.length,n.length);ol8(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=sh){return u8(e,t)?e.with({path:e.path.substr(0,e.path.length-1)}):e}addTrailingPathSeparator(e,t=sh){let i=!1;if(e.scheme===Ge.file){const n=Tl(e);i=n!==void 0&&n.length===l8(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&&!u8(e,t)?e.with({path:e.path+"/"}):e}}const ci=new vme(()=>!1),ZF=ci.isEqual.bind(ci);ci.isEqualOrParent.bind(ci);ci.getComparisonKey.bind(ci);const bme=ci.basenameOrAuthority.bind(ci),Wr=ci.basename.bind(ci),Cme=ci.extname.bind(ci),Ax=ci.dirname.bind(ci),wme=ci.joinPath.bind(ci),yme=ci.normalizePath.bind(ci),Sme=ci.relativePath.bind(ci),d8=ci.resolvePath.bind(ci);ci.isAbsolutePath.bind(ci);const c8=ci.isEqualAuthority.bind(ci),u8=ci.hasTrailingPathSeparator.bind(ci);ci.removeTrailingPathSeparator.bind(ci);ci.addTrailingPathSeparator.bind(ci);var Mh;(function(s){s.META_DATA_LABEL="label",s.META_DATA_DESCRIPTION="description",s.META_DATA_SIZE="size",s.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 o=t.path.substring(0,t.path.indexOf(";"));return o&&i.set(s.META_DATA_MIME,o),i}s.parseMetaData=e})(Mh||(Mh={}));function Tp(s){return s.toString()}class En{static create(e,t){const i=e.getAlternativeVersionId(),n=$A(e);return new En(i,i,n,n,t,t,[])}constructor(e,t,i,n,o,r,a){this.beforeVersionId=e,this.afterVersionId=t,this.beforeEOL=i,this.afterEOL=n,this.beforeCursorState=o,this.afterCursorState=r,this.changes=a}append(e,t,i,n,o){t.length>0&&(this.changes=pme(this.changes,t)),this.afterEOL=i,this.afterVersionId=n,this.afterCursorState=o}static _writeSelectionsSize(e){return 4+4*4*(e?e.length:0)}static _writeSelections(e,t,i){if(Fa(e,t?t.length:0,i),i+=4,t)for(const n of t)Fa(e,n.selectionStartLineNumber,i),i+=4,Fa(e,n.selectionStartColumn,i),i+=4,Fa(e,n.positionLineNumber,i),i+=4,Fa(e,n.positionColumn,i),i+=4;return i}static _readSelections(e,t,i){const n=Pa(e,t);t+=4;for(let o=0;ot.toString()).join(", ")}matchesResource(e){return(Ae.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 En}append(e,t,i,n,o){this._data instanceof En&&this._data.append(e,t,i,n,o)}close(){this._data instanceof En&&(this._data=this._data.serialize())}open(){this._data instanceof En||(this._data=En.deserialize(this._data))}undo(){if(Ae.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof En&&(this._data=this._data.serialize());const e=En.deserialize(this._data);this.model._applyUndo(e.changes,e.beforeEOL,e.beforeVersionId,e.beforeCursorState)}redo(){if(Ae.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof En&&(this._data=this._data.serialize());const e=En.deserialize(this._data);this.model._applyRedo(e.changes,e.afterEOL,e.afterVersionId,e.afterCursorState)}heapSize(){return this._data instanceof En&&(this._data=this._data.serialize()),this._data.byteLength+168}}class Dme{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 o=Tp(n.resource);this._editStackElementsMap.set(o,n)}this._delegate=null}prepareUndoRedo(){if(this._delegate)return this._delegate.prepareUndoRedo(this)}matchesResource(e){const t=Tp(e);return this._editStackElementsMap.has(t)}setModel(e){const t=Tp(Ae.isUri(e)?e:e.uri);this._editStackElementsMap.has(t)&&this._editStackElementsMap.get(t).setModel(e)}canAppend(e){if(!this._isOpen)return!1;const t=Tp(e.uri);return this._editStackElementsMap.has(t)?this._editStackElementsMap.get(t).canAppend(e):!1}append(e,t,i,n,o){const r=Tp(e.uri);this._editStackElementsMap.get(r).append(e,t,i,n,o)}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=Tp(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(`${Wr(t.resource)}: ${t}`);return`{${e.join(", ")}}`}}function $A(s){return s.getEOL()===` `?0:1}function tc(s){return s?s instanceof y$||s instanceof Dme:!1}class XF{constructor(e,t){this._model=e,this._undoRedoService=t}pushStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);tc(e)&&e.close()}popStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);tc(e)&&e.open()}clear(){this._undoRedoService.removeElements(this._model.uri)}_getOrCreateEditStackElement(e,t){const i=this._undoRedoService.getLastElement(this._model.uri);if(tc(i)&&i.canAppend(this._model))return i;const n=new y$(p("edit","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,[],$A(this._model),this._model.getAlternativeVersionId(),null)}pushEditOperation(e,t,i,n){const o=this._getOrCreateEditStackElement(e,n),r=this._model.applyEdits(t,!0),a=XF._computeCursorState(i,r),l=r.map((d,c)=>({index:c,textChange:d.textChange}));return l.sort((d,c)=>d.textChange.oldPosition===c.textChange.oldPosition?d.index-c.index:d.textChange.oldPosition-c.textChange.oldPosition),o.append(this._model,l.map(d=>d.textChange),$A(this._model),this._model.getAlternativeVersionId(),a),a}static _computeCursorState(e,t){try{return e?e(t):null}catch(i){return Xe(i),null}}}class Lme{constructor(){this.spacesDiff=0,this.looksLikeAlignment=!1}}function xme(s,e,t,i,n){n.spacesDiff=0,n.looksLikeAlignment=!1;let o;for(o=0;o0&&a>0||l>0&&d>0)return;const c=Math.abs(a-d),u=Math.abs(r-l);if(c===0){n.spacesDiff=u,u>0&&0<=l-1&&l-10?n++:w>1&&o++,xme(r,a,_,C,u),u.looksLikeAlignment&&!(t&&e===u.spacesDiff)))continue;const D=u.spacesDiff;D<=d&&c[D]++,r=_,a=C}let h=t;n!==o&&(h=n{const _=c[m];_>f&&(f=_,g=m)}),g===4&&c[4]>0&&c[2]>0&&c[2]>=c[4]/2&&(g=2)}return{insertSpaces:h,tabSize:g}}function eo(s){return(s.metadata&1)>>>0}function ri(s,e){s.metadata=s.metadata&254|e<<0}function Qn(s){return(s.metadata&2)>>>1===1}function ii(s,e){s.metadata=s.metadata&253|(e?1:0)<<1}function S$(s){return(s.metadata&4)>>>2===1}function g8(s,e){s.metadata=s.metadata&251|(e?1:0)<<2}function D$(s){return(s.metadata&64)>>>6===1}function f8(s,e){s.metadata=s.metadata&191|(e?1:0)<<6}function kme(s){return(s.metadata&24)>>>3}function p8(s,e){s.metadata=s.metadata&231|e<<3}function Eme(s){return(s.metadata&32)>>>5===1}function m8(s,e){s.metadata=s.metadata&223|(e?1:0)<<5}class L${constructor(e,t,i){this.metadata=0,this.parent=this,this.left=this,this.right=this,ri(this,1),this.start=t,this.end=i,this.delta=0,this.maxEnd=i,this.id=e,this.ownerId=0,this.options=null,g8(this,!1),f8(this,!1),p8(this,1),m8(this,!1),this.cachedVersionId=0,this.cachedAbsoluteStart=t,this.cachedAbsoluteEnd=i,this.range=null,ii(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;g8(this,t==="squiggly-error"||t==="squiggly-warning"||t==="squiggly-info"),f8(this,this.options.glyphMarginClassName!==null),p8(this,this.options.stickiness),m8(this,this.options.collapseOnReplaceEdit)}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 at=new L$(null,0,0);at.parent=at;at.left=at;at.right=at;ri(at,0);class SI{constructor(){this.root=at,this.requestNormalizeDelta=!1}intervalSearch(e,t,i,n,o,r){return this.root===at?[]:Fme(this,e,t,i,n,o,r)}search(e,t,i,n){return this.root===at?[]:Pme(this,e,t,i,n)}collectNodesFromOwner(e){return Mme(this,e)}collectNodesPostOrder(){return Rme(this)}insert(e){_8(this,e),this._normalizeDeltaIfNecessary()}delete(e){v8(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 o=i.start+n,r=i.end+n;i.setCachedOffsets(o,r,t)}acceptReplace(e,t,i,n){const o=Nme(this,e,e+t);for(let r=0,a=o.length;rt||i===1?!1:i===2?!0:e}function Tme(s,e,t,i,n){const o=kme(s),r=o===0||o===2,a=o===1||o===2,l=t-e,d=i,c=Math.min(l,d),u=s.start;let h=!1;const g=s.end;let f=!1;e<=u&&g<=t&&Eme(s)&&(s.start=e,h=!0,s.end=e,f=!0);{const _=n?1:l>0?2:0;!h&&Np(u,r,e,_)&&(h=!0),!f&&Np(g,a,e,_)&&(f=!0)}if(c>0&&!n){const _=l>d?2:0;!h&&Np(u,r,e+c,_)&&(h=!0),!f&&Np(g,a,e+c,_)&&(f=!0)}{const _=n?1:0;!h&&Np(u,r,t,_)&&(s.start=e+d,h=!0),!f&&Np(g,a,t,_)&&(s.end=e+d,f=!0)}const m=d-l;h||(s.start=Math.max(0,u+m)),f||(s.end=Math.max(0,g+m)),s.start>s.end&&(s.end=s.start)}function Nme(s,e,t){let i=s.root,n=0,o=0,r=0,a=0;const l=[];let d=0;for(;i!==at;){if(Qn(i)){ii(i.left,!1),ii(i.right,!1),i===i.parent.right&&(n-=i.parent.delta),i=i.parent;continue}if(!Qn(i.left)){if(o=n+i.maxEnd,ot){ii(i,!0);continue}if(a=n+i.end,a>=e&&(i.setCachedOffsets(r,a,0),l[d++]=i),ii(i,!0),i.right!==at&&!Qn(i.right)){n+=i.delta,i=i.right;continue}}return ii(s.root,!1),l}function Ame(s,e,t,i){let n=s.root,o=0,r=0,a=0;const l=i-(t-e);for(;n!==at;){if(Qn(n)){ii(n.left,!1),ii(n.right,!1),n===n.parent.right&&(o-=n.parent.delta),Rh(n),n=n.parent;continue}if(!Qn(n.left)){if(r=o+n.maxEnd,rt){n.start+=l,n.end+=l,n.delta+=l,(n.delta<-1073741824||n.delta>1073741824)&&(s.requestNormalizeDelta=!0),ii(n,!0);continue}if(ii(n,!0),n.right!==at&&!Qn(n.right)){o+=n.delta,n=n.right;continue}}ii(s.root,!1)}function Mme(s,e){let t=s.root;const i=[];let n=0;for(;t!==at;){if(Qn(t)){ii(t.left,!1),ii(t.right,!1),t=t.parent;continue}if(t.left!==at&&!Qn(t.left)){t=t.left;continue}if(t.ownerId===e&&(i[n++]=t),ii(t,!0),t.right!==at&&!Qn(t.right)){t=t.right;continue}}return ii(s.root,!1),i}function Rme(s){let e=s.root;const t=[];let i=0;for(;e!==at;){if(Qn(e)){ii(e.left,!1),ii(e.right,!1),e=e.parent;continue}if(e.left!==at&&!Qn(e.left)){e=e.left;continue}if(e.right!==at&&!Qn(e.right)){e=e.right;continue}t[i++]=e,ii(e,!0)}return ii(s.root,!1),t}function Pme(s,e,t,i,n){let o=s.root,r=0,a=0,l=0;const d=[];let c=0;for(;o!==at;){if(Qn(o)){ii(o.left,!1),ii(o.right,!1),o===o.parent.right&&(r-=o.parent.delta),o=o.parent;continue}if(o.left!==at&&!Qn(o.left)){o=o.left;continue}a=r+o.start,l=r+o.end,o.setCachedOffsets(a,l,i);let u=!0;if(e&&o.ownerId&&o.ownerId!==e&&(u=!1),t&&S$(o)&&(u=!1),n&&!D$(o)&&(u=!1),u&&(d[c++]=o),ii(o,!0),o.right!==at&&!Qn(o.right)){r+=o.delta,o=o.right;continue}}return ii(s.root,!1),d}function Fme(s,e,t,i,n,o,r){let a=s.root,l=0,d=0,c=0,u=0;const h=[];let g=0;for(;a!==at;){if(Qn(a)){ii(a.left,!1),ii(a.right,!1),a===a.parent.right&&(l-=a.parent.delta),a=a.parent;continue}if(!Qn(a.left)){if(d=l+a.maxEnd,dt){ii(a,!0);continue}if(u=l+a.end,u>=e){a.setCachedOffsets(c,u,o);let f=!0;i&&a.ownerId&&a.ownerId!==i&&(f=!1),n&&S$(a)&&(f=!1),r&&!D$(a)&&(f=!1),f&&(h[g++]=a)}if(ii(a,!0),a.right!==at&&!Qn(a.right)){l+=a.delta,a=a.right;continue}}return ii(s.root,!1),h}function _8(s,e){if(s.root===at)return e.parent=at,e.left=at,e.right=at,ri(e,0),s.root=e,s.root;Ome(s,e),Su(e.parent);let t=e;for(;t!==s.root&&eo(t.parent)===1;)if(t.parent===t.parent.parent.left){const i=t.parent.parent.right;eo(i)===1?(ri(t.parent,0),ri(i,0),ri(t.parent.parent,1),t=t.parent.parent):(t===t.parent.right&&(t=t.parent,Qv(s,t)),ri(t.parent,0),ri(t.parent.parent,1),Jv(s,t.parent.parent))}else{const i=t.parent.parent.left;eo(i)===1?(ri(t.parent,0),ri(i,0),ri(t.parent.parent,1),t=t.parent.parent):(t===t.parent.left&&(t=t.parent,Jv(s,t)),ri(t.parent,0),ri(t.parent.parent,1),Qv(s,t.parent.parent))}return ri(s.root,0),e}function Ome(s,e){let t=0,i=s.root;const n=e.start,o=e.end;for(;;)if(Wme(n,o,i.start+t,i.end+t)<0)if(i.left===at){e.start-=t,e.end-=t,e.maxEnd-=t,i.left=e;break}else i=i.left;else if(i.right===at){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=at,e.right=at,ri(e,1)}function v8(s,e){let t,i;if(e.left===at?(t=e.right,i=e,t.delta+=e.delta,(t.delta<-1073741824||t.delta>1073741824)&&(s.requestNormalizeDelta=!0),t.start+=e.delta,t.end+=e.delta):e.right===at?(t=e.left,i=e):(i=Bme(e.right),t=i.right,t.start+=i.delta,t.end+=i.delta,t.delta+=i.delta,(t.delta<-1073741824||t.delta>1073741824)&&(s.requestNormalizeDelta=!0),i.start+=e.delta,i.end+=e.delta,i.delta=e.delta,(i.delta<-1073741824||i.delta>1073741824)&&(s.requestNormalizeDelta=!0)),i===s.root){s.root=t,ri(t,0),e.detach(),DI(),Rh(t),s.root.parent=at;return}const n=eo(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,ri(i,eo(e)),e===s.root?s.root=i:e===e.parent.left?e.parent.left=i:e.parent.right=i,i.left!==at&&(i.left.parent=i),i.right!==at&&(i.right.parent=i)),e.detach(),n){Su(t.parent),i!==e&&(Su(i),Su(i.parent)),DI();return}Su(t),Su(t.parent),i!==e&&(Su(i),Su(i.parent));let o;for(;t!==s.root&&eo(t)===0;)t===t.parent.left?(o=t.parent.right,eo(o)===1&&(ri(o,0),ri(t.parent,1),Qv(s,t.parent),o=t.parent.right),eo(o.left)===0&&eo(o.right)===0?(ri(o,1),t=t.parent):(eo(o.right)===0&&(ri(o.left,0),ri(o,1),Jv(s,o),o=t.parent.right),ri(o,eo(t.parent)),ri(t.parent,0),ri(o.right,0),Qv(s,t.parent),t=s.root)):(o=t.parent.left,eo(o)===1&&(ri(o,0),ri(t.parent,1),Jv(s,t.parent),o=t.parent.left),eo(o.left)===0&&eo(o.right)===0?(ri(o,1),t=t.parent):(eo(o.left)===0&&(ri(o.right,0),ri(o,1),Qv(s,o),o=t.parent.left),ri(o,eo(t.parent)),ri(t.parent,0),ri(o.left,0),Jv(s,t.parent),t=s.root));ri(t,0),DI()}function Bme(s){for(;s.left!==at;)s=s.left;return s}function DI(){at.parent=at,at.delta=0,at.start=0,at.end=0}function Qv(s,e){const t=e.right;t.delta+=e.delta,(t.delta<-1073741824||t.delta>1073741824)&&(s.requestNormalizeDelta=!0),t.start+=e.delta,t.end+=e.delta,e.right=t.left,t.left!==at&&(t.left.parent=e),t.parent=e.parent,e.parent===at?s.root=t:e===e.parent.left?e.parent.left=t:e.parent.right=t,t.left=e,e.parent=t,Rh(e),Rh(t)}function Jv(s,e){const t=e.left;e.delta-=t.delta,(e.delta<-1073741824||e.delta>1073741824)&&(s.requestNormalizeDelta=!0),e.start-=t.delta,e.end-=t.delta,e.left=t.right,t.right!==at&&(t.right.parent=e),t.parent=e.parent,e.parent===at?s.root=t:e===e.parent.right?e.parent.right=t:e.parent.left=t,t.right=e,e.parent=t,Rh(e),Rh(t)}function x$(s){let e=s.end;if(s.left!==at){const t=s.left.maxEnd;t>e&&(e=t)}if(s.right!==at){const t=s.right.maxEnd+s.delta;t>e&&(e=t)}return e}function Rh(s){s.maxEnd=x$(s)}function Su(s){for(;s!==at;){const e=x$(s);if(s.maxEnd===e)return;s.maxEnd=e,s=s.parent}}function Wme(s,e,t,i){return s===t?e-i:s-t}class jA{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!==Qe)return YF(this.right);let e=this;for(;e.parent!==Qe&&e.parent.left!==e;)e=e.parent;return e.parent===Qe?Qe:e.parent}prev(){if(this.left!==Qe)return k$(this.left);let e=this;for(;e.parent!==Qe&&e.parent.right!==e;)e=e.parent;return e.parent===Qe?Qe:e.parent}detach(){this.parent=null,this.left=null,this.right=null}}const Qe=new jA(null,0);Qe.parent=Qe;Qe.left=Qe;Qe.right=Qe;Qe.color=0;function YF(s){for(;s.left!==Qe;)s=s.left;return s}function k$(s){for(;s.right!==Qe;)s=s.right;return s}function QF(s){return s===Qe?0:s.size_left+s.piece.length+QF(s.right)}function JF(s){return s===Qe?0:s.lf_left+s.piece.lineFeedCnt+JF(s.right)}function LI(){Qe.parent=Qe}function eb(s,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!==Qe&&(t.left.parent=e),t.parent=e.parent,e.parent===Qe?s.root=t:e.parent.left===e?e.parent.left=t:e.parent.right=t,t.left=e,e.parent=t}function tb(s,e){const t=e.left;e.left=t.right,t.right!==Qe&&(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===Qe?s.root=t:e===e.parent.right?e.parent.right=t:e.parent.left=t,t.right=e,e.parent=t}function Rw(s,e){let t,i;if(e.left===Qe?(i=e,t=i.right):e.right===Qe?(i=e,t=i.left):(i=YF(e.right),t=i.right),i===s.root){s.root=t,t.color=0,e.detach(),LI(),s.root.parent=Qe;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,Sv(s,t)):(i.parent===e?t.parent=i:t.parent=i.parent,Sv(s,t),i.left=e.left,i.right=e.right,i.parent=e.parent,i.color=e.color,e===s.root?s.root=i:e===e.parent.left?e.parent.left=i:e.parent.right=i,i.left!==Qe&&(i.left.parent=i),i.right!==Qe&&(i.right.parent=i),i.size_left=e.size_left,i.lf_left=e.lf_left,Sv(s,i)),e.detach(),t.parent.left===t){const r=QF(t),a=JF(t);if(r!==t.parent.size_left||a!==t.parent.lf_left){const l=r-t.parent.size_left,d=a-t.parent.lf_left;t.parent.size_left=r,t.parent.lf_left=a,qd(s,t.parent,l,d)}}if(Sv(s,t.parent),n){LI();return}let o;for(;t!==s.root&&t.color===0;)t===t.parent.left?(o=t.parent.right,o.color===1&&(o.color=0,t.parent.color=1,eb(s,t.parent),o=t.parent.right),o.left.color===0&&o.right.color===0?(o.color=1,t=t.parent):(o.right.color===0&&(o.left.color=0,o.color=1,tb(s,o),o=t.parent.right),o.color=t.parent.color,t.parent.color=0,o.right.color=0,eb(s,t.parent),t=s.root)):(o=t.parent.left,o.color===1&&(o.color=0,t.parent.color=1,tb(s,t.parent),o=t.parent.left),o.left.color===0&&o.right.color===0?(o.color=1,t=t.parent):(o.left.color===0&&(o.right.color=0,o.color=1,eb(s,o),o=t.parent.left),o.color=t.parent.color,t.parent.color=0,o.left.color=0,tb(s,t.parent),t=s.root));t.color=0,LI()}function b8(s,e){for(Sv(s,e);e!==s.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,eb(s,e)),e.parent.color=0,e.parent.parent.color=1,tb(s,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,tb(s,e)),e.parent.color=0,e.parent.parent.color=1,eb(s,e.parent.parent))}s.root.color=0}function qd(s,e,t,i){for(;e!==s.root&&e!==Qe;)e.parent.left===e&&(e.parent.size_left+=t,e.parent.lf_left+=i),e=e.parent}function Sv(s,e){let t=0,i=0;if(e!==s.root){for(;e!==s.root&&e===e.parent.right;)e=e.parent;if(e!==s.root)for(e=e.parent,t=QF(e.left)-e.size_left,i=JF(e.left)-e.lf_left,e.size_left+=t,e.lf_left+=i;e!==s.root&&(t!==0||i!==0);)e.parent.left===e&&(e.parent.size_left+=t,e.parent.lf_left+=i),e=e.parent}}const Wd=65535;function E$(s){let e;return s[s.length-1]<65536?e=new Uint16Array(s.length):e=new Uint32Array(s.length),e.set(s,0),e}class Hme{constructor(e,t,i,n,o){this.lineStarts=e,this.cr=t,this.lf=i,this.crlf=n,this.isBasicASCII=o}}function Zd(s,e=!0){const t=[0];let i=1;for(let n=0,o=s.length;n126)&&(r=!1)}const a=new Hme(E$(s),i,n,o,r);return s.length=0,a}class _o{constructor(e,t,i,n,o){this.bufferIndex=e,this.start=t,this.end=i,this.lineFeedCnt=n,this.length=o}}class zg{constructor(e,t){this.buffer=e,this.lineStarts=t}}class zme{constructor(e,t){this._pieces=[],this._tree=e,this._BOM=t,this._index=0,e.root!==Qe&&e.iterate(e.root,i=>(i!==Qe&&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 Ume{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 o of i)o!==null&&n.push(o);this._cache=n}}}class $me{constructor(e,t,i){this.create(e,t,i)}create(e,t,i){this._buffers=[new zg("",[0])],this._lastChangeBufferPos={line:0,column:0},this.root=Qe,this._lineCnt=1,this._length=0,this._EOL=t,this._EOLLength=t.length,this._EOLNormalized=i;let n=null;for(let o=0,r=e.length;o0){e[o].lineStarts||(e[o].lineStarts=Zd(e[o].buffer));const a=new _o(o+1,{line:0,column:0},{line:e[o].lineStarts.length-1,column:e[o].buffer.length-e[o].lineStarts[e[o].lineStarts.length-1]},e[o].lineStarts.length-1,e[o].buffer.length);this._buffers.push(e[o]),n=this.rbInsertRight(n,a)}this._searchCache=new Ume(1),this._lastVisitedLine={lineNumber:0,value:""},this.computeBufferMetadata()}normalizeEOL(e){const t=Wd,i=t-Math.floor(t/3),n=i*2;let o="",r=0;const a=[];if(this.iterate(this.root,l=>{const d=this.getNodeContent(l),c=d.length;if(r<=i||r+c0){const l=o.replace(/\r\n|\r|\n/g,e);a.push(new zg(l,Zd(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 zme(this,e)}getOffsetAt(e,t){let i=0,n=this.root;for(;n!==Qe;)if(n.left!==Qe&&n.lf_left+1>=e)n=n.left;else if(n.lf_left+n.piece.lineFeedCnt+1>=e){i+=n.size_left;const o=this.getAccumulatedValue(n,e-n.lf_left-2);return i+=o+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!==Qe;)if(t.size_left!==0&&t.size_left>=e)t=t.left;else if(t.size_left+t.piece.length>=e){const o=this.getIndexOf(t,e-t.size_left);if(i+=t.lf_left+o.index,o.index===0){const r=this.getOffsetAt(i+1,1),a=n-r;return new W(i+1,a+1)}return new W(i+1,o.remainder+1)}else if(e-=t.size_left+t.piece.length,i+=t.lf_left+t.piece.lineFeedCnt,t.right===Qe){const o=this.getOffsetAt(i+1,1),r=n-e-o;return new W(i+1,r+1)}else t=t.right;return new W(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),o=this.getValueInRange2(i,n);return t?t!==this._EOL||!this._EOLNormalized?o.replace(/\r\n|\r|\n/g,t):t===this.getEOL()&&this._EOLNormalized?o:o.replace(/\r\n|\r|\n/g,t):o}getValueInRange2(e,t){if(e.node===t.node){const a=e.node,l=this._buffers[a.piece.bufferIndex].buffer,d=this.offsetInBuffer(a.piece.bufferIndex,a.piece.start);return l.substring(d+e.remainder,d+t.remainder)}let i=e.node;const n=this._buffers[i.piece.bufferIndex].buffer,o=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);let r=n.substring(o+e.remainder,o+i.piece.length);for(i=i.next();i!==Qe;){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,o=>{if(o===Qe)return!0;const r=o.piece;let a=r.length;if(a===0)return!0;const l=this._buffers[r.bufferIndex].buffer,d=this._buffers[r.bufferIndex].lineStarts,c=r.start.line,u=r.end.line;let h=d[c]+r.start.column;if(n&&(l.charCodeAt(h)===10&&(h++,a--),e[t++]=i,i="",n=!1,a===0))return!0;if(c===u)return!this._EOLNormalized&&l.charCodeAt(h+a-1)===13?(n=!0,i+=l.substr(h,a-1)):i+=l.substr(h,a),!0;i+=this._EOLNormalized?l.substring(h,Math.max(h,d[c+1]-this._EOLLength)):l.substring(h,d[c+1]).replace(/(\r\n|\r|\n)$/,""),e[t++]=i;for(let g=c+1;gw+f,t.reset(0)):(b=h.buffer,C=w=>w,t.reset(f));do if(_=t.next(b),_){if(C(_.index)>=m)return c;this.positionInBuffer(e,C(_.index)-g,v);const w=this.getLineFeedCnt(e.piece.bufferIndex,o,v),y=v.line===o.line?v.column-o.column+n:v.column+1,D=y+_[0].length;if(u[c++]=Pg(new x(i+w,y,i+w,D),_,l),C(_.index)+_[0].length>=m||c>=d)return c}while(_);return c}findMatchesLineByLine(e,t,i,n){const o=[];let r=0;const a=new nm(t.wordSeparators,t.regex);let l=this.nodeAt2(e.startLineNumber,e.startColumn);if(l===null)return[];const d=this.nodeAt2(e.endLineNumber,e.endColumn);if(d===null)return[];let c=this.positionInBuffer(l.node,l.remainder);const u=this.positionInBuffer(d.node,d.remainder);if(l.node===d.node)return this.findMatchesInNode(l.node,a,e.startLineNumber,e.startColumn,c,u,t,i,n,r,o),o;let h=e.startLineNumber,g=l.node;for(;g!==d.node;){const m=this.getLineFeedCnt(g.piece.bufferIndex,c,g.piece.end);if(m>=1){const v=this._buffers[g.piece.bufferIndex].lineStarts,b=this.offsetInBuffer(g.piece.bufferIndex,g.piece.start),C=v[c.line+m],w=h===e.startLineNumber?e.startColumn:1;if(r=this.findMatchesInNode(g,a,h,w,c,this.positionInBuffer(g,C-b),t,i,n,r,o),r>=n)return o;h+=m}const _=h===e.startLineNumber?e.startColumn-1:0;if(h===e.endLineNumber){const v=this.getLineContent(h).substring(_,e.endColumn-1);return r=this._findMatchesInLine(t,a,v,e.endLineNumber,_,r,o,i,n),o}if(r=this._findMatchesInLine(t,a,this.getLineContent(h).substr(_),h,_,r,o,i,n),r>=n)return o;h++,l=this.nodeAt2(h,1),g=l.node,c=this.positionInBuffer(l.node,l.remainder)}if(h===e.endLineNumber){const m=h===e.startLineNumber?e.startColumn-1:0,_=this.getLineContent(h).substring(m,e.endColumn-1);return r=this._findMatchesInLine(t,a,_,e.endLineNumber,m,r,o,i,n),o}const f=h===e.startLineNumber?e.startColumn:1;return r=this.findMatchesInNode(d.node,a,h,f,c,u,t,i,n,r,o),o}_findMatchesInLine(e,t,i,n,o,r,a,l,d){const c=e.wordSeparators;if(!l&&e.simpleSearch){const h=e.simpleSearch,g=h.length,f=i.length;let m=-g;for(;(m=i.indexOf(h,m+g))!==-1;)if((!c||vF(c,i,f,m,g))&&(a[r++]=new Wb(new x(n,m+1+o,n,m+1+g+o),null),r>=d))return r;return r}let u;t.reset(0);do if(u=t.next(i),u&&(a[r++]=Pg(new x(n,u.index+1+o,n,u.index+1+u[0].length+o),u,l),r>=d))return r;while(u);return r}insert(e,t,i=!1){if(this._EOLNormalized=this._EOLNormalized&&i,this._lastVisitedLine.lineNumber=0,this._lastVisitedLine.value="",this.root!==Qe){const{node:n,remainder:o,nodeStartOffset:r}=this.nodeAt(e),a=n.piece,l=a.bufferIndex,d=this.positionInBuffer(n,o);if(n.piece.bufferIndex===0&&a.end.line===this._lastChangeBufferPos.line&&a.end.column===this._lastChangeBufferPos.column&&r+a.length===e&&t.lengthe){const c=[];let u=new _o(a.bufferIndex,d,a.end,this.getLineFeedCnt(a.bufferIndex,d,a.end),this.offsetInBuffer(l,a.end)-this.offsetInBuffer(l,d));if(this.shouldCheckCRLF()&&this.endWithCR(t)&&this.nodeCharCodeAt(n,o)===10){const m={line:u.start.line+1,column:0};u=new _o(u.bufferIndex,m,u.end,this.getLineFeedCnt(u.bufferIndex,m,u.end),u.length-1),t+=` `}if(this.shouldCheckCRLF()&&this.startWithLF(t))if(this.nodeCharCodeAt(n,o-1)===13){const m=this.positionInBuffer(n,o-1);this.deleteNodeTail(n,m),t="\r"+t,n.piece.length===0&&c.push(n)}else this.deleteNodeTail(n,d);else this.deleteNodeTail(n,d);const h=this.createNewPieces(t);u.length>0&&this.rbInsertRight(n,u);let g=n;for(let f=0;f=0;r--)o=this.rbInsertLeft(o,n[r]);this.validateCRLFWithPrevNode(o),this.deleteNodes(i)}insertContentToNodeRight(e,t){this.adjustCarriageReturnFromNext(e,t)&&(e+=` `);const i=this.createNewPieces(e),n=this.rbInsertRight(t,i[0]);let o=n;for(let r=1;r=h)d=u+1;else break;return i?(i.line=u,i.column=l-g,null):{line:u,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 o=n[i.line+1],r=n[i.line]+i.column;if(o>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;tWd){const c=[];for(;e.length>Wd;){const h=e.charCodeAt(Wd-1);let g;h===13||h>=55296&&h<=56319?(g=e.substring(0,Wd-1),e=e.substring(Wd-1)):(g=e.substring(0,Wd),e=e.substring(Wd));const f=Zd(g);c.push(new _o(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 zg(g,f))}const u=Zd(e);return c.push(new _o(this._buffers.length,{line:0,column:0},{line:u.length-1,column:e.length-u[u.length-1]},u.length-1,e.length)),this._buffers.push(new zg(e,u)),c}let t=this._buffers[0].buffer.length;const i=Zd(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 c=0;c=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),d=this.getAccumulatedValue(i,e-i.lf_left-1),c=this._buffers[i.piece.bufferIndex].buffer,u=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)}),c.substring(u+l,u+d-t)}else if(i.lf_left+i.piece.lineFeedCnt===e-1){const l=this.getAccumulatedValue(i,e-i.lf_left-2),d=this._buffers[i.piece.bufferIndex].buffer,c=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);n=d.substring(c+l,c+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!==Qe;){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!==Qe;)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),o=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!==o)return{index:r,remainder:0}}return{index:o,remainder:n.column}}getAccumulatedValue(e,t){if(t<0)return 0;const i=e.piece,n=this._buffers[i.bufferIndex].lineStarts,o=i.start.line+t+1;return o>i.end.line?n[i.end.line]+i.end.column-n[i.start.line]-i.start.column:n[o]-n[i.start.line]-i.start.column}deleteNodeTail(e,t){const i=e.piece,n=i.lineFeedCnt,o=this.offsetInBuffer(i.bufferIndex,i.end),r=t,a=this.offsetInBuffer(i.bufferIndex,r),l=this.getLineFeedCnt(i.bufferIndex,i.start,r),d=l-n,c=a-o,u=i.length+c;e.piece=new _o(i.bufferIndex,i.start,r,l,u),qd(this,e,c,d)}deleteNodeHead(e,t){const i=e.piece,n=i.lineFeedCnt,o=this.offsetInBuffer(i.bufferIndex,i.start),r=t,a=this.getLineFeedCnt(i.bufferIndex,r,i.end),l=this.offsetInBuffer(i.bufferIndex,r),d=a-n,c=o-l,u=i.length+c;e.piece=new _o(i.bufferIndex,r,i.end,a,u),qd(this,e,c,d)}shrinkNode(e,t,i){const n=e.piece,o=n.start,r=n.end,a=n.length,l=n.lineFeedCnt,d=t,c=this.getLineFeedCnt(n.bufferIndex,n.start,d),u=this.offsetInBuffer(n.bufferIndex,t)-this.offsetInBuffer(n.bufferIndex,o);e.piece=new _o(n.bufferIndex,n.start,d,c,u),qd(this,e,u-a,c-l);const h=new _o(n.bufferIndex,i,r,this.getLineFeedCnt(n.bufferIndex,i,r),this.offsetInBuffer(n.bufferIndex,r)-this.offsetInBuffer(n.bufferIndex,i)),g=this.rbInsertRight(e,h);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 o=Zd(t,!1);for(let g=0;ge)t=t.left;else if(t.size_left+t.piece.length>=e){n+=t.size_left;const o={node:t,remainder:e-t.size_left,nodeStartOffset:n};return this._searchCache.set(o),o}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!==Qe;)if(i.left!==Qe&&i.lf_left>=e-1)i=i.left;else if(i.lf_left+i.piece.lineFeedCnt>e-1){const o=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(o+t-1,r),nodeStartOffset:n}}else if(i.lf_left+i.piece.lineFeedCnt===e-1){const o=this.getAccumulatedValue(i,e-i.lf_left-2);if(o+t-1<=i.piece.length)return{node:i,remainder:o+t-1,nodeStartOffset:n};t-=i.piece.length-o;break}else e-=i.lf_left+i.piece.lineFeedCnt,n+=i.size_left+i.piece.length,i=i.right;for(i=i.next();i!==Qe;){if(i.piece.lineFeedCnt>0){const o=this.getAccumulatedValue(i,0),r=this.offsetOfNode(i);return{node:i,remainder:Math.min(t-1,o),nodeStartOffset:r}}else if(i.piece.length>=t-1){const o=this.offsetOfNode(i);return{node:i,remainder:t-1,nodeStartOffset:o}}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===Qe||e.piece.lineFeedCnt===0)return!1;const t=e.piece,i=this._buffers[t.bufferIndex].lineStarts,n=t.start.line,o=i[n]+t.start.column;return n===i.length-1||i[n+1]>o+1?!1:this._buffers[t.bufferIndex].buffer.charCodeAt(o)===10}endWithCR(e){return typeof e=="string"?e.charCodeAt(e.length-1)===13:e===Qe||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 o;e.piece.end.column===0?o={line:e.piece.end.line-1,column:n[e.piece.end.line]-n[e.piece.end.line-1]-1}:o={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 _o(e.piece.bufferIndex,e.piece.start,o,a,r),qd(this,e,-1,-1),e.piece.length===0&&i.push(e);const l={line:t.piece.start.line+1,column:0},d=t.piece.length-1,c=this.getLineFeedCnt(t.piece.bufferIndex,l,t.piece.end);t.piece=new _o(t.piece.bufferIndex,l,t.piece.end,c,d),qd(this,t,-1,-1),t.piece.length===0&&i.push(t);const u=this.createNewPieces(`\r `);this.rbInsertRight(e,u[0]);for(let h=0;h_.sortIndex-v.sortIndex)}this._mightContainRTL=n,this._mightContainUnusualLineTerminators=o,this._mightContainNonBasicASCII=r;const g=this._doApplyEdits(l);let f=null;if(t&&u.length>0){u.sort((m,_)=>_.lineNumber-m.lineNumber),f=[];for(let m=0,_=u.length;m<_;m++){const v=u[m].lineNumber;if(m>0&&u[m-1].lineNumber===v)continue;const b=u[m].oldContent,C=this.getLineContent(v);C.length===0||C===b||Cs(C)!==-1||f.push(v)}}return this._onDidChangeContent.fire(),new jde(h,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,o=new x(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(m.text),r=_.endLineNumber,a=_.endColumn}const d=l.join(""),[c,u,h]=Ah(d);return{sortIndex:0,identifier:e[0].identifier,range:o,rangeOffset:this.getOffsetAt(o.startLineNumber,o.startColumn),rangeLength:this.getValueLengthInRange(o,0),text:d,eolCount:c,firstLineLength:u,lastLineLength:h,forceMoveMarkers:t,isAutoWhitespaceEdit:!1}}_doApplyEdits(e){e.sort(zm._sortOpsDescending);const t=[];for(let i=0;i0){const h=l.eolCount+1;h===1?u=new x(d,c,d,c+l.firstLineLength):u=new x(d,c,d+h-1,l.lastLineLength+1)}else u=new x(d,c,d,c);i=u.endLineNumber,n=u.endColumn,t.push(u),o=l}return t}static _sortOpsAscending(e,t){const i=x.compareRangesUsingEnds(e.range,t.range);return i===0?e.sortIndex-t.sortIndex:i}static _sortOpsDescending(e,t){const i=x.compareRangesUsingEnds(e.range,t.range);return i===0?t.sortIndex-e.sortIndex:-i}}class jme{constructor(e,t,i,n,o,r,a,l,d){this._chunks=e,this._bom=t,this._cr=i,this._lf=n,this._crlf=o,this._containsRTL=r,this._containsUnusualLineTerminators=a,this._isBasicASCII=l,this._normalizeEOL=d}_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 o=0,r=i.length;o=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=Vme(this._tmpLineStarts,e);this.chunks.push(new zg(e,t.lineStarts)),this.cr+=t.cr,this.lf+=t.lf,this.crlf+=t.crlf,t.isBasicASCII||(this.isBasicASCII=!1,this.containsRTL||(this.containsRTL=d_(e)),this.containsUnusualLineTerminators||(this.containsUnusualLineTerminators=lz(e)))}finish(e=!0){return this._finish(),new jme(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=Zd(e.buffer);e.lineStarts=t,this._previousChar===13&&this.cr++}}}class Kme{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),o=this._store.slice(e+t),r=qme(i,this._default);this._store=n.concat(r,o)}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 Gme(e,[t]))}finalize(){return this._tokens}}class Zme{constructor(e,t){this.tokenizationSupport=t,this.initialState=this.tokenizationSupport.getInitialState(),this.store=new qA(e)}getStartState(e){return this.store.getStartState(e,this.initialState)}getFirstInvalidLine(){return this.store.getFirstInvalidLine(this.initialState)}}class Xme extends Zme{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 o=this._textModel.getLineContent(n.lineNumber),r=$0(this._languageIdCodec,i,this.tokenizationSupport,o,!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(),o=this._textModel.getLineContent(e.lineNumber),r=o.substring(0,e.column-1)+t+o.substring(e.column-1),a=$0(this._languageIdCodec,n,this.tokenizationSupport,r,!0,i),l=new wn(a.tokens,r,this._languageIdCodec);if(l.getCount()===0)return 0;const d=l.findTokenIndexAtOffset(e.column-1);return l.getStandardTokenType(d)}tokenizeLineWithEdit(e,t,i){const n=e.lineNumber,o=e.column,r=this.getStartState(n);if(!r)return null;const a=this._textModel.getLineContent(n),l=a.substring(0,o-1)+i+a.substring(o-1+t),d=this._textModel.getLanguageIdAtPosition(n,0),c=$0(this._languageIdCodec,d,this.tokenizationSupport,l,!0,r);return new wn(c.tokens,l,this._languageIdCodec)}hasAccurateTokensForLine(e){const t=this.store.getFirstInvalidEndStateLineNumberOrMax();return e1&&a>=1;a--){const l=this._textModel.getLineFirstNonWhitespaceColumn(a);if(l!==0&&l0&&i>0&&(i--,t--),this._lineEndStates.replace(e.startLineNumber,i,t)}}class Qme{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 et(e+1,i.endExclusive):i.endExclusive===e+1?this._ranges[t]=new et(i.start,e):this._ranges.splice(t,1,new et(i.start,e),new et(e+1,i.endExclusive))}}addRange(e){et.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 $0(s,e,t,i,n,o){let r=null;if(t)try{r=t.tokenizeEncoded(i,n,o.clone())}catch(a){Xe(a)}return r||(r=xF(s.encodeLanguageId(e),o)),wn.convertToEndOffset(r.tokens,i.length),r}class Jme{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,pz(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){var t;const i=(t=this._tokenizerWithStateStore)===null||t===void 0?void 0:t.getFirstInvalidLine();return i?(this._tokenizerWithStateStore.updateTokensUntilLine(e,i.lineNumber),i.lineNumber):this._tokenizerWithStateStore._textModel.getLineCount()+1}checkFinished(){this._isDisposed||this._tokenizerWithStateStore.store.allStatesValid()&&this._backgroundTokenStore.backgroundTokenizationFinished()}requestTokens(e,t){this._tokenizerWithStateStore.store.invalidateEndStateRange(new Je(e,t))}}const Xd=new Uint32Array(0).buffer;class Ml{static deleteBeginning(e,t){return e===null||e===Xd?e:Ml.delete(e,0,t)}static deleteEnding(e,t){if(e===null||e===Xd)return e;const i=lc(e),n=i[i.length-2];return Ml.delete(e,t,n)}static delete(e,t,i){if(e===null||e===Xd||t===i)return e;const n=lc(e),o=n.length>>>1;if(t===0&&n[n.length-2]===i)return Xd;const r=wn.findIndexInTokensArray(n,t),a=r>0?n[r-1<<1]:0,l=n[r<<1];if(ic&&(n[d++]=f,n[d++]=n[(g<<1)+1],c=f)}if(d===n.length)return e;const h=new Uint32Array(d);return h.set(n.subarray(0,d),0),h.buffer}static append(e,t){if(t===Xd)return e;if(e===Xd)return t;if(e===null)return e;if(t===null)return null;const i=lc(e),n=lc(t),o=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 d=0;d>>1;let r=wn.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&&(o=yo.getLanguageId(n[1])!==e),!o)return Xd}if(!n||n.length===0){const o=new Uint32Array(2);return o[0]=t,o[1]=C8(e),o.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]=Ml.delete(this._lineTokens[t],e.startColumn-1,e.endColumn-1);return}this._lineTokens[t]=Ml.deleteEnding(this._lineTokens[t],e.startColumn-1);const i=e.endLineNumber-1;let n=null;i=this._len)){if(t===0){this._lineTokens[n]=Ml.insert(this._lineTokens[n],e.column-1,i);return}this._lineTokens[n]=Ml.deleteEnding(this._lineTokens[n],e.column-1),this._lineTokens[n]=Ml.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,o=e.length;n>>0}class eO{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){this._pieces=e||[],this._isComplete=t}setPartial(e,t){let i=e;if(t.length>0){const o=t[0].getRange(),r=t[t.length-1].getRange();if(!o||!r)return e;i=e.plusRange(o).plusRange(r)}let n=null;for(let o=0,r=this._pieces.length;oi.endLineNumber){n=n||{index:o};break}if(a.removeTokens(i),a.isEmpty()){this._pieces.splice(o,1),o--,r--;continue}if(a.endLineNumberi.endLineNumber){n=n||{index:o};continue}const[l,d]=a.split(i);if(l.isEmpty()){n=n||{index:o};continue}d.isEmpty()||(this._pieces.splice(o,1,l,d),o++,r++,n=n||{index:o})}return n=n||{index:this._pieces.length},t.length>0&&(this._pieces=zL(this._pieces,n.index,t)),i}isComplete(){return this._isComplete}addSparseTokens(e,t){if(t.getLineContent().length===0)return t;const i=this._pieces;if(i.length===0)return t;const n=eO._findFirstPieceWithLine(i,e),o=i[n].getLineTokens(e);if(!o)return t;const r=t.getCount(),a=o.getCount();let l=0;const d=[];let c=0,u=0;const h=(g,f)=>{g!==u&&(u=g,d[c++]=g,d[c++]=f)};for(let g=0;g>>0,b=~v>>>0;for(;lt)n=o-1;else{for(;o>i&&e[o-1].startLineNumber<=t&&t<=e[o-1].endLineNumber;)o--;return o}}return i}acceptEdit(e,t,i,n,o){for(const r of this._pieces)r.acceptEdit(e,t,i,n,o)}}class hD extends a${constructor(e,t,i,n,o,r){super(),this._languageService=e,this._languageConfigurationService=t,this._textModel=i,this._bracketPairsTextModelPart=n,this._languageId=o,this._attachedViews=r,this._semanticTokens=new eO(this._languageService.languageIdCodec),this._onDidChangeLanguage=this._register(new B),this.onDidChangeLanguage=this._onDidChangeLanguage.event,this._onDidChangeLanguageConfiguration=this._register(new B),this.onDidChangeLanguageConfiguration=this._onDidChangeLanguageConfiguration.event,this._onDidChangeTokens=this._register(new B),this.onDidChangeTokens=this._onDidChangeTokens.event,this.grammarTokens=this._register(new e_e(this._languageService.languageIdCodec,this._textModel,()=>this._languageId,this._attachedViews)),this._register(this._languageConfigurationService.onDidChange(a=>{a.affects(this._languageId)&&this._onDidChangeLanguageConfiguration.fire({})})),this._register(this.grammarTokens.onDidChangeTokens(a=>{this._emitModelTokensChangedEvent(a)})),this._register(this.grammarTokens.onDidChangeBackgroundTokenizationState(a=>{this._bracketPairsTextModelPart.handleDidChangeBackgroundTokenizationState()}))}handleDidChangeContent(e){if(e.isFlush)this._semanticTokens.flush();else if(!e.isEolChange)for(const t of e.changes){const[i,n,o]=Ah(t.text);this._semanticTokens.acceptEdit(t.range,i,n,o,t.text.length>0?t.text.charCodeAt(0):0)}this.grammarTokens.handleDidChangeContent(e)}handleDidChangeAttached(){this.grammarTokens.handleDidChangeAttached()}getLineTokens(e){this.validateLineNumber(e);const t=this.grammarTokens.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 Ut("Illegal value for lineNumber")}get hasTokens(){return this.grammarTokens.hasTokens}resetTokenization(){this.grammarTokens.resetTokenization()}get backgroundTokenizationState(){return this.grammarTokens.backgroundTokenizationState}forceTokenization(e){this.validateLineNumber(e),this.grammarTokens.forceTokenization(e)}hasAccurateTokensForLine(e){return this.validateLineNumber(e),this.grammarTokens.hasAccurateTokensForLine(e)}isCheapToTokenize(e){return this.validateLineNumber(e),this.grammarTokens.isCheapToTokenize(e)}tokenizeIfCheap(e){this.validateLineNumber(e),this.grammarTokens.tokenizeIfCheap(e)}getTokenTypeIfInsertingCharacter(e,t,i){return this.grammarTokens.getTokenTypeIfInsertingCharacter(e,t,i)}tokenizeLineWithEdit(e,t,i){return this.grammarTokens.tokenizeLineWithEdit(e,t,i)}setSemanticTokens(e,t){this._semanticTokens.set(e,t),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),o=n.findTokenIndexAtOffset(t.column-1),[r,a]=hD._findLanguageBoundaries(n,o),l=Eb(t.column,this.getLanguageConfiguration(n.getLanguageId(o)).getWordDefinition(),i.substring(r,a),r);if(l&&l.startColumn<=e.column&&e.column<=l.endColumn)return l;if(o>0&&r===t.column-1){const[d,c]=hD._findLanguageBoundaries(n,o-1),u=Eb(t.column,this.getLanguageConfiguration(n.getLanguageId(o-1)).getWordDefinition(),i.substring(d,c),d);if(u&&u.startColumn<=e.column&&e.column<=u.endColumn)return u}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 o=e.getLineContent().length;for(let r=t,a=e.getCount();r{const r=this.getLanguageId();o.changedLanguages.indexOf(r)!==-1&&this.resetTokenization()})),this.resetTokenization(),this._register(n.onDidChangeVisibleRanges(({view:o,state:r})=>{if(r){let a=this._attachedViewStates.get(o);a||(a=new t_e(()=>this.refreshRanges(a.lineRanges)),this._attachedViewStates.set(o,a)),a.handleStateChange(r)}else this._attachedViewStates.deleteAndDispose(o)}))}resetTokenization(e=!0){var t;this._tokens.flush(),(t=this._debugBackgroundTokens)===null||t===void 0||t.flush(),this._debugBackgroundStates&&(this._debugBackgroundStates=new qA(this._textModel.getLineCount())),e&&this._onDidChangeTokens.fire({semanticTokensApplied:!1,ranges:[{fromLineNumber:1,toLineNumber:this._textModel.getLineCount()}]});const i=()=>{if(this._textModel.isTooLargeForTokenization())return[null,null];const r=Ki.get(this.getLanguageId());if(!r)return[null,null];let a;try{a=r.getInitialState()}catch(l){return Xe(l),[null,null]}return[r,a]},[n,o]=i();if(n&&o?this._tokenizer=new Xme(this._textModel.getLineCount(),n,this._textModel,this._languageIdCodec):this._tokenizer=null,this._backgroundTokenizer.clear(),this._defaultBackgroundTokenizer=null,this._tokenizer){const r={setTokens:a=>{this.setTokens(a)},backgroundTokenizationFinished:()=>{if(this._backgroundTokenizationState===2)return;const a=2;this._backgroundTokenizationState=a,this._onDidChangeBackgroundTokenizationState.fire()},setEndState:(a,l)=>{var d;if(!this._tokenizer)return;const c=this._tokenizer.store.getFirstInvalidEndStateLineNumber();c!==null&&a>=c&&((d=this._tokenizer)===null||d===void 0||d.store.setEndState(a,l))}};n&&n.createBackgroundTokenizer&&!n.backgroundTokenizerShouldOnlyVerifyTokens&&(this._backgroundTokenizer.value=n.createBackgroundTokenizer(this._textModel,r)),!this._backgroundTokenizer.value&&!this._textModel.isTooLargeForTokenization()&&(this._backgroundTokenizer.value=this._defaultBackgroundTokenizer=new Jme(this._tokenizer,r),this._defaultBackgroundTokenizer.handleChanges()),n!=null&&n.backgroundTokenizerShouldOnlyVerifyTokens&&n.createBackgroundTokenizer?(this._debugBackgroundTokens=new rC(this._languageIdCodec),this._debugBackgroundStates=new qA(this._textModel.getLineCount()),this._debugBackgroundTokenizer.clear(),this._debugBackgroundTokenizer.value=n.createBackgroundTokenizer(this._textModel,{setTokens:a=>{var l;(l=this._debugBackgroundTokens)===null||l===void 0||l.setMultilineTokens(a,this._textModel)},backgroundTokenizationFinished(){},setEndState:(a,l)=>{var d;(d=this._debugBackgroundStates)===null||d===void 0||d.setEndState(a,l)}})):(this._debugBackgroundTokens=void 0,this._debugBackgroundStates=void 0,this._debugBackgroundTokenizer.value=void 0)}this.refreshAllVisibleLineTokens()}handleDidChangeAttached(){var e;(e=this._defaultBackgroundTokenizer)===null||e===void 0||e.handleChanges()}handleDidChangeContent(e){var t,i,n;if(e.isFlush)this.resetTokenization(!1);else if(!e.isEolChange){for(const o of e.changes){const[r,a]=Ah(o.text);this._tokens.acceptEdit(o.range,r,a),(t=this._debugBackgroundTokens)===null||t===void 0||t.acceptEdit(o.range,r,a)}(i=this._debugBackgroundStates)===null||i===void 0||i.acceptChanges(e.changes),this._tokenizer&&this._tokenizer.store.acceptChanges(e.changes),(n=this._defaultBackgroundTokenizer)===null||n===void 0||n.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=Je.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){var i,n;if(!this._tokenizer)return;e=Math.max(1,Math.min(this._textModel.getLineCount(),e)),t=Math.min(this._textModel.getLineCount(),t);const o=new KA,{heuristicTokens:r}=this._tokenizer.tokenizeHeuristically(o,e,t),a=this.setTokens(o.finalize());if(r)for(const l of a.changes)(i=this._backgroundTokenizer.value)===null||i===void 0||i.requestTokens(l.fromLineNumber,l.toLineNumber+1);(n=this._defaultBackgroundTokenizer)===null||n===void 0||n.checkFinished()}forceTokenization(e){var t,i;const n=new KA;(t=this._tokenizer)===null||t===void 0||t.updateTokensUntilLine(n,e),this.setTokens(n.finalize()),(i=this._defaultBackgroundTokenizer)===null||i===void 0||i.checkFinished()}hasAccurateTokensForLine(e){return this._tokenizer?this._tokenizer.hasAccurateTokensForLine(e):!0}isCheapToTokenize(e){return this._tokenizer?this._tokenizer.isCheapToTokenize(e):!0}tokenizeIfCheap(e){this.isCheapToTokenize(e)&&this.forceTokenization(e)}getLineTokens(e){var t;const i=this._textModel.getLineContent(e),n=this._tokens.getTokens(this._textModel.getLanguageId(),e-1,i);if(this._debugBackgroundTokens&&this._debugBackgroundStates&&this._tokenizer&&this._debugBackgroundStates.getFirstInvalidEndStateLineNumberOrMax()>e&&this._tokenizer.store.getFirstInvalidEndStateLineNumberOrMax()>e){const o=this._debugBackgroundTokens.getTokens(this._textModel.getLanguageId(),e-1,i);!n.equals(o)&&(!((t=this._debugBackgroundTokenizer.value)===null||t===void 0)&&t.reportMismatchingTokens)&&this._debugBackgroundTokenizer.value.reportMismatchingTokens(e)}return n}getTokenTypeIfInsertingCharacter(e,t,i){if(!this._tokenizer)return 0;const n=this._textModel.validatePosition(new W(e,t));return this.forceTokenization(n.lineNumber),this._tokenizer.getTokenTypeIfInsertingCharacter(n,i)}tokenizeLineWithEdit(e,t,i){if(!this._tokenizer)return null;const n=this._textModel.validatePosition(e);return this.forceTokenization(n.lineNumber),this._tokenizer.tokenizeLineWithEdit(n,t,i)}get hasTokens(){return this._tokens.hasTokens}}class t_e extends H{get lineRanges(){return this._lineRanges}constructor(e){super(),this._refreshTokens=e,this.runner=this._register(new Wt(()=>this.update(),50)),this._computedLineRanges=[],this._lineRanges=[]}update(){Ci(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()}}const Mx=ut("undoRedoService");class T${constructor(e,t){this.resource=e,this.elements=t}}class w_{constructor(){this.id=w_._ID++,this.order=1}nextOrder(){return this.id===0?0:this.order++}}w_._ID=0;w_.None=new w_;class $l{constructor(){this.id=$l._ID++,this.order=1}nextOrder(){return this.id===0?0:this.order++}}$l._ID=0;$l.None=new $l;var i_e=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},xI=function(s,e){return function(t,i){e(t,i,s)}},Tg;function n_e(s){const e=new I$;return e.acceptChunk(s),e.finish()}function s_e(s){const e=new I$;let t;for(;typeof(t=s.read())=="string";)e.acceptChunk(t);return e.finish()}function w8(s,e){let t;return typeof s=="string"?t=n_e(s):Ude(s)?t=s_e(s):t=s,t.create(e)}let Pw=0;const o_e=999,r_e=1e4;class a_e{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 j0=()=>{throw new Error("Invalid change accessor")};let wd=Tg=class extends H{static resolveOptions(e,t){if(t.detectIndentation){const i=h8(e,t.tabSize,t.insertSpaces);return new Vy({tabSize:i.tabSize,indentSize:"tabSize",insertSpaces:i.insertSpaces,trimAutoWhitespace:t.trimAutoWhitespace,defaultEOL:t.defaultEOL,bracketPairColorizationOptions:t.bracketPairColorizationOptions})}return new Vy(t)}get onDidChangeLanguage(){return this._tokenizationTextModelPart.onDidChangeLanguage}get onDidChangeLanguageConfiguration(){return this._tokenizationTextModelPart.onDidChangeLanguageConfiguration}get onDidChangeTokens(){return this._tokenizationTextModelPart.onDidChangeTokens}onDidChangeContent(e){return this._eventEmitter.slowEvent(t=>e(t.contentChangedEvent))}onDidChangeContentOrInjectedText(e){return ha(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,o,r,a){super(),this._undoRedoService=o,this._languageService=r,this._languageConfigurationService=a,this._onWillDispose=this._register(new B),this.onWillDispose=this._onWillDispose.event,this._onDidChangeDecorations=this._register(new g_e(g=>this.handleBeforeFireDecorationsChangedEvent(g))),this.onDidChangeDecorations=this._onDidChangeDecorations.event,this._onDidChangeOptions=this._register(new B),this.onDidChangeOptions=this._onDidChangeOptions.event,this._onDidChangeAttached=this._register(new B),this.onDidChangeAttached=this._onDidChangeAttached.event,this._onDidChangeInjectedText=this._register(new B),this._eventEmitter=this._register(new f_e),this._languageSelectionListener=this._register(new $n),this._deltaDecorationCallCnt=0,this._attachedViews=new p_e,Pw++,this.id="$model"+Pw,this.isForSimpleWidget=i.isForSimpleWidget,typeof n>"u"||n===null?this._associatedResource=Ae.parse("inmemory://model/"+Pw):this._associatedResource=n,this._attachedEditorCount=0;const{textBuffer:l,disposable:d}=w8(e,i.defaultEOL);this._buffer=l,this._bufferDisposable=d,this._options=Tg.resolveOptions(this._buffer,i);const c=typeof t=="string"?t:t.languageId;typeof t!="string"&&(this._languageSelectionListener.value=t.onDidChange(()=>this._setLanguage(t.languageId))),this._bracketPairs=this._register(new hme(this,this._languageConfigurationService)),this._guidesTextModelPart=this._register(new ope(this,this._languageConfigurationService)),this._decorationProvider=this._register(new fme(this)),this._tokenizationTextModelPart=new hD(this._languageService,this._languageConfigurationService,this,this._bracketPairs,c,this._attachedViews);const u=this._buffer.getLineCount(),h=this._buffer.getValueLengthInRange(new x(1,1,u,this._buffer.getLineLength(u)+1),0);i.largeFileOptimizations?(this._isTooLargeForTokenization=h>Tg.LARGE_FILE_SIZE_THRESHOLD||u>Tg.LARGE_FILE_LINE_COUNT_THRESHOLD,this._isTooLargeForHeapOperation=h>Tg.LARGE_FILE_HEAP_OPERATION_THRESHOLD):(this._isTooLargeForTokenization=!1,this._isTooLargeForHeapOperation=!1),this._isTooLargeForSyncing=h>Tg._MODEL_SYNC_LIMIT,this._versionId=1,this._alternativeVersionId=1,this._initialUndoRedoSnapshot=null,this._isDisposed=!1,this.__isDisposing=!1,this._instanceId=dz(Pw),this._lastDecorationId=0,this._decorations=Object.create(null),this._decorationsTree=new y8,this._commandManager=new XF(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(c)}dispose(){this.__isDisposing=!0,this._onWillDispose.fire(),this._tokenizationTextModelPart.dispose(),this._isDisposed=!0,super.dispose(),this._bufferDisposable.dispose(),this.__isDisposing=!1;const e=new zm([],"",` `,!1,!1,!0,!0);e.dispose(),this._buffer=e,this._bufferDisposable=H.None}_assertNotDisposed(){if(this._isDisposed)throw new Error("Model is disposed!")}_emitContentChangedEvent(e,t){this.__isDisposing||(this._tokenizationTextModelPart.handleDidChangeContent(t),this._bracketPairs.handleDidChangeContent(t),this._eventEmitter.fire(new cf(e,t)))}setValue(e){if(this._assertNotDisposed(),e==null)throw Mr();const{textBuffer:t,disposable:i}=w8(e,this._options.defaultEOL);this._setValueFromTextBuffer(t,i)}_createContentChanged2(e,t,i,n,o,r,a,l){return{changes:[{range:e,rangeOffset:t,rangeLength:i,text:n}],eol:this._buffer.getEOL(),isEolChange:l,versionId:this.getVersionId(),isUndoing:o,isRedoing:r,isFlush:a}}_setValueFromTextBuffer(e,t){this._assertNotDisposed();const i=this.getFullModelRange(),n=this.getValueLengthInRange(i),o=this.getLineCount(),r=this.getLineMaxColumn(o);this._buffer=e,this._bufferDisposable.dispose(),this._bufferDisposable=t,this._increaseVersionId(),this._decorations=Object.create(null),this._decorationsTree=new y8,this._commandManager.clear(),this._trimAutoWhitespaceLines=null,this._emitContentChangedEvent(new Wm([new Ope],this._versionId,!1,!1),this._createContentChanged2(new x(1,1,o,r),0,n,this.getValue(),!1,!1,!0,!1))}setEOL(e){this._assertNotDisposed();const t=e===1?`\r `:` `;if(this._buffer.getEOL()===t)return;const i=this.getFullModelRange(),n=this.getValueLengthInRange(i),o=this.getLineCount(),r=this.getLineMaxColumn(o);this._onBeforeEOLChange(),this._buffer.setEOL(t),this._increaseVersionId(),this._onAfterEOLChange(),this._emitContentChangedEvent(new Wm([new Hpe],this._versionId,!1,!1),this._createContentChanged2(new x(1,1,o,r),0,n,this.getValue(),!1,!1,!1,!0))}_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 o=this._buffer.getLineLength(n);o>=r_e?t+=o:e+=o}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,o=typeof e.trimAutoWhitespace<"u"?e.trimAutoWhitespace:this._options.trimAutoWhitespace,r=typeof e.bracketColorizationOptions<"u"?e.bracketColorizationOptions:this._options.bracketPairColorizationOptions,a=new Vy({tabSize:t,indentSize:i,insertSpaces:n,defaultEOL:this._options.defaultEOL,trimAutoWhitespace:o,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=h8(this._buffer,t,e);this.updateOptions({insertSpaces:i.insertSpaces,tabSize:i.tabSize,indentSize:i.tabSize})}normalizeIndentation(e){return this._assertNotDisposed(),VF(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(az.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 Ut("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 a_e(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 Ut("Illegal value for lineNumber");return this._buffer.getLineContent(e)}getLineLength(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Ut("Illegal value for lineNumber");return this._buffer.getLineLength(e)}getLinesContent(){if(this._assertNotDisposed(),this.isTooLargeForHeapOperation())throw new Ut("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 Ut("Illegal value for lineNumber");return this._buffer.getLineLength(e)+1}getLineFirstNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Ut("Illegal value for lineNumber");return this._buffer.getLineFirstNonWhitespaceColumn(e)}getLineLastNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Ut("Illegal value for lineNumber");return this._buffer.getLineLastNonWhitespaceColumn(e)}_validateRangeRelaxedNoAllocations(e){const t=this._buffer.getLineCount(),i=e.startLineNumber,n=e.startColumn;let o=Math.floor(typeof i=="number"&&!isNaN(i)?i:1),r=Math.floor(typeof n=="number"&&!isNaN(n)?n:1);if(o<1)o=1,r=1;else if(o>t)o=t,r=this.getLineMaxColumn(o);else if(r<=1)r=1;else{const u=this.getLineMaxColumn(o);r>=u&&(r=u)}const a=e.endLineNumber,l=e.endColumn;let d=Math.floor(typeof a=="number"&&!isNaN(a)?a:1),c=Math.floor(typeof l=="number"&&!isNaN(l)?l:1);if(d<1)d=1,c=1;else if(d>t)d=t,c=this.getLineMaxColumn(d);else if(c<=1)c=1;else{const u=this.getLineMaxColumn(d);c>=u&&(c=u)}return i===o&&n===r&&a===d&&l===c&&e instanceof x&&!(e instanceof we)?e:new x(o,r,d,c)}_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 o=this.getLineMaxColumn(e);if(t>o)return!1;if(i===1){const r=this._buffer.getLineCharCode(e,t-2);if(Cn(r))return!1}return!0}_validatePosition(e,t,i){const n=Math.floor(typeof e=="number"&&!isNaN(e)?e:1),o=Math.floor(typeof t=="number"&&!isNaN(t)?t:1),r=this._buffer.getLineCount();if(n<1)return new W(1,1);if(n>r)return new W(r,this.getLineMaxColumn(r));if(o<=1)return new W(n,1);const a=this.getLineMaxColumn(n);if(o>=a)return new W(n,a);if(i===1){const l=this._buffer.getLineCharCode(n,o-2);if(Cn(l))return new W(n,o-1)}return new W(n,o)}validatePosition(e){return this._assertNotDisposed(),e instanceof W&&this._isValidPosition(e.lineNumber,e.column,1)?e:this._validatePosition(e.lineNumber,e.column,1)}_isValidRange(e,t){const i=e.startLineNumber,n=e.startColumn,o=e.endLineNumber,r=e.endColumn;if(!this._isValidPosition(i,n,0)||!this._isValidPosition(o,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(o)?this._buffer.getLineCharCode(o,r-2):0,d=Cn(a),c=Cn(l);return!d&&!c}return!0}validateRange(e){if(this._assertNotDisposed(),e instanceof x&&!(e instanceof we)&&this._isValidRange(e,1))return e;const i=this._validatePosition(e.startLineNumber,e.startColumn,0),n=this._validatePosition(e.endLineNumber,e.endColumn,0),o=i.lineNumber,r=i.column,a=n.lineNumber,l=n.column;{const d=r>1?this._buffer.getLineCharCode(o,r-2):0,c=l>1&&l<=this._buffer.getLineLength(a)?this._buffer.getLineCharCode(a,l-2):0,u=Cn(d),h=Cn(c);return!u&&!h?new x(o,r,a,l):o===a&&r===l?new x(o,r-1,a,l-1):u&&h?new x(o,r-1,a,l+1):u?new x(o,r-1,a,l):new x(o,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 x(1,1,e,this.getLineMaxColumn(e))}findMatchesLineByLine(e,t,i,n){return this._buffer.findMatchesLineByLine(e,t,i,n)}findMatches(e,t,i,n,o,r,a=o_e){this._assertNotDisposed();let l=null;t!==null&&(Array.isArray(t)||(t=[t]),t.every(u=>x.isIRange(u))&&(l=t.map(u=>this.validateRange(u)))),l===null&&(l=[this.getFullModelRange()]),l=l.sort((u,h)=>u.startLineNumber-h.startLineNumber||u.startColumn-h.startColumn);const d=[];d.push(l.reduce((u,h)=>x.areIntersecting(u,h)?u.plusRange(h):(d.push(u),h)));let c;if(!i&&e.indexOf(` `)<0){const h=new Ig(e,i,n,o).parseSearchRequest();if(!h)return[];c=g=>this.findMatchesLineByLine(g,h,r,a)}else c=u=>_w.findMatches(this,new Ig(e,i,n,o),u,r,a);return d.map(c).reduce((u,h)=>u.concat(h),[])}findNextMatch(e,t,i,n,o,r){this._assertNotDisposed();const a=this.validatePosition(t);if(!i&&e.indexOf(` `)<0){const d=new Ig(e,i,n,o).parseSearchRequest();if(!d)return null;const c=this.getLineCount();let u=new x(a.lineNumber,a.column,c,this.getLineMaxColumn(c)),h=this.findMatchesLineByLine(u,d,r,1);return _w.findNextMatch(this,new Ig(e,i,n,o),a,r),h.length>0||(u=new x(1,1,a.lineNumber,this.getLineMaxColumn(a.lineNumber)),h=this.findMatchesLineByLine(u,d,r,1),h.length>0)?h[0]:null}return _w.findNextMatch(this,new Ig(e,i,n,o),a,r)}findPreviousMatch(e,t,i,n,o,r){this._assertNotDisposed();const a=this.validatePosition(t);return _w.findPreviousMatch(this,new Ig(e,i,n,o),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 sI?e:new sI(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(a.range),text:a.text}));let r=!0;if(e)for(let a=0,l=e.length;ad.endLineNumber,m=d.startLineNumber>g.endLineNumber;if(!f&&!m){c=!0;break}}if(!c){r=!1;break}}if(r)for(let a=0,l=this._trimAutoWhitespaceLines.length;af.endLineNumber)&&!(d===f.startLineNumber&&f.startColumn===c&&f.isEmpty()&&m&&m.length>0&&m.charAt(0)===` `)&&!(d===f.startLineNumber&&f.startColumn===1&&f.isEmpty()&&m&&m.length>0&&m.charAt(m.length-1)===` `)){u=!1;break}}if(u){const h=new x(d,1,d,c);t.push(new sI(null,h,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)}_applyUndo(e,t,i,n){const o=e.map(r=>{const a=this.getPositionAt(r.newPosition),l=this.getPositionAt(r.newEnd);return{range:new x(a.lineNumber,a.column,l.lineNumber,l.column),text:r.oldText}});this._applyUndoRedoEdits(o,t,!0,!1,i,n)}_applyRedo(e,t,i,n){const o=e.map(r=>{const a=this.getPositionAt(r.oldPosition),l=this.getPositionAt(r.oldEnd);return{range:new x(a.lineNumber,a.column,l.lineNumber,l.column),text:r.newText}});this._applyUndoRedoEdits(o,t,!1,!0,i,n)}_applyUndoRedoEdits(e,t,i,n,o,r){try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._isUndoing=i,this._isRedoing=n,this.applyEdits(e,!1),this.setEOL(t),this._overwriteAlternativeVersionId(o)}finally{this._isUndoing=!1,this._isRedoing=!1,this._eventEmitter.endDeferredEmit(r),this._onDidChangeDecorations.endDeferredEmit()}}applyEdits(e,t=!1){try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit();const i=this._validateEditOperations(e);return this._doApplyEdits(i,t)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}}_doApplyEdits(e,t){const i=this._buffer.getLineCount(),n=this._buffer.applyEdits(e,this._options.trimAutoWhitespace,t),o=this._buffer.getLineCount(),r=n.changes;if(this._trimAutoWhitespaceLines=n.trimAutoWhitespaceLineNumbers,r.length!==0){for(let d=0,c=r.length;d=0;I--){const O=g+I,R=C+I;k.takeFromEndWhile(F=>F.lineNumber>R);const P=k.takeFromEndWhile(F=>F.lineNumber===R);a.push(new n8(O,this.getLineContent(R),P))}if(vpe.lineNumberpe.lineNumber===J)}a.push(new Wpe(O+1,g+_,V,F))}l+=b}this._emitContentChangedEvent(new Wm(a,this.getVersionId(),this._isUndoing,this._isRedoing),{changes:r,eol:this._buffer.getEOL(),isEolChange:!1,versionId:this.getVersionId(),isUndoing:this._isUndoing,isRedoing:this._isRedoing,isFlush:!1})}return n.reverseEdits===null?void 0:n.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){if(e===null||e.size===0)return;const i=Array.from(e).map(n=>new n8(n,this.getLineContent(n),this._getInjectedTextInLine(n)));this._onDidChangeInjectedText.fire(new c$(i))}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:(o,r)=>this._deltaDecorationsImpl(e,[],[{range:o,options:r}])[0],changeDecoration:(o,r)=>{this._changeDecorationImpl(o,r)},changeDecorationOptions:(o,r)=>{this._changeDecorationOptionsImpl(o,D8(r))},removeDecoration:o=>{this._deltaDecorationsImpl(e,[o],[])},deltaDecorations:(o,r)=>o.length===0&&r.length===0?[]:this._deltaDecorationsImpl(e,o,r)};let n=null;try{n=t(i)}catch(o){Xe(o)}return i.addDecoration=j0,i.changeDecoration=j0,i.changeDecorationOptions=j0,i.removeDecoration=j0,i.deltaDecorations=j0,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."),Xe(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:S8[i]}],!0)[0]:null;if(!t)return this._decorationsTree.delete(n),delete this._decorations[n.id],null;const o=this._validateRangeRelaxedNoAllocations(t),r=this._buffer.getOffsetAt(o.startLineNumber,o.startColumn),a=this._buffer.getOffsetAt(o.endLineNumber,o.endColumn);return this._decorationsTree.delete(n),n.reset(this.getVersionId(),r,a,o),n.setOptions(S8[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)}getLinesDecorations(e,t,i=0,n=!1,o=!1){const r=this.getLineCount(),a=Math.min(r,Math.max(1,e)),l=Math.min(r,Math.max(1,t)),d=this.getLineMaxColumn(l),c=new x(a,1,l,d),u=this._getDecorationsInRange(c,i,n,o);return qT(u,this._decorationProvider.getDecorationsInRange(c,i,n)),u}getDecorationsInRange(e,t=0,i=!1,n=!1,o=!1){const r=this.validateRange(e),a=this._getDecorationsInRange(r,t,i,o);return qT(a,this._decorationProvider.getDecorationsInRange(r,t,i,n)),a}getOverviewRulerDecorations(e=0,t=!1){return this._decorationsTree.getAll(this,e,t,!0,!1)}getInjectedTextDecorations(e=0){return this._decorationsTree.getAllInjectedText(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 al.fromDecorations(n).filter(o=>o.lineNumber===e)}getAllDecorations(e=0,t=!1){let i=this._decorationsTree.getAll(this,e,t,!1,!1);return i=i.concat(this._decorationProvider.getAllDecorations(e,t)),i}getAllMarginDecorations(e=0){return this._decorationsTree.getAll(this,e,!1,!1,!0)}_getDecorationsInRange(e,t,i,n){const o=this._buffer.getOffsetAt(e.startLineNumber,e.startColumn),r=this._buffer.getOffsetAt(e.endLineNumber,e.endColumn);return this._decorationsTree.getAllInInterval(this,o,r,t,i,n)}getRangeAt(e,t){return this._buffer.getRangeAt(e,t-e)}_changeDecorationImpl(e,t){const i=this._decorations[e];if(!i)return;if(i.options.after){const a=this.getDecorationRange(e);this._onDidChangeDecorations.recordLineAffectedByInjectedText(a.endLineNumber)}if(i.options.before){const a=this.getDecorationRange(e);this._onDidChangeDecorations.recordLineAffectedByInjectedText(a.startLineNumber)}const n=this._validateRangeRelaxedNoAllocations(t),o=this._buffer.getOffsetAt(n.startLineNumber,n.startColumn),r=this._buffer.getOffsetAt(n.endLineNumber,n.endColumn);this._decorationsTree.delete(i),i.reset(this.getVersionId(),o,r,n),this._decorationsTree.insert(i),this._onDidChangeDecorations.checkAffectedAndFire(i.options),i.options.after&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(n.endLineNumber),i.options.before&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(n.startLineNumber)}_changeDecorationOptionsImpl(e,t){const i=this._decorations[e];if(!i)return;const n=!!(i.options.overviewRuler&&i.options.overviewRuler.color),o=!!(t.overviewRuler&&t.overviewRuler.color);if(this._onDidChangeDecorations.checkAffectedAndFire(i.options),this._onDidChangeDecorations.checkAffectedAndFire(t),i.options.after||t.after){const l=this._decorationsTree.getNodeRange(this,i);this._onDidChangeDecorations.recordLineAffectedByInjectedText(l.endLineNumber)}if(i.options.before||t.before){const l=this._decorationsTree.getNodeRange(this,i);this._onDidChangeDecorations.recordLineAffectedByInjectedText(l.startLineNumber)}const r=n!==o,a=d_e(t)!==Xy(i);r||a?(this._decorationsTree.delete(i),i.setOptions(t),this._decorationsTree.insert(i)):i.setOptions(t)}_deltaDecorationsImpl(e,t,i,n=!1){const o=this.getVersionId(),r=t.length;let a=0;const l=i.length;let d=0;this._onDidChangeDecorations.beginDeferredEmit();try{const c=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 l_e(this.getLineContent(e))+1}};wd._MODEL_SYNC_LIMIT=50*1024*1024;wd.LARGE_FILE_SIZE_THRESHOLD=20*1024*1024;wd.LARGE_FILE_LINE_COUNT_THRESHOLD=300*1e3;wd.LARGE_FILE_HEAP_OPERATION_THRESHOLD=256*1024*1024;wd.DEFAULT_CREATION_OPTIONS={isForSimpleWidget:!1,tabSize:ns.tabSize,indentSize:ns.indentSize,insertSpaces:ns.insertSpaces,detectIndentation:!1,defaultEOL:1,trimAutoWhitespace:ns.trimAutoWhitespace,largeFileOptimizations:ns.largeFileOptimizations,bracketPairColorizationOptions:ns.bracketPairColorizationOptions};wd=Tg=i_e([xI(4,Mx),xI(5,vi),xI(6,Yt)],wd);function l_e(s){let e=0;for(const t of s)if(t===" "||t===" ")e++;else break;return e}function kI(s){return!!(s.options.overviewRuler&&s.options.overviewRuler.color)}function d_e(s){return!!s.after||!!s.before}function Xy(s){return!!s.options.after||!!s.options.before}class y8{constructor(){this._decorationsTree0=new SI,this._decorationsTree1=new SI,this._injectedTextDecorationsTree=new SI}ensureAllNodesHaveRanges(e){this.getAll(e,0,!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,o,r){const a=e.getVersionId(),l=this._intervalSearch(t,i,n,o,a,r);return this._ensureNodesHaveRanges(e,l)}_intervalSearch(e,t,i,n,o,r){const a=this._decorationsTree0.intervalSearch(e,t,i,n,o,r),l=this._decorationsTree1.intervalSearch(e,t,i,n,o,r),d=this._injectedTextDecorationsTree.intervalSearch(e,t,i,n,o,r);return a.concat(l).concat(d)}getInjectedTextInInterval(e,t,i,n){const o=e.getVersionId(),r=this._injectedTextDecorationsTree.intervalSearch(t,i,n,!1,o,!1);return this._ensureNodesHaveRanges(e,r).filter(a=>a.options.showIfCollapsed||!a.range.isEmpty())}getAllInjectedText(e,t){const i=e.getVersionId(),n=this._injectedTextDecorationsTree.search(t,!1,i,!1);return this._ensureNodesHaveRanges(e,n).filter(o=>o.options.showIfCollapsed||!o.range.isEmpty())}getAll(e,t,i,n,o){const r=e.getVersionId(),a=this._search(t,i,n,r,o);return this._ensureNodesHaveRanges(e,a)}_search(e,t,i,n,o){if(i)return this._decorationsTree1.search(e,t,n,o);{const r=this._decorationsTree0.search(e,t,n,o),a=this._decorationsTree1.search(e,t,n,o),l=this._injectedTextDecorationsTree.search(e,t,n,o);return r.concat(a).concat(l)}}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){Xy(e)?this._injectedTextDecorationsTree.insert(e):kI(e)?this._decorationsTree1.insert(e):this._decorationsTree0.insert(e)}delete(e){Xy(e)?this._injectedTextDecorationsTree.delete(e):kI(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){Xy(e)?this._injectedTextDecorationsTree.resolveNode(e,t):kI(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 wl(s){return s.replace(/[^a-z0-9\-_]/gi," ")}class N${constructor(e){this.color=e.color||"",this.darkColor=e.darkColor||""}}class c_e extends N${constructor(e){super(e),this._resolvedColor=null,this.position=typeof e.position=="number"?e.position:Br.Center}getColor(e){return this._resolvedColor||(e.type!=="light"&&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 u_e{constructor(e){var t;this.position=(t=e==null?void 0:e.position)!==null&&t!==void 0?t:bd.Center,this.persistLane=e==null?void 0:e.persistLane}}class h_e extends N${constructor(e){var t,i;super(e),this.position=e.position,this.sectionHeaderStyle=(t=e.sectionHeaderStyle)!==null&&t!==void 0?t:null,this.sectionHeaderText=(i=e.sectionHeaderText)!==null&&i!==void 0?i:null}getColor(e){return this._resolvedColor||(e.type!=="light"&&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"?$.fromHex(e):t.getColor(e.id)}}class Ph{static from(e){return e instanceof Ph?e:new Ph(e)}constructor(e){this.content=e.content||"",this.inlineClassName=e.inlineClassName||null,this.inlineClassNameAffectsLetterSpacing=e.inlineClassNameAffectsLetterSpacing||!1,this.attachedData=e.attachedData||null,this.cursorStops=e.cursorStops||null}}class Ye{static register(e){return new Ye(e)}static createDynamic(e){return new Ye(e)}constructor(e){var t,i,n,o,r,a;this.description=e.description,this.blockClassName=e.blockClassName?wl(e.blockClassName):null,this.blockDoesNotCollapse=(t=e.blockDoesNotCollapse)!==null&&t!==void 0?t:null,this.blockIsAfterEnd=(i=e.blockIsAfterEnd)!==null&&i!==void 0?i:null,this.blockPadding=(n=e.blockPadding)!==null&&n!==void 0?n:null,this.stickiness=e.stickiness||0,this.zIndex=e.zIndex||0,this.className=e.className?wl(e.className):null,this.shouldFillLineOnLineBreak=(o=e.shouldFillLineOnLineBreak)!==null&&o!==void 0?o:null,this.hoverMessage=e.hoverMessage||null,this.glyphMarginHoverMessage=e.glyphMarginHoverMessage||null,this.lineNumberHoverMessage=e.lineNumberHoverMessage||null,this.isWholeLine=e.isWholeLine||!1,this.showIfCollapsed=e.showIfCollapsed||!1,this.collapseOnReplaceEdit=e.collapseOnReplaceEdit||!1,this.overviewRuler=e.overviewRuler?new c_e(e.overviewRuler):null,this.minimap=e.minimap?new h_e(e.minimap):null,this.glyphMargin=e.glyphMarginClassName?new u_e(e.glyphMargin):null,this.glyphMarginClassName=e.glyphMarginClassName?wl(e.glyphMarginClassName):null,this.linesDecorationsClassName=e.linesDecorationsClassName?wl(e.linesDecorationsClassName):null,this.lineNumberClassName=e.lineNumberClassName?wl(e.lineNumberClassName):null,this.linesDecorationsTooltip=e.linesDecorationsTooltip?xre(e.linesDecorationsTooltip):null,this.firstLineDecorationClassName=e.firstLineDecorationClassName?wl(e.firstLineDecorationClassName):null,this.marginClassName=e.marginClassName?wl(e.marginClassName):null,this.inlineClassName=e.inlineClassName?wl(e.inlineClassName):null,this.inlineClassNameAffectsLetterSpacing=e.inlineClassNameAffectsLetterSpacing||!1,this.beforeContentClassName=e.beforeContentClassName?wl(e.beforeContentClassName):null,this.afterContentClassName=e.afterContentClassName?wl(e.afterContentClassName):null,this.after=e.after?Ph.from(e.after):null,this.before=e.before?Ph.from(e.before):null,this.hideInCommentTokens=(r=e.hideInCommentTokens)!==null&&r!==void 0?r:!1,this.hideInStringTokens=(a=e.hideInStringTokens)!==null&&a!==void 0?a:!1}}Ye.EMPTY=Ye.register({description:"empty"});const S8=[Ye.register({description:"tracked-range-always-grows-when-typing-at-edges",stickiness:0}),Ye.register({description:"tracked-range-never-grows-when-typing-at-edges",stickiness:1}),Ye.register({description:"tracked-range-grows-only-when-typing-before",stickiness:2}),Ye.register({description:"tracked-range-grows-only-when-typing-after",stickiness:3})];function D8(s){return s instanceof Ye?s:Ye.createDynamic(s)}class g_e extends H{constructor(e){super(),this.handleBeforeFire=e,this._actual=this._register(new B),this.event=this._actual.event,this._affectedInjectedTextLines=null,this._deferredCnt=0,this._shouldFireDeferred=!1,this._affectsMinimap=!1,this._affectsOverviewRuler=!1,this._affectsGlyphMargin=!1,this._affectsLineNumber=!1}beginDeferredEmit(){this._deferredCnt++}endDeferredEmit(){var e;this._deferredCnt--,this._deferredCnt===0&&(this._shouldFireDeferred&&this.doFire(),(e=this._affectedInjectedTextLines)===null||e===void 0||e.clear(),this._affectedInjectedTextLines=null)}recordLineAffectedByInjectedText(e){this._affectedInjectedTextLines||(this._affectedInjectedTextLines=new Set),this._affectedInjectedTextLines.add(e)}checkAffectedAndFire(e){var t,i;this._affectsMinimap||(this._affectsMinimap=!!(!((t=e.minimap)===null||t===void 0)&&t.position)),this._affectsOverviewRuler||(this._affectsOverviewRuler=!!(!((i=e.overviewRuler)===null||i===void 0)&&i.color)),this._affectsGlyphMargin||(this._affectsGlyphMargin=!!e.glyphMarginClassName),this._affectsLineNumber||(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);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 f_e extends H{constructor(){super(),this._fastEmitter=this._register(new B),this.fastEvent=this._fastEmitter.event,this._slowEmitter=this._register(new B),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)}}class p_e{constructor(){this._onDidChangeVisibleRanges=new B,this.onDidChangeVisibleRanges=this._onDidChangeVisibleRanges.event,this._views=new Set}attachView(){const e=new m_e(t=>{this._onDidChangeVisibleRanges.fire({view:e,state:t})});return this._views.add(e),e}detachView(e){this._views.delete(e),this._onDidChangeVisibleRanges.fire({view:e,state:void 0})}}class m_e{constructor(e){this.handleStateChange=e}setVisibleLines(e,t){const i=e.map(n=>new Je(n.startLineNumber,n.endLineNumber+1));this.handleStateChange({visibleLineRanges:i,stabilized:t})}}class tO{static create(e){return new tO(e.get(134),e.get(133))}constructor(e,t){this.classifier=new __e(e,t)}createLineBreaksComputer(e,t,i,n,o){const r=[],a=[],l=[];return{addRequest:(d,c,u)=>{r.push(d),a.push(c),l.push(u)},finalize:()=>{const d=e.typicalFullwidthCharacterWidth/e.typicalHalfwidthCharacterWidth,c=[];for(let u=0,h=r.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 GA=[],ZA=[];function v_e(s,e,t,i,n,o,r,a){if(n===-1)return null;const l=t.length;if(l<=1)return null;const d=a==="keepAll",c=e.breakOffsets,u=e.breakOffsetsVisibleColumn,h=A$(t,i,n,o,r),g=n-h,f=GA,m=ZA;let _=0,v=0,b=0,C=n;const w=c.length;let y=0;if(y>=0){let D=Math.abs(u[y]-C);for(;y+1=D)break;D=L,y++}}for(;yD&&(D=v,L=b);let k=0,I=0,O=0,R=0;if(L<=C){let F=L,V=D===0?0:t.charCodeAt(D-1),U=D===0?0:s.get(V),J=!0;for(let pe=D;pev&&XA(V,U,ge,We,d)&&(k=De,I=F),F+=ye,F>C){De>v?(O=De,R=F-ye):(O=pe+1,R=F),F-I>g&&(k=0),J=!1;break}V=ge,U=We}if(J){_>0&&(f[_]=c[c.length-1],m[_]=u[c.length-1],_++);break}}if(k===0){let F=L,V=t.charCodeAt(D),U=s.get(V),J=!1;for(let pe=D-1;pe>=v;pe--){const De=pe+1,ge=t.charCodeAt(pe);if(ge===9){J=!0;break}let We,ye;if(Cf(ge)?(pe--,We=0,ye=2):(We=s.get(ge),ye=Dh(ge)?o:1),F<=C){if(O===0&&(O=De,R=F),F<=C-g)break;if(XA(ge,We,V,U,d)){k=De,I=F;break}}F-=ye,V=ge,U=We}if(k!==0){const pe=g-(R-I);if(pe<=i){const De=t.charCodeAt(O);let ge;Cn(De)?ge=2:ge=ib(De,R,i,o),pe-ge<0&&(k=0)}}if(J){y--;continue}}if(k===0&&(k=O,I=R),k<=v){const F=t.charCodeAt(v);Cn(F)?(k=v+2,I=b+2):(k=v+1,I=b+ib(F,b,i,o))}for(v=k,f[_]=k,b=I,m[_]=I,_++,C=I+g;y<0||y=P)break;P=F,y++}}return _===0?null:(f.length=_,m.length=_,GA=e.breakOffsets,ZA=e.breakOffsetsVisibleColumn,e.breakOffsets=f,e.breakOffsetsVisibleColumn=m,e.wrappedTextIndentLength=h,e)}function b_e(s,e,t,i,n,o,r,a){const l=al.applyInjectedText(e,t);let d,c;if(t&&t.length>0?(d=t.map(I=>I.options),c=t.map(I=>I.column-1)):(d=null,c=null),n===-1)return d?new Yv(c,d,[l.length],[],0):null;const u=l.length;if(u<=1)return d?new Yv(c,d,[l.length],[],0):null;const h=a==="keepAll",g=A$(l,i,n,o,r),f=n-g,m=[],_=[];let v=0,b=0,C=0,w=n,y=l.charCodeAt(0),D=s.get(y),L=ib(y,0,i,o),k=1;Cn(y)&&(L+=1,y=l.charCodeAt(1),D=s.get(y),k++);for(let I=k;Iw&&((b===0||L-C>f)&&(b=O,C=L-F),m[v]=b,_[v]=C,v++,w=C+f,b=0),y=R,D=P}return v===0&&(!t||t.length===0)?null:(m[v]=u,_[v]=L,new Yv(c,d,m,_,g))}function ib(s,e,t,i){return s===9?t-e%t:Dh(s)||s<32?i:1}function L8(s,e){return e-s%e}function XA(s,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 A$(s,e,t,i,n){let o=0;if(n!==0){const r=Cs(s);if(r!==-1){for(let l=0;lt&&(o=0)}}return o}class gD{constructor(e){this._selTrackedRange=null,this._trackSelection=!0,this._setState(e,new Wn(new x(1,1,1,1),0,0,new W(1,1),0),new Wn(new x(1,1,1,1),0,0,new W(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 wt(this.modelState,this.viewState)}readSelectionFromMarkers(e){const t=e.model._getTrackedRange(this._selTrackedRange);return this.modelState.selection.isEmpty()&&!t.isEmpty()?we.fromRange(t.collapseToEnd(),this.modelState.selection.getDirection()):we.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(),o=t.selectionStart.getEndPosition(),r=e.normalizePosition(i,2),a=this._validatePositionWithCache(e,n,i,r),l=this._validatePositionWithCache(e,o,n,a);return i.equals(r)&&n.equals(a)&&o.equals(l)?t:new Wn(x.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=gD._validateViewState(e.viewModel,i)),t){const n=e.model.validateRange(t.selectionStart),o=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,o,r,a)}else{if(!i)return;const n=e.model.validateRange(e.coordinatesConverter.convertViewRangeToModelRange(i.selectionStart)),o=e.model.validatePosition(e.coordinatesConverter.convertViewPositionToModelPosition(i.position));t=new Wn(n,i.selectionStartKind,i.selectionStartLeftoverVisibleColumns,o,i.leftoverVisibleColumns)}if(i){const n=e.coordinatesConverter.validateViewRange(i.selectionStart,t.selectionStart),o=e.coordinatesConverter.validateViewPosition(i.position,t.position);i=new Wn(n,t.selectionStartKind,t.selectionStartLeftoverVisibleColumns,o,t.leftoverVisibleColumns)}else{const n=e.coordinatesConverter.convertModelPositionToViewPosition(new W(t.selectionStart.startLineNumber,t.selectionStart.startColumn)),o=e.coordinatesConverter.convertModelPositionToViewPosition(new W(t.selectionStart.endLineNumber,t.selectionStart.endColumn)),r=new x(n.lineNumber,n.column,o.lineNumber,o.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 x8{constructor(e){this.context=e,this.cursors=[new gD(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 ece(this.cursors,ao(e=>e.viewState.position,W.compare)).viewState.position}getBottomMostViewPosition(){return Jde(this.cursors,ao(e=>e.viewState.position,W.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(wt.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 o=0;o=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,x.compareRangesUsingStarts));for(let i=0;iu&&m.index--;e.splice(u,1),t.splice(c,1),this._removeSecondaryCursor(u-1),i--}}}}class k8{constructor(e,t,i,n){this._cursorContextBrand=void 0,this.model=e,this.viewModel=t,this.coordinatesConverter=i,this.cursorConfig=n}}class C_e{constructor(){this.type=0}}class w_e{constructor(){this.type=1}}class y_e{constructor(e){this.type=2,this._source=e}hasChanged(e){return this._source.hasChanged(e)}}class S_e{constructor(e,t,i){this.selections=e,this.modelSelections=t,this.reason=i,this.type=3}}class vg{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 Fw{constructor(){this.type=5}}class D_e{constructor(e){this.type=6,this.isFocused=e}}class L_e{constructor(){this.type=7}}class Ow{constructor(){this.type=8}}class M${constructor(e,t){this.fromLineNumber=e,this.count=t,this.type=9}}class YA{constructor(e,t){this.type=10,this.fromLineNumber=e,this.toLineNumber=t}}class QA{constructor(e,t){this.type=11,this.fromLineNumber=e,this.toLineNumber=t}}class nb{constructor(e,t,i,n,o,r,a){this.source=e,this.minimalReveal=t,this.range=i,this.selections=n,this.verticalType=o,this.revealHorizontal=r,this.scrollType=a,this.type=12}}class x_e{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 k_e{constructor(e){this.theme=e,this.type=14}}class E_e{constructor(e){this.type=15,this.ranges=e}}class I_e{constructor(){this.type=16}}let T_e=class{constructor(){this.type=17}};class N_e extends H{constructor(){super(),this._onEvent=this._register(new B),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 A_e{constructor(){this.viewEvents=[],this.outgoingEvents=[]}emitViewEvent(e){this.viewEvents.push(e)}emitOutgoingEvent(e){this.outgoingEvents.push(e)}}class iO{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 iO(this._oldContentWidth,this._oldContentHeight,e.contentWidth,e.contentHeight)}}class nO{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 nO(this.oldHasFocus,e.hasFocus)}}class sO{constructor(e,t,i,n,o,r,a,l){this.kind=2,this._oldScrollWidth=e,this._oldScrollLeft=t,this._oldScrollHeight=i,this._oldScrollTop=n,this.scrollWidth=o,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 sO(this._oldScrollWidth,this._oldScrollLeft,this._oldScrollHeight,this._oldScrollTop,e.scrollWidth,e.scrollLeft,e.scrollHeight,e.scrollTop)}}class M_e{constructor(){this.kind=3}isNoOp(){return!1}attemptToMerge(e){return e.kind!==this.kind?null:this}}class R_e{constructor(){this.kind=4}isNoOp(){return!1}attemptToMerge(e){return e.kind!==this.kind?null:this}}class fD{constructor(e,t,i,n,o,r,a){this.kind=6,this.oldSelections=e,this.selections=t,this.oldModelVersionId=i,this.modelVersionId=n,this.source=o,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 o=0;o0){const e=this._cursors.getSelections();for(let t=0;tr&&(n=n.slice(0,r),o=!0);const a=sb.from(this._model,this);return this._cursors.setStates(n),this._cursors.normalize(),this._columnSelectData=null,this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(e,t,i,a,o)}setCursorColumnSelectData(e){this._columnSelectData=e}revealAll(e,t,i,n,o,r){const a=this._cursors.getViewPositions();let l=null,d=null;a.length>1?d=this._cursors.getViewSelections():l=x.fromPositions(a[0],a[0]),e.emitViewEvent(new nb(t,i,l,d,n,o,r))}revealPrimary(e,t,i,n,o,r){const l=[this._cursors.getPrimaryCursor().viewState.selection];e.emitViewEvent(new nb(t,i,null,l,n,o,r))}saveState(){const e=[],t=this._cursors.getSelections();for(let i=0,n=t.length;i0){const o=wt.fromModelSelections(i.resultingSelection);this.setStates(e,"modelChange",i.isUndoing?5:i.isRedoing?6:2,o)&&this.revealAll(e,"modelChange",!1,0,!0,0)}else{const o=this._cursors.readSelectionFromMarkers();this.setStates(e,"modelChange",2,wt.fromModelSelections(o))}}}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,wt.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(i,n),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,o){const r=sb.from(this._model,this);if(r.equals(n))return!1;const a=this._cursors.getSelections(),l=this._cursors.getViewSelections();if(e.emitViewEvent(new S_e(l,a,i)),!n||n.cursorState.length!==r.cursorState.length||r.cursorState.some((d,c)=>!d.modelState.equals(n.cursorState[c].modelState))){const d=n?n.cursorState.map(u=>u.modelState.selection):null,c=n?n.modelVersionId:0;e.emitOutgoingEvent(new fD(d,a,c,r.modelVersionId,t||"keyboard",i,o))}return!0}_findAutoClosingPairs(e){if(!e.length)return null;const t=[];for(let i=0,n=e.length;i=0)return null;const r=o.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 d=l[0].open,c=o.text.length-r[2].length-1,u=o.text.lastIndexOf(d,c-1);if(u===-1)return null;t.push([u,c])}return t}executeEdits(e,t,i,n){let o=null;t==="snippet"&&(o=this._findAutoClosingPairs(i)),o&&(i[0]._isTracked=!0);const r=[],a=[],l=this._model.pushEditOperations(this.getSelections(),i,d=>{if(o)for(let u=0,h=o.length;u0&&this._pushAutoClosedAction(r,a)}_executeEdit(e,t,i,n=0){if(this.context.cursorConfig.readOnly)return;const o=sb.from(this._model,this);this._cursors.stopTrackingSelections(),this._isHandling=!0;try{this._cursors.ensureValidState(),e()}catch(r){Xe(r)}this._isHandling=!1,this._cursors.startTrackingSelections(),this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(t,i,n,o,!1)&&this.revealAll(t,i,!1,0,!0,0)}getAutoClosedCharacters(){return E8.getAllAutoClosedCharacters(this._autoClosedActions)}startComposition(e){this._compositionState=new ob(this._model,this.getSelections())}endComposition(e,t){const i=this._compositionState?this._compositionState.deduceOutcome(this._model,this.getSelections()):null;this._compositionState=null,this._executeEdit(()=>{t==="keyboard"&&this._executeEditOperation(bi.compositionEndWithInterceptors(this._prevEditOperationType,this.context.cursorConfig,this._model,i,this.getSelections(),this.getAutoClosedCharacters()))},e,t)}type(e,t,i){this._executeEdit(()=>{if(i==="keyboard"){const n=t.length;let o=0;for(;o{const d=l.getPosition();return new we(d.lineNumber,d.column+o,d.lineNumber,d.column+o)});this.setSelections(e,r,a,0)}return}this._executeEdit(()=>{this._executeEditOperation(bi.compositionType(this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),t,i,n,o))},e,r)}paste(e,t,i,n,o){this._executeEdit(()=>{this._executeEditOperation(bi.paste(this.context.cursorConfig,this._model,this.getSelections(),t,i,n||[]))},e,o,4)}cut(e,t){this._executeEdit(()=>{this._executeEditOperation(kf.cut(this.context.cursorConfig,this._model,this.getSelections()))},e,t)}executeCommand(e,t,i){this._executeEdit(()=>{this._cursors.killSecondaryCursors(),this._executeEditOperation(new Js(0,[t],{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))},e,i)}executeCommands(e,t,i){this._executeEdit(()=>{this._executeEditOperation(new Js(0,t,{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))},e,i)}}class sb{static from(e,t){return new sb(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 U_e{static executeCommands(e,t,i){const n={model:e,selectionsBefore:t,trackedRanges:[],trackedRangesDirection:[]},o=this._innerExecuteCommands(n,i);for(let r=0,a=n.trackedRanges.length;r0&&(r[0]._isTracked=!0);let a=e.model.pushEditOperations(e.selectionsBefore,r,d=>{const c=[];for(let g=0;gg.identifier.minor-f.identifier.minor,h=[];for(let g=0;g0?(c[g].sort(u),h[g]=t[g].computeCursorState(e.model,{getInverseEditOperations:()=>c[g],getTrackedSelection:f=>{const m=parseInt(f,10),_=e.model._getTrackedRange(e.trackedRanges[m]);return e.trackedRangesDirection[m]===0?new we(_.startLineNumber,_.startColumn,_.endLineNumber,_.endColumn):new we(_.endLineNumber,_.endColumn,_.startLineNumber,_.startColumn)}})):h[g]=e.selectionsBefore[g];return h});a||(a=e.selectionsBefore);const l=[];for(const d in o)o.hasOwnProperty(d)&&l.push(parseInt(d,10));l.sort((d,c)=>c-d);for(const d of l)a.splice(d,1);return a}static _arrayIsEmpty(e){for(let t=0,i=e.length;t{x.isEmpty(u)&&h===""||n.push({identifier:{major:t,minor:o++},range:u,text:h,forceMoveMarkers:g,isAutoWhitespaceEdit:i.insertsAutoWhitespace})};let a=!1;const c={addEditOperation:r,addTrackedEditOperation:(u,h,g)=>{a=!0,r(u,h,g)},trackSelection:(u,h)=>{const g=we.liftSelection(u);let f;if(g.isEmpty())if(typeof h=="boolean")h?f=2:f=3;else{const v=e.model.getLineMaxColumn(g.startLineNumber);g.startColumn===v?f=2:f=3}else f=1;const m=e.trackedRanges.length,_=e.model._setTrackedRange(null,g,f);return e.trackedRanges[m]=_,e.trackedRangesDirection[m]=g.getDirection(),m.toString()}};try{i.getEditOperations(e.model,c)}catch(u){return Xe(u),{operations:[],hadTrackedEditOperation:!1}}return{operations:n,hadTrackedEditOperation:a}}static _getLoserCursorMap(e){e=e.slice(0),e.sort((i,n)=>-x.compareRangesUsingEnds(i.range,n.range));const t={};for(let i=1;io.identifier.major?r=n.identifier.major:r=o.identifier.major,t[r.toString()]=!0;for(let a=0;a0&&i--}}return t}}class $_e{constructor(e,t,i){this.text=e,this.startSelection=t,this.endSelection=i}}class ob{static _capture(e,t){const i=[];for(const n of t){if(n.startLineNumber!==n.endLineNumber)return null;i.push(new $_e(e.getLineContent(n.startLineNumber),n.startColumn-1,n.endColumn-1))}return i}constructor(e,t){this._original=ob._capture(e,t)}deduceOutcome(e,t){if(!this._original)return null;const i=ob._capture(e,t);if(!i||this._original.length!==i.length)return null;const n=[];for(let o=0,r=this._original.length;oUb,tokenizeEncoded:(s,e,t)=>xF(0,t)};async function j_e(s,e,t){if(!t)return T8(e,s.languageIdCodec,I8);const i=await Ki.getOrCreate(t);return T8(e,s.languageIdCodec,i||I8)}function K_e(s,e,t,i,n,o,r){let a="
",l=i,d=0,c=!0;for(let u=0,h=e.getCount();u0;)r&&c?(f+=" ",c=!1):(f+=" ",c=!0),_--;break}case 60:f+="<",c=!1;break;case 62:f+=">",c=!1;break;case 38:f+="&",c=!1;break;case 0:f+="�",c=!1;break;case 65279:case 8232:case 8233:case 133:f+="�",c=!1;break;case 13:f+="​",c=!1;break;case 32:r&&c?(f+=" ",c=!1):(f+=" ",c=!0);break;default:f+=String.fromCharCode(m),c=!1}}if(a+=`${f}`,g>n||l>=n)break}return a+="
",a}function T8(s,e,t){let i='
';const n=Td(s);let o=t.getInitialState();for(let r=0,a=n.length;r0&&(i+="
");const d=t.tokenizeEncoded(l,!0,o);wn.convertToEndOffset(d.tokens,l.length);const u=new wn(d.tokens,l,e).inflate();let h=0;for(let g=0,f=u.getCount();g${OS(l.substring(h,_))}`,h=_}o=d.endState}return i+="
",i}class q_e{constructor(){this._hasPending=!1,this._inserts=[],this._changes=[],this._removes=[]}insert(e){this._hasPending=!0,this._inserts.push(e)}change(e){this._hasPending=!0,this._changes.push(e)}remove(e){this._hasPending=!0,this._removes.push(e)}mustCommit(){return this._hasPending}commit(e){if(!this._hasPending)return;const t=this._inserts,i=this._changes,n=this._removes;this._hasPending=!1,this._inserts=[],this._changes=[],this._removes=[],e._commitPendingChanges(t,i,n)}}class G_e{constructor(e,t,i,n,o){this.id=e,this.afterLineNumber=t,this.ordinal=i,this.height=n,this.minWidth=o,this.prefixSum=0}}let R$=class JA{constructor(e,t,i,n){this._instanceId=dz(++JA.INSTANCE_COUNT),this._pendingChanges=new q_e,this._lastWhitespaceId=0,this._arr=[],this._prefixSumValidIndex=-1,this._minWidth=-1,this._lineCount=e,this._lineHeight=t,this._paddingTop=i,this._paddingBottom=n}static findInsertionIndex(e,t,i){let n=0,o=e.length;for(;n>>1;t===e[r].afterLineNumber?i{t=!0,n=n|0,o=o|0,r=r|0,a=a|0;const l=this._instanceId+ ++this._lastWhitespaceId;return this._pendingChanges.insert(new G_e(l,n,o,r,a)),l},changeOneWhitespace:(n,o,r)=>{t=!0,o=o|0,r=r|0,this._pendingChanges.change({id:n,newAfterLineNumber:o,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 d=this._findWhitespaceIndex(l.id);d!==-1&&this._removeWhitespace(d)}return}const n=new Set;for(const l of i)n.add(l.id);const o=new Map;for(const l of t)o.set(l.id,l);const r=l=>{const d=[];for(const c of l)if(!n.has(c.id)){if(o.has(c.id)){const u=o.get(c.id);c.afterLineNumber=u.newAfterLineNumber,c.height=u.newHeight}d.push(c)}return d},a=r(this._arr).concat(r(e));a.sort((l,d)=>l.afterLineNumber===d.afterLineNumber?l.ordinal-d.ordinal:l.afterLineNumber-d.afterLineNumber),this._arr=a,this._prefixSumValidIndex=-1}_checkPendingChanges(){this._pendingChanges.mustCommit()&&this._pendingChanges.commit(this)}_insertWhitespace(e){const t=JA.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)}}onLinesInserted(e,t){this._checkPendingChanges(),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._lineHeight*(e-1):i=0;const n=this.getWhitespaceAccumulatedHeightBeforeLineNumber(e-(t?1:0));return i+n+this._paddingTop}getVerticalOffsetAfterLineNumber(e,t=!1){this._checkPendingChanges(),e=e|0;const i=this._lineHeight*e,n=this.getWhitespaceAccumulatedHeightBeforeLineNumber(e+(t?1:0));return i+n+this._paddingTop}getWhitespaceMinWidth(){if(this._checkPendingChanges(),this._minWidth===-1){let e=0;for(let t=0,i=this._arr.length;tt}isInTopPadding(e){return this._paddingTop===0?!1:(this._checkPendingChanges(),e=t-this._paddingBottom}getLineNumberAtOrAfterVerticalOffset(e){if(this._checkPendingChanges(),e=e|0,e<0)return 1;const t=this._lineCount|0,i=this._lineHeight;let n=1,o=t;for(;n=a+i)n=r+1;else{if(e>=a)return r;o=r}}return n>t?t:n}getLinesViewportData(e,t){this._checkPendingChanges(),e=e|0,t=t|0;const i=this._lineHeight,n=this.getLineNumberAtOrAfterVerticalOffset(e)|0,o=this.getVerticalOffsetForLineNumber(n)|0;let r=this._lineCount|0,a=this.getFirstWhitespaceIndexAfterLineNumber(n)|0;const l=this.getWhitespacesCount()|0;let d,c;a===-1?(a=l,c=r+1,d=0):(c=this.getAfterLineNumberForWhitespaceIndex(a)|0,d=this.getHeightForWhitespaceIndex(a)|0);let u=o,h=u;const g=5e5;let f=0;o>=g&&(f=Math.floor(o/g)*g,f=Math.floor(f/i)*i,h-=f);const m=[],_=e+(t-e)/2;let v=-1;for(let y=n;y<=r;y++){if(v===-1){const D=u,L=u+i;(D<=_&&__)&&(v=y)}for(u+=i,m[y-n]=h,h+=i;c===y;)h+=d,u+=d,a++,a>=l?c=r+1:(c=this.getAfterLineNumberForWhitespaceIndex(a)|0,d=this.getHeightForWhitespaceIndex(a)|0);if(u>=t){r=y;break}}v===-1&&(v=r);const b=this.getVerticalOffsetForLineNumber(r)|0;let C=n,w=r;return Ct&&w--,{bigNumbersDelta:f,startLineNumber:n,endLineNumber:r,relativeVerticalOffset:m,centeredLineNumber:v,completelyVisibleStartLineNumber:C,completelyVisibleEndLineNumber:w,lineHeight:this._lineHeight}}getVerticalOffsetForWhitespaceIndex(e){this._checkPendingChanges(),e=e|0;const t=this.getAfterLineNumberForWhitespaceIndex(e);let i;t>=1?i=this._lineHeight*t:i=0;let n;return e>0?n=this.getWhitespacesAccumulatedHeight(e-1):n=0,i+n+this._paddingTop}getWhitespaceIndexAtOrAfterVerticallOffset(e){this._checkPendingChanges(),e=e|0;let t=0,i=this.getWhitespacesCount()-1;if(i<0)return-1;const n=this.getVerticalOffsetForWhitespaceIndex(i),o=this.getHeightForWhitespaceIndex(i);if(e>=n+o)return-1;for(;t=a+l)t=r+1;else{if(e>=a)return r;i=r}}return t}getWhitespaceAtVerticalOffset(e){this._checkPendingChanges(),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),o=this.getIdForWhitespaceIndex(t),r=this.getAfterLineNumberForWhitespaceIndex(t);return{id:o,afterLineNumber:r,verticalOffset:i,height:n}}getWhitespaceViewportData(e,t){this._checkPendingChanges(),e=e|0,t=t|0;const i=this.getWhitespaceIndexAtOrAfterVerticallOffset(e),n=this.getWhitespacesCount()-1;if(i<0)return[];const o=[];for(let r=i;r<=n;r++){const a=this.getVerticalOffsetForWhitespaceIndex(r),l=this.getHeightForWhitespaceIndex(r);if(a>=t)break;o.push({id:this.getIdForWhitespaceIndex(r),afterLineNumber:this.getAfterLineNumberForWhitespaceIndex(r),verticalOffset:a,height:l})}return o}getWhitespaces(){return this._checkPendingChanges(),this._arr.slice(0)}getWhitespacesCount(){return this._checkPendingChanges(),this._arr.length}getIdForWhitespaceIndex(e){return this._checkPendingChanges(),e=e|0,this._arr[e].id}getAfterLineNumberForWhitespaceIndex(e){return this._checkPendingChanges(),e=e|0,this._arr[e].afterLineNumber}getHeightForWhitespaceIndex(e){return this._checkPendingChanges(),e=e|0,this._arr[e].height}};R$.INSTANCE_COUNT=0;const Z_e=125;class Dv{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 X_e extends H{constructor(e,t){super(),this._onDidContentSizeChange=this._register(new B),this.onDidContentSizeChange=this._onDidContentSizeChange.event,this._dimensions=new Dv(0,0,0,0),this._scrollable=this._register(new u0({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 iO(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 Y_e extends H{constructor(e,t,i){super(),this._configuration=e;const n=this._configuration.options,o=n.get(145),r=n.get(84);this._linesLayout=new R$(t,n.get(67),r.top,r.bottom),this._maxLineWidth=0,this._overlayWidgetsMinWidth=0,this._scrollable=this._register(new X_e(0,i)),this._configureSmoothScrollDuration(),this._scrollable.setScrollDimensions(new Dv(o.contentWidth,0,o.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(114)?Z_e:0)}onConfigurationChanged(e){const t=this._configuration.options;if(e.hasChanged(67)&&this._linesLayout.setLineHeight(t.get(67)),e.hasChanged(84)){const i=t.get(84);this._linesLayout.setPadding(i.top,i.bottom)}if(e.hasChanged(145)){const i=t.get(145),n=i.contentWidth,o=i.height,r=this._scrollable.getScrollDimensions(),a=r.contentWidth;this._scrollable.setScrollDimensions(new Dv(n,r.contentWidth,o,this._getContentHeight(n,o,a)))}else this._updateHeight();e.hasChanged(114)&&this._configureSmoothScrollDuration()}onFlushed(e){this._linesLayout.onFlushed(e)}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(103);return n.horizontal===2||e>=t?0:n.horizontalScrollbarSize}_getContentHeight(e,t,i){const n=this._configuration.options;let o=this._linesLayout.getLinesTotalHeight();return n.get(105)?o+=Math.max(0,t-n.get(67)-n.get(84).bottom):n.get(103).ignoreHorizontalScrollbarInContentHeight||(o+=this._getHorizontalScrollbarHeight(e,i)),o}_updateHeight(){const e=this._scrollable.getScrollDimensions(),t=e.width,i=e.height,n=e.contentWidth;this._scrollable.setScrollDimensions(new Dv(t,e.contentWidth,i,this._getContentHeight(t,i,n)))}getCurrentViewport(){const e=this._scrollable.getScrollDimensions(),t=this._scrollable.getCurrentScrollPosition();return new _B(t.scrollTop,t.scrollLeft,e.width,e.height)}getFutureViewport(){const e=this._scrollable.getScrollDimensions(),t=this._scrollable.getFutureScrollPosition();return new _B(t.scrollTop,t.scrollLeft,e.width,e.height)}_computeContentWidth(){const e=this._configuration.options,t=this._maxLineWidth,i=e.get(146),n=e.get(50),o=e.get(145);if(i.isViewportWrapping){const r=e.get(73);return t>o.contentWidth+n.typicalHalfwidthCharacterWidth&&r.enabled&&r.side==="right"?t+o.verticalScrollbarWidth:t}else{const r=e.get(104)*n.typicalHalfwidthCharacterWidth,a=this._linesLayout.getWhitespaceMinWidth();return Math.max(t+r+o.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 Dv(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}getVerticalOffsetForLineNumber(e,t=!1){return this._linesLayout.getVerticalOffsetForLineNumber(e,t)}getVerticalOffsetAfterLineNumber(e,t=!1){return this._linesLayout.getVerticalOffsetAfterLineNumber(e,t)}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 Q_e{constructor(e,t,i,n,o){this.editorId=e,this.model=t,this.configuration=i,this._linesCollection=n,this._coordinatesConverter=o,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,o=e.options;let r;if(o.isWholeLine){const a=this._coordinatesConverter.convertModelPositionToViewPosition(new W(n.startLineNumber,1),0,!1,!0),l=this._coordinatesConverter.convertModelPositionToViewPosition(new W(n.endLineNumber,this.model.getLineMaxColumn(n.endLineNumber)),1);r=new x(a.lineNumber,a.column,l.lineNumber,l.column)}else r=this._coordinatesConverter.convertModelRangeToViewRange(n,1);i=new CU(r,o),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}getInlineDecorationsOnLine(e,t=!1,i=!1){const n=new x(e,this._linesCollection.getViewLineMinColumn(e),e,this._linesCollection.getViewLineMaxColumn(e));return this._getDecorationsInRange(n,t,i).inlineDecorations[0]}_getDecorationsInRange(e,t,i){const n=this._linesCollection.getDecorationsInRange(e,this.editorId,TS(this.configuration.options),t,i),o=e.startLineNumber,r=e.endLineNumber,a=[];let l=0;const d=[];for(let c=o;c<=r;c++)d[c-o]=[];for(let c=0,u=n.length;ct===1)}function aO(s,e){return P$(s,e.range,t=>t===2)}function P$(s,e,t){for(let i=e.startLineNumber;i<=e.endLineNumber;i++){const n=s.tokenization.getLineTokens(i),o=i===e.startLineNumber,r=i===e.endLineNumber;let a=o?n.findTokenIndexAtOffset(e.startColumn-1):0;for(;ae.endColumn-1);){if(!t(n.getStandardTokenType(a)))return!1;a++}}return!0}function EI(s,e){return s===null?e?pD.INSTANCE:mD.INSTANCE:new J_e(s,e)}class J_e{constructor(e,t){this._projectionData=e,this._isVisible=t}isVisible(){return this._isVisible}setVisible(e){return this._isVisible=e,this}getProjectionData(){return this._projectionData}getViewLineCount(){return this._isVisible?this._projectionData.getOutputLineCount():0}getViewLineContent(e,t,i){this._assertVisible();const n=i>0?this._projectionData.breakOffsets[i-1]:0,o=this._projectionData.breakOffsets[i];let r;if(this._projectionData.injectionOffsets!==null){const a=this._projectionData.injectionOffsets.map((d,c)=>new al(0,0,d+1,this._projectionData.injectionOptions[c],0));r=al.applyInjectedText(e.getLineContent(t),a).substring(n,o)}else r=e.getValueInRange({startLineNumber:t,startColumn:n+1,endLineNumber:t,endColumn:o+1});return i>0&&(r=N8(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,o,r,a){this._assertVisible();const l=this._projectionData,d=l.injectionOffsets,c=l.injectionOptions;let u=null;if(d){u=[];let g=0,f=0;for(let m=0;m0?l.breakOffsets[m-1]:0,b=l.breakOffsets[m];for(;fb)break;if(v0?l.wrappedTextIndentLength:0,k=L+Math.max(w-v,0),I=L+Math.min(y-v,b-v);k!==I&&_.push(new iue(k,I,D.inlineClassName,D.inlineClassNameAffectsLetterSpacing))}}if(y<=b)g+=C,f++;else break}}}let h;d?h=e.tokenization.getLineTokens(t).withInserted(d.map((g,f)=>({offset:g,text:c[f].content,tokenMetadata:wn.defaultTokenMetadata}))):h=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,o);let d=l.getLineContent();i>0&&(d=N8(n.wrappedTextIndentLength)+d);const c=this._projectionData.getMinOutputOffset(i)+1,u=d.length+1,h=i+1=II.length)for(let e=1;e<=s;e++)II[e]=e0e(e);return II[s]}function e0e(s){return new Array(s+1).join(" ")}class t0e{constructor(e,t,i,n,o,r,a,l,d,c){this._editorId=e,this.model=t,this._validModelVersionId=-1,this._domLineBreaksComputerFactory=i,this._monospaceLineBreaksComputerFactory=n,this.fontInfo=o,this.tabSize=r,this.wrappingStrategy=a,this.wrappingColumn=l,this.wrappingIndent=d,this.wordBreak=c,this._constructLines(!0,null)}dispose(){this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,[])}createCoordinatesConverter(){return new n0e(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),o=i.length,r=this.createLineBreaksComputer(),a=new Hc(al.fromDecorations(n));for(let m=0;mv.lineNumber===m+1);r.addRequest(i[m],_,t?t[m]:null)}const l=r.finalize(),d=[],c=this.hiddenAreasDecorationIds.map(m=>this.model.getDecorationRange(m)).sort(x.compareRangesUsingStarts);let u=1,h=0,g=-1,f=g+1=u&&_<=h,b=EI(l[m],!v);d[m]=b.getViewLineCount(),this.modelLineProjections[m]=b}this._validModelVersionId=this.model.getVersionId(),this.projectedModelLineLineCounts=new Tde(d)}getHiddenAreas(){return this.hiddenAreasDecorationIds.map(e=>this.model.getDecorationRange(e))}setHiddenAreas(e){const t=e.map(h=>this.model.validateRange(h)),i=i0e(t),n=this.hiddenAreasDecorationIds.map(h=>this.model.getDecorationRange(h)).sort(x.compareRangesUsingStarts);if(i.length===n.length){let h=!1;for(let g=0;g({range:h,options:Ye.EMPTY}));this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,o);const r=i;let a=1,l=0,d=-1,c=d+1=a&&g<=l?this.modelLineProjections[h].isVisible()&&(this.modelLineProjections[h]=this.modelLineProjections[h].setVisible(!1),f=!0):(u=!0,this.modelLineProjections[h].isVisible()||(this.modelLineProjections[h]=this.modelLineProjections[h].setVisible(!0),f=!0)),f){const m=this.modelLineProjections[h].getViewLineCount();this.projectedModelLineLineCounts.setValue(h,m)}}return u||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,o){const r=this.fontInfo.equals(e),a=this.wrappingStrategy===t,l=this.wrappingColumn===i,d=this.wrappingIndent===n,c=this.wordBreak===o;if(r&&a&&l&&d&&c)return!1;const u=r&&a&&!l&&d&&c;this.fontInfo=e,this.wrappingStrategy=t,this.wrappingColumn=i,this.wrappingIndent=n,this.wordBreak=o;let h=null;if(u){h=[];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=[],d=[];for(let c=0,u=n.length;cl?(c=this.projectedModelLineLineCounts.getPrefixSum(t-1)+1,u=c+l-1,f=u+1,m=f+(o-l)-1,d=!0):ot?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)),o=this.convertViewPositionToModelPosition(t,this.getViewLineMinColumn(t)),r=this.convertViewPositionToModelPosition(i,this.getViewLineMinColumn(i)),a=this.model.guides.getActiveIndentGuide(n.lineNumber,o.lineNumber,r.lineNumber),l=this.convertModelPositionToViewPosition(a.startLineNumber,1),d=this.convertModelPositionToViewPosition(a.endLineNumber,this.model.getLineMaxColumn(a.endLineNumber));return{startLineNumber:l.lineNumber,endLineNumber:d.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 A8(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 W(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 W(e.modelLineNumber,n)}getViewLineInfosGroupedByModelRanges(e,t){const i=this.getViewLineInfo(e),n=this.getViewLineInfo(t),o=new Array;let r=this.getModelStartPositionOfViewLine(i),a=new Array;for(let l=i.modelLineNumber;l<=n.modelLineNumber;l++){const d=this.modelLineProjections[l-1];if(d.isVisible()){const c=l===i.modelLineNumber?i.modelLineWrappedLineIdx:0,u=l===n.modelLineNumber?n.modelLineWrappedLineIdx+1:d.getViewLineCount();for(let h=c;h{if(g.forWrappedLinesAfterColumn!==-1&&this.modelLineProjections[c.modelLineNumber-1].getViewPositionOfModelPosition(0,g.forWrappedLinesAfterColumn).lineNumber>=c.modelLineWrappedLineIdx||g.forWrappedLinesBeforeOrAtColumn!==-1&&this.modelLineProjections[c.modelLineNumber-1].getViewPositionOfModelPosition(0,g.forWrappedLinesBeforeOrAtColumn).lineNumberc.modelLineWrappedLineIdx)return}const m=this.convertModelPositionToViewPosition(c.modelLineNumber,g.horizontalLine.endColumn),_=this.modelLineProjections[c.modelLineNumber-1].getViewPositionOfModelPosition(0,g.horizontalLine.endColumn);return _.lineNumber===c.modelLineWrappedLineIdx?new Yg(g.visibleColumn,f,g.className,new Gv(g.horizontalLine.top,m.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 o=[];const r=[],a=[],l=i.lineNumber-1,d=n.lineNumber-1;let c=null;for(let f=l;f<=d;f++){const m=this.modelLineProjections[f];if(m.isVisible()){const _=m.getViewLineNumberOfModelPosition(0,f===l?i.column:1),v=m.getViewLineNumberOfModelPosition(0,this.model.getLineMaxColumn(f+1)),b=v-_+1;let C=0;b>1&&m.getViewLineMinColumn(this.model,f+1,v)===1&&(C=_===0?1:2),r.push(b),a.push(C),c===null&&(c=new W(f+1,0))}else c!==null&&(o=o.concat(this.model.guides.getLinesIndentGuides(c.lineNumber,f)),c=null)}c!==null&&(o=o.concat(this.model.guides.getLinesIndentGuides(c.lineNumber,n.lineNumber)),c=null);const u=t-e+1,h=new Array(u);let g=0;for(let f=0,m=o.length;ft&&(f=!0,g=t-o+1),u.getViewLinesData(this.model,d+1,h,g,o-e,i,l),o+=g,f)break}return l}validateViewPosition(e,t,i){e=this._toValidViewLineNumber(e);const n=this.projectedModelLineLineCounts.getIndexOf(e-1),o=n.index,r=n.remainder,a=this.modelLineProjections[o],l=a.getViewLineMinColumn(this.model,o+1,r),d=a.getViewLineMaxColumn(this.model,o+1,r);td&&(t=d);const c=a.getModelColumnOfViewPosition(r,t);return this.model.validatePosition(new W(o+1,c)).equals(i)?new W(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 x(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 W(i.modelLineNumber,n))}convertViewRangeToModelRange(e){const t=this.convertViewPositionToModelPosition(e.startLineNumber,e.startColumn),i=this.convertViewPositionToModelPosition(e.endLineNumber,e.endColumn);return new x(t.lineNumber,t.column,i.lineNumber,i.column)}convertModelPositionToViewPosition(e,t,i=2,n=!1,o=!1){const r=this.model.validatePosition(new W(e,t)),a=r.lineNumber,l=r.column;let d=a-1,c=!1;if(o)for(;d0&&!this.modelLineProjections[d].isVisible();)d--,c=!0;if(d===0&&!this.modelLineProjections[d].isVisible())return new W(n?0:1,1);const u=1+this.projectedModelLineLineCounts.getPrefixSum(d);let h;return c?o?h=this.modelLineProjections[d].getViewPositionOfModelPosition(u,1,i):h=this.modelLineProjections[d].getViewPositionOfModelPosition(u,this.model.getLineMaxColumn(d+1),i):h=this.modelLineProjections[a-1].getViewPositionOfModelPosition(u,l,i),h}convertModelRangeToViewRange(e,t=0){if(e.isEmpty()){const i=this.convertModelPositionToViewPosition(e.startLineNumber,e.startColumn,t);return x.fromPositions(i)}else{const i=this.convertModelPositionToViewPosition(e.startLineNumber,e.startColumn,1),n=this.convertModelPositionToViewPosition(e.endLineNumber,e.endColumn,0);return new x(i.lineNumber,i.column,n.lineNumber,n.column)}}getViewLineNumberOfModelPosition(e,t){let i=e-1;if(this.modelLineProjections[i].isVisible()){const o=1+this.projectedModelLineLineCounts.getPrefixSum(i);return this.modelLineProjections[i].getViewLineNumberOfModelPosition(o,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,o){const r=this.convertViewPositionToModelPosition(e.startLineNumber,e.startColumn),a=this.convertViewPositionToModelPosition(e.endLineNumber,e.endColumn);if(a.lineNumber-r.lineNumber<=e.endLineNumber-e.startLineNumber)return this.model.getDecorationsInRange(new x(r.lineNumber,1,a.lineNumber,a.column),t,i,n,o);let l=[];const d=r.lineNumber-1,c=a.lineNumber-1;let u=null;for(let m=d;m<=c;m++)if(this.modelLineProjections[m].isVisible())u===null&&(u=new W(m+1,m===d?r.column:1));else if(u!==null){const v=this.model.getLineMaxColumn(m);l=l.concat(this.model.getDecorationsInRange(new x(u.lineNumber,u.column,m,v),t,i,n)),u=null}u!==null&&(l=l.concat(this.model.getDecorationsInRange(new x(u.lineNumber,u.column,a.lineNumber,a.column),t,i,n)),u=null),l.sort((m,_)=>{const v=x.compareRangesUsingStarts(m.range,_.range);return v===0?m.id<_.id?-1:m.id>_.id?1:0:v});const h=[];let g=0,f=null;for(const m of l){const _=m.id;f!==_&&(f=_,h[g++]=m)}return h}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 i0e(s){if(s.length===0)return[];const e=s.slice();e.sort(x.compareRangesUsingStarts);const t=[];let i=e[0].startLineNumber,n=e[0].endLineNumber;for(let o=1,r=e.length;on+1?(t.push(new x(i,1,n,1)),i=a.startLineNumber,n=a.endLineNumber):a.endLineNumber>n&&(n=a.endLineNumber)}return t.push(new x(i,1,n,1)),t}class A8{constructor(e,t){this.modelLineNumber=e,this.modelLineWrappedLineIdx=t}}class M8{constructor(e,t){this.modelRange=e,this.viewLines=t}}class n0e{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 s0e{constructor(e){this.model=e}dispose(){}createCoordinatesConverter(){return new o0e(this)}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 YA(t,i)}onModelLinesInserted(e,t,i,n){return new QA(t,i)}onModelLineChanged(e,t,i){return[!1,new M$(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 o=0;ot)}getModelLineViewLineCount(e){return 1}getViewLineNumberOfModelPosition(e,t){return e}}const bg=bd.Right;class r0e{constructor(e){this.persist=0,this._requiredLanes=1,this.lanes=new Uint8Array(Math.ceil((e+1)*bg/8))}reset(e){const t=Math.ceil((e+1)*bg/8);this.lanes.length>>3]|=1<>>3]&1<>>3]&1<this._updateConfigurationViewLineCountNow(),0)),this._hasFocus=!1,this._viewportStart=lO.create(this.model),this.glyphLanes=new r0e(0),this.model.isTooLargeForTokenization())this._lines=new s0e(this.model);else{const c=this._configuration.options,u=c.get(50),h=c.get(139),g=c.get(146),f=c.get(138),m=c.get(129);this._lines=new t0e(this._editorId,this.model,n,o,u,this.model.getOptions().tabSize,h,g.wrappingColumn,f,m)}this.coordinatesConverter=this._lines.createCoordinatesConverter(),this._cursor=this._register(new z_e(i,this,this.coordinatesConverter,this.cursorConfig)),this.viewLayout=this._register(new Y_e(this._configuration,this.getLineCount(),r)),this._register(this.viewLayout.onDidScroll(c=>{c.scrollTopChanged&&this._handleVisibleLinesChanged(),c.scrollTopChanged&&this._viewportStart.invalidate(),this._eventDispatcher.emitSingleViewEvent(new x_e(c)),this._eventDispatcher.emitOutgoingEvent(new sO(c.oldScrollWidth,c.oldScrollLeft,c.oldScrollHeight,c.oldScrollTop,c.scrollWidth,c.scrollLeft,c.scrollHeight,c.scrollTop))})),this._register(this.viewLayout.onDidContentSizeChange(c=>{this._eventDispatcher.emitOutgoingEvent(c)})),this._decorations=new Q_e(this._editorId,this.model,this._configuration,this._lines,this.coordinatesConverter),this._registerModelEvents(),this._register(this._configuration.onDidChangeFast(c=>{try{const u=this._eventDispatcher.beginEmitViewEvents();this._onConfigurationChanged(u,c)}finally{this._eventDispatcher.endEmitViewEvents()}})),this._register(D1.getInstance().onDidChange(()=>{this._eventDispatcher.emitSingleViewEvent(new I_e)})),this._register(this._themeService.onDidColorThemeChange(c=>{this._invalidateDecorationsColorCache(),this._eventDispatcher.emitSingleViewEvent(new k_e(c))})),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)}_updateConfigurationViewLineCountNow(){this._configuration.setViewLineCount(this._lines.getViewLineCount())}getModelVisibleRanges(){const e=this.viewLayout.getLinesViewportData(),t=new x(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 D_e(e)),this._eventDispatcher.emitOutgoingEvent(new nO(!e,e))}onCompositionStart(){this._eventDispatcher.emitSingleViewEvent(new C_e)}onCompositionEnd(){this._eventDispatcher.emitSingleViewEvent(new w_e)}_captureStableViewport(){if(this._viewportStart.isValid&&this.viewLayout.getCurrentScrollTop()>0){const e=new W(this._viewportStart.viewLineNumber,this.getLineMinColumn(this._viewportStart.viewLineNumber)),t=this.coordinatesConverter.convertViewPositionToModelPosition(e);return new P8(t,this._viewportStart.startLineDelta)}return new P8(null,0)}_onConfigurationChanged(e,t){const i=this._captureStableViewport(),n=this._configuration.options,o=n.get(50),r=n.get(139),a=n.get(146),l=n.get(138),d=n.get(129);this._lines.setWrappingSettings(o,r,a.wrappingColumn,l,d)&&(e.emitViewEvent(new Fw),e.emitViewEvent(new Ow),e.emitViewEvent(new vg(null)),this._cursor.onLineMappingChanged(e),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount()),this._updateConfigurationViewLineCount.schedule()),t.hasChanged(91)&&(this._decorations.reset(),e.emitViewEvent(new vg(null))),t.hasChanged(98)&&(this._decorations.reset(),e.emitViewEvent(new vg(null))),e.emitViewEvent(new y_e(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(e=>{try{const i=this._eventDispatcher.beginEmitViewEvents();let n=!1,o=!1;const r=e instanceof cf?e.rawContentChangedEvent.changes:e.changes,a=e instanceof cf?e.rawContentChangedEvent.versionId:null,l=this._lines.createLineBreaksComputer();for(const u of r)switch(u.changeType){case 4:{for(let h=0;h!m.ownerId||m.ownerId===this._editorId)),l.addRequest(g,f,null)}break}case 2:{let h=null;u.injectedText&&(h=u.injectedText.filter(g=>!g.ownerId||g.ownerId===this._editorId)),l.addRequest(u.detail,h,null);break}}const d=l.finalize(),c=new Hc(d);for(const u of r)switch(u.changeType){case 1:{this._lines.onModelFlushed(),i.emitViewEvent(new Fw),this._decorations.reset(),this.viewLayout.onFlushed(this.getLineCount()),n=!0;break}case 3:{const h=this._lines.onModelLinesDeleted(a,u.fromLineNumber,u.toLineNumber);h!==null&&(i.emitViewEvent(h),this.viewLayout.onLinesDeleted(h.fromLineNumber,h.toLineNumber)),n=!0;break}case 4:{const h=c.takeCount(u.detail.length),g=this._lines.onModelLinesInserted(a,u.fromLineNumber,u.toLineNumber,h);g!==null&&(i.emitViewEvent(g),this.viewLayout.onLinesInserted(g.fromLineNumber,g.toLineNumber)),n=!0;break}case 2:{const h=c.dequeue(),[g,f,m,_]=this._lines.onModelLineChanged(a,u.lineNumber,h);o=g,f&&i.emitViewEvent(f),m&&(i.emitViewEvent(m),this.viewLayout.onLinesInserted(m.fromLineNumber,m.toLineNumber)),_&&(i.emitViewEvent(_),this.viewLayout.onLinesDeleted(_.fromLineNumber,_.toLineNumber));break}case 5:break}a!==null&&this._lines.acceptVersionId(a),this.viewLayout.onHeightMaybeChanged(),!n&&o&&(i.emitViewEvent(new Ow),i.emitViewEvent(new vg(null)),this._cursor.onLineMappingChanged(i),this._decorations.onLineMappingChanged())}finally{this._eventDispatcher.endEmitViewEvents()}const t=this._viewportStart.isValid;if(this._viewportStart.invalidate(),this._configuration.setModelLineCount(this.model.getLineCount()),this._updateConfigurationViewLineCountNow(),!this._hasFocus&&this.model.getAttachedEditorCount()>=2&&t){const i=this.model._getTrackedRange(this._viewportStart.modelTrackedRange);if(i){const n=this.coordinatesConverter.convertModelPositionToViewPosition(i.getStartPosition()),o=this.viewLayout.getVerticalOffsetForLineNumber(n.lineNumber);this.viewLayout.setScrollPosition({scrollTop:o+this._viewportStart.startLineDelta},1)}}try{const i=this._eventDispatcher.beginEmitViewEvents();e instanceof cf&&i.emitOutgoingEvent(new W_e(e.contentChangedEvent)),this._cursor.onModelContentChanged(i,e)}finally{this._eventDispatcher.endEmitViewEvents()}this._handleVisibleLinesChanged()})),this._register(this.model.onDidChangeTokens(e=>{const t=[];for(let i=0,n=e.ranges.length;i{this._eventDispatcher.emitSingleViewEvent(new L_e),this.cursorConfig=new Ep(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new B_e(e))})),this._register(this.model.onDidChangeLanguage(e=>{this.cursorConfig=new Ep(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new O_e(e))})),this._register(this.model.onDidChangeOptions(e=>{if(this._lines.setTabSize(this.model.getOptions().tabSize)){try{const t=this._eventDispatcher.beginEmitViewEvents();t.emitViewEvent(new Fw),t.emitViewEvent(new Ow),t.emitViewEvent(new vg(null)),this._cursor.onLineMappingChanged(t),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount())}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 H_e(e))})),this._register(this.model.onDidChangeDecorations(e=>{this._decorations.onModelDecorationsChanged(),this._eventDispatcher.emitSingleViewEvent(new vg(e)),this._eventDispatcher.emitOutgoingEvent(new F_e(e))}))}setHiddenAreas(e,t){var i;this.hiddenAreasModel.setHiddenAreas(t,e);const n=this.hiddenAreasModel.getMergedRanges();if(n===this.previousHiddenAreas)return;this.previousHiddenAreas=n;const o=this._captureStableViewport();let r=!1;try{const a=this._eventDispatcher.beginEmitViewEvents();r=this._lines.setHiddenAreas(n),r&&(a.emitViewEvent(new Fw),a.emitViewEvent(new Ow),a.emitViewEvent(new vg(null)),this._cursor.onLineMappingChanged(a),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount()),this.viewLayout.onHeightMaybeChanged());const l=(i=o.viewportStartModelPosition)===null||i===void 0?void 0:i.lineNumber;l&&n.some(c=>c.startLineNumber<=l&&l<=c.endLineNumber)||o.recoverViewportStart(this.coordinatesConverter,this.viewLayout)}finally{this._eventDispatcher.endEmitViewEvents()}this._updateConfigurationViewLineCount.schedule(),r&&this._eventDispatcher.emitOutgoingEvent(new R_e)}getVisibleRangesPlusViewportAboveBelow(){const e=this._configuration.options.get(145),t=this._configuration.options.get(67),i=Math.max(20,Math.round(e.height/t)),n=this.viewLayout.getLinesViewportData(),o=Math.max(1,n.completelyVisibleStartLineNumber-i),r=Math.min(this.getLineCount(),n.completelyVisibleEndLineNumber+i);return this._toModelVisibleRanges(new x(o,this.getLineMinColumn(o),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 o=0,r=t.startLineNumber,a=t.startColumn;const l=t.endLineNumber,d=t.endColumn;for(let c=0,u=i.length;cl||(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=Cs(this.getLineContent(e));return t===-1?0:t+1}getLineLastNonWhitespaceColumn(e){const t=Ya(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)}getViewportViewLineRenderingData(e,t){const n=this._decorations.getDecorationsViewportData(e).inlineDecorations[t-e.startLineNumber];return this._getViewLineRenderingData(t,n)}getViewLineRenderingData(e){const t=this._decorations.getInlineDecorationsOnLine(e);return this._getViewLineRenderingData(e,t)}_getViewLineRenderingData(e,t){const i=this.model.mightContainRTL(),n=this.model.mightContainNonBasicASCII(),o=this.getTabSize(),r=this._lines.getViewLineData(e);return r.inlineDecorations&&(t=[...t,...r.inlineDecorations.map(a=>a.toInlineDecoration(e))]),new lr(r.minColumn,r.maxColumn,r.content,r.continuesWithWrappedLine,i,n,r.tokens,t,o,r.startVisibleColumn)}getViewLineData(e){return this._lines.getViewLineData(e)}getMinimapLinesRenderingData(e,t,i){const n=this._lines.getViewLinesData(e,t,i);return new tue(this.getTabSize(),n)}getAllOverviewRulerDecorations(e){const t=this.model.getOverviewRulerDecorations(this._editorId,TS(this._configuration.options)),i=new l0e;for(const n of t){const o=n.options,r=o.overviewRuler;if(!r)continue;const a=r.position;if(a===0)continue;const l=r.getColor(e.value),d=this.coordinatesConverter.getViewLineNumberOfModelPosition(n.range.startLineNumber,n.range.startColumn),c=this.coordinatesConverter.getViewLineNumberOfModelPosition(n.range.endLineNumber,n.range.endColumn);i.accept(l,o.zIndex,d,c,a)}return i.asArray}_invalidateDecorationsColorCache(){const e=this.model.getOverviewRulerDecorations();for(const t of e){const i=t.options.overviewRuler;i==null||i.invalidateCachedColor();const n=t.options.minimap;n==null||n.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(x.compareRangesUsingStarts);let o=!1,r=!1;for(const l of e)l.isEmpty()?o=!0:r=!0;if(!r){if(!t)return"";const l=e.map(c=>c.startLineNumber);let d="";for(let c=0;c0&&l[c-1]===l[c]||(d+=this.model.getLineContent(l[c])+n);return d}if(o&&t){const l=[];let d=0;for(const c of e){const u=c.startLineNumber;c.isEmpty()?u!==d&&l.push(this.model.getLineContent(u)):l.push(this.model.getValueInRange(c,i?2:0)),d=u}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===ir||e.length!==1)return null;let n=e[0];if(n.isEmpty()){if(!t)return null;const c=n.startLineNumber;n=new x(c,this.model.getLineMinColumn(c),c,this.model.getLineMaxColumn(c))}const o=this._configuration.options.get(50),r=this._getColorMap(),l=/[:;\\\/<>]/.test(o.fontFamily)||o.fontFamily===co.fontFamily;let d;return l?d=co.fontFamily:(d=o.fontFamily,d=d.replace(/"/g,"'"),/[,']/.test(d)||/[+ ]/.test(d)&&(d=`'${d}'`),d=`${d}, ${co.fontFamily}`),{mode:i,html:`
`+this._getHTMLToCopy(n,r)+"
"}}_getHTMLToCopy(e,t){const i=e.startLineNumber,n=e.startColumn,o=e.endLineNumber,r=e.endColumn,a=this.getTabSize();let l="";for(let d=i;d<=o;d++){const c=this.model.tokenization.getLineTokens(d),u=c.getLineContent(),h=d===i?n-1:0,g=d===o?r-1:u.length;u===""?l+="
":l+=K_e(u,c.inflate(),t,h,g,a,as)}return l}_getColorMap(){const e=Ki.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 P_e);return}this._withViewEventsCollector(e)}executeEdits(e,t,i){this._executeCursorEdit(n=>this._cursor.executeEdits(n,e,t,i))}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,o){this._executeCursorEdit(r=>this._cursor.compositionType(r,e,t,i,n,o))}paste(e,t,i,n){this._executeCursorEdit(o=>this._cursor.paste(o,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 x(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector(n=>n.emitViewEvent(new nb(e,!1,i,null,0,!0,0)))}revealBottomMostCursor(e){const t=this._cursor.getBottomMostViewPosition(),i=new x(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector(n=>n.emitViewEvent(new nb(e,!1,i,null,0,!0,0)))}revealRange(e,t,i,n,o){this._withViewEventsCollector(r=>r.emitViewEvent(new nb(e,!1,i,null,n,t,o)))}changeWhitespace(e){this.viewLayout.changeWhitespace(e)&&(this._eventDispatcher.emitSingleViewEvent(new T_e),this._eventDispatcher.emitOutgoingEvent(new M_e))}_withViewEventsCollector(e){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 lO{static create(e){const t=e._setTrackedRange(null,new x(1,1,1,1),1);return new lO(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,o){this._model=e,this._viewLineNumber=t,this._isValid=i,this._modelTrackedRange=n,this._startLineDelta=o}dispose(){this._model._setTrackedRange(this._modelTrackedRange,null,1)}update(e,t){const i=e.coordinatesConverter.convertViewPositionToModelPosition(new W(t,e.getLineMinColumn(t))),n=e.model._setTrackedRange(this._modelTrackedRange,new x(i.lineNumber,i.column,i.lineNumber,i.column),1),o=e.viewLayout.getVerticalOffsetForLineNumber(t),r=e.viewLayout.getCurrentScrollTop();this._viewLineNumber=t,this._isValid=!0,this._modelTrackedRange=n,this._startLineDelta=r-o}invalidate(){this._isValid=!1}}class l0e{constructor(){this._asMap=Object.create(null),this.asArray=[]}accept(e,t,i,n,o){const r=this._asMap[e];if(r){const a=r.data,l=a[a.length-3],d=a[a.length-1];if(l===o&&d+1>=i){n>d&&(a[a.length-1]=n);return}a.push(o,i,n)}else{const a=new $b(e,t,[o,i,n]);this._asMap[e]=a,this.asArray.push(a)}}}class d0e{constructor(){this.hiddenAreas=new Map,this.shouldRecompute=!1,this.ranges=[]}setHiddenAreas(e,t){const i=this.hiddenAreas.get(e);i&&R8(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)=>c0e(t,i),[]);return R8(this.ranges,e)?this.ranges:(this.ranges=e,this.ranges)}}function c0e(s,e){const t=[];let i=0,n=0;for(;i=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Hd=function(s,e){return function(t,i){e(t,i,s)}},Ng;let y_=Ng=class extends H{get isSimpleWidget(){return this._configuration.isSimpleWidget}get contextMenuId(){return this._configuration.contextMenuId}constructor(e,t,i,n,o,r,a,l,d,c,u,h){var g,f;super(),this.languageConfigurationService=u,this._deliveryQueue=qoe(),this._contributions=this._register(new $pe),this._onDidDispose=this._register(new B),this.onDidDispose=this._onDidDispose.event,this._onDidChangeModelContent=this._register(new B({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelContent=this._onDidChangeModelContent.event,this._onDidChangeModelLanguage=this._register(new B({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelLanguage=this._onDidChangeModelLanguage.event,this._onDidChangeModelLanguageConfiguration=this._register(new B({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelLanguageConfiguration=this._onDidChangeModelLanguageConfiguration.event,this._onDidChangeModelOptions=this._register(new B({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelOptions=this._onDidChangeModelOptions.event,this._onDidChangeModelDecorations=this._register(new B({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelDecorations=this._onDidChangeModelDecorations.event,this._onDidChangeModelTokens=this._register(new B({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelTokens=this._onDidChangeModelTokens.event,this._onDidChangeConfiguration=this._register(new B({deliveryQueue:this._deliveryQueue})),this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this._onWillChangeModel=this._register(new B({deliveryQueue:this._deliveryQueue})),this.onWillChangeModel=this._onWillChangeModel.event,this._onDidChangeModel=this._register(new B({deliveryQueue:this._deliveryQueue})),this.onDidChangeModel=this._onDidChangeModel.event,this._onDidChangeCursorPosition=this._register(new B({deliveryQueue:this._deliveryQueue})),this.onDidChangeCursorPosition=this._onDidChangeCursorPosition.event,this._onDidChangeCursorSelection=this._register(new B({deliveryQueue:this._deliveryQueue})),this.onDidChangeCursorSelection=this._onDidChangeCursorSelection.event,this._onDidAttemptReadOnlyEdit=this._register(new us(this._contributions,this._deliveryQueue)),this.onDidAttemptReadOnlyEdit=this._onDidAttemptReadOnlyEdit.event,this._onDidLayoutChange=this._register(new B({deliveryQueue:this._deliveryQueue})),this.onDidLayoutChange=this._onDidLayoutChange.event,this._editorTextFocus=this._register(new F8({deliveryQueue:this._deliveryQueue})),this.onDidFocusEditorText=this._editorTextFocus.onDidChangeToTrue,this.onDidBlurEditorText=this._editorTextFocus.onDidChangeToFalse,this._editorWidgetFocus=this._register(new F8({deliveryQueue:this._deliveryQueue})),this.onDidFocusEditorWidget=this._editorWidgetFocus.onDidChangeToTrue,this.onDidBlurEditorWidget=this._editorWidgetFocus.onDidChangeToFalse,this._onWillType=this._register(new us(this._contributions,this._deliveryQueue)),this.onWillType=this._onWillType.event,this._onDidType=this._register(new us(this._contributions,this._deliveryQueue)),this.onDidType=this._onDidType.event,this._onDidCompositionStart=this._register(new us(this._contributions,this._deliveryQueue)),this.onDidCompositionStart=this._onDidCompositionStart.event,this._onDidCompositionEnd=this._register(new us(this._contributions,this._deliveryQueue)),this.onDidCompositionEnd=this._onDidCompositionEnd.event,this._onDidPaste=this._register(new us(this._contributions,this._deliveryQueue)),this.onDidPaste=this._onDidPaste.event,this._onMouseUp=this._register(new us(this._contributions,this._deliveryQueue)),this.onMouseUp=this._onMouseUp.event,this._onMouseDown=this._register(new us(this._contributions,this._deliveryQueue)),this.onMouseDown=this._onMouseDown.event,this._onMouseDrag=this._register(new us(this._contributions,this._deliveryQueue)),this.onMouseDrag=this._onMouseDrag.event,this._onMouseDrop=this._register(new us(this._contributions,this._deliveryQueue)),this.onMouseDrop=this._onMouseDrop.event,this._onMouseDropCanceled=this._register(new us(this._contributions,this._deliveryQueue)),this.onMouseDropCanceled=this._onMouseDropCanceled.event,this._onDropIntoEditor=this._register(new us(this._contributions,this._deliveryQueue)),this.onDropIntoEditor=this._onDropIntoEditor.event,this._onContextMenu=this._register(new us(this._contributions,this._deliveryQueue)),this.onContextMenu=this._onContextMenu.event,this._onMouseMove=this._register(new us(this._contributions,this._deliveryQueue)),this.onMouseMove=this._onMouseMove.event,this._onMouseLeave=this._register(new us(this._contributions,this._deliveryQueue)),this.onMouseLeave=this._onMouseLeave.event,this._onMouseWheel=this._register(new us(this._contributions,this._deliveryQueue)),this.onMouseWheel=this._onMouseWheel.event,this._onKeyUp=this._register(new us(this._contributions,this._deliveryQueue)),this.onKeyUp=this._onKeyUp.event,this._onKeyDown=this._register(new us(this._contributions,this._deliveryQueue)),this.onKeyDown=this._onKeyDown.event,this._onDidContentSizeChange=this._register(new B({deliveryQueue:this._deliveryQueue})),this.onDidContentSizeChange=this._onDidContentSizeChange.event,this._onDidScrollChange=this._register(new B({deliveryQueue:this._deliveryQueue})),this.onDidScrollChange=this._onDidScrollChange.event,this._onDidChangeViewZones=this._register(new B({deliveryQueue:this._deliveryQueue})),this.onDidChangeViewZones=this._onDidChangeViewZones.event,this._onDidChangeHiddenAreas=this._register(new B({deliveryQueue:this._deliveryQueue})),this.onDidChangeHiddenAreas=this._onDidChangeHiddenAreas.event,this._actions=new Map,this._bannerDomNode=null,this._dropIntoEditorDecorations=this.createDecorationsCollection(),o.willCreateCodeEditor();const m={...t};this._domElement=e,this._overflowWidgetsDomNode=m.overflowWidgetsDomNode,delete m.overflowWidgetsDomNode,this._id=++g0e,this._decorationTypeKeysToIds={},this._decorationTypeSubtypes={},this._telemetryData=i.telemetryData,this._configuration=this._register(this._createConfiguration(i.isSimpleWidget||!1,(g=i.contextMenuId)!==null&&g!==void 0?g:i.isSimpleWidget?E.SimpleEditorContext:E.EditorContext,m,c)),this._register(this._configuration.onDidChange(b=>{this._onDidChangeConfiguration.fire(b);const C=this._configuration.options;if(b.hasChanged(145)){const w=C.get(145);this._onDidLayoutChange.fire(w)}})),this._contextKeyService=this._register(a.createScoped(this._domElement)),this._notificationService=d,this._codeEditorService=o,this._commandService=r,this._themeService=l,this._register(new p0e(this,this._contextKeyService)),this._register(new m0e(this,this._contextKeyService,h)),this._instantiationService=n.createChild(new L1([Be,this._contextKeyService])),this._modelData=null,this._focusTracker=new _0e(e,this._overflowWidgetsDomNode),this._register(this._focusTracker.onChange(()=>{this._editorWidgetFocus.setValue(this._focusTracker.hasFocus())})),this._contentWidgets={},this._overlayWidgets={},this._glyphMarginWidgets={};let _;Array.isArray(i.contributions)?_=i.contributions:_=Im.getEditorContributions(),this._contributions.initialize(this,_,this._instantiationService);for(const b of Im.getEditorActions()){if(this._actions.has(b.id)){Xe(new Error(`Cannot have two actions with the same id ${b.id}`));continue}const C=new u$(b.id,b.label,b.alias,b.metadata,(f=b.precondition)!==null&&f!==void 0?f:void 0,w=>this._instantiationService.invokeFunction(y=>Promise.resolve(b.runEditorCommand(y,this,w))),this._contextKeyService);this._actions.set(C.id,C)}const v=()=>!this._configuration.options.get(91)&&this._configuration.options.get(36).enabled;this._register(new ele(this._domElement,{onDragOver:b=>{if(!v())return;const C=this.getTargetAtClientPoint(b.clientX,b.clientY);C!=null&&C.position&&this.showDropIndicatorAt(C.position)},onDrop:async b=>{if(!v()||(this.removeDropIndicator(),!b.dataTransfer))return;const C=this.getTargetAtClientPoint(b.clientX,b.clientY);C!=null&&C.position&&this._onDropIntoEditor.fire({position:C.position,event:b})},onDragLeave:()=>{this.removeDropIndicator()},onDragEnd:()=>{this.removeDropIndicator()}})),this._codeEditorService.addCodeEditor(this)}writeScreenReaderContent(e){var t;(t=this._modelData)===null||t===void 0||t.view.writeScreenReaderContent(e)}_createConfiguration(e,t,i,n){return new LA(e,t,i,this._domElement,n)}getId(){return this.getEditorType()+":"+this._id}getEditorType(){return p1.ICodeEditor}dispose(){this._codeEditorService.removeCodeEditor(this),this._focusTracker.dispose(),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?Et.getWordAtPosition(this._modelData.model,this._configuration.options.get(131),this._configuration.options.get(130),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){this._modelData&&this._modelData.model.setValue(e)}getModel(){return this._modelData?this._modelData.model:null}setModel(e=null){var t;const i=e;if(this._modelData===null&&i===null||this._modelData&&this._modelData.model===i)return;const n={oldModelUrl:((t=this._modelData)===null||t===void 0?void 0:t.model.uri)||null,newModelUrl:(i==null?void 0:i.uri)||null};this._onWillChangeModel.fire(n);const o=this.hasTextFocus(),r=this._detachModel();this._attachModel(i),o&&this.hasModel()&&this.focus(),this._removeDecorationTypes(),this._onDidChangeModel.fire(n),this._postDetachModelCleanup(r),this._contributionsDisposable=this._contributions.onAfterModelAttached()}_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 o=e.model.validatePosition({lineNumber:t,column:i}),r=e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(o);return e.viewModel.viewLayout.getVerticalOffsetAfterLineNumber(r.lineNumber,n)}getTopForLineNumber(e,t=!1){return this._modelData?Ng._getVerticalOffsetForPosition(this._modelData,e,1,t):-1}getTopForPosition(e,t){return this._modelData?Ng._getVerticalOffsetForPosition(this._modelData,e,t,!1):-1}static _getVerticalOffsetForPosition(e,t,i,n=!1){const o=e.model.validatePosition({lineNumber:t,column:i}),r=e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(o);return e.viewModel.viewLayout.getVerticalOffsetForLineNumber(r.lineNumber,n)}getBottomForLineNumber(e,t=!1){return this._modelData?Ng._getVerticalOffsetAfterPosition(this._modelData,e,1,t):-1}setHiddenAreas(e,t){var i;(i=this._modelData)===null||i===void 0||i.viewModel.setHiddenAreas(e.map(n=>x.lift(n)),t)}getVisibleColumnFromPosition(e){if(!this._modelData)return e.column;const t=this._modelData.model.validatePosition(e),i=this._modelData.model.getOptions().tabSize;return hn.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(!W.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(!x.isIRange(e))throw new Error("Invalid arguments");const o=this._modelData.model.validateRange(e),r=this._modelData.viewModel.coordinatesConverter.convertModelRangeToViewRange(o);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 x(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(!W.isIPosition(e))throw new Error("Invalid arguments");this._sendRevealRange(new x(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=we.isISelection(e),n=x.isIRange(e);if(!i&&!n)throw new Error("Invalid arguments");if(i)this._setSelectionImpl(e,t);else if(n){const o={selectionStartLineNumber:e.startLineNumber,selectionStartColumn:e.startColumn,positionLineNumber:e.endLineNumber,positionColumn:e.endColumn};this._setSelectionImpl(o,t)}}_setSelectionImpl(e,t){if(!this._modelData)return;const i=new we(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 x(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(!x.isIRange(e))throw new Error("Invalid arguments");this._sendRevealRange(x.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,o=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(){var e;(e=this._getViewModel())===null||e===void 0||e.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){switch(i=i||{},t){case"compositionStart":this._startComposition();return;case"compositionEnd":this._endComposition(e);return;case"type":{const o=i;this._type(e,o.text||"");return}case"replacePreviousChar":{const o=i;this._compositionType(e,o.text||"",o.replaceCharCnt||0,0,0);return}case"compositionType":{const o=i;this._compositionType(e,o.text||"",o.replacePrevCharCnt||0,o.replaceNextCharCnt||0,o.positionDelta||0);return}case"paste":{const o=i;this._paste(e,o.text||"",o.pasteOnNewLine||!1,o.multicursorText||null,o.mode||null,o.clipboardEvent);return}case"cut":this._cut(e);return}const n=this.getAction(t);if(n){Promise.resolve(n.run(i)).then(void 0,Xe);return}this._modelData&&(this._triggerEditorCommand(e,t,i)||this._triggerCommand(t,i))}_triggerCommand(e,t){this._commandService.executeCommand(e,t)}_startComposition(){this._modelData&&(this._modelData.viewModel.startComposition(),this._onDidCompositionStart.fire())}_endComposition(e){this._modelData&&(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,o){this._modelData&&this._modelData.viewModel.compositionType(t,i,n,o,e)}_paste(e,t,i,n,o,r){if(!this._modelData)return;const a=this._modelData.viewModel,l=a.getSelection().getStartPosition();a.paste(t,i,n,e);const d=a.getSelection().getStartPosition();e==="keyboard"&&this._onDidPaste.fire({clipboardEvent:r,range:new x(l.lineNumber,l.column,d.lineNumber,d.column),languageId:o})}_cut(e){this._modelData&&this._modelData.viewModel.cut(e)}_triggerEditorCommand(e,t,i){const n=Im.getEditorCommand(t);return n?(i=i||{},i.source=e,this._instantiationService.invokeFunction(o=>{Promise.resolve(n.runEditorCommand(o,this,i)).then(void 0,Xe)}),!0):!1}_getViewModel(){return this._modelData?this._modelData.viewModel:null}pushUndoStop(){return!this._modelData||this._configuration.options.get(91)?!1:(this._modelData.model.pushStackElement(),!0)}popUndoStop(){return!this._modelData||this._configuration.options.get(91)?!1:(this._modelData.model.popStackElement(),!0)}executeEdits(e,t,i){if(!this._modelData||this._configuration.options.get(91))return!1;let n;return i?Array.isArray(i)?n=()=>i:n=i:n=()=>null,this._modelData.viewModel.executeEdits(e,t,n),!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 v0e(this,e)}changeDecorations(e){return this._modelData?this._modelData.model.changeDecorations(e,this._id):null}getLineDecorations(e){return this._modelData?this._modelData.model.getLineDecorations(e,this._id,TS(this._configuration.options)):null}getDecorationsInRange(e){return this._modelData?this._modelData.model.getDecorationsInRange(e,this._id,TS(this._configuration.options)):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(145)}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._focusTracker&&this._focusTracker.hasFocus()}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),i=this._configuration.options,n=i.get(145),o=Ng._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();return{top:o,left:r,height:i.get(67)}}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){Un(e,this._configuration.options.get(50))}setBanner(e,t){this._bannerDomNode&&this._domElement.contains(this._bannerDomNode)&&this._domElement.removeChild(this._bannerDomNode),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 a0e(this._id,this._configuration,e,$F.create(Te(this._domElement)),tO.create(this._configuration.options),a=>Ao(Te(this._domElement),a),this.languageConfigurationService,this._themeService,i);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._onDidScrollChange.fire(a);break;case 3:this._onDidChangeViewZones.fire();break;case 4:this._onDidChangeHiddenAreas.fire();break;case 5:this._onDidAttemptReadOnlyEdit.fire();break;case 6:{if(a.reachedMaxCursorCount){const u=this.getOption(80),h=p("cursors.maximum","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.",u);this._notificationService.prompt(Rx.Warning,h,[{label:"Find and Replace",run:()=>{this._commandService.executeCommand("editor.action.startFindReplaceAction")}},{label:p("goToSetting","Increase Multi Cursor Limit"),run:()=>{this._commandService.executeCommand("workbench.action.openSettings2",{query:"editor.multiCursorLimit"})}}])}const l=[];for(let u=0,h=a.selections.length;u{this._paste("keyboard",o,r,a,l)},type:o=>{this._type("keyboard",o)},compositionType:(o,r,a,l)=>{this._compositionType("keyboard",o,r,a,l)},startComposition:()=>{this._startComposition()},endComposition:()=>{this._endComposition("keyboard")},cut:()=>{this._cut("keyboard")}}:t={paste:(o,r,a,l)=>{const d={text:o,pasteOnNewLine:r,multicursorText:a,mode:l};this._commandService.executeCommand("paste",d)},type:o=>{const r={text:o};this._commandService.executeCommand("type",r)},compositionType:(o,r,a,l)=>{if(a||l){const d={text:o,replacePrevCharCnt:r,replaceNextCharCnt:a,positionDelta:l};this._commandService.executeCommand("compositionType",d)}else{const d={text:o,replaceCharCnt:r};this._commandService.executeCommand("replacePreviousChar",d)}},startComposition:()=>{this._commandService.executeCommand("compositionStart",{})},endComposition:()=>{this._commandService.executeCommand("compositionEnd",{})},cut:()=>{this._commandService.executeCommand("cut",{})}};const i=new Ix(e.coordinatesConverter);return i.onKeyDown=o=>this._onKeyDown.fire(o),i.onKeyUp=o=>this._onKeyUp.fire(o),i.onContextMenu=o=>this._onContextMenu.fire(o),i.onMouseMove=o=>this._onMouseMove.fire(o),i.onMouseLeave=o=>this._onMouseLeave.fire(o),i.onMouseDown=o=>this._onMouseDown.fire(o),i.onMouseUp=o=>this._onMouseUp.fire(o),i.onMouseDrag=o=>this._onMouseDrag.fire(o),i.onMouseDrop=o=>this._onMouseDrop.fire(o),i.onMouseDropCanceled=o=>this._onMouseDropCanceled.fire(o),i.onMouseWheel=o=>this._onMouseWheel.fire(o),[new OA(t,this._configuration,this._themeService.getColorTheme(),e,i,this._overflowWidgetsDomNode,this._instantiationService),!0]}_postDetachModelCleanup(e){e==null||e.removeAllDecorationsWithOwnerId(this._id)}_detachModel(){var e;if((e=this._contributionsDisposable)===null||e===void 0||e.dispose(),this._contributionsDisposable=void 0,!this._modelData)return null;const t=this._modelData.model,i=this._modelData.hasRealView?this._modelData.view.domNode.domNode:null;return this._modelData.dispose(),this._modelData=null,this._domElement.removeAttribute("data-mode-id"),i&&this._domElement.contains(i)&&this._domElement.removeChild(i),this._bannerDomNode&&this._domElement.contains(this._bannerDomNode)&&this._domElement.removeChild(this._bannerDomNode),t}_removeDecorationType(e){this._codeEditorService.removeDecorationType(e)}hasModel(){return this._modelData!==null}showDropIndicatorAt(e){const t=[{range:new x(e.lineNumber,e.column,e.lineNumber,e.column),options:Ng.dropIntoEditorDecorationOptions}];this._dropIntoEditorDecorations.set(t),this.revealPosition(e,1)}removeDropIndicator(){this._dropIntoEditorDecorations.clear()}setContextValue(e,t){this._contextKeyService.createKey(e,t)}};y_.dropIntoEditorDecorationOptions=Ye.register({description:"workbench-dnd-target",className:"dnd-target"});y_=Ng=h0e([Hd(3,Ne),Hd(4,xt),Hd(5,gi),Hd(6,Be),Hd(7,_n),Hd(8,en),Hd(9,gr),Hd(10,Yt),Hd(11,Ce)],y_);let g0e=0,f0e=class{constructor(e,t,i,n,o,r){this.model=e,this.viewModel=t,this.view=i,this.hasRealView=n,this.listenersToRemove=o,this.attachedView=r}dispose(){jt(this.listenersToRemove),this.model.onBeforeDetached(this.attachedView),this.hasRealView&&this.view.dispose(),this.viewModel.dispose()}};class F8 extends H{constructor(e){super(),this._emitterOptions=e,this._onDidChangeToTrue=this._register(new B(this._emitterOptions)),this.onDidChangeToTrue=this._onDidChangeToTrue.event,this._onDidChangeToFalse=this._register(new B(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 us extends B{constructor(e,t){super({deliveryQueue:t}),this._contributions=e}fire(e){this._contributions.onBeforeInteractionEvent(),super.fire(e)}}class p0e extends H{constructor(e,t){super(),this._editor=e,t.createKey("editorId",e.getId()),this._editorSimpleInput=T.editorSimpleInput.bindTo(t),this._editorFocus=T.focus.bindTo(t),this._textInputFocus=T.textInputFocus.bindTo(t),this._editorTextFocus=T.editorTextFocus.bindTo(t),this._tabMovesFocus=T.tabMovesFocus.bindTo(t),this._editorReadonly=T.readOnly.bindTo(t),this._inDiffEditor=T.inDiffEditor.bindTo(t),this._editorColumnSelection=T.columnSelection.bindTo(t),this._hasMultipleSelections=T.hasMultipleSelections.bindTo(t),this._hasNonEmptySelection=T.hasNonEmptySelection.bindTo(t),this._canUndo=T.canUndo.bindTo(t),this._canRedo=T.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(p_.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(p_.getTabFocusMode()),this._editorReadonly.set(e.get(91)),this._inDiffEditor.set(e.get(61)),this._editorColumnSelection.set(e.get(22))}_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 m0e extends H{constructor(e,t,i){super(),this._editor=e,this._contextKeyService=t,this._languageFeaturesService=i,this._langId=T.languageId.bindTo(t),this._hasCompletionItemProvider=T.hasCompletionItemProvider.bindTo(t),this._hasCodeActionsProvider=T.hasCodeActionsProvider.bindTo(t),this._hasCodeLensProvider=T.hasCodeLensProvider.bindTo(t),this._hasDefinitionProvider=T.hasDefinitionProvider.bindTo(t),this._hasDeclarationProvider=T.hasDeclarationProvider.bindTo(t),this._hasImplementationProvider=T.hasImplementationProvider.bindTo(t),this._hasTypeDefinitionProvider=T.hasTypeDefinitionProvider.bindTo(t),this._hasHoverProvider=T.hasHoverProvider.bindTo(t),this._hasDocumentHighlightProvider=T.hasDocumentHighlightProvider.bindTo(t),this._hasDocumentSymbolProvider=T.hasDocumentSymbolProvider.bindTo(t),this._hasReferenceProvider=T.hasReferenceProvider.bindTo(t),this._hasRenameProvider=T.hasRenameProvider.bindTo(t),this._hasSignatureHelpProvider=T.hasSignatureHelpProvider.bindTo(t),this._hasInlayHintsProvider=T.hasInlayHintsProvider.bindTo(t),this._hasDocumentFormattingProvider=T.hasDocumentFormattingProvider.bindTo(t),this._hasDocumentSelectionFormattingProvider=T.hasDocumentSelectionFormattingProvider.bindTo(t),this._hasMultipleDocumentFormattingProvider=T.hasMultipleDocumentFormattingProvider.bindTo(t),this._hasMultipleDocumentSelectionFormattingProvider=T.hasMultipleDocumentSelectionFormattingProvider.bindTo(t),this._isInEmbeddedEditor=T.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===Ge.walkThroughSnippet||e.uri.scheme===Ge.vscodeChatCodeBlock)})}}class _0e extends H{constructor(e,t){super(),this._onChange=this._register(new B),this.onChange=this._onChange.event,this._hadFocus=void 0,this._hasDomElementFocus=!1,this._domFocusTracker=this._register(ba(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(ba(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(){var e;return(e=this._hadFocus)!==null&&e!==void 0?e:!1}}class v0e{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 b0e=encodeURIComponent("");function TI(s){return b0e+encodeURIComponent(s.toString())+C0e}const w0e=encodeURIComponent('');function S0e(s){return w0e+encodeURIComponent(s.toString())+y0e}zr((s,e)=>{const t=s.getColor(Jl);t&&e.addRule(`.monaco-editor .squiggly-error { background: url("data:image/svg+xml,${TI(t)}") repeat-x bottom left; }`);const i=s.getColor(vs);i&&e.addRule(`.monaco-editor .squiggly-warning { background: url("data:image/svg+xml,${TI(i)}") repeat-x bottom left; }`);const n=s.getColor(ro);n&&e.addRule(`.monaco-editor .squiggly-info { background: url("data:image/svg+xml,${TI(n)}") repeat-x bottom left; }`);const o=s.getColor(Rue);o&&e.addRule(`.monaco-editor .squiggly-hint { background: url("data:image/svg+xml,${S0e(o)}") no-repeat bottom left; }`);const r=s.getColor(sfe);r&&e.addRule(`.monaco-editor.showUnused .squiggly-inline-unnecessary { opacity: ${r.rgba.a}; }`)});var D0e=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},L0e=function(s,e){return function(t,i){e(t,i,s)}};let e2=class extends H{constructor(e){super(),this._themeService=e,this._onWillCreateCodeEditor=this._register(new B),this._onCodeEditorAdd=this._register(new B),this.onCodeEditorAdd=this._onCodeEditorAdd.event,this._onCodeEditorRemove=this._register(new B),this.onCodeEditorRemove=this._onCodeEditorRemove.event,this._onWillCreateDiffEditor=this._register(new B),this._onDiffEditorAdd=this._register(new B),this.onDiffEditorAdd=this._onDiffEditorAdd.event,this._onDiffEditorRemove=this._register(new B),this.onDiffEditorRemove=this._onDiffEditorRemove.event,this._decorationOptionProviders=new Map,this._codeEditorOpenHandlers=new Rs,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)}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 o;this._modelProperties.has(n)?o=this._modelProperties.get(n):(o=new Map,this._modelProperties.set(n,o)),o.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 o=await n(e,t,i);if(o!==null)return o}return null}registerCodeEditorOpenHandler(e){const t=this._codeEditorOpenHandlers.unshift(e);return Ie(t)}};e2=D0e([L0e(0,_n)],e2);var x0e=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},O8=function(s,e){return function(t,i){e(t,i,s)}};let _D=class extends e2{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,o)=>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 o=t.resource.scheme;if(o===Ge.http||o===Ge.https)return Pz(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 o={lineNumber:n.startLineNumber,column:n.startColumn};e.setPosition(o),e.revealPositionInCenter(o,1)}return e}findModel(e,t){const i=e.getModel();return i&&i.uri.toString()!==t.toString()?null:i}};_D=x0e([O8(0,Be),O8(1,_n)],_D);mt(xt,_D,0);const ig=ut("layoutService");var F$=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},O$=function(s,e){return function(t,i){e(t,i,s)}};let vD=class{get mainContainer(){var e,t;return(t=(e=FP(this._codeEditorService.listCodeEditors()))===null||e===void 0?void 0:e.getContainerDomNode())!==null&&t!==void 0?t:Ht.document.body}get activeContainer(){var e,t;const i=(e=this._codeEditorService.getFocusedCodeEditor())!==null&&e!==void 0?e:this._codeEditorService.getActiveCodeEditor();return(t=i==null?void 0:i.getContainerDomNode())!==null&&t!==void 0?t:this.mainContainer}get mainContainerDimension(){return Eh(this.mainContainer)}get activeContainerDimension(){return Eh(this.activeContainer)}get containers(){return pd(this._codeEditorService.listCodeEditors().map(e=>e.getContainerDomNode()))}getContainer(){return this.activeContainer}whenContainerStylesLoaded(){}focus(){var e;(e=this._codeEditorService.getFocusedCodeEditor())===null||e===void 0||e.focus()}constructor(e){this._codeEditorService=e,this.onDidLayoutMainContainer=le.None,this.onDidLayoutActiveContainer=le.None,this.onDidLayoutContainer=le.None,this.onDidChangeActiveContainer=le.None,this.onDidAddContainer=le.None,this.mainContainerOffset={top:0,quickPickTop:0},this.activeContainerOffset={top:0,quickPickTop:0}}};vD=F$([O$(0,xt)],vD);let t2=class extends vD{get mainContainer(){return this._container}constructor(e,t){super(t),this._container=e}};t2=F$([O$(1,xt)],t2);mt(ig,vD,1);const dO=ut("dialogService");var k0e=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},B8=function(s,e){return function(t,i){e(t,i,s)}};function Bw(s){return s.scheme===Ge.file?s.fsPath:s.path}let B$=0;class Ww{constructor(e,t,i,n,o,r,a){this.id=++B$,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=o,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 W8{constructor(e,t){this.resourceLabel=e,this.reason=t}}class H8{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(p({},"The following files have been closed and modified on disk: {0}.",e.join(", "))),t.length>0&&i.push(p({},"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 E0e{constructor(e,t,i,n,o,r,a){this.id=++B$,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=o,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 H8),this.removedResources.has(t)||this.removedResources.set(t,new W8(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 H8),this.invalidatedResources.has(t)||this.invalidatedResources.set(t,new W8(e,0)))}toString(){return`[id:${this.id}] [group:${this.groupId}] [${this.invalidatedResources?"INVALID":" VALID"}] ${this.actual.constructor.name} - ${this.actual}`}}class W${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 T$(e,t)}restoreSnapshot(e){const t=e.elements.length;let i=!0,n=0,o=-1;for(let a=0,l=this._past.length;a=t||d.id!==e.elements[n])&&(i=!1,o=0),!i&&d.type===1&&d.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)}o!==-1&&(this._past=this._past.slice(0,o)),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 NI{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 $l){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){Xe(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,o){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(),o()),l=>(r(),n.dispose(),this._onError(l,e))):(r(),n.dispose(),o())}async _invokeWorkspacePrepare(e){if(typeof e.actual.prepareUndoRedo>"u")return H.None;const t=e.actual.prepareUndoRedo();return typeof t>"u"?H.None:t}_invokeResourcePrepare(e,t){if(e.actual.type!==1||typeof e.actual.prepareUndoRedo>"u")return t(H.None);const i=e.actual.prepareUndoRedo();return i?jL(i)?t(i):i.then(n=>t(n)):t(H.None)}_getAffectedEditStacks(e){const t=[];for(const i of e.strResources)t.push(this._editStacks.get(i)||H$);return new NI(t)}_tryToSplitAndUndo(e,t,i,n){if(t.canSplit())return this._splitPastWorkspaceElement(t,i),this._notificationService.warn(n),new Hw(this._undo(e,0,!0));for(const o of t.strResources)this.removeElements(o);return this._notificationService.warn(n),new Hw}_checkWorkspaceUndo(e,t,i,n){if(t.removedResources)return this._tryToSplitAndUndo(e,t,t.removedResources,p({},"Could not undo '{0}' across all files. {1}",t.label,t.removedResources.createMessage()));if(n&&t.invalidatedResources)return this._tryToSplitAndUndo(e,t,t.invalidatedResources,p({},"Could not undo '{0}' across all files. {1}",t.label,t.invalidatedResources.createMessage()));const o=[];for(const a of i.editStacks)a.getClosestPastElement()!==t&&o.push(a.resourceLabel);if(o.length>0)return this._tryToSplitAndUndo(e,t,null,p({},"Could not undo '{0}' across all files because changes were made to {1}",t.label,o.join(", ")));const r=[];for(const a of i.editStacks)a.locked&&r.push(a.resourceLabel);return r.length>0?this._tryToSplitAndUndo(e,t,null,p({},"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,p({},"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),o=this._checkWorkspaceUndo(e,t,n,!1);return o?o.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(c){c[c.All=0]="All",c[c.This=1]="This",c[c.Cancel=2]="Cancel"})(a||(a={}));const{result:l}=await this._dialogService.prompt({type:Bi.Info,message:p("confirmWorkspace","Would you like to undo '{0}' across all files?",t.label),buttons:[{label:p({},"&&Undo in {0} Files",i.editStacks.length),run:()=>a.All},{label:p({},"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 d=this._checkWorkspaceUndo(e,t,i,!1);if(d)return d.returnValue;n=!0}let o;try{o=await this._invokeWorkspacePrepare(t)}catch(a){return this._onError(a,t)}const r=this._checkWorkspaceUndo(e,t,i,!0);if(r)return o.dispose(),r.returnValue;for(const a of i.editStacks)a.moveBackward(t);return this._safeInvokeWithLocks(t,()=>t.actual.undo(),i,o,()=>this._continueUndoInGroup(t.groupId,n))}_resourceUndo(e,t,i){if(!t.isValid){e.flushAllElements();return}if(e.locked){const n=p({},"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 NI([e]),n,()=>this._continueUndoInGroup(t.groupId,i))))}_findClosestUndoElementInGroup(e){if(!e)return[null,null];let t=null,i=null;for(const[n,o]of this._editStacks){const r=o.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 $l){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),o=n.getClosestPastElement();if(!o)return;if(o.groupId){const[a,l]=this._findClosestUndoElementInGroup(o.groupId);if(o!==a&&l)return this._undo(l,t,i)}if((o.sourceId!==t||o.confirmBeforeUndo)&&!i)return this._confirmAndContinueUndo(e,t,o);try{return o.type===1?this._workspaceUndo(e,o,i):this._resourceUndo(n,o,i)}finally{}}async _confirmAndContinueUndo(e,t,i){if((await this._dialogService.confirm({message:p("confirmDifferentSource","Would you like to undo '{0}'?",i.label),primaryButton:p({},"&&Yes"),cancelButton:p("confirmDifferentSource.no","No")})).confirmed)return this._undo(e,t,!0)}_findClosestRedoElementWithSource(e){if(!e)return[null,null];let t=null,i=null;for(const[n,o]of this._editStacks){const r=o.getClosestFutureElement();r&&r.sourceId===e&&(!t||r.sourceOrder0)return this._tryToSplitAndRedo(e,t,null,p({},"Could not redo '{0}' across all files because changes were made to {1}",t.label,o.join(", ")));const r=[];for(const a of i.editStacks)a.locked&&r.push(a.resourceLabel);return r.length>0?this._tryToSplitAndRedo(e,t,null,p({},"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,p({},"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 o=this._checkWorkspaceRedo(e,t,i,!0);if(o)return n.dispose(),o.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=p({},"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 NI([e]),i,()=>this._continueRedoInGroup(t.groupId))))}_findClosestRedoElementInGroup(e){if(!e)return[null,null];let t=null,i=null;for(const[n,o]of this._editStacks){const r=o.getClosestFutureElement();r&&r.groupId===e&&(!t||r.groupOrder=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},V8=function(s,e){return function(t,i){e(t,i,s)}};const Ur=ut("ILanguageFeatureDebounceService");var bD;(function(s){const e=new WeakMap;let t=0;function i(n){let o=e.get(n);return o===void 0&&(o=++t,e.set(n,o)),o}s.of=i})(bD||(bD={}));class N0e{constructor(e){this._default=e}get(e){return this._default}update(e,t){return this._default}default(){return this._default}}class A0e{constructor(e,t,i,n,o,r){this._logService=e,this._name=t,this._registry=i,this._default=n,this._min=o,this._max=r,this._cache=new iu(50,.7)}_key(e){return e.id+this._registry.all(e).reduce((t,i)=>YL(bD.of(i),t),0)}get(e){const t=this._key(e),i=this._cache.get(t);return i?xs(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 I0e(6),this._cache.set(i,n));const o=xs(n.update(t),this._min,this._max);return rF(e.uri,"output")||this._logService.trace(`[DEBOUNCE: ${this._name}] for ${e.uri.toString()} is ${o}ms`),o}_overall(){const e=new V$;for(const[,t]of this._cache)e.update(t.value);return e.value}default(){const e=this._overall()|0||this._default;return xs(e,this._min,this._max)}}let n2=class{constructor(e,t){this._logService=e,this._data=new Map,this._isDev=t.isExtensionDevelopment||!t.isBuilt}for(e,t,i){var n,o,r;const a=(n=i==null?void 0:i.min)!==null&&n!==void 0?n:50,l=(o=i==null?void 0:i.max)!==null&&o!==void 0?o:a**2,d=(r=i==null?void 0:i.key)!==null&&r!==void 0?r:void 0,c=`${bD.of(e)},${a}${d?","+d:""}`;let u=this._data.get(c);return u||(this._isDev?(this._logService.debug(`[DEBOUNCE: ${t}] is disabled in developed mode`),u=new N0e(a*1.5)):u=new A0e(this._logService,t,e,this._overallAverage()|0||a*1.5,a,l),this._data.set(c,u)),u}_overallAverage(){const e=new V$;for(const t of this._data.values())e.update(t.default());return e.value}};n2=T0e([V8(0,ys),V8(1,cO)],n2);mt(Ur,n2,1);class rb{static create(e,t){return new rb(e,new CD(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 x(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,o,r]=this._tokens.split(t,e.startColumn-1,i,e.endColumn-1);return[new rb(this._startLineNumber,n),new rb(this._startLineNumber+r,o)]}applyEdit(e,t){const[i,n,o]=Ah(t);this.acceptEdit(e,i,n,o,t.length>0?t.charCodeAt(0):0)}acceptEdit(e,t,i,n,o){this._acceptDeleteRange(e),this._acceptInsertText(new W(e.startLineNumber,e.startColumn),t,i,n,o),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 o=i-t;this._startLineNumber-=o;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 o=-t;this._startLineNumber-=o,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,o){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,o)}}class CD{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||h===e&&f>=t)&&(he||f===e&&_>=t){if(fo?m-=o-i:m=i;else if(g===t&&f===i)if(g===n&&m>o)m-=o-i;else{c=!0;continue}else if(go)g=t,f=i,m=f+(m-o);else{c=!0;continue}else if(g>n){if(l===0&&!c){d=a;break}g-=l}else if(g===n&&f>=o)e&&g===0&&(f+=e,m+=e),g-=l,f-=o-i,m-=o-i;else throw new Error("Not possible!");const v=4*d;r[v]=g,r[v+1]=f,r[v+2]=m,r[v+3]=_,d++}this._tokenCount=d}acceptInsertText(e,t,i,n,o,r){const a=i===0&&n===1&&(r>=48&&r<=57||r>=65&&r<=90||r>=97&&r<=122),l=this._tokens,d=this._tokenCount;for(let c=0;c=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},AI=function(s,e){return function(t,i){e(t,i,s)}};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 ic}getMetadata(e,t,i){const n=this._languageService.languageIdCodec.encodeLanguageId(i),o=this._hashTable.get(e,t,n);let r;if(o)r=o.metadata,this._logService.getLevel()===Zn.Trace&&this._logService.trace(`SemanticTokensProviderStyling [CACHED] ${e} / ${t}: foreground ${yo.getForeground(r)}, fontStyle ${yo.getFontStyle(r).toString(2)}`);else{let a=this._legend.tokenTypes[e];const l=[];if(a){let d=t;for(let u=0;d>0&&u>1;d>0&&this._logService.getLevel()===Zn.Trace&&(this._logService.trace(`SemanticTokensProviderStyling: unknown token modifier index: ${t.toString(2)} for legend: ${JSON.stringify(this._legend.tokenModifiers)}`),l.push("not-in-legend"));const c=this._themeService.getColorTheme().getTokenStyleMetadata(a,l,i);if(typeof c>"u")r=2147483647;else{if(r=0,typeof c.italic<"u"){const u=(c.italic?1:0)<<11;r|=u|1}if(typeof c.bold<"u"){const u=(c.bold?2:0)<<11;r|=u|2}if(typeof c.underline<"u"){const u=(c.underline?4:0)<<11;r|=u|4}if(typeof c.strikethrough<"u"){const u=(c.strikethrough?8:0)<<11;r|=u|8}if(c.foreground){const u=c.foreground<<15;r|=u|16}r===0&&(r=2147483647)}}else this._logService.getLevel()===Zn.Trace&&this._logService.trace(`SemanticTokensProviderStyling: unknown token type index: ${e} for legend: ${JSON.stringify(this._legend.tokenTypes)}`),r=2147483647,a="not-in-legend";this._hashTable.add(e,t,n,r),this._logService.getLevel()===Zn.Trace&&this._logService.trace(`SemanticTokensProviderStyling ${e} (${a}) / ${t} (${l.join(" ")}): foreground ${yo.getForeground(r)}, fontStyle ${yo.getFontStyle(r).toString(2)}`)}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,o){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 ${o}).`))}};s2=M0e([AI(1,_n),AI(2,vi),AI(3,ys)],s2);function z$(s,e,t){const i=s.data,n=s.data.length/5|0,o=Math.max(Math.ceil(n/1024),400),r=[];let a=0,l=1,d=0;for(;ac&&i[5*b]===0;)b--;if(b-1===c){let C=u;for(;C+1D)e.warnOverlappingSemanticTokens(y,D+1);else{const R=e.getMetadata(I,O,t);R!==2147483647&&(f===0&&(f=y),h[g]=y-f,h[g+1]=D,h[g+2]=k,h[g+3]=R,g+=4,m=y,_=k)}l=y,d=D,a++}g!==h.length&&(h=h.subarray(0,g));const v=rb.create(f,h);r.push(v)}return r}class R0e{constructor(e,t,i,n){this.tokenTypeIndex=e,this.tokenModifierSet=t,this.languageId=i,this.metadata=n,this.next=null}}class ic{constructor(){this._elementsCount=0,this._currentLengthIndex=0,this._currentLength=ic._SIZES[this._currentLengthIndex],this._growCount=Math.round(this._currentLengthIndex+1=this._growCount){const o=this._elements;this._currentLengthIndex++,this._currentLength=ic._SIZES[this._currentLengthIndex],this._growCount=Math.round(this._currentLengthIndex+1=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},MI=function(s,e){return function(t,i){e(t,i,s)}};let o2=class extends H{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)}};o2=P0e([MI(0,_n),MI(1,ys),MI(2,vi)],o2);mt(Px,o2,1);const Vw="**",U8="/",Yy="[/\\\\]",Qy="[^/\\\\]",F0e=/\//g;function $8(s,e){switch(s){case 0:return"";case 1:return`${Qy}*?`;default:return`(?:${Yy}|${Qy}+${Yy}${e?`|${Yy}${Qy}+`:""})*?`}}function j8(s,e){if(!s)return[];const t=[];let i=!1,n=!1,o="";for(const r of s){switch(r){case e:if(!i&&!n){t.push(o),o="";continue}break;case"{":i=!0;break;case"}":i=!1;break;case"[":n=!0;break;case"]":n=!1;break}o+=r}return o&&t.push(o),t}function U$(s){if(!s)return"";let e="";const t=j8(s,U8);if(t.every(i=>i===Vw))e=".*";else{let i=!1;t.forEach((n,o)=>{if(n===Vw){if(i)return;e+=$8(2,o===t.length-1)}else{let r=!1,a="",l=!1,d="";for(const c of n){if(c!=="}"&&r){a+=c;continue}if(l&&(c!=="]"||!d)){let u;c==="-"?u=c:(c==="^"||c==="!")&&!d?u="^":c===U8?u="":u=rr(c),d+=u;continue}switch(c){case"{":r=!0;continue;case"[":l=!0;continue;case"}":{const h=`(?:${j8(a,",").map(g=>U$(g)).join("|")})`;e+=h,r=!1,a="";break}case"]":{e+="["+d+"]",l=!1,d="";break}case"?":e+=Qy;continue;case"*":e+=$8(1);continue;default:e+=rr(c)}}ouO(a,e)).filter(a=>a!==cd),s),i=t.length;if(!i)return cd;if(i===1)return t[0];const n=function(a,l){for(let d=0,c=t.length;d!!a.allBasenames);o&&(n.allBasenames=o.allBasenames);const r=t.reduce((a,l)=>l.allPaths?a.concat(l.allPaths):a,[]);return r.length&&(n.allPaths=r),n}function Z8(s,e,t){const i=sh===Yi.sep,n=i?s:s.replace(F0e,sh),o=sh+n,r=Yi.sep+s;let a;return t?a=function(l,d){return typeof l=="string"&&(l===n||l.endsWith(o)||!i&&(l===s||l.endsWith(r)))?e:null}:a=function(l,d){return typeof l=="string"&&(l===n||!i&&l===s)?e:null},a.allPaths=[(t?"*/":"./")+s],a}function K0e(s){try{const e=new RegExp(`^${U$(s)}$`);return function(t){return e.lastIndex=0,typeof t=="string"&&e.test(t)?s:null}}catch{return cd}}function q0e(s,e,t){return!s||typeof e!="string"?!1:$$(s)(e,void 0,t)}function $$(s,e={}){if(!s)return q8;if(typeof s=="string"||G0e(s)){const t=uO(s,e);if(t===cd)return q8;const i=function(n,o){return!!t(n,o)};return t.allBasenames&&(i.allBasenames=t.allBasenames),t.allPaths&&(i.allPaths=t.allPaths),i}return Z0e(s,e)}function G0e(s){const e=s;return e?typeof e.base=="string"&&typeof e.pattern=="string":!1}function Z0e(s,e){const t=j$(Object.getOwnPropertyNames(s).map(a=>X0e(a,s[a],e)).filter(a=>a!==cd)),i=t.length;if(!i)return cd;if(!t.some(a=>!!a.requiresSiblings)){if(i===1)return t[0];const a=function(c,u){let h;for(let g=0,f=t.length;g{for(const g of h){const f=await g;if(typeof f=="string")return f}return null})():null},l=t.find(c=>!!c.allBasenames);l&&(a.allBasenames=l.allBasenames);const d=t.reduce((c,u)=>u.allPaths?c.concat(u.allPaths):c,[]);return d.length&&(a.allPaths=d),a}const n=function(a,l,d){let c,u;for(let h=0,g=t.length;h{for(const h of u){const g=await h;if(typeof g=="string")return g}return null})():null},o=t.find(a=>!!a.allBasenames);o&&(n.allBasenames=o.allBasenames);const r=t.reduce((a,l)=>l.allPaths?a.concat(l.allPaths):a,[]);return r.length&&(n.allPaths=r),n}function X0e(s,e,t){if(e===!1)return cd;const i=uO(s,t);if(i===cd)return cd;if(typeof e=="boolean")return i;if(e){const n=e.when;if(typeof n=="string"){const o=(r,a,l,d)=>{if(!d||!i(r,a))return null;const c=n.replace("$(basename)",()=>l),u=d(c);return eA(u)?u.then(h=>h?s:null):u?s:null};return o.requiresSiblings=!0,o}}return i}function j$(s,e){const t=s.filter(a=>!!a.basenames);if(t.length<2)return s;const i=t.reduce((a,l)=>{const d=l.basenames;return d?a.concat(d):a},[]);let n;if(e){n=[];for(let a=0,l=i.length;a{const d=l.patterns;return d?a.concat(d):a},[]);const o=function(a,l){if(typeof a!="string")return null;if(!l){let c;for(c=a.length;c>0;c--){const u=a.charCodeAt(c-1);if(u===47||u===92)break}l=a.substr(c)}const d=i.indexOf(l);return d!==-1?n[d]:null};o.basenames=i,o.patterns=n,o.allBasenames=i;const r=s.filter(a=>!a.basenames);return r.push(o),r}function hO(s,e,t,i,n,o){if(Array.isArray(s)){let r=0;for(const a of s){const l=hO(a,e,t,i,n,o);if(l===10)return l;l>r&&(r=l)}return r}else{if(typeof s=="string")return i?s==="*"?5:s===t?10:0:0;if(s){const{language:r,pattern:a,scheme:l,hasAccessToAllModels:d,notebookType:c}=s;if(!i&&!d)return 0;c&&n&&(e=n);let u=0;if(l)if(l===e.scheme)u=10;else if(l==="*")u=5;else return 0;if(r)if(r===t)u=10;else if(r==="*")u=Math.max(u,5);else return 0;if(c)if(c===o)u=10;else if(c==="*"&&o!==void 0)u=Math.max(u,5);else return 0;if(a){let h;if(typeof a=="string"?h=a:h={...a,base:ZV(a.base)},h===e.fsPath||q0e(h,e.fsPath))u=10;else return 0}return u}else return 0}}function K$(s){return typeof s=="string"?!1:Array.isArray(s)?s.every(K$):!!s.exclusive}class X8{constructor(e,t,i,n){this.uri=e,this.languageId=t,this.notebookUri=i,this.notebookType=n}equals(e){var t,i;return this.notebookType===e.notebookType&&this.languageId===e.languageId&&this.uri.toString()===e.uri.toString()&&((t=this.notebookUri)===null||t===void 0?void 0:t.toString())===((i=e.notebookUri)===null||i===void 0?void 0:i.toString())}}class fi{constructor(e){this._notebookInfoResolver=e,this._clock=0,this._entries=[],this._onDidChange=new B,this.onDidChange=this._onDidChange.event}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),Ie(()=>{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);const t=[];for(const i of this._entries)i._score>0&&t.push(i.provider);return t}ordered(e){const t=[];return this._orderedForEach(e,i=>t.push(i.provider)),t}orderedGroups(e){const t=[];let i,n;return this._orderedForEach(e,o=>{i&&n===o._score?i.push(o.provider):(n=o._score,i=[o.provider],t.push(i))}),t}_orderedForEach(e,t){this._updateScores(e);for(const i of this._entries)i._score>0&&t(i)}_updateScores(e){var t,i;const n=(t=this._notebookInfoResolver)===null||t===void 0?void 0:t.call(this,e.uri),o=n?new X8(e.uri,e.getLanguageId(),n.uri,n.type):new X8(e.uri,e.getLanguageId(),void 0,void 0);if(!(!((i=this._lastCandidate)===null||i===void 0)&&i.equals(o))){this._lastCandidate=o;for(const r of this._entries)if(r._score=hO(r.selector,o.uri,o.languageId,aU(e),o.notebookUri,o.notebookType),K$(r.selector)&&r._score>0){for(const a of this._entries)a._score=0;r._score=1e3;break}this._entries.sort(fi._compareByScoreAndTime)}}static _compareByScoreAndTime(e,t){return e._scoret._score?-1:Lv(e.selector)&&!Lv(t.selector)?1:!Lv(e.selector)&&Lv(t.selector)?-1:e._timet._time?-1:0}}function Lv(s){return typeof s=="string"?!1:Array.isArray(s)?s.some(Lv):!!s.isBuiltin}class Y0e{constructor(){this.referenceProvider=new fi(this._score.bind(this)),this.renameProvider=new fi(this._score.bind(this)),this.newSymbolNamesProvider=new fi(this._score.bind(this)),this.codeActionProvider=new fi(this._score.bind(this)),this.definitionProvider=new fi(this._score.bind(this)),this.typeDefinitionProvider=new fi(this._score.bind(this)),this.declarationProvider=new fi(this._score.bind(this)),this.implementationProvider=new fi(this._score.bind(this)),this.documentSymbolProvider=new fi(this._score.bind(this)),this.inlayHintsProvider=new fi(this._score.bind(this)),this.colorProvider=new fi(this._score.bind(this)),this.codeLensProvider=new fi(this._score.bind(this)),this.documentFormattingEditProvider=new fi(this._score.bind(this)),this.documentRangeFormattingEditProvider=new fi(this._score.bind(this)),this.onTypeFormattingEditProvider=new fi(this._score.bind(this)),this.signatureHelpProvider=new fi(this._score.bind(this)),this.hoverProvider=new fi(this._score.bind(this)),this.documentHighlightProvider=new fi(this._score.bind(this)),this.multiDocumentHighlightProvider=new fi(this._score.bind(this)),this.selectionRangeProvider=new fi(this._score.bind(this)),this.foldingRangeProvider=new fi(this._score.bind(this)),this.linkProvider=new fi(this._score.bind(this)),this.inlineCompletionsProvider=new fi(this._score.bind(this)),this.inlineEditProvider=new fi(this._score.bind(this)),this.completionProvider=new fi(this._score.bind(this)),this.linkedEditingRangeProvider=new fi(this._score.bind(this)),this.documentRangeSemanticTokensProvider=new fi(this._score.bind(this)),this.documentSemanticTokensProvider=new fi(this._score.bind(this)),this.documentDropEditProvider=new fi(this._score.bind(this)),this.documentPasteEditProvider=new fi(this._score.bind(this))}_score(e){var t;return(t=this._notebookTypeResolver)===null||t===void 0?void 0:t.call(this,e)}}mt(Ce,Y0e,1);var Q0e=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Y8=function(s,e){return function(t,i){e(t,i,s)}};const Md=ut("hoverService");let S_=class extends H{get delay(){return this.isInstantlyHovering()?0:this._delay}constructor(e,t,i={},n,o){super(),this.placement=e,this.instantHover=t,this.overrideOptions=i,this.configurationService=n,this.hoverService=o,this.lastHoverHideTime=0,this.timeLimit=200,this.hoverDisposables=this._register(new Y),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=e.target instanceof HTMLElement?[e.target]:e.target.targetElements;for(const r of n)this.hoverDisposables.add(Ni(r,"keydown",a=>{a.equals(9)&&this.hoverService.hideHover()}));const o=e.content instanceof HTMLElement?void 0:e.content.toString();return this.hoverService.showHover({...e,...i,persistence:{hideOnKeyDown:!0,...i.persistence},id:o,appearance:{...e.appearance,compact:!0,skipFadeInAnimation:this.isInstantlyHovering(),...i.appearance}},t)}isInstantlyHovering(){return this.instantHover&&Date.now()-this.lastHoverHideTime{i.stopPropagation(),i.preventDefault(),t(e)}))}}class Z$ extends H{constructor(e,t,i){super(),this._register(K(e,ee.KEY_DOWN,n=>{const o=new Kt(n);i.some(r=>o.equals(r))&&(n.stopPropagation(),n.preventDefault(),t(e))}))}}const Bo=ut("openerService");function J0e(s){let e;const t=/^L?(\d+)(?:,(\d+))?(-L?(\d+)(?:,(\d+))?)?/.exec(s.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},s=s.with({fragment:""})),{selection:e,uri:s}}function eve(s,e={}){const t=fO(e);return t.textContent=s,t}function tve(s,e={}){const t=fO(e);return X$(t,nve(s,!!e.renderCodeSegments),e.actionHandler,e.renderCodeSegments),t}function fO(s){const e=s.inline?"span":"div",t=document.createElement(e);return s.className&&(t.className=s.className),t}class ive{constructor(e){this.source=e,this.index=0}eos(){return this.index>=this.source.length}next(){const e=this.peek();return this.advance(),e}peek(){return this.source[this.index]}advance(){this.index++}}function X$(s,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 o=document.createElement("a");t.disposables.add(Ni(o,"click",r=>{t.callback(String(e.index),r)})),n=o}else e.type===8?n=document.createElement("br"):e.type===1&&(n=s);n&&s!==n&&s.appendChild(n),n&&Array.isArray(e.children)&&e.children.forEach(o=>{X$(n,o,t,i)})}function nve(s,e){const t={type:1,children:[]};let i=0,n=t;const o=[],r=new ive(s);for(;!r.eos();){let a=r.next();const l=a==="\\"&&r2(r.peek(),e)!==0;if(l&&(a=r.next()),!l&&sve(a,e)&&a===r.peek()){r.advance(),n.type===2&&(n=o.pop());const d=r2(a,e);if(n.type===d||n.type===5&&d===6)n=o.pop();else{const c={type:d,children:[]};d===5&&(c.index=i,i++),n.children.push(c),o.push(n),n=c}}else if(a===` `)n.type===2&&(n=o.pop()),n.children.push({type:8});else if(n.type!==2){const d={type:2,content:a};n.children.push(d),o.push(n),n=d}else n.content+=a}return n.type===2&&(n=o.pop()),t}function sve(s,e){return r2(s,e)!==0}function r2(s,e){switch(s){case"*":return 3;case"_":return 4;case"[":return 5;case"]":return 6;case"`":return e?7:0;default:return 0}}const ove=new RegExp(`(\\\\)?\\$\\((${Pe.iconNameExpression}(?:${Pe.iconModifierExpression})?)\\)`,"g");function lh(s){const e=new Array;let t,i=0,n=0;for(;(t=ove.exec(s))!==null;){n=t.index||0,i0?[{start:0,end:e.length}]:[]:null}function rve(s,e){const t=e.toLowerCase().indexOf(s.toLowerCase());return t===-1?null:[{start:t,end:t+s.length}]}function J$(s,e){return a2(s.toLowerCase(),e.toLowerCase(),0,0)}function a2(s,e,t,i){if(t===s.length)return[];if(i===e.length)return null;if(s[t]===e[i]){let n=null;return(n=a2(s,e,t+1,i+1))?tj({start:i,end:i+1},n):null}return a2(s,e,t,i+1)}function pO(s){return 97<=s&&s<=122}function Ox(s){return 65<=s&&s<=90}function mO(s){return 48<=s&&s<=57}function ave(s){return s===32||s===9||s===10||s===13}const lve=new Set;"()[]{}<>`'\"-/;:,.?!".split("").forEach(s=>lve.add(s.charCodeAt(0)));function ej(s){return pO(s)||Ox(s)||mO(s)}function tj(s,e){return e.length===0?e=[s]:s.end===e[0].start?e[0].start=s.start:e.unshift(s),e}function ij(s,e){for(let t=e;t0&&!ej(s.charCodeAt(t-1)))return t}return s.length}function l2(s,e,t,i){if(t===s.length)return[];if(i===e.length)return null;if(s[t]!==e[i].toLowerCase())return null;{let n=null,o=i+1;for(n=l2(s,e,t+1,i+1);!n&&(o=ij(e,o)).6}function uve(s){const{upperPercent:e,lowerPercent:t,alphaPercent:i,numericPercent:n}=s;return t>.2&&e<.8&&i>.6&&n<.2}function hve(s){let e=0,t=0,i=0,n=0;for(let o=0;o60&&(e=e.substring(0,60));const t=dve(e);if(!uve(t)){if(!cve(t))return null;e=e.toLowerCase()}let i=null,n=0;for(s=s.toLowerCase();n"u")return[];const e=[],t=s[1];for(let i=s.length-1;i>1;i--){const n=s[i]+t,o=e[e.length-1];o&&o.end===n?o.end=n+1:e.push({start:n,end:n+1})}return e}const qu=128;function _O(){const s=[],e=[];for(let t=0;t<=qu;t++)e[t]=0;for(let t=0;t<=qu;t++)s.push(e.slice(0));return s}function sj(s){const e=[];for(let t=0;t<=s;t++)e[t]=0;return e}const oj=sj(2*qu),d2=sj(2*qu),Vd=_O(),Cg=_O(),Uw=_O();function $w(s,e){if(e<0||e>=s.length)return!1;const t=s.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!!tF(t)}}function e6(s,e){if(e<0||e>=s.length)return!1;switch(s.charCodeAt(e)){case 32:case 9:return!0;default:return!1}}function Jy(s,e,t){return e[s]!==t[s]}function _ve(s,e,t,i,n,o,r=!1){for(;equ?qu:s.length,l=i.length>qu?qu:i.length;if(t>=a||o>=l||a-t>l-o||!_ve(e,t,a,n,o,l,!0))return;vve(a,l,t,o,e,n);let d=1,c=1,u=t,h=o;const g=[!1];for(d=1,u=t;ub,I=k?Cg[d][c-1]+(Vd[d][c-1]>0?-5:0):0,O=h>b+1&&Vd[d][c-1]>0,R=O?Cg[d][c-2]+(Vd[d][c-2]>0?-5:0):0;if(O&&(!k||R>=I)&&(!D||R>=L))Cg[d][c]=R,Uw[d][c]=3,Vd[d][c]=0;else if(k&&(!D||I>=L))Cg[d][c]=I,Uw[d][c]=2,Vd[d][c]=0;else if(D)Cg[d][c]=L,Uw[d][c]=1,Vd[d][c]=Vd[d-1][c-1]+1;else throw new Error("not possible")}}if(!g[0]&&!r.firstMatchCanBeWeak)return;d--,c--;const f=[Cg[d][c],o];let m=0,_=0;for(;d>=1;){let b=c;do{const C=Uw[d][b];if(C===3)b=b-2;else if(C===2)b=b-1;else break}while(b>=1);m>1&&e[t+d-1]===n[o+c-1]&&!Jy(b+o-1,i,n)&&m+1>Vd[d][b]&&(b=c),b===c?m++:m=1,_||(_=b),d--,c=b-1,f.push(c)}l===a&&r.boostFullMatch&&(f[0]+=2);const v=_-a;return f[0]-=v,f}function vve(s,e,t,i,n,o){let r=s-1,a=e-1;for(;r>=t&&a>=i;)n[r]===o[a]&&(d2[r]=a,r--),a--}function bve(s,e,t,i,n,o,r,a,l,d,c){if(e[t]!==o[r])return Number.MIN_SAFE_INTEGER;let u=1,h=!1;return r===t-i?u=s[t]===n[r]?7:5:Jy(r,n,o)&&(r===0||!Jy(r-1,n,o))?(u=s[t]===n[r]?7:5,h=!0):$w(o,r)&&(r===0||!$w(o,r-1))?u=5:($w(o,r-1)||e6(o,r-1))&&(u=5,h=!0),u>1&&t===i&&(c[0]=!0),h||(h=Jy(r,n,o)||$w(o,r-1)||e6(o,r-1)),t===i?r>l&&(u-=h?3:5):d?u+=h?2:0:u+=h?0:1,r+1===a&&(u-=h?3:5),u}function Cve(s,e,t,i,n,o,r){return wve(s,e,t,i,n,o,!0,r)}function wve(s,e,t,i,n,o,r,a){let l=D_(s,e,t,i,n,o,a);if(s.length>=3){const d=Math.min(7,s.length-1);for(let c=t+1;cl[0])&&(l=h))}}}return l}function yve(s,e){if(e+1>=s.length)return;const t=s[e],i=s[e+1];if(t!==i)return s.slice(0,e)+i+t+s.slice(e+2)}const Sve="$(",vO=new RegExp(`\\$\\(${Pe.iconNameExpression}(?:${Pe.iconModifierExpression})?\\)`,"g"),Dve=new RegExp(`(\\\\)?${vO.source}`,"g");function Lve(s){return s.replace(Dve,(e,t)=>t?e:`\\${e}`)}const xve=new RegExp(`\\\\${vO.source}`,"g");function kve(s){return s.replace(xve,e=>`\\${e}`)}const Eve=new RegExp(`(\\s)?(\\\\)?${vO.source}(\\s)?`,"g");function rj(s){return s.indexOf(Sve)===-1?s:s.replace(Eve,(e,t,i,n)=>i?e:t||n||"")}function Ive(s){return s?s.replace(/\$\((.*?)\)/g,(e,t)=>` ${t} `).trim():""}const PI=new RegExp(`\\$\\(${Pe.iconNameCharacter}+\\)`,"g");function xv(s){PI.lastIndex=0;let e="";const t=[];let i=0;for(;;){const n=PI.lastIndex,o=PI.exec(s),r=s.substring(n,o==null?void 0:o.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+=` ${Ave(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(rr(t),"g");return e.replace(i,(n,o)=>e.charAt(o-1)!=="\\"?`\\${n}`:n)}}function L_(s){return tl(s)?!s.value:Array.isArray(s)?s.every(L_):!0}function tl(s){return s instanceof ss?!0:s&&typeof s=="object"?typeof s.value=="string"&&(typeof s.isTrusted=="boolean"||typeof s.isTrusted=="object"||s.isTrusted===void 0)&&(typeof s.supportThemeIcons=="boolean"||s.supportThemeIcons===void 0):!1}function Tve(s,e){return s===e?!0:!s||!e?!1:s.value===e.value&&s.isTrusted===e.isTrusted&&s.supportThemeIcons===e.supportThemeIcons&&s.supportHtml===e.supportHtml&&(s.baseUri===e.baseUri||!!s.baseUri&&!!e.baseUri&&ZF(Ae.from(s.baseUri),Ae.from(e.baseUri)))}function Nve(s){return s.replace(/[\\`*_{}[\]()#+\-!~]/g,"\\$&")}function Ave(s,e){var t,i;const n=(i=(t=s.match(/^`+/gm))===null||t===void 0?void 0:t.reduce((r,a)=>r.length>a.length?r:a).length)!==null&&i!==void 0?i:0,o=n>=3?n+1:3;return[`${"`".repeat(o)}${e}`,s,`${"`".repeat(o)}`].join(` `)}function jw(s){return s.replace(/"/g,""")}function OI(s){return s&&s.replace(/\\([\\`*_{}[\]()#+\-.!~])/g,"$1")}function Mve(s){const e=[],t=s.split("|").map(n=>n.trim());s=t[0];const i=t[1];if(i){const n=/height=(\d+)/.exec(i),o=/width=(\d+)/.exec(i),r=n?n[1]:"",a=o?o[1]:"",l=isFinite(parseInt(a)),d=isFinite(parseInt(r));l&&e.push(`width="${a}"`),d&&e.push(`height="${r}"`)}return{href:s,dimensions:e}}class bO{constructor(e){this._prefix=e,this._lastId=0}nextId(){return this._prefix+ ++this._lastId}}const c2=new bO("id#");let Zs={};(function(){function s(e,t){t(Zs)}s.amd=!0,function(e,t){typeof s=="function"&&s.amd?s(["exports"],t):typeof exports=="object"&&typeof module<"u"?t(exports):(e=typeof globalThis<"u"?globalThis:e||self,t(e.marked={}))}(this,function(e){function t(se,X){for(var q=0;qse.length)&&(X=se.length);for(var q=0,A=new Array(X);q=se.length?{done:!0}:{done:!1,value:se[A++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function a(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}e.defaults=a();function l(se){e.defaults=se}var d=/[&<>"']/,c=/[&<>"']/g,u=/[<>"']|&(?!#?\w+;)/,h=/[<>"']|&(?!#?\w+;)/g,g={"&":"&","<":"<",">":">",'"':""","'":"'"},f=function(X){return g[X]};function m(se,X){if(X){if(d.test(se))return se.replace(c,f)}else if(u.test(se))return se.replace(h,f);return se}var _=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function v(se){return se.replace(_,function(X,q){return q=q.toLowerCase(),q==="colon"?":":q.charAt(0)==="#"?q.charAt(1)==="x"?String.fromCharCode(parseInt(q.substring(2),16)):String.fromCharCode(+q.substring(1)):""})}var b=/(^|[^\[])\^/g;function C(se,X){se=typeof se=="string"?se:se.source,X=X||"";var q={replace:function(M,j){return j=j.source||j,j=j.replace(b,"$1"),se=se.replace(M,j),q},getRegex:function(){return new RegExp(se,X)}};return q}var w=/[^\w:]/g,y=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function D(se,X,q){if(se){var A;try{A=decodeURIComponent(v(q)).replace(w,"").toLowerCase()}catch{return null}if(A.indexOf("javascript:")===0||A.indexOf("vbscript:")===0||A.indexOf("data:")===0)return null}X&&!y.test(q)&&(q=R(X,q));try{q=encodeURI(q).replace(/%25/g,"%")}catch{return null}return q}var L={},k=/^[^:]+:\/*[^/]*$/,I=/^([^:]+:)[\s\S]*$/,O=/^([^:]+:\/*[^/]*)[\s\S]*$/;function R(se,X){L[" "+se]||(k.test(se)?L[" "+se]=se+"/":L[" "+se]=U(se,"/",!0)),se=L[" "+se];var q=se.indexOf(":")===-1;return X.substring(0,2)==="//"?q?X:se.replace(I,"$1")+X:X.charAt(0)==="/"?q?X:se.replace(O,"$1")+X:se+X}var P={exec:function(){}};function F(se){for(var X=1,q,A;X=0&&ne[Me]==="\\";)_e=!_e;return _e?"|":" |"}),A=q.split(/ \|/),M=0;if(A[0].trim()||A.shift(),A.length>0&&!A[A.length-1].trim()&&A.pop(),A.length>X)A.splice(X);else for(;A.length1;)X&1&&(q+=se),X>>=1,se+=se;return q+se}function ge(se,X,q,A){var M=X.href,j=X.title?m(X.title):null,z=se[1].replace(/\\([\[\]])/g,"$1");if(se[0].charAt(0)!=="!"){A.state.inLink=!0;var ne={type:"link",raw:q,href:M,title:j,text:z,tokens:A.inlineTokens(z)};return A.state.inLink=!1,ne}return{type:"image",raw:q,href:M,title:j,text:m(z)}}function We(se,X){var q=se.match(/^(\s+)(?:```)/);if(q===null)return X;var A=q[1];return X.split(` `).map(function(M){var j=M.match(/^\s+/);if(j===null)return M;var z=j[0];return z.length>=A.length?M.slice(A.length):M}).join(` `)}var ye=function(){function se(q){this.options=q||e.defaults}var X=se.prototype;return X.space=function(A){var M=this.rules.block.newline.exec(A);if(M&&M[0].length>0)return{type:"space",raw:M[0]}},X.code=function(A){var M=this.rules.block.code.exec(A);if(M){var j=M[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:M[0],codeBlockStyle:"indented",text:this.options.pedantic?j:U(j,` `)}}},X.fences=function(A){var M=this.rules.block.fences.exec(A);if(M){var j=M[0],z=We(j,M[3]||"");return{type:"code",raw:j,lang:M[2]?M[2].trim():M[2],text:z}}},X.heading=function(A){var M=this.rules.block.heading.exec(A);if(M){var j=M[2].trim();if(/#$/.test(j)){var z=U(j,"#");(this.options.pedantic||!z||/ $/.test(z))&&(j=z.trim())}return{type:"heading",raw:M[0],depth:M[1].length,text:j,tokens:this.lexer.inline(j)}}},X.hr=function(A){var M=this.rules.block.hr.exec(A);if(M)return{type:"hr",raw:M[0]}},X.blockquote=function(A){var M=this.rules.block.blockquote.exec(A);if(M){var j=M[0].replace(/^ *>[ \t]?/gm,"");return{type:"blockquote",raw:M[0],tokens:this.lexer.blockTokens(j,[]),text:j}}},X.list=function(A){var M=this.rules.block.list.exec(A);if(M){var j,z,ne,_e,Me,Oe,ot,tt,Jt,Vt,qe,Mi,Ri=M[1].trim(),Gr=Ri.length>1,Mt={type:"list",raw:"",ordered:Gr,start:Gr?+Ri.slice(0,-1):"",loose:!1,items:[]};Ri=Gr?"\\d{1,9}\\"+Ri.slice(-1):"\\"+Ri,this.options.pedantic&&(Ri=Gr?Ri:"[*+-]");for(var cn=new RegExp("^( {0,3}"+Ri+")((?:[ ][^\\n]*)?(?:\\n|$))");A&&(Mi=!1,!(!(M=cn.exec(A))||this.rules.block.hr.test(A)));){if(j=M[0],A=A.substring(j.length),tt=M[2].split(` `,1)[0],Jt=A.split(` `,1)[0],this.options.pedantic?(_e=2,qe=tt.trimLeft()):(_e=M[2].search(/[^ ]/),_e=_e>4?1:_e,qe=tt.slice(_e),_e+=M[1].length),Oe=!1,!tt&&/^ *$/.test(Jt)&&(j+=Jt+` `,A=A.substring(Jt.length+1),Mi=!0),!Mi)for(var hg=new RegExp("^ {0,"+Math.min(3,_e-1)+"}(?:[*+-]|\\d{1,9}[.)])((?: [^\\n]*)?(?:\\n|$))"),gg=new RegExp("^ {0,"+Math.min(3,_e-1)+"}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)"),La=new RegExp("^ {0,"+Math.min(3,_e-1)+"}(?:```|~~~)"),cu=new RegExp("^ {0,"+Math.min(3,_e-1)+"}#");A&&(Vt=A.split(` `,1)[0],tt=Vt,this.options.pedantic&&(tt=tt.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!(La.test(tt)||cu.test(tt)||hg.test(tt)||gg.test(A)));){if(tt.search(/[^ ]/)>=_e||!tt.trim())qe+=` `+tt.slice(_e);else if(!Oe)qe+=` `+tt;else break;!Oe&&!tt.trim()&&(Oe=!0),j+=Vt+` `,A=A.substring(Vt.length+1)}Mt.loose||(ot?Mt.loose=!0:/\n *\n *$/.test(j)&&(ot=!0)),this.options.gfm&&(z=/^\[[ xX]\] /.exec(qe),z&&(ne=z[0]!=="[ ] ",qe=qe.replace(/^\[[ xX]\] +/,""))),Mt.items.push({type:"list_item",raw:j,task:!!z,checked:ne,loose:!1,text:qe}),Mt.raw+=j}Mt.items[Mt.items.length-1].raw=j.trimRight(),Mt.items[Mt.items.length-1].text=qe.trimRight(),Mt.raw=Mt.raw.trimRight();var fg=Mt.items.length;for(Me=0;Me1)return!0}return!1});!Mt.loose&&pg.length&&wp&&(Mt.loose=!0,Mt.items[Me].loose=!0)}return Mt}},X.html=function(A){var M=this.rules.block.html.exec(A);if(M){var j={type:"html",raw:M[0],pre:!this.options.sanitizer&&(M[1]==="pre"||M[1]==="script"||M[1]==="style"),text:M[0]};if(this.options.sanitize){var z=this.options.sanitizer?this.options.sanitizer(M[0]):m(M[0]);j.type="paragraph",j.text=z,j.tokens=this.lexer.inline(z)}return j}},X.def=function(A){var M=this.rules.block.def.exec(A);if(M){M[3]&&(M[3]=M[3].substring(1,M[3].length-1));var j=M[1].toLowerCase().replace(/\s+/g," ");return{type:"def",tag:j,raw:M[0],href:M[2],title:M[3]}}},X.table=function(A){var M=this.rules.block.table.exec(A);if(M){var j={type:"table",header:V(M[1]).map(function(ot){return{text:ot}}),align:M[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:M[3]&&M[3].trim()?M[3].replace(/\n[ \t]*$/,"").split(` `):[]};if(j.header.length===j.align.length){j.raw=M[0];var z=j.align.length,ne,_e,Me,Oe;for(ne=0;ne/i.test(M[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(M[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(M[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:M[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(M[0]):m(M[0]):M[0]}},X.link=function(A){var M=this.rules.inline.link.exec(A);if(M){var j=M[2].trim();if(!this.options.pedantic&&/^$/.test(j))return;var z=U(j.slice(0,-1),"\\");if((j.length-z.length)%2===0)return}else{var ne=J(M[2],"()");if(ne>-1){var _e=M[0].indexOf("!")===0?5:4,Me=_e+M[1].length+ne;M[2]=M[2].substring(0,ne),M[0]=M[0].substring(0,Me).trim(),M[3]=""}}var Oe=M[2],ot="";if(this.options.pedantic){var tt=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Oe);tt&&(Oe=tt[1],ot=tt[3])}else ot=M[3]?M[3].slice(1,-1):"";return Oe=Oe.trim(),/^$/.test(j)?Oe=Oe.slice(1):Oe=Oe.slice(1,-1)),ge(M,{href:Oe&&Oe.replace(this.rules.inline._escapes,"$1"),title:ot&&ot.replace(this.rules.inline._escapes,"$1")},M[0],this.lexer)}},X.reflink=function(A,M){var j;if((j=this.rules.inline.reflink.exec(A))||(j=this.rules.inline.nolink.exec(A))){var z=(j[2]||j[1]).replace(/\s+/g," ");if(z=M[z.toLowerCase()],!z||!z.href){var ne=j[0].charAt(0);return{type:"text",raw:ne,text:ne}}return ge(j,z,j[0],this.lexer)}},X.emStrong=function(A,M,j){j===void 0&&(j="");var z=this.rules.inline.emStrong.lDelim.exec(A);if(z&&!(z[3]&&j.match(/(?:[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u0660-\u0669\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0966-\u096F\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09F9\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AE6-\u0AEF\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B6F\u0B71-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0BE6-\u0BF2\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C66-\u0C6F\u0C78-\u0C7E\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D58-\u0D61\u0D66-\u0D78\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DE6-\u0DEF\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F20-\u0F33\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F-\u1049\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1090-\u1099\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\u1369-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A20-\u1A54\u1A80-\u1A89\u1A90-\u1A99\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B50-\u1B59\u1B83-\u1BA0\u1BAE-\u1BE5\u1C00-\u1C23\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\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\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2CFD\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-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3192-\u3195\u31A0-\u31BF\u31F0-\u31FF\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA830-\uA835\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uA9E0-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uABF0-\uABF9\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\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDE80-\uDE9C\uDEA0-\uDED0\uDEE1-\uDEFB\uDF00-\uDF23\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC58-\uDC76\uDC79-\uDC9E\uDCA7-\uDCAF\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDD1B\uDD20-\uDD39\uDD80-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE40-\uDE48\uDE60-\uDE7E\uDE80-\uDE9F\uDEC0-\uDEC7\uDEC9-\uDEE4\uDEEB-\uDEEF\uDF00-\uDF35\uDF40-\uDF55\uDF58-\uDF72\uDF78-\uDF91\uDFA9-\uDFAF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDD23\uDD30-\uDD39\uDE60-\uDE7E\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF27\uDF30-\uDF45\uDF51-\uDF54\uDF70-\uDF81\uDFB0-\uDFCB\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC52-\uDC6F\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD03-\uDD26\uDD36-\uDD3F\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDD0-\uDDDA\uDDDC\uDDE1-\uDDF4\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDEF0-\uDEF9\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC50-\uDC59\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE50-\uDE59\uDE80-\uDEAA\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF30-\uDF3B\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCF2\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDD50-\uDD59\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC50-\uDC6C\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF2\uDFB0\uDFC0-\uDFD4]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDE70-\uDEBE\uDEC0-\uDEC9\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE96\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD834[\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD837[\uDF00-\uDF1E]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD40-\uDD49\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB\uDEF0-\uDEF9]|\uD839[\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDCC7-\uDCCF\uDD00-\uDD43\uDD4B\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF38\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])/))){var ne=z[1]||z[2]||"";if(!ne||ne&&(j===""||this.rules.inline.punctuation.exec(j))){var _e=z[0].length-1,Me,Oe,ot=_e,tt=0,Jt=z[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(Jt.lastIndex=0,M=M.slice(-1*A.length+_e);(z=Jt.exec(M))!=null;)if(Me=z[1]||z[2]||z[3]||z[4]||z[5]||z[6],!!Me){if(Oe=Me.length,z[3]||z[4]){ot+=Oe;continue}else if((z[5]||z[6])&&_e%3&&!((_e+Oe)%3)){tt+=Oe;continue}if(ot-=Oe,!(ot>0)){if(Oe=Math.min(Oe,Oe+ot+tt),Math.min(_e,Oe)%2){var Vt=A.slice(1,_e+z.index+Oe);return{type:"em",raw:A.slice(0,_e+z.index+Oe+1),text:Vt,tokens:this.lexer.inlineTokens(Vt)}}var qe=A.slice(2,_e+z.index+Oe-1);return{type:"strong",raw:A.slice(0,_e+z.index+Oe+1),text:qe,tokens:this.lexer.inlineTokens(qe)}}}}}},X.codespan=function(A){var M=this.rules.inline.code.exec(A);if(M){var j=M[2].replace(/\n/g," "),z=/[^ ]/.test(j),ne=/^ /.test(j)&&/ $/.test(j);return z&&ne&&(j=j.substring(1,j.length-1)),j=m(j,!0),{type:"codespan",raw:M[0],text:j}}},X.br=function(A){var M=this.rules.inline.br.exec(A);if(M)return{type:"br",raw:M[0]}},X.del=function(A){var M=this.rules.inline.del.exec(A);if(M)return{type:"del",raw:M[0],text:M[2],tokens:this.lexer.inlineTokens(M[2])}},X.autolink=function(A,M){var j=this.rules.inline.autolink.exec(A);if(j){var z,ne;return j[2]==="@"?(z=m(this.options.mangle?M(j[1]):j[1]),ne="mailto:"+z):(z=m(j[1]),ne=z),{type:"link",raw:j[0],text:z,href:ne,tokens:[{type:"text",raw:z,text:z}]}}},X.url=function(A,M){var j;if(j=this.rules.inline.url.exec(A)){var z,ne;if(j[2]==="@")z=m(this.options.mangle?M(j[0]):j[0]),ne="mailto:"+z;else{var _e;do _e=j[0],j[0]=this.rules.inline._backpedal.exec(j[0])[0];while(_e!==j[0]);z=m(j[0]),j[1]==="www."?ne="http://"+z:ne=z}return{type:"link",raw:j[0],text:z,href:ne,tokens:[{type:"text",raw:z,text:z}]}}},X.inlineText=function(A,M){var j=this.rules.inline.text.exec(A);if(j){var z;return this.lexer.state.inRawBlock?z=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(j[0]):m(j[0]):j[0]:z=m(this.options.smartypants?M(j[0]):j[0]),{type:"text",raw:j[0],text:z}}},se}(),ve={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {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|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?]+)>?(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:P,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/};ve._label=/(?!\s*\])(?:\\.|[^\[\]\\])+/,ve._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,ve.def=C(ve.def).replace("label",ve._label).replace("title",ve._title).getRegex(),ve.bullet=/(?:[*+-]|\d{1,9}[.)])/,ve.listItemStart=C(/^( *)(bull) */).replace("bull",ve.bullet).getRegex(),ve.list=C(ve.list).replace(/bull/g,ve.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+ve.def.source+")").getRegex(),ve._tag="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|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",ve._comment=/|$)/,ve.html=C(ve.html,"i").replace("comment",ve._comment).replace("tag",ve._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ve.paragraph=C(ve._paragraph).replace("hr",ve.hr).replace("heading"," {0,3}#{1,6} ").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",ve._tag).getRegex(),ve.blockquote=C(ve.blockquote).replace("paragraph",ve.paragraph).getRegex(),ve.normal=F({},ve),ve.gfm=F({},ve.normal,{table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),ve.gfm.table=C(ve.gfm.table).replace("hr",ve.hr).replace("heading"," {0,3}#{1,6} ").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",ve._tag).getRegex(),ve.gfm.paragraph=C(ve._paragraph).replace("hr",ve.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",ve.gfm.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",ve._tag).getRegex(),ve.pedantic=F({},ve.normal,{html:C(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ve._comment).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:P,paragraph:C(ve.normal._paragraph).replace("hr",ve.hr).replace("heading",` *#{1,6} *[^ ]`).replace("lheading",ve.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var ce={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:P,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/^[^_*]*?\_\_[^_*]*?\*[^_*]*?(?=\_\_)|[^*]+(?=[^*])|[punct_](\*+)(?=[\s]|$)|[^punct*_\s](\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|[^punct*_\s](\*+)(?=[^punct*_\s])/,rDelimUnd:/^[^_*]*?\*\*[^_*]*?\_[^_*]*?(?=\*\*)|[^_]+(?=[^_])|[punct*](\_+)(?=[\s]|$)|[^punct*_\s](\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:P,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~",ce.punctuation=C(ce.punctuation).replace(/punctuation/g,ce._punctuation).getRegex(),ce.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,ce.escapedEmSt=/\\\*|\\_/g,ce._comment=C(ve._comment).replace("(?:-->|$)","-->").getRegex(),ce.emStrong.lDelim=C(ce.emStrong.lDelim).replace(/punct/g,ce._punctuation).getRegex(),ce.emStrong.rDelimAst=C(ce.emStrong.rDelimAst,"g").replace(/punct/g,ce._punctuation).getRegex(),ce.emStrong.rDelimUnd=C(ce.emStrong.rDelimUnd,"g").replace(/punct/g,ce._punctuation).getRegex(),ce._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,ce._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,ce._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])?)+(?![-_])/,ce.autolink=C(ce.autolink).replace("scheme",ce._scheme).replace("email",ce._email).getRegex(),ce._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,ce.tag=C(ce.tag).replace("comment",ce._comment).replace("attribute",ce._attribute).getRegex(),ce._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,ce._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,ce._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,ce.link=C(ce.link).replace("label",ce._label).replace("href",ce._href).replace("title",ce._title).getRegex(),ce.reflink=C(ce.reflink).replace("label",ce._label).replace("ref",ve._label).getRegex(),ce.nolink=C(ce.nolink).replace("ref",ve._label).getRegex(),ce.reflinkSearch=C(ce.reflinkSearch,"g").replace("reflink",ce.reflink).replace("nolink",ce.nolink).getRegex(),ce.normal=F({},ce),ce.pedantic=F({},ce.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:C(/^!?\[(label)\]\((.*?)\)/).replace("label",ce._label).getRegex(),reflink:C(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ce._label).getRegex()}),ce.gfm=F({},ce.normal,{escape:C(ce.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\.5&&(A="x"+A.toString(16)),X+="&#"+A+";";return X}var Gi=function(){function se(q){this.tokens=[],this.tokens.links=Object.create(null),this.options=q||e.defaults,this.options.tokenizer=this.options.tokenizer||new ye,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};var A={block:ve.normal,inline:ce.normal};this.options.pedantic?(A.block=ve.pedantic,A.inline=ce.pedantic):this.options.gfm&&(A.block=ve.gfm,this.options.breaks?A.inline=ce.breaks:A.inline=ce.gfm),this.tokenizer.rules=A}se.lex=function(A,M){var j=new se(M);return j.lex(A)},se.lexInline=function(A,M){var j=new se(M);return j.inlineTokens(A)};var X=se.prototype;return X.lex=function(A){A=A.replace(/\r\n|\r/g,` `),this.blockTokens(A,this.tokens);for(var M;M=this.inlineQueue.shift();)this.inlineTokens(M.src,M.tokens);return this.tokens},X.blockTokens=function(A,M){var j=this;M===void 0&&(M=[]),this.options.pedantic?A=A.replace(/\t/g," ").replace(/^ +$/gm,""):A=A.replace(/^( *)(\t+)/gm,function(ot,tt,Jt){return tt+" ".repeat(Jt.length)});for(var z,ne,_e,Me;A;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(function(ot){return(z=ot.call({lexer:j},A,M))?(A=A.substring(z.raw.length),M.push(z),!0):!1}))){if(z=this.tokenizer.space(A)){A=A.substring(z.raw.length),z.raw.length===1&&M.length>0?M[M.length-1].raw+=` `:M.push(z);continue}if(z=this.tokenizer.code(A)){A=A.substring(z.raw.length),ne=M[M.length-1],ne&&(ne.type==="paragraph"||ne.type==="text")?(ne.raw+=` `+z.raw,ne.text+=` `+z.text,this.inlineQueue[this.inlineQueue.length-1].src=ne.text):M.push(z);continue}if(z=this.tokenizer.fences(A)){A=A.substring(z.raw.length),M.push(z);continue}if(z=this.tokenizer.heading(A)){A=A.substring(z.raw.length),M.push(z);continue}if(z=this.tokenizer.hr(A)){A=A.substring(z.raw.length),M.push(z);continue}if(z=this.tokenizer.blockquote(A)){A=A.substring(z.raw.length),M.push(z);continue}if(z=this.tokenizer.list(A)){A=A.substring(z.raw.length),M.push(z);continue}if(z=this.tokenizer.html(A)){A=A.substring(z.raw.length),M.push(z);continue}if(z=this.tokenizer.def(A)){A=A.substring(z.raw.length),ne=M[M.length-1],ne&&(ne.type==="paragraph"||ne.type==="text")?(ne.raw+=` `+z.raw,ne.text+=` `+z.raw,this.inlineQueue[this.inlineQueue.length-1].src=ne.text):this.tokens.links[z.tag]||(this.tokens.links[z.tag]={href:z.href,title:z.title});continue}if(z=this.tokenizer.table(A)){A=A.substring(z.raw.length),M.push(z);continue}if(z=this.tokenizer.lheading(A)){A=A.substring(z.raw.length),M.push(z);continue}if(_e=A,this.options.extensions&&this.options.extensions.startBlock&&function(){var ot=1/0,tt=A.slice(1),Jt=void 0;j.options.extensions.startBlock.forEach(function(Vt){Jt=Vt.call({lexer:this},tt),typeof Jt=="number"&&Jt>=0&&(ot=Math.min(ot,Jt))}),ot<1/0&&ot>=0&&(_e=A.substring(0,ot+1))}(),this.state.top&&(z=this.tokenizer.paragraph(_e))){ne=M[M.length-1],Me&&ne.type==="paragraph"?(ne.raw+=` `+z.raw,ne.text+=` `+z.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=ne.text):M.push(z),Me=_e.length!==A.length,A=A.substring(z.raw.length);continue}if(z=this.tokenizer.text(A)){A=A.substring(z.raw.length),ne=M[M.length-1],ne&&ne.type==="text"?(ne.raw+=` `+z.raw,ne.text+=` `+z.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=ne.text):M.push(z);continue}if(A){var Oe="Infinite loop on byte: "+A.charCodeAt(0);if(this.options.silent){console.error(Oe);break}else throw new Error(Oe)}}return this.state.top=!0,M},X.inline=function(A,M){return M===void 0&&(M=[]),this.inlineQueue.push({src:A,tokens:M}),M},X.inlineTokens=function(A,M){var j=this;M===void 0&&(M=[]);var z,ne,_e,Me=A,Oe,ot,tt;if(this.tokens.links){var Jt=Object.keys(this.tokens.links);if(Jt.length>0)for(;(Oe=this.tokenizer.rules.inline.reflinkSearch.exec(Me))!=null;)Jt.includes(Oe[0].slice(Oe[0].lastIndexOf("[")+1,-1))&&(Me=Me.slice(0,Oe.index)+"["+De("a",Oe[0].length-2)+"]"+Me.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(Oe=this.tokenizer.rules.inline.blockSkip.exec(Me))!=null;)Me=Me.slice(0,Oe.index)+"["+De("a",Oe[0].length-2)+"]"+Me.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(Oe=this.tokenizer.rules.inline.escapedEmSt.exec(Me))!=null;)Me=Me.slice(0,Oe.index)+"++"+Me.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;A;)if(ot||(tt=""),ot=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(function(qe){return(z=qe.call({lexer:j},A,M))?(A=A.substring(z.raw.length),M.push(z),!0):!1}))){if(z=this.tokenizer.escape(A)){A=A.substring(z.raw.length),M.push(z);continue}if(z=this.tokenizer.tag(A)){A=A.substring(z.raw.length),ne=M[M.length-1],ne&&z.type==="text"&&ne.type==="text"?(ne.raw+=z.raw,ne.text+=z.text):M.push(z);continue}if(z=this.tokenizer.link(A)){A=A.substring(z.raw.length),M.push(z);continue}if(z=this.tokenizer.reflink(A,this.tokens.links)){A=A.substring(z.raw.length),ne=M[M.length-1],ne&&z.type==="text"&&ne.type==="text"?(ne.raw+=z.raw,ne.text+=z.text):M.push(z);continue}if(z=this.tokenizer.emStrong(A,Me,tt)){A=A.substring(z.raw.length),M.push(z);continue}if(z=this.tokenizer.codespan(A)){A=A.substring(z.raw.length),M.push(z);continue}if(z=this.tokenizer.br(A)){A=A.substring(z.raw.length),M.push(z);continue}if(z=this.tokenizer.del(A)){A=A.substring(z.raw.length),M.push(z);continue}if(z=this.tokenizer.autolink(A,Ui)){A=A.substring(z.raw.length),M.push(z);continue}if(!this.state.inLink&&(z=this.tokenizer.url(A,Ui))){A=A.substring(z.raw.length),M.push(z);continue}if(_e=A,this.options.extensions&&this.options.extensions.startInline&&function(){var qe=1/0,Mi=A.slice(1),Ri=void 0;j.options.extensions.startInline.forEach(function(Gr){Ri=Gr.call({lexer:this},Mi),typeof Ri=="number"&&Ri>=0&&(qe=Math.min(qe,Ri))}),qe<1/0&&qe>=0&&(_e=A.substring(0,qe+1))}(),z=this.tokenizer.inlineText(_e,Qt)){A=A.substring(z.raw.length),z.raw.slice(-1)!=="_"&&(tt=z.raw.slice(-1)),ot=!0,ne=M[M.length-1],ne&&ne.type==="text"?(ne.raw+=z.raw,ne.text+=z.text):M.push(z);continue}if(A){var Vt="Infinite loop on byte: "+A.charCodeAt(0);if(this.options.silent){console.error(Vt);break}else throw new Error(Vt)}}return M},i(se,null,[{key:"rules",get:function(){return{block:ve,inline:ce}}}]),se}(),St=function(){function se(q){this.options=q||e.defaults}var X=se.prototype;return X.code=function(A,M,j){var z=(M||"").match(/\S*/)[0];if(this.options.highlight){var ne=this.options.highlight(A,z);ne!=null&&ne!==A&&(j=!0,A=ne)}return A=A.replace(/\n$/,"")+` `,z?'
'+(j?A:m(A,!0))+`
`:"
"+(j?A:m(A,!0))+`
`},X.blockquote=function(A){return`
`+A+`
`},X.html=function(A){return A},X.heading=function(A,M,j,z){if(this.options.headerIds){var ne=this.options.headerPrefix+z.slug(j);return"'+A+" `}return""+A+" `},X.hr=function(){return this.options.xhtml?`
`:`
`},X.list=function(A,M,j){var z=M?"ol":"ul",ne=M&&j!==1?' start="'+j+'"':"";return"<"+z+ne+`> `+A+" `},X.listitem=function(A){return"
  • "+A+`
  • `},X.checkbox=function(A){return" "},X.paragraph=function(A){return"

    "+A+`

    `},X.table=function(A,M){return M&&(M=""+M+""),` `+A+` `+M+`
    `},X.tablerow=function(A){return` `+A+` `},X.tablecell=function(A,M){var j=M.header?"th":"td",z=M.align?"<"+j+' align="'+M.align+'">':"<"+j+">";return z+A+(" `)},X.strong=function(A){return""+A+""},X.em=function(A){return""+A+""},X.codespan=function(A){return""+A+""},X.br=function(){return this.options.xhtml?"
    ":"
    "},X.del=function(A){return""+A+""},X.link=function(A,M,j){if(A=D(this.options.sanitize,this.options.baseUrl,A),A===null)return j;var z='",z},X.image=function(A,M,j){if(A=D(this.options.sanitize,this.options.baseUrl,A),A===null)return j;var z=''+j+'":">",z},X.text=function(A){return A},se}(),tn=function(){function se(){}var X=se.prototype;return X.strong=function(A){return A},X.em=function(A){return A},X.codespan=function(A){return A},X.del=function(A){return A},X.html=function(A){return A},X.text=function(A){return A},X.link=function(A,M,j){return""+j},X.image=function(A,M,j){return""+j},X.br=function(){return""},se}(),Pn=function(){function se(){this.seen={}}var X=se.prototype;return X.serialize=function(A){return A.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},X.getNextSafeSlug=function(A,M){var j=A,z=0;if(this.seen.hasOwnProperty(j)){z=this.seen[A];do z++,j=A+"-"+z;while(this.seen.hasOwnProperty(j))}return M||(this.seen[A]=z,this.seen[j]=0),j},X.slug=function(A,M){M===void 0&&(M={});var j=this.serialize(A);return this.getNextSafeSlug(j,M.dryrun)},se}(),ln=function(){function se(q){this.options=q||e.defaults,this.options.renderer=this.options.renderer||new St,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new tn,this.slugger=new Pn}se.parse=function(A,M){var j=new se(M);return j.parse(A)},se.parseInline=function(A,M){var j=new se(M);return j.parseInline(A)};var X=se.prototype;return X.parse=function(A,M){M===void 0&&(M=!0);var j="",z,ne,_e,Me,Oe,ot,tt,Jt,Vt,qe,Mi,Ri,Gr,Mt,cn,hg,gg,La,cu,fg=A.length;for(z=0;z0&&cn.tokens[0].type==="paragraph"?(cn.tokens[0].text=La+" "+cn.tokens[0].text,cn.tokens[0].tokens&&cn.tokens[0].tokens.length>0&&cn.tokens[0].tokens[0].type==="text"&&(cn.tokens[0].tokens[0].text=La+" "+cn.tokens[0].tokens[0].text)):cn.tokens.unshift({type:"text",text:La}):Mt+=La),Mt+=this.parse(cn.tokens,Gr),Vt+=this.renderer.listitem(Mt,gg,hg);j+=this.renderer.list(Vt,Mi,Ri);continue}case"html":{j+=this.renderer.html(qe.text);continue}case"paragraph":{j+=this.renderer.paragraph(this.parseInline(qe.tokens));continue}case"text":{for(Vt=qe.tokens?this.parseInline(qe.tokens):qe.text;z+1"u"||se===null)throw new Error("marked(): input parameter is undefined or null");if(typeof se!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(se)+", string expected");if(typeof X=="function"&&(q=X,X=null),X=F({},$e.defaults,X||{}),pe(X),q){var A=X.highlight,M;try{M=Gi.lex(se,X)}catch(Me){return q(Me)}var j=function(Oe){var ot;if(!Oe)try{X.walkTokens&&$e.walkTokens(M,X.walkTokens),ot=ln.parse(M,X)}catch(tt){Oe=tt}return X.highlight=A,Oe?q(Oe):q(null,ot)};if(!A||A.length<3||(delete X.highlight,!M.length))return j();var z=0;$e.walkTokens(M,function(Me){Me.type==="code"&&(z++,setTimeout(function(){A(Me.text,Me.lang,function(Oe,ot){if(Oe)return j(Oe);ot!=null&&ot!==Me.text&&(Me.text=ot,Me.escaped=!0),z--,z===0&&j()})},0))}),z===0&&j();return}function ne(Me){if(Me.message+=` Please report this to https://github.com/markedjs/marked.`,X.silent)return"

    An error occurred:

    "+m(Me.message+"",!0)+"
    ";throw Me}try{var _e=Gi.lex(se,X);if(X.walkTokens){if(X.async)return Promise.all($e.walkTokens(_e,X.walkTokens)).then(function(){return ln.parse(_e,X)}).catch(ne);$e.walkTokens(_e,X.walkTokens)}return ln.parse(_e,X)}catch(Me){ne(Me)}}$e.options=$e.setOptions=function(se){return F($e.defaults,se),l($e.defaults),$e},$e.getDefaults=a,$e.defaults=e.defaults,$e.use=function(){for(var se=arguments.length,X=new Array(se),q=0;q"u"||se===null)throw new Error("marked.parseInline(): input parameter is undefined or null");if(typeof se!="string")throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(se)+", string expected");X=F({},$e.defaults,X||{}),pe(X);try{var q=Gi.lexInline(se,X);return X.walkTokens&&$e.walkTokens(q,X.walkTokens),ln.parseInline(q,X)}catch(A){if(A.message+=` Please report this to https://github.com/markedjs/marked.`,X.silent)return"

    An error occurred:

    "+m(A.message+"",!0)+"
    ";throw A}},$e.Parser=ln,$e.parser=ln.parse,$e.Renderer=St,$e.TextRenderer=tn,$e.Lexer=Gi,$e.lexer=Gi.lex,$e.Tokenizer=ye,$e.Slugger=Pn,$e.parse=$e;var dn=$e.options,qr=$e.setOptions,Wo=$e.use,Fd=$e.walkTokens,xn=$e.parseInline,Da=$e,Z1=ln.parse,aE=Gi.lex;e.Lexer=Gi,e.Parser=ln,e.Renderer=St,e.Slugger=Pn,e.TextRenderer=tn,e.Tokenizer=ye,e.getDefaults=a,e.lexer=aE,e.marked=$e,e.options=dn,e.parse=Da,e.parseInline=xn,e.parser=Z1,e.setOptions=qr,e.use=Wo,e.walkTokens=Fd,Object.defineProperty(e,"__esModule",{value:!0})})})();Zs.Lexer||exports.Lexer;Zs.Parser||exports.Parser;Zs.Renderer||exports.Renderer;Zs.Slugger||exports.Slugger;Zs.TextRenderer||exports.TextRenderer;Zs.Tokenizer||exports.Tokenizer;Zs.getDefaults||exports.getDefaults;Zs.lexer||exports.lexer;var jl=Zs.marked||exports.marked;Zs.options||exports.options;Zs.parse||exports.parse;Zs.parseInline||exports.parseInline;Zs.parser||exports.parser;Zs.setOptions||exports.setOptions;Zs.use||exports.use;Zs.walkTokens||exports.walkTokens;function Rve(s){return JSON.stringify(s,Pve)}function u2(s){let e=JSON.parse(s);return e=h2(e),e}function Pve(s,e){return e instanceof RegExp?{$mid:2,source:e.source,flags:e.flags}:e}function h2(s,e=0){if(!s||e>200)return s;if(typeof s=="object"){switch(s.$mid){case 1:return Ae.revive(s);case 2:return new RegExp(s.source,s.flags);case 17:return new Date(s.source)}if(s instanceof px||s instanceof Uint8Array)return s;if(Array.isArray(s))for(let t=0;t{let i=[],n=[];return s&&({href:s,dimensions:i}=Mve(s),n.push(`src="${jw(s)}"`)),t&&n.push(`alt="${jw(t)}"`),e&&n.push(`title="${jw(e)}"`),i.length&&(n=n.concat(i)),""},paragraph:s=>`

    ${s}

    `,link:(s,e,t)=>typeof s!="string"?"":(s===t&&(t=OI(t)),e=typeof e=="string"?jw(OI(e)):"",s=OI(s),s=s.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'"),`
    ${t}`)});function Hx(s,e={},t={}){var i,n;const o=new Y;let r=!1;const a=fO(e),l=function(v){let b;try{b=u2(decodeURIComponent(v))}catch{}return b?(b=TV(b,C=>{if(s.uris&&s.uris[C])return Ae.revive(s.uris[C])}),encodeURIComponent(JSON.stringify(b))):v},d=function(v,b){const C=s.uris&&s.uris[v];let w=Ae.revive(C);return b?v.startsWith(Ge.data+":")?v:(w||(w=Ae.parse(v)),Dz.uriToBrowserUri(w).toString(!0)):!w||Ae.parse(v).toString()===w.toString()?v:(w.query&&(w=w.with({query:l(w.query)})),w.toString())},c=new jl.Renderer;c.image=BI.image,c.link=BI.link,c.paragraph=BI.paragraph;const u=[],h=[];if(e.codeBlockRendererSync?c.code=(v,b)=>{const C=c2.nextId(),w=e.codeBlockRendererSync(t6(b),v);return h.push([C,w]),`
    ${OS(v)}
    `}:e.codeBlockRenderer&&(c.code=(v,b)=>{const C=c2.nextId(),w=e.codeBlockRenderer(t6(b),v);return u.push(w.then(y=>[C,y])),`
    ${OS(v)}
    `}),e.actionHandler){const v=function(w){let y=w.target;if(!(y.tagName!=="A"&&(y=y.parentElement,!y||y.tagName!=="A")))try{let D=y.dataset.href;D&&(s.baseUri&&(D=WI(Ae.from(s.baseUri),D)),e.actionHandler.callback(D,w))}catch(D){Xe(D)}finally{w.preventDefault()}},b=e.actionHandler.disposables.add(new ht(a,"click")),C=e.actionHandler.disposables.add(new ht(a,"auxclick"));e.actionHandler.disposables.add(le.any(b.event,C.event)(w=>{const y=new ra(Te(a),w);!y.leftButton&&!y.middleButton||v(y)})),e.actionHandler.disposables.add(K(a,"keydown",w=>{const y=new Kt(w);!y.equals(10)&&!y.equals(3)||v(y)}))}s.supportHtml||(t.sanitizer=v=>(s.isTrusted?v.match(/^(]+>)|(<\/\s*span>)$/):void 0)?v:"",t.sanitize=!0,t.silent=!0),t.renderer=c;let g=(i=s.value)!==null&&i!==void 0?i:"";g.length>1e5&&(g=`${g.substr(0,1e5)}…`),s.supportThemeIcons&&(g=kve(g));let f;if(e.fillInIncompleteTokens){const v={...jl.defaults,...t},b=jl.lexer(g,v),C=Uve(b);f=jl.parser(C,v)}else f=jl.parse(g,t);s.supportThemeIcons&&(f=lh(f).map(b=>typeof b=="string"?b:b.outerHTML).join(""));const _=new DOMParser().parseFromString(g2(s,f),"text/html");if(_.body.querySelectorAll("img, audio, video, source").forEach(v=>{const b=v.getAttribute("src");if(b){let C=b;try{s.baseUri&&(C=WI(Ae.from(s.baseUri),C))}catch{}if(v.setAttribute("src",d(C,!0)),e.disallowRemoteImages){const w=Ae.parse(C).scheme;w!==Ge.file&&w!==Ge.data&&v.replaceWith(he("",void 0,v.outerHTML))}}}),_.body.querySelectorAll("a").forEach(v=>{const b=v.getAttribute("href");if(v.setAttribute("href",""),!b||/^data:|javascript:/i.test(b)||/^command:/i.test(b)&&!s.isTrusted||/^command:(\/\/\/)?_workbench\.downloadResource/i.test(b))v.replaceWith(...v.childNodes);else{let C=d(b,!1);s.baseUri&&(C=WI(Ae.from(s.baseUri),b)),v.dataset.href=C}}),a.innerHTML=g2(s,_.body.innerHTML),u.length>0)Promise.all(u).then(v=>{var b,C;if(r)return;const w=new Map(v),y=a.querySelectorAll("div[data-code]");for(const D of y){const L=w.get((b=D.dataset.code)!==null&&b!==void 0?b:"");L&&Yn(D,L)}(C=e.asyncRenderCallback)===null||C===void 0||C.call(e)});else if(h.length>0){const v=new Map(h),b=a.querySelectorAll("div[data-code]");for(const C of b){const w=v.get((n=C.dataset.code)!==null&&n!==void 0?n:"");w&&Yn(C,w)}}if(e.asyncRenderCallback)for(const v of a.getElementsByTagName("img")){const b=o.add(K(v,"load",()=>{b.dispose(),e.asyncRenderCallback()}))}return{element:a,dispose:()=>{r=!0,o.dispose()}}}function t6(s){if(!s)return"";const e=s.split(/[\s+|:|,|\{|\?]/,1);return e.length?e[0]:s}function WI(s,e){return/^\w[\w\d+.-]*:/.test(e)?e:s.path.endsWith("/")?d8(s,e).toString():d8(Ax(s),e).toString()}function g2(s,e){const{config:t,allowedSchemes:i}=Ove(s);sA("uponSanitizeAttribute",(o,r)=>{var a;if(r.attrName==="style"||r.attrName==="class"){if(o.tagName==="SPAN"){if(r.attrName==="style"){r.keepAttr=/^(color\:(#[0-9a-fA-F]+|var\(--vscode(-[a-zA-Z]+)+\));)?(background-color\:(#[0-9a-fA-F]+|var\(--vscode(-[a-zA-Z]+)+\));)?$/.test(r.attrValue);return}else if(r.attrName==="class"){r.keepAttr=/^codicon codicon-[a-z\-]+( codicon-modifier-[a-z\-]+)?$/.test(r.attrValue);return}}r.keepAttr=!1;return}else if(o.tagName==="INPUT"&&((a=o.attributes.getNamedItem("type"))===null||a===void 0?void 0:a.value)==="checkbox"){if(r.attrName==="type"&&r.attrValue==="checkbox"||r.attrName==="disabled"||r.attrName==="checked"){r.keepAttr=!0;return}r.keepAttr=!1}}),sA("uponSanitizeElement",(o,r)=>{var a,l;r.tagName==="input"&&(((a=o.attributes.getNamedItem("type"))===null||a===void 0?void 0:a.value)==="checkbox"?o.setAttribute("disabled",""):(l=o.parentElement)===null||l===void 0||l.removeChild(o))});const n=Qae(i);try{return wz(e,{...t,RETURN_TRUSTED_TYPE:!0})}finally{yz("uponSanitizeAttribute"),n.dispose()}}const Fve=["align","autoplay","alt","checked","class","controls","data-code","data-href","disabled","draggable","height","href","loop","muted","playsinline","poster","src","style","target","title","type","width","start"];function Ove(s){const e=[Ge.http,Ge.https,Ge.mailto,Ge.data,Ge.file,Ge.vscodeFileResource,Ge.vscodeRemote,Ge.vscodeRemoteResource];return s.isTrusted&&e.push(Ge.command),{config:{ALLOWED_TAGS:[...Jae],ALLOWED_ATTR:Fve,ALLOW_UNKNOWN_PROTOCOLS:!0},allowedSchemes:e}}function Bve(s){return typeof s=="string"?s:Wve(s)}function Wve(s){var e;let t=(e=s.value)!==null&&e!==void 0?e:"";t.length>1e5&&(t=`${t.substr(0,1e5)}…`);const i=jl.parse(t,{renderer:Vve.value}).replace(/&(#\d+|[a-zA-Z]+);/g,n=>{var o;return(o=Hve.get(n))!==null&&o!==void 0?o:n});return g2({isTrusted:!1},i).toString()}const Hve=new Map([[""",'"'],[" "," "],["&","&"],["'","'"],["<","<"],[">",">"]]),Vve=new gl(()=>{const s=new jl.Renderer;return s.code=e=>e,s.blockquote=e=>e,s.html=e=>"",s.heading=(e,t,i)=>e+` `,s.hr=()=>"",s.list=(e,t)=>e,s.listitem=e=>e+` `,s.paragraph=e=>e+` `,s.table=(e,t)=>e+t+` `,s.tablerow=e=>e,s.tablecell=(e,t)=>e+" ",s.strong=e=>e,s.em=e=>e,s.codespan=e=>e,s.br=()=>` `,s.del=e=>e,s.image=(e,t,i)=>"",s.text=e=>e,s.link=(e,t,i)=>i,s});function CO(s){let e="";return s.forEach(t=>{e+=t.raw}),e}function zve(s){var e,t;for(let i=0;ii6(a.raw)))return Zve(s)}}}}function i6(s){return!!s.match(/^[^\[]*\]\([^\)]*$/)}function Uve(s){let e,t;for(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(o!==t.length-1)return;n=!0}else return}if(typeof i=="number"&&i>0){const o=n?t.slice(0,-1).join(` `):e,r=!!o.match(/\|\s*$/),a=o+(r?"":"|")+` |${" --- |".repeat(i)}`;return jl.lexer(a)}}var Jve=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},s6=function(s,e){return function(t,i){e(t,i,s)}},f2;let yd=f2=class{constructor(e,t,i){this._options=e,this._languageService=t,this._openerService=i,this._onDidRenderAsync=new B,this.onDidRenderAsync=this._onDidRenderAsync.event}dispose(){this._onDidRenderAsync.dispose()}render(e,t,i){if(!e)return{element:document.createElement("span"),dispose:()=>{}};const n=new Y,o=n.add(Hx(e,{...this._getRenderOptions(e,n),...t},i));return o.element.classList.add("rendered-markdown"),{element:o.element,dispose:()=>n.dispose()}}_getRenderOptions(e,t){return{codeBlockRenderer:async(i,n)=>{var o,r,a;let l;i?l=this._languageService.getLanguageIdByLanguageName(i):this._options.editor&&(l=(o=this._options.editor.getModel())===null||o===void 0?void 0:o.getLanguageId()),l||(l=ir);const d=await j_e(this._languageService,n,l),c=document.createElement("span");if(c.innerHTML=(a=(r=f2._ttpTokenizer)===null||r===void 0?void 0:r.createHTML(d))!==null&&a!==void 0?a:d,this._options.editor){const u=this._options.editor.getOption(50);Un(c,u)}else this._options.codeBlockFontFamily&&(c.style.fontFamily=this._options.codeBlockFontFamily);return this._options.codeBlockFontSize!==void 0&&(c.style.fontSize=this._options.codeBlockFontSize),c},asyncRenderCallback:()=>this._onDidRenderAsync.fire(),actionHandler:{callback:i=>wO(this._openerService,i,e.isTrusted),disposables:t}}}};yd._ttpTokenizer=tu("tokenizeToString",{createHTML(s){return s}});yd=f2=Jve([s6(1,vi),s6(2,Bo)],yd);async function wO(s,e,t){try{return await s.open(e,{fromUserGesture:!0,allowContributedOpeners:!0,allowCommands:ebe(t)})}catch(i){return Xe(i),!1}}function ebe(s){return s===!0?!0:s&&Array.isArray(s.enabledCommands)?s.enabledCommands:!1}var tbe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},K0=function(s,e){return function(t,i){e(t,i,s)}};const yl=he;let p2=class extends fr{get _targetWindow(){return Te(this._target.targetElements[0])}get _targetDocumentElement(){return Te(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,o,r){var a,l,d,c,u,h,g,f;super(),this._keybindingService=t,this._configurationService=i,this._openerService=n,this._instantiationService=o,this._accessibilityService=r,this._messageListeners=new Y,this._isDisposed=!1,this._forcePosition=!1,this._x=0,this._y=0,this._isLocked=!1,this._enableFocusTraps=!1,this._addedFocusTrap=!1,this._onDispose=this._register(new B),this._onRequestLayout=this._register(new B),this._linkHandler=e.linkHandler||(w=>wO(this._openerService,w,tl(e.content)?e.content.isTrusted:void 0)),this._target="targetElements"in e.target?e.target:new ibe(e.target),this._hoverPointer=!((a=e.appearance)===null||a===void 0)&&a.showPointer?yl("div.workbench-hover-pointer"):void 0,this._hover=this._register(new gO),this._hover.containerDomNode.classList.add("workbench-hover","fadeIn"),!((l=e.appearance)===null||l===void 0)&&l.compact&&this._hover.containerDomNode.classList.add("workbench-hover","compact"),!((d=e.appearance)===null||d===void 0)&&d.skipFadeInAnimation&&this._hover.containerDomNode.classList.add("skip-fade-in"),e.additionalClasses&&this._hover.containerDomNode.classList.add(...e.additionalClasses),!((c=e.position)===null||c===void 0)&&c.forcePosition&&(this._forcePosition=!0),e.trapFocus&&(this._enableFocusTraps=!0),this._hoverPosition=(h=(u=e.position)===null||u===void 0?void 0:u.hoverPosition)!==null&&h!==void 0?h:3,this.onmousedown(this._hover.containerDomNode,w=>w.stopPropagation()),this.onkeydown(this._hover.containerDomNode,w=>{w.equals(9)&&this.dispose()}),this._register(K(this._targetWindow,"blur",()=>this.dispose()));const m=yl("div.hover-row.markdown-hover"),_=yl("div.hover-contents");if(typeof e.content=="string")_.textContent=e.content,_.style.whiteSpace="pre-wrap";else if(e.content instanceof HTMLElement)_.appendChild(e.content),_.classList.add("html-hover-contents");else{const w=e.content,y=this._instantiationService.createInstance(yd,{codeBlockFontFamily:this._configurationService.getValue("editor").fontFamily||co.fontFamily}),{element:D}=y.render(w,{actionHandler:{callback:L=>this._linkHandler(L),disposables:this._messageListeners},asyncRenderCallback:()=>{_.classList.add("code-hover-contents"),this.layout(),this._onRequestLayout.fire()}});_.appendChild(D)}if(m.appendChild(_),this._hover.contentsDomNode.appendChild(m),e.actions&&e.actions.length>0){const w=yl("div.hover-row.status-bar"),y=yl("div.actions");e.actions.forEach(D=>{const L=this._keybindingService.lookupKeybinding(D.commandId),k=L?L.getLabel():null;Fx.render(y,{label:D.label,commandId:D.commandId,run:I=>{D.run(I),this.dispose()},iconClass:D.iconClass},k)}),w.appendChild(y),this._hover.containerDomNode.appendChild(w)}this._hoverContainer=yl("div.workbench-hover-container"),this._hoverPointer&&this._hoverContainer.appendChild(this._hoverPointer),this._hoverContainer.appendChild(this._hover.containerDomNode);let v;if(e.actions&&e.actions.length>0?v=!1:((g=e.persistence)===null||g===void 0?void 0:g.hideOnHover)===void 0?v=typeof e.content=="string"||tl(e.content)&&!e.content.value.includes("](")&&!e.content.value.includes(""):v=e.persistence.hideOnHover,v&&(!((f=e.appearance)===null||f===void 0)&&f.showHoverHint)){const w=yl("div.hover-row.status-bar"),y=yl("div.info");y.textContent=p("hoverhint","Hold {0} key to mouse over",lt?"Option":"Alt"),w.appendChild(y),this._hover.containerDomNode.appendChild(w)}const b=[...this._target.targetElements];v||b.push(this._hoverContainer);const C=this._register(new o6(b));if(this._register(C.onMouseOut(()=>{this._isLocked||this.dispose()})),v){const w=[...this._target.targetElements,this._hoverContainer];this._lockMouseTracker=this._register(new o6(w)),this._register(this._lockMouseTracker.onMouseOut(()=>{this._isLocked||this.dispose()}))}else this._lockMouseTracker=C}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=uF(this._hoverContainer,yl("div")),n=Q(this._hoverContainer,yl("div"));i.tabIndex=0,n.tabIndex=0,this._register(K(n,"focus",o=>{e.focus(),o.preventDefault()})),this._register(K(i,"focus",o=>{t.focus(),o.preventDefault()}))}}findLastFocusableChild(e){if(e.hasChildNodes())for(let t=0;t=0)return o}const n=this.findLastFocusableChild(i);if(n)return n}}render(e){var t;e.appendChild(this._hoverContainer);const n=this._hoverContainer.contains(this._hoverContainer.ownerDocument.activeElement)&&q$(this._configurationService.getValue("accessibility.verbosity.hover")===!0&&this._accessibilityService.isScreenReaderOptimized(),(t=this._keybindingService.lookupKeybinding("editor.action.accessibleView"))===null||t===void 0?void 0:t.getAriaLabel());n&&Uc(n),this.layout(),this.addFocusTrap()}layout(){this._hover.containerDomNode.classList.remove("right-aligned"),this._hover.contentsDomNode.style.maxHeight="";const e=c=>{const u=Ez(c),h=c.getBoundingClientRect();return{top:h.top*u,bottom:h.bottom*u,right:h.right*u,left:h.left*u}},t=this._target.targetElements.map(c=>e(c)),{top:i,right:n,bottom:o,left:r}=t[0],a=n-r,l=o-i,d={top:i,right:n,bottom:o,left:r,width:a,height:l,center:{x:r+a/2,y:i+l/2}};if(this.adjustHorizontalHoverPosition(d),this.adjustVerticalHoverPosition(d),this.adjustHoverMaxHeight(d),this._hoverContainer.style.padding="",this._hoverContainer.style.margin="",this._hoverPointer){switch(this._hoverPosition){case 1:d.left+=3,d.right+=3,this._hoverContainer.style.paddingLeft="3px",this._hoverContainer.style.marginLeft="-3px";break;case 0:d.left-=3,d.right-=3,this._hoverContainer.style.paddingRight="3px",this._hoverContainer.style.marginRight="-3px";break;case 2:d.top+=3,d.bottom+=3,this._hoverContainer.style.paddingTop="3px",this._hoverContainer.style.marginTop="-3px";break;case 3:d.top-=3,d.bottom-=3,this._hoverContainer.style.paddingBottom="3px",this._hoverContainer.style.marginBottom="-3px";break}d.center.x=d.left+a/2,d.center.y=d.top+l/2}this.computeXCordinate(d),this.computeYCordinate(d),this._hoverPointer&&(this._hoverPointer.classList.remove("top"),this._hoverPointer.classList.remove("left"),this._hoverPointer.classList.remove("right"),this._hoverPointer.classList.remove("bottom"),this.setHoverPointerPosition(d)),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.clientHeight+t>this._targetWindow.innerHeight&&(this._hoverPosition=3)}adjustHoverMaxHeight(e){let t=this._targetWindow.innerHeight/2;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._hoverContainer.remove(),this._messageListeners.dispose(),this._target.dispose(),super.dispose()),this._isDisposed=!0}};p2=tbe([K0(1,At),K0(2,rt),K0(3,Bo),K0(4,Ne),K0(5,gr)],p2);class o6 extends fr{get onMouseOut(){return this._onMouseOut.event}get isMouseIn(){return this._isMouseIn}constructor(e){super(),this._elements=e,this._isMouseIn=!0,this._onMouseOut=this._register(new B),this._elements.forEach(t=>this.onmouseover(t,()=>this._onTargetMouseOver(t))),this._elements.forEach(t=>this.onmouseleave(t,()=>this._onTargetMouseLeave(t)))}_onTargetMouseOver(e){this._isMouseIn=!0,this._clearEvaluateMouseStateTimeout(e)}_onTargetMouseLeave(e){this._isMouseIn=!1,this._evaluateMouseState(e)}_evaluateMouseState(e){this._clearEvaluateMouseStateTimeout(e),this._mouseTimeout=Te(e).setTimeout(()=>this._fireIfMouseOutside(),0)}_clearEvaluateMouseStateTimeout(e){this._mouseTimeout&&(Te(e).clearTimeout(this._mouseTimeout),this._mouseTimeout=void 0)}_fireIfMouseOutside(){this._isMouseIn||this._onMouseOut.fire()}}class ibe{constructor(e){this._element=e,this.targetElements=[this._element]}dispose(){}}var ts;(function(s){function e(o,r){if(o.start>=r.end||r.start>=o.end)return{start:0,end:0};const a=Math.max(o.start,r.start),l=Math.min(o.end,r.end);return l-a<=0?{start:0,end:0}:{start:a,end:l}}s.intersect=e;function t(o){return o.end-o.start<=0}s.isEmpty=t;function i(o,r){return!t(e(o,r))}s.intersects=i;function n(o,r){const a=[],l={start:o.start,end:Math.min(r.start,o.end)},d={start:Math.max(r.end,o.start),end:o.end};return t(l)||a.push(l),t(d)||a.push(d),a}s.relativeComplement=n})(ts||(ts={}));function nbe(s){const e=s;return!!e&&typeof e.x=="number"&&typeof e.y=="number"}var Gu;(function(s){s[s.AVOID=0]="AVOID",s[s.ALIGN=1]="ALIGN"})(Gu||(Gu={}));function pm(s,e,t){const i=t.mode===Gu.ALIGN?t.offset:t.offset+t.size,n=t.mode===Gu.ALIGN?t.offset+t.size:t.offset;return t.position===0?e<=s-i?i:e<=n?n-e:Math.max(s-e,0):e<=n?n-e:e<=s-i?i:0}class x_ extends H{constructor(e,t){super(),this.container=null,this.useFixedPosition=!1,this.useShadowDOM=!1,this.delegate=null,this.toDisposeOnClean=H.None,this.toDisposeOnSetContainer=H.None,this.shadowRoot=null,this.shadowRootHostElement=null,this.view=he(".context-view"),Es(this.view),this.setContainer(e,t),this._register(Ie(()=>this.setContainer(null,1)))}setContainer(e,t){var i;this.useFixedPosition=t!==1;const n=this.useShadowDOM;if(this.useShadowDOM=t===3,!(e===this.container&&n===this.useShadowDOM)&&(this.container&&(this.toDisposeOnSetContainer.dispose(),this.shadowRoot?(this.shadowRoot.removeChild(this.view),this.shadowRoot=null,(i=this.shadowRootHostElement)===null||i===void 0||i.remove(),this.shadowRootHostElement=null):this.container.removeChild(this.view),this.container=null),e)){if(this.container=e,this.useShadowDOM){this.shadowRootHostElement=he(".shadow-root-host"),this.container.appendChild(this.shadowRootHostElement),this.shadowRoot=this.shadowRootHostElement.attachShadow({mode:"open"});const r=document.createElement("style");r.textContent=sbe,this.shadowRoot.appendChild(r),this.shadowRoot.appendChild(this.view),this.shadowRoot.appendChild(he("slot"))}else this.container.appendChild(this.view);const o=new Y;x_.BUBBLE_UP_EVENTS.forEach(r=>{o.add(Ni(this.container,r,a=>{this.onDOMEvent(a,!1)}))}),x_.BUBBLE_DOWN_EVENTS.forEach(r=>{o.add(Ni(this.container,r,a=>{this.onDOMEvent(a,!0)},!0))}),this.toDisposeOnSetContainer=o}}show(e){var t,i,n;this.isVisible()&&this.hide(),zn(this.view),this.view.className="context-view monaco-component",this.view.style.top="0px",this.view.style.left="0px",this.view.style.zIndex=`${2575+((t=e.layer)!==null&&t!==void 0?t:0)}`,this.view.style.position=this.useFixedPosition?"fixed":"absolute",Do(this.view),this.toDisposeOnClean=e.render(this.view)||H.None,this.delegate=e,this.doLayout(),(n=(i=this.delegate).focus)===null||n===void 0||n.call(i)}getViewElement(){return this.view}layout(){var e,t;if(this.isVisible()){if(this.delegate.canRelayout===!1&&!(_d&&nF.pointerEvents)){this.hide();return}(t=(e=this.delegate)===null||e===void 0?void 0:e.layout)===null||t===void 0||t.call(e),this.doLayout()}}doLayout(){if(!this.isVisible())return;const e=this.delegate.getAnchor();let t;if(e instanceof HTMLElement){const h=qi(e),g=Ez(e);t={top:h.top*g,left:h.left*g,width:h.width*g,height:h.height*g}}else nbe(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=wo(this.view),n=uc(this.view),o=this.delegate.anchorPosition||0,r=this.delegate.anchorAlignment||0,a=this.delegate.anchorAxisAlignment||0;let l,d;const c=Hae();if(a===0){const h={offset:t.top-c.pageYOffset,size:t.height,position:o===0?0:1},g={offset:t.left,size:t.width,position:r===0?0:1,mode:Gu.ALIGN};l=pm(c.innerHeight,n,h)+c.pageYOffset,ts.intersects({start:l,end:l+n},{start:h.offset,end:h.offset+h.size})&&(g.mode=Gu.AVOID),d=pm(c.innerWidth,i,g)}else{const h={offset:t.left,size:t.width,position:r===0?0:1},g={offset:t.top,size:t.height,position:o===0?0:1,mode:Gu.ALIGN};d=pm(c.innerWidth,i,h),ts.intersects({start:d,end:d+i},{start:h.offset,end:h.offset+h.size})&&(g.mode=Gu.AVOID),l=pm(c.innerHeight,n,g)+c.pageYOffset}this.view.classList.remove("top","bottom","left","right"),this.view.classList.add(o===0?"bottom":"top"),this.view.classList.add(r===0?"left":"right"),this.view.classList.toggle("fixed",this.useFixedPosition);const u=qi(this.container);this.view.style.top=`${l-(this.useFixedPosition?qi(this.view).top:u.top)}px`,this.view.style.left=`${d-(this.useFixedPosition?qi(this.view).left:u.left)}px`,this.view.style.width="initial"}hide(e){const t=this.delegate;this.delegate=null,t!=null&&t.onHide&&t.onHide(e),this.toDisposeOnClean.dispose(),Es(this.view)}isVisible(){return!!this.delegate}onDOMEvent(e,t){this.delegate&&(this.delegate.onDOMEvent?this.delegate.onDOMEvent(e,Te(e).document.activeElement):t&&!An(e.target,this.container)&&this.hide())}dispose(){this.hide(),super.dispose()}}x_.BUBBLE_UP_EVENTS=["click","keydown","focus","blur"];x_.BUBBLE_DOWN_EVENTS=["click"];const sbe=` :host { all: initial; /* 1st rule so subsequent properties are reset. */ } .codicon[class*='codicon-'] { font: normal normal normal 16px/1 codicon; display: inline-block; text-decoration: none; text-rendering: auto; text-align: center; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; user-select: none; -webkit-user-select: none; -ms-user-select: none; } :host { font-family: -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "HelveticaNeue-Light", system-ui, "Ubuntu", "Droid Sans", sans-serif; } :host-context(.mac) { font-family: -apple-system, BlinkMacSystemFont, sans-serif; } :host-context(.mac:lang(zh-Hans)) { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", sans-serif; } :host-context(.mac:lang(zh-Hant)) { font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", sans-serif; } :host-context(.mac:lang(ja)) { font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic Pro", sans-serif; } :host-context(.mac:lang(ko)) { font-family: -apple-system, BlinkMacSystemFont, "Nanum Gothic", "Apple SD Gothic Neo", "AppleGothic", sans-serif; } :host-context(.windows) { font-family: "Segoe WPC", "Segoe UI", sans-serif; } :host-context(.windows:lang(zh-Hans)) { font-family: "Segoe WPC", "Segoe UI", "Microsoft YaHei", sans-serif; } :host-context(.windows:lang(zh-Hant)) { font-family: "Segoe WPC", "Segoe UI", "Microsoft Jhenghei", sans-serif; } :host-context(.windows:lang(ja)) { font-family: "Segoe WPC", "Segoe UI", "Yu Gothic UI", "Meiryo UI", sans-serif; } :host-context(.windows:lang(ko)) { font-family: "Segoe WPC", "Segoe UI", "Malgun Gothic", "Dotom", sans-serif; } :host-context(.linux) { font-family: system-ui, "Ubuntu", "Droid Sans", sans-serif; } :host-context(.linux:lang(zh-Hans)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans SC", "Source Han Sans CN", "Source Han Sans", sans-serif; } :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 obe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},rbe=function(s,e){return function(t,i){e(t,i,s)}};let yD=class extends H{constructor(e){super(),this.layoutService=e,this.contextView=this._register(new x_(this.layoutService.mainContainer,1)),this.layout(),this._register(e.onDidLayoutContainer(()=>this.layout()))}showContextView(e,t,i){let n;t?t===this.layoutService.getContainer(Te(t))?n=1:i?n=3:n=2:n=1,this.contextView.setContainer(t??this.layoutService.activeContainer,n),this.contextView.show(e);const o={close:()=>{this.openContextView===o&&this.hideContextView()}};return this.openContextView=o,o}layout(){this.contextView.layout()}hideContextView(e){this.contextView.hide(e),this.openContextView=void 0}};yD=obe([rbe(0,ig)],yD);class abe extends yD{getContextViewElement(){return this.contextView.getViewElement()}}class lbe{constructor(e,t,i){this.hoverDelegate=e,this.target=t,this.fadeInAnimation=i}async update(e,t,i){var n;if(this._cancellationTokenSource&&(this._cancellationTokenSource.dispose(!0),this._cancellationTokenSource=void 0),this.isDisposed)return;let o;if(e===void 0||lo(e)||e instanceof HTMLElement)o=e;else if(!kS(e.markdown))o=(n=e.markdown)!==null&&n!==void 0?n:e.markdownNotSupportedFallback;else{this._hoverWidget||this.show(p("iconLabel.loading","Loading..."),t),this._cancellationTokenSource=new Vi;const r=this._cancellationTokenSource.token;if(o=await e.markdown(r),o===void 0&&(o=e.markdownNotSupportedFallback),this.isDisposed||r.isCancellationRequested)return}this.show(o,t,i)}show(e,t,i){const n=this._hoverWidget;if(this.hasContent(e)){const o={content:e,target:this.target,appearance:{showPointer:this.hoverDelegate.placement==="element",skipFadeInAnimation:!this.fadeInAnimation||!!n},position:{hoverPosition:2},...i};this._hoverWidget=this.hoverDelegate.showHover(o,t)}n==null||n.dispose()}hasContent(e){return e?tl(e)?!!e.value:!0:!1}get isDisposed(){var e;return(e=this._hoverWidget)===null||e===void 0?void 0:e.isDisposed}dispose(){var e,t;(e=this._hoverWidget)===null||e===void 0||e.dispose(),(t=this._cancellationTokenSource)===null||t===void 0||t.dispose(!0),this._cancellationTokenSource=void 0}}var dbe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},q0=function(s,e){return function(t,i){e(t,i,s)}};let m2=class extends H{constructor(e,t,i,n,o){super(),this._instantiationService=e,this._keybindingService=i,this._layoutService=n,this._accessibilityService=o,t.onDidShowContextMenu(()=>this.hideHover()),this._contextViewHandler=this._register(new yD(this._layoutService))}showHover(e,t,i){var n,o,r,a;if(r6(this._currentHoverOptions)===r6(e)||this._currentHover&&(!((o=(n=this._currentHoverOptions)===null||n===void 0?void 0:n.persistence)===null||o===void 0)&&o.sticky))return;this._currentHoverOptions=e,this._lastHoverOptions=e;const l=e.trapFocus||this._accessibilityService.isScreenReaderOptimized(),d=Xn();i||(l&&d?this._lastFocusedElementBeforeOpen=d:this._lastFocusedElementBeforeOpen=void 0);const c=new Y,u=this._instantiationService.createInstance(p2,e);if(!((r=e.persistence)===null||r===void 0)&&r.sticky&&(u.isLocked=!0),u.onDispose(()=>{var h,g;((h=this._currentHover)===null||h===void 0?void 0:h.domNode)&&Tz(this._currentHover.domNode)&&((g=this._lastFocusedElementBeforeOpen)===null||g===void 0||g.focus()),this._currentHoverOptions===e&&(this._currentHoverOptions=void 0),c.dispose()},void 0,c),!e.container){const h=e.target instanceof HTMLElement?e.target:e.target.targetElements[0];e.container=this._layoutService.getContainer(Te(h))}if(this._contextViewHandler.showContextView(new cbe(u,t),e.container),u.onRequestLayout(()=>this._contextViewHandler.layout(),void 0,c),!((a=e.persistence)===null||a===void 0)&&a.sticky)c.add(K(Te(e.container).document,ee.MOUSE_DOWN,h=>{An(h.target,u.domNode)||this.doHideHover()}));else{if("targetElements"in e.target)for(const g of e.target.targetElements)c.add(K(g,ee.CLICK,()=>this.hideHover()));else c.add(K(e.target,ee.CLICK,()=>this.hideHover()));const h=Xn();if(h){const g=Te(h).document;c.add(K(h,ee.KEY_DOWN,f=>{var m;return this._keyDown(f,u,!!(!((m=e.persistence)===null||m===void 0)&&m.hideOnKeyDown))})),c.add(K(g,ee.KEY_DOWN,f=>{var m;return this._keyDown(f,u,!!(!((m=e.persistence)===null||m===void 0)&&m.hideOnKeyDown))})),c.add(K(h,ee.KEY_UP,f=>this._keyUp(f,u))),c.add(K(g,ee.KEY_UP,f=>this._keyUp(f,u)))}}if("IntersectionObserver"in Ht){const h=new IntersectionObserver(f=>this._intersectionChange(f,u),{threshold:0}),g="targetElements"in e.target?e.target.targetElements[0]:e.target;h.observe(g),c.add(Ie(()=>h.disconnect()))}return this._currentHover=u,u}hideHover(){var e;!((e=this._currentHover)===null||e===void 0)&&e.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.showHover(this._lastHoverOptions,!0,!0)}_keyDown(e,t,i){var n,o;if(e.key==="Alt"){t.isLocked=!0;return}const r=new Kt(e);this._keybindingService.resolveKeyboardEvent(r).getSingleModifierDispatchChords().some(l=>!!l)||this._keybindingService.softDispatch(r,r.target).kind!==0||i&&(!(!((n=this._currentHoverOptions)===null||n===void 0)&&n.trapFocus)||e.key!=="Tab")&&(this.hideHover(),(o=this._lastFocusedElementBeforeOpen)===null||o===void 0||o.focus())}_keyUp(e,t){var i;e.key==="Alt"&&(t.isLocked=!1,t.isMouseIn||(this.hideHover(),(i=this._lastFocusedElementBeforeOpen)===null||i===void 0||i.focus()))}setupUpdatableHover(e,t,i,n){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 o,r;const a=(C,w)=>{var y;const D=r!==void 0;C&&(r==null||r.dispose(),r=void 0),w&&(o==null||o.dispose(),o=void 0),D&&((y=e.onDidHideHover)===null||y===void 0||y.call(e),r=void 0)},l=(C,w,y)=>new ya(async()=>{(!r||r.isDisposed)&&(r=new lbe(e,y||t,C>0),await r.update(typeof i=="function"?i():i,w,n))},C);let d=!1;const c=K(t,ee.MOUSE_DOWN,()=>{d=!0,a(!0,!0)},!0),u=K(t,ee.MOUSE_UP,()=>{d=!1},!0),h=K(t,ee.MOUSE_LEAVE,C=>{d=!1,a(!1,C.fromElement===t)},!0),g=C=>{if(o)return;const w=new Y,y={targetElements:[t],dispose:()=>{}};if(e.placement===void 0||e.placement==="mouse"){const D=L=>{y.x=L.x+10,L.target instanceof HTMLElement&&a6(L.target,t)!==t&&a(!0,!0)};w.add(K(t,ee.MOUSE_MOVE,D,!0))}o=w,!(C.target instanceof HTMLElement&&a6(C.target,t)!==t)&&w.add(l(e.delay,!1,y))},f=K(t,ee.MOUSE_OVER,g,!0),m=()=>{if(d||o)return;const C={targetElements:[t],dispose:()=>{}},w=new Y,y=()=>a(!0,!0);w.add(K(t,ee.BLUR,y,!0)),w.add(l(e.delay,!1,C)),o=w};let _;const v=t.tagName.toLowerCase();return v!=="input"&&v!=="textarea"&&(_=K(t,ee.FOCUS,m,!0)),{show:C=>{a(!1,!0),l(0,C)},hide:()=>{a(!0,!0)},update:async(C,w)=>{i=C,await(r==null?void 0:r.update(i,void 0,w))},dispose:()=>{f.dispose(),h.dispose(),c.dispose(),u.dispose(),_==null||_.dispose(),a(!0,!0)}}}};m2=dbe([q0(0,Ne),q0(1,Oo),q0(2,At),q0(3,ig),q0(4,gr)],m2);function r6(s){var e;if(s!==void 0)return(e=s==null?void 0:s.id)!==null&&e!==void 0?e:s}class cbe{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 a6(s,e){for(e=e??Te(s).document.body;!s.hasAttribute("custom-hover")&&s!==e;)s=s.parentElement;return s}mt(Md,m2,1);zr((s,e)=>{const t=s.getColor(EU);t&&(e.addRule(`.monaco-workbench .workbench-hover .hover-row:not(:first-child):not(:empty) { border-top: 1px solid ${t.transparent(.5)}; }`),e.addRule(`.monaco-workbench .workbench-hover hr { border-top: 1px solid ${t.transparent(.5)}; }`))});const x1=ut("IWorkspaceEditService");class yO{constructor(e){this.metadata=e}static convert(e){return e.edits.map(t=>{if(dh.is(t))return dh.lift(t);if(Um.is(t))return Um.lift(t);throw new Error("Unsupported edit")})}}class dh extends yO{static is(e){return e instanceof dh?!0:Ms(e)&&Ae.isUri(e.resource)&&Ms(e.textEdit)}static lift(e){return e instanceof dh?e:new dh(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 Um extends yO{static is(e){return e instanceof Um?!0:Ms(e)&&(!!e.newResource||!!e.oldResource)}static lift(e){return e instanceof Um?e:new Um(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 es={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},hideUnchangedRegions:{enabled:!1,contextLineCount:3,minimumLineCount:3,revealLineCount:20},isInEmbeddedEditor:!1,onlyShowAccessibleDiffViewer:!1,renderSideBySideInlineBreakpoint:900,useInlineViewWhenSpaceIsLimited:!0},Vx=Object.freeze({id:"editor",order:5,type:"object",title:p("editorConfigurationTitle","Editor"),scope:5}),SD={...Vx,properties:{"editor.tabSize":{type:"number",default:ns.tabSize,minimum:1,markdownDescription:p("tabSize","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:p("indentSize",'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:ns.insertSpaces,markdownDescription:p("insertSpaces","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:ns.detectIndentation,markdownDescription:p("detectIndentation","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:ns.trimAutoWhitespace,description:p("trimAutoWhitespace","Remove trailing auto inserted whitespace.")},"editor.largeFileOptimizations":{type:"boolean",default:ns.largeFileOptimizations,description:p("largeFileOptimizations","Special handling for large files to disable certain memory intensive features.")},"editor.wordBasedSuggestions":{enum:["off","currentDocument","matchingDocuments","allDocuments"],default:"matchingDocuments",enumDescriptions:[p("wordBasedSuggestions.off","Turn off Word Based Suggestions."),p("wordBasedSuggestions.currentDocument","Only suggest words from the active document."),p("wordBasedSuggestions.matchingDocuments","Suggest words from all open documents of the same language."),p("wordBasedSuggestions.allDocuments","Suggest words from all open documents.")],description:p("wordBasedSuggestions","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:[p("semanticHighlighting.true","Semantic highlighting enabled for all color themes."),p("semanticHighlighting.false","Semantic highlighting disabled for all color themes."),p("semanticHighlighting.configuredByTheme","Semantic highlighting is configured by the current color theme's `semanticHighlighting` setting.")],default:"configuredByTheme",description:p("semanticHighlighting.enabled","Controls whether the semanticHighlighting is shown for the languages that support it.")},"editor.stablePeek":{type:"boolean",default:!1,markdownDescription:p("stablePeek","Keep peek editors open even when double-clicking their content or when hitting `Escape`.")},"editor.maxTokenizationLineLength":{type:"integer",default:2e4,description:p("maxTokenizationLineLength","Lines above this length will not be tokenized for performance reasons")},"editor.experimental.asyncTokenization":{type:"boolean",default:!1,description:p("editor.experimental.asyncTokenization","Controls whether the tokenization should happen asynchronously on a web worker."),tags:["experimental"]},"editor.experimental.asyncTokenizationLogging":{type:"boolean",default:!1,description:p("editor.experimental.asyncTokenizationLogging","Controls whether async tokenization should be logged. For debugging only.")},"editor.experimental.asyncTokenizationVerification":{type:"boolean",default:!1,description:p("editor.experimental.asyncTokenizationVerification","Controls whether async tokenization should be verified against legacy background tokenization. Might slow down tokenization. For debugging only."),tags:["experimental"]},"editor.language.brackets":{type:["array","null"],default:null,description:p("schema.brackets","Defines the bracket symbols that increase or decrease the indentation."),items:{type:"array",items:[{type:"string",description:p("schema.openBracket","The opening bracket character or string sequence.")},{type:"string",description:p("schema.closeBracket","The closing bracket character or string sequence.")}]}},"editor.language.colorizedBracketPairs":{type:["array","null"],default:null,description:p("schema.colorizedBracketPairs","Defines the bracket pairs that are colorized by their nesting level if bracket pair colorization is enabled."),items:{type:"array",items:[{type:"string",description:p("schema.openBracket","The opening bracket character or string sequence.")},{type:"string",description:p("schema.closeBracket","The closing bracket character or string sequence.")}]}},"diffEditor.maxComputationTime":{type:"number",default:es.maxComputationTime,description:p("maxComputationTime","Timeout in milliseconds after which diff computation is cancelled. Use 0 for no timeout.")},"diffEditor.maxFileSize":{type:"number",default:es.maxFileSize,description:p("maxFileSize","Maximum file size in MB for which to compute diffs. Use 0 for no limit.")},"diffEditor.renderSideBySide":{type:"boolean",default:es.renderSideBySide,description:p("sideBySide","Controls whether the diff editor shows the diff side by side or inline.")},"diffEditor.renderSideBySideInlineBreakpoint":{type:"number",default:es.renderSideBySideInlineBreakpoint,description:p("renderSideBySideInlineBreakpoint","If the diff editor width is smaller than this value, the inline view is used.")},"diffEditor.useInlineViewWhenSpaceIsLimited":{type:"boolean",default:es.useInlineViewWhenSpaceIsLimited,description:p("useInlineViewWhenSpaceIsLimited","If enabled and the editor width is too small, the inline view is used.")},"diffEditor.renderMarginRevertIcon":{type:"boolean",default:es.renderMarginRevertIcon,description:p("renderMarginRevertIcon","When enabled, the diff editor shows arrows in its glyph margin to revert changes.")},"diffEditor.renderGutterMenu":{type:"boolean",default:es.renderGutterMenu,description:p("renderGutterMenu","When enabled, the diff editor shows a special gutter for revert and stage actions.")},"diffEditor.ignoreTrimWhitespace":{type:"boolean",default:es.ignoreTrimWhitespace,description:p("ignoreTrimWhitespace","When enabled, the diff editor ignores changes in leading or trailing whitespace.")},"diffEditor.renderIndicators":{type:"boolean",default:es.renderIndicators,description:p("renderIndicators","Controls whether the diff editor shows +/- indicators for added/removed changes.")},"diffEditor.codeLens":{type:"boolean",default:es.diffCodeLens,description:p("codeLens","Controls whether the editor shows CodeLens.")},"diffEditor.wordWrap":{type:"string",enum:["off","on","inherit"],default:es.diffWordWrap,markdownEnumDescriptions:[p("wordWrap.off","Lines will never wrap."),p("wordWrap.on","Lines will wrap at the viewport width."),p("wordWrap.inherit","Lines will wrap according to the {0} setting.","`#editor.wordWrap#`")]},"diffEditor.diffAlgorithm":{type:"string",enum:["legacy","advanced"],default:es.diffAlgorithm,markdownEnumDescriptions:[p("diffAlgorithm.legacy","Uses the legacy diffing algorithm."),p("diffAlgorithm.advanced","Uses the advanced diffing algorithm.")],tags:["experimental"]},"diffEditor.hideUnchangedRegions.enabled":{type:"boolean",default:es.hideUnchangedRegions.enabled,markdownDescription:p("hideUnchangedRegions.enabled","Controls whether the diff editor shows unchanged regions.")},"diffEditor.hideUnchangedRegions.revealLineCount":{type:"integer",default:es.hideUnchangedRegions.revealLineCount,markdownDescription:p("hideUnchangedRegions.revealLineCount","Controls how many lines are used for unchanged regions."),minimum:1},"diffEditor.hideUnchangedRegions.minimumLineCount":{type:"integer",default:es.hideUnchangedRegions.minimumLineCount,markdownDescription:p("hideUnchangedRegions.minimumLineCount","Controls how many lines are used as a minimum for unchanged regions."),minimum:1},"diffEditor.hideUnchangedRegions.contextLineCount":{type:"integer",default:es.hideUnchangedRegions.contextLineCount,markdownDescription:p("hideUnchangedRegions.contextLineCount","Controls how many lines are used as context when comparing unchanged regions."),minimum:1},"diffEditor.experimental.showMoves":{type:"boolean",default:es.experimental.showMoves,markdownDescription:p("showMoves","Controls whether the diff editor should show detected code moves.")},"diffEditor.experimental.showEmptyDecorations":{type:"boolean",default:es.experimental.showEmptyDecorations,description:p("showEmptyDecorations","Controls whether the diff editor shows empty decorations to see where characters got inserted or deleted.")}}};function ube(s){return typeof s.type<"u"||typeof s.anyOf<"u"}for(const s of Jp){const e=s.schema;if(typeof e<"u")if(ube(e))SD.properties[`editor.${s.name}`]=e;else for(const t in e)Object.hasOwnProperty.call(e,t)&&(SD.properties[t]=e[t])}let Kw=null;function aj(){return Kw===null&&(Kw=Object.create(null),Object.keys(SD.properties).forEach(s=>{Kw[s]=!0})),Kw}function hbe(s){return aj()[`editor.${s}`]||!1}function gbe(s){return aj()[`diffEditor.${s}`]||!1}const fbe=Ji.as(pl.Configuration);fbe.registerConfiguration(SD);class pi{static insert(e,t){return{range:new x(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 qw(s){return Object.isFrozen(s)?s:Nse(s)}class Vn{static createEmptyModel(e){return new Vn({},[],[],void 0,e)}constructor(e,t,i,n,o){this._contents=e,this._keys=t,this._overrides=i,this.raw=n,this.logService=o,this.overrideConfigurations=new Map}get rawConfiguration(){var e;if(!this._rawConfiguration)if(!((e=this.raw)===null||e===void 0)&&e.length){const t=this.raw.map(i=>{if(i instanceof Vn)return i;const n=new pbe("",this.logService);return n.parseRaw(i),n.configurationModel});this._rawConfiguration=t.reduce((i,n)=>n===i?n:i.merge(n),t[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?R3(this.contents,e):this.contents}inspect(e,t){const i=this;return{get value(){return qw(i.rawConfiguration.getValue(e))},get override(){return t?qw(i.rawConfiguration.getOverrideValue(e,t)):void 0},get merged(){return qw(t?i.rawConfiguration.override(t).getValue(e):i.rawConfiguration.getValue(e))},get overrides(){const n=[];for(const{contents:o,identifiers:r,keys:a}of i.rawConfiguration.overrides){const l=new Vn(o,a,[],void 0,i.logService).getValue(e);l!==void 0&&n.push({identifiers:r,value:l})}return n.length?qw(n):void 0}}}getOverrideValue(e,t){const i=this.getContentsForOverrideIdentifer(t);return i?e?R3(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){var t,i;const n=Jd(this.contents),o=Jd(this.overrides),r=[...this.keys],a=!((t=this.raw)===null||t===void 0)&&t.length?[...this.raw]:[this];for(const l of e)if(a.push(...!((i=l.raw)===null||i===void 0)&&i.length?l.raw:[l]),!l.isEmpty()){this.mergeContents(n,l.contents);for(const d of l.overrides){const[c]=o.filter(u=>Ci(u.identifiers,d.identifiers));c?(this.mergeContents(c.contents,d.contents),c.keys.push(...d.keys),c.keys=Wc(c.keys)):o.push(Jd(d))}for(const d of l.keys)r.indexOf(d)===-1&&r.push(d)}return new Vn(n,r,o,a.every(l=>l instanceof Vn)?void 0:a,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 Wc([...Object.keys(this.contents),...Object.keys(t)])){let o=this.contents[n];const r=t[n];r&&(typeof o=="object"&&typeof r=="object"?(o=Jd(o),this.mergeContents(o,r)):o=r),i[n]=o}return new Vn(i,this.keys,this.overrides,void 0,this.logService)}mergeContents(e,t){for(const i of Object.keys(t)){if(i in e&&Ms(e[i])&&Ms(t[i])){this.mergeContents(e[i],t[i]);continue}e[i]=Jd(t[i])}}getContentsForOverrideIdentifer(e){let t=null,i=null;const n=o=>{o&&(i?this.mergeContents(i,o):i=Jd(o))};for(const o of this.overrides)o.identifiers.length===1&&o.identifiers[0]===e?t=o.contents:o.identifiers.includes(e)&&n(o.contents);return n(t),i}toJSON(){return{contents:this.contents,overrides:this.overrides,keys:this.keys}}addValue(e,t){this.updateValue(e,t,!0)}setValue(e,t){this.updateValue(e,t,!1)}removeValue(e){const t=this.keys.indexOf(e);t!==-1&&(this.keys.splice(t,1),lde(this.contents,e),Th.test(e)&&this.overrides.splice(this.overrides.findIndex(i=>Ci(i.identifiers,qS(e))),1))}updateValue(e,t,i){Jz(this.contents,e,t,n=>this.logService.error(n)),i=i||this.keys.indexOf(e)===-1,i&&this.keys.push(e),Th.test(e)&&this.overrides.push({identifiers:qS(e),keys:Object.keys(this.contents[e]),contents:hA(this.contents[e],n=>this.logService.error(n))})}}class pbe{constructor(e,t){this._name=e,this.logService=t,this._raw=null,this._configurationModel=null,this._restrictedConfigurations=[]}get configurationModel(){return this._configurationModel||Vn.createEmptyModel(this.logService)}parseRaw(e,t){this._raw=e;const{contents:i,keys:n,overrides:o,restricted:r,hasExcludedProperties:a}=this.doParseRaw(e,t);this._configurationModel=new Vn(i,n,o,a?[e]:void 0,this.logService),this._restrictedConfigurations=r||[]}doParseRaw(e,t){const i=Ji.as(pl.Configuration).getConfigurationProperties(),n=this.filter(e,i,!0,t);e=n.raw;const o=hA(e,l=>this.logService.error(`Conflict in settings file ${this._name}: ${l}`)),r=Object.keys(e),a=this.toOverrides(e,l=>this.logService.error(`Conflict in settings file ${this._name}: ${l}`));return{contents:o,keys:r,overrides:a,restricted:n.restricted,hasExcludedProperties:n.hasExcludedProperties}}filter(e,t,i,n){var o,r,a;let l=!1;if(!(n!=null&&n.scopes)&&!(n!=null&&n.skipRestricted)&&!(!((o=n==null?void 0:n.exclude)===null||o===void 0)&&o.length))return{raw:e,restricted:[],hasExcludedProperties:l};const d={},c=[];for(const u in e)if(Th.test(u)&&i){const h=this.filter(e[u],t,!1,n);d[u]=h.raw,l=l||h.hasExcludedProperties,c.push(...h.restricted)}else{const h=t[u],g=h?typeof h.scope<"u"?h.scope:3:void 0;h!=null&&h.restricted&&c.push(u),!(!((r=n.exclude)===null||r===void 0)&&r.includes(u))&&(!((a=n.include)===null||a===void 0)&&a.includes(u)||(g===void 0||n.scopes===void 0||n.scopes.includes(g))&&!(n.skipRestricted&&(h!=null&&h.restricted)))?d[u]=e[u]:l=!0}return{raw:d,restricted:c,hasExcludedProperties:l}}toOverrides(e,t){const i=[];for(const n of Object.keys(e))if(Th.test(n)){const o={};for(const r in e[n])o[r]=e[n][r];i.push({identifiers:qS(n),keys:Object.keys(o),contents:hA(o,t)})}return i}}class mbe{constructor(e,t,i,n,o,r,a,l,d,c,u,h,g){this.key=e,this.overrides=t,this._value=i,this.overrideIdentifiers=n,this.defaultConfiguration=o,this.policyConfiguration=r,this.applicationConfiguration=a,this.userConfiguration=l,this.localUserConfiguration=d,this.remoteUserConfiguration=c,this.workspaceConfiguration=u,this.folderConfigurationModel=h,this.memoryConfigurationModel=g}toInspectValue(e){return(e==null?void 0:e.value)!==void 0||(e==null?void 0:e.override)!==void 0||(e==null?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 zx{constructor(e,t,i,n,o,r,a,l,d,c){this._defaultConfiguration=e,this._policyConfiguration=t,this._applicationConfiguration=i,this._localUserConfiguration=n,this._remoteUserConfiguration=o,this._workspaceConfiguration=r,this._folderConfigurations=a,this._memoryConfiguration=l,this._memoryConfigurationByResource=d,this.logService=c,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations=new Wi,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=Vn.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),o=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 d of l.identifiers)n.getOverrideValue(e,d)!==void 0&&a.add(d);return new mbe(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,o||void 0,r)}get applicationConfiguration(){return this._applicationConfiguration}get userConfiguration(){return this._userConfiguration||(this._userConfiguration=this._remoteUserConfiguration.isEmpty()?this._localUserConfiguration:this._localUserConfiguration.merge(this._remoteUserConfiguration)),this._userConfiguration}get localUserConfiguration(){return this._localUserConfiguration}get remoteUserConfiguration(){return this._remoteUserConfiguration}getConsolidatedConfigurationModel(e,t,i){let n=this.getConsolidatedConfigurationModelForResource(t,i);return t.overrideIdentifier&&(n=n.override(t.overrideIdentifier)),!this._policyConfiguration.isEmpty()&&this._policyConfiguration.getValue(e)!==void 0&&(n=n.merge(this._policyConfiguration)),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 o=this._memoryConfigurationByResource.get(e);o&&(i=i.merge(o))}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},user:{contents:this.userConfiguration.contents,overrides:this.userConfiguration.overrides,keys:this.userConfiguration.keys},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:o}=this._folderConfigurations.get(t);return e.push([t,{contents:i,overrides:n,keys:o}]),e},[])}}static parse(e,t){const i=this.parseConfigurationModel(e.defaults,t),n=this.parseConfigurationModel(e.policy,t),o=this.parseConfigurationModel(e.application,t),r=this.parseConfigurationModel(e.user,t),a=this.parseConfigurationModel(e.workspace,t),l=e.folders.reduce((d,c)=>(d.set(Ae.revive(c[0]),this.parseConfigurationModel(c[1],t)),d),new Wi);return new zx(i,n,o,r,Vn.createEmptyModel(t),a,l,Vn.createEmptyModel(t),new Wi,t)}static parseConfigurationModel(e,t){return new Vn(e.contents,e.keys,e.overrides,void 0,t)}}class _be{constructor(e,t,i,n,o){this.change=e,this.previous=t,this.currentConfiguraiton=i,this.currentWorkspace=n,this.logService=o,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=zx.parse(this.previous.data,this.logService)),this._previousConfiguration}affectsConfiguration(e,t){var i;const n=this._marker+e,o=this._affectsConfigStr.indexOf(n);if(o<0)return!1;const r=o+n.length;if(r>=this._affectsConfigStr.length)return!1;const a=this._affectsConfigStr.charCodeAt(r);if(a!==this._markerCode1&&a!==this._markerCode2)return!1;if(t){const l=this.previousConfiguration?this.previousConfiguration.getValue(e,t,(i=this.previous)===null||i===void 0?void 0:i.workspace):void 0,d=this.currentConfiguraiton.getValue(e,t,this.currentWorkspace);return!tr(l,d)}return!0}}const DD={kind:0},vbe={kind:1};function bbe(s,e,t){return{kind:2,commandId:s,commandArgs:e,isBubble:t}}class ab{constructor(e,t,i){var n;this._log=i,this._defaultKeybindings=e,this._defaultBoundCommands=new Map;for(const o of e){const r=o.command;r&&r.charAt(0)!=="-"&&this._defaultBoundCommands.set(r,!0)}this._map=new Map,this._lookupMap=new Map,this._keybindings=ab.handleRemovals([].concat(e).concat(t));for(let o=0,r=this._keybindings.length;o"u"){this._map.set(e,[t]),this._addToLookupMap(t);return}for(let n=i.length-1;n>=0;n--){const o=i[n];if(o.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"||i.length===0)return null;if(i.length===1)return i[0];for(let n=i.length-1;n>=0;n--){const o=i[n];if(t.contextMatchesRules(o.when))return o}return i[i.length-1]}resolve(e,t,i){const n=[...t,i];this._log(`| Resolving ${n}`);const o=this._map.get(n[0]);if(o===void 0)return this._log("\\ No keybinding entries."),DD;let r=null;if(n.length<2)r=o;else{r=[];for(let l=0,d=o.length;lc.chords.length)continue;let u=!0;for(let h=1;h=0;i--){const n=t[i];if(ab._contextMatchesRules(e,n.when))return n}return null}static _contextMatchesRules(e,t){return t?t.evaluate(e):!0}}function l6(s){return s?`${s.serialize()}`:"no when condition"}function d6(s){return s.extensionId?s.isBuiltinExtension?`built-in extension ${s.extensionId}`:`user extension ${s.extensionId}`:s.isDefault?"built-in":"user"}const Cbe=/^(cursor|delete|undo|redo|tab|editor\.action\.clipboard)/;class wbe extends H{get onDidUpdateKeybindings(){return this._onDidUpdateKeybindings?this._onDidUpdateKeybindings.event:le.None}get inChordMode(){return this._currentChords.length>0}constructor(e,t,i,n,o){super(),this._contextKeyService=e,this._commandService=t,this._telemetryService=i,this._notificationService=n,this._logService=o,this._onDidUpdateKeybindings=this._register(new B),this._currentChords=[],this._currentChordChecker=new oF,this._currentChordStatusMessage=null,this._ignoreSingleModifiers=mm.EMPTY,this._currentSingleModifier=null,this._currentSingleModifierClearTimeout=new ya,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){const i=this._getResolver().lookupPrimaryKeybinding(e,t||this._contextKeyService);if(i)return i.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"),DD;const[n]=i.getDispatchChords();if(n===null)return this._log("\\ Keyboard event cannot be dispatched"),DD;const o=this._contextKeyService.getContext(t),r=this._currentChords.map(({keypress:a})=>a);return this._getResolver().resolve(o,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 UP("impossible");case 1:this._currentChordStatusMessage=this._notificationService.status(p("first.chord","({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(p("next.chord","({0}) was pressed. Waiting for next key of chord...",i))}}this._scheduleLeaveChordMode(),Kv.enabled&&Kv.disable()}_leaveChordMode(){this._currentChordStatusMessage&&(this._currentChordStatusMessage.dispose(),this._currentChordStatusMessage=null),this._currentChordChecker.cancel(),this._currentChords=[],Kv.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=mm.EMPTY,this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1):(this._ignoreSingleModifiers=mm.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[o]=i.getChords();return this._ignoreSingleModifiers=new mm(o),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){var n;let o=!1;if(e.hasMultipleChords())return console.warn("Unexpected keyboard event mapped to multiple chords"),!1;let r=null,a=null;if(i){const[u]=e.getSingleModifierDispatchChords();r=u,a=u?[u]:[]}else[r]=e.getDispatchChords(),a=this._currentChords.map(({keypress:u})=>u);if(r===null)return this._log("\\ Keyboard event cannot be dispatched in keydown phase."),o;const l=this._contextKeyService.getContext(t),d=e.getLabel(),c=this._getResolver().resolve(l,a,r);switch(c.kind){case 0:{if(this._logService.trace("KeybindingService#dispatch",d,"[ No matching keybinding ]"),this.inChordMode){const u=this._currentChords.map(({label:h})=>h).join(", ");this._log(`+ Leaving multi-chord mode: Nothing bound to "${u}, ${d}".`),this._notificationService.status(p("missing.chord","The key combination ({0}, {1}) is not a command.",u,d),{hideAfter:10*1e3}),this._leaveChordMode(),o=!0}return o}case 1:return this._logService.trace("KeybindingService#dispatch",d,"[ Several keybindings match - more chords needed ]"),o=!0,this._expectAnotherChord(r,d),this._log(this._currentChords.length===1?"+ Entering multi-chord mode...":"+ Continuing multi-chord mode..."),o;case 2:{if(this._logService.trace("KeybindingService#dispatch",d,`[ Will dispatch command ${c.commandId} ]`),c.commandId===null||c.commandId===""){if(this.inChordMode){const u=this._currentChords.map(({label:h})=>h).join(", ");this._log(`+ Leaving chord mode: Nothing bound to "${u}, ${d}".`),this._notificationService.status(p("missing.chord","The key combination ({0}, {1}) is not a command.",u,d),{hideAfter:10*1e3}),this._leaveChordMode(),o=!0}}else{this.inChordMode&&this._leaveChordMode(),c.isBubble||(o=!0),this._log(`+ Invoking command ${c.commandId}.`),this._currentlyDispatchingCommandId=c.commandId;try{typeof c.commandArgs>"u"?this._commandService.executeCommand(c.commandId).then(void 0,u=>this._notificationService.warn(u)):this._commandService.executeCommand(c.commandId,c.commandArgs).then(void 0,u=>this._notificationService.warn(u))}finally{this._currentlyDispatchingCommandId=null}Cbe.test(c.commandId)||this._telemetryService.publicLog2("workbenchActionExecuted",{id:c.commandId,from:"keybinding",detail:(n=e.getUserSettingsLabel())!==null&&n!==void 0?n:void 0})}return o}}}mightProducePrintableCharacter(e){return e.ctrlKey||e.metaKey?!1:e.keyCode>=31&&e.keyCode<=56||e.keyCode>=21&&e.keyCode<=30}}class mm{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}}}mm.EMPTY=new mm(null);class c6{constructor(e,t,i,n,o,r,a){this._resolvedKeybindingItemBrand=void 0,this.resolvedKeybinding=e,this.chords=e?_2(e.getDispatchChords()):[],e&&this.chords.length===0&&(this.chords=_2(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=o,this.extensionId=r,this.isBuiltinExtension=a}}function _2(s){const e=[];for(let t=0,i=s.length;tthis._getLabel(e))}getAriaLabel(){return ybe.toLabel(this._os,this._chords,e=>this._getAriaLabel(e))}getElectronAccelerator(){return this._chords.length>1||this._chords[0].isDuplicateModifierCase()?null:Sbe.toLabel(this._os,this._chords,e=>this._getElectronAccelerator(e))}getUserSettingsLabel(){return Dbe.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 zre(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 lC extends xbe{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 sc.toString(e)}_getLabel(e){return e.isDuplicateModifierCase()?"":this._keyCodeToUILabel(e.keyCode)}_getAriaLabel(e){return e.isDuplicateModifierCase()?"":sc.toString(e.keyCode)}_getElectronAccelerator(e){return sc.toElectronAccelerator(e.keyCode)}_getUserSettingsLabel(e){if(e.isDuplicateModifierCase())return"";const t=sc.toUserSettingsUS(e.keyCode);return t&&t.toLowerCase()}_getChordDispatch(e){return lC.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+=sc.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=GP[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 Vc)return e;const t=this._scanCodeToKeyCode(e.scanCode);return t===0?null:new Vc(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,t)}static resolveKeybinding(e,t){const i=_2(e.chords.map(n=>this._toKeyCodeChord(n)));return i.length>0?[new lC(i,t)]:[]}}const k_=ut("labelService"),lj=ut("progressService");class Nc{constructor(e){this.callback=e}report(e){this._value=e,this.callback(this._value)}}Nc.None=Object.freeze({report(){}});const sg=ut("editorProgressService");class kbe{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 $m(new Tbe(e,t))}static forStrings(){return new $m(new kbe)}static forConfigKeys(){return new $m(new Ebe)}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 Gw,this._root.segment=i.value());const o=[];for(n=this._root;;){const a=i.cmp(n.segment);if(a>0)n.left||(n.left=new Gw,n.left.segment=i.value()),o.push([-1,n]),n=n.left;else if(a<0)n.right||(n.right=new Gw,n.right.segment=i.value()),o.push([1,n]),n=n.right;else if(i.hasNext())i.next(),n.mid||(n.mid=new Gw,n.mid.segment=i.value()),o.push([0,n]),n=n.mid;else break}const r=n.value;n.value=t,n.key=e;for(let a=o.length-1;a>=0;a--){const l=o[a][1];l.updateHeight();const d=l.balanceFactor();if(d<-1||d>1){const c=o[a][0],u=o[a+1][0];if(c===1&&u===1)o[a][1]=l.rotateLeft();else if(c===-1&&u===-1)o[a][1]=l.rotateRight();else if(c===1&&u===-1)l.right=o[a+1][1]=o[a+1][1].rotateRight(),o[a][1]=l.rotateLeft();else if(c===-1&&u===1)l.left=o[a+1][1]=o[a+1][1].rotateLeft(),o[a][1]=l.rotateRight();else throw new Error;if(a>0)switch(o[a-1][0]){case-1:o[a-1][1].left=o[a][1];break;case 1:o[a-1][1].right=o[a][1];break;case 0:o[a-1][1].mid=o[a][1];break}else this._root=o[0][1]}}return r}get(e){var t;return(t=this._getNode(e))===null||t===void 0?void 0:t.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==null?void 0:t.value)===void 0&&(t==null?void 0:t.mid)===void 0)}delete(e){return this._delete(e,!1)}deleteSuperstr(e){return this._delete(e,!0)}_delete(e,t){var i;const n=this._iter.reset(e),o=[];let r=this._root;for(;r;){const a=n.cmp(r.segment);if(a>0)o.push([-1,r]),r=r.left;else if(a<0)o.push([1,r]),r=r.right;else if(n.hasNext())n.next(),o.push([0,r]),r=r.mid;else break}if(r){if(t?(r.left=void 0,r.mid=void 0,r.right=void 0,r.height=1):(r.key=void 0,r.value=void 0),!r.mid&&!r.value)if(r.left&&r.right){const a=this._min(r.right);if(a.key){const{key:l,value:d,segment:c}=a;this._delete(a.key,!1),r.key=l,r.value=d,r.segment=c}}else{const a=(i=r.left)!==null&&i!==void 0?i:r.right;if(o.length>0){const[l,d]=o[o.length-1];switch(l){case-1:d.left=a;break;case 0:d.mid=a;break;case 1:d.right=a;break}}else this._root=a}for(let a=o.length-1;a>=0;a--){const l=o[a][1];l.updateHeight();const d=l.balanceFactor();if(d>1?(l.right.balanceFactor()>=0||(l.right=l.right.rotateRight()),o[a][1]=l.rotateLeft()):d<-1&&(l.left.balanceFactor()<=0||(l.left=l.left.rotateLeft()),o[a][1]=l.rotateRight()),a>0)switch(o[a-1][0]){case-1:o[a-1][1].left=o[a][1];break;case 1:o[a-1][1].right=o[a][1];break;case 0:o[a-1][1].mid=o[a][1];break}else this._root=o[0][1]}}}_min(e){for(;e.left;)e=e.left;return e}findSubstr(e){const t=this._iter.reset(e);let i=this._root,n;for(;i;){const o=t.cmp(i.segment);if(o>0)i=i.left;else if(o<0)i=i.right;else if(t.hasNext())t.next(),n=i.value||n,i=i.mid;else break}return i&&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 o=i.cmp(n.segment);if(o>0)n=n.left;else if(o<0)n=n.right;else if(i.hasNext())i.next(),n=n.mid;else return n.mid?this._entries(n.mid):t?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&&t.push([e.key,e.value]),e.mid&&this._dfsEntries(e.mid,t),e.right&&this._dfsEntries(e.right,t))}}const If=ut("contextService");function v2(s){const e=s;return typeof(e==null?void 0:e.id)=="string"&&Ae.isUri(e.uri)}function Nbe(s){const e=s;return typeof(e==null?void 0:e.id)=="string"&&!v2(s)&&!Rbe(s)}const Abe={id:"empty-window"};function Mbe(s,e){if(typeof s=="string"||typeof s>"u")return typeof s=="string"?{id:nh(s)}:Abe;const t=s;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 Rbe(s){const e=s;return typeof(e==null?void 0:e.id)=="string"&&Ae.isUri(e.configPath)}class Pbe{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 b2="code-workspace";p("codeWorkspace","Code Workspace");const dj="4064f6ec-cb38-4ad0-af64-ee6467e63c82";function Fbe(s){return s.id===dj}var u6;(function(s){s.inspectTokensAction=p("inspectTokens","Developer: Inspect Tokens")})(u6||(u6={}));var h6;(function(s){s.gotoLineActionLabel=p("gotoLineActionLabel","Go to Line/Column...")})(h6||(h6={}));var g6;(function(s){s.helpQuickAccessActionLabel=p("helpQuickAccess","Show all Quick Access Providers")})(g6||(g6={}));var f6;(function(s){s.quickCommandActionLabel=p("quickCommandActionLabel","Command Palette"),s.quickCommandHelp=p("quickCommandActionHelp","Show And Run Commands")})(f6||(f6={}));var p6;(function(s){s.quickOutlineActionLabel=p("quickOutlineActionLabel","Go to Symbol..."),s.quickOutlineByCategoryActionLabel=p("quickOutlineByCategoryActionLabel","Go to Symbol by Category...")})(p6||(p6={}));var LD;(function(s){s.editorViewAccessibleLabel=p("editorViewAccessibleLabel","Editor content"),s.accessibilityHelpMessage=p("accessibilityHelpMessage","Press Alt+F1 for Accessibility Options.")})(LD||(LD={}));var m6;(function(s){s.toggleHighContrast=p("toggleHighContrast","Toggle High Contrast Theme")})(m6||(m6={}));var C2;(function(s){s.bulkEditServiceSummary=p("bulkEditServiceSummary","Made {0} edits in {1} files")})(C2||(C2={}));const cj=ut("workspaceTrustManagementService");let E_=[],DO=[],uj=[];function Zw(s,e=!1){Obe(s,!1,e)}function Obe(s,e,t){const i=Bbe(s,e);E_.push(i),i.userConfigured?uj.push(i):DO.push(i),t&&!i.userConfigured&&E_.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 Bbe(s,e){return{id:s.id,mime:s.mime,filename:s.filename,extension:s.extension,filepattern:s.filepattern,firstline:s.firstline,userConfigured:e,filenameLowercase:s.filename?s.filename.toLowerCase():void 0,extensionLowercase:s.extension?s.extension.toLowerCase():void 0,filepatternLowercase:s.filepattern?$$(s.filepattern.toLowerCase()):void 0,filepatternOnPath:s.filepattern?s.filepattern.indexOf(Yi.sep)>=0:!1}}function Wbe(){E_=E_.filter(s=>s.userConfigured),DO=[]}function Hbe(s,e){return Vbe(s,e).map(t=>t.id)}function Vbe(s,e){let t;if(s)switch(s.scheme){case Ge.file:t=s.fsPath;break;case Ge.data:{t=Mh.parseMetaData(s).get(Mh.META_DATA_LABEL);break}case Ge.vscodeNotebookCell:t=void 0;break;default:t=s.path}if(!t)return[{id:"unknown",mime:Ti.unknown}];t=t.toLowerCase();const i=nh(t),n=_6(t,i,uj);if(n)return[n,{id:ir,mime:Ti.text}];const o=_6(t,i,DO);if(o)return[o,{id:ir,mime:Ti.text}];if(e){const r=zbe(e);if(r)return[r,{id:ir,mime:Ti.text}]}return[{id:"unknown",mime:Ti.unknown}]}function _6(s,e,t){var i;let n,o,r;for(let a=t.length-1;a>=0;a--){const l=t[a];if(e===l.filenameLowercase){n=l;break}if(l.filepattern&&(!o||l.filepattern.length>o.filepattern.length)){const d=l.filepatternOnPath?s:e;!((i=l.filepatternLowercase)===null||i===void 0)&&i.call(l,d)&&(o=l)}l.extension&&(!r||l.extension.length>r.extension.length)&&e.endsWith(l.extensionLowercase)&&(r=l)}if(n)return n;if(o)return o;if(r)return r}function zbe(s){if(iF(s)&&(s=s.substr(1)),s.length>0)for(let e=E_.length-1;e>=0;e--){const t=E_[e];if(!t.firstline)continue;const i=s.match(t.firstline);if(i&&i.length>0)return t}}const Xw=Object.prototype.hasOwnProperty,v6="vs.editor.nullLanguage";class Ube{constructor(){this._languageIdToLanguage=[],this._languageToLanguageId=new Map,this._register(v6,0),this._register(ir,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]||v6}}class dC extends H{constructor(e=!0,t=!1){super(),this._onDidChange=this._register(new B),this.onDidChange=this._onDidChange.event,dC.instanceCount++,this._warnOnOverwrite=t,this.languageIdCodec=new Ube,this._dynamicLanguages=[],this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},e&&(this._initializeFromRegistry(),this._register(h_.onDidChangeLanguages(i=>{this._initializeFromRegistry()})))}dispose(){dC.instanceCount--,super.dispose()}_initializeFromRegistry(){this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},Wbe();const e=[].concat(h_.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})}),Ji.as(pl.Configuration).registerOverrideIdentifiers(this.getRegisteredLanguageIds()),this._onDidChange.fire()}_registerLanguage(e){const t=e.id;let i;Xw.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)Zw({id:i,mime:n,extension:a},this._warnOnOverwrite)}if(Array.isArray(t.filenames))for(const a of t.filenames)Zw({id:i,mime:n,filename:a},this._warnOnOverwrite),e.filenames.push(a);if(Array.isArray(t.filenamePatterns))for(const a of t.filenamePatterns)Zw({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);Ire(l)||Zw({id:i,mime:n,firstline:l},this._warnOnOverwrite)}catch(l){console.warn(`[${t.id}]: Invalid regular expression \`${a}\`: `,l)}}e.aliases.push(i);let o=null;if(typeof t.aliases<"u"&&Array.isArray(t.aliases)&&(t.aliases.length===0?o=[null]:o=t.aliases),o!==null)for(const a of o)!a||a.length===0||e.aliases.push(a);const r=o!==null&&o.length>0;if(!(r&&o[0]===null)){const a=(r?o[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?Xw.call(this._languages,e):!1}getRegisteredLanguageIds(){return Object.keys(this._languages)}getLanguageIdByLanguageName(e){const t=e.toLowerCase();return Xw.call(this._lowercaseNameMap,t)?this._lowercaseNameMap[t]:null}getLanguageIdByMimeType(e){return e&&Xw.call(this._mimeTypesMap,e)?this._mimeTypesMap[e]:null}guessLanguageIdByFilepathOrFirstLine(e,t){return!e&&!t?[]:Hbe(e,t)}}dC.instanceCount=0;class cC extends H{constructor(e=!1){super(),this._onDidRequestBasicLanguageFeatures=this._register(new B),this.onDidRequestBasicLanguageFeatures=this._onDidRequestBasicLanguageFeatures.event,this._onDidRequestRichLanguageFeatures=this._register(new B),this.onDidRequestRichLanguageFeatures=this._onDidRequestRichLanguageFeatures.event,this._onDidChange=this._register(new B({leakWarningThreshold:200})),this.onDidChange=this._onDidChange.event,this._requestedBasicLanguages=new Set,this._requestedRichLanguages=new Set,cC.instanceCount++,this._registry=this._register(new dC(!0,e)),this.languageIdCodec=this._registry.languageIdCodec,this._register(this._registry.onDidChange(()=>this._onDidChange.fire()))}dispose(){cC.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){const i=this._registry.guessLanguageIdByFilepathOrFirstLine(e,t);return FP(i,null)}createById(e){return new b6(this.onDidChange,()=>this._createAndGetLanguageIdentifier(e))}createByFilepathOrFirstLine(e,t){return new b6(this.onDidChange,()=>{const i=this.guessLanguageIdByFilepathOrFirstLine(e,t);return this._createAndGetLanguageIdentifier(i)})}_createAndGetLanguageIdentifier(e){return(!e||!this.isRegisteredLanguageId(e))&&(e=ir),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),Ki.getOrCreate(e),this._onDidRequestRichLanguageFeatures.fire(e))}}cC.instanceCount=0;class b6{constructor(e,t){this._onDidChangeLanguages=e,this._selector=t,this._listener=null,this._emitter=null,this.languageId=this._selector()}_dispose(){this._listener&&(this._listener.dispose(),this._listener=null),this._emitter&&(this._emitter.dispose(),this._emitter=null)}get onDidChange(){return this._listener||(this._listener=this._onDidChangeLanguages(()=>this._evaluate())),this._emitter||(this._emitter=new B({onDidRemoveLastListener:()=>{this._dispose()}})),this._emitter.event}_evaluate(){var e;const t=this._selector();t!==this.languageId&&(this.languageId=t,(e=this._emitter)===null||e===void 0||e.fire(this.languageId))}}const uC={RESOURCES:"ResourceURLs",TEXT:Ti.text,INTERNAL_URI_LIST:"application/vnd.code.uri-list"},$be=()=>({get delay(){return-1},dispose:()=>{},showHover:()=>{}});let $x=$be;const jbe=new gl(()=>$x("mouse",!1)),Kbe=new gl(()=>$x("element",!1));function qbe(s){$x=s}function Xs(s){return s==="element"?Kbe.value:jbe.value}function I_(){return $x("element",!0)}let hj={showHover:()=>{},hideHover:()=>{},showAndFocusLastHover:()=>{},setupUpdatableHover:()=>null};function Gbe(s){hj=s}function _l(){return hj}class Zbe{constructor(e){this.spliceables=e}splice(e,t,i){this.spliceables.forEach(n=>n.splice(e,t,i))}}class wg extends Error{constructor(e,t){super(`ListError [${e}] ${t}`)}}function C6(s,e){const t=[];for(const i of e){if(s.start>=i.range.end)continue;if(s.ende.concat(t),[]))}class Qbe{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,o=C6({start:0,end:e},this.groups),r=C6({start:e+t,end:Number.POSITIVE_INFINITY},this.groups).map(l=>({range:w2(l.range,n),size:l.size})),a=i.map((l,d)=>({range:{start:e+d,end:e+d+1},size:l.size}));this.groups=Ybe(o,a,r),this._size=this._paddingTop+this.groups.reduce((l,d)=>l+d.size*(d.range.end-d.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}}var su=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};const yg={CurrentDragAndDropData:void 0},Sl={useShadows:!0,verticalScrollMode:1,setRowLineHeight:!0,setRowHeight:!0,supportDynamicHeights:!1,dnd:{getDragElements(s){return[s]},getDragURI(){return null},onDragStart(){},onDragOver(){return!1},drop(){},dispose(){}},horizontalScrolling:!1,transformOptimization:!0,alwaysConsumeMouseWheel:!0};class k1{constructor(e){this.elements=e}update(){}getData(){return this.elements}}class tCe{constructor(e){this.elements=e}update(){}getData(){return this.elements}}class iCe{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!=null&&e.getPosInSet?this.getPosInSet=e.getPosInSet.bind(e):this.getPosInSet=(t,i)=>i+1,e!=null&&e.getRole?this.getRole=e.getRole.bind(e):this.getRole=t=>"listitem",e!=null&&e.isChecked?this.isChecked=e.isChecked.bind(e):this.isChecked=t=>{}}}class $r{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:$E(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=Sl){var o,r,a,l,d,c,u,h,g,f,m,_,v;if(this.virtualDelegate=t,this.domId=`list_id_${++$r.InstanceCount}`,this.renderers=new Map,this.renderWidth=0,this._scrollHeight=0,this.scrollableElementUpdateDisposable=null,this.scrollableElementWidthDelayer=new _a(50),this.splicing=!1,this.dragOverAnimationStopDisposable=H.None,this.dragOverMouseY=0,this.canDrop=!1,this.currentDragFeedbackDisposable=H.None,this.onDragLeaveTimeout=H.None,this.disposables=new Y,this._onDidChangeContentHeight=new B,this._onDidChangeContentWidth=new B,this.onDidChangeContentHeight=le.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((o=n.paddingTop)!==null&&o!==void 0?o:0);for(const C of i)this.renderers.set(C.templateId,C);this.cache=this.disposables.add(new eCe(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=(r=n.horizontalScrolling)!==null&&r!==void 0?r:Sl.horizontalScrolling,this.domNode.classList.toggle("horizontal-scrolling",this._horizontalScrolling),this.paddingBottom=typeof n.paddingBottom>"u"?0:n.paddingBottom,this.accessibilityProvider=new sCe(n.accessibilityProvider),this.rowsContainer=document.createElement("div"),this.rowsContainer.className="monaco-list-rows",((a=n.transformOptimization)!==null&&a!==void 0?a:Sl.transformOptimization)&&(this.rowsContainer.style.transform="translate3d(0px, 0px, 0px)",this.rowsContainer.style.overflow="hidden",this.rowsContainer.style.contain="strict"),this.disposables.add(Gt.addTarget(this.rowsContainer)),this.scrollable=this.disposables.add(new u0({forceIntegerValues:!0,smoothScrollDuration:(l=n.smoothScrolling)!==null&&l!==void 0&&l?125:0,scheduleAtNextAnimationFrame:C=>Ao(Te(this.domNode),C)})),this.scrollableElement=this.disposables.add(new Lx(this.rowsContainer,{alwaysConsumeMouseWheel:(d=n.alwaysConsumeMouseWheel)!==null&&d!==void 0?d:Sl.alwaysConsumeMouseWheel,horizontal:1,vertical:(c=n.verticalScrollMode)!==null&&c!==void 0?c:Sl.verticalScrollMode,useShadows:(u=n.useShadows)!==null&&u!==void 0?u:Sl.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(K(this.rowsContainer,Xt.Change,C=>this.onTouchChange(C))),this.disposables.add(K(this.scrollableElement.getDomNode(),"scroll",C=>C.target.scrollTop=0)),this.disposables.add(K(this.domNode,"dragover",C=>this.onDragOver(this.toDragEvent(C)))),this.disposables.add(K(this.domNode,"drop",C=>this.onDrop(this.toDragEvent(C)))),this.disposables.add(K(this.domNode,"dragleave",C=>this.onDragLeave(this.toDragEvent(C)))),this.disposables.add(K(this.domNode,"dragend",C=>this.onDragEnd(C))),this.setRowLineHeight=(h=n.setRowLineHeight)!==null&&h!==void 0?h:Sl.setRowLineHeight,this.setRowHeight=(g=n.setRowHeight)!==null&&g!==void 0?g:Sl.setRowHeight,this.supportDynamicHeights=(f=n.supportDynamicHeights)!==null&&f!==void 0?f:Sl.supportDynamicHeights,this.dnd=(m=n.dnd)!==null&&m!==void 0?m:this.disposables.add(Sl.dnd),this.layout((_=n.initialSize)===null||_===void 0?void 0:_.height,(v=n.initialSize)===null||v===void 0?void 0:v.width)}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 Qbe(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),o={start:e,end:e+t},r=ts.intersect(n,o),a=new Map;for(let y=r.end-1;y>=r.start;y--){const D=this.items[y];if(D.dragStartDisposable.dispose(),D.checkedDisposable.dispose(),D.row){let L=a.get(D.templateId);L||(L=[],a.set(D.templateId,L));const k=this.renderers.get(D.templateId);k&&k.disposeElement&&k.disposeElement(D.element,y,D.row.templateData,D.size),L.unshift(D.row)}D.row=null,D.stale=!0}const l={start:e+t,end:this.items.length},d=ts.intersect(l,n),c=ts.relativeComplement(l,n),u=i.map(y=>({id:String(this.itemId++),element:y,templateId:this.virtualDelegate.getTemplateId(y),size:this.virtualDelegate.getHeight(y),width:void 0,hasDynamicHeight:!!this.virtualDelegate.hasDynamicHeight&&this.virtualDelegate.hasDynamicHeight(y),lastDynamicHeightWidth:void 0,row:null,uri:void 0,dropTarget:!1,dragStartDisposable:H.None,checkedDisposable:H.None,stale:!1}));let h;e===0&&t>=this.items.length?(this.rangeMap=this.createRangeMap(this.rangeMap.paddingTop),this.rangeMap.splice(0,0,u),h=this.items,this.items=u):(this.rangeMap.splice(e,t,u),h=this.items.splice(e,t,...u));const g=i.length-t,f=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),m=w2(d,g),_=ts.intersect(f,m);for(let y=_.start;y<_.end;y++)this.updateItemInDOM(this.items[y],y);const v=ts.relativeComplement(m,f);for(const y of v)for(let D=y.start;Dw2(y,g)),w=[{start:e,end:e+i.length},...b].map(y=>ts.intersect(f,y)).reverse();for(const y of w)for(let D=y.end-1;D>=y.start;D--){const L=this.items[D],k=a.get(L.templateId),I=k==null?void 0:k.pop();this.insertItemInDOM(D,I)}for(const y of a.values())for(const D of y)this.cache.release(D);return this.eventuallyUpdateScrollDimensions(),this.supportDynamicHeights&&this._rerender(this.scrollTop,this.renderHeight),h.map(y=>y.element)}eventuallyUpdateScrollDimensions(){this._scrollHeight=this.contentHeight,this.rowsContainer.style.height=`${this._scrollHeight}px`,this.scrollableElementUpdateDisposable||(this.scrollableElementUpdateDisposable=Ao(Te(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.getRenderRange(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:Bae(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:$E(this.domNode)})}render(e,t,i,n,o,r=!1){const a=this.getRenderRange(t,i),l=ts.relativeComplement(a,e).reverse(),d=ts.relativeComplement(e,a);if(r){const c=ts.intersect(e,a);for(let u=c.start;u{for(const c of d)for(let u=c.start;u=c.start;u--)this.insertItemInDOM(u)}),n!==void 0&&(this.rowsContainer.style.left=`-${n}px`),this.rowsContainer.style.top=`-${t}px`,this.horizontalScrolling&&o!==void 0&&(this.rowsContainer.style.width=`${Math.max(o,this.renderWidth)}px`),this.lastRenderTop=t,this.lastRenderHeight=i}insertItemInDOM(e,t){var i,n,o;const r=this.items[e];if(!r.row)if(t)r.row=t,r.stale=!0;else{const u=this.cache.alloc(r.templateId);r.row=u.row,r.stale||(r.stale=u.isReusingConnectedDomNode)}const a=this.accessibilityProvider.getRole(r.element)||"listitem";r.row.domNode.setAttribute("role",a);const l=this.accessibilityProvider.isChecked(r.element);if(typeof l=="boolean")r.row.domNode.setAttribute("aria-checked",String(!!l));else if(l){const u=h=>r.row.domNode.setAttribute("aria-checked",String(!!h));u(l.value),r.checkedDisposable=l.onDidChange(()=>u(l.value))}if(r.stale||!r.row.domNode.parentElement){const u=(o=(n=(i=this.items.at(e+1))===null||i===void 0?void 0:i.row)===null||n===void 0?void 0:n.domNode)!==null&&o!==void 0?o:null;(r.row.domNode.parentElement!==this.rowsContainer||r.row.domNode.nextElementSibling!==u)&&this.rowsContainer.insertBefore(r.row.domNode,u),r.stale=!1}this.updateItemInDOM(r,e);const d=this.renderers.get(r.templateId);if(!d)throw new Error(`No renderer found for template id ${r.templateId}`);d==null||d.renderElement(r.element,e,r.row.templateData,r.size);const c=this.dnd.getDragURI(r.element);r.dragStartDisposable.dispose(),r.row.domNode.draggable=!!c,c&&(r.dragStartDisposable=K(r.row.domNode,"dragstart",u=>this.onDragStart(r.element,c,u))),this.horizontalScrolling&&(this.measureItemWidth(r),this.eventuallyUpdateScrollWidth())}measureItemWidth(e){if(!e.row||!e.row.domNode)return;e.row.domNode.style.width="fit-content",e.width=$E(e.row.domNode);const t=Te(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){const t=this.items[e];if(t.dragStartDisposable.dispose(),t.checkedDisposable.dispose(),t.row){const i=this.renderers.get(t.templateId);i&&i.disposeElement&&i.disposeElement(t.element,e,t.row.templateData,t.size),this.cache.release(t.row),t.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 le.map(this.disposables.add(new ht(this.domNode,"click")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseDblClick(){return le.map(this.disposables.add(new ht(this.domNode,"dblclick")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseMiddleClick(){return le.filter(le.map(this.disposables.add(new ht(this.domNode,"auxclick")).event,e=>this.toMouseEvent(e),this.disposables),e=>e.browserEvent.button===1,this.disposables)}get onMouseDown(){return le.map(this.disposables.add(new ht(this.domNode,"mousedown")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseOver(){return le.map(this.disposables.add(new ht(this.domNode,"mouseover")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseOut(){return le.map(this.disposables.add(new ht(this.domNode,"mouseout")).event,e=>this.toMouseEvent(e),this.disposables)}get onContextMenu(){return le.any(le.map(this.disposables.add(new ht(this.domNode,"contextmenu")).event,e=>this.toMouseEvent(e),this.disposables),le.map(this.disposables.add(new ht(this.domNode,Xt.Contextmenu)).event,e=>this.toGestureEvent(e),this.disposables))}get onTouchStart(){return le.map(this.disposables.add(new ht(this.domNode,"touchstart")).event,e=>this.toTouchEvent(e),this.disposables)}get onTap(){return le.map(this.disposables.add(new ht(this.rowsContainer,Xt.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,o=this.getTargetSector(e,t);return{browserEvent:e,index:t,element:n,sector:o}}onScroll(e){try{const t=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight);this.render(t,e.scrollTop,e.height,e.scrollLeft,e.scrollWidth),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){var n,o;if(!i.dataTransfer)return;const r=this.dnd.getDragElements(e);if(i.dataTransfer.effectAllowed="copyMove",i.dataTransfer.setData(uC.TEXT,t),i.dataTransfer.setDragImage){let a;this.dnd.getDragLabel&&(a=this.dnd.getDragLabel(r,i)),typeof a>"u"&&(a=String(r.length));const l=he(".monaco-drag-image");l.textContent=a;const c=(u=>{for(;u&&!u.classList.contains("monaco-workbench");)u=u.parentElement;return u||this.domNode.ownerDocument})(this.domNode);c.appendChild(l),i.dataTransfer.setDragImage(l,-10,-10),setTimeout(()=>c.removeChild(l),0)}this.domNode.classList.add("dragging"),this.currentDragData=new k1(r),yg.CurrentDragAndDropData=new tCe(r),(o=(n=this.dnd).onDragStart)===null||o===void 0||o.call(n,this.currentDragData,i)}onDragOver(e){var t,i;if(e.browserEvent.preventDefault(),this.onDragLeaveTimeout.dispose(),yg.CurrentDragAndDropData&&yg.CurrentDragAndDropData.getData()==="vscode-ui"||(this.setupDragAndDropScrollTopAnimation(e.browserEvent),!e.browserEvent.dataTransfer))return!1;if(!this.currentDragData)if(yg.CurrentDragAndDropData)this.currentDragData=yg.CurrentDragAndDropData;else{if(!e.browserEvent.dataTransfer.types)return!1;this.currentDragData=new iCe}const n=this.dnd.onDragOver(this.currentDragData,e.element,e.index,e.sector,e.browserEvent);if(this.canDrop=typeof n=="boolean"?n:n.accept,!this.canDrop)return this.currentDragFeedback=void 0,this.currentDragFeedbackDisposable.dispose(),!1;e.browserEvent.dataTransfer.dropEffect=typeof n!="boolean"&&((t=n.effect)===null||t===void 0?void 0:t.type)===0?"copy":"move";let o;typeof n!="boolean"&&n.feedback?o=n.feedback:typeof e.index>"u"?o=[-1]:o=[e.index],o=Wc(o).filter(a=>a>=-1&&aa-l),o=o[0]===-1?[-1]:o;let r=typeof n!="boolean"&&n.effect&&n.effect.position?n.effect.position:"drop-target";if(nCe(this.currentDragFeedback,o)&&this.currentDragFeedbackPosition===r)return!0;if(this.currentDragFeedback=o,this.currentDragFeedbackPosition=r,this.currentDragFeedbackDisposable.dispose(),o[0]===-1)this.domNode.classList.add(r),this.rowsContainer.classList.add(r),this.currentDragFeedbackDisposable=Ie(()=>{this.domNode.classList.remove(r),this.rowsContainer.classList.remove(r)});else{if(o.length>1&&r!=="drop-target")throw new Error("Can't use multiple feedbacks with position different than 'over'");r==="drop-target-after"&&o[0]{var a;for(const l of o){const d=this.items[l];d.dropTarget=!1,(a=d.row)===null||a===void 0||a.domNode.classList.remove(r)}})}return!0}onDragLeave(e){var t,i;this.onDragLeaveTimeout.dispose(),this.onDragLeaveTimeout=kh(()=>this.clearDragOverFeedback(),100,this.disposables),this.currentDragData&&((i=(t=this.dnd).onDragLeave)===null||i===void 0||i.call(t,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,yg.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){var t,i;this.canDrop=!1,this.teardownDragAndDropScrollTopAnimation(),this.clearDragOverFeedback(),this.domNode.classList.remove("dragging"),this.currentDragData=void 0,yg.CurrentDragAndDropData=void 0,(i=(t=this.dnd).onDragEnd)===null||i===void 0||i.call(t,e)}clearDragOverFeedback(){this.currentDragFeedback=void 0,this.currentDragFeedbackPosition=void 0,this.currentDragFeedbackDisposable.dispose(),this.currentDragFeedbackDisposable=H.None}setupDragAndDropScrollTopAnimation(e){if(!this.dragOverAnimationDisposable){const t=kz(this.domNode).top;this.dragOverAnimationDisposable=Yae(Te(this.domNode),this.animateDragAndDropScrollTop.bind(this,t))}this.dragOverAnimationStopDisposable.dispose(),this.dragOverAnimationStopDisposable=kh(()=>{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 xs(n,0,3)}getItemIndexFromEventTarget(e){const t=this.scrollableElement.getDomNode();let i=e;for(;i instanceof HTMLElement&&i!==this.rowsContainer&&t.contains(i);){const n=i.getAttribute("data-index");if(n){const o=Number(n);if(!isNaN(o))return o}i=i.parentElement}}getRenderRange(e,t){return{start:this.rangeMap.indexAt(e),end:this.rangeMap.indexAfter(e+t-1)}}_rerender(e,t,i){const n=this.getRenderRange(e,t);let o,r;e===this.elementTop(n.start)?(o=n.start,r=0):n.end-n.start>1&&(o=n.start+1,r=this.elementTop(o)-e);let a=0;for(;;){const l=this.getRenderRange(e,t);let d=!1;for(let c=l.start;c=h.start;g--)this.insertItemInDOM(g);for(let h=l.start;hs===e;function y2(s=Sd){return(e,t)=>Ci(e,t,s)}function gj(){return(s,e)=>s.equals(e)}function oCe(s,e,t){return!s||!e?s===e:t(s,e)}class Mo{constructor(e,t,i){this.owner=e,this.debugNameSource=t,this.referenceFn=i}getDebugName(e){return rCe(e,this)}}const w6=new Map,S2=new WeakMap;function rCe(s,e){var t;const i=S2.get(s);if(i)return i;const n=aCe(s,e);if(n){let o=(t=w6.get(n))!==null&&t!==void 0?t:0;o++,w6.set(n,o);const r=o===1?n:`${n}#${o}`;return S2.set(s,r),r}}function aCe(s,e){const t=S2.get(s);if(t)return t;const i=e.owner?dCe(e.owner)+".":"";let n;const o=e.debugNameSource;if(o!==void 0)if(typeof o=="function"){if(n=o(),n!==void 0)return i+n}else return i+o;const r=e.referenceFn;if(r!==void 0&&(n=jx(r),n!==void 0))return i+n;if(e.owner!==void 0){const a=lCe(e.owner,s);if(a!==void 0)return i+a}}function lCe(s,e){for(const t in s)if(s[t]===e)return t}const y6=new Map,S6=new WeakMap;function dCe(s){var e;const t=S6.get(s);if(t)return t;const i=cCe(s);let n=(e=y6.get(i))!==null&&e!==void 0?e:0;n++,y6.set(i,n);const o=n===1?i:`${i}#${n}`;return S6.set(s,o),o}function cCe(s){const e=s.constructor;return e?e.name:"Object"}function jx(s){const e=s.toString(),i=/\/\*\*\s*@description\s*([^*]*)\*\//.exec(e),n=i?i[1]:void 0;return n==null?void 0:n.trim()}let uCe;function ud(){return uCe}let fj;function hCe(s){fj=s}let pj;function gCe(s){pj=s}class mj{get TChange(){return null}reportChanges(){this.get()}read(e){return e?e.readObservable(this):this.get()}map(e,t){const i=t===void 0?void 0:e,n=t===void 0?e:t;return pj({owner:i,debugName:()=>{const o=jx(n);if(o!==void 0)return o;const a=/^\s*\(?\s*([a-zA-Z_$][a-zA-Z_$0-9]*)\s*\)?\s*=>\s*\1(?:\??)\.([a-zA-Z_$][a-zA-Z_$0-9]*)\s*$/.exec(n.toString());if(a)return`${this.debugName}.${a[2]}`;if(!i)return`${this.debugName} (mapped)`},debugReferenceFn:n},o=>n(this.read(o),o))}recomputeInitiallyAndOnChange(e,t){return e.add(fj(this,t)),this}}class E1 extends mj{constructor(){super(...arguments),this.observers=new Set}addObserver(e){const t=this.observers.size;this.observers.add(e),t===0&&this.onFirstObserverAdded()}removeObserver(e){this.observers.delete(e)&&this.observers.size===0&&this.onLastObserverRemoved()}onFirstObserverAdded(){}onLastObserverRemoved(){}}function $t(s,e){const t=new Kx(s,e);try{s(t)}finally{t.finish()}}let Yw;function eS(s){if(Yw)s(Yw);else{const e=new Kx(s,void 0);Yw=e;try{s(e)}finally{e.finish(),Yw=void 0}}}async function fCe(s,e){const t=new Kx(s,e);try{await s(t)}finally{t.finish()}}function hC(s,e,t){s?e(s):$t(e,t)}class Kx{constructor(e,t){var i;this._fn=e,this._getDebugName=t,this.updatingObservers=[],(i=ud())===null||i===void 0||i.handleBeginTransaction(this)}getDebugName(){return this._getDebugName?this._getDebugName():jx(this._fn)}updateObserver(e,t){this.updatingObservers.push({observer:e,observable:t}),e.beginUpdate(t)}finish(){var e;const t=this.updatingObservers;for(let i=0;i{},()=>`Setting ${this.debugName}`));try{const r=this._value;this._setValue(e),(n=ud())===null||n===void 0||n.handleObservableChanged(this,{oldValue:r,newValue:e,change:i,didChange:!0,hadValue:!0});for(const a of this.observers)t.updateObserver(a,this),a.handleChange(this,i)}finally{o&&o.finish()}}toString(){return`${this.debugName}: ${this._value}`}_setValue(e){this._value=e}}function gC(s,e){let t;return typeof s=="string"?t=new Mo(void 0,s,void 0):t=new Mo(s,void 0,void 0),new mCe(t,e,Sd)}class mCe extends LO{_setValue(e){this._value!==e&&(this._value&&this._value.dispose(),this._value=e)}dispose(){var e;(e=this._value)===null||e===void 0||e.dispose()}}function je(s,e){return e!==void 0?new T_(new Mo(s,void 0,e),e,void 0,void 0,void 0,Sd):new T_(new Mo(void 0,void 0,s),s,void 0,void 0,void 0,Sd)}function dc(s,e){var t;return new T_(new Mo(s.owner,s.debugName,s.debugReferenceFn),e,void 0,void 0,s.onLastObserverRemoved,(t=s.equalsFn)!==null&&t!==void 0?t:Sd)}gCe(dc);function _Ce(s,e){var t;return new T_(new Mo(s.owner,s.debugName,void 0),e,s.createEmptyChangeSummary,s.handleChange,void 0,(t=s.equalityComparer)!==null&&t!==void 0?t:Sd)}function g0(s,e){let t,i;e===void 0?(t=s,i=void 0):(i=s,t=e);const n=new Y;return new T_(new Mo(i,void 0,t),o=>(n.clear(),t(o,n)),void 0,void 0,()=>n.dispose(),Sd)}function Gd(s,e){let t,i;e===void 0?(t=s,i=void 0):(i=s,t=e);const n=new Y;return new T_(new Mo(i,void 0,t),o=>{n.clear();const r=t(o);return r&&n.add(r),r},void 0,void 0,()=>n.dispose(),Sd)}class T_ extends E1{get debugName(){var e;return(e=this._debugNameData.getDebugName(this))!==null&&e!==void 0?e:"(anonymous)"}constructor(e,t,i,n,o=void 0,r){var a,l;super(),this._debugNameData=e,this._computeFn=t,this.createChangeSummary=i,this._handleChange=n,this._handleLastObserverRemoved=o,this._equalityComparator=r,this.state=0,this.value=void 0,this.updateCount=0,this.dependencies=new Set,this.dependenciesToBeRemoved=new Set,this.changeSummary=void 0,this.changeSummary=(a=this.createChangeSummary)===null||a===void 0?void 0:a.call(this),(l=ud())===null||l===void 0||l.handleDerivedCreated(this)}onLastObserverRemoved(){var e;this.state=0,this.value=void 0;for(const t of this.dependencies)t.removeObserver(this);this.dependencies.clear(),(e=this._handleLastObserverRemoved)===null||e===void 0||e.call(this)}get(){var e;if(this.observers.size===0){const t=this._computeFn(this,(e=this.createChangeSummary)===null||e===void 0?void 0:e.call(this));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._recomputeIfNeeded()}while(this.state!==3);return this.value}}_recomputeIfNeeded(){var e,t;if(this.state===3)return;const i=this.dependenciesToBeRemoved;this.dependenciesToBeRemoved=this.dependencies,this.dependencies=i;const n=this.state!==0,o=this.value;this.state=3;const r=this.changeSummary;this.changeSummary=(e=this.createChangeSummary)===null||e===void 0?void 0:e.call(this);try{this.value=this._computeFn(this,r)}finally{for(const l of this.dependenciesToBeRemoved)l.removeObserver(this);this.dependenciesToBeRemoved.clear()}const a=n&&!this._equalityComparator(o,this.value);if((t=ud())===null||t===void 0||t.handleDerivedRecomputed(this,{oldValue:o,newValue:this.value,change:void 0,didChange:a,hadValue:n}),a)for(const l of this.observers)l.handleChange(this,void 0)}toString(){return`LazyDerived<${this.debugName}>`}beginUpdate(e){this.updateCount++;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)}endUpdate(e){if(this.updateCount--,this.updateCount===0){const t=[...this.observers];for(const i of t)i.endUpdate(this)}Lf(()=>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)){const i=this._handleChange?this._handleChange({changedObservable:e,change:t,didChange:o=>o===e},this.changeSummary):!0,n=this.state===3;if(i&&(this.state===1||n)&&(this.state=2,n))for(const o of this.observers)o.handlePossibleChange(this)}}readObservable(e){e.addObserver(this);const t=e.get();return this.dependencies.add(e),this.dependenciesToBeRemoved.delete(e),t}addObserver(e){const t=!this.observers.has(e)&&this.updateCount>0;super.addObserver(e),t&&e.beginUpdate(this)}removeObserver(e){const t=this.observers.has(e)&&this.updateCount>0;super.removeObserver(e),t&&e.endUpdate(this)}}function st(s){return new Gx(new Mo(void 0,void 0,s),s,void 0,void 0)}function qx(s,e){var t;return new Gx(new Mo(s.owner,s.debugName,(t=s.debugReferenceFn)!==null&&t!==void 0?t:e),e,void 0,void 0)}function I1(s,e){var t;return new Gx(new Mo(s.owner,s.debugName,(t=s.debugReferenceFn)!==null&&t!==void 0?t:e),e,s.createEmptyChangeSummary,s.handleChange)}function Hr(s){const e=new Y,t=qx({owner:void 0,debugName:void 0,debugReferenceFn:s},i=>{e.clear(),s(i,e)});return Ie(()=>{t.dispose(),e.dispose()})}class Gx{get debugName(){var e;return(e=this._debugNameData.getDebugName(this))!==null&&e!==void 0?e:"(anonymous)"}constructor(e,t,i,n){var o,r;this._debugNameData=e,this._runFn=t,this.createChangeSummary=i,this._handleChange=n,this.state=2,this.updateCount=0,this.disposed=!1,this.dependencies=new Set,this.dependenciesToBeRemoved=new Set,this.changeSummary=(o=this.createChangeSummary)===null||o===void 0?void 0:o.call(this),(r=ud())===null||r===void 0||r.handleAutorunCreated(this),this._runIfNeeded()}dispose(){this.disposed=!0;for(const e of this.dependencies)e.removeObserver(this);this.dependencies.clear()}_runIfNeeded(){var e,t,i;if(this.state===3)return;const n=this.dependenciesToBeRemoved;this.dependenciesToBeRemoved=this.dependencies,this.dependencies=n,this.state=3;const o=this.disposed;try{if(!o){(e=ud())===null||e===void 0||e.handleAutorunTriggered(this);const r=this.changeSummary;this.changeSummary=(t=this.createChangeSummary)===null||t===void 0?void 0:t.call(this),this._runFn(this,r)}}finally{o||(i=ud())===null||i===void 0||i.handleAutorunFinished(this);for(const r of this.dependenciesToBeRemoved)r.removeObserver(this);this.dependenciesToBeRemoved.clear()}}toString(){return`Autorun<${this.debugName}>`}beginUpdate(){this.state===3&&(this.state=1),this.updateCount++}endUpdate(){if(this.updateCount===1)do{if(this.state===1){this.state=3;for(const e of this.dependencies)if(e.reportChanges(),this.state===2)break}this._runIfNeeded()}while(this.state!==3);this.updateCount--,Lf(()=>this.updateCount>=0)}handlePossibleChange(e){this.state===3&&this.dependencies.has(e)&&!this.dependenciesToBeRemoved.has(e)&&(this.state=1)}handleChange(e,t){this.dependencies.has(e)&&!this.dependenciesToBeRemoved.has(e)&&(!this._handleChange||this._handleChange({changedObservable:e,change:t,didChange:n=>n===e},this.changeSummary))&&(this.state=2)}readObservable(e){if(this.disposed)return e.get();e.addObserver(this);const t=e.get();return this.dependencies.add(e),this.dependenciesToBeRemoved.delete(e),t}}(function(s){s.Observer=Gx})(st||(st={}));function Ga(s){return new vCe(s)}class vCe extends mj{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 Ot(s,e){return new Qg(s,e)}class Qg extends E1{constructor(e,t){super(),this.event=e,this._getValue=t,this.hasValue=!1,this.handleEvent=i=>{var n;const o=this._getValue(i),r=this.value,a=!this.hasValue||r!==o;let l=!1;a&&(this.value=o,this.hasValue&&(l=!0,hC(Qg.globalTransaction,d=>{var c;(c=ud())===null||c===void 0||c.handleFromEventObservableTriggered(this,{oldValue:r,newValue:o,change:void 0,didChange:a,hadValue:this.hasValue});for(const u of this.observers)d.updateObserver(u,this),u.handleChange(this,void 0)},()=>{const d=this.getDebugName();return"Event fired"+(d?`: ${d}`:"")})),this.hasValue=!0),l||(n=ud())===null||n===void 0||n.handleFromEventObservableTriggered(this,{oldValue:r,newValue:o,change:void 0,didChange:a,hadValue:this.hasValue})}}getDebugName(){return jx(this._getValue)}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)}}(function(s){s.Observer=Qg;function e(t,i){let n=!1;Qg.globalTransaction===void 0&&(Qg.globalTransaction=t,n=!0);try{i()}finally{n&&(Qg.globalTransaction=void 0)}}s.batchEventsGlobally=e})(Ot||(Ot={}));function os(s,e){return new bCe(s,e)}class bCe extends E1{constructor(e,t){super(),this.debugName=e,this.event=t,this.handleEvent=()=>{$t(i=>{for(const n of this.observers)i.updateObserver(n,this),n.handleChange(this,void 0)},()=>this.debugName)}}onFirstObserverAdded(){this.subscription=this.event(this.handleEvent)}onLastObserverRemoved(){this.subscription.dispose(),this.subscription=void 0}get(){}}function Zx(s){return typeof s=="string"?new D6(s):new D6(void 0,s)}class D6 extends E1{get debugName(){var e;return(e=new Mo(this._owner,this._debugName,void 0).getDebugName(this))!==null&&e!==void 0?e:"Observable Signal"}constructor(e,t){super(),this._debugName=e,this._owner=t}trigger(e,t){if(!e){$t(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(){}}function T1(s,e){const t=new CCe(!0,e);return s.addObserver(t),e?e(s.get()):s.reportChanges(),Ie(()=>{s.removeObserver(t)})}hCe(T1);class CCe{constructor(e,t){this._forceRecompute=e,this._handleValue=t,this._counter=0}beginUpdate(e){this._counter++}endUpdate(e){this._counter--,this._counter===0&&this._forceRecompute&&(this._handleValue?this._handleValue(e.get()):e.reportChanges())}handlePossibleChange(e){}handleChange(e,t){}}function wCe(s,e,t,i){let n=new L6(t,i);return dc({debugReferenceFn:t,owner:s,onLastObserverRemoved:()=>{n.dispose(),n=new L6(t)}},r=>(n.setItems(e.read(r)),n.getItems()))}class L6{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 o=this._keySelector?this._keySelector(n):n;let r=this._cache.get(o);if(r)i.delete(o);else{const a=new Y;r={out:this._map(n,a),store:a},this._cache.set(o,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 _j(s,e,t,i){return e||(e=n=>n!=null),new Promise((n,o)=>{let r=!0,a=!1;const l=s.map(c=>({isFinished:e(c),error:t?t(c):!1,state:c})),d=st(c=>{const{isFinished:u,error:h,state:g}=l.read(c);(u||h)&&(r?a=!0:d.dispose(),h?o(h===!0?g:h):n(g))});if(i){const c=i.onCancellationRequested(()=>{d.dispose(),c.dispose(),o(new sl)});if(i.isCancellationRequested){d.dispose(),c.dispose(),o(new sl);return}}r=!1,a&&d.dispose()})}var og=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};class yCe{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(o=>o.templateData===i);if(n>=0){const o=this.renderedElements[n];this.trait.unrender(i),o.index=t}else{const o={index:t,templateData:i};this.renderedElements.push(o)}this.trait.renderIndex(t,i)}splice(e,t,i){const n=[];for(const o of this.renderedElements)o.index=e+t&&n.push({index:o.index+i-t,templateData:o.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 xD=class{get name(){return this._trait}get renderer(){return new yCe(this)}constructor(e){this._trait=e,this.indexes=[],this.sortedIndexes=[],this._onChange=new B,this.onChange=this._onChange.event}splice(e,t,i){const n=i.length-t,o=e+t,r=[];let a=0;for(;a=o;)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(k6),t)}_set(e,t,i){const n=this.indexes,o=this.sortedIndexes;this.indexes=e,this.sortedIndexes=t;const r=D2(o,e);return this.renderer.renderIndexes(r),this._onChange.fire({indexes:e,browserEvent:i}),n}get(){return this.indexes}contains(e){return xb(this.sortedIndexes,e,k6)>=0}dispose(){jt(this._onChange)}};og([zi],xD.prototype,"renderer",null);class SCe extends xD{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 HI{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 o=new Set(n),r=i.map(a=>o.has(this.identityProvider.getId(a).toString()));this.trait.splice(e,t,r)}}function ch(s){return s.tagName==="INPUT"||s.tagName==="TEXTAREA"}function N1(s,e){return s.classList.contains(e)?!0:s.classList.contains("monaco-list")||!s.parentElement?!1:N1(s.parentElement,e)}function kv(s){return N1(s,"monaco-editor")}function DCe(s){return N1(s,"monaco-custom-toggle")}function LCe(s){return N1(s,"action-item")}function lb(s){return N1(s,"monaco-tree-sticky-row")}function fC(s){return s.classList.contains("monaco-tree-sticky-container")}function vj(s){return s.tagName==="A"&&s.classList.contains("monaco-button")||s.tagName==="DIV"&&s.classList.contains("monaco-button-dropdown")?!0:s.classList.contains("monaco-list")||!s.parentElement?!1:vj(s.parentElement)}class bj{get onKeyDown(){return le.chain(this.disposables.add(new ht(this.view.domNode,"keydown")).event,e=>e.filter(t=>!ch(t.target)).map(t=>new Kt(t)))}constructor(e,t,i){this.list=e,this.view=t,this.disposables=new Y,this.multipleSelectionDisposables=new Y,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&&(lt?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(to(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()}}og([zi],bj.prototype,"onKeyDown",null);var Kl;(function(s){s[s.Automatic=0]="Automatic",s[s.Trigger=1]="Trigger"})(Kl||(Kl={}));var _m;(function(s){s[s.Idle=0]="Idle",s[s.Typing=1]="Typing"})(_m||(_m={}));const xCe=new class{mightProducePrintableCharacter(s){return s.ctrlKey||s.metaKey||s.altKey?!1:s.keyCode>=31&&s.keyCode<=56||s.keyCode>=21&&s.keyCode<=30||s.keyCode>=98&&s.keyCode<=107||s.keyCode>=85&&s.keyCode<=95}};class kCe{constructor(e,t,i,n,o){this.list=e,this.view=t,this.keyboardNavigationLabelProvider=i,this.keyboardNavigationEventFilter=n,this.delegate=o,this.enabled=!1,this.state=_m.Idle,this.mode=Kl.Automatic,this.triggered=!1,this.previouslyFocused=-1,this.enabledDisposables=new Y,this.disposables=new Y,this.updateOptions(e.options)}updateOptions(e){var t,i;!((t=e.typeNavigationEnabled)!==null&&t!==void 0)||t?this.enable():this.disable(),this.mode=(i=e.typeNavigationMode)!==null&&i!==void 0?i:Kl.Automatic}enable(){if(this.enabled)return;let e=!1;const t=le.chain(this.enabledDisposables.add(new ht(this.view.domNode,"keydown")).event,o=>o.filter(r=>!ch(r.target)).filter(()=>this.mode===Kl.Automatic||this.triggered).map(r=>new Kt(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=le.debounce(t,()=>null,800,void 0,void 0,void 0,this.enabledDisposables);le.reduce(le.any(t,i),(o,r)=>r===null?null:(o||"")+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(){var e;const t=this.list.getFocus();if(t.length>0&&t[0]===this.previouslyFocused){const i=(e=this.list.options.accessibilityProvider)===null||e===void 0?void 0:e.getAriaLabel(this.list.element(t[0]));typeof i=="string"?fo(i):i&&fo(i.get())}this.previouslyFocused=-1}onInput(e){if(!e){this.state=_m.Idle,this.triggered=!1;return}const t=this.list.getFocus(),i=t.length>0?t[0]:0,n=this.state===_m.Idle?1:0;this.state=_m.Typing;for(let o=0;o1&&d.length===1){this.previouslyFocused=i,this.list.setFocus([r]),this.list.reveal(r);return}}}else if(typeof l>"u"||wD(e,l)){this.previouslyFocused=i,this.list.setFocus([r]),this.list.reveal(r);return}}}dispose(){this.disable(),this.enabledDisposables.dispose(),this.disposables.dispose()}}class ECe{constructor(e,t){this.list=e,this.view=t,this.disposables=new Y;const i=le.chain(this.disposables.add(new ht(t.domNode,"keydown")).event,o=>o.filter(r=>!ch(r.target)).map(r=>new Kt(r)));le.chain(i,o=>o.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||!(n instanceof HTMLElement)||n.tabIndex===-1)return;const o=Te(n).getComputedStyle(n);o.visibility==="hidden"||o.display==="none"||(e.preventDefault(),e.stopPropagation(),n.focus())}dispose(){this.disposables.dispose()}}function Cj(s){return lt?s.browserEvent.metaKey:s.browserEvent.ctrlKey}function wj(s){return s.browserEvent.shiftKey}function ICe(s){return cF(s)&&s.button===2}const x6={isSelectionSingleChangeEvent:Cj,isSelectionRangeChangeEvent:wj};class yj{constructor(e){this.list=e,this.disposables=new Y,this._onPointer=new B,this.onPointer=this._onPointer.event,e.options.multipleSelectionSupport!==!1&&(this.multipleSelectionController=this.list.options.multipleSelectionController||x6),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(Gt.addTarget(e.getHTMLElement()))),le.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||x6))}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){kv(e.browserEvent.target)||Xn()!==e.browserEvent.target&&this.list.domFocus()}onContextMenu(e){if(ch(e.browserEvent.target)||kv(e.browserEvent.target))return;const t=typeof e.index>"u"?[]:[e.index];this.list.setFocus(t,e.browserEvent)}onViewPointer(e){if(!this.mouseSupport||ch(e.browserEvent.target)||kv(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),ICe(e.browserEvent)||this.list.setSelection([t],e.browserEvent),this._onPointer.fire(e)}onDoubleClick(e){if(ch(e.browserEvent.target)||kv(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)){if(typeof i>"u"){const c=this.list.getFocus()[0];i=c??t,this.list.setAnchor(i)}const n=Math.min(i,t),o=Math.max(i,t),r=to(n,o+1),a=this.list.getSelection(),l=ACe(D2(a,[i]),i);if(l.length===0)return;const d=D2(r,MCe(a,l));this.list.setSelection(d,e.browserEvent),this.list.setFocus([t],e.browserEvent)}else if(this.isSelectionSingleChangeEvent(e)){const n=this.list.getSelection(),o=n.filter(r=>r!==t);this.list.setFocus([t]),this.list.setAnchor(t),n.length===o.length?this.list.setSelection([...o,t],e.browserEvent):this.list.setSelection(o,e.browserEvent)}}dispose(){this.disposables.dispose()}}class Sj{constructor(e,t){this.styleElement=e,this.selectorSuffix=t}style(e){var t,i;const n=this.selectorSuffix&&`.${this.selectorSuffix}`,o=[];e.listBackground&&o.push(`.monaco-list${n} .monaco-list-rows { background: ${e.listBackground}; }`),e.listFocusBackground&&(o.push(`.monaco-list${n}:focus .monaco-list-row.focused { background-color: ${e.listFocusBackground}; }`),o.push(`.monaco-list${n}:focus .monaco-list-row.focused:hover { background-color: ${e.listFocusBackground}; }`)),e.listFocusForeground&&o.push(`.monaco-list${n}:focus .monaco-list-row.focused { color: ${e.listFocusForeground}; }`),e.listActiveSelectionBackground&&(o.push(`.monaco-list${n}:focus .monaco-list-row.selected { background-color: ${e.listActiveSelectionBackground}; }`),o.push(`.monaco-list${n}:focus .monaco-list-row.selected:hover { background-color: ${e.listActiveSelectionBackground}; }`)),e.listActiveSelectionForeground&&o.push(`.monaco-list${n}:focus .monaco-list-row.selected { color: ${e.listActiveSelectionForeground}; }`),e.listActiveSelectionIconForeground&&o.push(`.monaco-list${n}:focus .monaco-list-row.selected .codicon { color: ${e.listActiveSelectionIconForeground}; }`),e.listFocusAndSelectionBackground&&o.push(` .monaco-drag-image, .monaco-list${n}:focus .monaco-list-row.selected.focused { background-color: ${e.listFocusAndSelectionBackground}; } `),e.listFocusAndSelectionForeground&&o.push(` .monaco-drag-image, .monaco-list${n}:focus .monaco-list-row.selected.focused { color: ${e.listFocusAndSelectionForeground}; } `),e.listInactiveFocusForeground&&(o.push(`.monaco-list${n} .monaco-list-row.focused { color: ${e.listInactiveFocusForeground}; }`),o.push(`.monaco-list${n} .monaco-list-row.focused:hover { color: ${e.listInactiveFocusForeground}; }`)),e.listInactiveSelectionIconForeground&&o.push(`.monaco-list${n} .monaco-list-row.focused .codicon { color: ${e.listInactiveSelectionIconForeground}; }`),e.listInactiveFocusBackground&&(o.push(`.monaco-list${n} .monaco-list-row.focused { background-color: ${e.listInactiveFocusBackground}; }`),o.push(`.monaco-list${n} .monaco-list-row.focused:hover { background-color: ${e.listInactiveFocusBackground}; }`)),e.listInactiveSelectionBackground&&(o.push(`.monaco-list${n} .monaco-list-row.selected { background-color: ${e.listInactiveSelectionBackground}; }`),o.push(`.monaco-list${n} .monaco-list-row.selected:hover { background-color: ${e.listInactiveSelectionBackground}; }`)),e.listInactiveSelectionForeground&&o.push(`.monaco-list${n} .monaco-list-row.selected { color: ${e.listInactiveSelectionForeground}; }`),e.listHoverBackground&&o.push(`.monaco-list${n}:not(.drop-target):not(.dragging) .monaco-list-row:hover:not(.selected):not(.focused) { background-color: ${e.listHoverBackground}; }`),e.listHoverForeground&&o.push(`.monaco-list${n}:not(.drop-target):not(.dragging) .monaco-list-row:hover:not(.selected):not(.focused) { color: ${e.listHoverForeground}; }`);const r=Ec(e.listFocusAndSelectionOutline,Ec(e.listSelectionOutline,(t=e.listFocusOutline)!==null&&t!==void 0?t:""));r&&o.push(`.monaco-list${n}:focus .monaco-list-row.focused.selected { outline: 1px solid ${r}; outline-offset: -1px;}`),e.listFocusOutline&&o.push(` .monaco-drag-image, .monaco-list${n}:focus .monaco-list-row.focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; } .monaco-workbench.context-menu-visible .monaco-list${n}.last-focused .monaco-list-row.focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; } `);const a=Ec(e.listSelectionOutline,(i=e.listInactiveFocusOutline)!==null&&i!==void 0?i:"");a&&o.push(`.monaco-list${n} .monaco-list-row.focused.selected { outline: 1px dotted ${a}; outline-offset: -1px; }`),e.listSelectionOutline&&o.push(`.monaco-list${n} .monaco-list-row.selected { outline: 1px dotted ${e.listSelectionOutline}; outline-offset: -1px; }`),e.listInactiveFocusOutline&&o.push(`.monaco-list${n} .monaco-list-row.focused { outline: 1px dotted ${e.listInactiveFocusOutline}; outline-offset: -1px; }`),e.listHoverOutline&&o.push(`.monaco-list${n} .monaco-list-row:hover { outline: 1px dashed ${e.listHoverOutline}; outline-offset: -1px; }`),e.listDropOverBackground&&o.push(` .monaco-list${n}.drop-target, .monaco-list${n} .monaco-list-rows.drop-target, .monaco-list${n} .monaco-list-row.drop-target { background-color: ${e.listDropOverBackground} !important; color: inherit !important; } `),e.listDropBetweenBackground&&(o.push(` .monaco-list${n} .monaco-list-rows.drop-target-before .monaco-list-row:first-child::before, .monaco-list${n} .monaco-list-row.drop-target-before::before { content: ""; position: absolute; top: 0px; left: 0px; width: 100%; height: 1px; background-color: ${e.listDropBetweenBackground}; }`),o.push(` .monaco-list${n} .monaco-list-rows.drop-target-after .monaco-list-row:last-child::after, .monaco-list${n} .monaco-list-row.drop-target-after::after { content: ""; position: absolute; bottom: 0px; left: 0px; width: 100%; height: 1px; background-color: ${e.listDropBetweenBackground}; }`)),e.tableColumnsBorder&&o.push(` .monaco-table > .monaco-split-view2, .monaco-table > .monaco-split-view2 .monaco-sash.vertical::before, .monaco-workbench:not(.reduce-motion) .monaco-table:hover > .monaco-split-view2, .monaco-workbench:not(.reduce-motion) .monaco-table:hover > .monaco-split-view2 .monaco-sash.vertical::before { border-color: ${e.tableColumnsBorder}; } .monaco-workbench:not(.reduce-motion) .monaco-table > .monaco-split-view2, .monaco-workbench:not(.reduce-motion) .monaco-table > .monaco-split-view2 .monaco-sash.vertical::before { border-color: transparent; } `),e.tableOddRowsBackgroundColor&&o.push(` .monaco-table .monaco-list-row[data-parity=odd]:not(.focused):not(.selected):not(:hover) .monaco-table-tr, .monaco-table .monaco-list:not(:focus) .monaco-list-row[data-parity=odd].focused:not(.selected):not(:hover) .monaco-table-tr, .monaco-table .monaco-list:not(.focused) .monaco-list-row[data-parity=odd].focused:not(.selected):not(:hover) .monaco-table-tr { background-color: ${e.tableOddRowsBackgroundColor}; } `),this.styleElement.textContent=o.join(` `)}}const TCe={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:$.fromHex("#a9a9a9").transparent(.4).toString(),tableColumnsBorder:$.fromHex("#cccccc").transparent(.2).toString(),tableOddRowsBackgroundColor:$.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},NCe={keyboardSupport:!0,mouseSupport:!0,multipleSelectionSupport:!0,dnd:{getDragURI(){return null},onDragStart(){},onDragOver(){return!1},drop(){},dispose(){}}};function ACe(s,e){const t=s.indexOf(e);if(t===-1)return[];const i=[];let n=t-1;for(;n>=0&&s[n]===e-(t-n);)i.push(s[n--]);for(i.reverse(),n=t;n=s.length)t.push(e[n++]);else if(n>=e.length)t.push(s[i++]);else if(s[i]===e[n]){t.push(s[i]),i++,n++;continue}else s[i]=s.length)t.push(e[n++]);else if(n>=e.length)t.push(s[i++]);else if(s[i]===e[n]){i++,n++;continue}else s[i]s-e;class RCe{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 o=0;for(const r of this.renderers)r.renderElement(e,t,i[o++],n)}disposeElement(e,t,i,n){var o;let r=0;for(const a of this.renderers)(o=a.disposeElement)===null||o===void 0||o.call(a,e,t,i[r],n),r+=1}disposeTemplate(e){let t=0;for(const i of this.renderers)i.disposeTemplate(e[t++])}}class PCe{constructor(e){this.accessibilityProvider=e,this.templateId="a18n"}renderTemplate(e){return{container:e,disposables:new Y}}renderElement(e,t,i){const n=this.accessibilityProvider.getAriaLabel(e),o=n&&typeof n!="string"?n:Ga(n);i.disposables.add(st(a=>{this.setAriaLabel(a.readObservable(o),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,n){i.disposables.clear()}disposeTemplate(e){e.disposables.dispose()}}class FCe{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){var i,n;(n=(i=this.dnd).onDragStart)===null||n===void 0||n.call(i,e,t)}onDragOver(e,t,i,n,o){return this.dnd.onDragOver(e,t,i,n,o)}onDragLeave(e,t,i,n){var o,r;(r=(o=this.dnd).onDragLeave)===null||r===void 0||r.call(o,e,t,i,n)}onDragEnd(e){var t,i;(i=(t=this.dnd).onDragEnd)===null||i===void 0||i.call(t,e)}drop(e,t,i,n,o){this.dnd.drop(e,t,i,n,o)}dispose(){this.dnd.dispose()}}class pr{get onDidChangeFocus(){return le.map(this.eventBufferer.wrapEvent(this.focus.onChange),e=>this.toListEvent(e),this.disposables)}get onDidChangeSelection(){return le.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=le.chain(this.disposables.add(new ht(this.view.domNode,"keydown")).event,o=>o.map(r=>new Kt(r)).filter(r=>e=r.keyCode===58||r.shiftKey&&r.keyCode===68).map(r=>nt.stop(r,!0)).filter(()=>!1)),i=le.chain(this.disposables.add(new ht(this.view.domNode,"keyup")).event,o=>o.forEach(()=>e=!1).map(r=>new Kt(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,d=typeof l<"u"?this.view.element(l):void 0,c=typeof l<"u"?this.view.domElement(l):this.view.domNode;return{index:l,element:d,anchor:c,browserEvent:r}})),n=le.chain(this.view.onContextMenu,o=>o.filter(r=>!e).map(({element:r,index:a,browserEvent:l})=>({element:r,index:a,anchor:new ra(Te(this.view.domNode),l),browserEvent:l})));return le.any(t,i,n)}get onKeyDown(){return this.disposables.add(new ht(this.view.domNode,"keydown")).event}get onDidFocus(){return le.signal(this.disposables.add(new ht(this.view.domNode,"focus",!0)).event)}get onDidBlur(){return le.signal(this.disposables.add(new ht(this.view.domNode,"blur",!0)).event)}constructor(e,t,i,n,o=NCe){var r,a,l,d;this.user=e,this._options=o,this.focus=new xD("focused"),this.anchor=new xD("anchor"),this.eventBufferer=new KP,this._ariaLabel="",this.disposables=new Y,this._onDidDispose=new B,this.onDidDispose=this._onDidDispose.event;const c=this._options.accessibilityProvider&&this._options.accessibilityProvider.getWidgetRole?(r=this._options.accessibilityProvider)===null||r===void 0?void 0:r.getWidgetRole():"list";this.selection=new SCe(c!=="listbox");const u=[this.focus.renderer,this.selection.renderer];this.accessibilityProvider=o.accessibilityProvider,this.accessibilityProvider&&(u.push(new PCe(this.accessibilityProvider)),(l=(a=this.accessibilityProvider).onDidChangeActiveDescendant)===null||l===void 0||l.call(a,this.onDidChangeActiveDescendant,this,this.disposables)),n=n.map(g=>new RCe(g.templateId,[...u,g]));const h={...o,dnd:o.dnd&&new FCe(this,o.dnd)};if(this.view=this.createListView(t,i,n,h),this.view.domNode.setAttribute("role",c),o.styleController)this.styleController=o.styleController(this.view.domId);else{const g=ar(this.view.domNode);this.styleController=new Sj(g,this.view.domId)}if(this.spliceable=new Zbe([new HI(this.focus,this.view,o.identityProvider),new HI(this.selection,this.view,o.identityProvider),new HI(this.anchor,this.view,o.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 ECe(this,this.view)),(typeof o.keyboardSupport!="boolean"||o.keyboardSupport)&&(this.keyboardController=new bj(this,this.view,o),this.disposables.add(this.keyboardController)),o.keyboardNavigationLabelProvider){const g=o.keyboardNavigationDelegate||xCe;this.typeNavigationController=new kCe(this,this.view,o.keyboardNavigationLabelProvider,(d=o.keyboardNavigationEventFilter)!==null&&d!==void 0?d:()=>!0,g),this.disposables.add(this.typeNavigationController)}this.mouseController=this.createMouseController(o),this.disposables.add(this.mouseController),this.onDidChangeFocus(this._onFocusChange,this,this.disposables),this.onDidChangeSelection(this._onSelectionChange,this,this.disposables),this.accessibilityProvider&&(this.ariaLabel=this.accessibilityProvider.getWidgetAriaLabel()),this._options.multipleSelectionSupport!==!1&&this.view.domNode.setAttribute("aria-multiselectable","true")}createListView(e,t,i,n){return new $r(e,t,i,n)}createMouseController(e){return new yj(this)}updateOptions(e={}){var t,i;this._options={...this._options,...e},(t=this.typeNavigationController)===null||t===void 0||t.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),(i=this.keyboardController)===null||i===void 0||i.updateOptions(e),this.view.updateOptions(e)}get options(){return this._options}splice(e,t,i=[]){if(e<0||e>this.view.length)throw new wg(this.user,`Invalid start index: ${e}`);if(t<0)throw new wg(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 wg(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 wg(this.user,`Invalid index ${e}`);this.anchor.set([e])}getAnchor(){return FP(this.anchor.get(),void 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 wg(this.user,`Invalid index ${i}`);this.focus.set(e,t)}focusNext(e=1,t=!1,i,n){if(this.length===0)return;const o=this.focus.get(),r=this.findNextIndex(o.length>0?o[0]+e:0,t,n);r>-1&&this.setFocus([r],i)}focusPrevious(e=1,t=!1,i,n){if(this.length===0)return;const o=this.focus.get(),r=this.findPreviousIndex(o.length>0?o[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 o=this.findPreviousIndex(i,!1,t);o>-1&&n!==o?this.setFocus([o],e):this.setFocus([i],e)}else{const o=this.view.getScrollTop();let r=o+this.view.renderHeight;i>n&&(r-=this.view.elementHeight(i)),this.view.setScrollTop(r),this.view.getScrollTop()!==o&&(this.setFocus([]),await xh(0),await this.focusNextPage(e,t))}}async focusPreviousPage(e,t,i=()=>0){let n;const o=i(),r=this.view.getScrollTop()+o;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-o),this.view.getScrollTop()+i()!==l&&(this.setFocus([]),await xh(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 wg(this.user,`Invalid index ${e}`);const n=this.view.getScrollTop(),o=this.view.elementTop(e),r=this.view.elementHeight(e);if(yh(t)){const a=r-this.view.renderHeight+i;this.view.setScrollTop(a*xs(t,0,1)+o-i)}else{const a=o+r,l=n+this.view.renderHeight;o=l||(o=l&&r>=this.view.renderHeight?this.view.setScrollTop(o-i):a>=l&&this.view.setScrollTop(a-this.view.renderHeight))}}getRelativeTop(e,t=0){if(e<0||e>=this.length)throw new wg(this.user,`Invalid index ${e}`);const i=this.view.getScrollTop(),n=this.view.elementTop(e),o=this.view.elementHeight(e);if(ni+this.view.renderHeight)return null;const r=o-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(){var e;const t=this.focus.get();if(t.length>0){let i;!((e=this.accessibilityProvider)===null||e===void 0)&&e.getActiveDescendantId&&(i=this.accessibilityProvider.getActiveDescendantId(this.view.element(t[0]))),this.view.domNode.setAttribute("aria-activedescendant",i||this.view.getElementDomId(t[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()}}og([zi],pr.prototype,"onDidChangeFocus",null);og([zi],pr.prototype,"onDidChangeSelection",null);og([zi],pr.prototype,"onContextMenu",null);og([zi],pr.prototype,"onKeyDown",null);og([zi],pr.prototype,"onDidFocus",null);og([zi],pr.prototype,"onDidBlur",null);const Jg=he,Dj="selectOption.entry.template";class OCe{get templateId(){return Dj}renderTemplate(e){const t=Object.create(null);return t.root=e,t.text=Q(e,Jg(".option-text")),t.detail=Q(e,Jg(".option-detail")),t.decoratorRight=Q(e,Jg(".option-decorator-right")),t}renderElement(e,t,i){const n=i,o=e.text,r=e.detail,a=e.decoratorRight,l=e.isDisabled;n.text.textContent=o,n.detail.textContent=r||"",n.decoratorRight.innerText=a||"",l?n.root.classList.add("option-disabled"):n.root.classList.remove("option-disabled")}disposeTemplate(e){}}class ql extends H{constructor(e,t,i,n,o){super(),this.options=[],this._currentSelection=0,this._hasDetails=!1,this._skipLayout=!1,this._sticky=!1,this._isVisible=!1,this.styles=n,this.selectBoxOptions=o||Object.create(null),typeof this.selectBoxOptions.minBottomMargin!="number"?this.selectBoxOptions.minBottomMargin=ql.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 B,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(_l().setupUpdatableHover(Xs("mouse"),this.selectElement,e)):this._hover&&this._hover.update(e)}getHeight(){return 22}getTemplateId(){return Dj}constructSelectDropDown(e){this.contextViewProvider=e,this.selectDropDownContainer=he(".monaco-select-box-dropdown-container"),this.selectDropDownContainer.classList.add("monaco-select-box-dropdown-padding"),this.selectionDetailsPane=Q(this.selectDropDownContainer,Jg(".select-box-details-pane"));const t=Q(this.selectDropDownContainer,Jg(".select-box-dropdown-container-width-control")),i=Q(t,Jg(".width-control-div"));this.widthControlElement=document.createElement("span"),this.widthControlElement.className="option-text-width-control",Q(i,this.widthControlElement),this._dropDownPosition=0,this.styleElement=ar(this.selectDropDownContainer),this.selectDropDownContainer.setAttribute("draggable","true"),this._register(K(this.selectDropDownContainer,ee.DRAG_START,n=>{nt.stop(n,!0)}))}registerListeners(){this._register(Ni(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(K(this.selectElement,ee.CLICK,t=>{nt.stop(t),this._isVisible?this.hideSelectDropDown(!0):this.showSelectDropDown()})),this._register(K(this.selectElement,ee.MOUSE_DOWN,t=>{nt.stop(t)}));let e;this._register(K(this.selectElement,"touchstart",t=>{e=this._isVisible})),this._register(K(this.selectElement,"touchend",t=>{nt.stop(t),e?this.hideSelectDropDown(!0):this.showSelectDropDown()})),this._register(K(this.selectElement,ee.KEY_DOWN,t=>{const i=new Kt(t);let n=!1;lt?(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){Ci(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(){var e;(e=this.selectList)===null||e===void 0||e.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(){var e,t,i;const n=(e=this.styles.selectBackground)!==null&&e!==void 0?e:"",o=(t=this.styles.selectForeground)!==null&&t!==void 0?t:"",r=(i=this.styles.selectBorder)!==null&&i!==void 0?i:"";this.selectElement.style.backgroundColor=n,this.selectElement.style.color=o,this.selectElement.style.borderColor=r}styleList(){var e,t;const i=(e=this.styles.selectBackground)!==null&&e!==void 0?e:"",n=Ec(this.styles.selectListBackground,i);this.selectDropDownListContainer.style.backgroundColor=n,this.selectionDetailsPane.style.backgroundColor=n;const o=(t=this.styles.focusBorder)!==null&&t!==void 0?t:"";this.selectDropDownContainer.style.outlineColor=o,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.innerText="",!(!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:()=>{try{e.removeChild(this.selectDropDownContainer)}catch{}}}}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=Te(this.selectElement),i=qi(this.selectElement),n=Te(this.selectElement).getComputedStyle(this.selectElement),o=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-ql.DEFAULT_DROPDOWN_MINIMUM_TOP_MARGIN,l=this.selectElement.offsetWidth,d=this.setWidthControlElement(this.widthControlElement),c=Math.max(d,Math.round(l)).toString()+"px";this.selectDropDownContainer.style.width=c,this.selectList.getHTMLElement().style.height="",this.selectList.layout();let u=this.selectList.contentHeight;this._hasDetails&&this._cachedMaxDetailsHeight===void 0&&(this._cachedMaxDetailsHeight=this.measureMaxDetailsHeight());const h=this._hasDetails?this._cachedMaxDetailsHeight:0,g=u+o+h,f=Math.floor((r-o-h)/this.getHeight()),m=Math.floor((a-o-h)/this.getHeight());if(e)return i.top+i.height>t.innerHeight-22||i.topf&&this.options.length>f?(this._dropDownPosition=1,this.selectDropDownContainer.removeChild(this.selectDropDownListContainer),this.selectDropDownContainer.removeChild(this.selectionDetailsPane),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.selectDropDownContainer.removeChild(this.selectDropDownListContainer),this.selectDropDownContainer.removeChild(this.selectionDetailsPane),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&&(u=f*this.getHeight())}else g>a&&(u=m*this.getHeight());return this.selectList.layout(u),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=u+o+"px",this.selectDropDownContainer.style.height=""):this.selectDropDownContainer.style.height=u+o+"px",this.updateDetail(this.selected),this.selectDropDownContainer.style.width=c,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((o,r)=>{const a=o.detail?o.detail.length:0,l=o.decoratorRight?o.decoratorRight.length:0,d=o.text.length+a+l;d>n&&(i=r,n=d)}),e.textContent=this.options[i].text+(this.options[i].decoratorRight?this.options[i].decoratorRight+" ":""),t=wo(e)}return t}createSelectList(e){if(this.selectList)return;this.selectDropDownListContainer=Q(e,Jg(".select-box-dropdown-list-container")),this.listRenderer=new OCe,this.selectList=new pr("SelectBoxCustom",this.selectDropDownListContainer,this,[this.listRenderer],{useShadows:!1,verticalScrollMode:3,keyboardSupport:!1,mouseSupport:!1,accessibilityProvider:{getAriaLabel:n=>{let o=n.text;return n.detail&&(o+=`. ${n.detail}`),n.decoratorRight&&(o+=`. ${n.decoratorRight}`),n.description&&(o+=`. ${n.description}`),o},getWidgetAriaLabel:()=>p({},"Select Box"),getRole:()=>lt?"":"option",getWidgetRole:()=>"listbox"}}),this.selectBoxOptions.ariaLabel&&(this.selectList.ariaLabel=this.selectBoxOptions.ariaLabel);const t=this._register(new ht(this.selectDropDownListContainer,"keydown")),i=le.chain(t.event,n=>n.filter(()=>this.selectList.length>0).map(o=>new Kt(o)));this._register(le.chain(i,n=>n.filter(o=>o.keyCode===3))(this.onEnter,this)),this._register(le.chain(i,n=>n.filter(o=>o.keyCode===2))(this.onEnter,this)),this._register(le.chain(i,n=>n.filter(o=>o.keyCode===9))(this.onEscape,this)),this._register(le.chain(i,n=>n.filter(o=>o.keyCode===16))(this.onUpArrow,this)),this._register(le.chain(i,n=>n.filter(o=>o.keyCode===18))(this.onDownArrow,this)),this._register(le.chain(i,n=>n.filter(o=>o.keyCode===12))(this.onPageDown,this)),this._register(le.chain(i,n=>n.filter(o=>o.keyCode===11))(this.onPageUp,this)),this._register(le.chain(i,n=>n.filter(o=>o.keyCode===14))(this.onHome,this)),this._register(le.chain(i,n=>n.filter(o=>o.keyCode===13))(this.onEnd,this)),this._register(le.chain(i,n=>n.filter(o=>o.keyCode>=21&&o.keyCode<=56||o.keyCode>=85&&o.keyCode<=113))(this.onCharacter,this)),this._register(K(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(K(this.selectDropDownContainer,ee.FOCUS_OUT,n=>{!this._isVisible||An(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")),o=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=sc.toString(e.keyCode);let i=-1;for(let n=0;n{this._register(K(this.selectElement,e,t=>{this.selectElement.focus()}))}),this._register(Ni(this.selectElement,"click",e=>{nt.stop(e,!0)})),this._register(Ni(this.selectElement,"change",e=>{this.selectElement.title=e.target.value,this._onDidSelect.fire({index:e.target.selectedIndex,selected:e.target.value})})),this._register(Ni(this.selectElement,"keydown",e=>{let t=!1;lt?(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||!Ci(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 Df)),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(Gt.addTarget(e));const i=this.options&&this.options.draggable;i&&(e.draggable=!0,Fr&&this._register(K(e,ee.DRAG_START,n=>{var o;return(o=n.dataTransfer)===null||o===void 0?void 0:o.setData(uC.TEXT,this._action.label)}))),this._register(K(t,Xt.Tap,n=>this.onClick(n,!0))),this._register(K(t,ee.MOUSE_DOWN,n=>{i||nt.stop(n,!0),this._action.enabled&&n.button===0&&t.classList.add("active")})),lt&&this._register(K(t,ee.CONTEXT_MENU,n=>{n.button===0&&n.ctrlKey===!0&&this.onClick(n)})),this._register(K(t,ee.CLICK,n=>{nt.stop(n,!0),this.options&&this.options.isMenu||this.onClick(n)})),this._register(K(t,ee.DBLCLICK,n=>{nt.stop(n,!0)})),[ee.MOUSE_UP,ee.MOUSE_OUT].forEach(n=>{this._register(K(t,n,o=>{nt.stop(o),t.classList.remove("active")}))})}onClick(e,t=!1){var i;nt.stop(e,!0);const n=Go(this._context)?!((i=this.options)===null||i===void 0)&&i.useEventAsContext?e:{preserveFocus:t}:this._context;this.actionRunner.run(this._action,n)}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}updateTooltip(){var e,t,i;if(!this.element)return;const n=(e=this.getTooltip())!==null&&e!==void 0?e:"";if(this.updateAriaLabel(),!((t=this.options.hoverDelegate)===null||t===void 0)&&t.showNativeHover)this.element.title=n;else if(!this.customHover&&n!==""){const o=(i=this.options.hoverDelegate)!==null&&i!==void 0?i:Xs("element");this.customHover=this._store.add(_l().setupUpdatableHover(o,this.element,n))}else this.customHover&&this.customHover.update(n)}updateAriaLabel(){var e;if(this.element){const t=(e=this.getTooltip())!==null&&e!==void 0?e:"";this.element.setAttribute("aria-label",t)}}updateClass(){}updateChecked(){}dispose(){this.element&&(this.element.remove(),this.element=void 0),this._context=void 0,super.dispose()}}class N_ extends Va{constructor(e,t,i){super(e,t,i),this.options=i,this.options.icon=i.icon!==void 0?i.icon:!1,this.options.label=i.label!==void 0?i.label:!0,this.cssClass=""}render(e){super.render(e),yt(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){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===rn.ID?"presentation":this.options.isMenu?"menuitem":"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.options.label&&this.action.label&&this.options.icon&&(e=this.action.label,this.options.keybinding&&(e=p({},"{0} ({1})",e,this.options.keybinding))),e??void 0}updateClass(){var e;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()):(e=this.label)===null||e===void 0||e.classList.remove("codicon")}updateEnabled(){var e,t;this.action.enabled?(this.label&&(this.label.removeAttribute("aria-disabled"),this.label.classList.remove("disabled")),(e=this.element)===null||e===void 0||e.classList.remove("disabled")):(this.label&&(this.label.setAttribute("aria-disabled","true"),this.label.classList.add("disabled")),(t=this.element)===null||t===void 0||t.classList.add("disabled"))}updateAriaLabel(){var e;if(this.label){const t=(e=this.getTooltip())!==null&&e!==void 0?e:"";this.label.setAttribute("aria-label",t)}}updateChecked(){this.label&&(this.action.checked!==void 0?(this.label.classList.toggle("checked",this.action.checked),this.label.setAttribute("aria-checked",this.action.checked?"true":"false"),this.label.setAttribute("role","checkbox")):(this.label.classList.remove("checked"),this.label.removeAttribute("aria-checked"),this.label.setAttribute("role",this.getDefaultAriaRole())))}}class HCe extends Va{constructor(e,t,i,n,o,r,a){super(e,t),this.selectBox=new WCe(i,n,o,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(){var e;(e=this.selectBox)===null||e===void 0||e.focus()}blur(){var e;(e=this.selectBox)===null||e===void 0||e.blur()}render(e){this.selectBox.render(e)}}class VCe extends Df{constructor(e,t){super(),this._onDidChangeVisibility=this._register(new B),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this._element=Q(e,he(".monaco-dropdown")),this._label=Q(this._element,he(".dropdown-label"));let i=t.labelRenderer;i||(i=o=>(o.textContent=t.label||"",null));for(const o of[ee.CLICK,ee.MOUSE_DOWN,Xt.Tap])this._register(K(this.element,o,r=>nt.stop(r,!0)));for(const o of[ee.MOUSE_DOWN,Xt.Tap])this._register(K(this._label,o,r=>{cF(r)&&(r.detail>1||r.button!==0)||(this.visible?this.hide():this.show())}));this._register(K(this._label,ee.KEY_UP,o=>{const r=new Kt(o);(r.equals(3)||r.equals(10))&&(nt.stop(o,!0),this.visible?this.hide():this.show())}));const n=i(this._label);n&&this._register(n),this._register(Gt.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 zCe extends VCe{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 kD extends Va{constructor(e,t,i,n=Object.create(null)){super(null,e,n),this.actionItem=null,this._onDidChangeVisibility=this._register(new B),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this.menuActionsOrProvider=t,this.contextMenuProvider=i,this.options=n,this.options.actionRunner&&(this.actionRunner=this.options.actionRunner)}render(e){this.actionItem=e;const t=o=>{var r;this.element=Q(o,he("a.action-label"));let a=[];return typeof this.options.classNames=="string"?a=this.options.classNames.split(/\s+/g).filter(l=>!!l):this.options.classNames&&(a=this.options.classNames),a.find(l=>l==="icon")||a.push("codicon"),this.element.classList.add(...a),this.element.setAttribute("role","button"),this.element.setAttribute("aria-haspopup","true"),this.element.setAttribute("aria-expanded","false"),this._action.label&&this._register(_l().setupUpdatableHover((r=this.options.hoverDelegate)!==null&&r!==void 0?r:Xs("mouse"),this.element,this._action.label)),this.element.ariaLabel=this._action.label||"",null},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 zCe(e,n)),this._register(this.dropdownMenu.onDidChangeVisibility(o=>{var r;(r=this.element)===null||r===void 0||r.setAttribute("aria-expanded",`${o}`),this._onDidChangeVisibility.fire(o)})),this.dropdownMenu.menuOptions={actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,getKeyBinding:this.options.keybindingProvider,context:this._context},this.options.anchorAlignmentProvider){const o=this;this.dropdownMenu.menuOptions={...this.dropdownMenu.menuOptions,get anchorAlignment(){return o.options.anchorAlignmentProvider()}}}this.updateTooltip(),this.updateEnabled()}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(){var e;(e=this.dropdownMenu)===null||e===void 0||e.show()}updateEnabled(){var e,t;const i=!this.action.enabled;(e=this.actionItem)===null||e===void 0||e.classList.toggle("disabled",i),(t=this.element)===null||t===void 0||t.classList.toggle("disabled",i)}}function UCe(s){return s?s.condition!==void 0:!1}var jm;(function(s){s[s.STORAGE_DOES_NOT_EXIST=0]="STORAGE_DOES_NOT_EXIST",s[s.STORAGE_IN_MEMORY=1]="STORAGE_IN_MEMORY"})(jm||(jm={}));var vm;(function(s){s[s.None=0]="None",s[s.Initialized=1]="Initialized",s[s.Closed=2]="Closed"})(vm||(vm={}));class Km extends H{constructor(e,t=Object.create(null)){super(),this.database=e,this.options=t,this._onDidChangeStorage=this._register(new bf),this.onDidChangeStorage=this._onDidChangeStorage.event,this.state=vm.None,this.cache=new Map,this.flushDelayer=this._register(new fz(Km.DEFAULT_FLUSH_DELAY)),this.pendingDeletes=new Set,this.pendingInserts=new Map,this.whenFlushedCallbacks=[],this.registerListeners()}registerListeners(){this._register(this.database.onDidChangeItemsExternal(e=>this.onDidChangeItemsExternal(e)))}onDidChangeItemsExternal(e){var t,i;this._onDidChangeStorage.pause();try{(t=e.changed)===null||t===void 0||t.forEach((n,o)=>this.acceptExternal(o,n)),(i=e.deleted)===null||i===void 0||i.forEach(n=>this.acceptExternal(n,void 0))}finally{this._onDidChangeStorage.resume()}}acceptExternal(e,t){if(this.state===vm.Closed)return;let i=!1;Go(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 Go(i)?t:i}getBoolean(e,t){const i=this.get(e);return Go(i)?t:i==="true"}getNumber(e,t){const i=this.get(e);return Go(i)?t:parseInt(i,10)}async set(e,t,i=!1){if(this.state===vm.Closed)return;if(Go(t))return this.delete(e,i);const n=Ms(t)||Array.isArray(t)?Rve(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===vm.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(()=>{var t;if(!this.hasPending)for(;this.whenFlushedCallbacks.length;)(t=this.whenFlushedCallbacks.pop())===null||t===void 0||t()})}async doFlush(e){return this.options.hint===jm.STORAGE_IN_MEMORY?this.flushPending():this.flushDelayer.trigger(()=>this.flushPending(),e)}}Km.DEFAULT_FLUSH_DELAY=100;class VI{constructor(){this.onDidChangeItemsExternal=le.None,this.items=new Map}async updateItems(e){var t,i;(t=e.insert)===null||t===void 0||t.forEach((n,o)=>this.items.set(o,n)),(i=e.delete)===null||i===void 0||i.forEach(n=>this.items.delete(n))}}const tS="__$__targetStorageMarker",Rd=ut("storageService");var ED;(function(s){s[s.NONE=0]="NONE",s[s.SHUTDOWN=1]="SHUTDOWN"})(ED||(ED={}));function $Ce(s){const e=s.get(tS);if(e)try{return JSON.parse(e)}catch{}return Object.create(null)}class Xx extends H{constructor(e={flushInterval:Xx.DEFAULT_FLUSH_INTERVAL}){super(),this.options=e,this._onDidChangeValue=this._register(new bf),this._onDidChangeTarget=this._register(new bf),this._onWillSaveState=this._register(new B),this.onWillSaveState=this._onWillSaveState.event,this._workspaceKeyTargets=void 0,this._profileKeyTargets=void 0,this._applicationKeyTargets=void 0}onDidChangeValue(e,t,i){return le.filter(this._onDidChangeValue.event,n=>n.scope===e&&(t===void 0||n.key===t),i)}emitDidChangeValue(e,t){const{key:i,external:n}=t;if(i===tS){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){var n;return(n=this.getStorage(t))===null||n===void 0?void 0:n.get(e,i)}getBoolean(e,t,i){var n;return(n=this.getStorage(t))===null||n===void 0?void 0:n.getBoolean(e,i)}getNumber(e,t,i){var n;return(n=this.getStorage(t))===null||n===void 0?void 0:n.getNumber(e,i)}store(e,t,i,n,o=!1){if(Go(t)){this.remove(e,i,o);return}this.withPausedEmitters(()=>{var r;this.updateKeyTarget(e,i,n),(r=this.getStorage(i))===null||r===void 0||r.set(e,t,o)})}remove(e,t,i=!1){this.withPausedEmitters(()=>{var n;this.updateKeyTarget(e,t,void 0),(n=this.getStorage(t))===null||n===void 0||n.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){var o,r;const a=this.getKeyTargets(t);typeof i=="number"?a[e]!==i&&(a[e]=i,(o=this.getStorage(t))===null||o===void 0||o.set(tS,JSON.stringify(a),n)):typeof a[e]=="number"&&(delete a[e],(r=this.getStorage(t))===null||r===void 0||r.set(tS,JSON.stringify(a),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?$Ce(t):Object.create(null)}}Xx.DEFAULT_FLUSH_INTERVAL=60*1e3;class jCe extends Xx{constructor(){super(),this.applicationStorage=this._register(new Km(new VI,{hint:jm.STORAGE_IN_MEMORY})),this.profileStorage=this._register(new Km(new VI,{hint:jm.STORAGE_IN_MEMORY})),this.workspaceStorage=this._register(new Km(new VI,{hint:jm.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}}}function KCe(s,e){const t={...e};for(const i in s){const n=s[i];t[i]=n!==void 0?fe(n):void 0}return t}const qCe={keybindingLabelBackground:fe(whe),keybindingLabelForeground:fe(yhe),keybindingLabelBorder:fe(She),keybindingLabelBottomBorder:fe(Dhe),keybindingLabelShadow:fe(vc)},GCe={buttonForeground:fe(vv),buttonSeparator:fe(ghe),buttonBackground:fe(bv),buttonHoverBackground:fe(fhe),buttonSecondaryForeground:fe(mhe),buttonSecondaryBackground:fe(IA),buttonSecondaryHoverBackground:fe(_he),buttonBorder:fe(phe)},ZCe={progressBarBackground:fe(Aue)},ID={inputActiveOptionBorder:fe(RF),inputActiveOptionForeground:fe(PF),inputActiveOptionBackground:fe(Zg)};fe(vhe),fe(Che),fe(bhe);fe(Hi),fe(gc),fe(vc),fe(gt),fe(Zue),fe(Xue),fe(Yue),fe(Tue);const TD={inputBackground:fe(EA),inputForeground:fe(NU),inputBorder:fe(AU),inputValidationInfoBorder:fe(ohe),inputValidationInfoBackground:fe(nhe),inputValidationInfoForeground:fe(she),inputValidationWarningBorder:fe(lhe),inputValidationWarningBackground:fe(rhe),inputValidationWarningForeground:fe(ahe),inputValidationErrorBorder:fe(uhe),inputValidationErrorBackground:fe(dhe),inputValidationErrorForeground:fe(che)},XCe={listFilterWidgetBackground:fe(Fhe),listFilterWidgetOutline:fe(Ohe),listFilterWidgetNoMatchesOutline:fe(Bhe),listFilterWidgetShadow:fe(Whe),inputBoxStyles:TD,toggleStyles:ID},Lj={badgeBackground:fe(jy),badgeForeground:fe(Nue),badgeBorder:fe(gt)};fe(que),fe(Kue),fe(xB),fe(xB),fe(Gue);const cp={listBackground:void 0,listInactiveFocusForeground:void 0,listFocusBackground:fe(Lhe),listFocusForeground:fe(xhe),listFocusOutline:fe(khe),listActiveSelectionBackground:fe(Cc),listActiveSelectionForeground:fe(td),listActiveSelectionIconForeground:fe(Cv),listFocusAndSelectionOutline:fe(Ehe),listFocusAndSelectionBackground:fe(Cc),listFocusAndSelectionForeground:fe(td),listInactiveSelectionBackground:fe(Ihe),listInactiveSelectionIconForeground:fe(Nhe),listInactiveSelectionForeground:fe(The),listInactiveFocusBackground:fe(Ahe),listInactiveFocusOutline:fe(Mhe),listHoverBackground:fe(MU),listHoverForeground:fe(RU),listDropOverBackground:fe(Rhe),listDropBetweenBackground:fe(Phe),listSelectionOutline:fe(di),listHoverOutline:fe(di),treeIndentGuidesStroke:fe(wv),treeInactiveIndentGuidesStroke:fe(Hhe),treeStickyScrollBackground:void 0,treeStickyScrollBorder:void 0,treeStickyScrollShadow:void 0,tableColumnsBorder:fe(Vhe),tableOddRowsBackgroundColor:fe(zhe)};function up(s){return KCe(s,cp)}const YCe={selectBackground:fe(ed),selectListBackground:fe(hhe),selectForeground:fe(bc),decoratorRightForeground:fe(PU),selectBorder:fe(dm),focusBorder:fe(Ir),listFocusBackground:fe($u),listInactiveSelectionIconForeground:fe(cm),listFocusForeground:fe(Uu),listFocusOutline:xue(di,$.transparent.toString()),listHoverBackground:fe(MU),listHoverForeground:fe(RU),listHoverOutline:fe(di),selectListBorder:fe(fc),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},QCe={shadowColor:fe(vc),borderColor:fe(Uhe),foregroundColor:fe($he),backgroundColor:fe(jhe),selectionForegroundColor:fe(Khe),selectionBackgroundColor:fe(qhe),selectionBorderColor:fe(Ghe),separatorColor:fe(Zhe),scrollbarShadow:fe(gv),scrollbarSliderBackground:fe(fv),scrollbarSliderHoverBackground:fe(pv),scrollbarSliderActiveBackground:fe(mv)};var Yx=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},so=function(s,e){return function(t,i){e(t,i,s)}};function JCe(s,e,t,i){const n=s.getActions(e),o=hc.getInstance(),r=o.keyStatus.altKey||(as||$s)&&o.keyStatus.shiftKey;xj(n,t,r,a=>a==="navigation")}function Qx(s,e,t,i,n,o){const r=s.getActions(e);xj(r,t,!1,typeof i=="string"?l=>l===i:i,n,o)}function xj(s,e,t,i=r=>r==="navigation",n=()=>!1,o=!1){let r,a;Array.isArray(e)?(r=e,a=e):(r=e.primary,a=e.secondary);const l=new Set;for(const[d,c]of s){let u;i(d)?(u=r,u.length>0&&o&&u.push(new rn)):(u=a,u.length>0&&u.push(new rn));for(let h of c){t&&(h=h instanceof Io&&h.alt?h.alt:h);const g=u.push(h);h instanceof c_&&l.add({group:d,action:h,index:g-1})}}for(const{group:d,action:c,index:u}of l){const h=i(d)?r:a,g=c.actions;n(c,d,h.length)&&h.splice(u,1,...g)}}let Fh=class extends N_{constructor(e,t,i,n,o,r,a,l){super(void 0,e,{icon:!!(e.class||e.item.icon),label:!e.class&&!e.item.icon,draggable:t==null?void 0:t.draggable,keybinding:t==null?void 0:t.keybinding,hoverDelegate:t==null?void 0:t.hoverDelegate}),this._keybindingService=i,this._notificationService=n,this._contextKeyService=o,this._themeService=r,this._contextMenuService=a,this._accessibilityService=l,this._wantsAltCommand=!1,this._itemClassDispose=this._register(new $n),this._altKey=hc.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=()=>{var n;const o=!!(!((n=this._menuItemAction.alt)===null||n===void 0)&&n.enabled)&&(!this._accessibilityService.isMotionReduced()||t)&&(this._altKey.keyStatus.altKey||this._altKey.keyStatus.shiftKey&&t);o!==this._wantsAltCommand&&(this._wantsAltCommand=o,this.updateLabel(),this.updateTooltip(),this.updateClass())};this._register(this._altKey.event(i)),this._register(K(e,"mouseleave",n=>{t=!1,i()})),this._register(K(e,"mouseenter",n=>{t=!0,i()})),i()}}updateLabel(){this.options.label&&this.label&&(this.label.textContent=this._commandAction.label)}getTooltip(){var e;const t=this._keybindingService.lookupKeybinding(this._commandAction.id,this._contextKeyService),i=t&&t.getLabel(),n=this._commandAction.tooltip||this._commandAction.label;let o=i?p("titleAndKb","{0} ({1})",n,i):n;if(!this._wantsAltCommand&&(!((e=this._menuItemAction.alt)===null||e===void 0)&&e.enabled)){const r=this._menuItemAction.alt.tooltip||this._menuItemAction.alt.label,a=this._keybindingService.lookupKeybinding(this._menuItemAction.alt.id,this._contextKeyService),l=a&&a.getLabel(),d=l?p("titleAndKb","{0} ({1})",r,l):r;o=p("titleAndKbAndAlt",`{0} [{1}] {2}`,o,SO.modifierLabels[Lo].altKey,d)}return o}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&&UCe(e.toggled)&&e.toggled.icon?e.toggled.icon:e.icon;if(n)if(Pe.isThemeIcon(n)){const o=Pe.asClassNameArray(n);i.classList.add(...o),this._itemClassDispose.value=Ie(()=>{i.classList.remove(...o)})}else i.style.backgroundImage=Dx(this._themeService.getColorTheme().type)?Ih(n.dark):Ih(n.light),i.classList.add("icon"),this._itemClassDispose.value=ha(Ie(()=>{i.style.backgroundImage="",i.classList.remove("icon")}),this._themeService.onDidColorThemeChange(()=>{this.updateClass()}))}};Fh=Yx([so(2,At),so(3,en),so(4,Be),so(5,_n),so(6,Oo),so(7,gr)],Fh);let L2=class extends kD{constructor(e,t,i,n,o){var r,a,l;const d={...t,menuAsChild:(r=t==null?void 0:t.menuAsChild)!==null&&r!==void 0?r:!1,classNames:(a=t==null?void 0:t.classNames)!==null&&a!==void 0?a:Pe.isThemeIcon(e.item.icon)?Pe.asClassName(e.item.icon):void 0,keybindingProvider:(l=t==null?void 0:t.keybindingProvider)!==null&&l!==void 0?l:c=>i.lookupKeybinding(c.id)};super(e,{getActions:()=>e.actions},n,d),this._keybindingService=i,this._contextMenuService=n,this._themeService=o}render(e){super.render(e),yt(this.element),e.classList.add("menu-entry");const t=this._action,{icon:i}=t.item;if(i&&!Pe.isThemeIcon(i)){this.element.classList.add("icon");const n=()=>{this.element&&(this.element.style.backgroundImage=Dx(this._themeService.getColorTheme().type)?Ih(i.dark):Ih(i.light))};n(),this._register(this._themeService.onDidColorThemeChange(()=>{n()}))}}};L2=Yx([so(2,At),so(3,Oo),so(4,_n)],L2);let x2=class extends Va{constructor(e,t,i,n,o,r,a,l){var d,c,u;super(null,e),this._keybindingService=i,this._notificationService=n,this._contextMenuService=o,this._menuService=r,this._instaService=a,this._storageService=l,this._container=null,this._options=t,this._storageKey=`${e.item.submenu.id}_lastActionId`;let h;const g=t!=null&&t.persistLastActionId?l.get(this._storageKey,1):void 0;g&&(h=e.actions.find(m=>g===m.id)),h||(h=e.actions[0]),this._defaultAction=this._instaService.createInstance(Fh,h,{keybinding:this._getDefaultActionKeybindingLabel(h)});const f={keybindingProvider:m=>this._keybindingService.lookupKeybinding(m.id),...t,menuAsChild:(d=t==null?void 0:t.menuAsChild)!==null&&d!==void 0?d:!0,classNames:(c=t==null?void 0:t.classNames)!==null&&c!==void 0?c:["codicon","codicon-chevron-down"],actionRunner:(u=t==null?void 0:t.actionRunner)!==null&&u!==void 0?u:new Df};this._dropdown=new kD(e,e.actions,this._contextMenuService,f),this._register(this._dropdown.actionRunner.onDidRun(m=>{m.action instanceof Io&&this.update(m.action)}))}update(e){var t;!((t=this._options)===null||t===void 0)&&t.persistLastActionId&&this._storageService.store(this._storageKey,e.id,1,1),this._defaultAction.dispose(),this._defaultAction=this._instaService.createInstance(Fh,e,{keybinding:this._getDefaultActionKeybindingLabel(e)}),this._defaultAction.actionRunner=new class extends Df{async runAction(i,n){await i.run(void 0)}},this._container&&this._defaultAction.render(uF(this._container,he(".action-container")))}_getDefaultActionKeybindingLabel(e){var t;let i;if(!((t=this._options)===null||t===void 0)&&t.renderKeybindingWithDefaultActionLabel){const n=this._keybindingService.lookupKeybinding(e.id);n&&(i=`(${n.getLabel()})`)}return i}setActionContext(e){super.setActionContext(e),this._defaultAction.setActionContext(e),this._dropdown.setActionContext(e)}render(e){this._container=e,super.render(this._container),this._container.classList.add("monaco-dropdown-with-default");const t=he(".action-container");this._defaultAction.render(Q(this._container,t)),this._register(K(t,ee.KEY_DOWN,n=>{const o=new Kt(n);o.equals(17)&&(this._defaultAction.element.tabIndex=-1,this._dropdown.focus(),o.stopPropagation())}));const i=he(".dropdown-action-container");this._dropdown.render(Q(this._container,i)),this._register(K(i,ee.KEY_DOWN,n=>{var o;const r=new Kt(n);r.equals(15)&&(this._defaultAction.element.tabIndex=0,this._dropdown.setFocusable(!1),(o=this._defaultAction.element)===null||o===void 0||o.focus(),r.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))}dispose(){this._defaultAction.dispose(),this._dropdown.dispose(),super.dispose()}};x2=Yx([so(2,At),so(3,en),so(4,Oo),so(5,hr),so(6,Ne),so(7,Rd)],x2);let k2=class extends HCe{constructor(e,t){super(null,e,e.actions.map(i=>({text:i.id===rn.ID?"─────────":i.label,isDisabled:!i.enabled})),0,t,YCe,{ariaLabel:e.tooltip,optionsAsChildren:!0}),this.select(Math.max(0,e.actions.findIndex(i=>i.checked)))}render(e){super.render(e),e.style.borderColor=fe(dm)}runAction(e,t){const i=this.action.actions[t];i&&this.actionRunner.run(i)}};k2=Yx([so(1,nu)],k2);function kj(s,e,t){return e instanceof Io?s.createInstance(Fh,e,t):e instanceof Em?e.item.isSelection?s.createInstance(k2,e):e.item.rememberDefaultAction?s.createInstance(x2,e,{...t,persistLastActionId:!0}):s.createInstance(L2,e,t):void 0}class Vr extends H{constructor(e,t={}){var i,n,o,r,a,l,d;super(),this._actionRunnerDisposables=this._register(new Y),this.viewItemDisposables=this._register(new $P),this.triggerKeyDown=!1,this.focusable=!0,this._onDidBlur=this._register(new B),this.onDidBlur=this._onDidBlur.event,this._onDidCancel=this._register(new B({onWillAddFirstListener:()=>this.cancelHasListener=!0})),this.onDidCancel=this._onDidCancel.event,this.cancelHasListener=!1,this._onDidRun=this._register(new B),this.onDidRun=this._onDidRun.event,this._onWillRun=this._register(new B),this.onWillRun=this._onWillRun.event,this.options=t,this._context=(i=t.context)!==null&&i!==void 0?i:null,this._orientation=(n=this.options.orientation)!==null&&n!==void 0?n:0,this._triggerKeys={keyDown:(r=(o=this.options.triggerKeys)===null||o===void 0?void 0:o.keyDown)!==null&&r!==void 0?r:!1,keys:(l=(a=this.options.triggerKeys)===null||a===void 0?void 0:a.keys)!==null&&l!==void 0?l:[3,10]},this._hoverDelegate=(d=t.hoverDelegate)!==null&&d!==void 0?d:this._register(I_()),this.options.actionRunner?this._actionRunner=this.options.actionRunner:(this._actionRunner=new Df,this._actionRunnerDisposables.add(this._actionRunner)),this._actionRunnerDisposables.add(this._actionRunner.onDidRun(h=>this._onDidRun.fire(h))),this._actionRunnerDisposables.add(this._actionRunner.onWillRun(h=>this._onWillRun.fire(h))),this.viewItems=[],this.focusedItem=void 0,this.domNode=document.createElement("div"),this.domNode.className="monaco-action-bar";let c,u;switch(this._orientation){case 0:c=[15],u=[17];break;case 1:c=[16],u=[18],this.domNode.className+=" vertical";break}this._register(K(this.domNode,ee.KEY_DOWN,h=>{const g=new Kt(h);let f=!0;const m=typeof this.focusedItem=="number"?this.viewItems[this.focusedItem]:void 0;c&&(g.equals(c[0])||g.equals(c[1]))?f=this.focusPrevious():u&&(g.equals(u[0])||g.equals(u[1]))?f=this.focusNext():g.equals(9)&&this.cancelHasListener?this._onDidCancel.fire():g.equals(14)?f=this.focusFirst():g.equals(13)?f=this.focusLast():g.equals(2)&&m instanceof Va&&m.trapsArrowNavigation?f=this.focusNext():this.isTriggerKeyEvent(g)?this._triggerKeys.keyDown?this.doTrigger(g):this.triggerKeyDown=!0:f=!1,f&&(g.preventDefault(),g.stopPropagation())})),this._register(K(this.domNode,ee.KEY_UP,h=>{const g=new Kt(h);this.isTriggerKeyEvent(g)?(!this._triggerKeys.keyDown&&this.triggerKeyDown&&(this.triggerKeyDown=!1,this.doTrigger(g)),g.preventDefault(),g.stopPropagation()):(g.equals(2)||g.equals(1026)||g.equals(16)||g.equals(18)||g.equals(15)||g.equals(17))&&this.updateFocusedItem()})),this.focusTracker=this._register(ba(this.domNode)),this._register(this.focusTracker.onDidBlur(()=>{(Xn()===this.domNode||!An(Xn(),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 Va&&i.isEnabled());t instanceof Va&&t.setFocusable(!0)}else this.viewItems.forEach(t=>{t instanceof Va&&t.setFocusable(!1)})}isTriggerKeyEvent(e){let t=!1;return this._triggerKeys.keys.forEach(i=>{t=t||e.equals(i)}),t}updateFocusedItem(){var e,t;for(let i=0;it.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){var t;if(typeof e=="number")return(t=this.viewItems[e])===null||t===void 0?void 0:t.action;if(e instanceof HTMLElement){for(;e.parentElement!==this.actionsList;){if(!e.parentElement)return;e=e.parentElement}for(let i=0;i{const r=document.createElement("li");r.className="action-item",r.setAttribute("role","presentation");let a;const l={hoverDelegate:this._hoverDelegate,...t};this.options.actionViewItemProvider&&(a=this.options.actionViewItemProvider(o,l)),a||(a=new N_(this.context,o,l)),this.options.allowContextMenu||this.viewItemDisposables.set(a,K(r,ee.CONTEXT_MENU,d=>{nt.stop(d,!0)})),a.actionRunner=this._actionRunner,a.setActionContext(this.context),a.render(r),this.focusable&&a instanceof Va&&this.viewItems.length===0&&a.setFocusable(!0),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++)}),typeof this.focusedItem=="number"&&this.focus(this.focusedItem),this.refreshRole()}clear(){this.isEmpty()||(this.viewItems=jt(this.viewItems),this.viewItemDisposables.clearAndDisposeAll(),zn(this.actionsList),this.refreshRole())}length(){return this.viewItems.length}isEmpty(){return this.viewItems.length===0}focus(e){let t=!1,i;if(e===void 0?t=!0:typeof e=="number"?i=e:typeof e=="boolean"&&(t=e),t&&typeof this.focusedItem>"u"){const n=this.viewItems.findIndex(o=>o.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){if(typeof this.focusedItem>"u")this.focusedItem=this.viewItems.length-1;else if(this.viewItems.length<=1)return!1;const t=this.focusedItem;let i;do{if(!e&&this.options.preventLoopNavigation&&this.focusedItem+1>=this.viewItems.length)return this.focusedItem=t,!1;this.focusedItem=(this.focusedItem+1)%this.viewItems.length,i=this.viewItems[this.focusedItem]}while(this.focusedItem!==t&&(this.options.focusOnlyEnabledItems&&!i.isEnabled()||i.action.id===rn.ID));return this.updateFocus(),!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===rn.ID));return this.updateFocus(!0),!0}updateFocus(e,t,i=!1){var n,o;typeof this.focusedItem>"u"&&this.actionsList.focus({preventScroll:t}),this.previouslyFocusedItem!==void 0&&this.previouslyFocusedItem!==this.focusedItem&&((n=this.viewItems[this.previouslyFocusedItem])===null||n===void 0||n.blur());const r=this.focusedItem!==void 0?this.viewItems[this.focusedItem]:void 0;if(r){let a=!0;kS(r.focus)||(a=!1),this.options.focusOnlyEnabledItems&&kS(r.isEnabled)&&!r.isEnabled()&&(a=!1),r.action.id===rn.ID&&(a=!1),a?(i||this.previouslyFocusedItem!==this.focusedItem)&&(r.focus(e),this.previouslyFocusedItem=this.focusedItem):(this.actionsList.focus({preventScroll:t}),this.previouslyFocusedItem=void 0),a&&((o=r.showHover)===null||o===void 0||o.call(r))}}doTrigger(e){if(typeof this.focusedItem>"u")return;const t=this.viewItems[this.focusedItem];if(t instanceof Va){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=jt(this.viewItems),this.getContainer().remove(),super.dispose()}}const E2=/\(&([^\s&])\)|(^|[^&])&([^\s&])/,zI=/(&)?(&)([^\s&])/g;var ND;(function(s){s[s.Right=0]="Right",s[s.Left=1]="Left"})(ND||(ND={}));var I2;(function(s){s[s.Above=0]="Above",s[s.Below=1]="Below"})(I2||(I2={}));class qm extends Vr{constructor(e,t,i,n){e.classList.add("monaco-menu-container"),e.setAttribute("role","presentation");const o=document.createElement("div");o.classList.add("monaco-menu"),o.setAttribute("role","presentation"),super(o,{orientation:1,actionViewItemProvider:d=>this.doGetActionViewItem(d,i,r),context:i.context,actionRunner:i.actionRunner,ariaLabel:i.ariaLabel,ariaRole:"menu",focusOnlyEnabledItems:!0,triggerKeys:{keys:[3,...lt||$s?[10]:[]],keyDown:!0}}),this.menuStyles=n,this.menuElement=o,this.actionsList.tabIndex=0,this.initializeOrUpdateStyleSheet(e,n),this._register(Gt.addTarget(o)),this._register(K(o,ee.KEY_DOWN,d=>{new Kt(d).equals(2)&&d.preventDefault()})),i.enableMnemonics&&this._register(K(o,ee.KEY_DOWN,d=>{const c=d.key.toLocaleLowerCase();if(this.mnemonics.has(c)){nt.stop(d,!0);const u=this.mnemonics.get(c);if(u.length===1&&(u[0]instanceof E6&&u[0].container&&this.focusItemByElement(u[0].container),u[0].onClick(d)),u.length>1){const h=u.shift();h&&h.container&&(this.focusItemByElement(h.container),u.push(h)),this.mnemonics.set(c,u)}}})),$s&&this._register(K(o,ee.KEY_DOWN,d=>{const c=new Kt(d);c.equals(14)||c.equals(11)?(this.focusedItem=this.viewItems.length-1,this.focusNext(),nt.stop(d,!0)):(c.equals(13)||c.equals(12))&&(this.focusedItem=0,this.focusPrevious(),nt.stop(d,!0))})),this._register(K(this.domNode,ee.MOUSE_OUT,d=>{const c=d.relatedTarget;An(c,this.domNode)||(this.focusedItem=void 0,this.updateFocus(),d.stopPropagation())})),this._register(K(this.actionsList,ee.MOUSE_OVER,d=>{let c=d.target;if(!(!c||!An(c,this.actionsList)||c===this.actionsList)){for(;c.parentElement!==this.actionsList&&c.parentElement!==null;)c=c.parentElement;if(c.classList.contains("action-item")){const u=this.focusedItem;this.setFocusedItem(c),u!==this.focusedItem&&this.updateFocus()}}})),this._register(Gt.addTarget(this.actionsList)),this._register(K(this.actionsList,Xt.Tap,d=>{let c=d.initialTarget;if(!(!c||!An(c,this.actionsList)||c===this.actionsList)){for(;c.parentElement!==this.actionsList&&c.parentElement!==null;)c=c.parentElement;if(c.classList.contains("action-item")){const u=this.focusedItem;this.setFocusedItem(c),u!==this.focusedItem&&this.updateFocus()}}}));const r={parent:this};this.mnemonics=new Map,this.scrollableElement=this._register(new C1(o,{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(K(o,Xt.Change,d=>{nt.stop(d,!0);const c=this.scrollableElement.getScrollPosition().scrollTop;this.scrollableElement.setScrollPosition({scrollTop:c-d.translationY})})),this._register(K(a,ee.MOUSE_UP,d=>{d.preventDefault()}));const l=Te(e);o.style.maxHeight=`${Math.max(10,l.innerHeight-e.getBoundingClientRect().top-35)}px`,t=t.filter((d,c)=>{var u;return!((u=i.submenuIds)===null||u===void 0)&&u.has(d.id)?(console.warn(`Found submenu cycle: ${d.id}`),!1):!(d instanceof rn&&(c===t.length-1||c===0||t[c-1]instanceof rn))}),this.push(t,{icon:!0,label:!0,isMenu:!0}),e.appendChild(this.scrollableElement.getDomNode()),this.scrollableElement.scanDomNode(),this.viewItems.filter(d=>!(d instanceof I6)).forEach((d,c,u)=>{d.updatePositionInSet(c+1,u.length)})}initializeOrUpdateStyleSheet(e,t){this.styleSheet||(US(e)?this.styleSheet=ar(e):(qm.globalStyleSheet||(qm.globalStyleSheet=ar()),this.styleSheet=qm.globalStyleSheet)),this.styleSheet.textContent=t1e(t,US(e))}styleScrollElement(e,t){var i,n;const o=(i=t.foregroundColor)!==null&&i!==void 0?i:"",r=(n=t.backgroundColor)!==null&&n!==void 0?n:"",a=t.borderColor?`1px solid ${t.borderColor}`:"",l="5px",d=t.shadowColor?`0 2px 8px ${t.shadowColor}`:"";e.style.outline=a,e.style.borderRadius=l,e.style.color=o,e.style.backgroundColor=r,e.style.boxShadow=d}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(K(this.element,ee.MOUSE_UP,o=>{if(nt.stop(o,!0),Fr){if(new ra(Te(this.element),o).rightButton)return;this.onClick(o)}else setTimeout(()=>{this.onClick(o)},0)})),this._register(K(this.element,ee.CONTEXT_MENU,o=>{nt.stop(o,!0)})))},100),this._register(this.runOnceToEnableMouseUp)}render(e){super.render(e),this.element&&(this.container=e,this.item=Q(this.element,he("a.action-menu-item")),this._action.id===rn.ID?this.item.setAttribute("role","presentation"):(this.item.setAttribute("role","menuitem"),this.mnemonic&&this.item.setAttribute("aria-keyshortcuts",`${this.mnemonic}`)),this.check=Q(this.item,he("span.menu-item-check"+Pe.asCSSSelector(oe.menuSelection))),this.check.setAttribute("role","none"),this.label=Q(this.item,he("span.action-label")),this.options.label&&this.options.keybinding&&(Q(this.item,he("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(){var e;super.focus(),(e=this.item)===null||e===void 0||e.focus(),this.applyStyle()}updatePositionInSet(e,t){this.item&&(this.item.setAttribute("aria-posinset",`${e}`),this.item.setAttribute("aria-setsize",`${t}`))}updateLabel(){var e;if(this.label&&this.options.label){zn(this.label);let t=rj(this.action.label);if(t){const i=e1e(t);this.options.enableMnemonics||(t=i),this.label.setAttribute("aria-label",i.replace(/&&/g,"&"));const n=E2.exec(t);if(n){t=OS(t),zI.lastIndex=0;let o=zI.exec(t);for(;o&&o[1];)o=zI.exec(t);const r=a=>a.replace(/&&/g,"&");o?this.label.append(qL(r(t.substr(0,o.index))," "),he("u",{"aria-hidden":"true"},o[3]),kre(r(t.substr(o.index+o[0].length))," ")):this.label.innerText=r(t).trim(),(e=this.item)===null||e===void 0||e.setAttribute("aria-keyshortcuts",(n[1]?n[1]:n[3]).toLocaleLowerCase())}else this.label.innerText=t.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}`:"",o=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=o),this.check&&(this.check.style.color=t??"")}}class E6 extends Ej{constructor(e,t,i,n,o){super(e,e,n,o),this.submenuActions=t,this.parentData=i,this.submenuOptions=n,this.mysubmenu=null,this.submenuDisposables=this._register(new Y),this.mouseOver=!1,this.expandDirection=n&&n.expandDirection!==void 0?n.expandDirection:{horizontal:ND.Right,vertical:I2.Below},this.showScheduler=new Wt(()=>{this.mouseOver&&(this.cleanupExistingSubmenu(!1),this.createSubmenu(!1))},250),this.hideScheduler=new Wt(()=>{this.element&&!An(Xn(),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=Q(this.item,he("span.submenu-indicator"+Pe.asCSSSelector(oe.menuSubmenu))),this.submenuIndicator.setAttribute("aria-hidden","true")),this._register(K(this.element,ee.KEY_UP,t=>{const i=new Kt(t);(i.equals(17)||i.equals(3))&&(nt.stop(t,!0),this.createSubmenu(!0))})),this._register(K(this.element,ee.KEY_DOWN,t=>{const i=new Kt(t);Xn()===this.item&&(i.equals(17)||i.equals(3))&&nt.stop(t,!0)})),this._register(K(this.element,ee.MOUSE_OVER,t=>{this.mouseOver||(this.mouseOver=!0,this.showScheduler.schedule())})),this._register(K(this.element,ee.MOUSE_LEAVE,t=>{this.mouseOver=!1})),this._register(K(this.element,ee.FOCUS_OUT,t=>{this.element&&!An(Xn(),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 o={top:0,left:0};return o.left=pm(e.width,t.width,{position:n.horizontal===ND.Right?0:1,offset:i.left,size:i.width}),o.left>=i.left&&o.left{new Kt(c).equals(15)&&(nt.stop(c,!0),this.parentData.parent.focus(),this.cleanupExistingSubmenu(!0))})),this.submenuDisposables.add(K(this.submenuContainer,ee.KEY_DOWN,c=>{new Kt(c).equals(15)&&nt.stop(c,!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){var t;this.item&&((t=this.item)===null||t===void 0||t.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 I6 extends N_{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 e1e(s){const e=E2,t=e.exec(s);if(!t)return s;const i=!t[1];return s.replace(e,i?"$2$3":"").trim()}function T6(s){const e=ez()[s.id];return`.codicon-${s.id}:before { content: '\\${e.toString(16)}'; }`}function t1e(s,e){let t=` .monaco-menu { font-size: 13px; border-radius: 5px; min-width: 160px; } ${T6(oe.menuSelection)} ${T6(oe.menuSubmenu)} .monaco-menu .monaco-action-bar { text-align: right; overflow: hidden; white-space: nowrap; } .monaco-menu .monaco-action-bar .actions-container { display: flex; margin: 0 auto; padding: 0; width: 100%; justify-content: flex-end; } .monaco-menu .monaco-action-bar.vertical .actions-container { display: inline-block; } .monaco-menu .monaco-action-bar.reverse .actions-container { flex-direction: row-reverse; } .monaco-menu .monaco-action-bar .action-item { cursor: pointer; display: inline-block; transition: transform 50ms ease; position: relative; /* DO NOT REMOVE - this is the key to preventing the ghosting icon bug in Chrome 42 */ } .monaco-menu .monaco-action-bar .action-item.disabled { cursor: default; } .monaco-menu .monaco-action-bar .action-item .icon, .monaco-menu .monaco-action-bar .action-item .codicon { display: inline-block; } .monaco-menu .monaco-action-bar .action-item .codicon { display: flex; align-items: center; } .monaco-menu .monaco-action-bar .action-label { font-size: 11px; margin-right: 4px; } .monaco-menu .monaco-action-bar .action-item.disabled .action-label, .monaco-menu .monaco-action-bar .action-item.disabled .action-label:hover { color: var(--vscode-disabledForeground); } /* Vertical actions */ .monaco-menu .monaco-action-bar.vertical { text-align: left; } .monaco-menu .monaco-action-bar.vertical .action-item { display: block; } .monaco-menu .monaco-action-bar.vertical .action-label.separator { display: block; border-bottom: 1px solid var(--vscode-menu-separatorBackground); padding-top: 1px; padding: 30px; } .monaco-menu .secondary-actions .monaco-action-bar .action-label { margin-left: 6px; } /* Action Items */ .monaco-menu .monaco-action-bar .action-item.select-container { overflow: hidden; /* somehow the dropdown overflows its container, we prevent it here to not push */ flex: 1; max-width: 170px; min-width: 60px; display: flex; align-items: center; justify-content: center; margin-right: 10px; } .monaco-menu .monaco-action-bar.vertical { margin-left: 0; overflow: visible; } .monaco-menu .monaco-action-bar.vertical .actions-container { display: block; } .monaco-menu .monaco-action-bar.vertical .action-item { padding: 0; transform: none; display: flex; } .monaco-menu .monaco-action-bar.vertical .action-item.active { transform: none; } .monaco-menu .monaco-action-bar.vertical .action-menu-item { flex: 1 1 auto; display: flex; height: 2em; align-items: center; position: relative; margin: 0 4px; border-radius: 4px; } .monaco-menu .monaco-action-bar.vertical .action-menu-item:hover .keybinding, .monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .keybinding { opacity: unset; } .monaco-menu .monaco-action-bar.vertical .action-label { flex: 1 1 auto; text-decoration: none; padding: 0 1em; background: none; font-size: 12px; line-height: 1; } .monaco-menu .monaco-action-bar.vertical .keybinding, .monaco-menu .monaco-action-bar.vertical .submenu-indicator { display: inline-block; flex: 2 1 auto; padding: 0 1em; text-align: right; font-size: 12px; line-height: 1; } .monaco-menu .monaco-action-bar.vertical .submenu-indicator { height: 100%; } .monaco-menu .monaco-action-bar.vertical .submenu-indicator.codicon { font-size: 16px !important; display: flex; align-items: center; } .monaco-menu .monaco-action-bar.vertical .submenu-indicator.codicon::before { margin-left: auto; margin-right: -20px; } .monaco-menu .monaco-action-bar.vertical .action-item.disabled .keybinding, .monaco-menu .monaco-action-bar.vertical .action-item.disabled .submenu-indicator { opacity: 0.4; } .monaco-menu .monaco-action-bar.vertical .action-label:not(.separator) { display: inline-block; box-sizing: border-box; margin: 0; } .monaco-menu .monaco-action-bar.vertical .action-item { position: static; overflow: visible; } .monaco-menu .monaco-action-bar.vertical .action-item .monaco-submenu { position: absolute; } .monaco-menu .monaco-action-bar.vertical .action-label.separator { width: 100%; height: 0px !important; opacity: 1; } .monaco-menu .monaco-action-bar.vertical .action-label.separator.text { padding: 0.7em 1em 0.1em 1em; font-weight: bold; opacity: 1; } .monaco-menu .monaco-action-bar.vertical .action-label:hover { color: inherit; } .monaco-menu .monaco-action-bar.vertical .menu-item-check { position: absolute; visibility: hidden; width: 1em; height: 100%; } .monaco-menu .monaco-action-bar.vertical .action-menu-item.checked .menu-item-check { visibility: visible; display: flex; align-items: center; justify-content: center; } /* Context Menu */ .context-view.monaco-menu-container { outline: 0; border: none; animation: fadeIn 0.083s linear; -webkit-app-region: no-drag; } .context-view.monaco-menu-container :focus, .context-view.monaco-menu-container .monaco-action-bar.vertical:focus, .context-view.monaco-menu-container .monaco-action-bar.vertical :focus { outline: 0; } .hc-black .context-view.monaco-menu-container, .hc-light .context-view.monaco-menu-container, :host-context(.hc-black) .context-view.monaco-menu-container, :host-context(.hc-light) .context-view.monaco-menu-container { box-shadow: none; } .hc-black .monaco-menu .monaco-action-bar.vertical .action-item.focused, .hc-light .monaco-menu .monaco-action-bar.vertical .action-item.focused, :host-context(.hc-black) .monaco-menu .monaco-action-bar.vertical .action-item.focused, :host-context(.hc-light) .monaco-menu .monaco-action-bar.vertical .action-item.focused { background: none; } /* Vertical Action Bar Styles */ .monaco-menu .monaco-action-bar.vertical { padding: 4px 0; } .monaco-menu .monaco-action-bar.vertical .action-menu-item { height: 2em; } .monaco-menu .monaco-action-bar.vertical .action-label:not(.separator), .monaco-menu .monaco-action-bar.vertical .keybinding { font-size: inherit; padding: 0 2em; max-height: 100%; } .monaco-menu .monaco-action-bar.vertical .menu-item-check { font-size: inherit; width: 2em; } .monaco-menu .monaco-action-bar.vertical .action-label.separator { font-size: inherit; margin: 5px 0 !important; padding: 0; border-radius: 0; } .linux .monaco-menu .monaco-action-bar.vertical .action-label.separator, :host-context(.linux) .monaco-menu .monaco-action-bar.vertical .action-label.separator { margin-left: 0; margin-right: 0; } .monaco-menu .monaco-action-bar.vertical .submenu-indicator { font-size: 60%; padding: 0 1.8em; } .linux .monaco-menu .monaco-action-bar.vertical .submenu-indicator, :host-context(.linux) .monaco-menu .monaco-action-bar.vertical .submenu-indicator { height: 100%; mask-size: 10px 10px; -webkit-mask-size: 10px 10px; } .monaco-menu .action-item { cursor: default; }`;if(e){t+=` /* Arrows */ .monaco-scrollable-element > .scrollbar > .scra { cursor: pointer; font-size: 11px !important; } .monaco-scrollable-element > .visible { opacity: 1; /* Background rule added for IE9 - to allow clicks on dom node */ background:rgba(0,0,0,0); transition: opacity 100ms linear; } .monaco-scrollable-element > .invisible { opacity: 0; pointer-events: none; } .monaco-scrollable-element > .invisible.fade { transition: opacity 800ms linear; } /* Scrollable Content Inset Shadow */ .monaco-scrollable-element > .shadow { position: absolute; display: none; } .monaco-scrollable-element > .shadow.top { display: block; top: 0; left: 3px; height: 3px; width: 100%; } .monaco-scrollable-element > .shadow.left { display: block; top: 3px; left: 0; height: 100%; width: 3px; } .monaco-scrollable-element > .shadow.top-left-corner { display: block; top: 0; left: 0; height: 3px; width: 3px; } `;const i=s.scrollbarShadow;i&&(t+=` .monaco-scrollable-element > .shadow.top { box-shadow: ${i} 0 6px 6px -6px inset; } .monaco-scrollable-element > .shadow.left { box-shadow: ${i} 6px 0 6px -6px inset; } .monaco-scrollable-element > .shadow.top.left { box-shadow: ${i} 6px 6px 6px -6px inset; } `);const n=s.scrollbarSliderBackground;n&&(t+=` .monaco-scrollable-element > .scrollbar > .slider { background: ${n}; } `);const o=s.scrollbarSliderHoverBackground;o&&(t+=` .monaco-scrollable-element > .scrollbar > .slider:hover { background: ${o}; } `);const r=s.scrollbarSliderActiveBackground;r&&(t+=` .monaco-scrollable-element > .scrollbar > .slider.active { background: ${r}; } `)}return t}class i1e{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=Xn();let i;const n=e.domForShadowRoot instanceof HTMLElement?e.domForShadowRoot:void 0;this.contextViewService.showContextView({getAnchor:()=>e.getAnchor(),canRelayout:!1,anchorAlignment:e.anchorAlignment,anchorAxisAlignment:e.anchorAxisAlignment,render:o=>{var r;this.lastContainer=o;const a=e.getMenuClassName?e.getMenuClassName():"";a&&(o.className+=" "+a),this.options.blockMouse&&(this.block=o.appendChild(he(".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",(r=this.blockDisposable)===null||r===void 0||r.dispose(),this.blockDisposable=K(this.block,ee.MOUSE_DOWN,u=>u.stopPropagation()));const l=new Y,d=e.actionRunner||new Df;d.onWillRun(u=>this.onActionRun(u,!e.skipTelemetry),this,l),d.onDidRun(this.onDidActionRun,this,l),i=new qm(o,t,{actionViewItemProvider:e.getActionViewItem,context:e.getActionsContext?e.getActionsContext():null,actionRunner:d,getKeyBinding:e.getKeyBinding?e.getKeyBinding:u=>this.keybindingService.lookupKeybinding(u.id)},QCe),i.onDidCancel(()=>this.contextViewService.hideContextView(!0),null,l),i.onDidBlur(()=>this.contextViewService.hideContextView(!0),null,l);const c=Te(o);return l.add(K(c,ee.BLUR,()=>this.contextViewService.hideContextView(!0))),l.add(K(c,ee.MOUSE_DOWN,u=>{if(u.defaultPrevented)return;const h=new ra(c,u);let g=h.target;if(!h.rightButton){for(;g;){if(g===o)return;g=g.parentElement}this.contextViewService.hideContextView(!0)}})),ha(l,i)},focus:()=>{i==null||i.focus(!!e.autoSelectFirstItem)},onHide:o=>{var r,a,l;(r=e.onHide)===null||r===void 0||r.call(e,!!o),this.block&&(this.block.remove(),this.block=null),(a=this.blockDisposable)===null||a===void 0||a.dispose(),this.blockDisposable=null,this.lastContainer&&(Xn()===this.lastContainer||An(Xn(),this.lastContainer))&&((l=this.focusToReturn)===null||l===void 0||l.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&&!Id(e.error)&&this.notificationService.error(e.error)}}var n1e=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Ap=function(s,e){return function(t,i){e(t,i,s)}};let T2=class extends H{get contextMenuHandler(){return this._contextMenuHandler||(this._contextMenuHandler=new i1e(this.contextViewService,this.telemetryService,this.notificationService,this.keybindingService)),this._contextMenuHandler}constructor(e,t,i,n,o,r){super(),this.telemetryService=e,this.notificationService=t,this.contextViewService=i,this.keybindingService=n,this.menuService=o,this.contextKeyService=r,this._contextMenuHandler=void 0,this._onDidShowContextMenu=this._store.add(new B),this.onDidShowContextMenu=this._onDidShowContextMenu.event,this._onDidHideContextMenu=this._store.add(new B)}configure(e){this.contextMenuHandler.configure(e)}showContextMenu(e){e=N2.transform(e,this.menuService,this.contextKeyService),this.contextMenuHandler.showContextMenu({...e,onHide:t=>{var i;(i=e.onHide)===null||i===void 0||i.call(e,t),this._onDidHideContextMenu.fire()}}),hc.getInstance().resetKeyStatus(),this._onDidShowContextMenu.fire()}};T2=n1e([Ap(0,Gs),Ap(1,en),Ap(2,nu),Ap(3,At),Ap(4,hr),Ap(5,Be)],T2);var N2;(function(s){function e(i){return i&&i.menuId instanceof E}function t(i,n,o){if(!e(i))return i;const{menuId:r,menuActionOptions:a,contextKeyService:l}=i;return{...i,getActions:()=>{const d=[];if(r){const c=n.createMenu(r,l??o);JCe(c,a,d),c.dispose()}return i.getActions?rn.join(i.getActions(),d):d}}}s.transform=t})(N2||(N2={}));var AD;(function(s){s[s.API=0]="API",s[s.USER=1]="USER"})(AD||(AD={}));var xO=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},MD=function(s,e){return function(t,i){e(t,i,s)}};let A2=class{constructor(e){this._commandService=e}async open(e,t){if(!rF(e,Ge.command))return!1;if(!(t!=null&&t.allowCommands)||(typeof e=="string"&&(e=Ae.parse(e)),Array.isArray(t.allowCommands)&&!t.allowCommands.includes(e.path)))return!0;let i=[];try{i=u2(decodeURIComponent(e.query))}catch{try{i=u2(e.query)}catch{}}return Array.isArray(i)||(i=[i]),await this._commandService.executeCommand(e.path,...i),!0}};A2=xO([MD(0,gi)],A2);let M2=class{constructor(e){this._editorService=e}async open(e,t){typeof e=="string"&&(e=Ae.parse(e));const{selection:i,uri:n}=J0e(e);return e=n,e.scheme===Ge.file&&(e=yme(e)),await this._editorService.openCodeEditor({resource:e,options:{selection:i,source:t!=null&&t.fromUserGesture?AD.USER:AD.API,...t==null?void 0:t.editorOptions}},this._editorService.getFocusedCodeEditor(),t==null?void 0:t.openToSide),!0}};M2=xO([MD(0,xt)],M2);let R2=class{constructor(e,t){this._openers=new Rs,this._validators=new Rs,this._resolvers=new Rs,this._resolvedUriTargets=new Wi(i=>i.with({path:null,fragment:null,query:null}).toString()),this._externalOpeners=new Rs,this._defaultExternalOpener={openExternal:async i=>(_3(i,Ge.http,Ge.https)?Pz(i):Ht.location.href=i,!0)},this._openers.push({open:async(i,n)=>n!=null&&n.openExternal||_3(i,Ge.mailto,Ge.http,Ge.https,Ge.vsls)?(await this._doOpenExternal(i,n),!0):!1}),this._openers.push(new A2(t)),this._openers.push(new M2(e))}registerOpener(e){return{dispose:this._openers.unshift(e)}}async open(e,t){var i;const n=typeof e=="string"?Ae.parse(e):e,o=(i=this._resolvedUriTargets.get(n))!==null&&i!==void 0?i:e;for(const r of this._validators)if(!await r.shouldOpen(o,t))return!1;for(const r of this._openers)if(await r.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"?Ae.parse(e):e;let n;try{n=(await this.resolveExternalUri(i,t)).resolved}catch{n=i}let o;if(typeof e=="string"&&i.toString()===n.toString()?o=e:o=encodeURI(n.toString(!0)),t!=null&&t.allowContributedOpeners){const r=typeof(t==null?void 0:t.allowContributedOpeners)=="string"?t==null?void 0:t.allowContributedOpeners:void 0;for(const a of this._externalOpeners)if(await a.openExternal(o,{sourceUri:i,preferredOpenerId:r},dt.None))return!0}return this._defaultExternalOpener.openExternal(o,{sourceUri:i},dt.None)}dispose(){this._validators.clear()}};R2=xO([MD(0,xt),MD(1,gi)],R2);const jr=ut("editorWorkerService");var Li;(function(s){s[s.Hint=1]="Hint",s[s.Info=2]="Info",s[s.Warning=4]="Warning",s[s.Error=8]="Error"})(Li||(Li={}));(function(s){function e(r,a){return a-r}s.compare=e;const t=Object.create(null);t[s.Error]=p("sev.error","Error"),t[s.Warning]=p("sev.warning","Warning"),t[s.Info]=p("sev.info","Info");function i(r){return t[r]||""}s.toString=i;function n(r){switch(r){case Bi.Error:return s.Error;case Bi.Warning:return s.Warning;case Bi.Info:return s.Info;case Bi.Ignore:return s.Hint}}s.fromSeverity=n;function o(r){switch(r){case s.Error:return Bi.Error;case s.Warning:return Bi.Warning;case s.Info:return Bi.Info;case s.Hint:return Bi.Ignore}}s.toSeverity=o})(Li||(Li={}));var RD;(function(s){const e="";function t(n){return i(n,!0)}s.makeKey=t;function i(n,o){const r=[e];return n.source?r.push(n.source.replace("¦","\\¦")):r.push(e),n.code?typeof n.code=="string"?r.push(n.code.replace("¦","\\¦")):r.push(n.code.value.replace("¦","\\¦")):r.push(e),n.severity!==void 0&&n.severity!==null?r.push(Li.toString(n.severity)):r.push(e),n.message&&o?r.push(n.message.replace("¦","\\¦")):r.push(e),n.startLineNumber!==void 0&&n.startLineNumber!==null?r.push(n.startLineNumber.toString()):r.push(e),n.startColumn!==void 0&&n.startColumn!==null?r.push(n.startColumn.toString()):r.push(e),n.endLineNumber!==void 0&&n.endLineNumber!==null?r.push(n.endLineNumber.toString()):r.push(e),n.endColumn!==void 0&&n.endColumn!==null?r.push(n.endColumn.toString()):r.push(e),r.push(e),r.join("¦")}s.makeKeyOptionalMessage=i})(RD||(RD={}));const Pd=ut("markerService");function s1e(s,e){const t=[],i=[];for(const n of s)e.has(n)||t.push(n);for(const n of e)s.has(n)||i.push(n);return{removed:t,added:i}}function o1e(s,e){const t=new Set;for(const i of e)s.has(i)&&t.add(i);return t}var r1e=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},N6=function(s,e){return function(t,i){e(t,i,s)}};let P2=class extends H{constructor(e,t){super(),this._markerService=t,this._onDidChangeMarker=this._register(new B),this._markerDecorations=new Wi,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 a1e(e);this._markerDecorations.set(e.uri,t),this._updateDecorations(t)}_onModelRemoved(e){var t;const i=this._markerDecorations.get(e.uri);i&&(i.dispose(),this._markerDecorations.delete(e.uri)),(e.uri.scheme===Ge.inMemory||e.uri.scheme===Ge.internal||e.uri.scheme===Ge.vscode)&&((t=this._markerService)===null||t===void 0||t.read({resource:e.uri}).map(n=>n.owner).forEach(n=>this._markerService.remove(n,[e.uri])))}_updateDecorations(e){const t=this._markerService.read({resource:e.model.uri,take:500});e.update(t)&&this._onDidChangeMarker.fire(e.model)}};P2=r1e([N6(0,_i),N6(1,Pd)],P2);class a1e extends H{constructor(e){super(),this.model=e,this._map=new Vde,this._register(Ie(()=>{this.model.deltaDecorations([...this._map.values()],[]),this._map.clear()}))}update(e){const{added:t,removed:i}=s1e(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)),o=t.map(a=>({range:this._createDecorationRange(this.model,a),options:this._createDecorationOption(a)})),r=this.model.deltaDecorations(n,o);for(const a of i)this._map.delete(a);for(let a=0;a=n)return i;const o=e.getWordAtPosition(i.getStartPosition());o&&(i=new x(i.startLineNumber,o.startColumn,i.endLineNumber,o.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 l1e=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},G0=function(s,e){return function(t,i){e(t,i,s)}},Up;function Sg(s){return s.toString()}class d1e{constructor(e,t,i){this.model=e,this._modelEventListeners=new Y,this.model=e,this._modelEventListeners.add(e.onWillDispose(()=>t(e))),this._modelEventListeners.add(e.onDidChangeLanguage(n=>i(e,n)))}dispose(){this._modelEventListeners.dispose()}}const c1e=$s||lt?1:2;class u1e{constructor(e,t,i,n,o,r,a,l){this.uri=e,this.initialUndoRedoSnapshot=t,this.time=i,this.sharesUndoRedoStack=n,this.heapSize=o,this.sha1=r,this.versionId=a,this.alternativeVersionId=l}}let PD=Up=class extends H{constructor(e,t,i,n,o){super(),this._configurationService=e,this._resourcePropertiesService=t,this._undoRedoService=i,this._languageService=n,this._languageConfigurationService=o,this._onModelAdded=this._register(new B),this.onModelAdded=this._onModelAdded.event,this._onModelRemoved=this._register(new B),this.onModelRemoved=this._onModelRemoved.event,this._onModelModeChanged=this._register(new B),this.onModelLanguageChanged=this._onModelModeChanged.event,this._modelCreationOptionsByLanguageAndResource=Object.create(null),this._models={},this._disposedModels=new Map,this._disposedModelsHeapSize=0,this._register(this._configurationService.onDidChangeConfiguration(r=>this._updateModelOptions(r))),this._updateModelOptions(void 0)}static _readModelOptions(e,t){var i;let n=ns.tabSize;if(e.editor&&typeof e.editor.tabSize<"u"){const g=parseInt(e.editor.tabSize,10);isNaN(g)||(n=g),n<1&&(n=1)}let o="tabSize";if(e.editor&&typeof e.editor.indentSize<"u"&&e.editor.indentSize!=="tabSize"){const g=parseInt(e.editor.indentSize,10);isNaN(g)||(o=Math.max(g,1))}let r=ns.insertSpaces;e.editor&&typeof e.editor.insertSpaces<"u"&&(r=e.editor.insertSpaces==="false"?!1:!!e.editor.insertSpaces);let a=c1e;const l=e.eol;l===`\r `?a=2:l===` `&&(a=1);let d=ns.trimAutoWhitespace;e.editor&&typeof e.editor.trimAutoWhitespace<"u"&&(d=e.editor.trimAutoWhitespace==="false"?!1:!!e.editor.trimAutoWhitespace);let c=ns.detectIndentation;e.editor&&typeof e.editor.detectIndentation<"u"&&(c=e.editor.detectIndentation==="false"?!1:!!e.editor.detectIndentation);let u=ns.largeFileOptimizations;e.editor&&typeof e.editor.largeFileOptimizations<"u"&&(u=e.editor.largeFileOptimizations==="false"?!1:!!e.editor.largeFileOptimizations);let h=ns.bracketPairColorizationOptions;return!((i=e.editor)===null||i===void 0)&&i.bracketPairColorization&&typeof e.editor.bracketPairColorization=="object"&&(h={enabled:!!e.editor.bracketPairColorization.enabled,independentColorPoolPerBracketType:!!e.editor.bracketPairColorization.independentColorPoolPerBracketType}),{isForSimpleWidget:t,tabSize:n,indentSize:o,insertSpaces:r,detectIndentation:c,defaultEOL:a,trimAutoWhitespace:d,largeFileOptimizations:u,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 o=this._modelCreationOptionsByLanguageAndResource[n+t];if(!o){const r=this._configurationService.getValue("editor",{overrideIdentifier:n,resource:t}),a=this._getEOL(t,n);o=Up._readModelOptions({editor:r,eol:a},i),this._modelCreationOptionsByLanguageAndResource[n+t]=o}return o}_updateModelOptions(e){const t=this._modelCreationOptionsByLanguageAndResource;this._modelCreationOptionsByLanguageAndResource=Object.create(null);const i=Object.keys(this._models);for(let n=0,o=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 o=this.getCreationOptions(t,i,n),r=new wd(e,t,o,i,this._undoRedoService,this._languageService,this._languageConfigurationService);if(i&&this._disposedModels.has(Sg(i))){const d=this._removeDisposedModel(i),c=this._undoRedoService.getElements(i),u=this._getSHA1Computer(),h=u.canComputeSHA1(r)?u.computeSHA1(r)===d.sha1:!1;if(h||d.sharesUndoRedoStack){for(const g of c.past)tc(g)&&g.matchesResource(i)&&g.setModel(r);for(const g of c.future)tc(g)&&g.matchesResource(i)&&g.setModel(r);this._undoRedoService.setElementsValidFlag(i,!0,g=>tc(g)&&g.matchesResource(i)),h&&(r._overwriteVersionId(d.versionId),r._overwriteAlternativeVersionId(d.alternativeVersionId),r._overwriteInitialUndoRedoSnapshot(d.initialUndoRedoSnapshot))}else d.initialUndoRedoSnapshot!==null&&this._undoRedoService.restoreSnapshot(d.initialUndoRedoSnapshot)}const a=Sg(r.uri);if(this._models[a])throw new Error("ModelService: Cannot add model because it already exists!");const l=new d1e(r,d=>this._onWillDispose(d),(d,c)=>this._onDidChangeLanguage(d,c));return this._models[a]=l,l}createModel(e,t,i,n=!1){let o;return t?o=this._createModelData(e,t,i,n):o=this._createModelData(e,ir,i,n),this._onModelAdded.fire(o.model),o.model}getModels(){const e=[],t=Object.keys(this._models);for(let i=0,n=t.length;i0||d.future.length>0){for(const c of d.past)tc(c)&&c.matchesResource(e.uri)&&(o=!0,r+=c.heapSize(e.uri),c.setModel(e.uri));for(const c of d.future)tc(c)&&c.matchesResource(e.uri)&&(o=!0,r+=c.heapSize(e.uri),c.setModel(e.uri))}}const a=Up.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK,l=this._getSHA1Computer();if(o)if(!n&&(r>a||!l.canComputeSHA1(e))){const d=i.model.getInitialUndoRedoSnapshot();d!==null&&this._undoRedoService.restoreSnapshot(d)}else this._ensureDisposedModelsHeapSize(a-r),this._undoRedoService.setElementsValidFlag(e.uri,!1,d=>tc(d)&&d.matchesResource(e.uri)),this._insertDisposedModel(new u1e(e.uri,i.model.getInitialUndoRedoSnapshot(),Date.now(),n,r,l.computeSHA1(e),e.getVersionId(),e.getAlternativeVersionId()));else if(!n){const d=i.model.getInitialUndoRedoSnapshot();d!==null&&this._undoRedoService.restoreSnapshot(d)}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(),o=this.getCreationOptions(i,e.uri,e.isForSimpleWidget),r=this.getCreationOptions(n,e.uri,e.isForSimpleWidget);Up._setModelOptionsForModel(e,r,o),this._onModelModeChanged.fire({model:e,oldLanguageId:i})}_getSHA1Computer(){return new Jx}};PD.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK=20*1024*1024;PD=Up=l1e([G0(0,rt),G0(1,pU),G0(2,Mx),G0(3,vi),G0(4,Yt)],PD);class Jx{canComputeSHA1(e){return e.getValueLength()<=Jx.MAX_MODEL_SIZE}computeSHA1(e){const t=new QL,i=e.createSnapshot();let n;for(;n=i.read();)t.update(n);return t.digest()}}Jx.MAX_MODEL_SIZE=10*1024*1024;var F2;(function(s){s[s.PRESERVE=0]="PRESERVE",s[s.LAST=1]="LAST"})(F2||(F2={}));const Ij={Quickaccess:"workbench.contributions.quickaccess"};class h1e{constructor(){this.providers=[],this.defaultProvider=void 0}registerQuickAccessProvider(e){return e.prefix.length===0?this.defaultProvider=e:this.providers.push(e),this.providers.sort((t,i)=>i.prefix.length-t.prefix.length),Ie(()=>{this.providers.splice(this.providers.indexOf(e),1),this.defaultProvider===e&&(this.defaultProvider=void 0)})}getQuickAccessProviders(){return pd([this.defaultProvider,...this.providers])}getQuickAccessProvider(e){return e&&this.providers.find(i=>e.startsWith(i.prefix))||void 0||this.defaultProvider}}Ji.add(Ij.Quickaccess,new h1e);const g1e={ctrlCmd:!1,alt:!1};var A_;(function(s){s[s.Blur=1]="Blur",s[s.Gesture=2]="Gesture",s[s.Other=3]="Other"})(A_||(A_={}));var Rl;(function(s){s[s.NONE=0]="NONE",s[s.FIRST=1]="FIRST",s[s.SECOND=2]="SECOND",s[s.LAST=3]="LAST"})(Rl||(Rl={}));const hp=ut("quickInputService");var f1e=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},A6=function(s,e){return function(t,i){e(t,i,s)}};let O2=class extends H{constructor(e,t){super(),this.quickInputService=e,this.instantiationService=t,this.registry=Ji.as(Ij.Quickaccess),this.mapProviderToDescriptor=new Map,this.lastAcceptedPickerValues=new Map,this.visibleQuickAccess=void 0}show(e="",t){this.doShowOrPick(e,!1,t)}doShowOrPick(e,t,i){var n,o,r;const[a,l]=this.getOrInstantiateProvider(e),d=this.visibleQuickAccess,c=d==null?void 0:d.descriptor;if(d&&l&&c===l){e!==l.prefix&&!(i!=null&&i.preserveValue)&&(d.picker.value=e),this.adjustValueSelection(d.picker,l,i);return}if(l&&!(i!=null&&i.preserveValue)){let v;if(d&&c&&c!==l){const b=d.value.substr(c.prefix.length);b&&(v=`${l.prefix}${b}`)}if(!v){const b=a==null?void 0:a.defaultFilterValue;b===F2.LAST?v=this.lastAcceptedPickerValues.get(l):typeof b=="string"&&(v=`${l.prefix}${b}`)}typeof v=="string"&&(e=v)}const u=(n=d==null?void 0:d.picker)===null||n===void 0?void 0:n.valueSelection,h=(o=d==null?void 0:d.picker)===null||o===void 0?void 0:o.value,g=new Y,f=g.add(this.quickInputService.createQuickPick());f.value=e,this.adjustValueSelection(f,l,i),f.placeholder=l==null?void 0:l.placeholder,f.quickNavigate=i==null?void 0:i.quickNavigateConfiguration,f.hideInput=!!f.quickNavigate&&!d,(typeof(i==null?void 0:i.itemActivation)=="number"||i!=null&&i.quickNavigateConfiguration)&&(f.itemActivation=(r=i==null?void 0:i.itemActivation)!==null&&r!==void 0?r:Rl.SECOND),f.contextKey=l==null?void 0:l.contextKey,f.filterValue=v=>v.substring(l?l.prefix.length:0);let m;t&&(m=new ZL,g.add(le.once(f.onWillAccept)(v=>{v.veto(),f.hide()}))),g.add(this.registerPickerListeners(f,a,l,e,i==null?void 0:i.providerOptions));const _=g.add(new Vi);if(a&&g.add(a.provide(f,_.token,i==null?void 0:i.providerOptions)),le.once(f.onDidHide)(()=>{f.selectedItems.length===0&&_.cancel(),g.dispose(),m==null||m.complete(f.selectedItems.slice(0))}),f.show(),u&&h===e&&(f.valueSelection=u),t)return m==null?void 0:m.p}adjustValueSelection(e,t,i){var n;let o;i!=null&&i.preserveValue?o=[e.value.length,e.value.length]:o=[(n=t==null?void 0:t.prefix.length)!==null&&n!==void 0?n:0,e.value.length],e.valueSelection=o}registerPickerListeners(e,t,i,n,o){const r=new Y,a=this.visibleQuickAccess={picker:e,descriptor:i,value:n};return r.add(Ie(()=>{a===this.visibleQuickAccess&&(this.visibleQuickAccess=void 0)})),r.add(e.onDidChangeValue(l=>{const[d]=this.getOrInstantiateProvider(l);d!==t?this.show(l,{preserveValue:!0,providerOptions:o}):a.value=l})),i&&r.add(e.onDidAccept(()=>{this.lastAcceptedPickerValues.set(i,e.value)})),r}getOrInstantiateProvider(e){const t=this.registry.getQuickAccessProvider(e);if(!t)return[void 0,void 0];let i=this.mapProviderToDescriptor.get(t);return i||(i=this.instantiationService.createInstance(t.ctor),this.mapProviderToDescriptor.set(t,i)),[i,t]}};O2=f1e([A6(0,hp),A6(1,Ne)],O2);class f0 extends fr{constructor(e){var t;super(),this._onChange=this._register(new B),this.onChange=this._onChange.event,this._onKeyDown=this._register(new B),this.onKeyDown=this._onKeyDown.event,this._opts=e,this._checked=this._opts.isChecked;const i=["monaco-custom-toggle"];this._opts.icon&&(this._icon=this._opts.icon,i.push(...Pe.asClassNameArray(this._icon))),this._opts.actionClassName&&i.push(...this._opts.actionClassName.split(" ")),this._checked&&i.push("checked"),this.domNode=document.createElement("div"),this._hover=this._register(_l().setupUpdatableHover((t=e.hoverDelegate)!==null&&t!==void 0?t:Xs("mouse"),this.domNode,this._opts.title)),this.domNode.classList.add(...i),this._opts.notFocusable||(this.domNode.tabIndex=0),this.domNode.setAttribute("role","checkbox"),this.domNode.setAttribute("aria-checked",String(this._checked)),this.domNode.setAttribute("aria-label",this._opts.title),this.applyStyles(),this.onclick(this.domNode,n=>{this.enabled&&(this.checked=!this._checked,this._onChange.fire(!1),n.preventDefault())}),this._register(this.ignoreGesture(this.domNode)),this.onkeydown(this.domNode,n=>{if(n.keyCode===10||n.keyCode===3){this.checked=!this._checked,this._onChange.fire(!0),n.preventDefault(),n.stopPropagation();return}this._onKeyDown.fire(n)})}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()}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))}disable(){this.domNode.setAttribute("aria-disabled",String(!0))}}var p1e=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};class Tj{constructor(e){this.nodes=e}toString(){return this.nodes.map(e=>typeof e=="string"?e:e.label).join("")}}p1e([zi],Tj.prototype,"toString",null);const m1e=/\[([^\]]+)\]\(((?:https?:\/\/|command:|file:)[^\)\s]+)(?: (["'])(.+?)(\3))?\)/gi;function _1e(s){const e=[];let t=0,i;for(;i=m1e.exec(s);){i.index-t>0&&e.push(s.substring(t,i.index));const[,n,o,,r]=i;r?e.push({label:n,href:o,title:r}):e.push({label:n,href:o}),t=i.index+i[0].length}return t{jae(g)&&nt.stop(g,!0),t.callback(o.href)},d=t.disposables.add(new ht(a,ee.CLICK)).event,c=t.disposables.add(new ht(a,ee.KEY_DOWN)).event,u=le.chain(c,g=>g.filter(f=>{const m=new Kt(f);return m.equals(10)||m.equals(3)}));t.disposables.add(Gt.addTarget(a));const h=t.disposables.add(new ht(a,Xt.Tap)).event;le.any(d,h,u)(l,null,t.disposables),e.appendChild(a)}}class w1e{get templateId(){return this.renderer.templateId}constructor(e,t){this.renderer=e,this.modelProvider=t}renderTemplate(e){return{data:this.renderer.renderTemplate(e),disposable:H.None}}renderElement(e,t,i,n){var o;if((o=i.disposable)===null||o===void 0||o.dispose(),!i.data)return;const r=this.modelProvider();if(r.isResolved(e))return this.renderer.renderElement(r.get(e),e,i.data,n);const a=new Vi,l=r.resolve(e,a.token);i.disposable={dispose:()=>a.cancel()},this.renderer.renderPlaceholder(e,i.data),l.then(d=>this.renderer.renderElement(d,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 y1e{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 S1e(s,e){return{...e,accessibilityProvider:e.accessibilityProvider&&new y1e(s,e.accessibilityProvider)}}class D1e{constructor(e,t,i,n,o={}){const r=()=>this.model,a=n.map(l=>new w1e(l,r));this.list=new pr(e,t,i,a,S1e(r,o))}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 le.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 le.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 le.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._model=e,this.list.splice(0,this.list.length,to(e.length))}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()}}var p0=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};const L1e=!1;var OD;(function(s){s.North="north",s.South="south",s.East="east",s.West="west"})(OD||(OD={}));let x1e=4;const k1e=new B;let E1e=300;const I1e=new B;class kO{constructor(e){this.el=e,this.disposables=new Y}get onPointerMove(){return this.disposables.add(new ht(Te(this.el),"mousemove")).event}get onPointerUp(){return this.disposables.add(new ht(Te(this.el),"mouseup")).event}dispose(){this.disposables.dispose()}}p0([zi],kO.prototype,"onPointerMove",null);p0([zi],kO.prototype,"onPointerUp",null);class EO{get onPointerMove(){return this.disposables.add(new ht(this.el,Xt.Change)).event}get onPointerUp(){return this.disposables.add(new ht(this.el,Xt.End)).event}constructor(e){this.el=e,this.disposables=new Y}dispose(){this.disposables.dispose()}}p0([zi],EO.prototype,"onPointerMove",null);p0([zi],EO.prototype,"onPointerUp",null);class BD{get onPointerMove(){return this.factory.onPointerMove}get onPointerUp(){return this.factory.onPointerUp}constructor(e){this.factory=e}dispose(){}}p0([zi],BD.prototype,"onPointerMove",null);p0([zi],BD.prototype,"onPointerUp",null);const M6="pointer-events-disabled";class is extends H{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))}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=Q(this.el,he(".orthogonal-drag-handle.start")),this.orthogonalStartDragHandleDisposables.add(Ie(()=>this._orthogonalStartDragHandle.remove())),this.orthogonalStartDragHandleDisposables.add(new ht(this._orthogonalStartDragHandle,"mouseenter")).event(()=>is.onMouseEnter(e),void 0,this.orthogonalStartDragHandleDisposables),this.orthogonalStartDragHandleDisposables.add(new ht(this._orthogonalStartDragHandle,"mouseleave")).event(()=>is.onMouseLeave(e),void 0,this.orthogonalStartDragHandleDisposables))};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=Q(this.el,he(".orthogonal-drag-handle.end")),this.orthogonalEndDragHandleDisposables.add(Ie(()=>this._orthogonalEndDragHandle.remove())),this.orthogonalEndDragHandleDisposables.add(new ht(this._orthogonalEndDragHandle,"mouseenter")).event(()=>is.onMouseEnter(e),void 0,this.orthogonalEndDragHandleDisposables),this.orthogonalEndDragHandleDisposables.add(new ht(this._orthogonalEndDragHandle,"mouseleave")).event(()=>is.onMouseLeave(e),void 0,this.orthogonalEndDragHandleDisposables))};this.orthogonalEndSashDisposables.add(e.onDidEnablementChange.event(t,this)),t(e.state)}this._orthogonalEndSash=e}}constructor(e,t,i){super(),this.hoverDelay=E1e,this.hoverDelayer=this._register(new _a(this.hoverDelay)),this._state=3,this.onDidEnablementChange=this._register(new B),this._onDidStart=this._register(new B),this._onDidChange=this._register(new B),this._onDidReset=this._register(new B),this._onDidEnd=this._register(new B),this.orthogonalStartSashDisposables=this._register(new Y),this.orthogonalStartDragHandleDisposables=this._register(new Y),this.orthogonalEndSashDisposables=this._register(new Y),this.orthogonalEndDragHandleDisposables=this._register(new Y),this.onDidStart=this._onDidStart.event,this.onDidChange=this._onDidChange.event,this.onDidReset=this._onDidReset.event,this.onDidEnd=this._onDidEnd.event,this.linkedSash=void 0,this.el=Q(e,he(".monaco-sash")),i.orthogonalEdge&&this.el.classList.add(`orthogonal-edge-${i.orthogonalEdge}`),lt&&this.el.classList.add("mac");const n=this._register(new ht(this.el,"mousedown")).event;this._register(n(u=>this.onPointerStart(u,new kO(e)),this));const o=this._register(new ht(this.el,"dblclick")).event;this._register(o(this.onPointerDoublePress,this));const r=this._register(new ht(this.el,"mouseenter")).event;this._register(r(()=>is.onMouseEnter(this)));const a=this._register(new ht(this.el,"mouseleave")).event;this._register(a(()=>is.onMouseLeave(this))),this._register(Gt.addTarget(this.el));const l=this._register(new ht(this.el,Xt.Start)).event;this._register(l(u=>this.onPointerStart(u,new EO(this.el)),this));const d=this._register(new ht(this.el,Xt.Tap)).event;let c;this._register(d(u=>{if(c){clearTimeout(c),c=void 0,this.onPointerDoublePress(u);return}clearTimeout(c),c=setTimeout(()=>c=void 0,250)},this)),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=x1e,this._register(k1e.event(u=>{this.size=u,this.layout()}))),this._register(I1e.event(u=>this.hoverDelay=u)),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",L1e),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 BD(t)))}if(this.linkedSash&&!e.__linkedSashEvent&&(e.__linkedSashEvent=!0,this.linkedSash.onPointerStart(e,new BD(t))),!this.state)return;const n=this.el.ownerDocument.getElementsByTagName("iframe");for(const f of n)f.classList.add(M6);const o=e.pageX,r=e.pageY,a=e.altKey,l={startX:o,currentX:o,startY:r,currentY:r,altKey:a};this.el.classList.add("active"),this._onDidStart.fire(l);const d=ar(this.el),c=()=>{let f="";i?f="all-scroll":this.orientation===1?this.state===1?f="s-resize":this.state===2?f="n-resize":f=lt?"row-resize":"ns-resize":this.state===1?f="e-resize":this.state===2?f="w-resize":f=lt?"col-resize":"ew-resize",d.textContent=`* { cursor: ${f} !important; }`},u=new Y;c(),i||this.onDidEnablementChange.event(c,null,u);const h=f=>{nt.stop(f,!1);const m={startX:o,currentX:f.pageX,startY:r,currentY:f.pageY,altKey:a};this._onDidChange.fire(m)},g=f=>{nt.stop(f,!1),this.el.removeChild(d),this.el.classList.remove("active"),this._onDidEnd.fire(),u.dispose();for(const m of n)m.classList.remove(M6)};t.onPointerMove(h,null,u),t.onPointerUp(g,null,u),u.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&&is.onMouseEnter(e.linkedSash,!0)}static onMouseLeave(e,t=!1){e.hoverDelayer.cancel(),e.el.classList.remove("hover"),!t&&e.linkedSash&&is.onMouseLeave(e.linkedSash,!0)}clearSashHoverState(){is.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){var t;const i=(t=e.initialTarget)!==null&&t!==void 0?t:e.target;if(!(!i||!(i instanceof HTMLElement))&&i.classList.contains("orthogonal-drag-handle"))return i.classList.contains("start")?this.orthogonalStartSash:this.orthogonalEndSash}dispose(){super.dispose(),this.el.remove()}}const T1e={separatorBorder:$.transparent};class Nj{set size(e){this._size=e}get size(){return this._size}get visible(){return typeof this._cachedVisibleSize>"u"}setVisible(e,t){var i,n;if(e!==this.visible){e?(this.size=xs(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{(n=(i=this.view).setVisible)===null||n===void 0||n.call(i,e)}catch(o){console.error("Splitview: Failed to set visible view"),console.error(o)}}}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(){var e;return(e=this.view.proportionalLayout)!==null&&e!==void 0?e:!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 N1e extends Nj{layoutContainer(e){this.container.style.top=`${e}px`,this.container.style.height=`${this.size}px`}}class A1e extends Nj{layoutContainer(e){this.container.style.left=`${e}px`,this.container.style.width=`${this.size}px`}}var Yd;(function(s){s[s.Idle=0]="Idle",s[s.Busy=1]="Busy"})(Yd||(Yd={}));var WD;(function(s){s.Distribute={type:"distribute"};function e(n){return{type:"split",index:n}}s.Split=e;function t(n){return{type:"auto",index:n}}s.Auto=t;function i(n){return{type:"invisible",cachedVisibleSize:n}}s.Invisible=i})(WD||(WD={}));class Aj extends H{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={}){var i,n,o,r,a;super(),this.size=0,this._contentSize=0,this.proportions=void 0,this.viewItems=[],this.sashItems=[],this.state=Yd.Idle,this._onDidSashChange=this._register(new B),this._onDidSashReset=this._register(new B),this._startSnappingEnabled=!0,this._endSnappingEnabled=!0,this.onDidSashChange=this._onDidSashChange.event,this.onDidSashReset=this._onDidSashReset.event,this.orientation=(i=t.orientation)!==null&&i!==void 0?i:0,this.inverseAltBehavior=(n=t.inverseAltBehavior)!==null&&n!==void 0?n:!1,this.proportionalLayout=(o=t.proportionalLayout)!==null&&o!==void 0?o:!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=Q(this.el,he(".sash-container")),this.viewContainer=he(".split-view-container"),this.scrollable=this._register(new u0({forceIntegerValues:!0,smoothScrollDuration:125,scheduleAtNextAnimationFrame:d=>Ao(Te(this.el),d)})),this.scrollableElement=this._register(new Lx(this.viewContainer,{vertical:this.orientation===0?(r=t.scrollbarVisibility)!==null&&r!==void 0?r:1:2,horizontal:this.orientation===1?(a=t.scrollbarVisibility)!==null&&a!==void 0?a:1:2},this.scrollable));const l=this._register(new ht(this.viewContainer,"scroll")).event;this._register(l(d=>{const c=this.scrollableElement.getScrollPosition(),u=Math.abs(this.viewContainer.scrollLeft-c.scrollLeft)<=1?void 0:this.viewContainer.scrollLeft,h=Math.abs(this.viewContainer.scrollTop-c.scrollTop)<=1?void 0:this.viewContainer.scrollTop;(u!==void 0||h!==void 0)&&this.scrollableElement.setScrollPosition({scrollLeft:u,scrollTop:h})})),this.onDidScroll=this.scrollableElement.onScroll,this._register(this.onDidScroll(d=>{d.scrollTopChanged&&(this.viewContainer.scrollTop=d.scrollTop),d.scrollLeftChanged&&(this.viewContainer.scrollLeft=d.scrollLeft)})),Q(this.el,this.scrollableElement.getDomNode()),this.style(t.styles||T1e),t.descriptor&&(this.size=t.descriptor.size,t.descriptor.views.forEach((d,c)=>{const u=oo(d.visible)||d.visible?d.size:{type:"invisible",cachedVisibleSize:d.size},h=d.view;this.doAddView(h,u,c,!0)}),this._contentSize=this.viewItems.reduce((d,c)=>d+c.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 o=0;o0&&(r.size=xs(Math.round(a*e/n),r.minimumSize,r.maximumSize))}}else{const n=to(this.viewItems.length),o=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,o,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),o=ha(K(this.el.ownerDocument.body,"keydown",a=>r(this.sashDragState.current,a.altKey)),K(this.el.ownerDocument.body,"keyup",()=>r(this.sashDragState.current,!1))),r=(a,l)=>{const d=this.viewItems.map(f=>f.size);let c=Number.NEGATIVE_INFINITY,u=Number.POSITIVE_INFINITY;if(this.inverseAltBehavior&&(l=!l),l)if(n===this.sashItems.length-1){const m=this.viewItems[n];c=(m.minimumSize-m.size)/2,u=(m.maximumSize-m.size)/2}else{const m=this.viewItems[n+1];c=(m.size-m.maximumSize)/2,u=(m.size-m.minimumSize)/2}let h,g;if(!l){const f=to(n,-1),m=to(n+1,this.viewItems.length),_=f.reduce((k,I)=>k+(this.viewItems[I].minimumSize-d[I]),0),v=f.reduce((k,I)=>k+(this.viewItems[I].viewMaximumSize-d[I]),0),b=m.length===0?Number.POSITIVE_INFINITY:m.reduce((k,I)=>k+(d[I]-this.viewItems[I].minimumSize),0),C=m.length===0?Number.NEGATIVE_INFINITY:m.reduce((k,I)=>k+(d[I]-this.viewItems[I].viewMaximumSize),0),w=Math.max(_,C),y=Math.min(b,v),D=this.findFirstSnapIndex(f),L=this.findFirstSnapIndex(m);if(typeof D=="number"){const k=this.viewItems[D],I=Math.floor(k.viewMinimumSize/2);h={index:D,limitDelta:k.visible?w-I:w+I,size:k.size}}if(typeof L=="number"){const k=this.viewItems[L],I=Math.floor(k.viewMinimumSize/2);g={index:L,limitDelta:k.visible?y+I:y-I,size:k.size}}}this.sashDragState={start:a,current:a,index:n,sizes:d,minDelta:c,maxDelta:u,alt:l,snapBefore:h,snapAfter:g,disposable:o}};r(t,i)}onSashChange({current:e}){const{index:t,start:i,sizes:n,alt:o,minDelta:r,maxDelta:a,snapBefore:l,snapAfter:d}=this.sashDragState;this.sashDragState.current=e;const c=e-i,u=this.resize(t,c,n,void 0,void 0,r,a,l,d);if(o){const h=t===this.sashItems.length-1,g=this.viewItems.map(C=>C.size),f=h?t:t+1,m=this.viewItems[f],_=m.size-m.maximumSize,v=m.size-m.minimumSize,b=h?t-1:t+1;this.resize(b,-u,g,void 0,void 0,_,v)}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=xs(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!==Yd.Idle)throw new Error("Cant modify splitview");this.state=Yd.Busy;try{const i=to(this.viewItems.length).filter(a=>a!==e),n=[...i.filter(a=>this.viewItems[a].priority===1),e],o=i.filter(a=>this.viewItems[a].priority===2),r=this.viewItems[e];t=Math.round(t),t=xs(t,r.minimumSize,Math.min(r.maximumSize,this.size)),r.size=t,this.relayout(n,o)}finally{this.state=Yd.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=xs(i,a.minimumSize,a.maximumSize);const n=to(this.viewItems.length),o=n.filter(a=>this.viewItems[a].priority===1),r=n.filter(a=>this.viewItems[a].priority===2);this.relayout(o,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!==Yd.Idle)throw new Error("Cant modify splitview");this.state=Yd.Busy;try{const o=he(".split-view-view");i===this.viewItems.length?this.viewContainer.appendChild(o):this.viewContainer.insertBefore(o,this.viewContainer.children.item(i));const r=e.onDidChange(h=>this.onViewChange(c,h)),a=Ie(()=>this.viewContainer.removeChild(o)),l=ha(r,a);let d;typeof t=="number"?d=t:(t.type==="auto"&&(this.areViewsDistributed()?t={type:"distribute"}:t={type:"split",index:t.index}),t.type==="split"?d=this.getViewSize(t.index)/2:t.type==="invisible"?d={cachedVisibleSize:t.cachedVisibleSize}:d=e.minimumSize);const c=this.orientation===0?new N1e(o,e,d,l):new A1e(o,e,d,l);if(this.viewItems.splice(i,0,c),this.viewItems.length>1){const h={orthogonalStartSash:this.orthogonalStartSash,orthogonalEndSash:this.orthogonalEndSash},g=this.orientation===0?new is(this.sashContainer,{getHorizontalSashTop:k=>this.getSashPosition(k),getHorizontalSashWidth:this.getSashOrthogonalSize},{...h,orientation:1}):new is(this.sashContainer,{getVerticalSashLeft:k=>this.getSashPosition(k),getVerticalSashHeight:this.getSashOrthogonalSize},{...h,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}),_=le.map(g.onDidStart,f)(this.onSashStart,this),b=le.map(g.onDidChange,f)(this.onSashChange,this),w=le.map(g.onDidEnd,()=>this.sashItems.findIndex(k=>k.sash===g))(this.onSashEnd,this),y=g.onDidReset(()=>{const k=this.sashItems.findIndex(F=>F.sash===g),I=to(k,-1),O=to(k+1,this.viewItems.length),R=this.findFirstSnapIndex(I),P=this.findFirstSnapIndex(O);typeof R=="number"&&!this.viewItems[R].visible||typeof P=="number"&&!this.viewItems[P].visible||this._onDidSashReset.fire(k)}),D=ha(_,b,w,y,g),L={sash:g,disposable:D};this.sashItems.splice(i-1,0,L)}o.appendChild(e.element);let u;typeof t!="number"&&t.type==="split"&&(u=[t.index]),n||this.relayout([i],u),!n&&typeof t!="number"&&t.type==="distribute"&&this.distributeViewSizes()}finally{this.state=Yd.Idle}}relayout(e,t){const i=this.viewItems.reduce((n,o)=>n+o.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(c=>c.size),n,o,r=Number.NEGATIVE_INFINITY,a=Number.POSITIVE_INFINITY,l,d){if(e<0||e>=this.viewItems.length)return 0;const c=to(e,-1),u=to(e+1,this.viewItems.length);if(o)for(const L of o)EE(c,L),EE(u,L);if(n)for(const L of n)aw(c,L),aw(u,L);const h=c.map(L=>this.viewItems[L]),g=c.map(L=>i[L]),f=u.map(L=>this.viewItems[L]),m=u.map(L=>i[L]),_=c.reduce((L,k)=>L+(this.viewItems[k].minimumSize-i[k]),0),v=c.reduce((L,k)=>L+(this.viewItems[k].maximumSize-i[k]),0),b=u.length===0?Number.POSITIVE_INFINITY:u.reduce((L,k)=>L+(i[k]-this.viewItems[k].minimumSize),0),C=u.length===0?Number.NEGATIVE_INFINITY:u.reduce((L,k)=>L+(i[k]-this.viewItems[k].maximumSize),0),w=Math.max(_,C,r),y=Math.min(b,v,a);let D=!1;if(l){const L=this.viewItems[l.index],k=t>=l.limitDelta;D=k!==L.visible,L.setVisible(k,l.size)}if(!D&&d){const L=this.viewItems[d.index],k=ta+l.size,0);let i=this.size-t;const n=to(this.viewItems.length-1,-1),o=n.filter(a=>this.viewItems[a].priority===1),r=n.filter(a=>this.viewItems[a].priority===2);for(const a of r)EE(n,a);for(const a of o)aw(n,a);typeof e=="number"&&aw(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 o=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)?d.state=1:b&&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(){var e;(e=this.sashDragState)===null||e===void 0||e.disposable.dispose(),jt(this.viewItems),this.viewItems=[],this.sashItems.forEach(t=>t.disposable.dispose()),this.sashItems=[],super.dispose()}}class A1{constructor(e,t,i){this.columns=e,this.getColumnSize=i,this.templateId=A1.TemplateId,this.renderedTemplates=new Set;const n=new Map(t.map(o=>[o.templateId,o]));this.renderers=[];for(const o of e){const r=n.get(o.templateId);if(!r)throw new Error(`Table cell renderer for template id ${o.templateId} not found.`);this.renderers.push(r)}}renderTemplate(e){const t=Q(e,he(".monaco-table-tr")),i=[],n=[];for(let r=0;rthis.disposables.add(new R1e(c,u))),l={size:a.reduce((c,u)=>c+u.column.weight,0),views:a.map(c=>({size:c.column.weight,view:c}))};this.splitview=this.disposables.add(new Aj(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 d=new A1(n,o,c=>this.splitview.getViewSize(c));this.list=this.disposables.add(new pr(e,this.domNode,M1e(i),[d],r)),le.any(...a.map(c=>c.onDidLayout))(([c,u])=>d.layoutColumn(c,u),null,this.disposables),this.splitview.onDidSashReset(c=>{const u=n.reduce((g,f)=>g+f.weight,0),h=n[c].weight/u*this.cachedWidth;this.splitview.resizeView(c,h)},null,this.disposables),this.styleElement=ar(this.domNode),this.style(TCe)}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()}}ek.InstanceCount=0;const P1e=p("caseDescription","Match Case"),F1e=p("wordsDescription","Match Whole Word"),O1e=p("regexDescription","Use Regular Expression");class Mj extends f0{constructor(e){var t;super({icon:oe.caseSensitive,title:P1e+e.appendTitle,isChecked:e.isChecked,hoverDelegate:(t=e.hoverDelegate)!==null&&t!==void 0?t:Xs("element"),inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class Rj extends f0{constructor(e){var t;super({icon:oe.wholeWord,title:F1e+e.appendTitle,isChecked:e.isChecked,hoverDelegate:(t=e.hoverDelegate)!==null&&t!==void 0?t:Xs("element"),inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class Pj extends f0{constructor(e){var t;super({icon:oe.regex,title:O1e+e.appendTitle,isChecked:e.isChecked,hoverDelegate:(t=e.hoverDelegate)!==null&&t!==void 0?t:Xs("element"),inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class B1e{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 W1e{constructor(e=[],t=10){this._initialize(e),this._limit=t,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 B1e(e,0,e.length,e.length)}_reduceToLimit(){const e=this._elements;e.length>this._limit&&this._initialize(e.slice(e.length-this._limit))}_currentPosition(){const e=this._navigator.current();return e?this._elements.indexOf(e):-1}_initialize(e){this._history=new Set;for(const t of e)this._history.add(t)}get _elements(){const e=[];return this._history.forEach(t=>e.push(t)),e}}const Z0=he;let H1e=class extends fr{constructor(e,t,i){var n;super(),this.state="idle",this.maxHeight=Number.POSITIVE_INFINITY,this._onDidChange=this._register(new B),this.onDidChange=this._onDidChange.event,this._onDidHeightChange=this._register(new B),this.onDidHeightChange=this._onDidHeightChange.event,this.contextViewProvider=t,this.options=i,this.message=null,this.placeholder=this.options.placeholder||"",this.tooltip=(n=this.options.tooltip)!==null&&n!==void 0?n:this.placeholder||"",this.ariaLabel=this.options.ariaLabel||"",this.options.validationOptions&&(this.validation=this.options.validationOptions.validation),this.element=Q(e,Z0(".monaco-inputbox.idle"));const o=this.options.flexibleHeight?"textarea":"input",r=Q(this.element,Z0(".ibwrapper"));if(this.input=Q(r,Z0(o+".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=Q(r,Z0("div.mirror")),this.mirror.innerText=" ",this.scrollableElement=new VU(this.element,{vertical:1}),this.options.flexibleWidth&&(this.input.setAttribute("wrap","off"),this.mirror.style.whiteSpace="pre",this.mirror.style.wordWrap="initial"),Q(e,this.scrollableElement.getDomNode()),this._register(this.scrollableElement),this._register(this.scrollableElement.onScroll(d=>this.input.scrollTop=d.scrollTop));const a=this._register(new ht(e.ownerDocument,"selectionchange")),l=le.filter(a.event,()=>{const d=e.ownerDocument.getSelection();return(d==null?void 0:d.anchorNode)===r});this._register(l(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 Vr(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?this.hover.update(e):this.hover=this._register(_l().setupUpdatableHover(Xs("mouse"),this.input,e))}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:uc(this.element)}focus(){this.input.focus()}blur(){this.input.blur()}hasFocus(){return tx(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(){var e;const t=this.input.selectionStart;if(t===null)return null;const i=(e=this.input.selectionEnd)!==null&&e!==void 0?e:t;return{start:t,end:i}}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"&&tr(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 ${Ec(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==null?void 0: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=wo(this.element)+"px";this.contextViewProvider.showContextView({getAnchor:()=>this.element,anchorAlignment:1,render:n=>{var o,r;if(!this.message)return null;e=Q(n,Z0(".monaco-inputbox-container")),t();const a={inline:!0,className:"monaco-inputbox-message"},l=this.message.formatContent?tve(this.message.content,a):eve(this.message.content,a);l.classList.add(this.classForType(this.message.type));const d=this.stylesForType(this.message.type);return l.style.backgroundColor=(o=d.background)!==null&&o!==void 0?o:"",l.style.color=(r=d.foreground)!==null&&r!==void 0?r:"",l.style.border=d.border?`1px solid ${d.border}`:"",Q(e,l),null},onHide:()=>{this.state="closed"},layout:t});let i;this.message.type===3?i=p("alertErrorMessage","Error: {0}",this.message.content):this.message.type===2?i=p("alertWarningMessage","Warning: {0}",this.message.content):i=p("alertInfoMessage","Info: {0}",this.message.content),fo(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(){var e,t,i;const n=this.options.inputBoxStyles,o=(e=n.inputBackground)!==null&&e!==void 0?e:"",r=(t=n.inputForeground)!==null&&t!==void 0?t:"",a=(i=n.inputBorder)!==null&&i!==void 0?i:"";this.element.style.backgroundColor=o,this.element.style.color=r,this.input.style.backgroundColor="inherit",this.input.style.color=r,this.element.style.border=`1px solid ${Ec(a,"transparent")}`}layout(){if(!this.mirror)return;const e=this.cachedContentHeight;this.cachedContentHeight=uc(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,o=t.value;i!==null&&n!==null&&(this.value=o.substr(0,i)+e+o.substr(n),t.setSelectionRange(i+1,i+1),this.layout())}dispose(){var e;this._hideMessage(),this.message=null,(e=this.actionbar)===null||e===void 0||e.dispose(),super.dispose()}};class Fj extends H1e{constructor(e,t,i){const n=p({}," or {0} for history","⇅"),o=p({}," ({0} for history)","⇅");super(e,t,i),this._onDidFocus=this._register(new B),this.onDidFocus=this._onDidFocus.event,this._onDidBlur=this._register(new B),this.onDidBlur=this._onDidBlur.event,this.history=new W1e(i.history,100);const r=()=>{if(i.showHistoryHint&&i.showHistoryHint()&&!this.placeholder.endsWith(n)&&!this.placeholder.endsWith(o)&&this.history.getHistory().length){const a=this.placeholder.endsWith(")")?n:o,l=this.placeholder+a;i.showPlaceholderOnFocus&&!tx(this.input)?this.placeholder=l:this.setPlaceHolder(l)}};this.observer=new MutationObserver((a,l)=>{a.forEach(d=>{d.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 d=this.placeholder.slice(0,this.placeholder.length-l.length);return i.showPlaceholderOnFocus?this.placeholder=d:this.setPlaceHolder(d),!0}else return!1};a(o)||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??"",Uc(this.value?this.value:p("clearedInput","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,Uc(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 V1e=p("defaultLabel","input");class Oj extends fr{constructor(e,t,i){super(),this.fixFocusOnOptionClickEnabled=!0,this.imeSessionInProgress=!1,this.additionalTogglesDisposables=this._register(new $n),this.additionalToggles=[],this._onDidOptionChange=this._register(new B),this.onDidOptionChange=this._onDidOptionChange.event,this._onKeyDown=this._register(new B),this.onKeyDown=this._onKeyDown.event,this._onMouseDown=this._register(new B),this.onMouseDown=this._onMouseDown.event,this._onInput=this._register(new B),this._onKeyUp=this._register(new B),this._onCaseSensitiveKeyDown=this._register(new B),this.onCaseSensitiveKeyDown=this._onCaseSensitiveKeyDown.event,this._onRegexKeyDown=this._register(new B),this.onRegexKeyDown=this._onRegexKeyDown.event,this._lastHighlightFindOptions=0,this.placeholder=i.placeholder||"",this.validation=i.validation,this.label=i.label||V1e,this.showCommonFindToggles=!!i.showCommonFindToggles;const n=i.appendCaseSensitiveLabel||"",o=i.appendWholeWordsLabel||"",r=i.appendRegexLabel||"",a=i.history||[],l=!!i.flexibleHeight,d=!!i.flexibleWidth,c=i.flexibleMaxHeight;this.domNode=document.createElement("div"),this.domNode.classList.add("monaco-findInput"),this.inputBox=this._register(new Fj(this.domNode,t,{placeholder:this.placeholder||"",ariaLabel:this.label||"",validationOptions:{validation:this.validation},history:a,showHistoryHint:i.showHistoryHint,flexibleHeight:l,flexibleWidth:d,flexibleMaxHeight:c,inputBoxStyles:i.inputBoxStyles}));const u=this._register(I_());if(this.showCommonFindToggles){this.regex=this._register(new Pj({appendTitle:r,isChecked:!1,hoverDelegate:u,...i.toggleStyles})),this._register(this.regex.onChange(g=>{this._onDidOptionChange.fire(g),!g&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this._register(this.regex.onKeyDown(g=>{this._onRegexKeyDown.fire(g)})),this.wholeWords=this._register(new Rj({appendTitle:o,isChecked:!1,hoverDelegate:u,...i.toggleStyles})),this._register(this.wholeWords.onChange(g=>{this._onDidOptionChange.fire(g),!g&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this.caseSensitive=this._register(new Mj({appendTitle:n,isChecked:!1,hoverDelegate:u,...i.toggleStyles})),this._register(this.caseSensitive.onChange(g=>{this._onDidOptionChange.fire(g),!g&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this._register(this.caseSensitive.onKeyDown(g=>{this._onCaseSensitiveKeyDown.fire(g)}));const h=[this.caseSensitive.domNode,this.wholeWords.domNode,this.regex.domNode];this.onkeydown(this.domNode,g=>{if(g.equals(15)||g.equals(17)||g.equals(9)){const f=h.indexOf(this.domNode.ownerDocument.activeElement);if(f>=0){let m=-1;g.equals(17)?m=(f+1)%h.length:g.equals(15)&&(f===0?m=h.length-1:m=f-1),g.equals(9)?(h[f].blur(),this.inputBox.focus()):m>=0&&h[m].focus(),nt.stop(g,!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==null?void 0:i.additionalToggles),this.controls&&this.domNode.appendChild(this.controls),e==null||e.appendChild(this.domNode),this._register(K(this.inputBox.inputElement,"compositionstart",h=>{this.imeSessionInProgress=!0})),this._register(K(this.inputBox.inputElement,"compositionend",h=>{this.imeSessionInProgress=!1,this._onInput.fire()})),this.onkeydown(this.inputBox.inputElement,h=>this._onKeyDown.fire(h)),this.onkeyup(this.inputBox.inputElement,h=>this._onKeyUp.fire(h)),this.oninput(this.inputBox.inputElement,h=>this._onInput.fire()),this.onmousedown(this.inputBox.inputElement,h=>this._onMouseDown.fire(h))}get onDidChange(){return this.inputBox.onDidChange}layout(e){this.inputBox.layout(),this.updateInputBoxPadding(e.collapsedFindWidget)}enable(){var e,t,i;this.domNode.classList.remove("disabled"),this.inputBox.enable(),(e=this.regex)===null||e===void 0||e.enable(),(t=this.wholeWords)===null||t===void 0||t.enable(),(i=this.caseSensitive)===null||i===void 0||i.enable();for(const n of this.additionalToggles)n.enable()}disable(){var e,t,i;this.domNode.classList.add("disabled"),this.inputBox.disable(),(e=this.regex)===null||e===void 0||e.disable(),(t=this.wholeWords)===null||t===void 0||t.disable(),(i=this.caseSensitive)===null||i===void 0||i.disable();for(const n of this.additionalToggles)n.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 Y;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){var t,i,n,o,r,a;e?this.inputBox.paddingRight=0:this.inputBox.paddingRight=((i=(t=this.caseSensitive)===null||t===void 0?void 0:t.width())!==null&&i!==void 0?i:0)+((o=(n=this.wholeWords)===null||n===void 0?void 0:n.width())!==null&&o!==void 0?o:0)+((a=(r=this.regex)===null||r===void 0?void 0:r.width())!==null&&a!==void 0?a:0)+this.additionalToggles.reduce((l,d)=>l+d.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(){var e,t;return(t=(e=this.caseSensitive)===null||e===void 0?void 0:e.checked)!==null&&t!==void 0?t:!1}setCaseSensitive(e){this.caseSensitive&&(this.caseSensitive.checked=e)}getWholeWords(){var e,t;return(t=(e=this.wholeWords)===null||e===void 0?void 0:e.checked)!==null&&t!==void 0?t:!1}setWholeWords(e){this.wholeWords&&(this.wholeWords.checked=e)}getRegex(){var e,t;return(t=(e=this.regex)===null||e===void 0?void 0:e.checked)!==null&&t!==void 0?t:!1}setRegex(e){this.regex&&(this.regex.checked=e,this.validate())}focusOnCaseSensitive(){var e;(e=this.caseSensitive)===null||e===void 0||e.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()}}var Ko;(function(s){s[s.Expanded=0]="Expanded",s[s.Collapsed=1]="Collapsed",s[s.PreserveOrExpanded=2]="PreserveOrExpanded",s[s.PreserveOrCollapsed=3]="PreserveOrCollapsed"})(Ko||(Ko={}));var ef;(function(s){s[s.Unknown=0]="Unknown",s[s.Twistie=1]="Twistie",s[s.Element=2]="Element",s[s.Filter=3]="Filter"})(ef||(ef={}));class Xo extends Error{constructor(e,t){super(`TreeError [${e}] ${t}`)}}class IO{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}}function TO(s){return typeof s=="object"&&"visibility"in s&&"data"in s}function pC(s){switch(s){case!0:return 1;case!1:return 0;default:return s}}function $I(s){return typeof s.collapsible=="boolean"}class z1e{constructor(e,t,i,n={}){var o;this.user=e,this.list=t,this.rootRef=[],this.eventBufferer=new KP,this._onDidChangeCollapseState=new B,this.onDidChangeCollapseState=this.eventBufferer.wrapEvent(this._onDidChangeCollapseState.event),this._onDidChangeRenderNodeCount=new B,this.onDidChangeRenderNodeCount=this.eventBufferer.wrapEvent(this._onDidChangeRenderNodeCount.event),this._onDidSplice=new B,this.onDidSplice=this._onDidSplice.event,this.refilterDelayer=new _a(gz),this.collapseByDefault=typeof n.collapseByDefault>"u"?!1:n.collapseByDefault,this.allowNonCollapsibleParents=(o=n.allowNonCollapsibleParents)!==null&&o!==void 0?o:!1,this.filter=n.filter,this.autoExpandSingleChildren=typeof n.autoExpandSingleChildren>"u"?!1:n.autoExpandSingleChildren,this.root={parent:void 0,element:i,children:[],depth:0,visibleChildrenCount:0,visibleChildIndex:-1,collapsible:!1,collapsed:!1,renderNodeCount:0,visibility:1,visible:!0,filterData:void 0}}splice(e,t,i=ft.empty(),n={}){if(e.length===0)throw new Xo(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,o,r){var a;n===void 0&&(n=ft.empty()),r===void 0&&(r=(a=o.diffDepth)!==null&&a!==void 0?a:0);const{parentNode:l}=this.getParentNodeWithListIndex(t);if(!l.lastDiffIds)return this.spliceSimple(t,i,n,o);const d=[...n],c=t[t.length-1],u=new zl({getElements:()=>l.lastDiffIds},{getElements:()=>[...l.children.slice(0,c),...d,...l.children.slice(c+i)].map(_=>e.getId(_.element).toString())}).ComputeDiff(!1);if(u.quitEarly)return l.lastDiffIds=void 0,this.spliceSimple(t,i,d,o);const h=t.slice(0,-1),g=(_,v,b)=>{if(r>0)for(let C=0;Cb.originalStart-v.originalStart))g(f,m,f-(_.originalStart+_.originalLength)),f=_.originalStart,m=_.modifiedStart-c,this.spliceSimple([...h,f],_.originalLength,ft.slice(d,m,m+_.modifiedLength),o);g(f,m,f)}spliceSimple(e,t,i=ft.empty(),{onDidCreateNode:n,onDidDeleteNode:o,diffIdentityProvider:r}){const{parentNode:a,listIndex:l,revealed:d,visible:c}=this.getParentNodeWithListIndex(e),u=[],h=ft.map(i,y=>this.createTreeNode(y,a,a.visible?1:0,d,u,n)),g=e[e.length-1];let f=0;for(let y=g;y>=0&&yr.getId(y.element).toString())):a.lastDiffIds=a.children.map(y=>r.getId(y.element).toString()):a.lastDiffIds=void 0;let C=0;for(const y of b)y.visible&&C++;if(C!==0)for(let y=g+m.length;yD+(L.visible?L.renderNodeCount:0),0);this._updateAncestorsRenderNodeCount(a,v-y),this.list.splice(l,y,u)}if(b.length>0&&o){const y=D=>{o(D),D.children.forEach(y)};b.forEach(y)}this._onDidSplice.fire({insertedNodes:m,deletedNodes:b});let w=a;for(;w;){if(w.visibility===2){this.refilterDelayer.trigger(()=>this.refilter());break}w=w.parent}}rerender(e){if(e.length===0)throw new Xo(this.user,"Invalid tree location");const{node:t,listIndex:i,revealed:n}=this.getTreeNodeWithListIndex(e);t.visible&&n&&this.list.splice(i,1,[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 o={collapsed:t,recursive:i||!1};return this.eventBufferer.bufferEvents(()=>this._setCollapseState(e,o))}_setCollapseState(e,t){const{node:i,listIndex:n,revealed:o}=this.getTreeNodeWithListIndex(e),r=this._setListNodeCollapseState(i,n,o,t);if(i!==this.root&&this.autoExpandSingleChildren&&r&&!$I(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 o=this._setNodeCollapseState(e,n,!1);if(!i||!e.visible||!o)return o;const r=e.renderNodeCount,a=this.updateNodeAfterCollapseChange(e),l=r-(t===-1?0:1);return this.list.splice(t+1,l,a.slice(1)),o}_setNodeCollapseState(e,t,i){let n;if(e===this.root?n=!1:($I(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})),!$I(t)&&t.recursive)for(const o of e.children)n=this._setNodeCollapseState(o,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.list.splice(0,e,t),this.refilterDelayer.cancel()}createTreeNode(e,t,i,n,o,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&&o.push(a);const d=e.children||ft.empty(),c=n&&l!==0&&!a.collapsed;let u=0,h=1;for(const g of d){const f=this.createTreeNode(g,a,l,c,o,r);a.children.push(f),h+=f.renderNodeCount,f.visible&&(f.visibleChildIndex=u++)}return this.allowNonCollapsibleParents||(a.collapsible=a.collapsible||a.children.length>0),a.visibleChildrenCount=u,a.visible=l===2?u>0:l===1,a.visible?a.collapsed||(a.renderNodeCount=h):(a.renderNodeCount=0,n&&o.pop()),r==null||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 o;if(e!==this.root){if(o=this._filterNode(e,t),o===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||o!==0){let l=0;for(const d of e.children)a=this._updateNodeAfterFilterChange(d,o,i,n&&!e.collapsed)||a,d.visible&&(d.visibleChildIndex=l++);e.visibleChildrenCount=l}else e.visibleChildrenCount=0;return e!==this.root&&(e.visible=o===2?a:o===1,e.visibility=o),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):TO(i)?(e.filterData=i.data,pC(i.visibility)):(e.filterData=void 0,pC(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 Xo(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:o}=this.getParentNodeWithListIndex(e),r=e[e.length-1];if(r<0||r>t.children.length)throw new Xo(this.user,"Invalid tree location");const a=t.children[r];return{node:a,listIndex:i,revealed:n,visible:o&&a.visible}}getParentNodeWithListIndex(e,t=this.root,i=0,n=!0,o=!0){const[r,...a]=e;if(r<0||r>t.children.length)throw new Xo(this.user,"Invalid tree location");for(let l=0;lt.element)),this.data=e}}function jI(s){return s instanceof k1?new U1e(s):s}class $1e{constructor(e,t){this.modelProvider=e,this.dnd=t,this.autoExpandDisposable=H.None,this.disposables=new Y}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){var i,n;(n=(i=this.dnd).onDragStart)===null||n===void 0||n.call(i,jI(e),t)}onDragOver(e,t,i,n,o,r=!0){const a=this.dnd.onDragOver(jI(e),t&&t.element,i,n,o),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=kh(()=>{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),m=g.getParentNodeLocation(f),_=g.getNode(m),v=m&&g.getListIndex(m);return this.onDragOver(e,_,v,n,o,!1)}const d=this.modelProvider(),c=d.getNodeLocation(t),u=d.getListIndex(c),h=d.getListRenderCount(c);return{...a,feedback:to(u,u+h)}}drop(e,t,i,n,o){this.autoExpandDisposable.dispose(),this.autoExpandNode=void 0,this.dnd.drop(jI(e),t&&t.element,i,n,o)}onDragEnd(e){var t,i;(i=(t=this.dnd).onDragEnd)===null||i===void 0||i.call(t,e)}dispose(){this.disposables.dispose(),this.dnd.dispose()}}function j1e(s,e){return e&&{...e,identityProvider:e.identityProvider&&{getId(t){return e.identityProvider.getId(t.element)}},dnd:e.dnd&&new $1e(s,e.dnd),multipleSelectionController:e.multipleSelectionController&&{isSelectionSingleChangeEvent(t){return e.multipleSelectionController.isSelectionSingleChangeEvent({...t,element:t.element})},isSelectionRangeChangeEvent(t){return e.multipleSelectionController.isSelectionRangeChangeEvent({...t,element:t.element})}},accessibilityProvider:e.accessibilityProvider&&{...e.accessibilityProvider,getSetSize(t){const i=s(),n=i.getNodeLocation(t),o=i.getParentNodeLocation(n);return i.getNode(o).visibleChildrenCount},getPosInSet(t){return t.visibleChildIndex+1},isChecked:e.accessibilityProvider&&e.accessibilityProvider.isChecked?t=>e.accessibilityProvider.isChecked(t.element):void 0,getRole:e.accessibilityProvider&&e.accessibilityProvider.getRole?t=>e.accessibilityProvider.getRole(t.element):()=>"treeitem",getAriaLabel(t){return e.accessibilityProvider.getAriaLabel(t.element)},getWidgetAriaLabel(){return e.accessibilityProvider.getWidgetAriaLabel()},getWidgetRole:e.accessibilityProvider&&e.accessibilityProvider.getWidgetRole?()=>e.accessibilityProvider.getWidgetRole():()=>"tree",getAriaLevel:e.accessibilityProvider&&e.accessibilityProvider.getAriaLevel?t=>e.accessibilityProvider.getAriaLevel(t.element):t=>t.depth,getActiveDescendantId:e.accessibilityProvider.getActiveDescendantId&&(t=>e.accessibilityProvider.getActiveDescendantId(t.element))},keyboardNavigationLabelProvider:e.keyboardNavigationLabelProvider&&{...e.keyboardNavigationLabelProvider,getKeyboardNavigationLabel(t){return e.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(t.element)}}}}class NO{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){var i,n;(n=(i=this.delegate).setDynamicHeight)===null||n===void 0||n.call(i,e.element,t)}}var M_;(function(s){s.None="none",s.OnHover="onHover",s.Always="always"})(M_||(M_={}));class K1e{get elements(){return this._elements}constructor(e,t=[]){this._elements=t,this.disposables=new Y,this.onDidChange=le.forEach(e,i=>this._elements=i,this.disposables)}dispose(){this.disposables.dispose()}}class mC{constructor(e,t,i,n,o,r={}){var a;this.renderer=e,this.modelProvider=t,this.activeNodes=n,this.renderedIndentGuides=o,this.renderedElements=new Map,this.renderedNodes=new Map,this.indent=mC.DefaultIndent,this.hideTwistiesOfChildlessElements=!1,this.shouldRenderIndentGuides=!1,this.activeIndentNodes=new Set,this.indentGuidesDisposable=H.None,this.disposables=new Y,this.templateId=e.templateId,this.updateOptions(r),le.map(i,l=>l.node)(this.onDidChangeNodeTwistieState,this,this.disposables),(a=e.onDidChangeTwistieState)===null||a===void 0||a.call(e,this.onDidChangeTwistieState,this,this.disposables)}updateOptions(e={}){if(typeof e.indent<"u"){const t=xs(e.indent,0,40);if(t!==this.indent){this.indent=t;for(const[i,n]of this.renderedNodes)this.renderTreeElement(i,n)}}if(typeof e.renderIndentGuides<"u"){const t=e.renderIndentGuides!==M_.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 Y;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=Q(e,he(".monaco-tl-row")),i=Q(t,he(".monaco-tl-indent")),n=Q(t,he(".monaco-tl-twistie")),o=Q(t,he(".monaco-tl-contents")),r=this.renderer.renderTemplate(o);return{container:e,indent:i,twistie:n,indentGuidesDisposable:H.None,templateData:r}}renderElement(e,t,i,n){this.renderedNodes.set(e,i),this.renderedElements.set(e.element,e),this.renderTreeElement(e,i),this.renderer.renderElement(e,t,i.templateData,n)}disposeElement(e,t,i,n){var o,r;i.indentGuidesDisposable.dispose(),(r=(o=this.renderer).disposeElement)===null||r===void 0||r.call(o,e,t,i.templateData,n),typeof n=="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){const i=mC.DefaultIndent+(e.depth-1)*this.indent;t.twistie.style.paddingLeft=`${i}px`,t.indent.style.width=`${i+this.indent-16}px`,e.collapsible?t.container.setAttribute("aria-expanded",String(!e.collapsed)):t.container.removeAttribute("aria-expanded"),t.twistie.classList.remove(...Pe.asClassNameArray(oe.treeItemExpanded));let n=!1;this.renderer.renderTwistie&&(n=this.renderer.renderTwistie(e.element,t.twistie)),e.collapsible&&(!this.hideTwistiesOfChildlessElements||e.visibleChildrenCount>0)?(n||t.twistie.classList.add(...Pe.asClassNameArray(oe.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(zn(t.indent),t.indentGuidesDisposable.dispose(),!this.shouldRenderIndentGuides)return;const i=new Y,n=this.modelProvider();for(;;){const o=n.getNodeLocation(e),r=n.getParentNodeLocation(o);if(!r)break;const a=n.getNode(r),l=he(".indent-guide",{style:`width: ${this.indent}px`});this.activeIndentNodes.has(a)&&l.classList.add("active"),t.indent.childElementCount===0?t.indent.appendChild(l):t.indent.insertBefore(l,t.indent.firstElementChild),this.renderedIndentGuides.add(a,l),i.add(Ie(()=>this.renderedIndentGuides.delete(a,l))),e=a}t.indentGuidesDisposable=i}_onDidChangeActiveNodes(e){if(!this.shouldRenderIndentGuides)return;const t=new Set,i=this.modelProvider();e.forEach(n=>{const o=i.getNodeLocation(n);try{const r=i.getParentNodeLocation(o);n.collapsible&&n.children.length>0&&!n.collapsed?t.add(n):r&&t.add(i.getNode(r))}catch{}}),this.activeIndentNodes.forEach(n=>{t.has(n)||this.renderedIndentGuides.forEach(n,o=>o.classList.remove("active"))}),t.forEach(n=>{this.activeIndentNodes.has(n)||this.renderedIndentGuides.forEach(n,o=>o.classList.add("active"))}),this.activeIndentNodes=t}dispose(){this.renderedNodes.clear(),this.renderedElements.clear(),this.indentGuidesDisposable.dispose(),jt(this.disposables)}}mC.DefaultIndent=8;class q1e{get totalCount(){return this._totalCount}get matchCount(){return this._matchCount}constructor(e,t,i){this.tree=e,this.keyboardNavigationLabelProvider=t,this._filter=i,this._totalCount=0,this._matchCount=0,this._pattern="",this._lowercasePattern="",this.disposables=new Y,e.onWillRefilter(this.reset,this,this.disposables)}filter(e,t){let i=1;if(this._filter){const r=this._filter.filter(e,t);if(typeof r=="boolean"?i=r?1:0:TO(r)?i=pC(r.visibility):i=r,i===0)return!1}if(this._totalCount++,!this._pattern)return this._matchCount++,{data:el.Default,visibility:i};const n=this.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e),o=Array.isArray(n)?n:[n];for(const r of o){const a=r&&r.toString();if(typeof a>"u")return{data:el.Default,visibility:i};let l;if(this.tree.findMatchType===Tf.Contiguous){const d=a.toLowerCase().indexOf(this._lowercasePattern);if(d>-1){l=[Number.MAX_SAFE_INTEGER,0];for(let c=this._lowercasePattern.length;c>0;c--)l.push(d+c-1)}}else l=D_(this._pattern,this._lowercasePattern,0,a,a.toLowerCase(),0,{firstMatchCanBeWeak:!0,boostFullMatch:!0});if(l)return this._matchCount++,o.length===1?{data:l,visibility:i}:{data:{label:a,score:l},visibility:i}}return this.tree.findMode===Lc.Filter?typeof this.tree.options.defaultFindVisibility=="number"?this.tree.options.defaultFindVisibility:this.tree.options.defaultFindVisibility?this.tree.options.defaultFindVisibility(e):2:{data:el.Default,visibility:i}}reset(){this._totalCount=0,this._matchCount=0}dispose(){jt(this.disposables)}}var Lc;(function(s){s[s.Highlight=0]="Highlight",s[s.Filter=1]="Filter"})(Lc||(Lc={}));var Tf;(function(s){s[s.Fuzzy=0]="Fuzzy",s[s.Contiguous=1]="Contiguous"})(Tf||(Tf={}));let G1e=class{get pattern(){return this._pattern}get mode(){return this._mode}set mode(e){e!==this._mode&&(this._mode=e,this.widget&&(this.widget.mode=this._mode),this.tree.refilter(),this.render(),this._onDidChangeMode.fire(e))}get matchType(){return this._matchType}set matchType(e){e!==this._matchType&&(this._matchType=e,this.widget&&(this.widget.matchType=this._matchType),this.tree.refilter(),this.render(),this._onDidChangeMatchType.fire(e))}constructor(e,t,i,n,o,r={}){var a,l;this.tree=e,this.view=i,this.filter=n,this.contextViewProvider=o,this.options=r,this._pattern="",this.width=0,this._onDidChangeMode=new B,this.onDidChangeMode=this._onDidChangeMode.event,this._onDidChangeMatchType=new B,this.onDidChangeMatchType=this._onDidChangeMatchType.event,this._onDidChangePattern=new B,this._onDidChangeOpenState=new B,this.onDidChangeOpenState=this._onDidChangeOpenState.event,this.enabledDisposables=new Y,this.disposables=new Y,this._mode=(a=e.options.defaultFindMode)!==null&&a!==void 0?a:Lc.Highlight,this._matchType=(l=e.options.defaultFindMatchType)!==null&&l!==void 0?l:Tf.Fuzzy,t.onDidSplice(this.onDidSpliceModel,this,this.disposables)}updateOptions(e={}){e.defaultFindMode!==void 0&&(this.mode=e.defaultFindMode),e.defaultFindMatchType!==void 0&&(this.matchType=e.defaultFindMatchType)}onDidSpliceModel(){!this.widget||this.pattern.length===0||(this.tree.refilter(),this.render())}render(){var e,t,i,n;const o=this.filter.totalCount>0&&this.filter.matchCount===0;this.pattern&&o?!((e=this.tree.options.showNotFoundMessage)!==null&&e!==void 0)||e?(t=this.widget)===null||t===void 0||t.showMessage({type:2,content:p("not found","No elements found.")}):(i=this.widget)===null||i===void 0||i.showMessage({type:2}):(n=this.widget)===null||n===void 0||n.clearMessage()}shouldAllowFocus(e){return!this.widget||!this.pattern||this.filter.totalCount>0&&this.filter.matchCount<=1?!0:!el.isDefault(e.filterData)}layout(e){var t;this.width=e,(t=this.widget)===null||t===void 0||t.layout(e)}dispose(){this._history=void 0,this._onDidChangePattern.dispose(),this.enabledDisposables.dispose(),this.disposables.dispose()}};function Z1e(s,e){return s.position===e.position&&Bj(s,e)}function Bj(s,e){return s.node.element===e.node.element&&s.startIndex===e.startIndex&&s.height===e.height&&s.endIndex===e.endIndex}class X1e{constructor(e=[]){this.stickyNodes=e}get count(){return this.stickyNodes.length}equal(e){return Ci(this.stickyNodes,e.stickyNodes,Z1e)}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(!Ci(this.stickyNodes,e.stickyNodes,Bj)||this.count===0)return!1;const t=this.stickyNodes[this.count-1],i=e.stickyNodes[e.count-1];return t.position!==i.position}}class Y1e{constrainStickyScrollNodes(e,t,i){for(let n=0;ni||n>=t)return e.slice(0,n)}return e}}let R6=class extends H{constructor(e,t,i,n,o,r={}){var a;super(),this.tree=e,this.model=t,this.view=i,this.treeDelegate=o,this.maxWidgetViewRatio=.4;const l=this.validateStickySettings(r);this.stickyScrollMaxItemCount=l.stickyScrollMaxItemCount,this.stickyScrollDelegate=(a=r.stickyScrollDelegate)!==null&&a!==void 0?a:new Y1e,this._widget=this._register(new Q1e(i.getScrollableElement(),i,e,n,o,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.update()}get height(){return this._widget.height}getNodeAtHeight(e){let t;if(e===0?t=this.view.firstVisibleIndex:t=this.view.indexAt(e+this.view.scrollTop),!(t<0||t>=this.view.length))return this.view.element(t)}update(){const e=this.getNodeAtHeight(0);if(!e||this.tree.scrollTop===0){this._widget.setState(void 0);return}const t=this.findStickyState(e);this._widget.setState(t)}findStickyState(e){const t=[];let i=e,n=0,o=this.getNextStickyNode(i,void 0,n);for(;o&&(t.push(o),n+=o.height,!(t.length<=this.stickyScrollMaxItemCount&&(i=this.getNextVisibleNode(o),!i)));)o=this.getNextStickyNode(i,o.node,n);const r=this.constrainStickyNodes(t);return r.length?new X1e(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),o=t;return this.view.scrollTop===n-o}createStickyScrollNode(e,t){const i=this.treeDelegate.getHeight(e),{startIndex:n,endIndex:o}=this.getNodeRange(e),r=this.calculateStickyNodePosition(o,t,i);return{node:e,position:r,height:i,startIndex:n,endIndex:o}}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 o=n[n.length-1];if(n.length>this.stickyScrollMaxItemCount||o.position+o.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),o=i+n-1;return{startIndex:i,endIndex:o}}nodePositionTopBelowWidget(e){const t=[];let i=this.getParentNode(e);for(;i;)t.push(i),i=this.getParentNode(i);let n=0;for(let o=0;o0,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];if(this._previousState&&e.animationStateChanged(this._previousState))this._previousElements[this._previousState.count-1].style.top=`${n.position}px`;else{this._previousStateDisposables.clear();const o=Array(e.count);for(let r=e.count-1;r>=0;r--){const a=e.stickyNodes[r],{element:l,disposable:d}=this.createElement(a,r,e.count);o[r]=l,this._rootDomNode.appendChild(l),this._previousStateDisposables.add(d)}this.stickyScrollFocus.updateElements(o,e),this._previousElements=o}this._previousState=e,this._rootDomNode.style.height=`${n.position+n.height}px`}createElement(e,t,i){const n=e.startIndex,o=document.createElement("div");o.style.top=`${e.position}px`,this.tree.options.setRowHeight!==!1&&(o.style.height=`${e.height}px`),this.tree.options.setRowLineHeight!==!1&&(o.style.lineHeight=`${e.height}px`),o.classList.add("monaco-tree-sticky-row"),o.classList.add("monaco-list-row"),o.setAttribute("data-index",`${n}`),o.setAttribute("data-parity",n%2===0?"even":"odd"),o.setAttribute("id",this.view.getElementID(n));const r=this.setAccessibilityAttributes(o,e.node.element,t,i),a=this.treeDelegate.getTemplateId(e.node),l=this.treeRenderers.find(h=>h.templateId===a);if(!l)throw new Error(`No renderer found for template id ${a}`);let d=e.node;d===this.tree.getNode(this.tree.getNodeLocation(e.node))&&(d=new Proxy(e.node,{}));const c=l.renderTemplate(o);l.renderElement(d,e.startIndex,c,e.height);const u=Ie(()=>{r.dispose(),l.disposeElement(d,e.startIndex,c,e.height),l.disposeTemplate(c),o.remove()});return{element:o,disposable:u}}setAccessibilityAttributes(e,t,i,n){var o;if(!this.accessibilityProvider)return H.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",(o=this.accessibilityProvider.getRole(t))!==null&&o!==void 0?o:"treeitem");const r=this.accessibilityProvider.getAriaLabel(t),a=r&&typeof r!="string"?r:Ga(r),l=st(c=>{const u=c.readObservable(a);u?e.setAttribute("aria-label",u):e.removeAttribute("aria-label")});typeof r=="string"||r&&e.setAttribute("aria-label",r.get());const d=this.accessibilityProvider.getAriaLevel&&this.accessibilityProvider.getAriaLevel(t);return typeof d=="number"&&e.setAttribute("aria-level",`${d}`),e.setAttribute("aria-selected",String(!1)),l}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 J1e extends H{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 B,this.onDidChangeHasFocus=this._onDidChangeHasFocus.event,this._onContextMenu=new B,this.onContextMenu=this._onContextMenu.event,this._domHasFocus=!1,this.container.addEventListener("focus",()=>this.onFocus()),this.container.addEventListener("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(!fC(t)&&!lb(t)){this.focusedLast()&&this.view.domFocus();return}if(!Iu(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=>{var l;return a.node.element===((l=e.element)===null||l===void 0?void 0:l.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,o=this.elements[this.focusedIndex];this._onContextMenu.fire({element:n,anchor:o,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;!fC(t)&&!lb(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=xs(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,o=this.view.getElementTop(e),r=n?n.position+n.height+i.height:i.height;this.view.scrollTop=o-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 Qw(s){let e=ef.Unknown;return jE(s.browserEvent.target,"monaco-tl-twistie","monaco-tl-row")?e=ef.Twistie:jE(s.browserEvent.target,"monaco-tl-contents","monaco-tl-row")?e=ef.Element:jE(s.browserEvent.target,"monaco-tree-type-filter","monaco-list")&&(e=ef.Filter),{browserEvent:s.browserEvent,element:s.element?s.element.element:null,target:e}}function ewe(s){const e=fC(s.browserEvent.target);return{element:s.element?s.element.element:null,browserEvent:s.browserEvent,anchor:s.anchor,isStickyScroll:e}}function iS(s,e){e(s),s.children.forEach(t=>iS(t,e))}class KI{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 B,this.onDidChange=this._onDidChange.event}set(e,t){!(t!=null&&t.__forceEvent)&&Ci(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(),d=c=>l.delete(c);t.forEach(c=>iS(c,d)),this.set([...l.values()]);return}const i=new Set,n=l=>i.add(this.identityProvider.getId(l.element).toString());t.forEach(l=>iS(l,n));const o=new Map,r=l=>o.set(this.identityProvider.getId(l.element).toString(),l);e.forEach(l=>iS(l,r));const a=[];for(const l of this.nodes){const d=this.identityProvider.getId(l.element).toString();if(!i.has(d))a.push(l);else{const u=o.get(d);u&&u.visible&&a.push(u)}}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 twe extends yj{constructor(e,t,i){super(e),this.tree=t,this.stickyScrollProvider=i}onViewPointer(e){if(vj(e.browserEvent.target)||ch(e.browserEvent.target)||kv(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,o=lb(e.browserEvent.target);let r=!1;if(o?r=!0:typeof this.tree.expandOnlyOnTwistieClick=="function"?r=this.tree.expandOnlyOnTwistieClick(t.element):r=!!this.tree.expandOnlyOnTwistieClick,o)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&&(!o||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}}o||super.onViewPointer(e)}handleStickyScrollMouseEvent(e,t){if(DCe(e.browserEvent.target)||LCe(e.browserEvent.target))return;const i=this.stickyScrollProvider();if(!i)throw new Error("Sticky scroll controller not found");const n=this.list.indexOf(t),o=this.list.getElementTop(n),r=i.nodePositionTopBelowWidget(t);this.tree.scrollTop=o-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(!fC(t)&&!lb(t)){super.onMouseDown(e);return}}onContextMenu(e){const t=e.browserEvent.target;if(!fC(t)&&!lb(t)){super.onContextMenu(e);return}}}class iwe extends pr{constructor(e,t,i,n,o,r,a,l){super(e,t,i,n,l),this.focusTrait=o,this.selectionTrait=r,this.anchorTrait=a}createMouseController(e){return new twe(this,e.tree,e.stickyScrollProvider)}splice(e,t,i=[]){if(super.splice(e,t,i),i.length===0)return;const n=[],o=[];let r;i.forEach((a,l)=>{this.focusTrait.has(a)&&n.push(e+l),this.selectionTrait.has(a)&&o.push(e+l),this.anchorTrait.has(a)&&(r=e+l)}),n.length>0&&super.setFocus(Wc([...super.getFocus(),...n])),o.length>0&&super.setSelection(Wc([...super.getSelection(),...o])),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 Wj{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 le.filter(le.map(this.view.onMouseDblClick,Qw),e=>e.target!==ef.Filter)}get onMouseOver(){return le.map(this.view.onMouseOver,Qw)}get onMouseOut(){return le.map(this.view.onMouseOut,Qw)}get onContextMenu(){var e,t;return le.any(le.filter(le.map(this.view.onContextMenu,ewe),i=>!i.isStickyScroll),(t=(e=this.stickyScrollController)===null||e===void 0?void 0:e.onContextMenu)!==null&&t!==void 0?t:le.None)}get onPointer(){return le.map(this.view.onPointer,Qw)}get onKeyDown(){return this.view.onKeyDown}get onDidFocus(){return this.view.onDidFocus}get onDidChangeModel(){return le.signal(this.model.onDidSplice)}get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}get findMode(){var e,t;return(t=(e=this.findController)===null||e===void 0?void 0:e.mode)!==null&&t!==void 0?t:Lc.Highlight}set findMode(e){this.findController&&(this.findController.mode=e)}get findMatchType(){var e,t;return(t=(e=this.findController)===null||e===void 0?void 0:e.matchType)!==null&&t!==void 0?t:Tf.Fuzzy}set findMatchType(e){this.findController&&(this.findController.matchType=e)}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,o={}){var r;this._user=e,this._options=o,this.eventBufferer=new KP,this.onDidChangeFindOpenState=le.None,this.onDidChangeStickyScrollFocused=le.None,this.disposables=new Y,this._onWillRefilter=new B,this.onWillRefilter=this._onWillRefilter.event,this._onDidUpdateOptions=new B,this.treeDelegate=new NO(i);const a=new t3,l=new t3,d=this.disposables.add(new K1e(l.event)),c=new _F;this.renderers=n.map(m=>new mC(m,()=>this.model,a.event,d,c,o));for(const m of this.renderers)this.disposables.add(m);let u;o.keyboardNavigationLabelProvider&&(u=new q1e(this,o.keyboardNavigationLabelProvider,o.filter),o={...o,filter:u},this.disposables.add(u)),this.focus=new KI(()=>this.view.getFocusedElements()[0],o.identityProvider),this.selection=new KI(()=>this.view.getSelectedElements()[0],o.identityProvider),this.anchor=new KI(()=>this.view.getAnchorElement(),o.identityProvider),this.view=new iwe(e,t,this.treeDelegate,this.renderers,this.focus,this.selection,this.anchor,{...j1e(()=>this.model,o),tree:this,stickyScrollProvider:()=>this.stickyScrollController}),this.model=this.createModel(e,this.view,o),a.input=this.model.onDidChangeCollapseState;const h=le.forEach(this.model.onDidSplice,m=>{this.eventBufferer.bufferEvents(()=>{this.focus.onDidModelSplice(m),this.selection.onDidModelSplice(m)})},this.disposables);h(()=>null,null,this.disposables);const g=this.disposables.add(new B),f=this.disposables.add(new _a(0));if(this.disposables.add(le.any(h,this.focus.onDidChange,this.selection.onDidChange)(()=>{f.trigger(()=>{const m=new Set;for(const _ of this.focus.getNodes())m.add(_);for(const _ of this.selection.getNodes())m.add(_);g.fire([...m.values()])})})),l.input=g.event,o.keyboardSupport!==!1){const m=le.chain(this.view.onKeyDown,_=>_.filter(v=>!ch(v.target)).map(v=>new Kt(v)));le.chain(m,_=>_.filter(v=>v.keyCode===15))(this.onLeftArrow,this,this.disposables),le.chain(m,_=>_.filter(v=>v.keyCode===17))(this.onRightArrow,this,this.disposables),le.chain(m,_=>_.filter(v=>v.keyCode===10))(this.onSpace,this,this.disposables)}if((!((r=o.findWidgetEnabled)!==null&&r!==void 0)||r)&&o.keyboardNavigationLabelProvider&&o.contextViewProvider){const m=this.options.findWidgetStyles?{styles:this.options.findWidgetStyles}:void 0;this.findController=new G1e(this,this.model,this.view,u,o.contextViewProvider,m),this.focusNavigationFilter=_=>this.findController.shouldAllowFocus(_),this.onDidChangeFindOpenState=this.findController.onDidChangeOpenState,this.disposables.add(this.findController),this.onDidChangeFindMode=this.findController.onDidChangeMode,this.onDidChangeFindMatchType=this.findController.onDidChangeMatchType}else this.onDidChangeFindMode=le.None,this.onDidChangeFindMatchType=le.None;o.enableStickyScroll&&(this.stickyScrollController=new R6(this,this.model,this.view,this.renderers,this.treeDelegate,o),this.onDidChangeStickyScrollFocused=this.stickyScrollController.onDidChangeHasFocus),this.styleElement=ar(this.view.getHTMLElement()),this.getHTMLElement().classList.toggle("always",this._options.renderIndentGuides===M_.Always)}updateOptions(e={}){var t;this._options={...this._options,...e};for(const i of this.renderers)i.updateOptions(e);this.view.updateOptions(this._options),(t=this.findController)===null||t===void 0||t.updateOptions(e),this.updateStickyScroll(e),this._onDidUpdateOptions.fire(this._options),this.getHTMLElement().classList.toggle("always",this._options.renderIndentGuides===M_.Always)}get options(){return this._options}updateStickyScroll(e){var t;!this.stickyScrollController&&this._options.enableStickyScroll?(this.stickyScrollController=new R6(this,this.model,this.view,this.renderers,this.treeDelegate,this._options),this.onDidChangeStickyScrollFocused=this.stickyScrollController.onDidChangeHasFocus):this.stickyScrollController&&!this._options.enableStickyScroll&&(this.onDidChangeStickyScrollFocused=le.None,this.stickyScrollController.dispose(),this.stickyScrollController=void 0),(t=this.stickyScrollController)===null||t===void 0||t.updateOptions(e)}getHTMLElement(){return this.view.getHTMLElement()}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(){var e;!((e=this.stickyScrollController)===null||e===void 0)&&e.focusedLast()?this.stickyScrollController.domFocus():this.view.domFocus()}layout(e,t){var i;this.view.layout(e,t),yh(t)&&((i=this.findController)===null||i===void 0||i.layout(t))}style(e){var t,i;const n=`.${this.view.domId}`,o=[];e.treeIndentGuidesStroke&&(o.push(`.monaco-list${n}:hover .monaco-tl-indent > .indent-guide, .monaco-list${n}.always .monaco-tl-indent > .indent-guide { border-color: ${e.treeInactiveIndentGuidesStroke}; }`),o.push(`.monaco-list${n} .monaco-tl-indent > .indent-guide.active { border-color: ${e.treeIndentGuidesStroke}; }`));const r=(t=e.treeStickyScrollBackground)!==null&&t!==void 0?t:e.listBackground;r&&(o.push(`.monaco-list${n} .monaco-scrollable-element .monaco-tree-sticky-container { background-color: ${r}; }`),o.push(`.monaco-list${n} .monaco-scrollable-element .monaco-tree-sticky-container .monaco-tree-sticky-row { background-color: ${r}; }`)),e.treeStickyScrollBorder&&o.push(`.monaco-list${n} .monaco-scrollable-element .monaco-tree-sticky-container { border-bottom: 1px solid ${e.treeStickyScrollBorder}; }`),e.treeStickyScrollShadow&&o.push(`.monaco-list${n} .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&&(o.push(`.monaco-list${n}.sticky-scroll-focused .monaco-scrollable-element .monaco-tree-sticky-container:focus .monaco-list-row.focused { color: ${e.listFocusForeground}; }`),o.push(`.monaco-list${n}:not(.sticky-scroll-focused) .monaco-scrollable-element .monaco-tree-sticky-container .monaco-list-row.focused { color: inherit; }`));const a=Ec(e.listFocusAndSelectionOutline,Ec(e.listSelectionOutline,(i=e.listFocusOutline)!==null&&i!==void 0?i:""));a&&(o.push(`.monaco-list${n}.sticky-scroll-focused .monaco-scrollable-element .monaco-tree-sticky-container:focus .monaco-list-row.focused.selected { outline: 1px solid ${a}; outline-offset: -1px;}`),o.push(`.monaco-list${n}:not(.sticky-scroll-focused) .monaco-scrollable-element .monaco-tree-sticky-container .monaco-list-row.focused.selected { outline: inherit;}`)),e.listFocusOutline&&(o.push(`.monaco-list${n}.sticky-scroll-focused .monaco-scrollable-element .monaco-tree-sticky-container:focus .monaco-list-row.focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; }`),o.push(`.monaco-list${n}:not(.sticky-scroll-focused) .monaco-scrollable-element .monaco-tree-sticky-container .monaco-list-row.focused { outline: inherit; }`),o.push(`.monaco-workbench.context-menu-visible .monaco-list${n}.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; }`),o.push(`.monaco-workbench.context-menu-visible .monaco-list${n}.last-focused.sticky-scroll-focused .monaco-list-rows .monaco-list-row.focused { outline: inherit; }`),o.push(`.monaco-workbench.context-menu-visible .monaco-list${n}.last-focused:not(.sticky-scroll-focused) .monaco-tree-sticky-container .monaco-list-rows .monaco-list-row.focused { outline: inherit; }`)),this.styleElement.textContent=o.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(o=>this.model.getNode(o));this.selection.set(i,t);const n=e.map(o=>this.model.getListIndex(o)).filter(o=>o>-1);this.view.setSelection(n,t,!0)})}getSelection(){return this.selection.get()}setFocus(e,t){this.eventBufferer.bufferEvents(()=>{const i=e.map(o=>this.model.getNode(o));this.focus.set(i,t);const n=e.map(o=>this.model.getListIndex(o)).filter(o=>o>-1);this.view.setFocus(n,t,!0)})}focusNext(e=1,t=!1,i,n=Iu(i)&&i.altKey?void 0:this.focusNavigationFilter){this.view.focusNext(e,t,i,n)}focusPrevious(e=1,t=!1,i,n=Iu(i)&&i.altKey?void 0:this.focusNavigationFilter){this.view.focusPrevious(e,t,i,n)}focusNextPage(e,t=Iu(e)&&e.altKey?void 0:this.focusNavigationFilter){return this.view.focusNextPage(e,t)}focusPreviousPage(e,t=Iu(e)&&e.altKey?void 0:this.focusNavigationFilter){return this.view.focusPreviousPage(e,t,()=>{var i,n;return(n=(i=this.stickyScrollController)===null||i===void 0?void 0:i.height)!==null&&n!==void 0?n:0})}focusFirst(e,t=Iu(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),o=e.browserEvent.altKey;this.model.setCollapsed(n,void 0,o)}dispose(){var e;jt(this.disposables),(e=this.stickyScrollController)===null||e===void 0||e.dispose(),this.view.dispose()}}class AO{constructor(e,t,i={}){this.user=e,this.rootRef=null,this.nodes=new Map,this.nodesByIdentity=new Map,this.model=new z1e(e,t,null,i),this.onDidSplice=this.model.onDidSplice,this.onDidChangeCollapseState=this.model.onDidChangeCollapseState,this.onDidChangeRenderNodeCount=this.model.onDidChangeRenderNodeCount,i.sorter&&(this.sorter={compare(n,o){return i.sorter.compare(n.element,o.element)}}),this.identityProvider=i.identityProvider}setChildren(e,t=ft.empty(),i={}){const n=this.getElementLocation(e);this._setChildren(n,this.preserveCollapseState(t),i)}_setChildren(e,t=ft.empty(),i){const n=new Set,o=new Set,r=l=>{var d;if(l.element===null)return;const c=l;if(n.add(c.element),this.nodes.set(c.element,c),this.identityProvider){const u=this.identityProvider.getId(c.element).toString();o.add(u),this.nodesByIdentity.set(u,c)}(d=i.onDidCreateNode)===null||d===void 0||d.call(i,c)},a=l=>{var d;if(l.element===null)return;const c=l;if(n.has(c.element)||this.nodes.delete(c.element),this.identityProvider){const u=this.identityProvider.getId(c.element).toString();o.has(u)||this.nodesByIdentity.delete(u)}(d=i.onDidDeleteNode)===null||d===void 0||d.call(i,c)};this.model.splice([...e,0],Number.MAX_VALUE,t,{...i,onDidCreateNode:r,onDidDeleteNode:a})}preserveCollapseState(e=ft.empty()){return this.sorter&&(e=[...e].sort(this.sorter.compare.bind(this.sorter))),ft.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===Ko.Collapsed||t.collapsed===Ko.PreserveOrCollapsed?r=!0:t.collapsed===Ko.Expanded||t.collapsed===Ko.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 o;return typeof t.collapsed>"u"||t.collapsed===Ko.PreserveOrCollapsed||t.collapsed===Ko.PreserveOrExpanded?o=i.collapsed:t.collapsed===Ko.Collapsed?o=!0:t.collapsed===Ko.Expanded?o=!1:o=!!t.collapsed,{...t,collapsible:n,collapsed:o,children:this.preserveCollapseState(t.children)}})}rerender(e){const t=this.getElementLocation(e);this.model.rerender(t)}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 Xo(this.user,`Tree element not found: ${e}`);return t}getNodeLocation(e){return e.element}getParentNodeLocation(e){if(e===null)throw new Xo(this.user,"Invalid getParentNodeLocation call");const t=this.nodes.get(e);if(!t)throw new Xo(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 Xo(this.user,`Tree element not found: ${e}`);return this.model.getNodeLocation(t)}}function nS(s){const e=[s.element],t=s.incompressible||!1;return{element:{elements:e,incompressible:t},children:ft.map(ft.from(s.children),nS),collapsible:s.collapsible,collapsed:s.collapsed}}function sS(s){const e=[s.element],t=s.incompressible||!1;let i,n;for(;[n,i]=ft.consume(ft.from(s.children),2),!(n.length!==1||n[0].incompressible);)s=n[0],e.push(s.element);return{element:{elements:e,incompressible:t},children:ft.map(ft.concat(n,i),sS),collapsible:s.collapsible,collapsed:s.collapsed}}function B2(s,e=0){let t;return eB2(i,0)),e===0&&s.element.incompressible?{element:s.element.elements[e],children:t,incompressible:!0,collapsible:s.collapsible,collapsed:s.collapsed}:{element:s.element.elements[e],children:t,collapsible:s.collapsible,collapsed:s.collapsed}}function P6(s){return B2(s,0)}function Hj(s,e,t){return s.element===e?{...s,children:t}:{...s,children:ft.map(ft.from(s.children),i=>Hj(i,e,t))}}const nwe=s=>({getId(e){return e.elements.map(t=>s.getId(t).toString()).join("\0")}});class swe{get onDidSplice(){return this.model.onDidSplice}get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}get onDidChangeRenderNodeCount(){return this.model.onDidChangeRenderNodeCount}constructor(e,t,i={}){this.user=e,this.rootRef=null,this.nodes=new Map,this.model=new AO(e,t,i),this.enabled=typeof i.compressionEnabled>"u"?!0:i.compressionEnabled,this.identityProvider=i.identityProvider}setChildren(e,t=ft.empty(),i){const n=i.diffIdentityProvider&&nwe(i.diffIdentityProvider);if(e===null){const f=ft.map(t,this.enabled?sS:nS);this._setChildren(null,f,{diffIdentityProvider:n,diffDepth:1/0});return}const o=this.nodes.get(e);if(!o)throw new Xo(this.user,"Unknown compressed tree node");const r=this.model.getNode(o),a=this.model.getParentNodeLocation(o),l=this.model.getNode(a),d=P6(r),c=Hj(d,e,t),u=(this.enabled?sS:nS)(c),h=i.diffIdentityProvider?(f,m)=>i.diffIdentityProvider.getId(f)===i.diffIdentityProvider.getId(m):void 0;if(Ci(u.element.elements,r.element.elements,h)){this._setChildren(o,u.children||ft.empty(),{diffIdentityProvider:n,diffDepth:1});return}const g=l.children.map(f=>f===r?u: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=ft.map(i,P6),o=ft.map(n,e?sS:nS);this._setChildren(null,o,{diffIdentityProvider:this.identityProvider,diffDepth:1/0})}_setChildren(e,t,i){const n=new Set,o=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:o,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()}getCompressedNode(e){if(e===null)return null;const t=this.nodes.get(e);if(!t)throw new Xo(this.user,`Tree element not found: ${e}`);return t}}const owe=s=>s[s.length-1];class MO{get element(){return this.node.element===null?null:this.unwrapper(this.node.element)}get children(){return this.node.children.map(e=>new MO(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 rwe(s,e){return{splice(t,i,n){e.splice(t,i,n.map(o=>s.map(o)))},updateElementHeight(t,i){e.updateElementHeight(t,i)}}}function awe(s,e){return{...e,identityProvider:e.identityProvider&&{getId(t){return e.identityProvider.getId(s(t))}},sorter:e.sorter&&{compare(t,i){return e.sorter.compare(t.elements[0],i.elements[0])}},filter:e.filter&&{filter(t,i){return e.filter.filter(s(t),i)}}}}class lwe{get onDidSplice(){return le.map(this.model.onDidSplice,({insertedNodes:e,deletedNodes:t})=>({insertedNodes:e.map(i=>this.nodeMapper.map(i)),deletedNodes:t.map(i=>this.nodeMapper.map(i))}))}get onDidChangeCollapseState(){return le.map(this.model.onDidChangeCollapseState,({node:e,deep:t})=>({node:this.nodeMapper.map(e),deep:t}))}get onDidChangeRenderNodeCount(){return le.map(this.model.onDidChangeRenderNodeCount,e=>this.nodeMapper.map(e))}constructor(e,t,i={}){this.rootRef=null,this.elementMapper=i.elementMapper||owe;const n=o=>this.elementMapper(o.elements);this.nodeMapper=new IO(o=>new MO(n,o)),this.model=new swe(e,rwe(this.nodeMapper,t),awe(n,i))}setChildren(e,t=ft.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()}getCompressedTreeNode(e=null){return this.model.getNode(e)}}var dwe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};class RO extends Wj{get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}constructor(e,t,i,n,o={}){super(e,t,i,n,o),this.user=e}setChildren(e,t=ft.empty(),i){this.model.setChildren(e,t,i)}rerender(e){if(e===void 0){this.view.rerender();return}this.model.rerender(e)}hasElement(e){return this.model.has(e)}createModel(e,t,i){return new AO(e,t,i)}}class Vj{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 o=this.stickyScrollDelegate.getCompressedNode(e);o||(o=this.compressedTreeNodeProvider.getCompressedTreeNode(e.element)),o.element.elements.length===1?(i.compressedTreeNode=void 0,this.renderer.renderElement(e,t,i.data,n)):(i.compressedTreeNode=o,this.renderer.renderCompressedElements(o,t,i.data,n))}disposeElement(e,t,i,n){var o,r,a,l;i.compressedTreeNode?(r=(o=this.renderer).disposeCompressedElements)===null||r===void 0||r.call(o,i.compressedTreeNode,t,i.data,n):(l=(a=this.renderer).disposeElement)===null||l===void 0||l.call(a,e,t,i.data,n)}disposeTemplate(e){this.renderer.disposeTemplate(e.data)}renderTwistie(e,t){return this.renderer.renderTwistie?this.renderer.renderTwistie(e,t):!1}}dwe([zi],Vj.prototype,"compressedTreeNodeProvider",null);class cwe{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 cwe(()=>this.model),l=n.map(d=>new Vj(r,a,d));super(e,t,i,l,{...uwe(r,o),stickyScrollDelegate:a})}setChildren(e,t=ft.empty(),i){this.model.setChildren(e,t,i)}createModel(e,t,i){return new lwe(e,t,i)}updateOptions(e={}){super.updateOptions(e),typeof e.compressionEnabled<"u"&&this.model.setCompressionEnabled(e.compressionEnabled)}getCompressedTreeNode(e=null){return this.model.getCompressedTreeNode(e)}}function qI(s){return{...s,children:[],refreshPromise:void 0,stale:!0,slow:!1,forceExpanded:!1}}function W2(s,e){return e.parent?e.parent===s?!0:W2(s,e.parent):!1}function hwe(s,e){return s===e||W2(s,e)||W2(e,s)}class PO{get element(){return this.node.element.element}get children(){return this.node.children.map(e=>new PO(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 gwe{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(...Pe.asClassNameArray(oe.treeItemLoading)),!0):(t.classList.remove(...Pe.asClassNameArray(oe.treeItemLoading)),!1)}disposeElement(e,t,i,n){var o,r;(r=(o=this.renderer).disposeElement)===null||r===void 0||r.call(o,this.nodeMapper.map(e),t,i.templateData,n)}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}dispose(){this.renderedNodes.clear()}}function F6(s){return{browserEvent:s.browserEvent,elements:s.elements.map(e=>e.element)}}function O6(s){return{browserEvent:s.browserEvent,element:s.element&&s.element.element,target:s.target}}class fwe extends k1{constructor(e){super(e.elements.map(t=>t.element)),this.data=e}}function GI(s){return s instanceof k1?new fwe(s):s}class pwe{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){var i,n;(n=(i=this.dnd).onDragStart)===null||n===void 0||n.call(i,GI(e),t)}onDragOver(e,t,i,n,o,r=!0){return this.dnd.onDragOver(GI(e),t&&t.element,i,n,o)}drop(e,t,i,n,o){this.dnd.drop(GI(e),t&&t.element,i,n,o)}onDragEnd(e){var t,i;(i=(t=this.dnd).onDragEnd)===null||i===void 0||i.call(t,e)}dispose(){this.dnd.dispose()}}function Uj(s){return s&&{...s,collapseByDefault:!0,identityProvider:s.identityProvider&&{getId(e){return s.identityProvider.getId(e.element)}},dnd:s.dnd&&new pwe(s.dnd),multipleSelectionController:s.multipleSelectionController&&{isSelectionSingleChangeEvent(e){return s.multipleSelectionController.isSelectionSingleChangeEvent({...e,element:e.element})},isSelectionRangeChangeEvent(e){return s.multipleSelectionController.isSelectionRangeChangeEvent({...e,element:e.element})}},accessibilityProvider:s.accessibilityProvider&&{...s.accessibilityProvider,getPosInSet:void 0,getSetSize:void 0,getRole:s.accessibilityProvider.getRole?e=>s.accessibilityProvider.getRole(e.element):()=>"treeitem",isChecked:s.accessibilityProvider.isChecked?e=>{var t;return!!(!((t=s.accessibilityProvider)===null||t===void 0)&&t.isChecked(e.element))}:void 0,getAriaLabel(e){return s.accessibilityProvider.getAriaLabel(e.element)},getWidgetAriaLabel(){return s.accessibilityProvider.getWidgetAriaLabel()},getWidgetRole:s.accessibilityProvider.getWidgetRole?()=>s.accessibilityProvider.getWidgetRole():()=>"tree",getAriaLevel:s.accessibilityProvider.getAriaLevel&&(e=>s.accessibilityProvider.getAriaLevel(e.element)),getActiveDescendantId:s.accessibilityProvider.getActiveDescendantId&&(e=>s.accessibilityProvider.getActiveDescendantId(e.element))},filter:s.filter&&{filter(e,t){return s.filter.filter(e.element,t)}},keyboardNavigationLabelProvider:s.keyboardNavigationLabelProvider&&{...s.keyboardNavigationLabelProvider,getKeyboardNavigationLabel(e){return s.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e.element)}},sorter:void 0,expandOnlyOnTwistieClick:typeof s.expandOnlyOnTwistieClick>"u"?void 0:typeof s.expandOnlyOnTwistieClick!="function"?s.expandOnlyOnTwistieClick:e=>s.expandOnlyOnTwistieClick(e.element),defaultFindVisibility:e=>e.hasChildren&&e.stale?1:typeof s.defaultFindVisibility=="number"?s.defaultFindVisibility:typeof s.defaultFindVisibility>"u"?2:s.defaultFindVisibility(e.element)}}function H2(s,e){e(s),s.children.forEach(t=>H2(t,e))}class $j{get onDidScroll(){return this.tree.onDidScroll}get onDidChangeFocus(){return le.map(this.tree.onDidChangeFocus,F6)}get onDidChangeSelection(){return le.map(this.tree.onDidChangeSelection,F6)}get onMouseDblClick(){return le.map(this.tree.onMouseDblClick,O6)}get onPointer(){return le.map(this.tree.onPointer,O6)}get onDidFocus(){return this.tree.onDidFocus}get onDidChangeModel(){return this.tree.onDidChangeModel}get onDidChangeCollapseState(){return this.tree.onDidChangeCollapseState}get onDidChangeFindOpenState(){return this.tree.onDidChangeFindOpenState}get onDidChangeStickyScrollFocused(){return this.tree.onDidChangeStickyScrollFocused}get onDidDispose(){return this.tree.onDidDispose}constructor(e,t,i,n,o,r={}){this.user=e,this.dataSource=o,this.nodes=new Map,this.subTreeRefreshPromises=new Map,this.refreshPromises=new Map,this._onDidRender=new B,this._onDidChangeNodeSlowState=new B,this.nodeMapper=new IO(a=>new PO(a)),this.disposables=new Y,this.identityProvider=r.identityProvider,this.autoExpandSingleChildren=typeof r.autoExpandSingleChildren>"u"?!1:r.autoExpandSingleChildren,this.sorter=r.sorter,this.getDefaultCollapseState=a=>r.collapseByDefault?r.collapseByDefault(a)?Ko.PreserveOrCollapsed:Ko.PreserveOrExpanded:void 0,this.tree=this.createTree(e,t,i,n,r),this.onDidChangeFindMode=this.tree.onDidChangeFindMode,this.onDidChangeFindMatchType=this.tree.onDidChangeFindMatchType,this.root=qI({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)}createTree(e,t,i,n,o){const r=new NO(i),a=n.map(d=>new gwe(d,this.nodeMapper,this._onDidChangeNodeSlowState.event)),l=Uj(o)||{};return new RO(e,t,r,a,l)}updateOptions(e={}){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.refreshPromises.forEach(n=>n.cancel()),this.refreshPromises.clear(),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)}async _updateChildren(e=this.root.element,t=!0,i=!1,n,o){if(typeof this.root.element>"u")throw new Xo(this.user,"Tree input not set");this.root.refreshPromise&&(await this.root.refreshPromise,await le.toPromise(this._onDidRender.event));const r=this.getDataNode(e);if(await this.refreshAndRenderNode(r,t,n,o),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 Xo(this.user,"Tree input not set");this.root.refreshPromise&&(await this.root.refreshPromise,await le.toPromise(this._onDidRender.event));const i=this.getDataNode(e);if(this.tree.hasElement(i)&&!this.tree.isCollapsible(i)||(i.refreshPromise&&(await this.root.refreshPromise,await le.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 this.root.refreshPromise,await le.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)throw new Xo(this.user,`Data tree node not found: ${e}`);return t}async refreshAndRenderNode(e,t,i,n){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((o,r)=>{!n&&hwe(r,e)&&(n=o.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){let n;e.refreshPromise=new Promise(o=>n=o),this.subTreeRefreshPromises.set(e,e.refreshPromise),e.refreshPromise.finally(()=>{e.refreshPromise=void 0,this.subTreeRefreshPromises.delete(e)});try{const o=await this.doRefreshNode(e,t,i);e.stale=!1,await tA.settled(o.map(r=>this.doRefreshSubTree(r,t,i)))}finally{n()}}async doRefreshNode(e,t,i){e.hasChildren=!!this.dataSource.hasChildren(e.element);let n;if(!e.hasChildren)n=Promise.resolve(ft.empty());else{const o=this.doGetChildren(e);if(Z5(o))n=Promise.resolve(o);else{const r=xh(800);r.then(()=>{e.slow=!0,this._onDidChangeNodeSlowState.fire(e)},a=>null),n=o.finally(()=>r.cancel())}}try{const o=await n;return this.setChildren(e,o,t,i)}catch(o){if(e!==this.root&&this.tree.hasElement(e)&&this.tree.collapse(e),Id(o))return[];throw o}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 Z5(i)?this.processChildren(i):(t=Dn(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(Xe))}setChildren(e,t,i,n){const o=[...t];if(e.children.length===0&&o.length===0)return[];const r=new Map,a=new Map;for(const c of e.children)r.set(c.element,c),this.identityProvider&&a.set(c.id,{node:c,collapsed:this.tree.hasElement(c)&&this.tree.isCollapsed(c)});const l=[],d=o.map(c=>{const u=!!this.dataSource.hasChildren(c);if(!this.identityProvider){const m=qI({element:c,parent:e,hasChildren:u,defaultCollapseState:this.getDefaultCollapseState(c)});return u&&m.defaultCollapseState===Ko.PreserveOrExpanded&&l.push(m),m}const h=this.identityProvider.getId(c).toString(),g=a.get(h);if(g){const m=g.node;return r.delete(m.element),this.nodes.delete(m.element),this.nodes.set(c,m),m.element=c,m.hasChildren=u,i?g.collapsed?(m.children.forEach(_=>H2(_,v=>this.nodes.delete(v.element))),m.children.splice(0,m.children.length),m.stale=!0):l.push(m):u&&!g.collapsed&&l.push(m),m}const f=qI({element:c,parent:e,id:h,hasChildren:u,defaultCollapseState:this.getDefaultCollapseState(c)});return n&&n.viewState.focus&&n.viewState.focus.indexOf(h)>-1&&n.focus.push(f),n&&n.viewState.selection&&n.viewState.selection.indexOf(h)>-1&&n.selection.push(f),(n&&n.viewState.expanded&&n.viewState.expanded.indexOf(h)>-1||u&&f.defaultCollapseState===Ko.PreserveOrExpanded)&&l.push(f),f});for(const c of r.values())H2(c,u=>this.nodes.delete(u.element));for(const c of d)this.nodes.set(c.element,c);return e.children.splice(0,e.children.length,...d),e!==this.root&&this.autoExpandSingleChildren&&d.length===1&&l.length===0&&(d[0].forceExpanded=!0,l.push(d[0])),l}render(e,t,i){const n=e.children.map(r=>this.asTreeElement(r,t)),o=i&&{...i,diffIdentityProvider:i.diffIdentityProvider&&{getId(r){return i.diffIdentityProvider.getId(r.element)}}};this.tree.setChildren(e===this.root?null:e,n,o),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?ft.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 FO{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 FO(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 mwe{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(...Pe.asClassNameArray(oe.treeItemLoading)),!0):(t.classList.remove(...Pe.asClassNameArray(oe.treeItemLoading)),!1)}disposeElement(e,t,i,n){var o,r;(r=(o=this.renderer).disposeElement)===null||r===void 0||r.call(o,this.nodeMapper.map(e),t,i.templateData,n)}disposeCompressedElements(e,t,i,n){var o,r;(r=(o=this.renderer).disposeCompressedElements)===null||r===void 0||r.call(o,this.compressibleNodeMapperProvider().map(e),t,i.templateData,n)}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}dispose(){this.renderedNodes.clear(),this.disposables=jt(this.disposables)}}function _we(s){const e=s&&Uj(s);return e&&{...e,keyboardNavigationLabelProvider:e.keyboardNavigationLabelProvider&&{...e.keyboardNavigationLabelProvider,getCompressedNodeKeyboardNavigationLabel(t){return s.keyboardNavigationLabelProvider.getCompressedNodeKeyboardNavigationLabel(t.map(i=>i.element))}}}}class vwe extends $j{constructor(e,t,i,n,o,r,a={}){super(e,t,i,o,r,a),this.compressionDelegate=n,this.compressibleNodeMapper=new IO(l=>new FO(l)),this.filter=a.filter}createTree(e,t,i,n,o){const r=new NO(i),a=n.map(d=>new mwe(d,this.nodeMapper,()=>this.compressibleNodeMapper,this._onDidChangeNodeSlowState.event)),l=_we(o)||{};return new zj(e,t,r,a,l)}asTreeElement(e,t){return{incompressible:this.compressionDelegate.isIncompressible(e.element),...super.asTreeElement(e,t)}}updateOptions(e={}){this.tree.updateOptions(e)}render(e,t,i){if(!this.identityProvider)return super.render(e,t);const n=g=>this.identityProvider.getId(g).toString(),o=g=>{const f=new Set;for(const m of g){const _=this.tree.getCompressedTreeNode(m===this.root?null:m);if(_.element)for(const v of _.element.elements)f.add(n(v.element))}return f},r=o(this.tree.getSelection()),a=o(this.tree.getFocus());super.render(e,t,i);const l=this.getSelection();let d=!1;const c=this.getFocus();let u=!1;const h=g=>{const f=g.element;if(f)for(let m=0;m{const i=this.filter.filter(t,1),n=bwe(i);if(n===2)throw new Error("Recursive tree visibility not supported in async data compressed trees");return n===1})),super.processChildren(e)}}function bwe(s){return typeof s=="boolean"?s?1:0:TO(s)?pC(s.visibility):pC(s)}class Cwe extends Wj{constructor(e,t,i,n,o,r={}){super(e,t,i,n,r),this.user=e,this.dataSource=o,this.identityProvider=r.identityProvider}createModel(e,t,i){return new AO(e,t,i)}}new ue("isMac",lt,p("isMac","Whether the operating system is macOS"));new ue("isLinux",$s,p("isLinux","Whether the operating system is Linux"));const tk=new ue("isWindows",as,p("isWindows","Whether the operating system is Windows")),jj=new ue("isWeb",Jh,p("isWeb","Whether the platform is a web browser"));new ue("isMacNative",lt&&!Jh,p("isMacNative","Whether the operating system is macOS on a non-browser platform"));new ue("isIOS",_d,p("isIOS","Whether the operating system is iOS"));new ue("isMobile",RV,p("isMobile","Whether the platform is a mobile web browser"));new ue("isDevelopment",!1,!0);new ue("productQualityType","",p("productQualityType","Quality type of VS Code"));const Kj="inputFocus",wwe=new ue(Kj,!1,p("inputFocus","Whether keyboard focus is inside an input box"));var ou=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},ni=function(s,e){return function(t,i){e(t,i,s)}};const Kr=ut("listService");class ywe{get lastFocusedList(){return this._lastFocusedWidget}constructor(){this.disposables=new Y,this.lists=[],this._lastFocusedWidget=void 0,this._hasCreatedStyleController=!1}setLastFocusedList(e){var t,i;e!==this._lastFocusedWidget&&((t=this._lastFocusedWidget)===null||t===void 0||t.getHTMLElement().classList.remove("last-focused"),this._lastFocusedWidget=e,(i=this._lastFocusedWidget)===null||i===void 0||i.getHTMLElement().classList.add("last-focused"))}register(e,t){if(this._hasCreatedStyleController||(this._hasCreatedStyleController=!0,new Sj(ar(),"").style(cp)),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),tx(e.getHTMLElement())&&this.setLastFocusedList(e),ha(e.onDidFocus(()=>this.setLastFocusedList(e)),Ie(()=>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 _C=new ue("listScrollAtBoundary","none");G.or(_C.isEqualTo("top"),_C.isEqualTo("both"));G.or(_C.isEqualTo("bottom"),_C.isEqualTo("both"));const qj=new ue("listFocus",!0),Gj=new ue("treestickyScrollFocused",!1),ik=new ue("listSupportsMultiselect",!0),Zj=G.and(qj,G.not(Kj),Gj.negate()),OO=new ue("listHasSelectionOrFocus",!1),BO=new ue("listDoubleSelection",!1),WO=new ue("listMultiSelection",!1),nk=new ue("listSelectionNavigation",!1),Swe=new ue("listSupportsFind",!0),HO=new ue("treeElementCanCollapse",!1),Dwe=new ue("treeElementHasParent",!1),VO=new ue("treeElementCanExpand",!1),Lwe=new ue("treeElementHasChild",!1),xwe=new ue("treeFindOpen",!1),Xj="listTypeNavigationMode",Yj="listAutomaticKeyboardNavigation";function sk(s,e){const t=s.createScoped(e.getHTMLElement());return qj.bindTo(t),t}function ok(s,e){const t=_C.bindTo(s),i=()=>{const n=e.scrollTop===0,o=e.scrollHeight-e.renderHeight-e.scrollTop<1;n&&o?t.set("both"):n?t.set("top"):o?t.set("bottom"):t.set("none")};return i(),e.onDidScroll(i)}const gp="workbench.list.multiSelectModifier",oS="workbench.list.openMode",Pr="workbench.list.horizontalScrolling",zO="workbench.list.defaultFindMode",UO="workbench.list.typeNavigationMode",HD="workbench.list.keyboardNavigation",ll="workbench.list.scrollByPage",$O="workbench.list.defaultFindMatchType",vC="workbench.tree.indent",VD="workbench.tree.renderIndentGuides",dl="workbench.list.smoothScrolling",Dd="workbench.list.mouseWheelScrollSensitivity",Ld="workbench.list.fastScrollSensitivity",zD="workbench.tree.expandMode",UD="workbench.tree.enableStickyScroll",$D="workbench.tree.stickyScrollMaxItemCount";function xd(s){return s.getValue(gp)==="alt"}class kwe extends H{constructor(e){super(),this.configurationService=e,this.useAltAsMultipleSelectionModifier=xd(e),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>{e.affectsConfiguration(gp)&&(this.useAltAsMultipleSelectionModifier=xd(this.configurationService))}))}isSelectionSingleChangeEvent(e){return this.useAltAsMultipleSelectionModifier?e.browserEvent.altKey:Cj(e)}isSelectionRangeChangeEvent(e){return wj(e)}}function rk(s,e){var t;const i=s.get(rt),n=s.get(At),o=new Y;return[{...e,keyboardNavigationDelegate:{mightProducePrintableCharacter(a){return n.mightProducePrintableCharacter(a)}},smoothScrolling:!!i.getValue(dl),mouseWheelScrollSensitivity:i.getValue(Dd),fastScrollSensitivity:i.getValue(Ld),multipleSelectionController:(t=e.multipleSelectionController)!==null&&t!==void 0?t:o.add(new kwe(i)),keyboardNavigationEventFilter:Twe(n),scrollByPage:!!i.getValue(ll)},o]}let B6=class extends pr{constructor(e,t,i,n,o,r,a,l,d){const c=typeof o.horizontalScrolling<"u"?o.horizontalScrolling:!!l.getValue(Pr),[u,h]=d.invokeFunction(rk,o);super(e,t,i,n,{keyboardSupport:!1,...u,horizontalScrolling:c}),this.disposables.add(h),this.contextKeyService=sk(r,this),this.disposables.add(ok(this.contextKeyService,this)),this.listSupportsMultiSelect=ik.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(o.multipleSelectionSupport!==!1),nk.bindTo(this.contextKeyService).set(!!o.selectionNavigation),this.listHasSelectionOrFocus=OO.bindTo(this.contextKeyService),this.listDoubleSelection=BO.bindTo(this.contextKeyService),this.listMultiSelection=WO.bindTo(this.contextKeyService),this.horizontalScrolling=o.horizontalScrolling,this._useAltAsMultipleSelectionModifier=xd(l),this.disposables.add(this.contextKeyService),this.disposables.add(a.register(this)),this.updateStyles(o.overrideStyles),this.disposables.add(this.onDidChangeSelection(()=>{const f=this.getSelection(),m=this.getFocus();this.contextKeyService.bufferChangeEvents(()=>{this.listHasSelectionOrFocus.set(f.length>0||m.length>0),this.listMultiSelection.set(f.length>1),this.listDoubleSelection.set(f.length===2)})})),this.disposables.add(this.onDidChangeFocus(()=>{const f=this.getSelection(),m=this.getFocus();this.listHasSelectionOrFocus.set(f.length>0||m.length>0)})),this.disposables.add(l.onDidChangeConfiguration(f=>{f.affectsConfiguration(gp)&&(this._useAltAsMultipleSelectionModifier=xd(l));let m={};if(f.affectsConfiguration(Pr)&&this.horizontalScrolling===void 0){const _=!!l.getValue(Pr);m={...m,horizontalScrolling:_}}if(f.affectsConfiguration(ll)){const _=!!l.getValue(ll);m={...m,scrollByPage:_}}if(f.affectsConfiguration(dl)){const _=!!l.getValue(dl);m={...m,smoothScrolling:_}}if(f.affectsConfiguration(Dd)){const _=l.getValue(Dd);m={...m,mouseWheelScrollSensitivity:_}}if(f.affectsConfiguration(Ld)){const _=l.getValue(Ld);m={...m,fastScrollSensitivity:_}}Object.keys(m).length>0&&this.updateOptions(m)})),this.navigator=new Qj(this,{configurationService:l,...o}),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?up(e):cp)}};B6=ou([ni(5,Be),ni(6,Kr),ni(7,rt),ni(8,Ne)],B6);let W6=class extends D1e{constructor(e,t,i,n,o,r,a,l,d){const c=typeof o.horizontalScrolling<"u"?o.horizontalScrolling:!!l.getValue(Pr),[u,h]=d.invokeFunction(rk,o);super(e,t,i,n,{keyboardSupport:!1,...u,horizontalScrolling:c}),this.disposables=new Y,this.disposables.add(h),this.contextKeyService=sk(r,this),this.disposables.add(ok(this.contextKeyService,this.widget)),this.horizontalScrolling=o.horizontalScrolling,this.listSupportsMultiSelect=ik.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(o.multipleSelectionSupport!==!1),nk.bindTo(this.contextKeyService).set(!!o.selectionNavigation),this._useAltAsMultipleSelectionModifier=xd(l),this.disposables.add(this.contextKeyService),this.disposables.add(a.register(this)),this.updateStyles(o.overrideStyles),this.disposables.add(l.onDidChangeConfiguration(f=>{f.affectsConfiguration(gp)&&(this._useAltAsMultipleSelectionModifier=xd(l));let m={};if(f.affectsConfiguration(Pr)&&this.horizontalScrolling===void 0){const _=!!l.getValue(Pr);m={...m,horizontalScrolling:_}}if(f.affectsConfiguration(ll)){const _=!!l.getValue(ll);m={...m,scrollByPage:_}}if(f.affectsConfiguration(dl)){const _=!!l.getValue(dl);m={...m,smoothScrolling:_}}if(f.affectsConfiguration(Dd)){const _=l.getValue(Dd);m={...m,mouseWheelScrollSensitivity:_}}if(f.affectsConfiguration(Ld)){const _=l.getValue(Ld);m={...m,fastScrollSensitivity:_}}Object.keys(m).length>0&&this.updateOptions(m)})),this.navigator=new Qj(this,{configurationService:l,...o}),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?up(e):cp)}dispose(){this.disposables.dispose(),super.dispose()}};W6=ou([ni(5,Be),ni(6,Kr),ni(7,rt),ni(8,Ne)],W6);let H6=class extends ek{constructor(e,t,i,n,o,r,a,l,d,c){const u=typeof r.horizontalScrolling<"u"?r.horizontalScrolling:!!d.getValue(Pr),[h,g]=c.invokeFunction(rk,r);super(e,t,i,n,o,{keyboardSupport:!1,...h,horizontalScrolling:u}),this.disposables.add(g),this.contextKeyService=sk(a,this),this.disposables.add(ok(this.contextKeyService,this)),this.listSupportsMultiSelect=ik.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(r.multipleSelectionSupport!==!1),nk.bindTo(this.contextKeyService).set(!!r.selectionNavigation),this.listHasSelectionOrFocus=OO.bindTo(this.contextKeyService),this.listDoubleSelection=BO.bindTo(this.contextKeyService),this.listMultiSelection=WO.bindTo(this.contextKeyService),this.horizontalScrolling=r.horizontalScrolling,this._useAltAsMultipleSelectionModifier=xd(d),this.disposables.add(this.contextKeyService),this.disposables.add(l.register(this)),this.updateStyles(r.overrideStyles),this.disposables.add(this.onDidChangeSelection(()=>{const m=this.getSelection(),_=this.getFocus();this.contextKeyService.bufferChangeEvents(()=>{this.listHasSelectionOrFocus.set(m.length>0||_.length>0),this.listMultiSelection.set(m.length>1),this.listDoubleSelection.set(m.length===2)})})),this.disposables.add(this.onDidChangeFocus(()=>{const m=this.getSelection(),_=this.getFocus();this.listHasSelectionOrFocus.set(m.length>0||_.length>0)})),this.disposables.add(d.onDidChangeConfiguration(m=>{m.affectsConfiguration(gp)&&(this._useAltAsMultipleSelectionModifier=xd(d));let _={};if(m.affectsConfiguration(Pr)&&this.horizontalScrolling===void 0){const v=!!d.getValue(Pr);_={..._,horizontalScrolling:v}}if(m.affectsConfiguration(ll)){const v=!!d.getValue(ll);_={..._,scrollByPage:v}}if(m.affectsConfiguration(dl)){const v=!!d.getValue(dl);_={..._,smoothScrolling:v}}if(m.affectsConfiguration(Dd)){const v=d.getValue(Dd);_={..._,mouseWheelScrollSensitivity:v}}if(m.affectsConfiguration(Ld)){const v=d.getValue(Ld);_={..._,fastScrollSensitivity:v}}Object.keys(_).length>0&&this.updateOptions(_)})),this.navigator=new Ewe(this,{configurationService:d,...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?up(e):cp)}dispose(){this.disposables.dispose(),super.dispose()}};H6=ou([ni(6,Be),ni(7,Kr),ni(8,rt),ni(9,Ne)],H6);class jO extends H{constructor(e,t){var i;super(),this.widget=e,this._onDidOpen=this._register(new B),this.onDidOpen=this._onDidOpen.event,this._register(le.filter(this.widget.onDidChangeSelection,n=>Iu(n.browserEvent))(n=>this.onSelectionFromKeyboard(n))),this._register(this.widget.onPointer(n=>this.onPointer(n.element,n.browserEvent))),this._register(this.widget.onMouseDblClick(n=>this.onMouseDblClick(n.element,n.browserEvent))),typeof(t==null?void 0:t.openOnSingleClick)!="boolean"&&(t!=null&&t.configurationService)?(this.openOnSingleClick=(t==null?void 0:t.configurationService.getValue(oS))!=="doubleClick",this._register(t==null?void 0:t.configurationService.onDidChangeConfiguration(n=>{n.affectsConfiguration(oS)&&(this.openOnSingleClick=(t==null?void 0:t.configurationService.getValue(oS))!=="doubleClick")}))):this.openOnSingleClick=(i=t==null?void 0:t.openOnSingleClick)!==null&&i!==void 0?i:!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,o=!0,r=n,a=t.ctrlKey||t.metaKey||t.altKey;this._open(e,o,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 o=!1,r=!0,a=t.ctrlKey||t.metaKey||t.altKey;this._open(e,o,r,a,t)}_open(e,t,i,n,o){e&&this._onDidOpen.fire({editorOptions:{preserveFocus:t,pinned:i,revealIfVisible:!0},sideBySide:n,element:e,browserEvent:o})}}class Qj extends jO{constructor(e,t){super(e,t),this.widget=e}getSelectedElement(){return this.widget.getSelectedElements()[0]}}class Ewe extends jO{constructor(e,t){super(e,t)}getSelectedElement(){return this.widget.getSelectedElements()[0]}}class Iwe extends jO{constructor(e,t){super(e,t)}getSelectedElement(){var e;return(e=this.widget.getSelection()[0])!==null&&e!==void 0?e:void 0}}function Twe(s){let e=!1;return t=>{if(t.toKeyCodeChord().isModifierKey())return!1;if(e)return e=!1,!1;const i=s.softDispatch(t,t.target);return i.kind===1?(e=!0,!1):(e=!1,i.kind===0)}}let V2=class extends RO{constructor(e,t,i,n,o,r,a,l,d){const{options:c,getTypeNavigationMode:u,disposable:h}=r.invokeFunction(M1,o);super(e,t,i,n,c),this.disposables.add(h),this.internals=new Nf(this,o,u,o.overrideStyles,a,l,d),this.disposables.add(this.internals)}updateOptions(e){super.updateOptions(e),this.internals.updateOptions(e)}};V2=ou([ni(5,Ne),ni(6,Be),ni(7,Kr),ni(8,rt)],V2);let V6=class extends zj{constructor(e,t,i,n,o,r,a,l,d){const{options:c,getTypeNavigationMode:u,disposable:h}=r.invokeFunction(M1,o);super(e,t,i,n,c),this.disposables.add(h),this.internals=new Nf(this,o,u,o.overrideStyles,a,l,d),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};V6=ou([ni(5,Ne),ni(6,Be),ni(7,Kr),ni(8,rt)],V6);let z6=class extends Cwe{constructor(e,t,i,n,o,r,a,l,d,c){const{options:u,getTypeNavigationMode:h,disposable:g}=a.invokeFunction(M1,r);super(e,t,i,n,o,u),this.disposables.add(g),this.internals=new Nf(this,r,h,r.overrideStyles,l,d,c),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles!==void 0&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};z6=ou([ni(6,Ne),ni(7,Be),ni(8,Kr),ni(9,rt)],z6);let z2=class extends $j{get onDidOpen(){return this.internals.onDidOpen}constructor(e,t,i,n,o,r,a,l,d,c){const{options:u,getTypeNavigationMode:h,disposable:g}=a.invokeFunction(M1,r);super(e,t,i,n,o,u),this.disposables.add(g),this.internals=new Nf(this,r,h,r.overrideStyles,l,d,c),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};z2=ou([ni(6,Ne),ni(7,Be),ni(8,Kr),ni(9,rt)],z2);let U6=class extends vwe{constructor(e,t,i,n,o,r,a,l,d,c,u){const{options:h,getTypeNavigationMode:g,disposable:f}=l.invokeFunction(M1,a);super(e,t,i,n,o,r,h),this.disposables.add(f),this.internals=new Nf(this,a,g,a.overrideStyles,d,c,u),this.disposables.add(this.internals)}updateOptions(e){super.updateOptions(e),this.internals.updateOptions(e)}};U6=ou([ni(7,Ne),ni(8,Be),ni(9,Kr),ni(10,rt)],U6);function Jj(s){const e=s.getValue(zO);if(e==="highlight")return Lc.Highlight;if(e==="filter")return Lc.Filter;const t=s.getValue(HD);if(t==="simple"||t==="highlight")return Lc.Highlight;if(t==="filter")return Lc.Filter}function eK(s){const e=s.getValue($O);if(e==="fuzzy")return Tf.Fuzzy;if(e==="contiguous")return Tf.Contiguous}function M1(s,e){var t;const i=s.get(rt),n=s.get(nu),o=s.get(Be),r=s.get(Ne),a=()=>{const g=o.getContextKeyValue(Xj);if(g==="automatic")return Kl.Automatic;if(g==="trigger"||o.getContextKeyValue(Yj)===!1)return Kl.Trigger;const m=i.getValue(UO);if(m==="automatic")return Kl.Automatic;if(m==="trigger")return Kl.Trigger},l=e.horizontalScrolling!==void 0?e.horizontalScrolling:!!i.getValue(Pr),[d,c]=r.invokeFunction(rk,e),u=e.paddingBottom,h=e.renderIndentGuides!==void 0?e.renderIndentGuides:i.getValue(VD);return{getTypeNavigationMode:a,disposable:c,options:{keyboardSupport:!1,...d,indent:typeof i.getValue(vC)=="number"?i.getValue(vC):void 0,renderIndentGuides:h,smoothScrolling:!!i.getValue(dl),defaultFindMode:Jj(i),defaultFindMatchType:eK(i),horizontalScrolling:l,scrollByPage:!!i.getValue(ll),paddingBottom:u,hideTwistiesOfChildlessElements:e.hideTwistiesOfChildlessElements,expandOnlyOnTwistieClick:(t=e.expandOnlyOnTwistieClick)!==null&&t!==void 0?t:i.getValue(zD)==="doubleClick",contextViewProvider:n,findWidgetStyles:XCe,enableStickyScroll:!!i.getValue(UD),stickyScrollMaxItemCount:Number(i.getValue($D))}}}let Nf=class{get onDidOpen(){return this.navigator.onDidOpen}constructor(e,t,i,n,o,r,a){var l;this.tree=e,this.disposables=[],this.contextKeyService=sk(o,e),this.disposables.push(ok(this.contextKeyService,e)),this.listSupportsMultiSelect=ik.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(t.multipleSelectionSupport!==!1),nk.bindTo(this.contextKeyService).set(!!t.selectionNavigation),this.listSupportFindWidget=Swe.bindTo(this.contextKeyService),this.listSupportFindWidget.set((l=t.findWidgetEnabled)!==null&&l!==void 0?l:!0),this.hasSelectionOrFocus=OO.bindTo(this.contextKeyService),this.hasDoubleSelection=BO.bindTo(this.contextKeyService),this.hasMultiSelection=WO.bindTo(this.contextKeyService),this.treeElementCanCollapse=HO.bindTo(this.contextKeyService),this.treeElementHasParent=Dwe.bindTo(this.contextKeyService),this.treeElementCanExpand=VO.bindTo(this.contextKeyService),this.treeElementHasChild=Lwe.bindTo(this.contextKeyService),this.treeFindOpen=xwe.bindTo(this.contextKeyService),this.treeStickyScrollFocused=Gj.bindTo(this.contextKeyService),this._useAltAsMultipleSelectionModifier=xd(a),this.updateStyleOverrides(n);const c=()=>{const h=e.getFocus()[0];if(!h)return;const g=e.getNode(h);this.treeElementCanCollapse.set(g.collapsible&&!g.collapsed),this.treeElementHasParent.set(!!e.getParentElement(h)),this.treeElementCanExpand.set(g.collapsible&&g.collapsed),this.treeElementHasChild.set(!!e.getFirstElementChild(h))},u=new Set;u.add(Xj),u.add(Yj),this.disposables.push(this.contextKeyService,r.register(e),e.onDidChangeSelection(()=>{const h=e.getSelection(),g=e.getFocus();this.contextKeyService.bufferChangeEvents(()=>{this.hasSelectionOrFocus.set(h.length>0||g.length>0),this.hasMultiSelection.set(h.length>1),this.hasDoubleSelection.set(h.length===2)})}),e.onDidChangeFocus(()=>{const h=e.getSelection(),g=e.getFocus();this.hasSelectionOrFocus.set(h.length>0||g.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 g={};if(h.affectsConfiguration(gp)&&(this._useAltAsMultipleSelectionModifier=xd(a)),h.affectsConfiguration(vC)){const f=a.getValue(vC);g={...g,indent:f}}if(h.affectsConfiguration(VD)&&t.renderIndentGuides===void 0){const f=a.getValue(VD);g={...g,renderIndentGuides:f}}if(h.affectsConfiguration(dl)){const f=!!a.getValue(dl);g={...g,smoothScrolling:f}}if(h.affectsConfiguration(zO)||h.affectsConfiguration(HD)){const f=Jj(a);g={...g,defaultFindMode:f}}if(h.affectsConfiguration(UO)||h.affectsConfiguration(HD)){const f=i();g={...g,typeNavigationMode:f}}if(h.affectsConfiguration($O)){const f=eK(a);g={...g,defaultFindMatchType:f}}if(h.affectsConfiguration(Pr)&&t.horizontalScrolling===void 0){const f=!!a.getValue(Pr);g={...g,horizontalScrolling:f}}if(h.affectsConfiguration(ll)){const f=!!a.getValue(ll);g={...g,scrollByPage:f}}if(h.affectsConfiguration(zD)&&t.expandOnlyOnTwistieClick===void 0&&(g={...g,expandOnlyOnTwistieClick:a.getValue(zD)==="doubleClick"}),h.affectsConfiguration(UD)){const f=a.getValue(UD);g={...g,enableStickyScroll:f}}if(h.affectsConfiguration($D)){const f=Math.max(1,a.getValue($D));g={...g,stickyScrollMaxItemCount:f}}if(h.affectsConfiguration(Dd)){const f=a.getValue(Dd);g={...g,mouseWheelScrollSensitivity:f}}if(h.affectsConfiguration(Ld)){const f=a.getValue(Ld);g={...g,fastScrollSensitivity:f}}Object.keys(g).length>0&&e.updateOptions(g)}),this.contextKeyService.onDidChangeContext(h=>{h.affectsSome(u)&&e.updateOptions({typeNavigationMode:i()})})),this.navigator=new Iwe(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?up(e):cp)}dispose(){this.disposables=jt(this.disposables)}};Nf=ou([ni(4,Be),ni(5,Kr),ni(6,rt)],Nf);const Nwe=Ji.as(pl.Configuration);Nwe.registerConfiguration({id:"workbench",order:7,title:p("workbenchConfigurationTitle","Workbench"),type:"object",properties:{[gp]:{type:"string",enum:["ctrlCmd","alt"],markdownEnumDescriptions:[p("multiSelectModifier.ctrlCmd","Maps to `Control` on Windows and Linux and to `Command` on macOS."),p("multiSelectModifier.alt","Maps to `Alt` on Windows and Linux and to `Option` on macOS.")],default:"ctrlCmd",description:p({},"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.")},[oS]:{type:"string",enum:["singleClick","doubleClick"],default:"singleClick",description:p({},"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:p("horizontalScrolling setting","Controls whether lists and trees support horizontal scrolling in the workbench. Warning: turning on this setting has a performance implication.")},[ll]:{type:"boolean",default:!1,description:p("list.scrollByPage","Controls whether clicks in the scrollbar scroll page by page.")},[vC]:{type:"number",default:8,minimum:4,maximum:40,description:p("tree indent setting","Controls tree indentation in pixels.")},[VD]:{type:"string",enum:["none","onHover","always"],default:"onHover",description:p("render tree indent guides","Controls whether the tree should render indent guides.")},[dl]:{type:"boolean",default:!1,description:p("list smoothScrolling setting","Controls whether lists and trees have smooth scrolling.")},[Dd]:{type:"number",default:1,markdownDescription:p("Mouse Wheel Scroll Sensitivity","A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.")},[Ld]:{type:"number",default:5,markdownDescription:p("Fast Scroll Sensitivity","Scrolling speed multiplier when pressing `Alt`.")},[zO]:{type:"string",enum:["highlight","filter"],enumDescriptions:[p("defaultFindModeSettingKey.highlight","Highlight elements when searching. Further up and down navigation will traverse only the highlighted elements."),p("defaultFindModeSettingKey.filter","Filter elements when searching.")],default:"highlight",description:p("defaultFindModeSettingKey","Controls the default find mode for lists and trees in the workbench.")},[HD]:{type:"string",enum:["simple","highlight","filter"],enumDescriptions:[p("keyboardNavigationSettingKey.simple","Simple keyboard navigation focuses elements which match the keyboard input. Matching is done only on prefixes."),p("keyboardNavigationSettingKey.highlight","Highlight keyboard navigation highlights elements which match the keyboard input. Further up and down navigation will traverse only the highlighted elements."),p("keyboardNavigationSettingKey.filter","Filter keyboard navigation will filter out and hide all the elements which do not match the keyboard input.")],default:"highlight",description:p("keyboardNavigationSettingKey","Controls the keyboard navigation style for lists and trees in the workbench. Can be simple, highlight and filter."),deprecated:!0,deprecationMessage:p("keyboardNavigationSettingKeyDeprecated","Please use 'workbench.list.defaultFindMode' and 'workbench.list.typeNavigationMode' instead.")},[$O]:{type:"string",enum:["fuzzy","contiguous"],enumDescriptions:[p("defaultFindMatchTypeSettingKey.fuzzy","Use fuzzy matching when searching."),p("defaultFindMatchTypeSettingKey.contiguous","Use contiguous matching when searching.")],default:"fuzzy",description:p("defaultFindMatchTypeSettingKey","Controls the type of matching used when searching lists and trees in the workbench.")},[zD]:{type:"string",enum:["singleClick","doubleClick"],default:"singleClick",description:p("expand mode","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.")},[UD]:{type:"boolean",default:!0,description:p("sticky scroll","Controls whether sticky scrolling is enabled in trees.")},[$D]:{type:"number",minimum:1,default:7,markdownDescription:p("sticky scroll maximum items","Controls the number of sticky elements displayed in the tree when `#workbench.tree.enableStickyScroll#` is enabled.")},[UO]:{type:"string",enum:["automatic","trigger"],default:"automatic",markdownDescription:p("typeNavigationMode2","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 uh extends H{constructor(e,t){var i;super(),this.options=t,this.text="",this.title="",this.highlights=[],this.didEverRender=!1,this.supportIcons=(i=t==null?void 0:t.supportIcons)!==null&&i!==void 0?i:!1,this.domNode=Q(e,he("span.monaco-highlighted-label"))}get element(){return this.domNode}set(e,t=[],i="",n){e||(e=""),n&&(e=uh.escapeNewLines(e,t)),!(this.didEverRender&&this.text===e&&this.title===i&&tr(this.highlights,t))&&(this.text=e,this.title=i,this.highlights=t,this.render())}render(){var e,t,i,n;const o=[];let r=0;for(const a of this.highlights){if(a.end===a.start)continue;if(r{n=o===`\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 X0{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 className(e){this.disposed||e===this._className||(this._className=e,this._element.className=e)}set empty(e){this.disposed||e===this._empty||(this._empty=e,this._element.style.marginLeft=e?"0":"")}dispose(){this.disposed=!0}}class jD extends H{constructor(e,t){var i;super(),this.customHovers=new Map,this.creationOptions=t,this.domNode=this._register(new X0(Q(e,he(".monaco-icon-label")))),this.labelContainer=Q(this.domNode.element,he(".monaco-icon-label-container")),this.nameContainer=Q(this.labelContainer,he("span.monaco-icon-name-container")),t!=null&&t.supportHighlights||t!=null&&t.supportIcons?this.nameNode=this._register(new Rwe(this.nameContainer,!!t.supportIcons)):this.nameNode=new Awe(this.nameContainer),this.hoverDelegate=(i=t==null?void 0:t.hoverDelegate)!==null&&i!==void 0?i:Xs("mouse")}get element(){return this.domNode.element}setLabel(e,t,i){var n;const o=["monaco-icon-label"],r=["monaco-icon-label-container"];let a="";if(i&&(i.extraClasses&&o.push(...i.extraClasses),i.italic&&o.push("italic"),i.strikethrough&&o.push("strikethrough"),i.disabledCommand&&r.push("disabled"),i.title&&(typeof i.title=="string"?a+=i.title:a+=e)),this.domNode.className=o.join(" "),this.domNode.element.setAttribute("aria-label",a),this.labelContainer.className=r.join(" "),this.setupHover(i!=null&&i.descriptionTitle?this.labelContainer:this.element,i==null?void 0:i.title),this.nameNode.setLabel(e,i),t||this.descriptionNode){const l=this.getOrCreateDescriptionNode();l instanceof uh?(l.set(t||"",i?i.descriptionMatches:void 0,void 0,i==null?void 0:i.labelEscapeNewLines),this.setupHover(l.element,i==null?void 0:i.descriptionTitle)):(l.textContent=t&&(i!=null&&i.labelEscapeNewLines)?uh.escapeNewLines(t,[]):t||"",this.setupHover(l.element,(i==null?void 0:i.descriptionTitle)||""),l.empty=!t)}if(i!=null&&i.suffix||this.suffixNode){const l=this.getOrCreateSuffixNode();l.textContent=(n=i==null?void 0:i.suffix)!==null&&n!==void 0?n:""}}setupHover(e,t){const i=this.customHovers.get(e);if(i&&(i.dispose(),this.customHovers.delete(e)),!t){e.removeAttribute("title");return}if(this.hoverDelegate.showNativeHover)(function(o,r){lo(r)?o.title=rj(r):r!=null&&r.markdownNotSupportedFallback?o.title=r.markdownNotSupportedFallback:o.removeAttribute("title")})(e,t);else{const n=_l().setupUpdatableHover(this.hoverDelegate,e,t);n&&this.customHovers.set(e,n)}}dispose(){super.dispose();for(const e of this.customHovers.values())e.dispose();this.customHovers.clear()}getOrCreateSuffixNode(){if(!this.suffixNode){const e=this._register(new X0(Gae(this.nameContainer,he("span.monaco-icon-suffix-container"))));this.suffixNode=this._register(new X0(Q(e.element,he("span.label-suffix"))))}return this.suffixNode}getOrCreateDescriptionNode(){var e;if(!this.descriptionNode){const t=this._register(new X0(Q(this.labelContainer,he("span.monaco-icon-description-container"))));!((e=this.creationOptions)===null||e===void 0)&&e.supportDescriptionHighlights?this.descriptionNode=this._register(new uh(Q(t.element,he("span.label-description")),{supportIcons:!!this.creationOptions.supportIcons})):this.descriptionNode=this._register(new X0(Q(t.element,he("span.label-description"))))}return this.descriptionNode}}class Awe{constructor(e){this.container=e,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(!(this.label===e&&tr(this.options,t)))if(this.label=e,this.options=t,typeof e=="string")this.singleLabel||(this.container.innerText="",this.container.classList.remove("multiple"),this.singleLabel=Q(this.container,he("a.label-name",{id:t==null?void 0:t.domId}))),this.singleLabel.textContent=e;else{this.container.innerText="",this.container.classList.add("multiple"),this.singleLabel=void 0;for(let i=0;i{const o={start:i,end:i+n.length},r=t.map(a=>ts.intersect(o,a)).filter(a=>!ts.isEmpty(a)).map(({start:a,end:l})=>({start:a-i,end:l-i}));return i=o.end+e.length,r})}class Rwe extends H{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&&tr(this.options,t)))if(this.label=e,this.options=t,typeof e=="string")this.singleLabel||(this.container.innerText="",this.container.classList.remove("multiple"),this.singleLabel=this._register(new uh(Q(this.container,he("a.label-name",{id:t==null?void 0:t.domId})),{supportIcons:this.supportIcons}))),this.singleLabel.set(e,t==null?void 0:t.matches,void 0,t==null?void 0:t.labelEscapeNewLines);else{this.container.innerText="",this.container.classList.add("multiple"),this.singleLabel=void 0;const i=(t==null?void 0:t.separator)||"/",n=Mwe(e,i,t==null?void 0:t.matches);for(let o=0;o{const s=new Intl.Collator(void 0,{numeric:!0,sensitivity:"base"});return{collator:s,collatorIsNumeric:s.resolvedOptions().numeric}});function Pwe(s,e,t=!1){const i=s||"",n=e||"",o=$6.value.collator.compare(i,n);return $6.value.collatorIsNumeric&&o===0&&i!==n?in.length)return 1}return 0}var ak=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},iK=function(s,e){return function(t,i){e(t,i,s)}},U2;const Aa=he;var sn;(function(s){s[s.First=1]="First",s[s.Second=2]="Second",s[s.Last=3]="Last",s[s.Next=4]="Next",s[s.Previous=5]="Previous",s[s.NextPage=6]="NextPage",s[s.PreviousPage=7]="PreviousPage",s[s.NextSeparator=8]="NextSeparator",s[s.PreviousSeparator=9]="PreviousSeparator"})(sn||(sn={}));class nK{constructor(e,t,i){this.index=e,this.hasCheckbox=t,this._hidden=!1,this._init=new gl(()=>{var n;const o=(n=i.label)!==null&&n!==void 0?n:"",r=xv(o).text.trim(),a=i.ariaLabel||[o,this.saneDescription,this.saneDetail].map(l=>Ive(l)).filter(l=>!!l).join(", ");return{saneLabel:o,saneSortLabel:r,saneAriaLabel:a}}),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 hs extends nK{constructor(e,t,i,n,o,r){var a,l,d;super(e,t,o),this.fireButtonTriggered=i,this._onChecked=n,this.item=o,this._separator=r,this._checked=!1,this.onChecked=t?le.map(le.filter(this._onChecked.event,c=>c.element===this),c=>c.checked):le.None,this._saneDetail=o.detail,this._labelHighlights=(a=o.highlights)===null||a===void 0?void 0:a.label,this._descriptionHighlights=(l=o.highlights)===null||l===void 0?void 0:l.description,this._detailHighlights=(d=o.highlights)===null||d===void 0?void 0:d.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 Pl;(function(s){s[s.NONE=0]="NONE",s[s.MOUSE_HOVER=1]="MOUSE_HOVER",s[s.ACTIVE_ITEM=2]="ACTIVE_ITEM"})(Pl||(Pl={}));class Du extends nK{constructor(e,t,i){super(e,!1,i),this.fireSeparatorButtonTriggered=t,this.separator=i,this.children=new Array,this.focusInsideSeparator=Pl.NONE}}class Bwe{getHeight(e){return e instanceof Du?30:e.saneDetail?44:22}getTemplateId(e){return e instanceof hs?bC.ID:R1.ID}}class Wwe{getWidgetAriaLabel(){return p("quickInput","Quick Input")}getAriaLabel(e){var t;return!((t=e.separator)===null||t===void 0)&&t.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 hs)))return{get value(){return e.checked},onDidChange:t=>e.onChecked(()=>t())}}}class sK{constructor(e){this.hoverDelegate=e}renderTemplate(e){const t=Object.create(null);t.toDisposeElement=new Y,t.toDisposeTemplate=new Y,t.entry=Q(e,Aa(".quick-input-list-entry"));const i=Q(t.entry,Aa("label.quick-input-list-label"));t.toDisposeTemplate.add(Ni(i,ee.CLICK,d=>{t.checkbox.offsetParent||d.preventDefault()})),t.checkbox=Q(i,Aa("input.quick-input-list-checkbox")),t.checkbox.type="checkbox";const n=Q(i,Aa(".quick-input-list-rows")),o=Q(n,Aa(".quick-input-list-row")),r=Q(n,Aa(".quick-input-list-row"));t.label=new jD(o,{supportHighlights:!0,supportDescriptionHighlights:!0,supportIcons:!0,hoverDelegate:this.hoverDelegate}),t.toDisposeTemplate.add(t.label),t.icon=uF(t.label.element,Aa(".quick-input-list-icon"));const a=Q(o,Aa(".quick-input-list-entry-keybinding"));t.keybinding=new m0(a,Lo),t.toDisposeTemplate.add(t.keybinding);const l=Q(r,Aa(".quick-input-list-label-meta"));return t.detail=new jD(l,{supportHighlights:!0,supportIcons:!0,hoverDelegate:this.hoverDelegate}),t.toDisposeTemplate.add(t.detail),t.separator=Q(t.entry,Aa(".quick-input-list-separator")),t.actionBar=new Vr(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 bC=U2=class extends sK{constructor(e,t){super(e),this.themeService=t,this._itemsWithSeparatorsFrequency=new Map}get templateId(){return U2.ID}renderTemplate(e){const t=super.renderTemplate(e);return t.toDisposeTemplate.add(Ni(t.checkbox,ee.CHANGE,i=>{t.element.checked=t.checkbox.checked})),t}renderElement(e,t,i){var n,o,r;const a=e.element;i.element=a,a.element=(n=i.entry)!==null&&n!==void 0?n:void 0;const l=a.item;i.checkbox.checked=a.checked,i.toDisposeElement.add(a.onChecked(m=>i.checkbox.checked=m)),i.checkbox.disabled=a.checkboxDisabled;const{labelHighlights:d,descriptionHighlights:c,detailHighlights:u}=a;if(l.iconPath){const m=Dx(this.themeService.getColorTheme().type)?l.iconPath.dark:(o=l.iconPath.light)!==null&&o!==void 0?o:l.iconPath.dark,_=Ae.revive(m);i.icon.className="quick-input-list-icon",i.icon.style.backgroundImage=Ih(_)}else i.icon.style.backgroundImage="",i.icon.className=l.iconClass?`quick-input-list-icon ${l.iconClass}`:"";let h;!a.saneTooltip&&a.saneDescription&&(h={markdown:{value:a.saneDescription,supportThemeIcons:!0},markdownNotSupportedFallback:a.saneDescription});const g={matches:d||[],descriptionTitle:h,descriptionMatches:c||[],labelEscapeNewLines:!0};if(g.extraClasses=l.iconClasses,g.italic=l.italic,g.strikethrough=l.strikethrough,i.entry.classList.remove("quick-input-list-separator-as-item"),i.label.setLabel(a.saneLabel,a.saneDescription,g),i.keybinding.set(l.keybinding),a.saneDetail){let m;a.saneTooltip||(m={markdown:{value:a.saneDetail,supportThemeIcons:!0},markdownNotSupportedFallback:a.saneDetail}),i.detail.element.style.display="",i.detail.setLabel(a.saneDetail,void 0,{matches:u,title:m,labelEscapeNewLines:!0})}else i.detail.element.style.display="none";!((r=a.separator)===null||r===void 0)&&r.label?(i.separator.textContent=a.separator.label,i.separator.style.display="",this.addItemWithSeparator(a)):i.separator.style.display="none",i.entry.classList.toggle("quick-input-list-separator-border",!!a.separator);const f=l.buttons;f&&f.length?(i.actionBar.push(f.map((m,_)=>FD(m,`id-${_}`,()=>a.fireButtonTriggered({button:m,item:a.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)}};bC.ID="quickpickitem";bC=U2=ak([iK(1,_n)],bC);class R1 extends sK{constructor(){super(...arguments),this._visibleSeparatorsFrequency=new Map}get templateId(){return R1.ID}get visibleSeparators(){return[...this._visibleSeparatorsFrequency.keys()]}isSeparatorVisible(e){return this._visibleSeparatorsFrequency.has(e)}renderElement(e,t,i){var n;const o=e.element;i.element=o,o.element=(n=i.entry)!==null&&n!==void 0?n:void 0,o.element.classList.toggle("focus-inside",!!o.focusInsideSeparator);const r=o.separator,{labelHighlights:a,descriptionHighlights:l,detailHighlights:d}=o;i.icon.style.backgroundImage="",i.icon.className="";let c;!o.saneTooltip&&o.saneDescription&&(c={markdown:{value:o.saneDescription,supportThemeIcons:!0},markdownNotSupportedFallback:o.saneDescription});const u={matches:a||[],descriptionTitle:c,descriptionMatches:l||[],labelEscapeNewLines:!0};if(i.entry.classList.add("quick-input-list-separator-as-item"),i.label.setLabel(o.saneLabel,o.saneDescription,u),o.saneDetail){let g;o.saneTooltip||(g={markdown:{value:o.saneDetail,supportThemeIcons:!0},markdownNotSupportedFallback:o.saneDetail}),i.detail.element.style.display="",i.detail.setLabel(o.saneDetail,void 0,{matches:d,title:g,labelEscapeNewLines:!0})}else i.detail.element.style.display="none";i.separator.style.display="none",i.entry.classList.add("quick-input-list-separator-border");const h=r.buttons;h&&h.length?(i.actionBar.push(h.map((g,f)=>FD(g,`id-${f}`,()=>o.fireSeparatorButtonTriggered({button:g,separator:o.separator}))),{icon:!0,label:!1}),i.entry.classList.add("has-actions")):i.entry.classList.remove("has-actions"),this.addSeparator(o)}disposeElement(e,t,i){var n;this.removeSeparator(e.element),this.isSeparatorVisible(e.element)||(n=e.element.element)===null||n===void 0||n.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)}}R1.ID="quickpickseparator";let CC=class extends H{constructor(e,t,i,n,o){super(),this.parent=e,this.hoverDelegate=t,this.linkOpenerDelegate=i,this._onKeyDown=new B,this.onKeyDown=this._onKeyDown.event,this._onLeave=new B,this.onLeave=this._onLeave.event,this._onChangedAllVisibleChecked=new B,this.onChangedAllVisibleChecked=this._onChangedAllVisibleChecked.event,this._onChangedCheckedCount=new B,this.onChangedCheckedCount=this._onChangedCheckedCount.event,this._onChangedVisibleCount=new B,this.onChangedVisibleCount=this._onChangedVisibleCount.event,this._onChangedCheckedElements=new B,this.onChangedCheckedElements=this._onChangedCheckedElements.event,this._onButtonTriggered=new B,this.onButtonTriggered=this._onButtonTriggered.event,this._onSeparatorButtonTriggered=new B,this.onSeparatorButtonTriggered=this._onSeparatorButtonTriggered.event,this._onTriggerEmptySelectionOrFocus=new B,this._elementChecked=new B,this._inputElements=new Array,this._elementTree=new Array,this._itemElements=new Array,this._elementDisposable=this._register(new Y),this._shouldFireCheckedEvents=!0,this._matchOnDescription=!1,this._matchOnDetail=!1,this._matchOnLabel=!0,this._matchOnLabelMode="fuzzy",this._sortByLabel=!0,this._container=Q(this.parent,Aa(".quick-input-list")),this._separatorRenderer=new R1(t),this._itemRenderer=o.createInstance(bC,t),this._tree=this._register(o.createInstance(V2,"QuickInput",this._container,new Bwe,[this._itemRenderer,this._separatorRenderer],{accessibilityProvider:new Wwe,setRowLineHeight:!1,multipleSelectionSupport:!1,hideTwistiesOfChildlessElements:!0,renderIndentGuides:M_.None,findWidgetEnabled:!1,indent:0,horizontalScrolling:!1,allowNonCollapsibleParents:!0,identityProvider:{getId:r=>{const a=r.item||r.separator;if(a===void 0)return"";if(a.id!==void 0)return a.id;let l=`label:${a.label}`;return l+=`$$description:${a.description}`,a.type!=="separator"&&(l+=`$$detail:${a.detail}`),l}},alwaysConsumeMouseWheel:!0})),this._tree.getHTMLElement().id=n,this._registerListeners()}get onDidChangeFocus(){return le.map(le.any(this._tree.onDidChangeFocus,this._onTriggerEmptySelectionOrFocus.event),e=>e.elements.filter(t=>t instanceof hs).map(t=>t.item))}get onDidChangeSelection(){return le.map(le.any(this._tree.onDidChangeSelection,this._onTriggerEmptySelectionOrFocus.event),e=>({items:e.elements.filter(t=>t instanceof hs).map(t=>t.item),event:e.browserEvent}))}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}_registerListeners(){this._registerOnKeyDown(),this._registerOnContainerClick(),this._registerOnMouseMiddleClick(),this._registerOnElementChecked(),this._registerOnContextMenu(),this._registerHoverListeners(),this._registerSelectionChangeListener(),this._registerSeparatorActionShowingListeners()}_registerOnKeyDown(){this._register(this._tree.onKeyDown(e=>{const t=new Kt(e);switch(t.keyCode){case 10:this.toggleCheckbox();break;case 31:(lt?e.metaKey:e.ctrlKey)&&this._tree.setFocus(this._itemElements);break;case 16:{const i=this._tree.getFocus();i.length===1&&i[0]===this._itemElements[0]&&this._onLeave.fire();break}case 18:{const i=this._tree.getFocus();i.length===1&&i[0]===this._itemElements[this._itemElements.length-1]&&this._onLeave.fire();break}}this._onKeyDown.fire(t)}))}_registerOnContainerClick(){this._register(K(this._container,ee.CLICK,e=>{(e.x||e.y)&&this._onLeave.fire()}))}_registerOnMouseMiddleClick(){this._register(K(this._container,ee.AUXCLICK,e=>{e.button===1&&this._onLeave.fire()}))}_registerOnElementChecked(){this._register(this._elementChecked.event(e=>this._fireCheckedEvents()))}_registerOnContextMenu(){this._register(this._tree.onContextMenu(e=>{e.element&&(e.browserEvent.preventDefault(),this._tree.setSelection([e.element]))}))}_registerHoverListeners(){const e=this._register(new fz(this.hoverDelegate.delay));this._register(this._tree.onMouseOver(async t=>{var i;if(t.browserEvent.target instanceof HTMLAnchorElement){e.cancel();return}if(!(!(t.browserEvent.relatedTarget instanceof HTMLAnchorElement)&&An(t.browserEvent.relatedTarget,(i=t.element)===null||i===void 0?void 0:i.element)))try{await e.trigger(async()=>{t.element instanceof hs&&this.showHover(t.element)})}catch(n){if(!Id(n))throw n}})),this._register(this._tree.onMouseOut(t=>{var i;An(t.browserEvent.relatedTarget,(i=t.element)===null||i===void 0?void 0:i.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&Pl.ACTIVE_ITEM)!==n&&(n?i.focusInsideSeparator|=Pl.ACTIVE_ITEM:i.focusInsideSeparator&=~Pl.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&Pl.MOUSE_HOVER)||(i.focusInsideSeparator|=Pl.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&Pl.MOUSE_HOVER)&&(i.focusInsideSeparator&=~Pl.MOUSE_HOVER,this._tree.rerender(i))}}))}_registerSelectionChangeListener(){this._register(this._tree.onDidChangeSelection(e=>{const t=e.elements.filter(i=>i instanceof hs);t.length!==e.elements.length&&(e.elements.length===1&&e.elements[0]instanceof Du&&(this._tree.setFocus([e.elements[0].children[0]]),this._tree.reveal(e.elements[0],0)),this._tree.setSelection(t))}))}getAllVisibleChecked(){return this._allVisibleChecked(this._itemElements,!1)}getCheckedCount(){return this._itemElements.filter(e=>e.checked).length}getVisibleCount(){return this._itemElements.filter(e=>!e.hidden).length}setAllVisibleChecked(e){try{this._shouldFireCheckedEvents=!1,this._itemElements.forEach(t=>{!t.hidden&&!t.checkboxDisabled&&(t.checked=e)})}finally{this._shouldFireCheckedEvents=!0,this._fireCheckedEvents()}}setElements(e){this._elementDisposable.clear(),this._inputElements=e;const t=this.parent.classList.contains("show-checkboxes");let i;this._itemElements=new Array,this._elementTree=e.reduce((r,a,l)=>{let d;if(a.type==="separator"){if(!a.buttons)return r;i=new Du(l,c=>this.fireSeparatorButtonTriggered(c),a),d=i}else{const c=l>0?e[l-1]:void 0;let u;c&&c.type==="separator"&&!c.buttons&&(i=void 0,u=c);const h=new hs(l,t,g=>this.fireButtonTriggered(g),this._elementChecked,a,u);if(this._itemElements.push(h),i)return i.children.push(h),r;d=h}return r.push(d),r},new Array);const n=new Array;let o=0;for(const r of this._elementTree)r instanceof Du?(n.push({element:r,collapsible:!1,collapsed:!1,children:r.children.map(a=>({element:a,collapsible:!1,collapsed:!1}))}),o+=r.children.length+1):(n.push({element:r,collapsible:!1,collapsed:!1}),o++);this._tree.setChildren(null,n),this._onChangedVisibleCount.fire(o)}setFocusedElements(e){const t=e.map(i=>this._itemElements.find(n=>n.item===i)).filter(i=>!!i);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){try{this._shouldFireCheckedEvents=!1;const t=new Set;for(const i of e)t.add(i);for(const i of this._itemElements)i.checked=t.has(i.item)}finally{this._shouldFireCheckedEvents=!0,this._fireCheckedEvents()}}focus(e){var t;if(this._itemElements.length)switch(e===sn.Second&&this._itemElements.length<2&&(e=sn.First),e){case sn.First:this._tree.scrollTop=0,this._tree.focusFirst(void 0,i=>i.element instanceof hs);break;case sn.Second:this._tree.scrollTop=0,this._tree.setFocus([this._itemElements[1]]);break;case sn.Last:this._tree.scrollTop=this._tree.scrollHeight,this._tree.setFocus([this._itemElements[this._itemElements.length-1]]);break;case sn.Next:this._tree.focusNext(void 0,!0,void 0,i=>i.element instanceof hs?(this._tree.reveal(i.element),!0):!1);break;case sn.Previous:this._tree.focusPrevious(void 0,!0,void 0,i=>{if(!(i.element instanceof hs))return!1;const n=this._tree.getParentElement(i.element);return n===null||n.children[0]!==i.element?this._tree.reveal(i.element):this._tree.reveal(n),!0});break;case sn.NextPage:this._tree.focusNextPage(void 0,i=>i.element instanceof hs?(this._tree.reveal(i.element),!0):!1);break;case sn.PreviousPage:this._tree.focusPreviousPage(void 0,i=>{if(!(i.element instanceof hs))return!1;const n=this._tree.getParentElement(i.element);return n===null||n.children[0]!==i.element?this._tree.reveal(i.element):this._tree.reveal(n),!0});break;case sn.NextSeparator:{let i=!1;const n=this._tree.getFocus()[0];this._tree.focusNext(void 0,!0,void 0,r=>{if(i)return!0;if(r.element instanceof Du)i=!0,this._separatorRenderer.isSeparatorVisible(r.element)?this._tree.reveal(r.element.children[0]):this._tree.reveal(r.element,0);else if(r.element instanceof hs){if(r.element.separator)return this._itemRenderer.isItemWithSeparatorVisible(r.element)?this._tree.reveal(r.element):this._tree.reveal(r.element,0),!0;if(r.element===this._elementTree[0])return this._tree.reveal(r.element,0),!0}return!1});const o=this._tree.getFocus()[0];n===o&&(this._tree.scrollTop=this._tree.scrollHeight,this._tree.setFocus([this._itemElements[this._itemElements.length-1]]));break}case sn.PreviousSeparator:{let i,n=!!(!((t=this._tree.getFocus()[0])===null||t===void 0)&&t.separator);this._tree.focusPrevious(void 0,!0,void 0,o=>{if(o.element instanceof Du)n?i||(this._separatorRenderer.isSeparatorVisible(o.element)?this._tree.reveal(o.element):this._tree.reveal(o.element,0),i=o.element.children[0]):n=!0;else if(o.element instanceof hs&&!i){if(o.element.separator)this._itemRenderer.isItemWithSeparatorVisible(o.element)?this._tree.reveal(o.element):this._tree.reveal(o.element,0),i=o.element;else if(o.element===this._elementTree[0])return this._tree.reveal(o.element,0),!0}return!1}),i&&this._tree.setFocus([i]);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._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(l=>{l.labelHighlights=void 0,l.descriptionHighlights=void 0,l.detailHighlights=void 0,l.hidden=!1;const d=l.index&&this._inputElements[l.index-1];l.item&&(l.separator=d&&d.type==="separator"&&!d.buttons?d:void 0)});else{let l;this._elementTree.forEach(d=>{var c,u,h,g;let f;this.matchOnLabelMode==="fuzzy"?f=this.matchOnLabel&&(c=FI(e,xv(d.saneLabel)))!==null&&c!==void 0?c:void 0:f=this.matchOnLabel&&(u=Hwe(t,xv(d.saneLabel)))!==null&&u!==void 0?u:void 0;const m=this.matchOnDescription&&(h=FI(e,xv(d.saneDescription||"")))!==null&&h!==void 0?h:void 0,_=this.matchOnDetail&&(g=FI(e,xv(d.saneDetail||"")))!==null&&g!==void 0?g:void 0;if(f||m||_?(d.labelHighlights=f,d.descriptionHighlights=m,d.detailHighlights=_,d.hidden=!1):(d.labelHighlights=void 0,d.descriptionHighlights=void 0,d.detailHighlights=void 0,d.hidden=d.item?!d.item.alwaysShow:!0),d.item?d.separator=void 0:d.separator&&(d.hidden=!0),!this.sortByLabel){const v=d.index&&this._inputElements[d.index-1];l=v&&v.type==="separator"?v:l,l&&!d.hidden&&(d.separator=l,l=void 0)}})}const i=this._elementTree.filter(l=>!l.hidden);if(this.sortByLabel&&e){const l=e.toLowerCase();i.sort((d,c)=>Vwe(d,c,l))}let n;const o=i.reduce((l,d,c)=>(d instanceof hs?n?n.children.push(d):l.push(d):d instanceof Du&&(d.children=[],n=d,l.push(d)),l),new Array),r=new Array;for(const l of o)l instanceof Du?r.push({element:l,collapsible:!1,collapsed:!1,children:l.children.map(d=>({element:d,collapsible:!1,collapsed:!1}))}):r.push({element:l,collapsible:!1,collapsed:!1});const a=this._tree.getFocus().length;return this._tree.setChildren(null,r),a>0&&r.length===0&&this._onTriggerEmptySelectionOrFocus.fire({elements:[]}),this._tree.layout(),this._onChangedAllVisibleChecked.fire(this.getAllVisibleChecked()),this._onChangedVisibleCount.fire(i.length),!0}toggleCheckbox(){try{this._shouldFireCheckedEvents=!1;const e=this._tree.getFocus().filter(i=>i instanceof hs),t=this._allVisibleChecked(e);for(const i of e)i.checkboxDisabled||(i.checked=!t)}finally{this._shouldFireCheckedEvents=!0,this._fireCheckedEvents()}}display(e){this._container.style.display=e?"":"none"}isDisplayed(){return this._container.style.display!=="none"}style(e){this._tree.style(e)}toggleHover(){const e=this._tree.getFocus()[0];if(!(e!=null&&e.saneTooltip)||!(e instanceof hs))return;if(this._lastHover&&!this._lastHover.isDisposed){this._lastHover.dispose();return}this.showHover(e);const t=new Y;t.add(this._tree.onDidChangeFocus(i=>{i.elements[0]instanceof hs&&this.showHover(i.elements[0])})),this._lastHover&&t.add(this._lastHover),this._elementDisposable.add(t)}_allVisibleChecked(e,t=!0){for(let i=0,n=e.length;i{this.linkOpenerDelegate(o)},appearance:{showPointer:!0},container:this._container,position:{hoverPosition:1}},!1))}};ak([zi],CC.prototype,"onDidChangeFocus",null);ak([zi],CC.prototype,"onDidChangeSelection",null);CC=ak([iK(4,Ne)],CC);function Hwe(s,e){const{text:t,iconOffsets:i}=e;if(!i||i.length===0)return j6(s,t);const n=qL(t," "),o=t.length-n.length,r=j6(s,n);if(r)for(const a of r){const l=i[a.start+o]+o;a.start+=l,a.end+=l}return r}function j6(s,e){const t=e.toLowerCase().indexOf(s.toLowerCase());return t!==-1?[{start:t,end:t+s.length}]:null}function Vwe(s,e,t){const i=s.labelHighlights||[],n=e.labelHighlights||[];return i.length&&!n.length?-1:!i.length&&n.length?1:i.length===0&&n.length===0?0:Fwe(s.saneSortLabel,e.saneSortLabel,t)}var zwe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},K6=function(s,e){return function(t,i){e(t,i,s)}};const $2={iconClass:Pe.asClassName(oe.quickInputBack),tooltip:p("quickInput.back","Back")};class P1 extends H{constructor(e){super(),this.ui=e,this._widgetUpdated=!1,this.visible=!1,this._enabled=!0,this._busy=!1,this._ignoreFocusOut=!1,this._buttons=[],this.buttonsUpdated=!1,this._toggles=[],this.togglesUpdated=!1,this.noValidationMessage=P1.noPromptMessage,this._severity=Bi.Ignore,this.onDidTriggerButtonEmitter=this._register(new B),this.onDidHideEmitter=this._register(new B),this.onWillHideEmitter=this._register(new B),this.onDisposeEmitter=this._register(new B),this.visibleDisposables=this._register(new Y),this.onDidHide=this.onDidHideEmitter.event}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&&!_d;this._ignoreFocusOut=e&&!_d,t&&this.update()}get buttons(){return this._buttons}set buttons(e){this._buttons=e,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=!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=A_.Other){this.visible=!1,this.visibleDisposables.clear(),this.onDidHideEmitter.fire({reason:e})}willHide(e=A_.Other){this.onWillHideEmitter.fire({reason:e})}update(){var e,t;if(!this.visible)return;const i=this.getTitle();i&&this.ui.title.textContent!==i?this.ui.title.textContent=i:!i&&this.ui.title.innerHTML!==" "&&(this.ui.title.innerText=" ");const n=this.getDescription();if(this.ui.description1.textContent!==n&&(this.ui.description1.textContent=n),this.ui.description2.textContent!==n&&(this.ui.description2.textContent=n),this._widgetUpdated&&(this._widgetUpdated=!1,this._widget?Yn(this.ui.widget,this._widget):Yn(this.ui.widget)),this.busy&&!this.busyDelay&&(this.busyDelay=new ya,this.busyDelay.setIfNotSet(()=>{this.visible&&this.ui.progressBar.infinite()},800)),!this.busy&&this.busyDelay&&(this.ui.progressBar.stop(),this.busyDelay.cancel(),this.busyDelay=void 0),this.buttonsUpdated){this.buttonsUpdated=!1,this.ui.leftActionBar.clear();const r=this.buttons.filter(l=>l===$2).map((l,d)=>FD(l,`id-${d}`,async()=>this.onDidTriggerButtonEmitter.fire(l)));this.ui.leftActionBar.push(r,{icon:!0,label:!1}),this.ui.rightActionBar.clear();const a=this.buttons.filter(l=>l!==$2).map((l,d)=>FD(l,`id-${d}`,async()=>this.onDidTriggerButtonEmitter.fire(l)));this.ui.rightActionBar.push(a,{icon:!0,label:!1})}if(this.togglesUpdated){this.togglesUpdated=!1;const r=(t=(e=this.toggles)===null||e===void 0?void 0:e.filter(a=>a instanceof f0))!==null&&t!==void 0?t:[];this.ui.inputBox.toggles=r}this.ui.ignoreFocusOut=this.ignoreFocusOut,this.ui.setEnabled(this.enabled),this.ui.setContextKey(this.contextKey);const o=this.validationMessage||this.noValidationMessage;this._lastValidationMessage!==o&&(this._lastValidationMessage=o,Yn(this.ui.message),C1e(o,this.ui.message,{callback:r=>{this.ui.linkOpenerDelegate(r)},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?p("quickInput.steps","{0}/{1}",this.step,this.totalSteps):this.step?String(this.step):""}showMessageDecoration(e){if(this.ui.inputBox.showDecoration(e),e!==Bi.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()}}P1.noPromptMessage=p("inputModeEntry","Press 'Enter' to confirm your input or 'Escape' to cancel");class wC extends P1{constructor(){super(...arguments),this._value="",this.onDidChangeValueEmitter=this._register(new B),this.onWillAcceptEmitter=this._register(new B),this.onDidAcceptEmitter=this._register(new B),this.onDidCustomEmitter=this._register(new B),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=Rl.FIRST,this._activeItems=[],this.activeItemsUpdated=!1,this.activeItemsToConfirm=[],this.onDidChangeActiveEmitter=this._register(new B),this._selectedItems=[],this.selectedItemsUpdated=!1,this.selectedItemsToConfirm=[],this.onDidChangeSelectionEmitter=this._register(new B),this.onDidTriggerItemButtonEmitter=this._register(new B),this.onDidTriggerSeparatorButtonEmitter=this._register(new B),this.valueSelectionUpdated=!0,this._ok="default",this._customButton=!1,this.filterValue=e=>e,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}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 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?g1e: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 hideInput(){return!!this._hideInput}set hideInput(e){this._hideInput=e,this.update()}trySelectFirst(){this.canSelectMany||this.ui.list.focus(sn.First)}show(){this.visible||(this.visibleDisposables.add(this.ui.inputBox.onDidChange(e=>{this.doSetValue(e,!0)})),this.visibleDisposables.add((this._hideInput?this.ui.list:this.ui.inputBox).onKeyDown(e=>{switch(e.keyCode){case 18:this.quickNavigate===void 0&&(lt?e.metaKey:e.altKey)?this.ui.list.focus(sn.NextSeparator):this.ui.list.focus(sn.Next),this.canSelectMany&&this.ui.list.domFocus(),nt.stop(e,!0);break;case 16:this.quickNavigate===void 0&&(lt?e.metaKey:e.altKey)?this.ui.list.focus(sn.PreviousSeparator):this.ui.list.focus(sn.Previous),this.canSelectMany&&this.ui.list.domFocus(),nt.stop(e,!0);break;case 12:this.ui.list.focus(sn.NextPage),this.canSelectMany&&this.ui.list.domFocus(),nt.stop(e,!0);break;case 11:this.ui.list.focus(sn.PreviousPage),this.canSelectMany&&this.ui.list.domFocus(),nt.stop(e,!0);break;case 17:if(!this._canAcceptInBackground||!this.ui.inputBox.isSelectionAtEnd())return;this.activeItems[0]&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems),this.handleAccept(!0));break;case 14:(e.ctrlKey||e.metaKey)&&!e.shiftKey&&!e.altKey&&(this.ui.list.focus(sn.First),nt.stop(e,!0));break;case 13:(e.ctrlKey||e.metaKey)&&!e.shiftKey&&!e.altKey&&(this.ui.list.focus(sn.Last),nt.stop(e,!0));break}})),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.ui.list.onDidChangeFocus(e=>{this.activeItemsUpdated||this.activeItemsToConfirm!==this._activeItems&&Ci(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.length&&this.ui.list.setSelectedElements([]);return}this.selectedItemsToConfirm!==this._selectedItems&&Ci(e,this._selectedItems,(i,n)=>i===n)||(this._selectedItems=e,this.onDidChangeSelectionEmitter.fire(e),e.length&&this.handleAccept(cF(t)&&t.button===1))})),this.visibleDisposables.add(this.ui.list.onChangedCheckedElements(e=>{this.canSelectMany&&(this.selectedItemsToConfirm!==this._selectedItems&&Ci(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 K(this.ui.container,ee.KEY_UP,e=>{if(this.canSelectMany||!this._quickNavigate)return;const t=new Kt(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.buttons.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,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;if(!n&&i.inputBox&&(n=this.placeholder||wC.DEFAULT_ARIA_LABEL,this.title&&(n+=` - ${this.title}`)),this.ui.list.ariaLabel!==n&&(this.ui.list.ariaLabel=n??null),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;const o=this._activeItems;switch(this.ui.list.setElements(this.items),this.ui.list.filter(this.filterValue(this.ui.inputBox.value)),this.ui.checkAll.checked=this.ui.list.getAllVisibleChecked(),this.ui.visibleCount.setCount(this.ui.list.getVisibleCount()),this.ui.count.setCount(this.ui.list.getCheckedCount()),this._itemActivation){case Rl.NONE:o.length>0&&(this._activeItems=[],this.onDidChangeActiveEmitter.fire(this._activeItems)),this._itemActivation=Rl.FIRST;break;case Rl.SECOND:this.ui.list.focus(sn.Second),this._itemActivation=Rl.FIRST;break;case Rl.LAST:this.ui.list.focus(sn.Last),this._itemActivation=Rl.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.customButton.label=this.customLabel||"",this.ui.customButton.element.title=this.customHover||"",i.inputBox||(this.ui.list.domFocus(),this.canSelectMany&&this.ui.list.focus(sn.First)),this.keepScrollPosition&&(this.scrollTop=e)}}wC.DEFAULT_ARIA_LABEL=p("quickInputBox.ariaLabel","Type to narrow down results.");class Uwe extends P1{constructor(){super(...arguments),this._value="",this.valueSelectionUpdated=!0,this._password=!1,this.onDidValueChangeEmitter=this._register(new B),this.onDidAcceptEmitter=this._register(new B),this.onDidChangeValue=this.onDidValueChangeEmitter.event,this.onDidAccept=this.onDidAcceptEmitter.event}get value(){return this._value}set value(e){this._value=e||"",this.update()}get placeholder(){return this._placeholder}set placeholder(e){this._placeholder=e,this.update()}get password(){return this._password}set password(e){this._password=e,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()}update(){if(!this.visible)return;this.ui.container.classList.remove("hidden-input");const e={title:!!this.title||!!this.step||!!this.buttons.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 j2=class extends S_{constructor(e,t){super("element",!1,i=>this.getOverrideOptions(i),e,t)}getOverrideOptions(e){var t;const i=(e.content instanceof HTMLElement?(t=e.content.textContent)!==null&&t!==void 0?t:"":typeof e.content=="string"?e.content:e.content.value).includes(` `);return{persistence:{hideOnKeyDown:!1},appearance:{showHoverHint:i,skipFadeInAnimation:!0}}}};j2=zwe([K6(0,rt),K6(1,Md)],j2);$.white.toString(),$.white.toString();class KD extends H{get onDidClick(){return this._onDidClick.event}constructor(e,t){super(),this._label="",this._onDidClick=this._register(new B),this._onDidEscape=this._register(new B),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._register(Gt.addTarget(this._element)),[ee.CLICK,Xt.Tap].forEach(o=>{this._register(K(this._element,o,r=>{if(!this.enabled){nt.stop(r);return}this._onDidClick.fire(r)}))}),this._register(K(this._element,ee.KEY_DOWN,o=>{const r=new Kt(o);let a=!1;this.enabled&&(r.equals(3)||r.equals(10))?(this._onDidClick.fire(o),a=!0):r.equals(9)&&(this._onDidEscape.fire(o),this._element.blur(),a=!0),a&&nt.stop(r,!0)})),this._register(K(this._element,ee.MOUSE_OVER,o=>{this._element.classList.contains("disabled")||this.updateBackground(!0)})),this._register(K(this._element,ee.MOUSE_OUT,o=>{this.updateBackground(!1)})),this.focusTracker=this._register(ba(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 lh(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){var t;if(this._label===e||tl(this._label)&&tl(e)&&Tve(this._label,e))return;this._element.classList.add("monaco-text-button");const i=this.options.supportShortLabel?this._labelElement:this._element;if(tl(e)){const o=Hx(e,{inline:!0});o.dispose();const r=(t=o.element.querySelector("p"))===null||t===void 0?void 0:t.innerHTML;if(r){const a=wz(r,{ADD_TAGS:["b","i","u","code","span"],ALLOWED_ATTR:["class"],RETURN_TRUSTED_TYPE:!0});i.innerHTML=a}else Yn(i)}else this.options.supportIcons?Yn(i,...this.getContentElements(e)):i.textContent=e;let n="";typeof this.options.title=="string"?n=this.options.title:this.options.title&&(n=Bve(e)),this.setTitle(n),typeof this.options.ariaLabel=="string"?this._element.setAttribute("aria-label",this.options.ariaLabel):this.options.ariaLabel&&this._element.setAttribute("aria-label",n),this._label=e}get label(){return this._label}set icon(e){this._element.classList.add(...Pe.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){var t;!this._hover&&e!==""?this._hover=this._register(_l().setupUpdatableHover((t=this.options.hoverDelegate)!==null&&t!==void 0?t:Xs("mouse"),this._element,e)):this._hover&&this._hover.update(e)}}class K2{constructor(e,t,i){this.options=t,this.styles=i,this.count=0,this.element=Q(e,he(".monaco-count-badge")),this.countFormat=this.options.countFormat||"{0}",this.titleFormat=this.options.titleFormat||"",this.setCount(this.options.count||0)}setCount(e){this.count=e,this.render()}setTitleFormat(e){this.titleFormat=e,this.render()}render(){var e,t;this.element.textContent=l_(this.countFormat,this.count),this.element.title=l_(this.titleFormat,this.count),this.element.style.backgroundColor=(e=this.styles.badgeBackground)!==null&&e!==void 0?e:"",this.element.style.color=(t=this.styles.badgeForeground)!==null&&t!==void 0?t:"",this.styles.badgeBorder&&(this.element.style.border=`1px solid ${this.styles.badgeBorder}`)}}const q6="done",G6="active",ZI="infinite",XI="infinite-long-running",Z6="discrete";class lk extends H{constructor(e,t){super(),this.progressSignal=this._register(new $n),this.workedVal=0,this.showDelayedScheduler=this._register(new Wt(()=>Do(this.element),0)),this.longRunningScheduler=this._register(new Wt(()=>this.infiniteLongRunning(),lk.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==null?void 0:t.progressBarBackground)||"#0E70C0",this.element.appendChild(this.bit)}off(){this.bit.style.width="inherit",this.bit.style.opacity="1",this.element.classList.remove(G6,ZI,XI,Z6),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(q6),this.element.classList.contains(ZI)?(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(Z6,q6,XI),this.element.classList.add(G6,ZI),this.longRunningScheduler.schedule(),this}infiniteLongRunning(){this.element.classList.add(XI)}getContainer(){return this.element}}lk.LONG_RUNNING_INFINITE_THRESHOLD=1e4;const $we=he;class jwe extends H{constructor(e,t,i){super(),this.parent=e,this.onKeyDown=o=>Ni(this.findInput.inputBox.inputElement,ee.KEY_DOWN,o),this.onDidChange=o=>this.findInput.onDidChange(o),this.container=Q(this.parent,$we(".quick-input-box")),this.findInput=this._register(new Oj(this.container,void 0,{label:"",inputBoxStyles:t,toggleStyles:i}));const n=this.findInput.inputBox.inputElement;n.role="combobox",n.ariaHasPopup="menu",n.ariaAutoComplete="list",n.ariaExpanded="true"}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)}setAttribute(e,t){this.findInput.inputBox.inputElement.setAttribute(e,t)}showDecoration(e){e===Bi.Ignore?this.findInput.clearMessage():this.findInput.showMessage({type:e===Bi.Info?1:e===Bi.Warning?2:3,content:""})}stylesForType(e){return this.findInput.inputBox.stylesForType(e===Bi.Info?1:e===Bi.Warning?2:3)}setFocus(){this.findInput.focus()}layout(){this.findInput.inputBox.layout()}}var Kwe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},X6=function(s,e){return function(t,i){e(t,i,s)}},q2;const vo=he;let qD=q2=class extends H{get container(){return this._container}constructor(e,t,i){super(),this.options=e,this.layoutService=t,this.instantiationService=i,this.enabled=!0,this.onDidAcceptEmitter=this._register(new B),this.onDidCustomEmitter=this._register(new B),this.onDidTriggerButtonEmitter=this._register(new B),this.keyMods={ctrlCmd:!1,alt:!1},this.controller=null,this.onShowEmitter=this._register(new B),this.onShow=this.onShowEmitter.event,this.onHideEmitter=this._register(new B),this.onHide=this.onHideEmitter.event,this.idPrefix=e.idPrefix,this._container=e.container,this.styles=e.styles,this._register(le.runAndSubscribe(JL,({window:n,disposables:o})=>this.registerKeyModsListeners(n,o),{window:Ht,disposables:this._store})),this._register(Nae(n=>{this.ui&&Te(this.ui.container)===n&&(this.reparentUI(this.layoutService.mainContainer),this.layout(this.layoutService.mainContainerDimension,this.layoutService.mainContainerOffset.quickPickTop))}))}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(K(e,n,i,!0))}getUI(e){if(this.ui)return e&&Te(this._container)!==Te(this.layoutService.activeContainer)&&(this.reparentUI(this.layoutService.activeContainer),this.layout(this.layoutService.activeContainerDimension,this.layoutService.activeContainerOffset.quickPickTop)),this.ui;const t=Q(this._container,vo(".quick-input-widget.show-file-icons"));t.tabIndex=-1,t.style.display="none";const i=ar(t),n=Q(t,vo(".quick-input-titlebar")),o=this._register(new Vr(n,{hoverDelegate:this.options.hoverDelegate}));o.domNode.classList.add("quick-input-left-action-bar");const r=Q(n,vo(".quick-input-title")),a=this._register(new Vr(n,{hoverDelegate:this.options.hoverDelegate}));a.domNode.classList.add("quick-input-right-action-bar");const l=Q(t,vo(".quick-input-header")),d=Q(l,vo("input.quick-input-check-all"));d.type="checkbox",d.setAttribute("aria-label",p("quickInput.checkAll","Toggle all checkboxes")),this._register(Ni(d,ee.CHANGE,F=>{const V=d.checked;R.setAllVisibleChecked(V)})),this._register(K(d,ee.CLICK,F=>{(F.x||F.y)&&g.setFocus()}));const c=Q(l,vo(".quick-input-description")),u=Q(l,vo(".quick-input-and-message")),h=Q(u,vo(".quick-input-filter")),g=this._register(new jwe(h,this.styles.inputBox,this.styles.toggle));g.setAttribute("aria-describedby",`${this.idPrefix}message`);const f=Q(h,vo(".quick-input-visible-count"));f.setAttribute("aria-live","polite"),f.setAttribute("aria-atomic","true");const m=new K2(f,{countFormat:p({},"{0} Results")},this.styles.countBadge),_=Q(h,vo(".quick-input-count"));_.setAttribute("aria-live","polite");const v=new K2(_,{countFormat:p({},"{0} Selected")},this.styles.countBadge),b=Q(l,vo(".quick-input-action")),C=this._register(new KD(b,this.styles.button));C.label=p("ok","OK"),this._register(C.onDidClick(F=>{this.onDidAcceptEmitter.fire()}));const w=Q(l,vo(".quick-input-action")),y=this._register(new KD(w,{...this.styles.button,supportIcons:!0}));y.label=p("custom","Custom"),this._register(y.onDidClick(F=>{this.onDidCustomEmitter.fire()}));const D=Q(u,vo(`#${this.idPrefix}message.quick-input-message`)),L=this._register(new lk(t,this.styles.progressBar));L.getContainer().classList.add("quick-input-progress");const k=Q(t,vo(".quick-input-html-widget"));k.tabIndex=-1;const I=Q(t,vo(".quick-input-description")),O=this.idPrefix+"list",R=this._register(this.instantiationService.createInstance(CC,t,this.options.hoverDelegate,this.options.linkOpenerDelegate,O));g.setAttribute("aria-controls",O),this._register(R.onDidChangeFocus(()=>{var F;g.setAttribute("aria-activedescendant",(F=R.getActiveDescendant())!==null&&F!==void 0?F:"")})),this._register(R.onChangedAllVisibleChecked(F=>{d.checked=F})),this._register(R.onChangedVisibleCount(F=>{m.setCount(F)})),this._register(R.onChangedCheckedCount(F=>{v.setCount(F)})),this._register(R.onLeave(()=>{setTimeout(()=>{this.controller&&(g.setFocus(),this.controller instanceof wC&&this.controller.canSelectMany&&R.clearFocus())},0)}));const P=ba(t);return this._register(P),this._register(K(t,ee.FOCUS,F=>{An(F.relatedTarget,t)||(this.previousFocusElement=F.relatedTarget instanceof HTMLElement?F.relatedTarget:void 0)},!0)),this._register(P.onDidBlur(()=>{!this.getUI().ignoreFocusOut&&!this.options.ignoreFocusOut()&&this.hide(A_.Blur),this.previousFocusElement=void 0})),this._register(K(t,ee.FOCUS,F=>{g.setFocus()})),this._register(Ni(t,ee.KEY_DOWN,F=>{if(!An(F.target,k))switch(F.keyCode){case 3:nt.stop(F,!0),this.enabled&&this.onDidAcceptEmitter.fire();break;case 9:nt.stop(F,!0),this.hide(A_.Gesture);break;case 2:if(!F.altKey&&!F.ctrlKey&&!F.metaKey){const V=[".quick-input-list .monaco-action-bar .always-visible",".quick-input-list-entry:hover .monaco-action-bar",".monaco-list-row.focused .monaco-action-bar"];if(t.classList.contains("show-checkboxes")?V.push("input"):V.push("input[type=text]"),this.getUI().list.isDisplayed()&&V.push(".monaco-list"),this.getUI().message&&V.push(".quick-input-message a"),this.getUI().widget){if(An(F.target,this.getUI().widget))break;V.push(".quick-input-html-widget")}const U=t.querySelectorAll(V.join(", "));F.shiftKey&&F.target===U[0]?(nt.stop(F,!0),R.clearFocus()):!F.shiftKey&&An(F.target,U[U.length-1])&&(nt.stop(F,!0),U[0].focus())}break;case 10:F.ctrlKey&&(nt.stop(F,!0),this.getUI().list.toggleHover());break}})),this.ui={container:t,styleSheet:i,leftActionBar:o,titleBar:n,title:r,description1:I,description2:c,widget:k,rightActionBar:a,checkAll:d,inputContainer:u,filterContainer:h,inputBox:g,visibleCountContainer:f,visibleCount:m,countContainer:_,count:v,okContainer:b,ok:C,message:D,customButtonContainer:w,customButton:y,list:R,progressBar:L,onDidAccept:this.onDidAcceptEmitter.event,onDidCustom:this.onDidCustomEmitter.event,onDidTriggerButton:this.onDidTriggerButtonEmitter.event,ignoreFocusOut:!1,keyMods:this.keyMods,show:F=>this.show(F),hide:()=>this.hide(),setVisibilities:F=>this.setVisibilities(F),setEnabled:F=>this.setEnabled(F),setContextKey:F=>this.options.setContextKey(F),linkOpenerDelegate:F=>this.options.linkOpenerDelegate(F)},this.updateStyles(),this.ui}reparentUI(e){this.ui&&(this._container=e,Q(this._container,this.ui.container))}pick(e,t={},i=dt.None){return new Promise((n,o)=>{let r=c=>{var u;r=n,(u=t.onKeyMods)===null||u===void 0||u.call(t,a.keyMods),n(c)};if(i.isCancellationRequested){r(void 0);return}const a=this.createQuickPick();let l;const d=[a,a.onDidAccept(()=>{if(a.canSelectMany)r(a.selectedItems.slice()),a.hide();else{const c=a.activeItems[0];c&&(r(c),a.hide())}}),a.onDidChangeActive(c=>{const u=c[0];u&&t.onDidFocus&&t.onDidFocus(u)}),a.onDidChangeSelection(c=>{if(!a.canSelectMany){const u=c[0];u&&(r(u),a.hide())}}),a.onDidTriggerItemButton(c=>t.onDidTriggerItemButton&&t.onDidTriggerItemButton({...c,removeItem:()=>{const u=a.items.indexOf(c.item);if(u!==-1){const h=a.items.slice(),g=h.splice(u,1),f=a.activeItems.filter(_=>_!==g[0]),m=a.keepScrollPosition;a.keepScrollPosition=!0,a.items=h,f&&(a.activeItems=f),a.keepScrollPosition=m}}})),a.onDidTriggerSeparatorButton(c=>{var u;return(u=t.onDidTriggerSeparatorButton)===null||u===void 0?void 0:u.call(t,c)}),a.onDidChangeValue(c=>{l&&!c&&(a.activeItems.length!==1||a.activeItems[0]!==l)&&(a.activeItems=[l])}),i.onCancellationRequested(()=>{a.hide()}),a.onDidHide(()=>{jt(d),r(void 0)})];a.title=t.title,a.canSelectMany=!!t.canPickMany,a.placeholder=t.placeHolder,a.ignoreFocusOut=!!t.ignoreFocusLost,a.matchOnDescription=!!t.matchOnDescription,a.matchOnDetail=!!t.matchOnDetail,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(([c,u])=>{l=u,a.busy=!1,a.items=c,a.canSelectMany&&(a.selectedItems=c.filter(h=>h.type!=="separator"&&h.picked)),l&&(a.activeItems=[l])}),a.show(),Promise.resolve(e).then(void 0,c=>{o(c),a.hide()})})}createQuickPick(){const e=this.getUI(!0);return new wC(e)}createInputBox(){const e=this.getUI(!0);return new Uwe(e)}show(e){const t=this.getUI(!0);this.onShowEmitter.fire();const i=this.controller;this.controller=e,i==null||i.didHide(),this.setEnabled(!0),t.leftActionBar.clear(),t.title.textContent="",t.description1.textContent="",t.description2.textContent="",Yn(t.widget),t.rightActionBar.clear(),t.checkAll.checked=!1,t.inputBox.placeholder="",t.inputBox.password=!1,t.inputBox.showDecoration(Bi.Ignore),t.visibleCount.setCount(0),t.count.setCount(0),Yn(t.message),t.progressBar.stop(),t.list.setElements([]),t.list.matchOnDescription=!1,t.list.matchOnDetail=!1,t.list.matchOnLabel=!0,t.list.sortByLabel=!0,t.ignoreFocusOut=!1,t.inputBox.toggles=void 0;const n=this.options.backKeybindingLabel();$2.tooltip=n?p("quickInput.backWithKeybinding","Back ({0})",n):p("quickInput.back","Back"),t.container.style.display="",this.updateLayout(),t.inputBox.setFocus()}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.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.display(!!e.list),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;for(const t of this.getUI().leftActionBar.viewItems)t.action.enabled=e;for(const t of this.getUI().rightActionBar.viewItems)t.action.enabled=e;this.getUI().checkAll.disabled=!e,this.getUI().inputBox.enabled=e,this.getUI().ok.enabled=e,this.getUI().list.enabled=e}}hide(e){var t,i;const n=this.controller;if(!n)return;n.willHide(e);const o=(t=this.ui)===null||t===void 0?void 0:t.container,r=o&&!Tz(o);if(this.controller=null,this.onHideEmitter.fire(),o&&(o.style.display="none"),!r){let a=this.previousFocusElement;for(;a&&!a.offsetParent;)a=(i=a.parentElement)!==null&&i!==void 0?i:void 0;a!=null&&a.offsetParent?(a.focus(),this.previousFocusElement=void 0):this.options.returnFocus()}n.didHide(e)}layout(e,t){this.dimension=e,this.titleBarOffset=t,this.updateLayout()}updateLayout(){if(this.ui&&this.isVisible()){this.ui.container.style.top=`${this.titleBarOffset}px`;const e=this.ui.container.style,t=Math.min(this.dimension.width*.62,q2.MAX_WIDTH);e.width=t+"px",e.marginLeft="-"+t/2+"px",this.ui.inputBox.layout(),this.ui.list.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:o}=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=o?`0 0 8px 2px ${o}`:"",this.ui.list.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)}}};qD.MAX_WIDTH=600;qD=q2=Kwe([X6(1,ig),X6(2,Ne)],qD);var qwe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Y0=function(s,e){return function(t,i){e(t,i,s)}};let G2=class extends Vge{get controller(){return this._controller||(this._controller=this._register(this.createController())),this._controller}get hasController(){return!!this._controller}get quickAccess(){return this._quickAccess||(this._quickAccess=this._register(this.instantiationService.createInstance(O2))),this._quickAccess}constructor(e,t,i,n,o){super(i),this.instantiationService=e,this.contextKeyService=t,this.layoutService=n,this.configurationService=o,this._onShow=this._register(new B),this._onHide=this._register(new B),this.contexts=new Map}createController(e=this.layoutService,t){const i={idPrefix:"quickInput_",container:e.activeContainer,ignoreFocusOut:()=>!1,backKeybindingLabel:()=>{},setContextKey:o=>this.setContextKey(o),linkOpenerDelegate:o=>{this.instantiationService.invokeFunction(r=>{r.get(Bo).open(o,{allowCommands:!0,fromUserGesture:!0})})},returnFocus:()=>e.focus(),styles:this.computeStyles(),hoverDelegate:this._register(this.instantiationService.createInstance(j2))},n=this._register(this.instantiationService.createInstance(qD,{...i,...t}));return n.layout(e.activeContainerDimension,e.activeContainerOffset.quickPickTop),this._register(e.onDidLayoutActiveContainer(o=>{Te(e.activeContainer)===Te(n.container)&&n.layout(o,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 ue(e,!1).bindTo(this.contextKeyService),this.contexts.set(e,t))),!(t&&t.get())&&(this.resetContextKeys(),t==null||t.set(!0))}resetContextKeys(){this.contexts.forEach(e=>{e.get()&&e.reset()})}pick(e,t={},i=dt.None){return this.controller.pick(e,t,i)}createQuickPick(){return this.controller.createQuickPick()}createInputBox(){return this.controller.createInputBox()}updateStyles(){this.hasController&&this.controller.applyStyles(this.computeStyles())}computeStyles(){return{widget:{quickInputBackground:fe(NB),quickInputForeground:fe(Xhe),quickInputTitleBackground:fe(Yhe),widgetBorder:fe(IU),widgetShadow:fe(vc)},inputBox:TD,toggle:ID,countBadge:Lj,button:GCe,progressBar:ZCe,keybindingLabel:qCe,list:up({listBackground:NB,listFocusBackground:$u,listFocusForeground:Uu,listInactiveFocusForeground:Uu,listInactiveSelectionIconForeground:cm,listInactiveFocusBackground:$u,listFocusOutline:di,listInactiveFocusOutline:di}),pickerGroup:{pickerGroupBorder:fe(Qhe),pickerGroupForeground:fe(PU)}}}};G2=qwe([Y0(0,Ne),Y0(1,Be),Y0(2,_n),Y0(3,ig),Y0(4,rt)],G2);var oK=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Ug=function(s,e){return function(t,i){e(t,i,s)}};let Z2=class extends G2{constructor(e,t,i,n,o,r){super(t,i,n,new t2(e.getContainerDomNode(),o),r),this.host=void 0;const a=R_.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 le.map(e.onDidLayoutChange,d=>({container:l.getDomNode(),dimension:d}))},get onDidChangeActiveContainer(){return le.None},get onDidAddContainer(){return le.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)}};Z2=oK([Ug(1,Ne),Ug(2,Be),Ug(3,_n),Ug(4,xt),Ug(5,rt)],Z2);let X2=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(Z2,e);this.mapEditorToService.set(e,t),o_(e.onDidDispose)(()=>{i.dispose(),this.mapEditorToService.delete(e)})}return t}get quickAccess(){return this.activeService.quickAccess}constructor(e,t){this.instantiationService=e,this.codeEditorService=t,this.mapEditorToService=new Map}pick(e,t={},i=dt.None){return this.activeService.pick(e,t,i)}createQuickPick(){return this.activeService.createQuickPick()}createInputBox(){return this.activeService.createInputBox()}};X2=oK([Ug(0,Ne),Ug(1,xt)],X2);class R_{static get(e){return e.getContribution(R_.ID)}constructor(e){this.editor=e,this.widget=new dk(this.editor)}dispose(){this.widget.dispose()}}R_.ID="editor.controller.quickInput";class dk{constructor(e){this.codeEditor=e,this.domNode=document.createElement("div"),this.codeEditor.addOverlayWidget(this)}getId(){return dk.ID}getDomNode(){return this.domNode}getPosition(){return{preference:2}}dispose(){this.codeEditor.removeOverlayWidget(this)}}dk.ID="editor.contrib.quickInputWidget";kt(R_.ID,R_,4);class Gwe{constructor(e,t,i,n,o){this._parsedThemeRuleBrand=void 0,this.token=e,this.index=t,this.fontStyle=i,this.foreground=n,this.background=o}}function Zwe(s){if(!s||!Array.isArray(s))return[];const e=[];let t=0;for(let i=0,n=s.length;i{const h=tye(c.token,u.token);return h!==0?h:c.index-u.index});let t=0,i="000000",n="ffffff";for(;s.length>=1&&s[0].token==="";){const c=s.shift();c.fontStyle!==-1&&(t=c.fontStyle),c.foreground!==null&&(i=c.foreground),c.background!==null&&(n=c.background)}const o=new Qwe;for(const c of e)o.getId(c);const r=o.getId(i),a=o.getId(n),l=new KO(t,r,a),d=new qO(l);for(let c=0,u=s.length;c"u"){const n=this._match(t),o=eye(t);i=(n.metadata|o<<8)>>>0,this._cache.set(t,i)}return(i|e<<0)>>>0}}const Jwe=/\b(comment|string|regex|regexp)\b/;function eye(s){const e=s.match(Jwe);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 tye(s,e){return se?1:0}class KO{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 KO(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 qO{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 o=this._children.get(i);return typeof o<"u"?o.match(n):this._mainRule}insert(e,t,i,n){if(e===""){this._mainRule.acceptOverwrite(t,i,n);return}const o=e.indexOf(".");let r,a;o===-1?(r=e,a=""):(r=e.substring(0,o),a=e.substring(o+1));let l=this._children.get(r);typeof l>"u"&&(l=new qO(this._mainRule.clone()),this._children.set(r,l)),l.insert(a,t,i,n)}}function iye(s){const e=[];for(let t=1,i=s.length;t({format:n.format,location:n.location.toString()}))}}s.toJSONObject=e;function t(i){const n=o=>lo(o)?o:void 0;if(i&&Array.isArray(i.src)&&i.src.every(o=>lo(o.format)&&lo(o.location)))return{weight:n(i.weight),style:n(i.style),src:i.src.map(o=>({format:o.format,location:Ae.parse(o.location)}))}}s.fromJSONObject=t})(Q6||(Q6={}));class lye{constructor(){this._onDidChange=new B,this.onDidChange=this._onDidChange.event,this.iconSchema={definitions:{icons:{type:"object",properties:{fontId:{type:"string",description:p("iconDefinition.fontId","The id of the font to use. If not set, the font that is defined first is used.")},fontCharacter:{type:"string",description:p("iconDefinition.fontCharacter","The font character associated with the icon definition.")}},additionalProperties:!1,defaultSnippets:[{body:{fontCharacter:"\\\\e030"}}]}},type:"object",properties:{}},this.iconReferenceSchema={type:"string",pattern:`^${Pe.iconNameExpression}$`,enum:[],enumDescriptions:[]},this.iconsById={},this.iconFontsById={}}registerIcon(e,t,i,n){const o=this.iconsById[e];if(o){if(i&&!o.description){o.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 o}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=(o,r)=>o.id.localeCompare(r.id),t=o=>{for(;Pe.isThemeIcon(o.defaults);)o=this.iconsById[o.defaults.id];return`codicon codicon-${o?o.id:""}`},i=[];i.push("| preview | identifier | default codicon ID | description"),i.push("| ----------- | --------------------------------- | --------------------------------- | --------------------------------- |");const n=Object.keys(this.iconsById).map(o=>this.iconsById[o]);for(const o of n.filter(r=>!!r.description).sort(e))i.push(`||${o.id}|${Pe.isThemeIcon(o.defaults)?o.defaults.id:o.id}|${o.description||""}|`);i.push("| preview | identifier "),i.push("| ----------- | --------------------------------- |");for(const o of n.filter(r=>!Pe.isThemeIcon(r.defaults)).sort(e))i.push(`||${o.id}|`);return i.join(` `)}}const fp=new lye;Ji.add(aye.IconContribution,fp);function xi(s,e,t,i){return fp.registerIcon(s,e,t,i)}function aK(){return fp}function dye(){const s=ez();for(const e in s){const t="\\"+s[e].toString(16);fp.registerIcon(e,{fontCharacter:t})}}dye();const lK="vscode://schemas/icons",dK=Ji.as(vx.JSONContribution);dK.registerSchema(lK,fp.getIconSchema());const J6=new Wt(()=>dK.notifySchemaChanged(lK),200);fp.onDidChange(()=>{J6.isScheduled()||J6.schedule()});const cK=xi("widget-close",oe.close,p("widgetClose","Icon for the close action in widgets."));xi("goto-previous-location",oe.arrowUp,p("previousChangeIcon","Icon for goto previous editor location."));xi("goto-next-location",oe.arrowDown,p("nextChangeIcon","Icon for goto next editor location."));Pe.modify(oe.sync,"spin");Pe.modify(oe.loading,"spin");function cye(s){const e=new Y,t=e.add(new B),i=aK();return e.add(i.onDidChange(()=>t.fire())),s&&e.add(s.onDidProductIconThemeChange(()=>t.fire())),{dispose:()=>e.dispose(),onDidChange:t.event,getCSS(){const n=s?s.getProductIconTheme():new uK,o={},r=[],a=[];for(const l of i.getIcons()){const d=n.getIcon(l);if(!d)continue;const c=d.font,u=`--vscode-icon-${l.id}-font-family`,h=`--vscode-icon-${l.id}-content`;c?(o[c.id]=c.definition,a.push(`${u}: ${qE(c.id)};`,`${h}: '${d.fontCharacter}';`),r.push(`.codicon-${l.id}:before { content: '${d.fontCharacter}'; font-family: ${qE(c.id)}; }`)):(a.push(`${h}: '${d.fontCharacter}'; ${u}: 'codicon';`),r.push(`.codicon-${l.id}:before { content: '${d.fontCharacter}'; }`))}for(const l in o){const d=o[l],c=d.weight?`font-weight: ${d.weight};`:"",u=d.style?`font-style: ${d.style};`:"",h=d.src.map(g=>`${Ih(g.location)} format('${g.format}')`).join(", ");r.push(`@font-face { src: ${h}; font-family: ${qE(l)};${c}${u} font-display: block; }`)}return r.push(`:root { ${a.join(" ")} }`),r.join(` `)}}}class uK{getIcon(e){const t=aK();let i=e.defaults;for(;Pe.isThemeIcon(i);){const n=t.getIcon(i.id);if(!n)return;i=n.defaults}return i}}const Ru="vs",db="vs-dark",Gm="hc-black",Zm="hc-light",hK=Ji.as(DU.ColorContribution),uye=Ji.as(zU.ThemingContribution);class gK{constructor(e,t){this.semanticHighlighting=!1,this.themeData=t;const i=t.base;e.length>0?(rS(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,$.fromHex(this.themeData.colors[t]));if(this.themeData.inherit){const t=Y2(this.themeData.base);for(const i in t.colors)e.has(i)||e.set(i,$.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=hK.resolveDefaultColor(e,this),this.defaultColors[e]=t,t)}defines(e){return this.getColors().has(e)}get type(){switch(this.base){case Ru:return Nr.LIGHT;case Gm:return Nr.HIGH_CONTRAST_DARK;case Zm:return Nr.HIGH_CONTRAST_LIGHT;default:return Nr.DARK}}get tokenTheme(){if(!this._tokenTheme){let e=[],t=[];if(this.themeData.inherit){const o=Y2(this.themeData.base);e=o.rules,o.encodedTokensColors&&(t=o.encodedTokensColors)}const i=this.themeData.colors["editor.foreground"],n=this.themeData.colors["editor.background"];if(i||n){const o={token:""};i&&(o.foreground=i),n&&(o.background=n),e.push(o)}e=e.concat(this.themeData.rules),this.themeData.encodedTokensColors&&(t=this.themeData.encodedTokensColors),this._tokenTheme=rK.createFromRawTokenTheme(e,t)}return this._tokenTheme}getTokenStyleMetadata(e,t,i){const o=this.tokenTheme._match([e].concat(t).join(".")).metadata,r=yo.getForeground(o),a=yo.getFontStyle(o);return{foreground:r,italic:!!(a&1),bold:!!(a&2),underline:!!(a&4),strikethrough:!!(a&8)}}}function rS(s){return s===Ru||s===db||s===Gm||s===Zm}function Y2(s){switch(s){case Ru:return nye;case db:return sye;case Gm:return oye;case Zm:return rye}}function ey(s){const e=Y2(s);return new gK(s,e)}class hye extends H{constructor(){super(),this._onColorThemeChange=this._register(new B),this.onDidColorThemeChange=this._onColorThemeChange.event,this._onProductIconThemeChange=this._register(new B),this.onDidProductIconThemeChange=this._onProductIconThemeChange.event,this._environment=Object.create(null),this._builtInProductIconTheme=new uK,this._autoDetectHighContrast=!0,this._knownThemes=new Map,this._knownThemes.set(Ru,ey(Ru)),this._knownThemes.set(db,ey(db)),this._knownThemes.set(Gm,ey(Gm)),this._knownThemes.set(Zm,ey(Zm));const e=this._register(cye(this));this._codiconCSS=e.getCSS(),this._themeCSS="",this._allCSS=`${this._codiconCSS} ${this._themeCSS}`,this._globalStyleElement=null,this._styleElements=[],this._colorMapOverride=null,this.setTheme(Ru),this._onOSSchemeChanged(),this._register(e.onDidChange(()=>{this._codiconCSS=e.getCSS(),this._updateCSS()})),uz(Ht,"(forced-colors: active)",()=>{this._onOSSchemeChanged()})}registerEditorContainer(e){return US(e)?this._registerShadowDomContainer(e):this._registerRegularEditorContainer()}_registerRegularEditorContainer(){return this._globalStyleElement||(this._globalStyleElement=ar(void 0,e=>{e.className="monaco-colors",e.textContent=this._allCSS}),this._styleElements.push(this._globalStyleElement)),H.None}_registerShadowDomContainer(e){const t=ar(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(Ru),this._updateActualTheme(t)}_updateActualTheme(e){!e||this._theme===e||(this._theme=e,this._updateThemeOrColorMap())}_onOSSchemeChanged(){if(this._autoDetectHighContrast){const e=Ht.matchMedia("(forced-colors: active)").matches;if(e!==dd(this._theme.type)){let t;Dx(this._theme.type)?t=e?Gm:db:t=e?Zm:Ru,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)}};uye.getThemingParticipants().forEach(r=>r(this._theme,i,this._environment));const n=[];for(const r of hK.getColors()){const a=this._theme.getColor(r.id,!0);a&&n.push(`${NF(r.id)}: ${a.toString()};`)}i.addRule(`.monaco-editor, .monaco-diff-editor, .monaco-component { ${n.join(` `)} }`);const o=this._colorMapOverride||this._theme.tokenTheme.getColorMap();i.addRule(iye(o)),this._themeCSS=e.join(` `),this._updateCSS(),Ki.setColorMap(o),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}}const Sa=ut("themeService");var gye=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},YI=function(s,e){return function(t,i){e(t,i,s)}};let Q2=class extends H{constructor(e,t,i){super(),this._contextKeyService=e,this._layoutService=t,this._configurationService=i,this._accessibilitySupport=0,this._onDidChangeScreenReaderOptimized=new B,this._onDidChangeReducedMotion=new B,this._accessibilityModeEnabledContext=_1.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 o=Ht.matchMedia("(prefers-reduced-motion: reduce)");this._systemMotionReduced=o.matches,this._configMotionReduced=this._configurationService.getValue("workbench.reduceMotion"),this.initReducedMotionListeners(o)}initReducedMotionListeners(e){this._register(K(e,"change",()=>{this._systemMotionReduced=e.matches,this._configMotionReduced==="auto"&&this._onDidChangeReducedMotion.fire()}));const t=()=>{const i=this.isMotionReduced();this._layoutService.mainContainer.classList.toggle("reduce-motion",i),this._layoutService.mainContainer.classList.toggle("enable-motion",!i)};t(),this._register(this.onDidChangeReducedMotion(()=>t()))}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}};Q2=gye([YI(0,Be),YI(1,ig),YI(2,rt)],Q2);var ck=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},hd=function(s,e){return function(t,i){e(t,i,s)}},$p,Lu;let J2=class{constructor(e,t,i){this._commandService=e,this._keybindingService=t,this._hiddenStates=new GD(i)}createMenu(e,t,i){return new tM(e,this._hiddenStates,{emitEventsForSubmenuChanges:!1,eventDebounceDelay:50,...i},this._commandService,this._keybindingService,t)}resetHiddenStates(e){this._hiddenStates.reset(e)}};J2=ck([hd(0,gi),hd(1,At),hd(2,Rd)],J2);let GD=$p=class{constructor(e){this._storageService=e,this._disposables=new Y,this._onDidChange=new B,this.onDidChange=this._onDidChange.event,this._ignoreChangeEvent=!1,this._hiddenByDefaultCache=new Map;try{const t=e.get($p._key,0,"{}");this._data=JSON.parse(t)}catch{this._data=Object.create(null)}this._disposables.add(e.onDidChangeValue(0,$p._key,this._disposables)(()=>{if(!this._ignoreChangeEvent)try{const t=e.get($p._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){var i;return(i=this._hiddenByDefaultCache.get(`${e.id}/${t}`))!==null&&i!==void 0?i:!1}setDefaultState(e,t,i){this._hiddenByDefaultCache.set(`${e.id}/${t}`,i)}isHidden(e,t){var i,n;const o=this._isHiddenByDefault(e,t),r=(n=(i=this._data[e.id])===null||i===void 0?void 0:i.includes(t))!==null&&n!==void 0?n:!1;return o?!r:r}updateHidden(e,t,i){this._isHiddenByDefault(e,t)&&(i=!i);const o=this._data[e.id];if(i)o?o.indexOf(t)<0&&o.push(t):this._data[e.id]=[t];else if(o){const r=o.indexOf(t);r>=0&&yse(o,r),o.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($p._key,e,0,0)}finally{this._ignoreChangeEvent=!1}}};GD._key="menu.hiddenCommands";GD=$p=ck([hd(0,Rd)],GD);let eM=Lu=class{constructor(e,t,i,n,o,r){this._id=e,this._hiddenStates=t,this._collectContextKeysForSubmenus=i,this._commandService=n,this._keybindingService=o,this._contextKeyService=r,this._menuGroups=[],this._structureContextKeys=new Set,this._preconditionContextKeys=new Set,this._toggledContextKeys=new Set,this.refresh()}get structureContextKeys(){return this._structureContextKeys}get preconditionContextKeys(){return this._preconditionContextKeys}get toggledContextKeys(){return this._toggledContextKeys}refresh(){this._menuGroups.length=0,this._structureContextKeys.clear(),this._preconditionContextKeys.clear(),this._toggledContextKeys.clear();const e=yn.getMenuItems(this._id);let t;e.sort(Lu._compareMenuItems);for(const i of e){const n=i.group||"";(!t||t[0]!==n)&&(t=[n,[]],this._menuGroups.push(t)),t[1].push(i),this._collectContextKeys(i)}}_collectContextKeys(e){if(Lu._fillInKbExprKeys(e.when,this._structureContextKeys),tm(e)){if(e.command.precondition&&Lu._fillInKbExprKeys(e.command.precondition,this._preconditionContextKeys),e.command.toggled){const t=e.command.toggled.condition||e.command.toggled;Lu._fillInKbExprKeys(t,this._toggledContextKeys)}}else this._collectContextKeysForSubmenus&&yn.getMenuItems(e.submenu).forEach(this._collectContextKeys,this)}createActionGroups(e){const t=[];for(const i of this._menuGroups){const[n,o]=i,r=[];for(const a of o)if(this._contextKeyService.contextMatchesRules(a.when)){const l=tm(a);l&&this._hiddenStates.setDefaultState(this._id,a.command.id,!!a.isHiddenByDefault);const d=fye(this._id,l?a.command:a,this._hiddenStates);if(l){const c=fK(a.command.id,a.when,this._commandService,this._keybindingService);r.push(new Io(a.command,a.alt,e,d,c,this._contextKeyService,this._commandService))}else{const c=new Lu(a.submenu,this._hiddenStates,this._collectContextKeysForSubmenus,this._commandService,this._keybindingService,this._contextKeyService).createActionGroups(e),u=rn.join(...c.map(h=>h[1]));u.length>0&&r.push(new Em(a,d,u))}}r.length>0&&t.push([n,r])}return t}static _fillInKbExprKeys(e,t){if(e)for(const i of e.keys())t.add(i)}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 o=e.order||0,r=t.order||0;return or?1:Lu._compareTitles(tm(e)?e.command.title:e.title,tm(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)}};eM=Lu=ck([hd(3,gi),hd(4,At),hd(5,Be)],eM);let tM=class{constructor(e,t,i,n,o,r){this._disposables=new Y,this._menuInfo=new eM(e,t,i.emitEventsForSubmenuChanges,n,o,r);const a=new Wt(()=>{this._menuInfo.refresh(),this._onDidChange.fire({menu:this,isStructuralChange:!0,isEnablementChange:!0,isToggleChange:!0})},i.eventDebounceDelay);this._disposables.add(a),this._disposables.add(yn.onDidChangeMenu(u=>{u.has(e)&&a.schedule()}));const l=this._disposables.add(new Y),d=u=>{let h=!1,g=!1,f=!1;for(const m of u)if(h=h||m.isStructuralChange,g=g||m.isEnablementChange,f=f||m.isToggleChange,h&&g&&f)break;return{menu:this,isStructuralChange:h,isEnablementChange:g,isToggleChange:f}},c=()=>{l.add(r.onDidChangeContext(u=>{const h=u.affectsSome(this._menuInfo.structureContextKeys),g=u.affectsSome(this._menuInfo.preconditionContextKeys),f=u.affectsSome(this._menuInfo.toggledContextKeys);(h||g||f)&&this._onDidChange.fire({menu:this,isStructuralChange:h,isEnablementChange:g,isToggleChange:f})})),l.add(t.onDidChange(u=>{this._onDidChange.fire({menu:this,isStructuralChange:!0,isEnablementChange:!1,isToggleChange:!1})}))};this._onDidChange=new $V({onWillAddFirstListener:c,onDidRemoveLastListener:l.clear.bind(l),delay:i.eventDebounceDelay,merge:d}),this.onDidChange=this._onDidChange.event}getActions(e){return this._menuInfo.createActionGroups(e)}dispose(){this._disposables.dispose(),this._onDidChange.dispose()}};tM=ck([hd(3,gi),hd(4,At),hd(5,Be)],tM);function fye(s,e,t){const i=Ele(e)?e.submenu.id:e.id,n=typeof e.title=="string"?e.title:e.title.value,o=af({id:`hide/${s.id}/${i}`,label:p("hide.label","Hide '{0}'",n),run(){t.updateHidden(s,i,!0)}}),r=af({id:`toggle/${s.id}/${i}`,label:n,get checked(){return!t.isHidden(s,i)},run(){t.updateHidden(s,i,!!this.checked)}});return{hide:o,toggle:r,get isHidden(){return!r.checked}}}function fK(s,e=void 0,t,i){return af({id:`configureKeybinding/${s}`,label:p("configure keybinding","Configure Keybinding"),run(){const o=!!!i.lookupKeybinding(s)&&e?e.serialize():void 0;t.executeCommand("workbench.action.openGlobalKeybindings",`@command:${s}`+(o?` +when:${o}`:""))}})}var pye=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},e7=function(s,e){return function(t,i){e(t,i,s)}},iM;let ZD=iM=class extends H{constructor(e,t){super(),this.layoutService=e,this.logService=t,this.mapTextToType=new Map,this.findText="",this.resources=[],this.resourcesStateHash=void 0,(Lh||hz)&&this.installWebKitWriteTextWorkaround(),this._register(le.runAndSubscribe(JL,({window:i,disposables:n})=>{n.add(K(i.document,"copy",()=>this.clearResources()))},{window:Ht,disposables:this._store}))}installWebKitWriteTextWorkaround(){const e=()=>{const t=new ZL;this.webKitPendingClipboardWritePromise&&!this.webKitPendingClipboardWritePromise.isSettled&&this.webKitPendingClipboardWritePromise.cancel(),this.webKitPendingClipboardWritePromise=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(le.runAndSubscribe(this.layoutService.onDidAddContainer,({container:t,disposables:i})=>{i.add(K(t,"click",e)),i.add(K(t,"keydown",e))},{container:this.layoutService.mainContainer,disposables:this._store}))}async writeText(e,t){if(this.writeResources([]),t){this.mapTextToType.set(t,e);return}if(this.webKitPendingClipboardWritePromise)return this.webKitPendingClipboardWritePromise.complete(e);try{return await navigator.clipboard.writeText(e)}catch(i){console.error(i)}this.fallbackWriteText(e)}fallbackWriteText(e){const t=o0(),i=t.activeElement,n=t.body.appendChild(he("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"),i instanceof HTMLElement&&i.focus(),t.body.removeChild(n)}async readText(e){if(e)return this.mapTextToType.get(e)||"";try{return await navigator.clipboard.readText()}catch(t){console.error(t)}return""}async readFindText(){return this.findText}async writeFindText(e){this.findText=e}async writeResources(e){e.length===0?this.clearResources():(this.resources=e,this.resourcesStateHash=await this.computeResourcesStateHash())}async readResources(){const e=await this.computeResourcesStateHash();return this.resourcesStateHash!==e&&this.clearResources(),this.resources}async computeResourcesStateHash(){if(this.resources.length===0)return;const e=await this.readText();return XL(e.substring(0,iM.MAX_RESOURCE_STATE_SOURCE_LENGTH))}clearResources(){this.resources=[],this.resourcesStateHash=void 0}};ZD.MAX_RESOURCE_STATE_SOURCE_LENGTH=1e3;ZD=iM=pye([e7(0,ig),e7(1,ys)],ZD);const ru=ut("clipboardService");var mye=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},_ye=function(s,e){return function(t,i){e(t,i,s)}};const cb="data-keybinding-context";let GO=class{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 P_ extends GO{constructor(){super(-1,null)}setValue(e,t){return!1}removeValue(e){return!1}getValue(e){}}P_.INSTANCE=new P_;class yC extends GO{constructor(e,t,i){super(e,null),this._configurationService=t,this._values=$m.forConfigKeys(),this._listener=this._configurationService.onDidChangeConfiguration(n=>{if(n.source===7){const o=Array.from(this._values,([r])=>r);this._values.clear(),i.fire(new i7(o))}else{const o=[];for(const r of n.affectedKeys){const a=`config.${r}`,l=this._values.findSuperstr(a);l!==void 0&&(o.push(...ft.map(l,([d])=>d)),this._values.deleteSuperstr(a)),this._values.has(a)&&(o.push(a),this._values.delete(a))}i.fire(new i7(o))}})}dispose(){this._listener.dispose()}getValue(e){if(e.indexOf(yC._keyPrefix)!==0)return super.getValue(e);if(this._values.has(e))return this._values.get(e);const t=e.substr(yC._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)}}yC._keyPrefix="config.";class vye{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 t7{constructor(e){this.key=e}affectsSome(e){return e.has(this.key)}allKeysContainedIn(e){return this.affectsSome(e)}}class i7{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 bye{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 Cye(s,e){return s.allKeysContainedIn(new Set(Object.keys(e)))}class pK extends H{constructor(e){super(),this._onDidChangeContext=this._register(new bf({merge:t=>new bye(t)})),this.onDidChangeContext=this._onDidChangeContext.event,this._isDisposed=!1,this._myContextId=e}createKey(e,t){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");return new vye(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 wye(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 t7(e))}removeContext(e){this._isDisposed||this.getContextValuesContainer(this._myContextId).removeValue(e)&&this._onDidChangeContext.fire(new t7(e))}getContext(e){return this._isDisposed?P_.INSTANCE:this.getContextValuesContainer(yye(e))}dispose(){super.dispose(),this._isDisposed=!0}}let nM=class extends pK{constructor(e){super(0),this._contexts=new Map,this._lastContextId=0;const t=this._register(new yC(this._myContextId,e,this._onDidChangeContext));this._contexts.set(this._myContextId,t)}getContextValuesContainer(e){return this._isDisposed?P_.INSTANCE:this._contexts.get(e)||P_.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 GO(t,this.getContextValuesContainer(e))),t}disposeContext(e){this._isDisposed||this._contexts.delete(e)}};nM=mye([_ye(0,rt)],nM);class wye extends pK{constructor(e,t){if(super(e.createChildContext()),this._parentChangeListener=this._register(new $n),this._parent=e,this._updateParentChangeListener(),this._domNode=t,this._domNode.hasAttribute(cb)){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(cb,String(this._myContextId))}_updateParentChangeListener(){this._parentChangeListener.value=this._parent.onDidChangeContext(e=>{const i=this._parent.getContextValuesContainer(this._myContextId).value;Cye(e,i)||this._onDidChangeContext.fire(e)})}dispose(){this._isDisposed||(this._parent.disposeContext(this._myContextId),this._domNode.removeAttribute(cb),super.dispose())}getContextValuesContainer(e){return this._isDisposed?P_.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 yye(s){for(;s;){if(s.hasAttribute(cb)){const e=s.getAttribute(cb);return e?parseInt(e,10):NaN}s=s.parentElement}return 0}function Sye(s,e,t){s.get(Be).createKey(String(e),Dye(t))}function Dye(s){return TV(s,e=>{if(typeof e=="object"&&e.$mid===1)return Ae.revive(e).toString();if(e instanceof Ae)return e.toString()})}pt.registerCommand("_setContext",Sye);pt.registerCommand({id:"getContextKeyInfo",handler(){return[...ue.all()].sort((s,e)=>s.key.localeCompare(e.key))},metadata:{description:p("getContextKeyInfo","A command that returns information about context keys"),args:[]}});pt.registerCommand("_generateContextKeyInfo",function(){const s=[],e=new Set;for(const t of ue.all())e.has(t.key)||(e.add(t.key),s.push(t));s.sort((t,i)=>t.key.localeCompare(i.key)),console.log(JSON.stringify(s,void 0,2))});let Lye=class{constructor(e,t){this.key=e,this.data=t,this.incoming=new Map,this.outgoing=new Map}};class n7{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 Lye(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 o=this._findCycle(n,t);if(o)return o;t.delete(i)}}}const xye=!1;class s7 extends Error{constructor(e){var t;super("cyclic dependency between services"),this.message=(t=e.findCycleSlow())!==null&&t!==void 0?t:`UNABLE to detect cycle, dumping graph: ${e.toString()}`}}class XD{constructor(e=new L1,t=!1,i,n=xye){var o;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(Ne,this),this._globalGraph=n?(o=i==null?void 0:i._globalGraph)!==null&&o!==void 0?o:new n7(r=>r):void 0}dispose(){if(!this._isDisposed){this._isDisposed=!0,jt(this._children),this._children.clear();for(const e of this._servicesToMaybeDispose)jL(e)&&e.dispose();this._servicesToMaybeDispose.clear()}}_throwIfDisposed(){if(this._isDisposed)throw new Error("InstantiationService has been disposed")}createChild(e){this._throwIfDisposed();const t=new class extends XD{dispose(){this._children.delete(t),super.dispose()}}(e,this._strict,this,this._enableTracing);return this._children.add(t),t}invokeFunction(e,...t){this._throwIfDisposed();const i=io.traceInvocation(this._enableTracing,e);let n=!1;try{return e({get:r=>{if(n)throw UP("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}},...t)}finally{n=!0,i.stop()}}createInstance(e,...t){this._throwIfDisposed();let i,n;return e instanceof Ol?(i=io.traceCreation(this._enableTracing,e.ctor),n=this._createInstance(e.ctor,e.staticArguments.concat(t),i)):(i=io.traceCreation(this._enableTracing,e),n=this._createInstance(e,t,i)),i.stop(),n}_createInstance(e,t=[],i){const n=qa.getServiceDependencies(e).sort((a,l)=>a.index-l.index),o=[];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),o.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(o))}_setCreatedServiceInstance(e,t){if(this._services.get(e)instanceof Ol)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 Ol?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){var n;const o=new n7(l=>l.id.toString());let r=0;const a=[{id:e,desc:t,_trace:i}];for(;a.length;){const l=a.pop();if(o.lookupOrInsertNode(l),r++>1e3)throw new s7(o);for(const d of qa.getServiceDependencies(l.desc.ctor)){const c=this._getServiceInstanceOrDescriptor(d.id);if(c||this._throwIfStrict(`[createInstance] ${e} depends on ${d.id} which is NOT registered.`,!0),(n=this._globalGraph)===null||n===void 0||n.insertEdge(String(l.id),String(d.id)),c instanceof Ol){const u={id:d.id,desc:c,_trace:l._trace.branch(d.id,!0)};o.insertEdge(l,u),a.push(u)}}}for(;;){const l=o.roots();if(l.length===0){if(!o.isEmpty())throw new s7(o);break}for(const{data:d}of l){if(this._getServiceInstanceOrDescriptor(d.id)instanceof Ol){const u=this._createServiceInstanceWithOwner(d.id,d.desc.ctor,d.desc.staticArguments,d.desc.supportsDelayedInstantiation,d._trace);this._setCreatedServiceInstance(d.id,u)}o.removeNode(d)}}return this._getServiceInstanceOrDescriptor(e)}_createServiceInstanceWithOwner(e,t,i=[],n,o){if(this._services.get(e)instanceof Ol)return this._createServiceInstance(e,t,i,n,o,this._servicesToMaybeDispose);if(this._parent)return this._parent._createServiceInstanceWithOwner(e,t,i,n,o);throw new Error(`illegalState - creating UNKNOWN service instance ${t.name}`)}_createServiceInstance(e,t,i=[],n,o,r){if(n){const a=new XD(void 0,this._strict,this,this._enableTracing);a._globalGraphImplicitDependency=String(e);const l=new Map,d=new eae(()=>{const c=a._createInstance(t,i,o);for(const[u,h]of l){const g=c[u];if(typeof g=="function")for(const f of h)f.disposable=g.apply(c,f.listener)}return l.clear(),r.add(c),c});return new Proxy(Object.create(null),{get(c,u){if(!d.isInitialized&&typeof u=="string"&&(u.startsWith("onDid")||u.startsWith("onWill"))){let f=l.get(u);return f||(f=new Rs,l.set(u,f)),(_,v,b)=>{if(d.isInitialized)return d.value[u](_,v,b);{const C={listener:[_,v,b],disposable:void 0},w=f.push(C);return Ie(()=>{var D;w(),(D=C.disposable)===null||D===void 0||D.dispose()})}}}if(u in c)return c[u];const h=d.value;let g=h[u];return typeof g!="function"||(g=g.bind(h),c[u]=g),g},set(c,u,h){return d.value[u]=h,!0},getPrototypeOf(c){return t.prototype}})}else{const a=this._createInstance(t,i,o);return r.add(a),a}}_throwIfStrict(e,t){if(t&&console.warn(e),this._strict)throw new Error(e)}}class io{static traceInvocation(e,t){return e?new io(2,t.name||new Error().stack.split(` `).slice(3,4).join(` `)):io._None}static traceCreation(e,t){return e?new io(1,t.name):io._None}constructor(e,t){this.type=e,this.name=t,this._start=Date.now(),this._dep=[]}branch(e,t){const i=new io(3,e.toString());return this._dep.push([e,t,i]),i}stop(){const e=Date.now()-this._start;io._totals+=e;let t=!1;function i(o,r){const a=[],l=new Array(o+1).join(" ");for(const[d,c,u]of r._dep)if(c&&u){t=!0,a.push(`${l}CREATES -> ${d}`);const h=i(o+1,u);h&&a.push(h)}else a.push(`${l}uses -> ${d}`);return a.join(` `)}const n=[`${this.type===1?"CREATE":"CALL"} ${this.name}`,`${i(1,this)}`,`DONE, took ${e.toFixed(2)}ms (grand total ${io._totals.toFixed(2)}ms)`];(e>2||t)&&io.all.add(n.join(` `))}}io.all=new Set;io._None=new class extends io{constructor(){super(0,null)}stop(){}branch(){return this}};io._totals=0;const kye=new Set([Ge.inMemory,Ge.vscodeSourceControl,Ge.walkThrough,Ge.walkThroughSnippet,Ge.vscodeChatCodeBlock]);class Eye{constructor(){this._byResource=new Wi,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 o=this._byOwner.get(t);o||(o=new Wi,this._byOwner.set(t,o)),o.set(e,i)}get(e,t){const i=this._byResource.get(e);return i==null?void 0:i.get(t)}delete(e,t){let i=!1,n=!1;const o=this._byResource.get(e);o&&(i=o.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){var t,i,n,o;return typeof e=="string"?(i=(t=this._byOwner.get(e))===null||t===void 0?void 0:t.values())!==null&&i!==void 0?i:ft.empty():Ae.isUri(e)?(o=(n=this._byResource.get(e))===null||n===void 0?void 0:n.values())!==null&&o!==void 0?o:ft.empty():ft.map(ft.concat(...this._byOwner.values()),r=>r[1])}}class Iye{constructor(e){this.errors=0,this.infos=0,this.warnings=0,this.unknowns=0,this._data=new Wi,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(kye.has(e.scheme))return t;for(const{severity:i}of this._service.read({resource:e}))i===Li.Error?t.errors+=1:i===Li.Warning?t.warnings+=1:i===Li.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 ku{constructor(){this._onMarkerChanged=new $V({delay:0,merge:ku._merge}),this.onMarkerChanged=this._onMarkerChanged.event,this._data=new Eye,this._stats=new Iye(this)}dispose(){this._stats.dispose(),this._onMarkerChanged.dispose()}remove(e,t){for(const i of t||[])this.changeOne(e,i,[])}changeOne(e,t,i){if(LV(i))this._data.delete(t,e)&&this._onMarkerChanged.fire([t]);else{const n=[];for(const o of i){const r=ku._toMarker(e,t,o);r&&n.push(r)}this._data.set(t,e,n),this._onMarkerChanged.fire([t])}}static _toMarker(e,t,i){let{code:n,severity:o,message:r,source:a,startLineNumber:l,startColumn:d,endLineNumber:c,endColumn:u,relatedInformation:h,tags:g}=i;if(r)return l=l>0?l:1,d=d>0?d:1,c=c>=l?c:l,u=u>0?u:d,{resource:t,owner:e,code:n,severity:o,message:r,source:a,startLineNumber:l,startColumn:d,endLineNumber:c,endColumn:u,relatedInformation:h,tags:g}}changeAll(e,t){const i=[],n=this._data.values(e);if(n)for(const o of n){const r=ft.first(o);r&&(i.push(r.resource),this._data.delete(r.resource,e))}if(rs(t)){const o=new Wi;for(const{resource:r,marker:a}of t){const l=ku._toMarker(e,r,a);if(!l)continue;const d=o.get(r);d?d.push(l):(o.set(r,[l]),i.push(r))}for(const[r,a]of o)this._data.set(r,e,a)}i.length>0&&this._onMarkerChanged.fire(i)}read(e=Object.create(null)){let{owner:t,resource:i,severities:n,take:o}=e;if((!o||o<0)&&(o=-1),t&&i){const r=this._data.get(i,t);if(r){const a=[];for(const l of r)if(ku._accept(l,n)){const d=a.push(l);if(o>0&&d===o)break}return a}else return[]}else if(!t&&!i){const r=[];for(const a of this._data.values())for(const l of a)if(ku._accept(l,n)){const d=r.push(l);if(o>0&&d===o)return r}return r}else{const r=this._data.values(i??t),a=[];for(const l of r)for(const d of l)if(ku._accept(d,n)){const c=a.push(d);if(o>0&&c===o)return a}return a}}static _accept(e,t){return t===void 0||(t&e.severity)===e.severity}static _merge(e){const t=new Wi;for(const i of e)for(const n of i)t.set(n,!0);return Array.from(t.keys())}}class Tye extends H{get configurationModel(){return this._configurationModel}constructor(e){super(),this.logService=e,this._configurationModel=Vn.createEmptyModel(this.logService)}reload(){return this.resetConfigurationModel(),this.configurationModel}getConfigurationDefaultOverrides(){return{}}resetConfigurationModel(){this._configurationModel=Vn.createEmptyModel(this.logService);const e=Ji.as(pl.Configuration).getConfigurationProperties();this.updateConfigurationModel(Object.keys(e),e)}updateConfigurationModel(e,t){const i=this.getConfigurationDefaultOverrides();for(const n of e){const o=i[n],r=t[n];o!==void 0?this._configurationModel.addValue(n,o):r?this._configurationModel.addValue(n,r.default):this._configurationModel.removeValue(n)}}}const rg=ut("accessibilitySignalService");class He{static register(e){return new He(e.fileName)}constructor(e){this.fileName=e}}He.error=He.register({fileName:"error.mp3"});He.warning=He.register({fileName:"warning.mp3"});He.foldedArea=He.register({fileName:"foldedAreas.mp3"});He.break=He.register({fileName:"break.mp3"});He.quickFixes=He.register({fileName:"quickFixes.mp3"});He.taskCompleted=He.register({fileName:"taskCompleted.mp3"});He.taskFailed=He.register({fileName:"taskFailed.mp3"});He.terminalBell=He.register({fileName:"terminalBell.mp3"});He.diffLineInserted=He.register({fileName:"diffLineInserted.mp3"});He.diffLineDeleted=He.register({fileName:"diffLineDeleted.mp3"});He.diffLineModified=He.register({fileName:"diffLineModified.mp3"});He.chatRequestSent=He.register({fileName:"chatRequestSent.mp3"});He.chatResponseReceived1=He.register({fileName:"chatResponseReceived1.mp3"});He.chatResponseReceived2=He.register({fileName:"chatResponseReceived2.mp3"});He.chatResponseReceived3=He.register({fileName:"chatResponseReceived3.mp3"});He.chatResponseReceived4=He.register({fileName:"chatResponseReceived4.mp3"});He.clear=He.register({fileName:"clear.mp3"});He.save=He.register({fileName:"save.mp3"});He.format=He.register({fileName:"format.mp3"});He.voiceRecordingStarted=He.register({fileName:"voiceRecordingStarted.mp3"});He.voiceRecordingStopped=He.register({fileName:"voiceRecordingStopped.mp3"});He.progress=He.register({fileName:"progress.mp3"});class Nye{constructor(e){this.randomOneOf=e}}class Ke{constructor(e,t,i,n,o,r){this.sound=e,this.name=t,this.legacySoundSettingsKey=i,this.settingsKey=n,this.legacyAnnouncementSettingsKey=o,this.announcementMessage=r}static register(e){const t=new Nye("randomOneOf"in e.sound?e.sound.randomOneOf:[e.sound]),i=new Ke(t,e.name,e.legacySoundSettingsKey,e.settingsKey,e.legacyAnnouncementSettingsKey,e.announcementMessage);return Ke._signals.add(i),i}}Ke._signals=new Set;Ke.errorAtPosition=Ke.register({name:p("accessibilitySignals.positionHasError.name","Error at Position"),sound:He.error,announcementMessage:p("accessibility.signals.positionHasError","Error"),settingsKey:"accessibility.signals.positionHasError"});Ke.warningAtPosition=Ke.register({name:p("accessibilitySignals.positionHasWarning.name","Warning at Position"),sound:He.warning,announcementMessage:p("accessibility.signals.positionHasWarning","Warning"),settingsKey:"accessibility.signals.positionHasWarning"});Ke.errorOnLine=Ke.register({name:p("accessibilitySignals.lineHasError.name","Error on Line"),sound:He.error,legacySoundSettingsKey:"audioCues.lineHasError",legacyAnnouncementSettingsKey:"accessibility.alert.error",announcementMessage:p("accessibility.signals.lineHasError","Error on Line"),settingsKey:"accessibility.signals.lineHasError"});Ke.warningOnLine=Ke.register({name:p("accessibilitySignals.lineHasWarning.name","Warning on Line"),sound:He.warning,legacySoundSettingsKey:"audioCues.lineHasWarning",legacyAnnouncementSettingsKey:"accessibility.alert.warning",announcementMessage:p("accessibility.signals.lineHasWarning","Warning on Line"),settingsKey:"accessibility.signals.lineHasWarning"});Ke.foldedArea=Ke.register({name:p("accessibilitySignals.lineHasFoldedArea.name","Folded Area on Line"),sound:He.foldedArea,legacySoundSettingsKey:"audioCues.lineHasFoldedArea",legacyAnnouncementSettingsKey:"accessibility.alert.foldedArea",announcementMessage:p("accessibility.signals.lineHasFoldedArea","Folded"),settingsKey:"accessibility.signals.lineHasFoldedArea"});Ke.break=Ke.register({name:p("accessibilitySignals.lineHasBreakpoint.name","Breakpoint on Line"),sound:He.break,legacySoundSettingsKey:"audioCues.lineHasBreakpoint",legacyAnnouncementSettingsKey:"accessibility.alert.breakpoint",announcementMessage:p("accessibility.signals.lineHasBreakpoint","Breakpoint"),settingsKey:"accessibility.signals.lineHasBreakpoint"});Ke.inlineSuggestion=Ke.register({name:p("accessibilitySignals.lineHasInlineSuggestion.name","Inline Suggestion on Line"),sound:He.quickFixes,legacySoundSettingsKey:"audioCues.lineHasInlineSuggestion",settingsKey:"accessibility.signals.lineHasInlineSuggestion"});Ke.terminalQuickFix=Ke.register({name:p("accessibilitySignals.terminalQuickFix.name","Terminal Quick Fix"),sound:He.quickFixes,legacySoundSettingsKey:"audioCues.terminalQuickFix",legacyAnnouncementSettingsKey:"accessibility.alert.terminalQuickFix",announcementMessage:p("accessibility.signals.terminalQuickFix","Quick Fix"),settingsKey:"accessibility.signals.terminalQuickFix"});Ke.onDebugBreak=Ke.register({name:p("accessibilitySignals.onDebugBreak.name","Debugger Stopped on Breakpoint"),sound:He.break,legacySoundSettingsKey:"audioCues.onDebugBreak",legacyAnnouncementSettingsKey:"accessibility.alert.onDebugBreak",announcementMessage:p("accessibility.signals.onDebugBreak","Breakpoint"),settingsKey:"accessibility.signals.onDebugBreak"});Ke.noInlayHints=Ke.register({name:p("accessibilitySignals.noInlayHints","No Inlay Hints on Line"),sound:He.error,legacySoundSettingsKey:"audioCues.noInlayHints",legacyAnnouncementSettingsKey:"accessibility.alert.noInlayHints",announcementMessage:p("accessibility.signals.noInlayHints","No Inlay Hints"),settingsKey:"accessibility.signals.noInlayHints"});Ke.taskCompleted=Ke.register({name:p("accessibilitySignals.taskCompleted","Task Completed"),sound:He.taskCompleted,legacySoundSettingsKey:"audioCues.taskCompleted",legacyAnnouncementSettingsKey:"accessibility.alert.taskCompleted",announcementMessage:p("accessibility.signals.taskCompleted","Task Completed"),settingsKey:"accessibility.signals.taskCompleted"});Ke.taskFailed=Ke.register({name:p("accessibilitySignals.taskFailed","Task Failed"),sound:He.taskFailed,legacySoundSettingsKey:"audioCues.taskFailed",legacyAnnouncementSettingsKey:"accessibility.alert.taskFailed",announcementMessage:p("accessibility.signals.taskFailed","Task Failed"),settingsKey:"accessibility.signals.taskFailed"});Ke.terminalCommandFailed=Ke.register({name:p("accessibilitySignals.terminalCommandFailed","Terminal Command Failed"),sound:He.error,legacySoundSettingsKey:"audioCues.terminalCommandFailed",legacyAnnouncementSettingsKey:"accessibility.alert.terminalCommandFailed",announcementMessage:p("accessibility.signals.terminalCommandFailed","Command Failed"),settingsKey:"accessibility.signals.terminalCommandFailed"});Ke.terminalBell=Ke.register({name:p("accessibilitySignals.terminalBell","Terminal Bell"),sound:He.terminalBell,legacySoundSettingsKey:"audioCues.terminalBell",legacyAnnouncementSettingsKey:"accessibility.alert.terminalBell",announcementMessage:p("accessibility.signals.terminalBell","Terminal Bell"),settingsKey:"accessibility.signals.terminalBell"});Ke.notebookCellCompleted=Ke.register({name:p("accessibilitySignals.notebookCellCompleted","Notebook Cell Completed"),sound:He.taskCompleted,legacySoundSettingsKey:"audioCues.notebookCellCompleted",legacyAnnouncementSettingsKey:"accessibility.alert.notebookCellCompleted",announcementMessage:p("accessibility.signals.notebookCellCompleted","Notebook Cell Completed"),settingsKey:"accessibility.signals.notebookCellCompleted"});Ke.notebookCellFailed=Ke.register({name:p("accessibilitySignals.notebookCellFailed","Notebook Cell Failed"),sound:He.taskFailed,legacySoundSettingsKey:"audioCues.notebookCellFailed",legacyAnnouncementSettingsKey:"accessibility.alert.notebookCellFailed",announcementMessage:p("accessibility.signals.notebookCellFailed","Notebook Cell Failed"),settingsKey:"accessibility.signals.notebookCellFailed"});Ke.diffLineInserted=Ke.register({name:p("accessibilitySignals.diffLineInserted","Diff Line Inserted"),sound:He.diffLineInserted,legacySoundSettingsKey:"audioCues.diffLineInserted",settingsKey:"accessibility.signals.diffLineInserted"});Ke.diffLineDeleted=Ke.register({name:p("accessibilitySignals.diffLineDeleted","Diff Line Deleted"),sound:He.diffLineDeleted,legacySoundSettingsKey:"audioCues.diffLineDeleted",settingsKey:"accessibility.signals.diffLineDeleted"});Ke.diffLineModified=Ke.register({name:p("accessibilitySignals.diffLineModified","Diff Line Modified"),sound:He.diffLineModified,legacySoundSettingsKey:"audioCues.diffLineModified",settingsKey:"accessibility.signals.diffLineModified"});Ke.chatRequestSent=Ke.register({name:p("accessibilitySignals.chatRequestSent","Chat Request Sent"),sound:He.chatRequestSent,legacySoundSettingsKey:"audioCues.chatRequestSent",legacyAnnouncementSettingsKey:"accessibility.alert.chatRequestSent",announcementMessage:p("accessibility.signals.chatRequestSent","Chat Request Sent"),settingsKey:"accessibility.signals.chatRequestSent"});Ke.chatResponseReceived=Ke.register({name:p("accessibilitySignals.chatResponseReceived","Chat Response Received"),legacySoundSettingsKey:"audioCues.chatResponseReceived",sound:{randomOneOf:[He.chatResponseReceived1,He.chatResponseReceived2,He.chatResponseReceived3,He.chatResponseReceived4]},settingsKey:"accessibility.signals.chatResponseReceived"});Ke.progress=Ke.register({name:p("accessibilitySignals.progress","Progress"),sound:He.progress,legacySoundSettingsKey:"audioCues.chatResponsePending",legacyAnnouncementSettingsKey:"accessibility.alert.chatResponseProgress",announcementMessage:p("accessibility.signals.progress","Progress"),settingsKey:"accessibility.signals.progress"});Ke.clear=Ke.register({name:p("accessibilitySignals.clear","Clear"),sound:He.clear,legacySoundSettingsKey:"audioCues.clear",legacyAnnouncementSettingsKey:"accessibility.alert.clear",announcementMessage:p("accessibility.signals.clear","Clear"),settingsKey:"accessibility.signals.clear"});Ke.save=Ke.register({name:p("accessibilitySignals.save","Save"),sound:He.save,legacySoundSettingsKey:"audioCues.save",legacyAnnouncementSettingsKey:"accessibility.alert.save",announcementMessage:p("accessibility.signals.save","Save"),settingsKey:"accessibility.signals.save"});Ke.format=Ke.register({name:p("accessibilitySignals.format","Format"),sound:He.format,legacySoundSettingsKey:"audioCues.format",legacyAnnouncementSettingsKey:"accessibility.alert.format",announcementMessage:p("accessibility.signals.format","Format"),settingsKey:"accessibility.signals.format"});Ke.voiceRecordingStarted=Ke.register({name:p("accessibilitySignals.voiceRecordingStarted","Voice Recording Started"),sound:He.voiceRecordingStarted,legacySoundSettingsKey:"audioCues.voiceRecordingStarted",settingsKey:"accessibility.signals.voiceRecordingStarted"});Ke.voiceRecordingStopped=Ke.register({name:p("accessibilitySignals.voiceRecordingStopped","Voice Recording Stopped"),sound:He.voiceRecordingStopped,legacySoundSettingsKey:"audioCues.voiceRecordingStopped",settingsKey:"accessibility.signals.voiceRecordingStopped"});class Aye extends H{constructor(e,t=[]){super(),this.logger=new Tle([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)}}const mK=[];function F1(s){mK.push(s)}function Mye(){return mK.slice(0)}var au=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Nn=function(s,e){return function(t,i){e(t,i,s)}};class Rye{constructor(e){this.disposed=!1,this.model=e,this._onWillDispose=new B}get textEditorModel(){return this.model}dispose(){this.disposed=!0,this._onWillDispose.fire()}}let sM=class{constructor(e){this.modelService=e}createModelReference(e){const t=this.modelService.getModel(e);return t?Promise.resolve(new zoe(new Rye(t))):Promise.reject(new Error("Model not found"))}};sM=au([Nn(0,_i)],sM);class uk{show(){return uk.NULL_PROGRESS_RUNNER}async showWhile(e,t){await e}}uk.NULL_PROGRESS_RUNNER={done:()=>{},total:()=>{},worked:()=>{}};class Pye{withProgress(e,t,i){return t({report:()=>{}})}}class Fye{constructor(){this.isExtensionDevelopment=!1,this.isBuilt=!1}}class Oye{async confirm(e){return{confirmed:this.doConfirm(e.message,e.detail),checkboxChecked:!1}}doConfirm(e,t){let i=e;return t&&(i=i+` `+t),Ht.confirm(i)}async prompt(e){var t,i;let n;if(this.doConfirm(e.message,e.detail)){const r=[...(t=e.buttons)!==null&&t!==void 0?t:[]];e.cancelButton&&typeof e.cancelButton!="string"&&typeof e.cancelButton!="boolean"&&r.push(e.cancelButton),n=await((i=r[0])===null||i===void 0?void 0:i.run({checkboxChecked:!1}))}return{result:n}}async error(e,t){await this.prompt({type:Bi.Error,message:e,detail:t})}}class SC{info(e){return this.notify({severity:Bi.Info,message:e})}warn(e){return this.notify({severity:Bi.Warning,message:e})}error(e){return this.notify({severity:Bi.Error,message:e})}notify(e){switch(e.severity){case Bi.Error:console.error(e.message);break;case Bi.Warning:console.warn(e.message);break;default:console.log(e.message);break}return SC.NO_OP}prompt(e,t,i,n){return SC.NO_OP}status(e,t){return H.None}}SC.NO_OP=new u0e;let oM=class{constructor(e){this._onWillExecuteCommand=new B,this._onDidExecuteCommand=new B,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this._instantiationService=e}executeCommand(e,...t){const i=pt.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)}}};oM=au([Nn(0,Ne)],oM);let F_=class extends wbe{constructor(e,t,i,n,o,r){super(e,t,i,n,o),this._cachedResolver=null,this._dynamicKeybindings=[],this._domNodeListeners=[];const a=g=>{const f=new Y;f.add(K(g,ee.KEY_DOWN,m=>{const _=new Kt(m);this._dispatch(_,_.target)&&(_.preventDefault(),_.stopPropagation())})),f.add(K(g,ee.KEY_UP,m=>{const _=new Kt(m);this._singleModifierDispatch(_,_.target)&&_.preventDefault()})),this._domNodeListeners.push(new Bye(g,f))},l=g=>{for(let f=0;f{g.getOption(61)||a(g.getContainerDomNode())},c=g=>{g.getOption(61)||l(g.getContainerDomNode())};this._register(r.onCodeEditorAdd(d)),this._register(r.onCodeEditorRemove(c)),r.listCodeEditors().forEach(d);const u=g=>{a(g.getContainerDomNode())},h=g=>{l(g.getContainerDomNode())};this._register(r.onDiffEditorAdd(u)),this._register(r.onDiffEditorRemove(h)),r.listDiffEditors().forEach(u)}addDynamicKeybinding(e,t,i,n){return ha(pt.registerCommand(e,i),this.addDynamicKeybindings([{keybinding:t,command:e,when:n}]))}addDynamicKeybindings(e){const t=e.map(i=>{var n;return{keybinding:JN(i.keybinding,Lo),command:(n=i.command)!==null&&n!==void 0?n:null,commandArgs:i.commandArgs,when:i.when,weight1:1e3,weight2:0,extensionId:null,isBuiltinExtension:!1}});return this._dynamicKeybindings=this._dynamicKeybindings.concat(t),this.updateResolver(),Ie(()=>{for(let i=0;ithis._log(i))}return this._cachedResolver}_documentHasFocus(){return Ht.document.hasFocus()}_toNormalizedKeybindingItems(e,t){const i=[];let n=0;for(const o of e){const r=o.when||void 0,a=o.keybinding;if(!a)i[n++]=new c6(void 0,o.command,o.commandArgs,r,t,null,!1);else{const l=lC.resolveKeybinding(a,Lo);for(const d of l)i[n++]=new c6(d,o.command,o.commandArgs,r,t,null,!1)}}return i}resolveKeyboardEvent(e){const t=new Vc(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,e.keyCode);return new lC([t],Lo)}};F_=au([Nn(0,Be),Nn(1,gi),Nn(2,Gs),Nn(3,en),Nn(4,ys),Nn(5,xt)],F_);class Bye extends H{constructor(e,t){super(),this.domNode=e,this._register(t)}}function o7(s){return s&&typeof s=="object"&&(!s.overrideIdentifier||typeof s.overrideIdentifier=="string")&&(!s.resource||s.resource instanceof Ae)}let YD=class{constructor(e){this.logService=e,this._onDidChangeConfiguration=new B,this.onDidChangeConfiguration=this._onDidChangeConfiguration.event;const t=new Tye(e);this._configuration=new zx(t.reload(),Vn.createEmptyModel(e),Vn.createEmptyModel(e),Vn.createEmptyModel(e),Vn.createEmptyModel(e),Vn.createEmptyModel(e),new Wi,Vn.createEmptyModel(e),new Wi,e),t.dispose()}getValue(e,t){const i=typeof e=="string"?e:void 0,n=o7(e)?e:o7(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[o,r]=n;this.getValue(o)!==r&&(this._configuration.updateValue(o,r),i.push(o))}if(i.length>0){const n=new _be({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)}};YD=au([Nn(0,ys)],YD);let rM=class{constructor(e,t,i){this.configurationService=e,this.modelService=t,this.languageService=i,this._onDidChangeConfiguration=new B,this.configurationService.onDidChangeConfiguration(n=>{this._onDidChangeConfiguration.fire({affectedKeys:n.affectedKeys,affectsConfiguration:(o,r)=>n.affectsConfiguration(r)})})}getValue(e,t,i){const n=W.isIPosition(t)?t:null,o=n?typeof i=="string"?i:void 0:typeof t=="string"?t:void 0,r=e?this.getLanguage(e,n):void 0;return typeof o>"u"?this.configurationService.getValue({resource:e,overrideIdentifier:r}):this.configurationService.getValue(o,{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)}};rM=au([Nn(0,rt),Nn(1,_i),Nn(2,vi)],rM);let aM=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:$s||lt?` `:`\r `}};aM=au([Nn(0,rt)],aM);class Wye{publicLog2(){}}class DC{constructor(){const e=Ae.from({scheme:DC.SCHEME,authority:"model",path:"/"});this.workspace={id:dj,folders:[new Pbe({uri:e,name:"",index:0})]}}getWorkspace(){return this.workspace}getWorkspaceFolder(e){return e&&e.scheme===DC.SCHEME?this.workspace.folders[0]:null}}DC.SCHEME="inmemory";function QD(s,e,t){if(!e||!(s instanceof YD))return;const i=[];Object.keys(e).forEach(n=>{hbe(n)&&i.push([`editor.${n}`,e[n]]),t&&gbe(n)&&i.push([`diffEditor.${n}`,e[n]])}),i.length>0&&s.updateValues(i)}let lM=class{constructor(e){this._modelService=e}hasPreviewHandler(){return!1}async apply(e,t){const i=Array.isArray(e)?e:yO.convert(e),n=new Map;for(const a of i){if(!(a instanceof dh))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 d=n.get(l);d||(d=[],n.set(l,d)),d.push(pi.replaceMove(x.lift(a.textEdit.range),a.textEdit.text))}let o=0,r=0;for(const[a,l]of n)a.pushStackElement(),a.pushEditOperations([],l,()=>[]),a.pushStackElement(),r+=1,o+=l.length;return{ariaSummary:l_(C2.bulkEditServiceSummary,o,r),isApplied:o>0}}};lM=au([Nn(0,_i)],lM);class Hye{getUriLabel(e,t){return e.scheme==="file"?e.fsPath:e.path}getUriBasenameLabel(e){return Wr(e)}}let dM=class extends abe{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)}};dM=au([Nn(0,ig),Nn(1,xt)],dM);class Vye{constructor(){this._neverEmitter=new B,this.onDidChangeTrust=this._neverEmitter.event}isWorkspaceTrusted(){return!0}}class zye extends cC{constructor(){super()}}class Uye extends Aye{constructor(){super(new Ile)}}let cM=class extends T2{constructor(e,t,i,n,o,r){super(e,t,i,n,o,r),this.configure({blockMouse:!1})}};cM=au([Nn(0,Gs),Nn(1,en),Nn(2,nu),Nn(3,At),Nn(4,hr),Nn(5,Be)],cM);class $ye{async playSignal(e,t){}}mt(ys,Uye,0);mt(rt,YD,0);mt(DF,rM,0);mt(pU,aM,0);mt(If,DC,0);mt(k_,Hye,0);mt(Gs,Wye,0);mt(dO,Oye,0);mt(cO,Fye,0);mt(en,SC,0);mt(Pd,ku,0);mt(vi,zye,0);mt(Sa,hye,0);mt(_i,PD,0);mt(TF,P2,0);mt(Be,nM,0);mt(lj,Pye,0);mt(sg,uk,0);mt(Rd,jCe,0);mt(jr,CA,0);mt(x1,lM,0);mt(cj,Vye,0);mt(mo,sM,0);mt(gr,Q2,0);mt(Kr,ywe,0);mt(gi,oM,0);mt(At,F_,0);mt(hp,X2,0);mt(nu,dM,0);mt(Bo,R2,0);mt(ru,ZD,0);mt(Oo,cM,0);mt(hr,J2,0);mt(rg,$ye,0);var Fe;(function(s){const e=new L1;for(const[l,d]of P3())e.set(l,d);const t=new XD(e,!0);e.set(Ne,t);function i(l){n||r({});const d=e.get(l);if(!d)throw new Error("Missing service "+l);return d instanceof Ol?t.invokeFunction(c=>c.get(l)):d}s.get=i;let n=!1;const o=new B;function r(l){if(n)return t;n=!0;for(const[c,u]of P3())e.get(c)||e.set(c,u);for(const c in l)if(l.hasOwnProperty(c)){const u=ut(c);e.get(u)instanceof Ol&&e.set(u,l[c])}const d=Mye();for(const c of d)try{t.createInstance(c)}catch(u){Xe(u)}return o.fire(),t}s.initialize=r;function a(l){if(n)return l();const d=new Y,c=d.add(o.event(()=>{c.dispose(),d.add(l())}));return d}s.withServices=a})(Fe||(Fe={}));class cl{static capture(e){if(e.getScrollTop()===0||e.hasPendingScrollAnimation())return new cl(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 o=e.getTopForPosition(t.lineNumber,t.column);i=e.getScrollTop()-o}return new cl(e.getScrollTop(),e.getContentHeight(),t,i,e.getPosition())}constructor(e,t,i,n,o){this._initialScrollTop=e,this._initialContentHeight=t,this._visiblePosition=i,this._visiblePositionScrollDelta=n,this._cursorPosition=o}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)}}function ZO(){return QT&&!!QT.VSCODE_DEV}function _K(s){if(ZO()){const e=jye();return e.add(s),{dispose(){e.delete(s)}}}else return{dispose(){}}}function jye(){ty||(ty=new Set);const s=globalThis;return s.$hotReload_applyNewExports||(s.$hotReload_applyNewExports=e=>{const t={config:{mode:void 0},...e};for(const i of ty){const n=i(t);if(n)return n}}),ty}let ty;ZO()&&_K(({oldExports:s,newSrc:e,config:t})=>{if(t.mode==="patch-prototype")return i=>{var n,o;for(const r in i){const a=i[r];if(console.log(`[hot-reload] Patching prototype methods of '${r}'`,{exportedItem:a}),typeof a=="function"&&a.prototype){const l=s[r];if(l){for(const d of Object.getOwnPropertyNames(a.prototype)){const c=Object.getOwnPropertyDescriptor(a.prototype,d),u=Object.getOwnPropertyDescriptor(l.prototype,d);((n=c==null?void 0:c.value)===null||n===void 0?void 0:n.toString())!==((o=u==null?void 0:u.value)===null||o===void 0?void 0:o.toString())&&console.log(`[hot-reload] Patching prototype method '${r}.${d}'`),Object.defineProperty(l.prototype,d,c)}i[r]=l}}}return!0}});function Kye(s,e,t,i){if(s.length===0)return e;if(e.length===0)return s;const n=[];let o=0,r=0;for(;oc?(n.push(l),r++):(n.push(i(a,l)),o++,r++)}for(;o`Apply decorations from ${e.debugName}`},n=>{const o=e.read(n);i.set(o)})),t.add({dispose:()=>{i.clear()}}),t}function Ev(s,e){return s.appendChild(e),Ie(()=>{s.removeChild(e)})}function qye(s,e){return s.prepend(e),Ie(()=>{s.removeChild(e)})}class vK extends H{get width(){return this._width}get height(){return this._height}constructor(e,t){super(),this.elementSizeObserver=this._register(new SU(e,t)),this._width=vt(this,this.elementSizeObserver.getWidth()),this._height=vt(this,this.elementSizeObserver.getHeight()),this._register(this.elementSizeObserver.onDidChange(i=>$t(n=>{this._width.set(this.elementSizeObserver.getWidth(),n),this._height.set(this.elementSizeObserver.getHeight(),n)})))}observe(e){this.elementSizeObserver.observe(e)}setAutomaticLayout(e){e?this.elementSizeObserver.startObserving():this.elementSizeObserver.stopObserving()}}function r7(s,e,t){let i=e.get(),n=i,o=i;const r=vt("animatedValue",i);let a=-1;const l=300;let d;t.add(I1({createEmptyChangeSummary:()=>({animate:!1}),handleChange:(u,h)=>(u.didChange(e)&&(h.animate=h.animate||u.change),!0)},(u,h)=>{d!==void 0&&(s.cancelAnimationFrame(d),d=void 0),n=o,i=e.read(u),a=Date.now()-(h.animate?0:l),c()}));function c(){const u=Date.now()-a;o=Math.floor(Gye(u,n,i-n,l)),u{this._actualTop.set(i,void 0)},this.onComputedHeight=i=>{this._actualHeight.set(i,void 0)}}}class hk{constructor(e,t){this._editor=e,this._domElement=t,this._overlayWidgetId=`managedOverlayWidget-${hk._counter++}`,this._overlayWidget={getId:()=>this._overlayWidgetId,getDomNode:()=>this._domElement,getPosition:()=>null},this._editor.addOverlayWidget(this._overlayWidget)}dispose(){this._editor.removeOverlayWidget(this._overlayWidget)}}hk._counter=0;function Oh(s,e){return st(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,o=>"-"+o.toLowerCase()),s.style[i]=n})}function ta(s,e){return Zye([s],e),s}function Zye(s,e){ZO()&&os("reload",i=>_K(({oldExports:n})=>{if([...Object.values(n)].some(o=>s.includes(o)))return o=>(i(void 0),!0)})).read(e)}function tL(s,e,t,i){const n=new Y,o=[];return n.add(Hr((r,a)=>{const l=e.read(r),d=new Map,c=new Map;t&&t(!0),s.changeViewZones(u=>{for(const h of o)u.removeZone(h),i==null||i.delete(h);o.length=0;for(const h of l){const g=u.addZone(h);h.setZoneId&&h.setZoneId(g),o.push(g),i==null||i.add(g),d.set(h,g)}}),t&&t(!1),a.add(I1({createEmptyChangeSummary(){return{zoneIds:[]}},handleChange(u,h){const g=c.get(u.changedObservable);return g!==void 0&&h.zoneIds.push(g),!0}},(u,h)=>{for(const g of l)g.onChange&&(c.set(g.onChange,d.get(g)),g.onChange.read(u));t&&t(!0),s.changeViewZones(g=>{for(const f of h.zoneIds)g.layoutZone(f)}),t&&t(!1)}))})),n.add({dispose(){t&&t(!0),s.changeViewZones(r=>{for(const a of o)r.removeZone(a)}),i==null||i.clear(),t&&t(!1)}}),n}class Xye extends Vi{dispose(){super.dispose(!0)}}function a7(s,e){const t=YS(e,n=>n.original.startLineNumber<=s.lineNumber);if(!t)return x.fromPositions(s);if(t.original.endLineNumberExclusive<=s.lineNumber){const n=s.lineNumber-t.original.endLineNumberExclusive+t.modified.endLineNumberExclusive;return x.fromPositions(new W(n,s.column))}if(!t.innerChanges)return x.fromPositions(new W(t.modified.startLineNumber,1));const i=YS(t.innerChanges,n=>n.originalRange.getStartPosition().isBeforeOrEqual(s));if(!i){const n=s.lineNumber-t.original.startLineNumber+t.modified.startLineNumber;return x.fromPositions(new W(n,s.column))}if(i.originalRange.containsPosition(s))return i.modifiedRange;{const n=Yye(i.originalRange.getEndPosition(),s);return x.fromPositions(n.addToPosition(i.modifiedRange.getEndPosition()))}}function Yye(s,e){return s.lineNumber===e.lineNumber?new Fs(0,e.column-s.column):new Fs(e.lineNumber-s.lineNumber,e.column-1)}function zd(s,e,t){const i=s.bindTo(e);return qx({debugName:()=>`Set Context Key "${s.key}"`},n=>{i.set(t(n))})}function Qye(s,e){let t;return s.filter(i=>{const n=e(i,t);return t=i,n})}var XO=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},YO=function(s,e){return function(t,i){e(t,i,s)}};const Jye=xi("diff-review-insert",oe.add,p("accessibleDiffViewerInsertIcon","Icon for 'Insert' in accessible diff viewer.")),eSe=xi("diff-review-remove",oe.remove,p("accessibleDiffViewerRemoveIcon","Icon for 'Remove' in accessible diff viewer.")),tSe=xi("diff-review-close",oe.close,p("accessibleDiffViewerCloseIcon","Icon for 'Close' in accessible diff viewer."));let Zu=class extends H{constructor(e,t,i,n,o,r,a,l,d){super(),this._parentNode=e,this._visible=t,this._setVisible=i,this._canClose=n,this._width=o,this._height=r,this._diffs=a,this._models=l,this._instantiationService=d,this._state=g0(this,(c,u)=>{const h=this._visible.read(c);if(this._parentNode.style.visibility=h?"visible":"hidden",!h)return null;const g=u.add(this._instantiationService.createInstance(uM,this._diffs,this._models,this._setVisible,this._canClose)),f=u.add(this._instantiationService.createInstance(hM,this._parentNode,g,this._width,this._height,this._models));return{model:g,view:f}}).recomputeInitiallyAndOnChange(this._store)}next(){$t(e=>{const t=this._visible.get();this._setVisible(!0,e),t&&this._state.get().model.nextGroup(e)})}prev(){$t(e=>{this._setVisible(!0,e),this._state.get().model.previousGroup(e)})}close(){$t(e=>{this._setVisible(!1,e)})}};Zu._ttPolicy=tu("diffReview",{createHTML:s=>s});Zu=XO([YO(8,Ne)],Zu);let uM=class extends H{constructor(e,t,i,n,o){super(),this._diffs=e,this._models=t,this._setVisible=i,this.canClose=n,this._accessibilitySignalService=o,this._groups=vt(this,[]),this._currentGroupIdx=vt(this,0),this._currentElementIdx=vt(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)=>{var l;return(l=this.currentGroup.read(a))===null||l===void 0?void 0:l.lines[r]}),this._register(st(r=>{const a=this._diffs.read(r);if(!a){this._groups.set([],void 0);return}const l=iSe(a,this._models.getOriginalModel().getLineCount(),this._models.getModifiedModel().getLineCount());$t(d=>{const c=this._models.getModifiedPosition();if(c){const u=l.findIndex(h=>(c==null?void 0:c.lineNumber){const a=this.currentElement.read(r);(a==null?void 0:a.type)===Is.Deleted?this._accessibilitySignalService.playSignal(Ke.diffLineDeleted,{source:"accessibleDiffViewer.currentElementChanged"}):(a==null?void 0:a.type)===Is.Added&&this._accessibilitySignalService.playSignal(Ke.diffLineInserted,{source:"accessibleDiffViewer.currentElementChanged"})})),this._register(st(r=>{var a;const l=this.currentElement.read(r);if(l&&l.type!==Is.Header){const d=(a=l.modifiedLineNumber)!==null&&a!==void 0?a:l.diff.modified.startLineNumber;this._models.modifiedSetSelection(x.fromPositions(new W(d,1)))}}))}_goToGroupDelta(e,t){const i=this.groups.get();!i||i.length<=1||hC(t,n=>{this._currentGroupIdx.set(et.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||$t(i=>{this._currentElementIdx.set(et.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&&$t(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===Is.Deleted?this._models.originalReveal(x.fromPositions(new W(e.originalLineNumber,1))):this._models.modifiedReveal(e.type!==Is.Header?x.fromPositions(new W(e.modifiedLineNumber,1)):void 0))}close(){this.canClose.get()&&(this._setVisible(!1,void 0),this._models.modifiedFocus())}};uM=XO([YO(4,rg)],uM);const Q0=3;function iSe(s,e,t){const i=[];for(const n of PP(s,(o,r)=>r.modified.startLineNumber-o.modified.endLineNumberExclusive<2*Q0)){const o=[];o.push(new sSe);const r=new Je(Math.max(1,n[0].original.startLineNumber-Q0),Math.min(n[n.length-1].original.endLineNumberExclusive+Q0,e+1)),a=new Je(Math.max(1,n[0].modified.startLineNumber-Q0),Math.min(n[n.length-1].modified.endLineNumberExclusive+Q0,t+1));DV(n,(c,u)=>{const h=new Je(c?c.original.endLineNumberExclusive:r.startLineNumber,u?u.original.startLineNumber:r.endLineNumberExclusive),g=new Je(c?c.modified.endLineNumberExclusive:a.startLineNumber,u?u.modified.startLineNumber:a.endLineNumberExclusive);h.forEach(f=>{o.push(new aSe(f,g.startLineNumber+(f-h.startLineNumber)))}),u&&(u.original.forEach(f=>{o.push(new oSe(u,f))}),u.modified.forEach(f=>{o.push(new rSe(u,f))}))});const l=n[0].modified.join(n[n.length-1].modified),d=n[0].original.join(n[n.length-1].original);i.push(new nSe(new Ns(l,d),o))}return i}var Is;(function(s){s[s.Header=0]="Header",s[s.Unchanged=1]="Unchanged",s[s.Deleted=2]="Deleted",s[s.Added=3]="Added"})(Is||(Is={}));class nSe{constructor(e,t){this.range=e,this.lines=t}}class sSe{constructor(){this.type=Is.Header}}class oSe{constructor(e,t){this.diff=e,this.originalLineNumber=t,this.type=Is.Deleted,this.modifiedLineNumber=void 0}}class rSe{constructor(e,t){this.diff=e,this.modifiedLineNumber=t,this.type=Is.Added,this.originalLineNumber=void 0}}class aSe{constructor(e,t){this.originalLineNumber=e,this.modifiedLineNumber=t,this.type=Is.Unchanged}}let hM=class extends H{constructor(e,t,i,n,o,r){super(),this._element=e,this._model=t,this._width=i,this._height=n,this._models=o,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 Vr(a)),this._register(st(l=>{this._actionBar.clear(),this._model.canClose.read(l)&&this._actionBar.push(new Eo("diffreview.close",p("label.close","Close"),"close-diff-review "+Pe.asClassName(tSe),!0,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 C1(this._content,{})),Yn(this.domNode,this._scrollbar.getDomNode(),a),this._register(st(l=>{this._height.read(l),this._width.read(l),this._scrollbar.scanDomNode()})),this._register(Ie(()=>{Yn(this.domNode)})),this._register(Oh(this.domNode,{width:this._width,height:this._height})),this._register(Oh(this._content,{width:this._width,height:this._height})),this._register(Hr((l,d)=>{this._model.currentGroup.read(l),this._render(d)})),this._register(Ni(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",p("ariaLabel","Accessible Diff Viewer. Use arrow up and down to navigate.")),Un(n,i.get(50)),Yn(this._content,n);const o=this._models.getOriginalModel(),r=this._models.getModifiedModel();if(!o||!r)return;const a=o.getOptions(),l=r.getOptions(),d=i.get(67),c=this._model.currentGroup.get();for(const u of(c==null?void 0:c.lines)||[]){if(!c)break;let h;if(u.type===Is.Header){const f=document.createElement("div");f.className="diff-review-row",f.setAttribute("role","listitem");const m=c.range,_=this._model.currentGroupIndex.get(),v=this._model.groups.get().length,b=D=>D===0?p("no_lines_changed","no lines changed"):D===1?p("one_line_changed","1 line changed"):p("more_lines_changed","{0} lines changed",D),C=b(m.original.length),w=b(m.modified.length);f.setAttribute("aria-label",p({},"Difference {0} of {1}: original line {2}, {3}, modified line {4}, {5}",_+1,v,m.original.startLineNumber,C,m.modified.startLineNumber,w));const y=document.createElement("div");y.className="diff-review-cell diff-review-summary",y.appendChild(document.createTextNode(`${_+1}/${v}: @@ -${m.original.startLineNumber},${m.original.length} +${m.modified.startLineNumber},${m.modified.length} @@`)),f.appendChild(y),h=f}else h=this._createRow(u,d,this._width.get(),t,o,a,i,r,l);n.appendChild(h);const g=je(f=>this._model.currentElement.read(f)===u);e.add(st(f=>{const m=g.read(f);h.tabIndex=m?0:-1,m&&h.focus()})),e.add(K(h,"focus",()=>{this._model.goToLine(u)}))}this._scrollbar.scanDomNode()}_createRow(e,t,i,n,o,r,a,l,d){const c=n.get(145),u=c.glyphMarginWidth+c.lineNumbersWidth,h=a.get(145),g=10+h.glyphMarginWidth+h.lineNumbersWidth;let f="diff-review-row",m="";const _="diff-review-spacer";let v=null;switch(e.type){case Is.Added:f="diff-review-row line-insert",m=" char-insert",v=Jye;break;case Is.Deleted:f="diff-review-row line-delete",m=" char-delete",v=eSe;break}const b=document.createElement("div");b.style.minWidth=i+"px",b.className=f,b.setAttribute("role","listitem"),b.ariaLevel="";const C=document.createElement("div");C.className="diff-review-cell",C.style.height=`${t}px`,b.appendChild(C);const w=document.createElement("span");w.style.width=u+"px",w.style.minWidth=u+"px",w.className="diff-review-line-number"+m,e.originalLineNumber!==void 0?w.appendChild(document.createTextNode(String(e.originalLineNumber))):w.innerText=" ",C.appendChild(w);const y=document.createElement("span");y.style.width=g+"px",y.style.minWidth=g+"px",y.style.paddingRight="10px",y.className="diff-review-line-number"+m,e.modifiedLineNumber!==void 0?y.appendChild(document.createTextNode(String(e.modifiedLineNumber))):y.innerText=" ",C.appendChild(y);const D=document.createElement("span");if(D.className=_,v){const I=document.createElement("span");I.className=Pe.asClassName(v),I.innerText="  ",D.appendChild(I)}else D.innerText="  ";C.appendChild(D);let L;if(e.modifiedLineNumber!==void 0){let I=this._getLineHtml(l,a,d.tabSize,e.modifiedLineNumber,this._languageService.languageIdCodec);Zu._ttPolicy&&(I=Zu._ttPolicy.createHTML(I)),C.insertAdjacentHTML("beforeend",I),L=l.getLineContent(e.modifiedLineNumber)}else{let I=this._getLineHtml(o,n,r.tabSize,e.originalLineNumber,this._languageService.languageIdCodec);Zu._ttPolicy&&(I=Zu._ttPolicy.createHTML(I)),C.insertAdjacentHTML("beforeend",I),L=o.getLineContent(e.originalLineNumber)}L.length===0&&(L=p("blankLine","blank"));let k="";switch(e.type){case Is.Unchanged:e.originalLineNumber===e.modifiedLineNumber?k=p({},"{0} unchanged line {1}",L,e.originalLineNumber):k=p("equalLine","{0} original line {1} modified line {2}",L,e.originalLineNumber,e.modifiedLineNumber);break;case Is.Added:k=p("insertLine","+ {0} modified line {1}",L,e.modifiedLineNumber);break;case Is.Deleted:k=p("deleteLine","- {0} original line {1}",L,e.originalLineNumber);break}return b.setAttribute("aria-label",k),b}_getLineHtml(e,t,i,n,o){const r=e.getLineContent(n),a=t.get(50),l=wn.createEmpty(r,o),d=lr.isBasicASCII(r,e.mightContainNonBasicASCII()),c=lr.containsRTL(r,d,e.mightContainRTL());return bx(new tg(a.isMonospace&&!t.get(33),a.canUseHalfwidthRightwardsArrow,r,!1,d,c,0,l,[],i,0,a.spaceWidth,a.middotWidth,a.wsmiddotWidth,t.get(117),t.get(99),t.get(94),t.get(51)!==Zo.OFF,null)).html}};hM=XO([YO(5,vi)],hM);class lSe{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(){var e;return(e=this.editors.modified.getPosition())!==null&&e!==void 0?e:void 0}}class hh extends H{constructor(e,t,i,n,o){super(),this._rootElement=e,this._diffModel=t,this._originalEditorLayoutInfo=i,this._modifiedEditorLayoutInfo=n,this._editors=o,this._originalScrollTop=Ot(this._editors.original.onDidScrollChange,()=>this._editors.original.getScrollTop()),this._modifiedScrollTop=Ot(this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollTop()),this._viewZonesChanged=os("onDidChangeViewZones",this._editors.modified.onDidChangeViewZones),this.width=vt(this,0),this._modifiedViewZonesChangedSignal=os("modified.onDidChangeViewZones",this._editors.modified.onDidChangeViewZones),this._originalViewZonesChangedSignal=os("original.onDidChangeViewZones",this._editors.original.onDidChangeViewZones),this._state=g0(this,(c,u)=>{var h;this._element.replaceChildren();const g=this._diffModel.read(c),f=(h=g==null?void 0:g.diff.read(c))===null||h===void 0?void 0:h.movedTexts;if(!f||f.length===0){this.width.set(0,void 0);return}this._viewZonesChanged.read(c);const m=this._originalEditorLayoutInfo.read(c),_=this._modifiedEditorLayoutInfo.read(c);if(!m||!_){this.width.set(0,void 0);return}this._modifiedViewZonesChangedSignal.read(c),this._originalViewZonesChangedSignal.read(c);const v=f.map(k=>{function I(De,ge){const We=ge.getTopForLineNumber(De.startLineNumber,!0),ye=ge.getTopForLineNumber(De.endLineNumberExclusive,!0);return(We+ye)/2}const O=I(k.lineRangeMapping.original,this._editors.original),R=this._originalScrollTop.read(c),P=I(k.lineRangeMapping.modified,this._editors.modified),F=this._modifiedScrollTop.read(c),V=O-R,U=P-F,J=Math.min(O,P),pe=Math.max(O,P);return{range:new et(J,pe),from:V,to:U,fromWithoutScroll:O,toWithoutScroll:P,move:k}});v.sort(xse(ao(k=>k.fromWithoutScroll>k.toWithoutScroll,kse),ao(k=>k.fromWithoutScroll>k.toWithoutScroll?k.fromWithoutScroll:-k.toWithoutScroll,ua)));const b=QO.compute(v.map(k=>k.range)),C=10,w=m.verticalScrollbarWidth,y=(b.getTrackCount()-1)*10+C*2,D=w+y+(_.contentLeft-hh.movedCodeBlockPadding);let L=0;for(const k of v){const I=b.getTrack(L),O=w+C+I*10,R=15,P=15,F=D,V=_.glyphMarginWidth+_.lineNumbersWidth,U=18,J=document.createElementNS("http://www.w3.org/2000/svg","rect");J.classList.add("arrow-rectangle"),J.setAttribute("x",`${F-V}`),J.setAttribute("y",`${k.to-U/2}`),J.setAttribute("width",`${V}`),J.setAttribute("height",`${U}`),this._element.appendChild(J);const pe=document.createElementNS("http://www.w3.org/2000/svg","g"),De=document.createElementNS("http://www.w3.org/2000/svg","path");De.setAttribute("d",`M 0 ${k.from} L ${O} ${k.from} L ${O} ${k.to} L ${F-P} ${k.to}`),De.setAttribute("fill","none"),pe.appendChild(De);const ge=document.createElementNS("http://www.w3.org/2000/svg","polygon");ge.classList.add("arrow"),u.add(st(We=>{De.classList.toggle("currentMove",k.move===g.activeMovedText.read(We)),ge.classList.toggle("currentMove",k.move===g.activeMovedText.read(We))})),ge.setAttribute("points",`${F-P},${k.to-R/2} ${F},${k.to} ${F-P},${k.to+R/2}`),pe.appendChild(ge),this._element.appendChild(pe),L++}this.width.set(y,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(Ie(()=>this._element.remove())),this._register(st(c=>{const u=this._originalEditorLayoutInfo.read(c),h=this._modifiedEditorLayoutInfo.read(c);!u||!h||(this._element.style.left=`${u.width-u.verticalScrollbarWidth}px`,this._element.style.height=`${u.height}px`,this._element.style.width=`${u.verticalScrollbarWidth+u.contentLeft-hh.movedCodeBlockPadding+this.width.read(c)}px`)})),this._register(T1(this._state));const r=je(c=>{const u=this._diffModel.read(c),h=u==null?void 0:u.diff.read(c);return h?h.movedTexts.map(g=>({move:g,original:new eL(Ga(g.lineRangeMapping.original.startLineNumber-1),18),modified:new eL(Ga(g.lineRangeMapping.modified.startLineNumber-1),18)})):[]});this._register(tL(this._editors.original,r.map(c=>c.map(u=>u.original)))),this._register(tL(this._editors.modified,r.map(c=>c.map(u=>u.modified)))),this._register(Hr((c,u)=>{const h=r.read(c);for(const g of h)u.add(new l7(this._editors.original,g.original,g.move,"original",this._diffModel.get())),u.add(new l7(this._editors.modified,g.modified,g.move,"modified",this._diffModel.get()))}));const a=os("original.onDidFocusEditorWidget",c=>this._editors.original.onDidFocusEditorWidget(()=>setTimeout(()=>c(void 0),0))),l=os("modified.onDidFocusEditorWidget",c=>this._editors.modified.onDidFocusEditorWidget(()=>setTimeout(()=>c(void 0),0)));let d="modified";this._register(I1({createEmptyChangeSummary:()=>{},handleChange:(c,u)=>(c.didChange(a)&&(d="original"),c.didChange(l)&&(d="modified"),!0)},c=>{a.read(c),l.read(c);const u=this._diffModel.read(c);if(!u)return;const h=u.diff.read(c);let g;if(h&&d==="original"){const f=this._editors.originalCursor.read(c);f&&(g=h.movedTexts.find(m=>m.lineRangeMapping.original.contains(f.lineNumber)))}if(h&&d==="modified"){const f=this._editors.modifiedCursor.read(c);f&&(g=h.movedTexts.find(m=>m.lineRangeMapping.modified.contains(f.lineNumber)))}g!==u.movedTextToCompare.get()&&u.movedTextToCompare.set(void 0,void 0),u.setActiveMovedText(g)}))}}hh.movedCodeBlockPadding=4;class QO{static compute(e){const t=[],i=[];for(const n of e){let o=t.findIndex(r=>!r.intersectsStrict(n));o===-1&&(t.length>=6?o=tce(t,ao(a=>a.intersectWithRangeLength(n),ua)):(o=t.length,t.push(new CF))),t[o].addRange(n),i.push(o)}return new QO(t.length,i)}constructor(e,t){this._trackCount=e,this.trackPerLineIdx=t}getTrack(e){return this.trackPerLineIdx[e]}getTrackCount(){return this._trackCount}}class l7 extends bK{constructor(e,t,i,n,o){const r=Nt("div.diff-hidden-lines-widget");super(e,t,r.root),this._editor=e,this._move=i,this._kind=n,this._diffModel=o,this._nodes=Nt("div.diff-moved-code-block",{style:{marginRight:"4px"}},[Nt("div.text-content@textContent"),Nt("div.action-bar@actionBar")]),r.root.appendChild(this._nodes.root);const a=Ot(this._editor.onDidLayoutChange,()=>this._editor.getLayoutInfo());this._register(Oh(this._nodes.root,{paddingRight:a.map(h=>h.verticalScrollbarWidth)}));let l;i.changes.length>0?l=this._kind==="original"?p("codeMovedToWithChanges","Code moved with changes to line {0}-{1}",this._move.lineRangeMapping.modified.startLineNumber,this._move.lineRangeMapping.modified.endLineNumberExclusive-1):p("codeMovedFromWithChanges","Code moved with changes from line {0}-{1}",this._move.lineRangeMapping.original.startLineNumber,this._move.lineRangeMapping.original.endLineNumberExclusive-1):l=this._kind==="original"?p("codeMovedTo","Code moved to line {0}-{1}",this._move.lineRangeMapping.modified.startLineNumber,this._move.lineRangeMapping.modified.endLineNumberExclusive-1):p("codeMovedFrom","Code moved from line {0}-{1}",this._move.lineRangeMapping.original.startLineNumber,this._move.lineRangeMapping.original.endLineNumberExclusive-1);const d=this._register(new Vr(this._nodes.actionBar,{highlightToggledItems:!0})),c=new Eo("",l,"",!1);d.push(c,{icon:!1,label:!0});const u=new Eo("","Compare",Pe.asClassName(oe.compareChanges),!0,()=>{this._editor.focus(),this._diffModel.movedTextToCompare.set(this._diffModel.movedTextToCompare.get()===i?void 0:this._move,void 0)});this._register(st(h=>{const g=this._diffModel.movedTextToCompare.read(h)===i;u.checked=g})),d.push(u,{icon:!1,label:!0})}}N("diffEditor.move.border",{dark:"#8b8b8b9c",light:"#8b8b8b9c",hcDark:"#8b8b8b9c",hcLight:"#8b8b8b9c"},p("diffEditor.move.border","The border color for text that got moved in the diff editor."));N("diffEditor.moveActive.border",{dark:"#FFA500",light:"#FFA500",hcDark:"#FFA500",hcLight:"#FFA500"},p("diffEditor.moveActive.border","The active border color for text that got moved in the diff editor."));N("diffEditor.unchangedRegionShadow",{dark:"#000000",light:"#737373BF",hcDark:"#000000",hcLight:"#737373BF"},p("diffEditor.unchangedRegionShadow","The color of the shadow around unchanged region widgets."));const dSe=xi("diff-insert",oe.add,p("diffInsertIcon","Line decoration for inserts in the diff editor.")),CK=xi("diff-remove",oe.remove,p("diffRemoveIcon","Line decoration for removals in the diff editor.")),d7=Ye.register({className:"line-insert",description:"line-insert",isWholeLine:!0,linesDecorationsClassName:"insert-sign "+Pe.asClassName(dSe),marginClassName:"gutter-insert"}),c7=Ye.register({className:"line-delete",description:"line-delete",isWholeLine:!0,linesDecorationsClassName:"delete-sign "+Pe.asClassName(CK),marginClassName:"gutter-delete"}),u7=Ye.register({className:"line-insert",description:"line-insert",isWholeLine:!0,marginClassName:"gutter-insert"}),h7=Ye.register({className:"line-delete",description:"line-delete",isWholeLine:!0,marginClassName:"gutter-delete"}),g7=Ye.register({className:"char-insert",description:"char-insert",shouldFillLineOnLineBreak:!0}),cSe=Ye.register({className:"char-insert",description:"char-insert",isWholeLine:!0}),uSe=Ye.register({className:"char-insert diff-range-empty",description:"char-insert diff-range-empty"}),gM=Ye.register({className:"char-delete",description:"char-delete",shouldFillLineOnLineBreak:!0}),hSe=Ye.register({className:"char-delete",description:"char-delete",isWholeLine:!0}),gSe=Ye.register({className:"char-delete diff-range-empty",description:"char-delete diff-range-empty"});class fSe extends H{constructor(e,t,i,n){super(),this._editors=e,this._diffModel=t,this._options=i,this._decorations=je(this,o=>{var r;const a=(r=this._diffModel.read(o))===null||r===void 0?void 0:r.diff.read(o);if(!a)return null;const l=this._diffModel.read(o).movedTextToCompare.read(o),d=this._options.renderIndicators.read(o),c=this._options.showEmptyDecorations.read(o),u=[],h=[];if(!l)for(const f of a.mappings)if(f.lineRangeMapping.original.isEmpty||u.push({range:f.lineRangeMapping.original.toInclusiveRange(),options:d?c7:h7}),f.lineRangeMapping.modified.isEmpty||h.push({range:f.lineRangeMapping.modified.toInclusiveRange(),options:d?d7:u7}),f.lineRangeMapping.modified.isEmpty||f.lineRangeMapping.original.isEmpty)f.lineRangeMapping.original.isEmpty||u.push({range:f.lineRangeMapping.original.toInclusiveRange(),options:hSe}),f.lineRangeMapping.modified.isEmpty||h.push({range:f.lineRangeMapping.modified.toInclusiveRange(),options:cSe});else for(const m of f.lineRangeMapping.innerChanges||[])f.lineRangeMapping.original.contains(m.originalRange.startLineNumber)&&u.push({range:m.originalRange,options:m.originalRange.isEmpty()&&c?gSe:gM}),f.lineRangeMapping.modified.contains(m.modifiedRange.startLineNumber)&&h.push({range:m.modifiedRange,options:m.modifiedRange.isEmpty()&&c?uSe:g7});if(l)for(const f of l.changes){const m=f.original.toInclusiveRange();m&&u.push({range:m,options:d?c7:h7});const _=f.modified.toInclusiveRange();_&&h.push({range:_,options:d?d7:u7});for(const v of f.innerChanges||[])u.push({range:v.originalRange,options:gM}),h.push({range:v.modifiedRange,options:g7})}const g=this._diffModel.read(o).activeMovedText.read(o);for(const f of a.movedTexts)u.push({range:f.lineRangeMapping.original.toInclusiveRange(),options:{description:"moved",blockClassName:"movedOriginal"+(f===g?" currentMove":""),blockPadding:[hh.movedCodeBlockPadding,0,hh.movedCodeBlockPadding,hh.movedCodeBlockPadding]}}),h.push({range:f.lineRangeMapping.modified.toInclusiveRange(),options:{description:"moved",blockClassName:"movedModified"+(f===g?" currentMove":""),blockPadding:[4,0,4,4]}});return{originalDecorations:u,modifiedDecorations:h}}),this._register(JD(this._editors.original,this._decorations.map(o=>(o==null?void 0:o.originalDecorations)||[]))),this._register(JD(this._editors.modified,this._decorations.map(o=>(o==null?void 0:o.modifiedDecorations)||[])))}}class pSe extends H{constructor(e,t,i,n){super(),this._options=e,this._domNode=t,this._dimensions=i,this._sashes=n,this._sashRatio=vt(this,void 0),this.sashLeft=je(this,o=>{var r;const a=(r=this._sashRatio.read(o))!==null&&r!==void 0?r:this._options.splitViewDefaultRatio.read(o);return this._computeSashLeft(a,o)}),this._sash=this._register(new is(this._domNode,{getVerticalSashTop:o=>0,getVerticalSashLeft:o=>this.sashLeft.get(),getVerticalSashHeight:o=>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(o=>{const r=this._dimensions.width.get(),a=this._computeSashLeft((this._startSashPosition+(o.currentX-o.startX))/r,void 0);this._sashRatio.set(a/r,void 0)})),this._register(this._sash.onDidEnd(()=>this._sash.layout())),this._register(this._sash.onDidReset(()=>this._sashRatio.set(void 0,void 0))),this._register(st(o=>{const r=this._sashes.read(o);r&&(this._sash.orthogonalEndSash=r.bottom)})),this._register(st(o=>{const r=this._options.enableSplitViewResizing.read(o);this._sash.state=r?3:0,this.sashLeft.read(o),this._dimensions.height.read(o),this._sash.layout()}))}_computeSashLeft(e,t){const i=this._dimensions.width.read(t),n=Math.floor(this._options.splitViewDefaultRatio.read(t)*i),o=this._options.enableSplitViewResizing.read(t)?Math.floor(e*i):n,r=100;return i<=r*2?n:oi-r?i-r:o}}var wK=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},fM=function(s,e){return function(t,i){e(t,i,s)}},Ag;const yK=ut("diffProviderFactoryService");let pM=class{constructor(e){this.instantiationService=e}createDiffProvider(e){return this.instantiationService.createInstance(iL,e)}};pM=wK([fM(0,Ne)],pM);mt(yK,pM,1);let iL=Ag=class{constructor(e,t,i){this.editorWorkerService=t,this.telemetryService=i,this.onDidChangeEventEmitter=new B,this.onDidChange=this.onDidChangeEventEmitter.event,this.diffAlgorithm="advanced",this.diffAlgorithmOnDidChangeSubscription=void 0,this.setOptions(e)}dispose(){var e;(e=this.diffAlgorithmOnDidChangeSubscription)===null||e===void 0||e.dispose()}async computeDiff(e,t,i,n){var o,r;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 nr(new Je(1,2),new Je(1,t.getLineCount()+1),[new Qa(e.getFullModelRange(),t.getFullModelRange())])],identical:!1,quitEarly:!1,moves:[]};const a=JSON.stringify([e.uri.toString(),t.uri.toString()]),l=JSON.stringify([e.id,t.id,e.getAlternativeVersionId(),t.getAlternativeVersionId(),JSON.stringify(i)]),d=Ag.diffCache.get(a);if(d&&d.context===l)return d.result;const c=Jn.create(),u=await this.editorWorkerService.computeDiff(e.uri,t.uri,i,this.diffAlgorithm),h=c.elapsed();if(this.telemetryService.publicLog2("diffEditor.computeDiff",{timeMs:h,timedOut:(o=u==null?void 0:u.quitEarly)!==null&&o!==void 0?o:!0,detectedMoves:i.computeMoves?(r=u==null?void 0:u.moves.length)!==null&&r!==void 0?r:0:-1}),n.isCancellationRequested)return{changes:[],identical:!1,quitEarly:!0,moves:[]};if(!u)throw new Error("no diff result available");return Ag.diffCache.size>10&&Ag.diffCache.delete(Ag.diffCache.keys().next().value),Ag.diffCache.set(a,{result:u,context:l}),u}setOptions(e){var t;let i=!1;e.diffAlgorithm&&this.diffAlgorithm!==e.diffAlgorithm&&((t=this.diffAlgorithmOnDidChangeSubscription)===null||t===void 0||t.dispose(),this.diffAlgorithmOnDidChangeSubscription=void 0,this.diffAlgorithm=e.diffAlgorithm,typeof e.diffAlgorithm!="string"&&(this.diffAlgorithmOnDidChangeSubscription=e.diffAlgorithm.onDidChange(()=>this.onDidChangeEventEmitter.fire())),i=!0),i&&this.onDidChangeEventEmitter.fire()}};iL.diffCache=new Map;iL=Ag=wK([fM(1,jr),fM(2,Gs)],iL);var mSe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},_Se=function(s,e){return function(t,i){e(t,i,s)}};let mM=class extends H{setActiveMovedText(e){this._activeMovedText.set(e,void 0)}constructor(e,t,i){super(),this.model=e,this._options=t,this._diffProviderFactoryService=i,this._isDiffUpToDate=vt(this,!1),this.isDiffUpToDate=this._isDiffUpToDate,this._diff=vt(this,void 0),this.diff=this._diff,this._unchangedRegions=vt(this,void 0),this.unchangedRegions=je(this,a=>{var l,d;return this._options.hideUnchangedRegions.read(a)?(d=(l=this._unchangedRegions.read(a))===null||l===void 0?void 0:l.regions)!==null&&d!==void 0?d:[]:($t(c=>{var u;for(const h of((u=this._unchangedRegions.get())===null||u===void 0?void 0:u.regions)||[])h.collapseAll(c)}),[])}),this.movedTextToCompare=vt(this,void 0),this._activeMovedText=vt(this,void 0),this._hoveredMovedText=vt(this,void 0),this.activeMovedText=je(this,a=>{var l,d;return(d=(l=this.movedTextToCompare.read(a))!==null&&l!==void 0?l:this._hoveredMovedText.read(a))!==null&&d!==void 0?d:this._activeMovedText.read(a)}),this._cancellationTokenSource=new Vi,this._diffProvider=je(this,a=>{const l=this._diffProviderFactoryService.createDiffProvider({diffAlgorithm:this._options.diffAlgorithm.read(a)}),d=os("onDidChange",l.onDidChange);return{diffProvider:l,onChangeSignal:d}}),this._register(Ie(()=>this._cancellationTokenSource.cancel()));const n=Zx("contentChangedSignal"),o=this._register(new Wt(()=>n.trigger(void 0),200));this._register(st(a=>{const l=this._unchangedRegions.read(a);if(!l||l.regions.some(f=>f.isDragged.read(a)))return;const d=l.originalDecorationIds.map(f=>e.original.getDecorationRange(f)).map(f=>f?Je.fromRangeInclusive(f):void 0),c=l.modifiedDecorationIds.map(f=>e.modified.getDecorationRange(f)).map(f=>f?Je.fromRangeInclusive(f):void 0),u=l.regions.map((f,m)=>!d[m]||!c[m]?void 0:new Xu(d[m].startLineNumber,c[m].startLineNumber,d[m].length,f.visibleLineCountTop.read(a),f.visibleLineCountBottom.read(a))).filter(rd),h=[];let g=!1;for(const f of PP(u,(m,_)=>m.getHiddenModifiedRange(a).endLineNumberExclusive===_.getHiddenModifiedRange(a).startLineNumber))if(f.length>1){g=!0;const m=f.reduce((v,b)=>v+b.lineCount,0),_=new Xu(f[0].originalLineNumber,f[0].modifiedLineNumber,m,f[0].visibleLineCountTop.get(),f[f.length-1].visibleLineCountBottom.get());h.push(_)}else h.push(f[0]);if(g){const f=e.original.deltaDecorations(l.originalDecorationIds,h.map(_=>({range:_.originalUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}}))),m=e.modified.deltaDecorations(l.modifiedDecorationIds,h.map(_=>({range:_.modifiedUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}})));$t(_=>{this._unchangedRegions.set({regions:h,originalDecorationIds:f,modifiedDecorationIds:m},_)})}}));const r=(a,l,d)=>{const c=Xu.fromDiffs(a.changes,e.original.getLineCount(),e.modified.getLineCount(),this._options.hideUnchangedRegionsMinimumLineCount.read(d),this._options.hideUnchangedRegionsContextLineCount.read(d));let u;const h=this._unchangedRegions.get();if(h){const _=h.originalDecorationIds.map(w=>e.original.getDecorationRange(w)).map(w=>w?Je.fromRangeInclusive(w):void 0),v=h.modifiedDecorationIds.map(w=>e.modified.getDecorationRange(w)).map(w=>w?Je.fromRangeInclusive(w):void 0);let C=Qye(h.regions.map((w,y)=>{if(!_[y]||!v[y])return;const D=_[y].length;return new Xu(_[y].startLineNumber,v[y].startLineNumber,D,Math.min(w.visibleLineCountTop.get(),D),Math.min(w.visibleLineCountBottom.get(),D-w.visibleLineCountTop.get()))}).filter(rd),(w,y)=>!y||w.modifiedLineNumber>=y.modifiedLineNumber+y.lineCount&&w.originalLineNumber>=y.originalLineNumber+y.lineCount).map(w=>new Ns(w.getHiddenOriginalRange(d),w.getHiddenModifiedRange(d)));C=Ns.clip(C,Je.ofLength(1,e.original.getLineCount()),Je.ofLength(1,e.modified.getLineCount())),u=Ns.inverse(C,e.original.getLineCount(),e.modified.getLineCount())}const g=[];if(u)for(const _ of c){const v=u.filter(b=>b.original.intersectsStrict(_.originalUnchangedRange)&&b.modified.intersectsStrict(_.modifiedUnchangedRange));g.push(..._.setVisibleRanges(v,l))}else g.push(...c);const f=e.original.deltaDecorations((h==null?void 0:h.originalDecorationIds)||[],g.map(_=>({range:_.originalUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}}))),m=e.modified.deltaDecorations((h==null?void 0:h.modifiedDecorationIds)||[],g.map(_=>({range:_.modifiedUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}})));this._unchangedRegions.set({regions:g,originalDecorationIds:f,modifiedDecorationIds:m},l)};this._register(e.modified.onDidChangeContent(a=>{if(this._diff.get()){const d=Dc.fromModelContentChanges(a.changes);this._lastDiff,e.original,e.modified}this._isDiffUpToDate.set(!1,void 0),o.schedule()})),this._register(e.original.onDidChangeContent(a=>{if(this._diff.get()){const d=Dc.fromModelContentChanges(a.changes);this._lastDiff,e.original,e.modified}this._isDiffUpToDate.set(!1,void 0),o.schedule()})),this._register(Hr(async(a,l)=>{var d,c;this._options.hideUnchangedRegionsMinimumLineCount.read(a),this._options.hideUnchangedRegionsContextLineCount.read(a),o.cancel(),n.read(a);const u=this._diffProvider.read(a);u.onChangeSignal.read(a),ta(hU,a),ta(bA,a),this._isDiffUpToDate.set(!1,void 0);let h=[];l.add(e.original.onDidChangeContent(m=>{const _=Dc.fromModelContentChanges(m.changes);h=uD(h,_)}));let g=[];l.add(e.modified.onDidChangeContent(m=>{const _=Dc.fromModelContentChanges(m.changes);g=uD(g,_)}));let f=await u.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()||(f=vSe(f,e.original,e.modified),f=(d=(e.original,e.modified,void 0))!==null&&d!==void 0?d:f,f=(c=(e.original,e.modified,void 0))!==null&&c!==void 0?c:f,$t(m=>{r(f,m),this._lastDiff=f;const _=JO.fromDiffResult(f);this._diff.set(_,m),this._isDiffUpToDate.set(!0,m);const v=this.movedTextToCompare.get();this.movedTextToCompare.set(v?this._lastDiff.moves.find(b=>b.lineRangeMapping.modified.intersect(v.lineRangeMapping.modified)):void 0,m)}))}))}ensureModifiedLineIsVisible(e,t,i){var n,o;if(((n=this.diff.get())===null||n===void 0?void 0:n.mappings.length)===0)return;const r=((o=this._unchangedRegions.get())===null||o===void 0?void 0:o.regions)||[];for(const a of r)if(a.getHiddenModifiedRange(void 0).contains(e)){a.showModifiedLine(e,t,i);return}}ensureOriginalLineIsVisible(e,t,i){var n,o;if(((n=this.diff.get())===null||n===void 0?void 0:n.mappings.length)===0)return;const r=((o=this._unchangedRegions.get())===null||o===void 0?void 0:o.regions)||[];for(const a of r)if(a.getHiddenOriginalRange(void 0).contains(e)){a.showOriginalLine(e,t,i);return}}async waitForDiff(){await _j(this.isDiffUpToDate,e=>e)}serializeState(){const e=this._unchangedRegions.get();return{collapsedRegions:e==null?void 0:e.regions.map(t=>({range:t.getHiddenModifiedRange(void 0).serialize()}))}}restoreSerializedState(e){var t;const i=(t=e.collapsedRegions)===null||t===void 0?void 0:t.map(o=>Je.deserialize(o.range)),n=this._unchangedRegions.get();!n||!i||$t(o=>{for(const r of n.regions)for(const a of i)if(r.modifiedUnchangedRange.intersect(a)){r.setHiddenModifiedRange(a,o);break}})}};mM=mSe([_Se(2,yK)],mM);function vSe(s,e,t){return{changes:s.changes.map(i=>new nr(i.original,i.modified,i.innerChanges?i.innerChanges.map(n=>bSe(n,e,t)):void 0)),moves:s.moves,identical:s.identical,quitEarly:s.quitEarly}}function bSe(s,e,t){let i=s.originalRange,n=s.modifiedRange;return(i.endColumn!==1||n.endColumn!==1)&&i.endColumn===e.getLineMaxColumn(i.endLineNumber)&&n.endColumn===t.getLineMaxColumn(n.endLineNumber)&&i.endLineNumbernew SK(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 SK{constructor(e){this.lineRangeMapping=e}}class Xu{static fromDiffs(e,t,i,n,o){const r=nr.inverse(e,t,i),a=[];for(const l of r){let d=l.original.startLineNumber,c=l.modified.startLineNumber,u=l.original.length;const h=d===1&&c===1,g=d+u===t+1&&c+u===i+1;(h||g)&&u>=o+n?(h&&!g&&(u-=o),g&&!h&&(d+=o,c+=o,u-=o),a.push(new Xu(d,c,u,0,0))):u>=o*2+n&&(d+=o,c+=o,u-=o*2,a.push(new Xu(d,c,u,0,0)))}return a}get originalUnchangedRange(){return Je.ofLength(this.originalLineNumber,this.lineCount)}get modifiedUnchangedRange(){return Je.ofLength(this.modifiedLineNumber,this.lineCount)}constructor(e,t,i,n,o){this.originalLineNumber=e,this.modifiedLineNumber=t,this.lineCount=i,this._visibleLineCountTop=vt(this,0),this.visibleLineCountTop=this._visibleLineCountTop,this._visibleLineCountBottom=vt(this,0),this.visibleLineCountBottom=this._visibleLineCountBottom,this._shouldHideControls=je(this,l=>this.visibleLineCountTop.read(l)+this.visibleLineCountBottom.read(l)===this.lineCount&&!this.isDragged.read(l)),this.isDragged=vt(this,void 0);const r=Math.max(Math.min(n,this.lineCount),0),a=Math.max(Math.min(o,this.lineCount-n),0);x3(n===r),x3(o===a),this._visibleLineCountTop.set(r,void 0),this._visibleLineCountBottom.set(a,void 0)}setVisibleRanges(e,t){const i=[],n=new Lr(e.map(l=>l.modified)).subtractFrom(this.modifiedUnchangedRange);let o=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 d of n.ranges){const c=l===n.ranges.length-1;l++;const u=(c?a:d.endLineNumberExclusive)-r,h=new Xu(o,r,u,0,0);h.setHiddenModifiedRange(d,t),i.push(h),o=h.originalUnchangedRange.endLineNumberExclusive,r=h.modifiedUnchangedRange.endLineNumberExclusive}}return i}shouldHideControls(e){return this._shouldHideControls.read(e)}getHiddenOriginalRange(e){return Je.ofLength(this.originalLineNumber+this._visibleLineCountTop.read(e),this.lineCount-this._visibleLineCountTop.read(e)-this._visibleLineCountBottom.read(e))}getHiddenModifiedRange(e){return Je.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()),o=this.modifiedLineNumber-this._visibleLineCountBottom.get()+this.lineCount-e;t===0&&n{var _;this._contextMenuService.showContextMenu({domForShadowRoot:h&&(_=i.getDomNode())!==null&&_!==void 0?_:void 0,getAnchor:()=>({x:f,y:m}),getActions:()=>{const v=[],b=n.modified.isEmpty;return v.push(new Eo("diff.clipboard.copyDeletedContent",b?n.original.length>1?p("diff.clipboard.copyDeletedLinesContent.label","Copy deleted lines"):p("diff.clipboard.copyDeletedLinesContent.single.label","Copy deleted line"):n.original.length>1?p("diff.clipboard.copyChangedLinesContent.label","Copy changed lines"):p("diff.clipboard.copyChangedLinesContent.single.label","Copy changed line"),void 0,!0,async()=>{const w=this._originalTextModel.getValueInRange(n.original.toExclusiveRange());await this._clipboardService.writeText(w)})),n.original.length>1&&v.push(new Eo("diff.clipboard.copyDeletedLineContent",b?p("diff.clipboard.copyDeletedLineContent.label","Copy deleted line ({0})",n.original.startLineNumber+u):p("diff.clipboard.copyChangedLineContent.label","Copy changed line ({0})",n.original.startLineNumber+u),void 0,!0,async()=>{let w=this._originalTextModel.getLineContent(n.original.startLineNumber+u);w===""&&(w=this._originalTextModel.getEndOfLineSequence()===0?` `:`\r `),await this._clipboardService.writeText(w)})),i.getOption(91)||v.push(new Eo("diff.inline.revertChange",p("diff.inline.revertChange.label","Revert this change"),void 0,!0,async()=>{this._editor.revert(this._diff)})),v},autoSelectFirstItem:!0})};this._register(Ni(this._diffActions,"mousedown",f=>{if(!f.leftButton)return;const{top:m,height:_}=qi(this._diffActions),v=Math.floor(c/3);f.preventDefault(),g(f.posx,m+_+v)})),this._register(i.onMouseMove(f=>{(f.target.type===8||f.target.type===5)&&f.target.detail.viewZoneId===this._getViewZoneId()?(u=this._updateLightBulbPosition(this._marginDomNode,f.event.browserEvent.y,c),this.visibility=!0):this.visibility=!1})),this._register(i.onMouseDown(f=>{f.event.leftButton&&(f.target.type===8||f.target.type===5)&&f.target.detail.viewZoneId===this._getViewZoneId()&&(f.event.preventDefault(),u=this._updateLightBulbPosition(this._marginDomNode,f.event.browserEvent.y,c),g(f.event.posx,f.event.posy+c))}))}_updateLightBulbPosition(e,t,i){const{top:n}=qi(e),o=t-n,r=Math.floor(o/i),a=r*i;if(this._diffActions.style.top=`${a}px`,this._viewLineCounts){let l=0;for(let d=0;ds});function wSe(s,e,t,i){Un(i,e.fontInfo);const n=t.length>0,o=new l0(1e4);let r=0,a=0;const l=[];for(let h=0;h');const l=e.getLineContent(),d=lr.isBasicASCII(l,n),c=lr.containsRTL(l,d,o),u=m1(new tg(r.fontInfo.isMonospace&&!r.disableMonospaceOptimizations,r.fontInfo.canUseHalfwidthRightwardsArrow,l,!1,d,c,0,e,t,r.tabSize,0,r.fontInfo.spaceWidth,r.fontInfo.middotWidth,r.fontInfo.wsmiddotWidth,r.stopRenderingLineAfter,r.renderWhitespace,r.renderControlCharacters,r.fontLigatures!==Zo.OFF,null),a);return a.appendString(""),u.characterMapping.getHorizontalOffset(u.characterMapping.length)}var SSe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},m7=function(s,e){return function(t,i){e(t,i,s)}};let _M=class extends H{constructor(e,t,i,n,o,r,a,l,d,c){super(),this._targetWindow=e,this._editors=t,this._diffModel=i,this._options=n,this._diffEditorWidget=o,this._canIgnoreViewZoneUpdateEvent=r,this._origViewZonesToIgnore=a,this._modViewZonesToIgnore=l,this._clipboardService=d,this._contextMenuService=c,this._originalTopPadding=vt(this,0),this._originalScrollOffset=vt(this,0),this._originalScrollOffsetAnimated=r7(this._targetWindow,this._originalScrollOffset,this._store),this._modifiedTopPadding=vt(this,0),this._modifiedScrollOffset=vt(this,0),this._modifiedScrollOffsetAnimated=r7(this._targetWindow,this._modifiedScrollOffset,this._store);const u=vt("invalidateAlignmentsState",0),h=this._register(new Wt(()=>{u.set(u.get()+1,void 0)},0));this._register(this._editors.original.onDidChangeViewZones(C=>{this._canIgnoreViewZoneUpdateEvent()||h.schedule()})),this._register(this._editors.modified.onDidChangeViewZones(C=>{this._canIgnoreViewZoneUpdateEvent()||h.schedule()})),this._register(this._editors.original.onDidChangeConfiguration(C=>{(C.hasChanged(146)||C.hasChanged(67))&&h.schedule()})),this._register(this._editors.modified.onDidChangeConfiguration(C=>{(C.hasChanged(146)||C.hasChanged(67))&&h.schedule()}));const g=this._diffModel.map(C=>C?Ot(C.model.original.onDidChangeTokens,()=>C.model.original.tokenization.backgroundTokenizationState===2):void 0).map((C,w)=>C==null?void 0:C.read(w)),f=je(C=>{const w=this._diffModel.read(C),y=w==null?void 0:w.diff.read(C);if(!w||!y)return null;u.read(C);const L=this._options.renderSideBySide.read(C);return _7(this._editors.original,this._editors.modified,y.mappings,this._origViewZonesToIgnore,this._modViewZonesToIgnore,L)}),m=je(C=>{var w;const y=(w=this._diffModel.read(C))===null||w===void 0?void 0:w.movedTextToCompare.read(C);if(!y)return null;u.read(C);const D=y.changes.map(L=>new SK(L));return _7(this._editors.original,this._editors.modified,D,this._origViewZonesToIgnore,this._modViewZonesToIgnore,!0)});function _(){const C=document.createElement("div");return C.className="diagonal-fill",C}const v=this._register(new Y);this.viewZones=g0(this,(C,w)=>{var y,D,L,k,I,O,R,P;v.clear();const F=f.read(C)||[],V=[],U=[],J=this._modifiedTopPadding.read(C);J>0&&U.push({afterLineNumber:0,domNode:document.createElement("div"),heightInPx:J,showInHiddenAreas:!0,suppressMouseDown:!0});const pe=this._originalTopPadding.read(C);pe>0&&V.push({afterLineNumber:0,domNode:document.createElement("div"),heightInPx:pe,showInHiddenAreas:!0,suppressMouseDown:!0});const De=this._options.renderSideBySide.read(C),ge=De||(y=this._editors.modified._getViewModel())===null||y===void 0?void 0:y.createLineBreaksComputer();if(ge){const St=this._editors.original.getModel();for(const tn of F)if(tn.diff)for(let Pn=tn.originalRange.startLineNumber;PnSt.getLineCount())return{orig:V,mod:U};ge==null||ge.addRequest(St.getLineContent(Pn),null,null)}}const We=(D=ge==null?void 0:ge.finalize())!==null&&D!==void 0?D:[];let ye=0;const ve=this._editors.modified.getOption(67),ce=(L=this._diffModel.read(C))===null||L===void 0?void 0:L.movedTextToCompare.read(C),Qt=(I=(k=this._editors.original.getModel())===null||k===void 0?void 0:k.mightContainNonBasicASCII())!==null&&I!==void 0?I:!1,Ui=(R=(O=this._editors.original.getModel())===null||O===void 0?void 0:O.mightContainRTL())!==null&&R!==void 0?R:!1,Gi=e4.fromEditor(this._editors.modified);for(const St of F)if(St.diff&&!De){if(!St.originalRange.isEmpty){g.read(C);const Pn=document.createElement("div");Pn.classList.add("view-lines","line-delete","monaco-mouse-cursor-text");const ln=this._editors.original.getModel();if(St.originalRange.endLineNumberExclusive-1>ln.getLineCount())return{orig:V,mod:U};const $e=new ySe(St.originalRange.mapToLineArray(xn=>ln.tokenization.getLineTokens(xn)),St.originalRange.mapToLineArray(xn=>We[ye++]),Qt,Ui),dn=[];for(const xn of St.diff.innerChanges||[])dn.push(new $v(xn.originalRange.delta(-(St.diff.original.startLineNumber-1)),gM.className,0));const qr=wSe($e,Gi,dn,Pn),Wo=document.createElement("div");if(Wo.className="inline-deleted-margin-view-zone",Un(Wo,Gi.fontInfo),this._options.renderIndicators.read(C))for(let xn=0;xnOu(Fd),Wo,this._editors.modified,St.diff,this._diffEditorWidget,qr.viewLineCounts,this._editors.original.getModel(),this._contextMenuService,this._clipboardService));for(let xn=0;xn1&&V.push({afterLineNumber:St.originalRange.startLineNumber+xn,domNode:_(),heightInPx:(Da-1)*ve,showInHiddenAreas:!0,suppressMouseDown:!0})}U.push({afterLineNumber:St.modifiedRange.startLineNumber-1,domNode:Pn,heightInPx:qr.heightInLines*ve,minWidthInPx:qr.minWidthInPx,marginDomNode:Wo,setZoneId(xn){Fd=xn},showInHiddenAreas:!0,suppressMouseDown:!0})}const tn=document.createElement("div");tn.className="gutter-delete",V.push({afterLineNumber:St.originalRange.endLineNumberExclusive-1,domNode:_(),heightInPx:St.modifiedHeightInPx,marginDomNode:tn,showInHiddenAreas:!0,suppressMouseDown:!0})}else{const tn=St.modifiedHeightInPx-St.originalHeightInPx;if(tn>0){if(ce!=null&&ce.lineRangeMapping.original.delta(-1).deltaLength(2).contains(St.originalRange.endLineNumberExclusive-1))continue;V.push({afterLineNumber:St.originalRange.endLineNumberExclusive-1,domNode:_(),heightInPx:tn,showInHiddenAreas:!0,suppressMouseDown:!0})}else{let Pn=function(){const $e=document.createElement("div");return $e.className="arrow-revert-change "+Pe.asClassName(oe.arrowRight),w.add(K($e,"mousedown",dn=>dn.stopPropagation())),w.add(K($e,"click",dn=>{dn.stopPropagation(),o.revert(St.diff)})),he("div",{},$e)};if(ce!=null&&ce.lineRangeMapping.modified.delta(-1).deltaLength(2).contains(St.modifiedRange.endLineNumberExclusive-1))continue;let ln;St.diff&&St.diff.modified.isEmpty&&this._options.shouldRenderOldRevertArrows.read(C)&&(ln=Pn()),U.push({afterLineNumber:St.modifiedRange.endLineNumberExclusive-1,domNode:_(),heightInPx:-tn,marginDomNode:ln,showInHiddenAreas:!0,suppressMouseDown:!0})}}for(const St of(P=m.read(C))!==null&&P!==void 0?P:[]){if(!(ce!=null&&ce.lineRangeMapping.original.intersect(St.originalRange))||!(ce!=null&&ce.lineRangeMapping.modified.intersect(St.modifiedRange)))continue;const tn=St.modifiedHeightInPx-St.originalHeightInPx;tn>0?V.push({afterLineNumber:St.originalRange.endLineNumberExclusive-1,domNode:_(),heightInPx:tn,showInHiddenAreas:!0,suppressMouseDown:!0}):U.push({afterLineNumber:St.modifiedRange.endLineNumberExclusive-1,domNode:_(),heightInPx:-tn,showInHiddenAreas:!0,suppressMouseDown:!0})}return{orig:V,mod:U}});let b=!1;this._register(this._editors.original.onDidScrollChange(C=>{C.scrollLeftChanged&&!b&&(b=!0,this._editors.modified.setScrollLeft(C.scrollLeft),b=!1)})),this._register(this._editors.modified.onDidScrollChange(C=>{C.scrollLeftChanged&&!b&&(b=!0,this._editors.original.setScrollLeft(C.scrollLeft),b=!1)})),this._originalScrollTop=Ot(this._editors.original.onDidScrollChange,()=>this._editors.original.getScrollTop()),this._modifiedScrollTop=Ot(this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollTop()),this._register(st(C=>{const w=this._originalScrollTop.read(C)-(this._originalScrollOffsetAnimated.get()-this._modifiedScrollOffsetAnimated.read(C))-(this._originalTopPadding.get()-this._modifiedTopPadding.read(C));w!==this._editors.modified.getScrollTop()&&this._editors.modified.setScrollTop(w,1)})),this._register(st(C=>{const w=this._modifiedScrollTop.read(C)-(this._modifiedScrollOffsetAnimated.get()-this._originalScrollOffsetAnimated.read(C))-(this._modifiedTopPadding.get()-this._originalTopPadding.read(C));w!==this._editors.original.getScrollTop()&&this._editors.original.setScrollTop(w,1)})),this._register(st(C=>{var w;const y=(w=this._diffModel.read(C))===null||w===void 0?void 0:w.movedTextToCompare.read(C);let D=0;if(y){const L=this._editors.original.getTopForLineNumber(y.lineRangeMapping.original.startLineNumber,!0)-this._originalTopPadding.get();D=this._editors.modified.getTopForLineNumber(y.lineRangeMapping.modified.startLineNumber,!0)-this._modifiedTopPadding.get()-L}D>0?(this._modifiedTopPadding.set(0,void 0),this._originalTopPadding.set(D,void 0)):D<0?(this._modifiedTopPadding.set(-D,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.get()-D,void 0,!0):this._modifiedScrollOffset.set(this._originalScrollOffset.get()+D,void 0,!0)}))}};_M=SSe([m7(8,ru),m7(9,Oo)],_M);function _7(s,e,t,i,n,o){const r=new Hc(v7(s,i)),a=new Hc(v7(e,n)),l=s.getOption(67),d=e.getOption(67),c=[];let u=0,h=0;function g(f,m){for(;;){let _=r.peek(),v=a.peek();if(_&&_.lineNumber>=f&&(_=void 0),v&&v.lineNumber>=m&&(v=void 0),!_&&!v)break;const b=_?_.lineNumber-u:Number.MAX_VALUE,C=v?v.lineNumber-h:Number.MAX_VALUE;bC?(a.dequeue(),_={lineNumber:v.lineNumber-h+u,heightInPx:0}):(r.dequeue(),a.dequeue()),c.push({originalRange:Je.ofLength(_.lineNumber,1),modifiedRange:Je.ofLength(v.lineNumber,1),originalHeightInPx:l+_.heightInPx,modifiedHeightInPx:d+v.heightInPx,diff:void 0})}}for(const f of t){let C=function(w,y){var D,L,k,I;if(wV.lineNumberV+U.heightInPx,0))!==null&&L!==void 0?L:0,F=(I=(k=a.takeWhile(V=>V.lineNumberV+U.heightInPx,0))!==null&&I!==void 0?I:0;c.push({originalRange:O,modifiedRange:R,originalHeightInPx:O.length*l+P,modifiedHeightInPx:R.length*d+F,diff:f.lineRangeMapping}),b=w,v=y};const m=f.lineRangeMapping;g(m.original.startLineNumber,m.modified.startLineNumber);let _=!0,v=m.modified.startLineNumber,b=m.original.startLineNumber;if(o)for(const w of m.innerChanges||[]){w.originalRange.startColumn>1&&w.modifiedRange.startColumn>1&&C(w.originalRange.startLineNumber,w.modifiedRange.startLineNumber);const y=s.getModel(),D=w.originalRange.endLineNumber<=y.getLineCount()?y.getLineMaxColumn(w.originalRange.endLineNumber):Number.MAX_SAFE_INTEGER;w.originalRange.endColumn1&&i.push({lineNumber:l,heightInPx:r*(d-1)})}for(const l of s.getWhitespaces()){if(e.has(l.id))continue;const d=l.afterLineNumber===0?0:o.convertViewPositionToModelPosition(new W(l.afterLineNumber,1)).lineNumber;t.push({lineNumber:d,heightInPx:l.height})}return Kye(t,i,l=>l.lineNumber,(l,d)=>({lineNumber:l.lineNumber,heightInPx:l.heightInPx+d.heightInPx}))}class DSe extends H{constructor(e,t,i){super(),this._editor=e,this._domNode=t,this.itemProvider=i,this.scrollTop=Ot(this._editor.onDidScrollChange,r=>this._editor.getScrollTop()),this.isScrollTopZero=this.scrollTop.map(r=>r===0),this.modelAttached=Ot(this._editor.onDidChangeModel,r=>this._editor.hasModel()),this.editorOnDidChangeViewZones=os("onDidChangeViewZones",this._editor.onDidChangeViewZones),this.editorOnDidContentSizeChange=os("onDidContentSizeChange",this._editor.onDidContentSizeChange),this.domNodeSizeChanged=Zx("domNodeSizeChanged"),this.views=new Map,this._domNode.className="gutter monaco-editor";const n=this._domNode.appendChild(Nt("div.scroll-decoration",{role:"presentation",ariaHidden:"true",style:{width:"100%"}}).root),o=new ResizeObserver(()=>{$t(r=>{this.domNodeSizeChanged.trigger(r)})});o.observe(this._domNode),this._register(Ie(()=>o.disconnect())),this._register(st(r=>{n.className=this.isScrollTopZero.read(r)?"":"scroll-decoration"})),this._register(st(r=>this.render(r)))}dispose(){super.dispose(),Yn(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()),o=et.ofStartAndLength(0,this._domNode.clientHeight);if(!o.isEmpty)for(const r of i){const a=new Je(r.startLineNumber,r.endLineNumber+1),l=this.itemProvider.getIntersectingGutterItems(a,e);$t(d=>{for(const c of l){if(!c.range.intersect(a))continue;n.delete(c.id);let u=this.views.get(c.id);if(u)u.item.set(c,d);else{const m=document.createElement("div");this._domNode.appendChild(m);const _=vt("item",c),v=this.itemProvider.createView(_,m);u=new LSe(_,v,m),this.views.set(c.id,u)}const h=c.range.startLineNumber<=this._editor.getModel().getLineCount()?this._editor.getTopForLineNumber(c.range.startLineNumber,!0)-t:this._editor.getBottomForLineNumber(c.range.startLineNumber-1,!1)-t,f=(c.range.isEmpty?h:this._editor.getBottomForLineNumber(c.range.endLineNumberExclusive-1,!0)-t)-h;u.domNode.style.top=`${h}px`,u.domNode.style.height=`${f}px`,u.gutterItemView.layout(et.ofStartAndLength(h,f),o)}})}for(const r of n){const a=this.views.get(r);a.gutterItemView.dispose(),this._domNode.removeChild(a.domNode),this.views.delete(r)}}}class LSe{constructor(e,t,i){this.item=e,this.gutterItemView=t,this.domNode=i}}class DK extends Df{constructor(e){super(),this._getContext=e}runAction(e,t){const i=this._getContext();return super.runAction(e,i)}}class b7 extends dU{constructor(e){super(),this._textModel=e}getValueOfRange(e){return this._textModel.getValueInRange(e)}get length(){const e=this._textModel.getLineCount(),t=this._textModel.getLineLength(e);return new Fs(e-1,t)}}class xSe extends H{constructor(e,t,i={orientation:0}){var n;super(),this.submenuActionViewItems=[],this.hasSecondaryActions=!1,this._onDidChangeDropdownVisibility=this._register(new Zoe),this.onDidChangeDropdownVisibility=this._onDidChangeDropdownVisibility.event,this.disposables=this._register(new Y),i.hoverDelegate=(n=i.hoverDelegate)!==null&&n!==void 0?n:this._register(I_()),this.options=i,this.lookupKeybindings=typeof this.options.getKeyBinding=="function",this.toggleMenuAction=this._register(new O_(()=>{var o;return(o=this.toggleMenuActionViewItem)===null||o===void 0?void 0:o.show()},i.toggleMenuTitle)),this.element=document.createElement("div"),this.element.className="monaco-toolbar",e.appendChild(this.element),this.actionBar=this._register(new Vr(this.element,{orientation:i.orientation,ariaLabel:i.ariaLabel,actionRunner:i.actionRunner,allowContextMenu:i.allowContextMenu,highlightToggledItems:i.highlightToggledItems,hoverDelegate:i.hoverDelegate,actionViewItemProvider:(o,r)=>{var a;if(o.id===O_.ID)return this.toggleMenuActionViewItem=new kD(o,o.menuActions,t,{actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,keybindingProvider:this.options.getKeyBinding,classNames:Pe.asClassNameArray((a=i.moreIcon)!==null&&a!==void 0?a:oe.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 l=i.actionViewItemProvider(o,r);if(l)return l}if(o instanceof c_){const l=new kD(o,o.actions,t,{actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,keybindingProvider:this.options.getKeyBinding,classNames:o.class,anchorAlignmentProvider:this.options.anchorAlignmentProvider,menuAsChild:!!this.options.renderDropdownAsChildElement,skipTelemetry:this.options.skipTelemetry,hoverDelegate:this.options.hoverDelegate});return l.setActionContext(this.actionBar.context),this.submenuActionViewItems.push(l),this.disposables.add(this._onDidChangeDropdownVisibility.add(l.onDidChangeVisibility)),l}}}))}set actionRunner(e){this.actionBar.actionRunner=e}get actionRunner(){return this.actionBar.actionRunner}getElement(){return this.element}getItemAction(e){return this.actionBar.getAction(e)}setActions(e,t){this.clear();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.forEach(n=>{this.actionBar.push(n,{icon:!0,label:!1,keybinding:this.getKeybindingLabel(n)})})}getKeybindingLabel(e){var t,i,n;const o=this.lookupKeybindings?(i=(t=this.options).getKeyBinding)===null||i===void 0?void 0:i.call(t,e):void 0;return(n=o==null?void 0:o.getLabel())!==null&&n!==void 0?n:void 0}clear(){this.submenuActionViewItems=[],this.disposables.clear(),this.actionBar.clear()}dispose(){this.clear(),this.disposables.dispose(),super.dispose()}}class O_ extends Eo{constructor(e,t){t=t||p("moreActions","More Actions..."),super(O_.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}}O_.ID="toolbar.toggle.more";var LK=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},sa=function(s,e){return function(t,i){e(t,i,s)}};let LC=class extends xSe{constructor(e,t,i,n,o,r,a,l){super(e,o,{getKeyBinding:c=>{var u;return(u=r.lookupKeybinding(c.id))!==null&&u!==void 0?u:void 0},...t,allowContextMenu:!0,skipTelemetry:typeof(t==null?void 0:t.telemetrySource)=="string"}),this._options=t,this._menuService=i,this._contextKeyService=n,this._contextMenuService=o,this._keybindingService=r,this._commandService=a,this._sessionDisposables=this._store.add(new Y);const d=t==null?void 0:t.telemetrySource;d&&this._store.add(this.actionBar.onDidRun(c=>l.publicLog2("workbenchActionExecuted",{id:c.action.id,from:d})))}setActions(e,t=[],i){var n,o,r;this._sessionDisposables.clear();const a=e.slice(),l=t.slice(),d=[];let c=0;const u=[];let h=!1;if(((n=this._options)===null||n===void 0?void 0:n.hiddenItemStrategy)!==-1)for(let g=0;g_==null?void 0:_.id)),f=this._options.overflowBehavior.maxItems-g.size;let m=0;for(let _=0;_=f&&(a[_]=void 0,u[_]=v))}}q5(a),q5(u),super.setActions(a,rn.join(u,l)),(d.length>0||a.length>0)&&this._sessionDisposables.add(K(this.getElement(),"contextmenu",g=>{var f,m,_,v,b;const C=new ra(Te(this.getElement()),g),w=this.getItemAction(C.target);if(!w)return;C.preventDefault(),C.stopPropagation();const y=[];if(w instanceof Io&&w.menuKeybinding?y.push(w.menuKeybinding):w instanceof Em||w instanceof O_||y.push(fK(w.id,void 0,this._commandService,this._keybindingService)),d.length>0){let L=!1;if(c===1&&((f=this._options)===null||f===void 0?void 0:f.hiddenItemStrategy)===0){L=!0;for(let k=0;kthis._menuService.resetHiddenStates(i)}))),D.length!==0&&this._contextMenuService.showContextMenu({getAnchor:()=>C,getActions:()=>D,menuId:(_=this._options)===null||_===void 0?void 0:_.contextMenu,menuActionOptions:{renderShortTitle:!0,...(v=this._options)===null||v===void 0?void 0:v.menuOptions},skipTelemetry:typeof((b=this._options)===null||b===void 0?void 0:b.telemetrySource)=="string",contextKeyService:this._contextKeyService})}))}};LC=LK([sa(2,hr),sa(3,Be),sa(4,Oo),sa(5,At),sa(6,gi),sa(7,Gs)],LC);let nL=class extends LC{constructor(e,t,i,n,o,r,a,l,d){super(e,{resetMenu:t,...i},n,o,r,a,l,d),this._onDidChangeMenuItems=this._store.add(new B),this.onDidChangeMenuItems=this._onDidChangeMenuItems.event;const c=this._store.add(n.createMenu(t,o,{emitEventsForSubmenuChanges:!0})),u=()=>{var h,g,f;const m=[],_=[];Qx(c,i==null?void 0:i.menuOptions,{primary:m,secondary:_},(h=i==null?void 0:i.toolbarOptions)===null||h===void 0?void 0:h.primaryGroup,(g=i==null?void 0:i.toolbarOptions)===null||g===void 0?void 0:g.shouldInlineSubmenu,(f=i==null?void 0:i.toolbarOptions)===null||f===void 0?void 0:f.useSeparatorsInPrimaryActions),e.classList.toggle("has-no-actions",m.length===0&&_.length===0),super.setActions(m,_)};this._store.add(c.onDidChange(()=>{u(),this._onDidChangeMenuItems.fire(this)})),u()}setActions(){throw new Ut("This toolbar is populated from a menu.")}};nL=LK([sa(3,hr),sa(4,Be),sa(5,Oo),sa(6,At),sa(7,gi),sa(8,Gs)],nL);var xK=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},aS=function(s,e){return function(t,i){e(t,i,s)}};const QI=[],C7=35;let vM=class extends H{constructor(e,t,i,n,o,r){super(),this._diffModel=t,this._editors=i,this._instantiationService=n,this._contextKeyService=o,this._menuService=r,this._menu=this._register(this._menuService.createMenu(E.DiffEditorHunkToolbar,this._contextKeyService)),this._actions=Ot(this._menu.onDidChange,()=>this._menu.getActions()),this._hasActions=this._actions.map(a=>a.length>0),this.width=je(this,a=>this._hasActions.read(a)?C7:0),this.elements=Nt("div.gutter@gutter",{style:{position:"absolute",height:"100%",width:C7+"px"}},[]),this._currentDiff=je(this,a=>{var l;const d=this._diffModel.read(a);if(!d)return;const c=(l=d.diff.read(a))===null||l===void 0?void 0:l.mappings,u=this._editors.modifiedCursor.read(a);if(u)return c==null?void 0:c.find(h=>h.lineRangeMapping.modified.contains(u.lineNumber))}),this._selectedDiffs=je(this,a=>{const l=this._diffModel.read(a),d=l==null?void 0:l.diff.read(a);if(!d)return QI;const c=this._editors.modifiedSelections.read(a);if(c.every(f=>f.isEmpty()))return QI;const u=new Lr(c.map(f=>Je.fromRangeInclusive(f))),g=d.mappings.filter(f=>f.lineRangeMapping.innerChanges&&u.intersects(f.lineRangeMapping.modified)).map(f=>({mapping:f,rangeMappings:f.lineRangeMapping.innerChanges.filter(m=>c.some(_=>x.areIntersecting(m.modifiedRange,_)))}));return g.length===0||g.every(f=>f.rangeMappings.length===0)?QI:g}),this._register(qye(e,this.elements.root)),this._register(K(this.elements.root,"click",()=>{this._editors.modified.focus()})),this._register(Oh(this.elements.root,{display:this._hasActions.map(a=>a?"block":"none")})),this._register(new DSe(this._editors.modified,this.elements.root,{getIntersectingGutterItems:(a,l)=>{const d=this._diffModel.read(l);if(!d)return[];const c=d.diff.read(l);if(!c)return[];const u=this._selectedDiffs.read(l);if(u.length>0){const g=nr.fromRangeMappings(u.flatMap(f=>f.rangeMappings));return[new w7(g,!0,E.DiffEditorSelectionToolbar,void 0,d.model.original.uri,d.model.modified.uri)]}const h=this._currentDiff.read(l);return c.mappings.map(g=>new w7(g.lineRangeMapping.withInnerChangesFromLineRanges(),g.lineRangeMapping===(h==null?void 0:h.lineRangeMapping),E.DiffEditorHunkToolbar,void 0,d.model.original.uri,d.model.modified.uri))},createView:(a,l)=>this._instantiationService.createInstance(bM,a,l,this)})),this._register(K(this.elements.gutter,ee.MOUSE_WHEEL,a=>{this._editors.modified.getOption(103).handleMouseWheel&&this._editors.modified.delegateScrollFromMouseWheelEvent(a)},{passive:!1}))}computeStagedValue(e){var t;const i=(t=e.innerChanges)!==null&&t!==void 0?t:[],n=new b7(this._editors.modifiedModel.get()),o=new b7(this._editors.original.getModel());return new yF(i.map(l=>l.toTextEdit(n))).apply(o)}layout(e){this.elements.gutter.style.left=e+"px"}};vM=xK([aS(3,Ne),aS(4,Be),aS(5,hr)],vM);class w7{constructor(e,t,i,n,o,r){this.mapping=e,this.showAlways=t,this.menuId=i,this.rangeOverride=n,this.originalUri=o,this.modifiedUri=r}get id(){return this.mapping.modified.toString()}get range(){var e;return(e=this.rangeOverride)!==null&&e!==void 0?e:this.mapping.modified}}let bM=class extends H{constructor(e,t,i,n){super(),this._item=e,this._elements=Nt("div.gutterItem",{style:{height:"20px",width:"34px"}},[Nt("div.background@background",{},[]),Nt("div.buttons@buttons",{},[])]),this._showAlways=this._item.map(this,r=>r.showAlways),this._menuId=this._item.map(this,r=>r.menuId),this._isSmall=vt(this,!1),this._lastItemRange=void 0,this._lastViewRange=void 0;const o=this._register(n.createInstance(S_,"element",!0,{position:{hoverPosition:1}}));this._register(Ev(t,this._elements.root)),this._register(st(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(Hr((r,a)=>{this._elements.buttons.replaceChildren();const l=a.add(n.createInstance(nL,this._elements.buttons,this._menuId.read(r),{orientation:1,hoverDelegate:o,toolbarOptions:{primaryGroup:d=>d.startsWith("primary")},overflowBehavior:{maxItems:this._isSmall.read(r)?1:3},hiddenItemStrategy:0,actionRunner:new DK(()=>{const d=this._item.get(),c=d.mapping;return{mapping:c,originalWithModifiedChanges:i.computeStagedValue(c),originalUri:d.originalUri,modifiedUri:d.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,this._elements.root.style.top=e.start+"px",this._elements.root.style.height=e.length+"px";const n=e.length/2-i/2,o=i;let r=e.start+n;const a=et.tryCreate(o,t.endExclusive-o-i),l=et.tryCreate(e.start+o,e.endExclusive-i-o);l&&a&&l.start=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},ESe=function(s,e){return function(t,i){e(t,i,s)}},CM;let xC=CM=class extends H{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=Gd(this,l=>{const d=this._editors.modifiedModel.read(l),c=CM._breadcrumbsSourceFactory.read(l);return!d||!c?void 0:c(d,this._instantiationService)}),this._isUpdatingHiddenAreas=!1,this._register(this._editors.original.onDidChangeCursorPosition(l=>{if(l.reason===1)return;const d=this._diffModel.get();$t(c=>{for(const u of this._editors.original.getSelections()||[])d==null||d.ensureOriginalLineIsVisible(u.getStartPosition().lineNumber,0,c),d==null||d.ensureOriginalLineIsVisible(u.getEndPosition().lineNumber,0,c)})})),this._register(this._editors.modified.onDidChangeCursorPosition(l=>{if(l.reason===1)return;const d=this._diffModel.get();$t(c=>{for(const u of this._editors.modified.getSelections()||[])d==null||d.ensureModifiedLineIsVisible(u.getStartPosition().lineNumber,0,c),d==null||d.ensureModifiedLineIsVisible(u.getEndPosition().lineNumber,0,c)})}));const o=this._diffModel.map((l,d)=>{var c,u;const h=(c=l==null?void 0:l.unchangedRegions.read(d))!==null&&c!==void 0?c:[];return h.length===1&&h[0].modifiedLineNumber===1&&h[0].lineCount===((u=this._editors.modifiedModel.read(d))===null||u===void 0?void 0:u.getLineCount())?[]:h});this.viewZones=g0(this,(l,d)=>{const c=this._modifiedOutlineSource.read(l);if(!c)return{origViewZones:[],modViewZones:[]};const u=[],h=[],g=this._options.renderSideBySide.read(l),f=o.read(l);for(const m of f)if(!m.shouldHideControls(l)){{const _=je(this,b=>m.getHiddenOriginalRange(b).startLineNumber-1),v=new eL(_,24);u.push(v),d.add(new y7(this._editors.original,v,m,m.originalUnchangedRange,!g,c,b=>this._diffModel.get().ensureModifiedLineIsVisible(b,2,void 0),this._options))}{const _=je(this,b=>m.getHiddenModifiedRange(b).startLineNumber-1),v=new eL(_,24);h.push(v),d.add(new y7(this._editors.modified,v,m,m.modifiedUnchangedRange,!1,c,b=>this._diffModel.get().ensureModifiedLineIsVisible(b,2,void 0),this._options))}}return{origViewZones:u,modViewZones:h}});const r={description:"unchanged lines",className:"diff-unchanged-lines",isWholeLine:!0},a={description:"Fold Unchanged",glyphMarginHoverMessage:new ss(void 0,{isTrusted:!0,supportThemeIcons:!0}).appendMarkdown(p("foldUnchanged","Fold Unchanged Region")),glyphMarginClassName:"fold-unchanged "+Pe.asClassName(oe.fold),zIndex:10001};this._register(JD(this._editors.original,je(this,l=>{const d=o.read(l),c=d.map(u=>({range:u.originalUnchangedRange.toInclusiveRange(),options:r}));for(const u of d)u.shouldHideControls(l)&&c.push({range:x.fromPositions(new W(u.originalLineNumber,1)),options:a});return c}))),this._register(JD(this._editors.modified,je(this,l=>{const d=o.read(l),c=d.map(u=>({range:u.modifiedUnchangedRange.toInclusiveRange(),options:r}));for(const u of d)u.shouldHideControls(l)&&c.push({range:Je.ofLength(u.modifiedLineNumber,1).toInclusiveRange(),options:a});return c}))),this._register(st(l=>{const d=o.read(l);this._isUpdatingHiddenAreas=!0;try{this._editors.original.setHiddenAreas(d.map(c=>c.getHiddenOriginalRange(l).toInclusiveRange()).filter(rd)),this._editors.modified.setHiddenAreas(d.map(c=>c.getHiddenModifiedRange(l).toInclusiveRange()).filter(rd))}finally{this._isUpdatingHiddenAreas=!1}})),this._register(this._editors.modified.onMouseUp(l=>{var d;if(!l.event.rightButton&&l.target.position&&(!((d=l.target.element)===null||d===void 0)&&d.className.includes("fold-unchanged"))){const c=l.target.position.lineNumber,u=this._diffModel.get();if(!u)return;const h=u.unchangedRegions.get().find(g=>g.modifiedUnchangedRange.includes(c));if(!h)return;h.collapseAll(void 0),l.event.stopPropagation(),l.event.preventDefault()}})),this._register(this._editors.original.onMouseUp(l=>{var d;if(!l.event.rightButton&&l.target.position&&(!((d=l.target.element)===null||d===void 0)&&d.className.includes("fold-unchanged"))){const c=l.target.position.lineNumber,u=this._diffModel.get();if(!u)return;const h=u.unchangedRegions.get().find(g=>g.originalUnchangedRange.includes(c));if(!h)return;h.collapseAll(void 0),l.event.stopPropagation(),l.event.preventDefault()}}))}};xC._breadcrumbsSourceFactory=vt("breadcrumbsSourceFactory",void 0);xC=CM=kSe([ESe(3,Ne)],xC);class y7 extends bK{constructor(e,t,i,n,o,r,a,l){const d=Nt("div.diff-hidden-lines-widget");super(e,t,d.root),this._editor=e,this._unchangedRegion=i,this._unchangedRegionRange=n,this._hide=o,this._modifiedOutlineSource=r,this._revealModifiedHiddenLine=a,this._options=l,this._nodes=Nt("div.diff-hidden-lines",[Nt("div.top@top",{title:p("diff.hiddenLines.top","Click or drag to show more above")}),Nt("div.center@content",{style:{display:"flex"}},[Nt("div@first",{style:{display:"flex",justifyContent:"center",alignItems:"center",flexShrink:"0"}},[he("a",{title:p("showUnchangedRegion","Show Unchanged Region"),role:"button",onclick:()=>{this._unchangedRegion.showAll(void 0)}},...lh("$(unfold)"))]),Nt("div@others",{style:{display:"flex",justifyContent:"center",alignItems:"center"}})]),Nt("div.bottom@bottom",{title:p("diff.bottom","Click or drag to show more below"),role:"button"})]),d.root.appendChild(this._nodes.root);const c=Ot(this._editor.onDidLayoutChange,()=>this._editor.getLayoutInfo());this._hide?Yn(this._nodes.first):this._register(Oh(this._nodes.first,{width:c.map(h=>h.contentLeft)})),this._register(st(h=>{const g=this._unchangedRegion.visibleLineCountTop.read(h)+this._unchangedRegion.visibleLineCountBottom.read(h)===this._unchangedRegion.lineCount;this._nodes.bottom.classList.toggle("canMoveTop",!g),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",!g);const f=this._unchangedRegion.isDragged.read(h),m=this._editor.getDomNode();m&&(m.classList.toggle("draggingUnchangedRegion",!!f),f==="top"?(m.classList.toggle("canMoveTop",this._unchangedRegion.visibleLineCountTop.read(h)>0),m.classList.toggle("canMoveBottom",!g)):f==="bottom"?(m.classList.toggle("canMoveTop",!g),m.classList.toggle("canMoveBottom",this._unchangedRegion.visibleLineCountBottom.read(h)>0)):(m.classList.toggle("canMoveTop",!1),m.classList.toggle("canMoveBottom",!1)))}));const u=this._editor;this._register(K(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 g=h.clientY;let f=!1;const m=this._unchangedRegion.visibleLineCountTop.get();this._unchangedRegion.isDragged.set("top",void 0);const _=Te(this._nodes.top),v=K(_,"mousemove",C=>{const y=C.clientY-g;f=f||Math.abs(y)>2;const D=Math.round(y/u.getOption(67)),L=Math.max(0,Math.min(m+D,this._unchangedRegion.getMaxVisibleLineCountTop()));this._unchangedRegion.visibleLineCountTop.set(L,void 0)}),b=K(_,"mouseup",C=>{f||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),v.dispose(),b.dispose()})})),this._register(K(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 g=h.clientY;let f=!1;const m=this._unchangedRegion.visibleLineCountBottom.get();this._unchangedRegion.isDragged.set("bottom",void 0);const _=Te(this._nodes.bottom),v=K(_,"mousemove",C=>{const y=C.clientY-g;f=f||Math.abs(y)>2;const D=Math.round(y/u.getOption(67)),L=Math.max(0,Math.min(m-D,this._unchangedRegion.getMaxVisibleLineCountBottom())),k=this._unchangedRegionRange.endLineNumberExclusive>u.getModel().getLineCount()?u.getContentHeight():u.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);this._unchangedRegion.visibleLineCountBottom.set(L,void 0);const I=this._unchangedRegionRange.endLineNumberExclusive>u.getModel().getLineCount()?u.getContentHeight():u.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);u.setScrollTop(u.getScrollTop()+(I-k))}),b=K(_,"mouseup",C=>{if(this._unchangedRegion.isDragged.set(void 0,void 0),!f){const w=u.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);this._unchangedRegion.showMoreBelow(this._options.hideUnchangedRegionsRevealLineCount.get(),void 0);const y=u.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);u.setScrollTop(u.getScrollTop()+(y-w))}this._nodes.bottom.classList.toggle("dragging",!1),this._nodes.root.classList.toggle("dragging",!1),v.dispose(),b.dispose()})})),this._register(st(h=>{const g=[];if(!this._hide){const f=i.getHiddenModifiedRange(h).length,m=p("hiddenLines","{0} hidden lines",f),_=he("span",{title:p("diff.hiddenLines.expandAll","Double click to unfold")},m);_.addEventListener("dblclick",C=>{C.button===0&&(C.preventDefault(),this._unchangedRegion.showAll(void 0))}),g.push(_);const v=this._unchangedRegion.getHiddenModifiedRange(h),b=this._modifiedOutlineSource.getBreadcrumbItems(v,h);if(b.length>0){g.push(he("span",void 0,"  |  "));for(let C=0;C{this._revealModifiedHiddenLine(w.startLineNumber)}}}}Yn(this._nodes.others,...g)}))}}var ISe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},TSe=function(s,e){return function(t,i){e(t,i,s)}},Jr;let Af=Jr=class extends H{constructor(e,t,i,n,o,r,a){super(),this._editors=e,this._rootElement=t,this._diffModel=i,this._rootWidth=n,this._rootHeight=o,this._modifiedEditorLayoutInfo=r,this._themeService=a,this.width=Jr.ENTIRE_DIFF_OVERVIEW_WIDTH;const l=Ot(this._themeService.onDidColorThemeChange,()=>this._themeService.getColorTheme()),d=je(h=>{const g=l.read(h),f=g.getColor($ue)||(g.getColor(zue)||xA).transparent(2),m=g.getColor(jue)||(g.getColor(Uue)||kA).transparent(2);return{insertColor:f,removeColor:m}}),c=It(document.createElement("div"));c.setClassName("diffViewport"),c.setPosition("absolute");const u=Nt("div.diffOverview",{style:{position:"absolute",top:"0px",width:Jr.ENTIRE_DIFF_OVERVIEW_WIDTH+"px"}}).root;this._register(Ev(u,c.domNode)),this._register(Ni(u,ee.POINTER_DOWN,h=>{this._editors.modified.delegateVerticalScrollbarPointerDown(h)})),this._register(K(u,ee.MOUSE_WHEEL,h=>{this._editors.modified.delegateScrollFromMouseWheelEvent(h)},{passive:!1})),this._register(Ev(this._rootElement,u)),this._register(Hr((h,g)=>{const f=this._diffModel.read(h),m=this._editors.original.createOverviewRuler("original diffOverviewRuler");m&&(g.add(m),g.add(Ev(u,m.getDomNode())));const _=this._editors.modified.createOverviewRuler("modified diffOverviewRuler");if(_&&(g.add(_),g.add(Ev(u,_.getDomNode()))),!m||!_)return;const v=os("viewZoneChanged",this._editors.original.onDidChangeViewZones),b=os("viewZoneChanged",this._editors.modified.onDidChangeViewZones),C=os("hiddenRangesChanged",this._editors.original.onDidChangeHiddenAreas),w=os("hiddenRangesChanged",this._editors.modified.onDidChangeHiddenAreas);g.add(st(y=>{var D;v.read(y),b.read(y),C.read(y),w.read(y);const L=d.read(y),k=(D=f==null?void 0:f.diff.read(y))===null||D===void 0?void 0:D.mappings;function I(P,F,V){const U=V._getViewModel();return U?P.filter(J=>J.length>0).map(J=>{const pe=U.coordinatesConverter.convertModelPositionToViewPosition(new W(J.startLineNumber,1)),De=U.coordinatesConverter.convertModelPositionToViewPosition(new W(J.endLineNumberExclusive,1)),ge=De.lineNumber-pe.lineNumber;return new d$(pe.lineNumber,De.lineNumber,ge,F.toString())}):[]}const O=I((k||[]).map(P=>P.lineRangeMapping.original),L.removeColor,this._editors.original),R=I((k||[]).map(P=>P.lineRangeMapping.modified),L.insertColor,this._editors.modified);m==null||m.setZones(O),_==null||_.setZones(R)})),g.add(st(y=>{const D=this._rootHeight.read(y),L=this._rootWidth.read(y),k=this._modifiedEditorLayoutInfo.read(y);if(k){const I=Jr.ENTIRE_DIFF_OVERVIEW_WIDTH-2*Jr.ONE_OVERVIEW_WIDTH;m.setLayout({top:0,height:D,right:I+Jr.ONE_OVERVIEW_WIDTH,width:Jr.ONE_OVERVIEW_WIDTH}),_.setLayout({top:0,height:D,right:0,width:Jr.ONE_OVERVIEW_WIDTH});const O=this._editors.modifiedScrollTop.read(y),R=this._editors.modifiedScrollHeight.read(y),P=this._editors.modified.getOption(103),F=new C_(P.verticalHasArrows?P.arrowSize:0,P.verticalScrollbarSize,0,k.height,R,O);c.setTop(F.getSliderPosition()),c.setHeight(F.getSliderSize())}else c.setTop(0),c.setHeight(0);u.style.height=D+"px",u.style.left=L-Jr.ENTIRE_DIFF_OVERVIEW_WIDTH+"px",c.setWidth(Jr.ENTIRE_DIFF_OVERVIEW_WIDTH)}))}))}};Af.ONE_OVERVIEW_WIDTH=15;Af.ENTIRE_DIFF_OVERVIEW_WIDTH=Jr.ONE_OVERVIEW_WIDTH*2;Af=Jr=ISe([TSe(6,_n)],Af);const JI=[];class NSe extends H{constructor(e,t,i,n){super(),this._editors=e,this._diffModel=t,this._options=i,this._widget=n,this._selectedDiffs=je(this,o=>{const r=this._diffModel.read(o),a=r==null?void 0:r.diff.read(o);if(!a)return JI;const l=this._editors.modifiedSelections.read(o);if(l.every(h=>h.isEmpty()))return JI;const d=new Lr(l.map(h=>Je.fromRangeInclusive(h))),u=a.mappings.filter(h=>h.lineRangeMapping.innerChanges&&d.intersects(h.lineRangeMapping.modified)).map(h=>({mapping:h,rangeMappings:h.lineRangeMapping.innerChanges.filter(g=>l.some(f=>x.areIntersecting(g.modifiedRange,f)))}));return u.length===0||u.every(h=>h.rangeMappings.length===0)?JI:u}),this._register(Hr((o,r)=>{if(!this._options.shouldRenderOldRevertArrows.read(o))return;const a=this._diffModel.read(o),l=a==null?void 0:a.diff.read(o);if(!a||!l||a.movedTextToCompare.read(o))return;const d=[],c=this._selectedDiffs.read(o),u=new Set(c.map(h=>h.mapping));if(c.length>0){const h=this._editors.modifiedSelections.read(o),g=r.add(new kC(h[h.length-1].positionLineNumber,this._widget,c.flatMap(f=>f.rangeMappings),!0));this._editors.modified.addGlyphMarginWidget(g),d.push(g)}for(const h of l.mappings)if(!u.has(h)&&!h.lineRangeMapping.modified.isEmpty&&h.lineRangeMapping.innerChanges){const g=r.add(new kC(h.lineRangeMapping.modified.startLineNumber,this._widget,h.lineRangeMapping,!1));this._editors.modified.addGlyphMarginWidget(g),d.push(g)}r.add(Ie(()=>{for(const h of d)this._editors.modified.removeGlyphMarginWidget(h)}))}))}}class kC extends H{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${kC.counter++}`,this._domNode=Nt("div.revertButton",{title:this._revertSelection?p("revertSelectedChanges","Revert Selected Changes"):p("revertChange","Revert Change")},[Ef(oe.arrowRight)]).root,this._register(K(this._domNode,ee.MOUSE_DOWN,o=>{o.button!==2&&(o.stopPropagation(),o.preventDefault())})),this._register(K(this._domNode,ee.MOUSE_UP,o=>{o.stopPropagation(),o.preventDefault()})),this._register(K(this._domNode,ee.CLICK,o=>{this._diffs instanceof Ns?this._widget.revert(this._diffs):this._widget.revertRangeMappings(this._diffs),o.stopPropagation(),o.preventDefault()}))}getDomNode(){return this._domNode}getPosition(){return{lane:bd.Right,range:{startColumn:1,startLineNumber:this._lineNumber,endColumn:1,endLineNumber:this._lineNumber},zIndex:10001}}}kC.counter=0;function ASe(s){return tf.get(s)}class tf{static get(e){let t=tf._map.get(e);if(!t){t=new tf(e),tf._map.set(e,t);const i=e.onDidDispose(()=>{tf._map.delete(e),i.dispose()})}return t}constructor(e){this.editor=e,this.model=Ot(this.editor.onDidChangeModel,()=>this.editor.getModel())}}tf._map=new Map;var MSe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},S7=function(s,e){return function(t,i){e(t,i,s)}};let wM=class extends H{get onDidContentSizeChange(){return this._onDidContentSizeChange.event}constructor(e,t,i,n,o,r,a){super(),this.originalEditorElement=e,this.modifiedEditorElement=t,this._options=i,this._argCodeEditorWidgetOptions=n,this._createInnerEditor=o,this._instantiationService=r,this._keybindingService=a,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 B),this.modifiedScrollTop=Ot(this.modified.onDidScrollChange,()=>this.modified.getScrollTop()),this.modifiedScrollHeight=Ot(this.modified.onDidScrollChange,()=>this.modified.getScrollHeight()),this.modifiedModel=ASe(this.modified).model,this.modifiedSelections=Ot(this.modified.onDidChangeCursorSelection,()=>{var l;return(l=this.modified.getSelections())!==null&&l!==void 0?l:[]}),this.modifiedCursor=dc({owner:this,equalsFn:W.equals},l=>{var d,c;return(c=(d=this.modifiedSelections.read(l)[0])===null||d===void 0?void 0:d.getPosition())!==null&&c!==void 0?c:new W(1,1)}),this.originalCursor=Ot(this.original.onDidChangeCursorPosition,()=>{var l;return(l=this.original.getPosition())!==null&&l!==void 0?l:new W(1,1)}),this._argCodeEditorWidgetOptions=null,this._register(I1({createEmptyChangeSummary:()=>({}),handleChange:(l,d)=>(l.didChange(i.editorOptions)&&Object.assign(d,l.change.changedOptions),!0)},(l,d)=>{i.editorOptions.read(l),this._options.renderSideBySide.read(l),this.modified.updateOptions(this._adjustOptionsForRightHandSide(l,d)),this.original.updateOptions(this._adjustOptionsForLeftHandSide(l,d))}))}_createLeftHandSideEditor(e,t){const i=this._adjustOptionsForLeftHandSide(void 0,e),n=this._constructInnerEditor(this._instantiationService,this.originalEditorElement,i,t);return n.setContextValue("isInDiffLeftEditor",!0),n}_createRightHandSideEditor(e,t){const i=this._adjustOptionsForRightHandSide(void 0,e),n=this._constructInnerEditor(this._instantiationService,this.modifiedEditorElement,i,t);return n.setContextValue("isInDiffRightEditor",!0),n}_constructInnerEditor(e,t,i,n){const o=this._createInnerEditor(e,t,i,n);return this._register(o.onDidContentSizeChange(r=>{const a=this.original.getContentWidth()+this.modified.getContentWidth()+Af.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})})),o}_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=hl.revealHorizontalRightPadding.defaultValue+Af.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.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){var t;e||(e="");const i=p("diff-aria-navigation-tip"," use {0} to open the accessibility help.",(t=this._keybindingService.lookupKeybinding("editor.action.accessibilityHelp"))===null||t===void 0?void 0:t.getAriaLabel());return this._options.accessibilityVerbose.get()?e+i:e?e.replaceAll(i,""):""}};wM=MSe([S7(5,Ne),S7(6,At)],wM);class gk extends H{constructor(){super(...arguments),this._id=++gk.idCounter,this._onDidDispose=this._register(new B),this.onDidDispose=this._onDidDispose.event}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)}}gk.idCounter=0;var RSe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},PSe=function(s,e){return function(t,i){e(t,i,s)}};let yM=class{get editorOptions(){return this._options}constructor(e,t){this._accessibilityService=t,this._diffEditorWidth=vt(this,0),this._screenReaderMode=Ot(this._accessibilityService.onDidChangeScreenReaderOptimized,()=>this._accessibilityService.isScreenReaderOptimized()),this.couldShowInlineViewBecauseOfSize=je(this,n=>this._options.read(n).renderSideBySide&&this._diffEditorWidth.read(n)<=this._options.read(n).renderSideBySideInlineBreakpoint),this.renderOverviewRuler=je(this,n=>this._options.read(n).renderOverviewRuler),this.renderSideBySide=je(this,n=>this._options.read(n).renderSideBySide&&!(this._options.read(n).useInlineViewWhenSpaceIsLimited&&this.couldShowInlineViewBecauseOfSize.read(n)&&!this._screenReaderMode.read(n))),this.readOnly=je(this,n=>this._options.read(n).readOnly),this.shouldRenderOldRevertArrows=je(this,n=>!(!this._options.read(n).renderMarginRevertIcon||!this.renderSideBySide.read(n)||this.readOnly.read(n)||this.shouldRenderGutterMenu.read(n))),this.shouldRenderGutterMenu=je(this,n=>this._options.read(n).renderGutterMenu),this.renderIndicators=je(this,n=>this._options.read(n).renderIndicators),this.enableSplitViewResizing=je(this,n=>this._options.read(n).enableSplitViewResizing),this.splitViewDefaultRatio=je(this,n=>this._options.read(n).splitViewDefaultRatio),this.ignoreTrimWhitespace=je(this,n=>this._options.read(n).ignoreTrimWhitespace),this.maxComputationTimeMs=je(this,n=>this._options.read(n).maxComputationTime),this.showMoves=je(this,n=>this._options.read(n).experimental.showMoves&&this.renderSideBySide.read(n)),this.isInEmbeddedEditor=je(this,n=>this._options.read(n).isInEmbeddedEditor),this.diffWordWrap=je(this,n=>this._options.read(n).diffWordWrap),this.originalEditable=je(this,n=>this._options.read(n).originalEditable),this.diffCodeLens=je(this,n=>this._options.read(n).diffCodeLens),this.accessibilityVerbose=je(this,n=>this._options.read(n).accessibilityVerbose),this.diffAlgorithm=je(this,n=>this._options.read(n).diffAlgorithm),this.showEmptyDecorations=je(this,n=>this._options.read(n).experimental.showEmptyDecorations),this.onlyShowAccessibleDiffViewer=je(this,n=>this._options.read(n).onlyShowAccessibleDiffViewer),this.hideUnchangedRegions=je(this,n=>this._options.read(n).hideUnchangedRegions.enabled),this.hideUnchangedRegionsRevealLineCount=je(this,n=>this._options.read(n).hideUnchangedRegions.revealLineCount),this.hideUnchangedRegionsContextLineCount=je(this,n=>this._options.read(n).hideUnchangedRegions.contextLineCount),this.hideUnchangedRegionsMinimumLineCount=je(this,n=>this._options.read(n).hideUnchangedRegions.minimumLineCount);const i={...e,...D7(e,es)};this._options=vt(this,i)}updateOptions(e){const t=D7(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)}};yM=RSe([PSe(1,gr)],yM);function D7(s,e){var t,i,n,o,r,a,l,d;return{enableSplitViewResizing:xe(s.enableSplitViewResizing,e.enableSplitViewResizing),splitViewDefaultRatio:Gse(s.splitViewDefaultRatio,.5,.1,.9),renderSideBySide:xe(s.renderSideBySide,e.renderSideBySide),renderMarginRevertIcon:xe(s.renderMarginRevertIcon,e.renderMarginRevertIcon),maxComputationTime:kg(s.maxComputationTime,e.maxComputationTime,0,1073741824),maxFileSize:kg(s.maxFileSize,e.maxFileSize,0,1073741824),ignoreTrimWhitespace:xe(s.ignoreTrimWhitespace,e.ignoreTrimWhitespace),renderIndicators:xe(s.renderIndicators,e.renderIndicators),originalEditable:xe(s.originalEditable,e.originalEditable),diffCodeLens:xe(s.diffCodeLens,e.diffCodeLens),renderOverviewRuler:xe(s.renderOverviewRuler,e.renderOverviewRuler),diffWordWrap:Ii(s.diffWordWrap,e.diffWordWrap,["off","on","inherit"]),diffAlgorithm:Ii(s.diffAlgorithm,e.diffAlgorithm,["legacy","advanced"],{smart:"legacy",experimental:"advanced"}),accessibilityVerbose:xe(s.accessibilityVerbose,e.accessibilityVerbose),experimental:{showMoves:xe((t=s.experimental)===null||t===void 0?void 0:t.showMoves,e.experimental.showMoves),showEmptyDecorations:xe((i=s.experimental)===null||i===void 0?void 0:i.showEmptyDecorations,e.experimental.showEmptyDecorations)},hideUnchangedRegions:{enabled:xe((o=(n=s.hideUnchangedRegions)===null||n===void 0?void 0:n.enabled)!==null&&o!==void 0?o:(r=s.experimental)===null||r===void 0?void 0:r.collapseUnchangedRegions,e.hideUnchangedRegions.enabled),contextLineCount:kg((a=s.hideUnchangedRegions)===null||a===void 0?void 0:a.contextLineCount,e.hideUnchangedRegions.contextLineCount,0,1073741824),minimumLineCount:kg((l=s.hideUnchangedRegions)===null||l===void 0?void 0:l.minimumLineCount,e.hideUnchangedRegions.minimumLineCount,0,1073741824),revealLineCount:kg((d=s.hideUnchangedRegions)===null||d===void 0?void 0:d.revealLineCount,e.hideUnchangedRegions.revealLineCount,0,1073741824)},isInEmbeddedEditor:xe(s.isInEmbeddedEditor,e.isInEmbeddedEditor),onlyShowAccessibleDiffViewer:xe(s.onlyShowAccessibleDiffViewer,e.onlyShowAccessibleDiffViewer),renderSideBySideInlineBreakpoint:kg(s.renderSideBySideInlineBreakpoint,e.renderSideBySideInlineBreakpoint,0,1073741824),useInlineViewWhenSpaceIsLimited:xe(s.useInlineViewWhenSpaceIsLimited,e.useInlineViewWhenSpaceIsLimited),renderGutterMenu:xe(s.renderGutterMenu,e.renderGutterMenu)}}var FSe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},J0=function(s,e){return function(t,i){e(t,i,s)}};let $c=class extends gk{get onDidContentSizeChange(){return this._editors.onDidContentSizeChange}constructor(e,t,i,n,o,r,a,l){var d;super(),this._domElement=e,this._parentContextKeyService=n,this._parentInstantiationService=o,this._accessibilitySignalService=a,this._editorProgressService=l,this.elements=Nt("div.monaco-diff-editor.side-by-side",{style:{position:"relative",height:"100%"}},[Nt("div.editor.original@original",{style:{position:"absolute",height:"100%"}}),Nt("div.editor.modified@modified",{style:{position:"absolute",height:"100%"}}),Nt("div.accessibleDiffViewer@accessibleDiffViewer",{style:{position:"absolute",height:"100%"}})]),this._diffModel=vt(this,void 0),this._shouldDisposeDiffModel=!1,this.onDidChangeModel=le.fromObservableLight(this._diffModel),this._contextKeyService=this._register(this._parentContextKeyService.createScoped(this._domElement)),this._instantiationService=this._parentInstantiationService.createChild(new L1([Be,this._contextKeyService])),this._boundarySashes=vt(this,void 0),this._accessibleDiffViewerShouldBeVisible=vt(this,!1),this._accessibleDiffViewerVisible=je(this,w=>this._options.onlyShowAccessibleDiffViewer.read(w)?!0:this._accessibleDiffViewerShouldBeVisible.read(w)),this._movedBlocksLinesPart=vt(this,void 0),this._layoutInfo=je(this,w=>{var y,D,L,k,I;const O=this._rootSizeObserver.width.read(w),R=this._rootSizeObserver.height.read(w),P=this._sash.read(w),F=this._gutter.read(w),V=(y=F==null?void 0:F.width.read(w))!==null&&y!==void 0?y:0,U=(L=(D=this._overviewRulerPart.read(w))===null||D===void 0?void 0:D.width)!==null&&L!==void 0?L:0;let J,pe,De,ge,We;if(!!P){const ve=P.sashLeft.read(w),ce=(I=(k=this._movedBlocksLinesPart.read(w))===null||k===void 0?void 0:k.width.read(w))!==null&&I!==void 0?I:0;J=0,pe=ve-V-ce,We=ve-V,De=ve,ge=O-De-U}else We=0,J=V,pe=Math.max(5,this._editors.original.getLayoutInfo().decorationsLeft),De=V+pe,ge=O-De-U;return this.elements.original.style.left=J+"px",this.elements.original.style.width=pe+"px",this._editors.original.layout({width:pe,height:R},!0),F==null||F.layout(We),this.elements.modified.style.left=De+"px",this.elements.modified.style.width=ge+"px",this._editors.modified.layout({width:ge,height:R},!0),{modifiedEditor:this._editors.modified.getLayoutInfo(),originalEditor:this._editors.original.getLayoutInfo()}}),this._diffValue=this._diffModel.map((w,y)=>w==null?void 0:w.diff.read(y)),this.onDidUpdateDiff=le.fromObservableLight(this._diffValue),r.willCreateDiffEditor(),this._contextKeyService.createKey("isInDiffEditor",!0),this._domElement.appendChild(this.elements.root),this._register(Ie(()=>this._domElement.removeChild(this.elements.root))),this._rootSizeObserver=this._register(new vK(this.elements.root,t.dimension)),this._rootSizeObserver.setAutomaticLayout((d=t.automaticLayout)!==null&&d!==void 0?d:!1),this._options=this._instantiationService.createInstance(yM,t),this._register(st(w=>{this._options.setWidth(this._rootSizeObserver.width.read(w))})),this._contextKeyService.createKey(T.isEmbeddedDiffEditor.key,!1),this._register(zd(T.isEmbeddedDiffEditor,this._contextKeyService,w=>this._options.isInEmbeddedEditor.read(w))),this._register(zd(T.comparingMovedCode,this._contextKeyService,w=>{var y;return!!(!((y=this._diffModel.read(w))===null||y===void 0)&&y.movedTextToCompare.read(w))})),this._register(zd(T.diffEditorRenderSideBySideInlineBreakpointReached,this._contextKeyService,w=>this._options.couldShowInlineViewBecauseOfSize.read(w))),this._register(zd(T.diffEditorInlineMode,this._contextKeyService,w=>!this._options.renderSideBySide.read(w))),this._register(zd(T.hasChanges,this._contextKeyService,w=>{var y,D,L;return((L=(D=(y=this._diffModel.read(w))===null||y===void 0?void 0:y.diff.read(w))===null||D===void 0?void 0:D.mappings.length)!==null&&L!==void 0?L:0)>0})),this._editors=this._register(this._instantiationService.createInstance(wM,this.elements.original,this.elements.modified,this._options,i,(w,y,D,L)=>this._createInnerEditor(w,y,D,L))),this._register(zd(T.diffEditorOriginalWritable,this._contextKeyService,w=>this._options.originalEditable.read(w))),this._register(zd(T.diffEditorModifiedWritable,this._contextKeyService,w=>!this._options.readOnly.read(w))),this._register(zd(T.diffEditorOriginalUri,this._contextKeyService,w=>{var y,D;return(D=(y=this._diffModel.read(w))===null||y===void 0?void 0:y.model.original.uri.toString())!==null&&D!==void 0?D:""})),this._register(zd(T.diffEditorModifiedUri,this._contextKeyService,w=>{var y,D;return(D=(y=this._diffModel.read(w))===null||y===void 0?void 0:y.model.modified.uri.toString())!==null&&D!==void 0?D:""})),this._overviewRulerPart=Gd(this,w=>this._options.renderOverviewRuler.read(w)?this._instantiationService.createInstance(ta(Af,w),this._editors,this.elements.root,this._diffModel,this._rootSizeObserver.width,this._rootSizeObserver.height,this._layoutInfo.map(y=>y.modifiedEditor)):void 0).recomputeInitiallyAndOnChange(this._store),this._sash=Gd(this,w=>{const y=this._options.renderSideBySide.read(w);return this.elements.root.classList.toggle("side-by-side",y),y?new pSe(this._options,this.elements.root,{height:this._rootSizeObserver.height,width:this._rootSizeObserver.width.map((D,L)=>{var k,I;return D-((I=(k=this._overviewRulerPart.read(L))===null||k===void 0?void 0:k.width)!==null&&I!==void 0?I:0)})},this._boundarySashes):void 0}).recomputeInitiallyAndOnChange(this._store);const c=Gd(this,w=>this._instantiationService.createInstance(ta(xC,w),this._editors,this._diffModel,this._options)).recomputeInitiallyAndOnChange(this._store);Gd(this,w=>this._instantiationService.createInstance(ta(fSe,w),this._editors,this._diffModel,this._options,this)).recomputeInitiallyAndOnChange(this._store);const u=new Set,h=new Set;let g=!1;const f=Gd(this,w=>this._instantiationService.createInstance(ta(_M,w),Te(this._domElement),this._editors,this._diffModel,this._options,this,()=>g||c.get().isUpdatingHiddenAreas,u,h)).recomputeInitiallyAndOnChange(this._store),m=je(this,w=>{const y=f.read(w).viewZones.read(w).orig,D=c.read(w).viewZones.read(w).origViewZones;return y.concat(D)}),_=je(this,w=>{const y=f.read(w).viewZones.read(w).mod,D=c.read(w).viewZones.read(w).modViewZones;return y.concat(D)});this._register(tL(this._editors.original,m,w=>{g=w},u));let v;this._register(tL(this._editors.modified,_,w=>{g=w,g?v=cl.capture(this._editors.modified):(v==null||v.restore(this._editors.modified),v=void 0)},h)),this._accessibleDiffViewer=Gd(this,w=>this._instantiationService.createInstance(ta(Zu,w),this.elements.accessibleDiffViewer,this._accessibleDiffViewerVisible,(y,D)=>this._accessibleDiffViewerShouldBeVisible.set(y,D),this._options.onlyShowAccessibleDiffViewer.map(y=>!y),this._rootSizeObserver.width,this._rootSizeObserver.height,this._diffModel.map((y,D)=>{var L;return(L=y==null?void 0:y.diff.read(D))===null||L===void 0?void 0:L.mappings.map(k=>k.lineRangeMapping)}),new lSe(this._editors))).recomputeInitiallyAndOnChange(this._store);const b=this._accessibleDiffViewerVisible.map(w=>w?"hidden":"visible");this._register(Oh(this.elements.modified,{visibility:b})),this._register(Oh(this.elements.original,{visibility:b})),this._createDiffEditorContributions(),r.addDiffEditor(this),this._gutter=Gd(this,w=>this._options.shouldRenderGutterMenu.read(w)?this._instantiationService.createInstance(ta(vM,w),this.elements.root,this._diffModel,this._editors):void 0),this._register(T1(this._layoutInfo)),Gd(this,w=>new(ta(hh,w))(this.elements.root,this._diffModel,this._layoutInfo.map(y=>y.originalEditor),this._layoutInfo.map(y=>y.modifiedEditor),this._editors)).recomputeInitiallyAndOnChange(this._store,w=>{this._movedBlocksLinesPart.set(w,void 0)}),this._register(le.runAndSubscribe(this._editors.modified.onDidChangeCursorPosition,w=>this._handleCursorPositionChange(w,!0))),this._register(le.runAndSubscribe(this._editors.original.onDidChangeCursorPosition,w=>this._handleCursorPositionChange(w,!1)));const C=this._diffModel.map(this,(w,y)=>{if(w)return w.diff.read(y)===void 0&&!w.isDiffUpToDate.read(y)});this._register(Hr((w,y)=>{if(C.read(w)===!0){const D=this._editorProgressService.show(!0,1e3);y.add(Ie(()=>D.done()))}})),this._register(Ie(()=>{var w;this._shouldDisposeDiffModel&&((w=this._diffModel.get())===null||w===void 0||w.dispose())})),this._register(Hr((w,y)=>{y.add(new(ta(NSe,w))(this._editors,this._diffModel,this._options,this))}))}_createInnerEditor(e,t,i,n){return e.createInstance(y_,t,i,n)}_createDiffEditorContributions(){const e=Im.getDiffEditorContributions();for(const t of e)try{this._register(this._instantiationService.createInstance(t.ctor,this))}catch(i){Xe(i)}}get _targetEditor(){return this._editors.modified}getEditorType(){return p1.IDiffEditor}layout(e){this._rootSizeObserver.observe(e)}hasTextFocus(){return this._editors.original.hasTextFocus()||this._editors.modified.hasTextFocus()}saveViewState(){var e;const t=this._editors.original.saveViewState(),i=this._editors.modified.saveViewState();return{original:t,modified:i,modelState:(e=this._diffModel.get())===null||e===void 0?void 0:e.serializeState()}}restoreViewState(e){var t;if(e&&e.original&&e.modified){const i=e;this._editors.original.restoreViewState(i.original),this._editors.modified.restoreViewState(i.modified),i.modelState&&((t=this._diffModel.get())===null||t===void 0||t.restoreSerializedState(i.modelState))}}handleInitialized(){this._editors.original.handleInitialized(),this._editors.modified.handleInitialized()}createViewModel(e){return this._instantiationService.createInstance(mM,e,this._options)}getModel(){var e,t;return(t=(e=this._diffModel.get())===null||e===void 0?void 0:e.model)!==null&&t!==void 0?t:null}setModel(e,t){!e&&this._diffModel.get()&&this._accessibleDiffViewer.get().close();const i=e?"model"in e?{model:e,shouldDispose:!1}:{model:this.createViewModel(e),shouldDispose:!0}:void 0;this._diffModel.get()!==(i==null?void 0:i.model)&&hC(t,n=>{var o;Ot.batchEventsGlobally(n,()=>{this._editors.original.setModel(i?i.model.model.original:null),this._editors.modified.setModel(i?i.model.model.modified:null)});const r=this._diffModel.get(),a=this._shouldDisposeDiffModel;this._shouldDisposeDiffModel=(o=i==null?void 0:i.shouldDispose)!==null&&o!==void 0?o:!1,this._diffModel.set(i==null?void 0:i.model,n),a&&(r==null||r.dispose())})}updateOptions(e){this._options.updateOptions(e)}getContainerDomNode(){return this._domElement}getOriginalEditor(){return this._editors.original}getModifiedEditor(){return this._editors.modified}getLineChanges(){var e;const t=(e=this._diffModel.get())===null||e===void 0?void 0:e.diff.get();return t?OSe(t):null}revert(e){const t=this._diffModel.get();!t||!t.isDiffUpToDate.get()||this._editors.modified.executeEdits("diffEditor",[{range:e.modified.toExclusiveRange(),text:t.model.original.getValueInRange(e.original.toExclusiveRange())}])}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.executeEdits("diffEditor",i)}_goTo(e){this._editors.modified.setPosition(new W(e.lineRangeMapping.modified.startLineNumber,1)),this._editors.modified.revealRangeInCenter(e.lineRangeMapping.modified.toExclusiveRange())}goToDiff(e){var t,i,n,o;const r=(i=(t=this._diffModel.get())===null||t===void 0?void 0:t.diff.get())===null||i===void 0?void 0:i.mappings;if(!r||r.length===0)return;const a=this._editors.modified.getPosition().lineNumber;let l;e==="next"?l=(n=r.find(d=>d.lineRangeMapping.modified.startLineNumber>a))!==null&&n!==void 0?n:r[0]:l=(o=YS(r,d=>d.lineRangeMapping.modified.startLineNumber{var t;const i=(t=e.diff.get())===null||t===void 0?void 0:t.mappings;!i||i.length===0||this._goTo(i[0])})}accessibleDiffViewerNext(){this._accessibleDiffViewer.get().next()}accessibleDiffViewerPrev(){this._accessibleDiffViewer.get().prev()}async waitForDiff(){const e=this._diffModel.get();e&&await e.waitForDiff()}mapToOtherSide(){var e,t;const i=this._editors.modified.hasWidgetFocus(),n=i?this._editors.modified:this._editors.original,o=i?this._editors.original:this._editors.modified;let r;const a=n.getSelection();if(a){const l=(t=(e=this._diffModel.get())===null||e===void 0?void 0:e.diff.get())===null||t===void 0?void 0:t.mappings.map(d=>i?d.lineRangeMapping.flip():d.lineRangeMapping);if(l){const d=a7(a.getStartPosition(),l),c=a7(a.getEndPosition(),l);r=x.plusRange(d,c)}}return{destination:o,destinationSelection:r}}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(){var e;const t=(e=this._diffModel.get())===null||e===void 0?void 0:e.unchangedRegions.get();t&&$t(i=>{for(const n of t)n.collapseAll(i)})}showAllUnchangedRegions(){var e;const t=(e=this._diffModel.get())===null||e===void 0?void 0:e.unchangedRegions.get();t&&$t(i=>{for(const n of t)n.showAll(i)})}_handleCursorPositionChange(e,t){var i,n;if((e==null?void 0:e.reason)===3){const o=(n=(i=this._diffModel.get())===null||i===void 0?void 0:i.diff.get())===null||n===void 0?void 0:n.mappings.find(r=>t?r.lineRangeMapping.modified.contains(e.position.lineNumber):r.lineRangeMapping.original.contains(e.position.lineNumber));o!=null&&o.lineRangeMapping.modified.isEmpty?this._accessibilitySignalService.playSignal(Ke.diffLineDeleted,{source:"diffEditor.cursorPositionChanged"}):o!=null&&o.lineRangeMapping.original.isEmpty?this._accessibilitySignalService.playSignal(Ke.diffLineInserted,{source:"diffEditor.cursorPositionChanged"}):o&&this._accessibilitySignalService.playSignal(Ke.diffLineModified,{source:"diffEditor.cursorPositionChanged"})}}};$c=FSe([J0(3,Be),J0(4,Ne),J0(5,xt),J0(6,rg),J0(7,sg)],$c);function OSe(s){return s.mappings.map(e=>{const t=e.lineRangeMapping;let i,n,o,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?(o=t.modified.startLineNumber-1,r=0,a=void 0):(o=t.modified.startLineNumber,r=t.modified.endLineNumberExclusive-1),{originalStartLineNumber:i,originalEndLineNumber:n,modifiedStartLineNumber:o,modifiedEndLineNumber:r,charChanges:a==null?void 0: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}))}})}var t4=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},ei=function(s,e){return function(t,i){e(t,i,s)}};let BSe=0,L7=!1;function WSe(s){if(!s){if(L7)return;L7=!0}fue(s||Ht.document.body)}let sL=class extends y_{constructor(e,t,i,n,o,r,a,l,d,c,u,h,g){const f={...t};f.ariaLabel=f.ariaLabel||LD.editorViewAccessibleLabel,f.ariaLabel=f.ariaLabel+";"+LD.accessibilityHelpMessage,super(e,f,{},i,n,o,r,d,c,u,h,g),l instanceof F_?this._standaloneKeybindingService=l:this._standaloneKeybindingService=null,WSe(f.ariaContainerElement),qbe((m,_)=>i.createInstance(S_,m,_,{})),Gbe(a)}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_"+ ++BSe,o=G.deserialize(i);return this._standaloneKeybindingService.addDynamicKeybinding(n,e,t,o),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"),H.None;const t=e.id,i=e.label,n=G.and(G.equals("editorId",this.getId()),G.deserialize(e.precondition)),o=e.keybindings,r=G.and(n,G.deserialize(e.keybindingContext)),a=e.contextMenuGroupId||null,l=e.contextMenuOrder||0,d=(g,...f)=>Promise.resolve(e.run(this,...f)),c=new Y,u=this.getId()+":"+t;if(c.add(pt.registerCommand(u,d)),a){const g={command:{id:u,title:i},when:n,group:a,order:l};c.add(yn.appendMenuItem(E.EditorContext,g))}if(Array.isArray(o))for(const g of o)c.add(this._standaloneKeybindingService.addDynamicKeybinding(u,g,d,r));const h=new u$(u,i,i,void 0,n,(...g)=>Promise.resolve(e.run(this,...g)),this._contextKeyService);return this._actions.set(t,h),c.add(Ie(()=>{this._actions.delete(t)})),c}_triggerCommand(e,t){if(this._codeEditorService instanceof _D)try{this._codeEditorService.setActiveCodeEditor(this),super._triggerCommand(e,t)}finally{this._codeEditorService.setActiveCodeEditor(null)}else super._triggerCommand(e,t)}};sL=t4([ei(2,Ne),ei(3,xt),ei(4,gi),ei(5,Be),ei(6,Md),ei(7,At),ei(8,_n),ei(9,en),ei(10,gr),ei(11,Yt),ei(12,Ce)],sL);let SM=class extends sL{constructor(e,t,i,n,o,r,a,l,d,c,u,h,g,f,m,_){const v={...t};QD(u,v,!1);const b=d.registerEditorContainer(e);typeof v.theme=="string"&&d.setTheme(v.theme),typeof v.autoDetectHighContrast<"u"&&d.setAutoDetectHighContrast(!!v.autoDetectHighContrast);const C=v.model;delete v.model,super(e,v,i,n,o,r,a,l,d,c,h,m,_),this._configurationService=u,this._standaloneThemeService=d,this._register(b);let w;if(typeof C>"u"){const y=f.getLanguageIdByMimeType(v.language)||v.language||ir;w=kK(g,f,v.value||"",y,void 0),this._ownsModel=!0}else w=C,this._ownsModel=!1;if(this._attachModel(w),w){const y={oldModelUrl:null,newModelUrl:w.uri};this._onDidChangeModel.fire(y)}}dispose(){super.dispose()}updateOptions(e){QD(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)}};SM=t4([ei(2,Ne),ei(3,xt),ei(4,gi),ei(5,Be),ei(6,Md),ei(7,At),ei(8,Sa),ei(9,en),ei(10,rt),ei(11,gr),ei(12,_i),ei(13,vi),ei(14,Yt),ei(15,Ce)],SM);let DM=class extends $c{constructor(e,t,i,n,o,r,a,l,d,c,u,h){const g={...t};QD(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,o,h,c),this._configurationService=l,this._standaloneThemeService=r,this._register(f)}dispose(){super.dispose()}updateOptions(e){QD(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(sL,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)}};DM=t4([ei(2,Ne),ei(3,Be),ei(4,xt),ei(5,Sa),ei(6,en),ei(7,rt),ei(8,Oo),ei(9,sg),ei(10,ru),ei(11,rg)],DM);function kK(s,e,t,i,n){if(t=t||"",!i){const o=t.indexOf(` `);let r=t;return o!==-1&&(r=t.substring(0,o)),x7(s,t,e.createByFilepathOrFirstLine(n||null,r),n)}return x7(s,t,e.createById(i),n)}function x7(s,e,t,i){return s.createModel(e,t,i)}var HSe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},VSe=function(s,e){return function(t,i){e(t,i,s)}};class zSe{constructor(e,t){this.viewModel=e,this.deltaScrollVertical=t}getId(){return this.viewModel}}let oL=class extends H{constructor(e,t,i,n){super(),this._container=e,this._overflowWidgetsDomNode=t,this._workbenchUIElementFactory=i,this._instantiationService=n,this._viewModel=vt(this,void 0),this._collapsed=je(this,r=>{var a;return(a=this._viewModel.read(r))===null||a===void 0?void 0:a.collapsed.read(r)}),this._editorContentHeight=vt(this,500),this.contentHeight=je(this,r=>(this._collapsed.read(r)?0:this._editorContentHeight.read(r))+this._outerEditorHeight),this._modifiedContentWidth=vt(this,0),this._modifiedWidth=vt(this,0),this._originalContentWidth=vt(this,0),this._originalWidth=vt(this,0),this.maxScroll=je(this,r=>{const a=this._modifiedContentWidth.read(r)-this._modifiedWidth.read(r),l=this._originalContentWidth.read(r)-this._originalWidth.read(r);return a>l?{maxScroll:a,width:this._modifiedWidth.read(r)}:{maxScroll:l,width:this._originalWidth.read(r)}}),this._elements=Nt("div.multiDiffEntry",[Nt("div.header@header",[Nt("div.header-content",[Nt("div.collapse-button@collapseButton"),Nt("div.file-path",[Nt("div.title.modified.show-file-icons@primaryPath",[]),Nt("div.status.deleted@status",["R"]),Nt("div.title.original.show-file-icons@secondaryPath",[])]),Nt("div.actions@actions")])]),Nt("div.editorParent",[Nt("div.editorContainer@editor")])]),this.editor=this._register(this._instantiationService.createInstance($c,this._elements.editor,{overflowWidgetsDomNode:this._overflowWidgetsDomNode},{})),this.isModifedFocused=k7(this.editor.getModifiedEditor()),this.isOriginalFocused=k7(this.editor.getOriginalEditor()),this.isFocused=je(this,r=>this.isModifedFocused.read(r)||this.isOriginalFocused.read(r)),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=new Y,this._headerHeight=40,this._lastScrollTop=-1,this._isSettingScrollTop=!1;const o=new KD(this._elements.collapseButton,{});this._register(st(r=>{o.element.className="",o.icon=this._collapsed.read(r)?oe.chevronRight:oe.chevronDown})),this._register(o.onDidClick(()=>{var r;(r=this._viewModel.get())===null||r===void 0||r.collapsed.set(!this._collapsed.get(),void 0)})),this._register(st(r=>{this._elements.editor.style.display=this._collapsed.read(r)?"none":"block"})),this._register(this.editor.getModifiedEditor().onDidLayoutChange(r=>{const a=this.editor.getModifiedEditor().getLayoutInfo().contentWidth;this._modifiedWidth.set(a,void 0)})),this._register(this.editor.getOriginalEditor().onDidLayoutChange(r=>{const a=this.editor.getOriginalEditor().getLayoutInfo().contentWidth;this._originalWidth.set(a,void 0)})),this._register(this.editor.onDidContentSizeChange(r=>{eS(a=>{this._editorContentHeight.set(r.contentHeight,a),this._modifiedContentWidth.set(this.editor.getModifiedEditor().getContentWidth(),a),this._originalContentWidth.set(this.editor.getOriginalEditor().getContentWidth(),a)})})),this._register(this.editor.getOriginalEditor().onDidScrollChange(r=>{if(this._isSettingScrollTop||!r.scrollTopChanged||!this._data)return;const a=r.scrollTop-this._lastScrollTop;this._data.deltaScrollVertical(a)})),this._register(st(r=>{var a;const l=(a=this._viewModel.read(r))===null||a===void 0?void 0:a.isActive.read(r);this._elements.root.classList.toggle("active",l)})),this._container.appendChild(this._elements.root),this._outerEditorHeight=this._headerHeight,this._register(this._instantiationService.createInstance(nL,this._elements.actions,E.MultiDiffEditorFileToolbar,{actionRunner:this._register(new DK(()=>{var r;return(r=this._viewModel.get())===null||r===void 0?void 0:r.modifiedUri})),menuOptions:{shouldForwardArgs:!0},toolbarOptions:{primaryGroup:r=>r.startsWith("navigation")},actionViewItemProvider:(r,a)=>kj(n,r,a)}))}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}}const i=e.viewModel.entry.value;i.onOptionsDidChange&&this._dataStore.add(i.onOptionsDidChange(()=>{var n;this.editor.updateOptions(t((n=i.options)!==null&&n!==void 0?n:{}))})),eS(n=>{var o,r,a,l;(o=this._resourceLabel)===null||o===void 0||o.setUri((r=e.viewModel.modifiedUri)!==null&&r!==void 0?r:e.viewModel.originalUri,{strikethrough:e.viewModel.modifiedUri===void 0});let d=!1,c=!1,u=!1,h="";e.viewModel.modifiedUri&&e.viewModel.originalUri&&e.viewModel.modifiedUri.path!==e.viewModel.originalUri.path?(h="R",d=!0):e.viewModel.modifiedUri?e.viewModel.originalUri||(h="A",u=!0):(h="D",c=!0),this._elements.status.classList.toggle("renamed",d),this._elements.status.classList.toggle("deleted",c),this._elements.status.classList.toggle("added",u),this._elements.status.innerText=h,(a=this._resourceLabel2)===null||a===void 0||a.setUri(d?e.viewModel.originalUri:void 0,{strikethrough:!0}),this._dataStore.clear(),this._viewModel.set(e.viewModel,n),this.editor.setModel(e.viewModel.diffEditorViewModel,n),this.editor.updateOptions(t((l=i.options)!==null&&l!==void 0?l:{}))})}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 o=e.length-this._headerHeight,r=Math.max(0,Math.min(n.start-e.start,o));this._elements.header.style.transform=`translateY(${r}px)`,eS(a=>{this.editor.layout({width:t-2*8-2*1,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===o)}hide(){this._elements.root.style.top="-100000px",this._elements.root.style.visibility="hidden"}};oL=HSe([VSe(3,Ne)],oL);function k7(s){return Ot(e=>{const t=new Y;return t.add(s.onDidFocusEditorWidget(()=>e(!0))),t.add(s.onDidBlurEditorWidget(()=>e(!1))),t},()=>s.hasTextFocus())}class USe{constructor(e){this._create=e,this._unused=new Set,this._used=new Set,this._itemData=new Map}getUnusedObj(e){var t;let i;if(this._unused.size===0)i=this._create(e),this._itemData.set(i,e);else{const n=[...this._unused.values()];i=(t=n.find(o=>this._itemData.get(o).getId()===e.getId()))!==null&&t!==void 0?t:n[0],this._unused.delete(i),this._itemData.set(i,e),i.setData(e)}return this._used.add(i),{object:i,dispose:()=>{this._used.delete(i),this._unused.size>5?i.dispose():this._unused.add(i)}}}dispose(){for(const e of this._used)e.dispose();for(const e of this._unused)e.dispose();this._used.clear(),this._unused.clear()}}var $Se=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},E7=function(s,e){return function(t,i){e(t,i,s)}};let LM=class extends H{constructor(e,t,i,n,o,r){super(),this._element=e,this._dimension=t,this._viewModel=i,this._workbenchUIElementFactory=n,this._parentContextKeyService=o,this._parentInstantiationService=r,this._elements=Nt("div.monaco-component.multiDiffEditor",[Nt("div@content",{style:{overflow:"hidden"}}),Nt("div.monaco-editor@overflowWidgetsDomNode",{})]),this._sizeObserver=this._register(new vK(this._element,void 0)),this._objectPool=this._register(new USe(l=>{const d=this._instantiationService.createInstance(oL,this._elements.content,this._elements.overflowWidgetsDomNode,this._workbenchUIElementFactory);return d.setData(l),d})),this._scrollable=this._register(new u0({forceIntegerValues:!1,scheduleAtNextAnimationFrame:l=>Ao(Te(this._element),l),smoothScrollDuration:100})),this._scrollableElement=this._register(new Lx(this._elements.root,{vertical:1,horizontal:1,useShadows:!1},this._scrollable)),this.scrollTop=Ot(this._scrollableElement.onScroll,()=>this._scrollableElement.getScrollPosition().scrollTop),this.scrollLeft=Ot(this._scrollableElement.onScroll,()=>this._scrollableElement.getScrollPosition().scrollLeft),this._viewItemsInfo=g0(this,(l,d)=>{const c=this._viewModel.read(l);if(!c)return{items:[],getItem:f=>{throw new Ut}};const u=c.items.read(l),h=new Map;return{items:u.map(f=>{var m;const _=d.add(new jSe(f,this._objectPool,this.scrollLeft,b=>{this._scrollableElement.setScrollPosition({scrollTop:this._scrollableElement.getScrollPosition().scrollTop+b})})),v=(m=this._lastDocStates)===null||m===void 0?void 0:m[_.getKey()];return v&&$t(b=>{_.setViewState(v,b)}),h.set(f,_),_}),getItem:f=>h.get(f)}}),this._viewItems=this._viewItemsInfo.map(this,l=>l.items),this._spaceBetweenPx=0,this._totalHeight=this._viewItems.map(this,(l,d)=>l.reduce((c,u)=>c+u.contentHeight.read(d)+this._spaceBetweenPx,0)),this._contextKeyService=this._register(this._parentContextKeyService.createScoped(this._element)),this._instantiationService=this._parentInstantiationService.createChild(new L1([Be,this._contextKeyService])),this._lastDocStates={},this._contextKeyService.createKey(T.inMultiDiffEditor.key,!0),this._register(Hr((l,d)=>{const c=this._viewModel.read(l);if(c&&c.contextKeys)for(const[u,h]of Object.entries(c.contextKeys)){const g=this._contextKeyService.createKey(u,void 0);g.set(h),d.add(Ie(()=>g.reset()))}}));const a=this._parentContextKeyService.createKey(T.multiDiffEditorAllCollapsed.key,!1);this._register(st(l=>{const d=this._viewModel.read(l);if(d){const c=d.items.read(l).every(u=>u.collapsed.read(l));a.set(c)}})),this._register(st(l=>{const d=this._dimension.read(l);this._sizeObserver.observe(d)})),this._elements.content.style.position="relative",this._register(st(l=>{const d=this._sizeObserver.height.read(l);this._elements.root.style.height=`${d}px`;const c=this._totalHeight.read(l);this._elements.content.style.height=`${c}px`;const u=this._sizeObserver.width.read(l);let h=u;const g=this._viewItems.read(l),f=wF(g,ao(m=>m.maxScroll.read(l).maxScroll,ua));if(f){const m=f.maxScroll.read(l);h=u+m.maxScroll}this._scrollableElement.setScrollDimensions({width:u,height:d,scrollHeight:c,scrollWidth:h})})),e.replaceChildren(this._scrollableElement.getDomNode()),this._register(Ie(()=>{e.replaceChildren()})),this._register(this._register(st(l=>{eS(d=>{this.render(l)})})))}render(e){const t=this.scrollTop.read(e);let i=0,n=0,o=0;const r=this._sizeObserver.height.read(e),a=et.ofStartAndLength(t,r),l=this._sizeObserver.width.read(e);for(const d of this._viewItems.read(e)){const c=d.contentHeight.read(e),u=Math.min(c,r),h=et.ofStartAndLength(n,u),g=et.ofStartAndLength(o,c);if(g.isBefore(a))i-=c-u,d.hide();else if(g.isAfter(a))d.hide();else{const f=Math.max(0,Math.min(a.start-g.start,c-u));i-=f;const m=et.ofStartAndLength(t+i,r);d.render(h,f,l,m)}n+=u+this._spaceBetweenPx,o+=c+this._spaceBetweenPx}this._elements.content.style.transform=`translateY(${-(t+i)}px)`}};LM=$Se([E7(4,Be),E7(5,Ne)],LM);class jSe extends H{constructor(e,t,i,n){super(),this.viewModel=e,this._objectPool=t,this._scrollLeft=i,this._deltaScrollVertical=n,this._templateRef=this._register(gC(this,void 0)),this.contentHeight=je(this,o=>{var r,a,l;return(l=(a=(r=this._templateRef.read(o))===null||r===void 0?void 0:r.object.contentHeight)===null||a===void 0?void 0:a.read(o))!==null&&l!==void 0?l:this.viewModel.lastTemplateData.read(o).contentHeight}),this.maxScroll=je(this,o=>{var r,a;return(a=(r=this._templateRef.read(o))===null||r===void 0?void 0:r.object.maxScroll.read(o))!==null&&a!==void 0?a:{maxScroll:0,scrollWidth:0}}),this.template=je(this,o=>{var r;return(r=this._templateRef.read(o))===null||r===void 0?void 0:r.object}),this._isHidden=vt(this,!1),this._isFocused=je(this,o=>{var r,a;return(a=(r=this.template.read(o))===null||r===void 0?void 0:r.isFocused.read(o))!==null&&a!==void 0?a:!1}),this.viewModel.setIsFocused(this._isFocused,void 0),this._register(st(o=>{var r;const a=this._scrollLeft.read(o);(r=this._templateRef.read(o))===null||r===void 0||r.object.setScrollLeft(a)})),this._register(st(o=>{const r=this._templateRef.read(o);!r||!this._isHidden.read(o)||r.object.isFocused.read(o)||this._clear()}))}dispose(){this._clear(),super.dispose()}toString(){var e;return`VirtualViewItem(${(e=this.viewModel.entry.value.modified)===null||e===void 0?void 0:e.uri.toString()})`}getKey(){return this.viewModel.getKey()}setViewState(e,t){var i;this.viewModel.collapsed.set(e.collapsed,t),this._updateTemplateData(t);const n=this.viewModel.lastTemplateData.get(),o=(i=e.selections)===null||i===void 0?void 0:i.map(we.liftSelection);this.viewModel.lastTemplateData.set({...n,selections:o},t);const r=this._templateRef.get();r&&o&&r.object.editor.setSelections(o)}_updateTemplateData(e){var t;const i=this._templateRef.get();i&&this.viewModel.lastTemplateData.set({contentHeight:i.object.contentHeight.get(),selections:(t=i.object.editor.getSelections())!==null&&t!==void 0?t:void 0},e)}_clear(){const e=this._templateRef.get();e&&$t(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 o=this._templateRef.get();if(!o){o=this._objectPool.getUnusedObj(new zSe(this.viewModel,this._deltaScrollVertical)),this._templateRef.set(o,void 0);const r=this.viewModel.lastTemplateData.get().selections;r&&o.object.editor.setSelections(r)}o.object.render(e,i,t,n)}}N("multiDiffEditor.headerBackground",{dark:"#262626",light:"tab.inactiveBackground",hcDark:"tab.inactiveBackground",hcLight:"tab.inactiveBackground"},p("multiDiffEditor.headerBackground","The background color of the diff editor's header"));N("multiDiffEditor.background",{dark:"editorBackground",light:"editorBackground",hcDark:"editorBackground",hcLight:"editorBackground"},p("multiDiffEditor.background","The background color of the multi file diff editor"));N("multiDiffEditor.border",{dark:"sideBarSectionHeader.border",light:"#cccccc",hcDark:"sideBarSectionHeader.border",hcLight:"#cccccc"},p("multiDiffEditor.border","The border color of the multi file diff editor"));var KSe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},qSe=function(s,e){return function(t,i){e(t,i,s)}};let xM=class extends H{constructor(e,t,i){super(),this._element=e,this._workbenchUIElementFactory=t,this._instantiationService=i,this._dimension=vt(this,void 0),this._viewModel=vt(this,void 0),this._widgetImpl=g0(this,(n,o)=>(ta(oL,n),o.add(this._instantiationService.createInstance(ta(LM,n),this._element,this._dimension,this._viewModel,this._workbenchUIElementFactory)))),this._register(T1(this._widgetImpl))}};xM=KSe([qSe(2,Ne)],xM);function GSe(s,e,t){return Fe.initialize(t||{}).createInstance(SM,s,e)}function ZSe(s){return Fe.get(xt).onCodeEditorAdd(t=>{s(t)})}function XSe(s){return Fe.get(xt).onDiffEditorAdd(t=>{s(t)})}function YSe(){return Fe.get(xt).listCodeEditors()}function QSe(){return Fe.get(xt).listDiffEditors()}function JSe(s,e,t){return Fe.initialize(t||{}).createInstance(DM,s,e)}function eDe(s,e){const t=Fe.initialize(e||{});return new xM(s,{},t)}function tDe(s){if(typeof s.id!="string"||typeof s.run!="function")throw new Error("Invalid command descriptor, `id` and `run` are required properties!");return pt.registerCommand(s.id,s.run)}function iDe(s){if(typeof s.id!="string"||typeof s.label!="string"||typeof s.run!="function")throw new Error("Invalid action descriptor, `id`, `label` and `run` are required properties!");const e=G.deserialize(s.precondition),t=(n,...o)=>mn.runEditorCommand(n,o,e,(r,a,l)=>Promise.resolve(s.run(a,...l))),i=new Y;if(i.add(pt.registerCommand(s.id,t)),s.contextMenuGroupId){const n={command:{id:s.id,title:s.label},when:e,group:s.contextMenuGroupId,order:s.contextMenuOrder||0};i.add(yn.appendMenuItem(E.EditorContext,n))}if(Array.isArray(s.keybindings)){const n=Fe.get(At);if(!(n instanceof F_))console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService");else{const o=G.and(e,G.deserialize(s.keybindingContext));i.add(n.addDynamicKeybindings(s.keybindings.map(r=>({keybinding:r,command:s.id,when:o}))))}}return i}function nDe(s){return EK([s])}function EK(s){const e=Fe.get(At);return e instanceof F_?e.addDynamicKeybindings(s.map(t=>({keybinding:t.keybinding,command:t.command,commandArgs:t.commandArgs,when:G.deserialize(t.when)}))):(console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService"),H.None)}function sDe(s,e,t){const i=Fe.get(vi),n=i.getLanguageIdByMimeType(e)||e;return kK(Fe.get(_i),i,s,n,t)}function oDe(s,e){const t=Fe.get(vi),i=t.getLanguageIdByMimeType(e)||e||ir;s.setLanguage(t.createById(i))}function rDe(s,e,t){s&&Fe.get(Pd).changeOne(e,s.uri,t)}function aDe(s){Fe.get(Pd).changeAll(s,[])}function lDe(s){return Fe.get(Pd).read(s)}function dDe(s){return Fe.get(Pd).onMarkerChanged(s)}function cDe(s){return Fe.get(_i).getModel(s)}function uDe(){return Fe.get(_i).getModels()}function hDe(s){return Fe.get(_i).onModelAdded(s)}function gDe(s){return Fe.get(_i).onModelRemoved(s)}function fDe(s){return Fe.get(_i).onModelLanguageChanged(t=>{s({model:t.model,oldLanguage:t.oldLanguageId})})}function pDe(s){return Vce(Fe.get(_i),Fe.get(Yt),s)}function mDe(s,e){const t=Fe.get(vi),i=Fe.get(Sa);return IF.colorizeElement(i,t,s,e).then(()=>{i.registerEditorContainer(s)})}function _De(s,e,t){const i=Fe.get(vi);return Fe.get(Sa).registerEditorContainer(Ht.document.body),IF.colorize(i,s,e,t)}function vDe(s,e,t=4){return Fe.get(Sa).registerEditorContainer(Ht.document.body),IF.colorizeModelLine(s,e,t)}function bDe(s){const e=Ki.get(s);return e||{getInitialState:()=>Ub,tokenize:(t,i,n)=>mU(s,n)}}function CDe(s,e){Ki.getOrCreate(e);const t=bDe(e),i=Td(s),n=[];let o=t.getInitialState();for(let r=0,a=i.length;r{var o;if(!i)return null;const r=(o=t.options)===null||o===void 0?void 0:o.selection;let a;return r&&typeof r.endLineNumber=="number"&&typeof r.endColumn=="number"?a=r:r&&(a={lineNumber:r.startLineNumber,column:r.startColumn}),await s.openCodeEditor(i,t.resource,a)?i:null})}function kDe(){return{create:GSe,getEditors:YSe,getDiffEditors:QSe,onDidCreateEditor:ZSe,onDidCreateDiffEditor:XSe,createDiffEditor:JSe,addCommand:tDe,addEditorAction:iDe,addKeybindingRule:nDe,addKeybindingRules:EK,createModel:sDe,setModelLanguage:oDe,setModelMarkers:rDe,getModelMarkers:lDe,removeAllMarkers:aDe,onDidChangeMarkers:dDe,getModels:uDe,getModel:cDe,onDidCreateModel:hDe,onWillDisposeModel:gDe,onDidChangeModelLanguage:fDe,createWebWorker:pDe,colorizeElement:mDe,colorize:_De,colorizeModelLine:vDe,tokenize:CDe,defineTheme:wDe,setTheme:yDe,remeasureFonts:SDe,registerCommand:DDe,registerLinkOpener:LDe,registerEditorOpener:xDe,AccessibilitySupport:oN,ContentWidgetPositionPreference:uN,CursorChangeReason:hN,DefaultEndOfLine:gN,EditorAutoIndentStrategy:pN,EditorOption:mN,EndOfLinePreference:_N,EndOfLineSequence:vN,MinimapPosition:IN,MinimapSectionHeaderStyle:TN,MouseTargetType:NN,OverlayWidgetPositionPreference:RN,OverviewRulerLane:PN,GlyphMarginLane:bN,RenderLineNumbersType:BN,RenderMinimap:WN,ScrollbarVisibility:VN,ScrollType:HN,TextEditorCursorBlinkingStyle:qN,TextEditorCursorStyle:GN,TrackedRangeStickiness:ZN,WrappingIndent:XN,InjectedTextCursorStops:yN,PositionAffinity:ON,ShowLightbulbIconMode:UN,ConfigurationChangedEvent:HV,BareFontInfo:rf,FontInfo:rA,TextModelResolvedOptions:Vy,FindMatch:Wb,ApplyUpdateResult:Hv,EditorZoom:Sr,createMultiFileDiffEditor:eDe,EditorType:p1,EditorOptions:hl}}function EDe(s,e){if(!e||!Array.isArray(e))return!1;for(const t of e)if(!s(t))return!1;return!0}function iy(s,e){return typeof s=="boolean"?s:e}function I7(s,e){return typeof s=="string"?s:e}function IDe(s){const e={};for(const t of s)e[t]=!0;return e}function T7(s,e=!1){e&&(s=s.map(function(i){return i.toLowerCase()}));const t=IDe(s);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 kM(s,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 s[a]=="string")l=s[a];else if(s[a]&&s[a]instanceof RegExp)l=s[a].source;else throw s[a]===void 0?ai(s,"language definition does not contain attribute '"+a+"', used at: "+e):ai(s,"attribute reference '"+a+"' must be a string, used at: "+e);return Og(l)?"":"(?:"+l+")"}),i++;while(n&&i<5);e=e.replace(/\x01/g,"@");const o=(s.ignoreCase?"i":"")+(s.unicode?"u":"");if(t&&e.match(/\$[sS](\d\d?)/g)){let a=null,l=null;return d=>(l&&a===d||(a=d,l=new RegExp(rue(s,e,d),o)),l)}return new RegExp(e,o)}function TDe(s,e,t,i){if(i<0)return s;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 ai(s,"a 'bracket' attribute must be either '@open' or '@close', in rule: "+e);if(t.next){if(typeof t.next!="string")throw ai(s,"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&&!aue(s,Tu(s,n,"",[],""))))throw ai(s,"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,s.usesEmbedded=!0),i}}else if(Array.isArray(t)){const i=[];for(let n=0,o=t.length;n0&&i[0]==="^",this.name=this.name+": "+i,this.regex=kM(e,"^(?:"+(this.matchOnlyAtLineStart?i.substr(1):i)+")",!0)}setAction(e,t){this.action=EM(e,this.name,t)}resolveRegex(e){return this.regex instanceof RegExp?this.regex:this.regex(e)}}function IK(s,e){if(!e||typeof e!="object")throw new Error("Monarch: expecting a language definition object");const t={};t.languageId=s,t.includeLF=iy(e.includeLF,!1),t.noThrow=!1,t.maxStack=100,t.start=typeof e.start=="string"?e.start:null,t.ignoreCase=iy(e.ignoreCase,!1),t.unicode=iy(e.unicode,!1),t.tokenPostfix=I7(e.tokenPostfix,"."+t.languageId),t.defaultToken=I7(e.defaultToken,"source"),t.usesEmbedded=!1;const i=e;i.languageId=s,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 d of l){let c=d.include;if(c){if(typeof c!="string")throw ai(t,"an 'include' attribute must be a string at: "+r);if(c[0]==="@"&&(c=c.substr(1)),!e.tokenizer[c])throw ai(t,"include target '"+c+"' is not defined at: "+r);n(r+"."+c,a,e.tokenizer[c])}else{const u=new ADe(r);if(Array.isArray(d)&&d.length>=1&&d.length<=3)if(u.setRegex(i,d[0]),d.length>=3)if(typeof d[1]=="string")u.setAction(i,{token:d[1],next:d[2]});else if(typeof d[1]=="object"){const h=d[1];h.next=d[2],u.setAction(i,h)}else throw ai(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 u.setAction(i,d[1]);else{if(!d.regex)throw ai(t,"a rule must either be an array, or an object with a 'regex' or 'include' field at: "+r);d.name&&typeof d.name=="string"&&(u.name=d.name),d.matchOnlyAtStart&&(u.matchOnlyAtLineStart=iy(d.matchOnlyAtLineStart,!1)),u.setRegex(i,d.regex),u.setAction(i,d.action)}a.push(u)}}}if(!e.tokenizer||typeof e.tokenizer!="object")throw ai(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 ai(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 o=[];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 ai(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")o.push({token:a.token+t.tokenPostfix,open:Tc(t,a.open),close:Tc(t,a.close)});else throw ai(t,"every element in the 'brackets' array must be a '{open,close,token}' object or array")}return t.brackets=o,t.noThrow=!0,t}function MDe(s){h_.registerLanguage(s)}function RDe(){let s=[];return s=s.concat(h_.getLanguages()),s}function PDe(s){return Fe.get(vi).languageIdCodec.encodeLanguageId(s)}function FDe(s,e){return Fe.withServices(()=>{const i=Fe.get(vi).onDidRequestRichLanguageFeatures(n=>{n===s&&(i.dispose(),e())});return i})}function ODe(s,e){return Fe.withServices(()=>{const i=Fe.get(vi).onDidRequestBasicLanguageFeatures(n=>{n===s&&(i.dispose(),e())});return i})}function BDe(s,e){if(!Fe.get(vi).isRegisteredLanguageId(s))throw new Error(`Cannot set configuration for unknown language ${s}`);return Fe.get(Yt).register(s,e,100)}class WDe{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 EC.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 KL(n.tokens,n.endState)}}class EC{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 o=0,r=e.length;o0&&o[r-1]===h)continue;let g=u.startIndex;d===0?g=0:g{const i=await Promise.resolve(e.create());return i?HDe(i)?NK(s,i):new Kb(Fe.get(vi),Fe.get(Sa),s,IK(s,i),Fe.get(rt)):null});return Ki.registerFactory(s,t)}function UDe(s,e){if(!Fe.get(vi).isRegisteredLanguageId(s))throw new Error(`Cannot set tokens provider for unknown language ${s}`);return TK(e)?i4(s,{create:()=>e}):Ki.register(s,NK(s,e))}function $De(s,e){const t=i=>new Kb(Fe.get(vi),Fe.get(Sa),s,IK(s,i),Fe.get(rt));return TK(e)?i4(s,{create:()=>e}):Ki.register(s,t(e))}function jDe(s,e){return Fe.get(Ce).referenceProvider.register(s,e)}function KDe(s,e){return Fe.get(Ce).renameProvider.register(s,e)}function qDe(s,e){return Fe.get(Ce).newSymbolNamesProvider.register(s,e)}function GDe(s,e){return Fe.get(Ce).signatureHelpProvider.register(s,e)}function ZDe(s,e){return Fe.get(Ce).hoverProvider.register(s,{provideHover:async(i,n,o,r)=>{const a=i.getWordAtPosition(n);return Promise.resolve(e.provideHover(i,n,o,r)).then(l=>{if(l)return!l.range&&a&&(l.range=new x(n.lineNumber,a.startColumn,n.lineNumber,a.endColumn)),l.range||(l.range=new x(n.lineNumber,n.column,n.lineNumber,n.column)),l})}})}function XDe(s,e){return Fe.get(Ce).documentSymbolProvider.register(s,e)}function YDe(s,e){return Fe.get(Ce).documentHighlightProvider.register(s,e)}function QDe(s,e){return Fe.get(Ce).linkedEditingRangeProvider.register(s,e)}function JDe(s,e){return Fe.get(Ce).definitionProvider.register(s,e)}function eLe(s,e){return Fe.get(Ce).implementationProvider.register(s,e)}function tLe(s,e){return Fe.get(Ce).typeDefinitionProvider.register(s,e)}function iLe(s,e){return Fe.get(Ce).codeLensProvider.register(s,e)}function nLe(s,e,t){return Fe.get(Ce).codeActionProvider.register(s,{providedCodeActionKinds:t==null?void 0:t.providedCodeActionKinds,documentation:t==null?void 0:t.documentation,provideCodeActions:(n,o,r,a)=>{const d=Fe.get(Pd).read({resource:n.uri}).filter(c=>x.areIntersectingOrTouching(c,o));return e.provideCodeActions(n,o,{markers:d,only:r.only,trigger:r.trigger},a)},resolveCodeAction:e.resolveCodeAction})}function sLe(s,e){return Fe.get(Ce).documentFormattingEditProvider.register(s,e)}function oLe(s,e){return Fe.get(Ce).documentRangeFormattingEditProvider.register(s,e)}function rLe(s,e){return Fe.get(Ce).onTypeFormattingEditProvider.register(s,e)}function aLe(s,e){return Fe.get(Ce).linkProvider.register(s,e)}function lLe(s,e){return Fe.get(Ce).completionProvider.register(s,e)}function dLe(s,e){return Fe.get(Ce).colorProvider.register(s,e)}function cLe(s,e){return Fe.get(Ce).foldingRangeProvider.register(s,e)}function uLe(s,e){return Fe.get(Ce).declarationProvider.register(s,e)}function hLe(s,e){return Fe.get(Ce).selectionRangeProvider.register(s,e)}function gLe(s,e){return Fe.get(Ce).documentSemanticTokensProvider.register(s,e)}function fLe(s,e){return Fe.get(Ce).documentRangeSemanticTokensProvider.register(s,e)}function pLe(s,e){return Fe.get(Ce).inlineCompletionsProvider.register(s,e)}function mLe(s,e){return Fe.get(Ce).inlineEditProvider.register(s,e)}function _Le(s,e){return Fe.get(Ce).inlayHintsProvider.register(s,e)}function vLe(){return{register:MDe,getLanguages:RDe,onLanguage:FDe,onLanguageEncountered:ODe,getEncodedLanguageId:PDe,setLanguageConfiguration:BDe,setColorMap:zDe,registerTokensProviderFactory:i4,setTokensProvider:UDe,setMonarchTokensProvider:$De,registerReferenceProvider:jDe,registerRenameProvider:KDe,registerNewSymbolNameProvider:qDe,registerCompletionItemProvider:lLe,registerSignatureHelpProvider:GDe,registerHoverProvider:ZDe,registerDocumentSymbolProvider:XDe,registerDocumentHighlightProvider:YDe,registerLinkedEditingRangeProvider:QDe,registerDefinitionProvider:JDe,registerImplementationProvider:eLe,registerTypeDefinitionProvider:tLe,registerCodeLensProvider:iLe,registerCodeActionProvider:nLe,registerDocumentFormattingEditProvider:sLe,registerDocumentRangeFormattingEditProvider:oLe,registerOnTypeFormattingEditProvider:rLe,registerLinkProvider:aLe,registerColorProvider:dLe,registerFoldingRangeProvider:cLe,registerDeclarationProvider:uLe,registerSelectionRangeProvider:hLe,registerDocumentSemanticTokensProvider:gLe,registerDocumentRangeSemanticTokensProvider:fLe,registerInlineCompletionsProvider:pLe,registerInlineEditProvider:mLe,registerInlayHintsProvider:_Le,DocumentHighlightKind:fN,CompletionItemKind:lN,CompletionItemTag:dN,CompletionItemInsertTextRule:aN,SymbolKind:jN,SymbolTag:KN,IndentAction:wN,CompletionTriggerKind:cN,SignatureHelpTriggerKind:$N,InlayHintKind:SN,InlineCompletionTriggerKind:DN,InlineEditTriggerKind:LN,CodeActionTriggerType:rN,NewSymbolNameTag:AN,NewSymbolNameTriggerKind:MN,PartialAcceptTriggerKind:FN,HoverVerbosityAction:CN,FoldingRangeKind:Ps,SelectedSuggestionInfo:tz}}const n4=ut("IEditorCancelService"),AK=new ue("cancellableOperation",!1,p("cancellableOperation","Whether the editor runs a cancellable operation, e.g. like 'Peek References'"));mt(n4,class{constructor(){this._tokens=new WeakMap}add(s,e){let t=this._tokens.get(s);t||(t=s.invokeWithinContext(n=>{const o=AK.bindTo(n.get(Be)),r=new Rs;return{key:o,tokens:r}}),this._tokens.set(s,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(s){const e=this._tokens.get(s);if(!e)return;const t=e.tokens.pop();t&&(t.cancel(),e.key.set(!e.tokens.isEmpty()))}},1);class bLe extends Vi{constructor(e,t){super(t),this.editor=e,this._unregister=e.invokeWithinContext(i=>i.get(n4).add(e,this))}dispose(){this._unregister(),super.dispose()}}de(new class extends mn{constructor(){super({id:"editor.cancelOperation",kbOpts:{weight:100,primary:9},precondition:AK})}runEditorCommand(s,e){s.get(n4).cancel(e)}});let MK=class IM{constructor(e,t){if(this.flags=t,this.flags&1){const i=e.getModel();this.modelVersionId=i?l_("{0}#{1}",i.uri.toString(),i.getVersionId()):null}else this.modelVersionId=null;this.flags&4?this.position=e.getPosition():this.position=null,this.flags&2?this.selection=e.getSelection():this.selection=null,this.flags&8?(this.scrollLeft=e.getScrollLeft(),this.scrollTop=e.getScrollTop()):(this.scrollLeft=-1,this.scrollTop=-1)}_equals(e){if(!(e instanceof IM))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 IM(e,this.flags))}};class Bh extends bLe{constructor(e,t,i,n){super(e,n),this._listener=new Y,t&4&&this._listener.add(e.onDidChangeCursorPosition(o=>{(!i||!x.containsPosition(i,o.position))&&this.cancel()})),t&2&&this._listener.add(e.onDidChangeCursorSelection(o=>{(!i||!x.containsRange(i,o.selection))&&this.cancel()})),t&8&&this._listener.add(e.onDidScrollChange(o=>this.cancel())),t&1&&(this._listener.add(e.onDidChangeModel(o=>this.cancel())),this._listener.add(e.onDidChangeModelContent(o=>this.cancel())))}dispose(){this._listener.dispose(),super.dispose()}}class s4 extends Vi{constructor(e,t){super(t),this._listener=e.onDidChangeContent(()=>this.cancel())}dispose(){this._listener.dispose(),super.dispose()}}function Wh(s){return s&&typeof s.getEditorType=="function"?s.getEditorType()===p1.ICodeEditor:!1}function CLe(s){return s&&typeof s.getEditorType=="function"?s.getEditorType()===p1.IDiffEditor:!1}class B_{static _handleEolEdits(e,t){let i;const n=[];for(const o of t)typeof o.eol=="number"&&(i=o.eol),o.range&&typeof o.text=="string"&&n.push(o);return typeof i=="number"&&e.hasModel()&&e.getModel().pushEOL(i),n}static _isFullModelReplaceEdit(e,t){if(!e.hasModel())return!1;const i=e.getModel(),n=i.validateRange(t.range);return i.getFullModelRange().equalsRange(n)}static execute(e,t,i){i&&e.pushUndoStop();const n=cl.capture(e),o=B_._handleEolEdits(e,t);o.length===1&&B_._isFullModelReplaceEdit(e,o[0])?e.executeEdits("formatEditsCommand",o.map(r=>pi.replace(x.lift(r.range),r.text))):e.executeEdits("formatEditsCommand",o.map(r=>pi.replaceMove(x.lift(r.range),r.text))),i&&e.pushUndoStop(),n.restoreRelativeVerticalPositionOfCursor(e)}}class N7{constructor(e){this.value=e,this._lower=e.toLowerCase()}static toKey(e){return typeof e=="string"?e.toLowerCase():e._lower}}class wLe{constructor(e){if(this._set=new Set,e)for(const t of e)this.add(t)}add(e){this._set.add(N7.toKey(e))}has(e){return this._set.has(N7.toKey(e))}}function RK(s,e,t){const i=[],n=new wLe,o=s.ordered(t);for(const a of o)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,d,c){return a.provideDocumentRangeFormattingEdits(l,l.getFullModelRange(),d,c)}})}return i}class Mf{static setFormatterSelector(e){return{dispose:Mf._selectors.unshift(e)}}static async select(e,t,i,n){if(e.length===0)return;const o=ft.first(Mf._selectors);if(o)return await o(e,t,i,n)}}Mf._selectors=new Rs;async function PK(s,e,t,i,n,o,r){const a=s.get(Ne),{documentRangeFormattingEditProvider:l}=s.get(Ce),d=Wh(e)?e.getModel():e,c=l.ordered(d),u=await Mf.select(c,d,i,2);u&&(n.report(u),await a.invokeFunction(yLe,u,e,t,o,r))}async function yLe(s,e,t,i,n,o){var r,a;const l=s.get(jr),d=s.get(ys),c=s.get(rg);let u,h;Wh(t)?(u=t.getModel(),h=new Bh(t,5,void 0,n)):(u=t,h=new s4(t,n));const g=[];let f=0;for(const C of OP(i).sort(x.compareRangesUsingStarts))f>0&&x.areIntersectingOrTouching(g[f-1],C)?g[f-1]=x.fromPositions(g[f-1].getStartPosition(),C.getEndPosition()):f=g.push(C);const m=async C=>{var w,y;d.trace("[format][provideDocumentRangeFormattingEdits] (request)",(w=e.extensionId)===null||w===void 0?void 0:w.value,C);const D=await e.provideDocumentRangeFormattingEdits(u,C,u.getFormattingOptions(),h.token)||[];return d.trace("[format][provideDocumentRangeFormattingEdits] (response)",(y=e.extensionId)===null||y===void 0?void 0:y.value,D),D},_=(C,w)=>{if(!C.length||!w.length)return!1;const y=C.reduce((D,L)=>x.plusRange(D,L.range),C[0].range);if(!w.some(D=>x.intersectRanges(y,D.range)))return!1;for(const D of C)for(const L of w)if(x.intersectRanges(D.range,L.range))return!0;return!1},v=[],b=[];try{if(typeof e.provideDocumentRangesFormattingEdits=="function"){d.trace("[format][provideDocumentRangeFormattingEdits] (request)",(r=e.extensionId)===null||r===void 0?void 0:r.value,g);const C=await e.provideDocumentRangesFormattingEdits(u,g,u.getFormattingOptions(),h.token)||[];d.trace("[format][provideDocumentRangeFormattingEdits] (response)",(a=e.extensionId)===null||a===void 0?void 0:a.value,C),b.push(C)}else{for(const C of g){if(h.token.isCancellationRequested)return!0;b.push(await m(C))}for(let C=0;C({text:y.text,range:x.lift(y.range),forceMoveMarkers:!0})),y=>{for(const{range:D}of y)if(x.areIntersectingOrTouching(D,w))return[new we(D.startLineNumber,D.startColumn,D.endLineNumber,D.endColumn)];return null})}return c.playSignal(Ke.format,{userGesture:o}),!0}async function SLe(s,e,t,i,n,o){const r=s.get(Ne),a=s.get(Ce),l=Wh(e)?e.getModel():e,d=RK(a.documentFormattingEditProvider,a.documentRangeFormattingEditProvider,l),c=await Mf.select(d,l,t,1);c&&(i.report(c),await r.invokeFunction(DLe,c,e,t,n,o))}async function DLe(s,e,t,i,n,o){const r=s.get(jr),a=s.get(rg);let l,d;Wh(t)?(l=t.getModel(),d=new Bh(t,5,void 0,n)):(l=t,d=new s4(t,n));let c;try{const u=await e.provideDocumentFormattingEdits(l,l.getFormattingOptions(),d.token);if(c=await r.computeMoreMinimalEdits(l.uri,u),d.token.isCancellationRequested)return!0}finally{d.dispose()}if(!c||c.length===0)return!1;if(Wh(t))B_.execute(t,c,i!==2),i!==2&&t.revealPositionInCenterIfOutsideViewport(t.getPosition(),1);else{const[{range:u}]=c,h=new we(u.startLineNumber,u.startColumn,u.endLineNumber,u.endColumn);l.pushEditOperations([h],c.map(g=>({text:g.text,range:x.lift(g.range),forceMoveMarkers:!0})),g=>{for(const{range:f}of g)if(x.areIntersectingOrTouching(f,h))return[new we(f.startLineNumber,f.startColumn,f.endLineNumber,f.endColumn)];return null})}return a.playSignal(Ke.format,{userGesture:o}),!0}async function LLe(s,e,t,i,n,o){const r=e.documentRangeFormattingEditProvider.ordered(t);for(const a of r){const l=await Promise.resolve(a.provideDocumentRangeFormattingEdits(t,i,n,o)).catch(Ai);if(rs(l))return await s.computeMoreMinimalEdits(t.uri,l)}}async function xLe(s,e,t,i,n){const o=RK(e.documentFormattingEditProvider,e.documentRangeFormattingEditProvider,t);for(const r of o){const a=await Promise.resolve(r.provideDocumentFormattingEdits(t,i,n)).catch(Ai);if(rs(a))return await s.computeMoreMinimalEdits(t.uri,a)}}function FK(s,e,t,i,n,o,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,o,r)).catch(Ai).then(l=>s.computeMoreMinimalEdits(t.uri,l))}pt.registerCommand("_executeFormatRangeProvider",async function(s,...e){const[t,i,n]=e;yt(Ae.isUri(t)),yt(x.isIRange(i));const o=s.get(mo),r=s.get(jr),a=s.get(Ce),l=await o.createModelReference(t);try{return LLe(r,a,l.object.textEditorModel,x.lift(i),n,dt.None)}finally{l.dispose()}});pt.registerCommand("_executeFormatDocumentProvider",async function(s,...e){const[t,i]=e;yt(Ae.isUri(t));const n=s.get(mo),o=s.get(jr),r=s.get(Ce),a=await n.createModelReference(t);try{return xLe(o,r,a.object.textEditorModel,i,dt.None)}finally{a.dispose()}});pt.registerCommand("_executeFormatOnTypeProvider",async function(s,...e){const[t,i,n,o]=e;yt(Ae.isUri(t)),yt(W.isIPosition(i)),yt(typeof n=="string");const r=s.get(mo),a=s.get(jr),l=s.get(Ce),d=await r.createModelReference(t);try{return FK(a,l,d.object.textEditorModel,W.lift(i),n,o,dt.None)}finally{d.dispose()}});hl.wrappingIndent.defaultValue=0;hl.glyphMargin.defaultValue=!1;hl.autoIndent.defaultValue=3;hl.overviewRulerLanes.defaultValue=2;Mf.setFormatterSelector((s,e,t)=>Promise.resolve(s[0]));const Ys=iz();Ys.editor=kDe();Ys.languages=vLe();const kLe=Ys.CancellationTokenSource,OK=Ys.Emitter,ELe=Ys.KeyCode,ILe=Ys.KeyMod,TLe=Ys.Position,NLe=Ys.Range,ALe=Ys.Selection,MLe=Ys.SelectionDirection,RLe=Ys.MarkerSeverity,PLe=Ys.MarkerTag,FLe=Ys.Uri,OLe=Ys.Token,BLe=Ys.editor,O1=Ys.languages,eT=globalThis.MonacoEnvironment;(eT!=null&&eT.globalAPI||typeof define=="function"&&define.amd)&&(globalThis.monaco=Ys);typeof globalThis.require<"u"&&typeof globalThis.require.config=="function"&&globalThis.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 _0=Object.freeze(Object.defineProperty({__proto__:null,CancellationTokenSource:kLe,Emitter:OK,KeyCode:ELe,KeyMod:ILe,MarkerSeverity:RLe,MarkerTag:PLe,Position:TLe,Range:NLe,Selection:ALe,SelectionDirection:MLe,Token:OLe,Uri:FLe,editor:BLe,languages:O1},Symbol.toStringTag,{value:"Module"}));/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.49.0(383fdf3fc0e1e1a024068b8d0fd4f3dcbae74d04) * Released under the MIT license * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt *-----------------------------------------------------------------------------*/var WLe=Object.defineProperty,HLe=Object.getOwnPropertyDescriptor,VLe=Object.getOwnPropertyNames,zLe=Object.prototype.hasOwnProperty,ULe=(s,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of VLe(e))!zLe.call(s,n)&&n!==t&&WLe(s,n,{get:()=>e[n],enumerable:!(i=HLe(e,n))||i.enumerable});return s},$Le=(s,e,t)=>(ULe(s,e,"default"),t),Iv={};$Le(Iv,_0);var BK={},tT={},jLe=class WK{static getOrCreate(e){return tT[e]||(tT[e]=new WK(e)),tT[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,BK[this._languageId].loader().then(e=>this._lazyLoadPromiseResolve(e),e=>this._lazyLoadPromiseReject(e))),this._lazyLoadPromise}};function pp(s){const e=s.id;BK[e]=s,Iv.languages.register(s);const t=jLe.getOrCreate(e);Iv.languages.registerTokensProviderFactory(e,{create:async()=>(await t.load()).language}),Iv.languages.onLanguageEncountered(e,async()=>{const i=await t.load();Iv.languages.setLanguageConfiguration(e,i.conf)})}pp({id:"css",extensions:[".css"],aliases:["CSS","css"],mimetypes:["text/css"],loader:()=>er(()=>import("./css-D1nB4Vcj.js"),[])});pp({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:()=>er(()=>import("./html-B4dTfUY8.js"),__vite__mapDeps([0,1,2,3]))});pp({id:"javascript",extensions:[".js",".es6",".jsx",".mjs",".cjs"],firstLine:"^#!.*\\bnode",filenames:["jakefile"],aliases:["JavaScript","javascript","js"],mimetypes:["text/javascript"],loader:()=>er(()=>import("./javascript-BcV1SRi8.js"),__vite__mapDeps([4,5,1,2,3]))});pp({id:"markdown",extensions:[".md",".markdown",".mdown",".mkdn",".mkd",".mdwn",".mdtxt",".mdtext"],aliases:["Markdown","markdown"],loader:()=>er(()=>import("./markdown-7fQo6M4U.js"),[])});pp({id:"python",extensions:[".py",".rpy",".pyw",".cpy",".gyp",".gypi"],aliases:["Python","py"],firstLine:"^#!/.*\\bpython[0-9.-]*\\b",loader:()=>er(()=>import("./python-CsxvR8Mf.js"),__vite__mapDeps([6,1,2,3]))});pp({id:"typescript",extensions:[".ts",".tsx",".cts",".mts"],aliases:["TypeScript","ts","typescript"],mimetypes:["text/typescript"],loader:()=>er(()=>import("./typescript-BfKWl9Pr.js"),__vite__mapDeps([5,1,2,3]))});pp({id:"yaml",extensions:[".yaml",".yml"],aliases:["YAML","yaml","YML","yml"],mimetypes:["application/x-yaml","text/x-yaml"],loader:()=>er(()=>import("./yaml-DWuY8lcX.js"),__vite__mapDeps([7,1,2,3]))});class KLe extends qs{constructor(){super({id:"diffEditor.toggleCollapseUnchangedRegions",title:Ve("toggleCollapseUnchangedRegions","Toggle Collapse Unchanged Regions"),icon:oe.map,toggled:G.has("config.diffEditor.hideUnchangedRegions.enabled"),precondition:G.has("isInDiffEditor"),menu:{when:G.has("isInDiffEditor"),id:E.EditorTitle,order:22,group:"navigation"}})}run(e,...t){const i=e.get(rt),n=!i.getValue("diffEditor.hideUnchangedRegions.enabled");i.updateValue("diffEditor.hideUnchangedRegions.enabled",n)}}class HK extends qs{constructor(){super({id:"diffEditor.toggleShowMovedCodeBlocks",title:Ve("toggleShowMovedCodeBlocks","Toggle Show Moved Code Blocks"),precondition:G.has("isInDiffEditor")})}run(e,...t){const i=e.get(rt),n=!i.getValue("diffEditor.experimental.showMoves");i.updateValue("diffEditor.experimental.showMoves",n)}}class VK extends qs{constructor(){super({id:"diffEditor.toggleUseInlineViewWhenSpaceIsLimited",title:Ve("toggleUseInlineViewWhenSpaceIsLimited","Toggle Use Inline View When Space Is Limited"),precondition:G.has("isInDiffEditor")})}run(e,...t){const i=e.get(rt),n=!i.getValue("diffEditor.useInlineViewWhenSpaceIsLimited");i.updateValue("diffEditor.useInlineViewWhenSpaceIsLimited",n)}}const B1=Ve("diffEditor","Diff Editor");class qLe extends fl{constructor(){super({id:"diffEditor.switchSide",title:Ve("switchSide","Switch Side"),icon:oe.arrowSwap,precondition:G.has("isInDiffEditor"),f1:!0,category:B1})}runEditorCommand(e,t,i){const n=b0(e);if(n instanceof $c){if(i&&i.dryRun)return{destinationSelection:n.mapToOtherSide().destinationSelection};n.switchSide()}}}class GLe extends fl{constructor(){super({id:"diffEditor.exitCompareMove",title:Ve("exitCompareMove","Exit Compare Move"),icon:oe.close,precondition:T.comparingMovedCode,f1:!1,category:B1,keybinding:{weight:1e4,primary:9}})}runEditorCommand(e,t,...i){const n=b0(e);n instanceof $c&&n.exitCompareMove()}}class ZLe extends fl{constructor(){super({id:"diffEditor.collapseAllUnchangedRegions",title:Ve("collapseAllUnchangedRegions","Collapse All Unchanged Regions"),icon:oe.fold,precondition:G.has("isInDiffEditor"),f1:!0,category:B1})}runEditorCommand(e,t,...i){const n=b0(e);n instanceof $c&&n.collapseAllUnchangedRegions()}}class XLe extends fl{constructor(){super({id:"diffEditor.showAllUnchangedRegions",title:Ve("showAllUnchangedRegions","Show All Unchanged Regions"),icon:oe.unfold,precondition:G.has("isInDiffEditor"),f1:!0,category:B1})}runEditorCommand(e,t,...i){const n=b0(e);n instanceof $c&&n.showAllUnchangedRegions()}}class TM extends qs{constructor(){super({id:"diffEditor.revert",title:Ve("revert","Revert"),f1:!1,category:B1})}run(e,t){var i;const n=YLe(e,t.originalUri,t.modifiedUri);n instanceof $c&&n.revertRangeMappings((i=t.mapping.innerChanges)!==null&&i!==void 0?i:[])}}const zK=Ve("accessibleDiffViewer","Accessible Diff Viewer");class v0 extends qs{constructor(){super({id:v0.id,title:Ve("editor.action.accessibleDiffViewer.next","Go to Next Difference"),category:zK,precondition:G.has("isInDiffEditor"),keybinding:{primary:65,weight:100},f1:!0})}run(e){const t=b0(e);t==null||t.accessibleDiffViewerNext()}}v0.id="editor.action.accessibleDiffViewer.next";class W1 extends qs{constructor(){super({id:W1.id,title:Ve("editor.action.accessibleDiffViewer.prev","Go to Previous Difference"),category:zK,precondition:G.has("isInDiffEditor"),keybinding:{primary:1089,weight:100},f1:!0})}run(e){const t=b0(e);t==null||t.accessibleDiffViewerPrev()}}W1.id="editor.action.accessibleDiffViewer.prev";function YLe(s,e,t){return s.get(xt).listDiffEditors().find(o=>{var r,a;const l=o.getModifiedEditor(),d=o.getOriginalEditor();return l&&((r=l.getModel())===null||r===void 0?void 0:r.uri.toString())===t.toString()&&d&&((a=d.getModel())===null||a===void 0?void 0:a.uri.toString())===e.toString()})||null}function b0(s){const t=s.get(xt).listDiffEditors(),i=Xn();if(i)for(const n of t){const o=n.getContainerDomNode();if(QLe(o,i))return n}return null}function QLe(s,e){let t=e;for(;t;){if(t===s)return!0;t=t.parentElement}return!1}qt(KLe);qt(HK);qt(VK);yn.appendMenuItem(E.EditorTitle,{command:{id:new VK().desc.id,title:p("useInlineViewWhenSpaceIsLimited","Use Inline View When Space Is Limited"),toggled:G.has("config.diffEditor.useInlineViewWhenSpaceIsLimited"),precondition:G.has("isInDiffEditor")},order:11,group:"1_diff",when:G.and(T.diffEditorRenderSideBySideInlineBreakpointReached,G.has("isInDiffEditor"))});yn.appendMenuItem(E.EditorTitle,{command:{id:new HK().desc.id,title:p("showMoves","Show Moved Code Blocks"),icon:oe.move,toggled:r0.create("config.diffEditor.experimental.showMoves",!0),precondition:G.has("isInDiffEditor")},order:10,group:"1_diff",when:G.has("isInDiffEditor")});qt(TM);for(const s of[{icon:oe.arrowRight,key:T.diffEditorInlineMode.toNegated()},{icon:oe.discard,key:T.diffEditorInlineMode}])yn.appendMenuItem(E.DiffEditorHunkToolbar,{command:{id:new TM().desc.id,title:p("revertHunk","Revert Block"),icon:s.icon},when:G.and(T.diffEditorModifiedWritable,s.key),order:5,group:"primary"}),yn.appendMenuItem(E.DiffEditorSelectionToolbar,{command:{id:new TM().desc.id,title:p("revertSelection","Revert Selection"),icon:s.icon},when:G.and(T.diffEditorModifiedWritable,s.key),order:5,group:"primary"});qt(qLe);qt(GLe);qt(ZLe);qt(XLe);yn.appendMenuItem(E.EditorTitle,{command:{id:v0.id,title:p("Open Accessible Diff Viewer","Open Accessible Diff Viewer"),precondition:G.has("isInDiffEditor")},order:10,group:"2_diff",when:G.and(T.accessibleDiffViewerVisible.negate(),G.has("isInDiffEditor"))});pt.registerCommandAlias("editor.action.diffReview.next",v0.id);qt(v0);pt.registerCommandAlias("editor.action.diffReview.prev",W1.id);qt(W1);var JLe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},exe=function(s,e){return function(t,i){e(t,i,s)}},NM;const fk=new ue("selectionAnchorSet",!1);let jc=NM=class{static get(e){return e.getContribution(NM.ID)}constructor(e,t){this.editor=e,this.selectionAnchorSetContextKey=fk.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(we.fromPositions(e,e),{description:"selection-anchor",stickiness:1,hoverMessage:new ss().appendText(p("selectionAnchor","Selection Anchor")),className:"selection-anchor"})}),this.selectionAnchorSetContextKey.set(!!this.decorationId),fo(p("anchorSet","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(we.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()}};jc.ID="editor.contrib.selectionAnchorController";jc=NM=JLe([exe(1,Be)],jc);class txe extends me{constructor(){super({id:"editor.action.setSelectionAnchor",label:p("setSelectionAnchor","Set Selection Anchor"),alias:"Set Selection Anchor",precondition:void 0,kbOpts:{kbExpr:T.editorTextFocus,primary:an(2089,2080),weight:100}})}async run(e,t){var i;(i=jc.get(t))===null||i===void 0||i.setSelectionAnchor()}}class ixe extends me{constructor(){super({id:"editor.action.goToSelectionAnchor",label:p("goToSelectionAnchor","Go to Selection Anchor"),alias:"Go to Selection Anchor",precondition:fk})}async run(e,t){var i;(i=jc.get(t))===null||i===void 0||i.goToSelectionAnchor()}}class nxe extends me{constructor(){super({id:"editor.action.selectFromAnchorToCursor",label:p("selectFromAnchorToCursor","Select from Anchor to Cursor"),alias:"Select from Anchor to Cursor",precondition:fk,kbOpts:{kbExpr:T.editorTextFocus,primary:an(2089,2089),weight:100}})}async run(e,t){var i;(i=jc.get(t))===null||i===void 0||i.selectFromAnchorToCursor()}}class sxe extends me{constructor(){super({id:"editor.action.cancelSelectionAnchor",label:p("cancelSelectionAnchor","Cancel Selection Anchor"),alias:"Cancel Selection Anchor",precondition:fk,kbOpts:{kbExpr:T.editorTextFocus,primary:9,weight:100}})}async run(e,t){var i;(i=jc.get(t))===null||i===void 0||i.cancelSelectionAnchor()}}kt(jc.ID,jc,4);te(txe);te(ixe);te(nxe);te(sxe);const oxe=N("editorOverviewRuler.bracketMatchForeground",{dark:"#A0A0A0",light:"#A0A0A0",hcDark:"#A0A0A0",hcLight:"#A0A0A0"},p("overviewRulerBracketMatchForeground","Overview ruler marker color for matching brackets."));class rxe extends me{constructor(){super({id:"editor.action.jumpToBracket",label:p("smartSelect.jumpBracket","Go to Bracket"),alias:"Go to Bracket",precondition:void 0,kbOpts:{kbExpr:T.editorTextFocus,primary:3165,weight:100}})}run(e,t){var i;(i=ga.get(t))===null||i===void 0||i.jumpToBracket()}}class axe extends me{constructor(){super({id:"editor.action.selectToBracket",label:p("smartSelect.selectToBracket","Select to Bracket"),alias:"Select to Bracket",precondition:void 0,metadata:{description:Ve("smartSelect.selectToBracketDescription","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){var n;let o=!0;i&&i.selectBrackets===!1&&(o=!1),(n=ga.get(t))===null||n===void 0||n.selectToBracket(o)}}class lxe extends me{constructor(){super({id:"editor.action.removeBrackets",label:p("smartSelect.removeBrackets","Remove Brackets"),alias:"Remove Brackets",precondition:void 0,kbOpts:{kbExpr:T.editorTextFocus,primary:2561,weight:100}})}run(e,t){var i;(i=ga.get(t))===null||i===void 0||i.removeBrackets(this.id)}}class dxe{constructor(e,t,i){this.position=e,this.brackets=t,this.options=i}}class ga extends H{static get(e){return e.getContribution(ga.ID)}constructor(e){super(),this._editor=e,this._lastBracketsData=[],this._lastVersionId=0,this._decorations=this._editor.createDecorationsCollection(),this._updateBracketsSoon=this._register(new Wt(()=>this._updateBrackets(),50)),this._matchBrackets=this._editor.getOption(72),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(72)&&(this._matchBrackets=this._editor.getOption(72),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(),o=e.bracketPairs.matchBracket(n);let r=null;if(o)o[0].containsPosition(n)&&!o[1].containsPosition(n)?r=o[1].getStartPosition():o[1].containsPosition(n)&&(r=o[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 we(r.lineNumber,r.column,r.lineNumber,r.column):new we(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 o=n.getStartPosition();let r=t.bracketPairs.matchBracket(o);if(!r&&(r=t.bracketPairs.findEnclosingBrackets(o),!r)){const d=t.bracketPairs.findNextBracket(o);d&&d.range&&(r=t.bracketPairs.matchBracket(d.range.getStartPosition()))}let a=null,l=null;if(r){r.sort(x.compareRangesUsingStarts);const[d,c]=r;if(a=e?d.getStartPosition():d.getEndPosition(),l=e?c.getEndPosition():c.getStartPosition(),c.containsPosition(o)){const u=a;a=l,l=u}}a&&l&&i.push(new we(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 o=t.bracketPairs.matchBracket(n);o||(o=t.bracketPairs.findEnclosingBrackets(n)),o&&(this._editor.pushUndoStop(),this._editor.executeEdits(e,[{range:o[0],text:""},{range:o[1],text:""}]),this._editor.pushUndoStop())})}_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 o=[];let r=0;for(let u=0,h=e.length;u1&&o.sort(W.compare);const a=[];let l=0,d=0;const c=n.length;for(let u=0,h=o.length;u0&&(t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop())}}te(gxe);const pk=function(){if(typeof crypto=="object"&&typeof crypto.randomUUID=="function")return crypto.randomUUID.bind(crypto);let s;typeof crypto=="object"&&typeof crypto.getRandomValues=="function"?s=crypto.getRandomValues.bind(crypto):s=function(i){for(let n=0;ns,asFile:()=>{},value:typeof s=="string"?s:void 0}}function fxe(s,e,t){const i={id:pk(),name:s,uri:e,data:t};return{asString:async()=>"",asFile:()=>i,value:void 0}}class $K{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 ft.some(this,([i,n])=>n.asFile())&&t.push("files"),KK(rL(e),t)}get(e){var t;return(t=this._entries.get(this.toKey(e)))===null||t===void 0?void 0:t[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 rL(e)}}function rL(s){return s.toLowerCase()}function jK(s,e){return KK(rL(s),e.map(rL))}function KK(s,e){if(s==="*/*")return e.length>0;if(e.includes(s))return!0;const t=s.match(/^([a-z]+)\/([a-z]+|\*)$/i);if(!t)return!1;const[i,n,o]=t;return o==="*"?e.some(r=>r.startsWith(n+"/")):!1}const mk=Object.freeze({create:s=>Wc(s.map(e=>e.toString())).join(`\r `),split:s=>s.split(`\r `),parse:s=>mk.split(s).filter(e=>!e.startsWith("#"))});class Bt{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+Bt.sep)}intersects(e){return this.contains(e)||e.contains(this)}append(...e){return new Bt((this.value?[this.value,...e]:e).join(Bt.sep))}}Bt.sep=".";Bt.None=new Bt("@@none@@");Bt.Empty=new Bt("");const A7={EDITORS:"CodeEditors",FILES:"CodeFiles"};class pxe{}const mxe={DragAndDropContribution:"workbench.contributions.dragAndDrop"};Ji.add(mxe.DragAndDropContribution,new pxe);class IC{constructor(){}static getInstance(){return IC.INSTANCE}hasData(e){return e&&e===this.proto}getData(e){if(this.hasData(e))return this.data}}IC.INSTANCE=new IC;function qK(s){const e=new $K;for(const t of s.items){const i=t.type;if(t.kind==="string"){const n=new Promise(o=>t.getAsString(o));e.append(i,o4(n))}else if(t.kind==="file"){const n=t.getAsFile();n&&e.append(i,_xe(n))}}return e}function _xe(s){const e=s.path?Ae.parse(s.path):void 0;return fxe(s.name,e,async()=>new Uint8Array(await s.arrayBuffer()))}const vxe=Object.freeze([A7.EDITORS,A7.FILES,uC.RESOURCES,uC.INTERNAL_URI_LIST]);function GK(s,e=!1){const t=qK(s),i=t.get(uC.INTERNAL_URI_LIST);if(i)t.replace(Ti.uriList,i);else if(e||!t.has(Ti.uriList)){const n=[];for(const o of s.items){const r=o.getAsFile();if(r){const a=r.path;try{a?n.push(Ae.file(a).toString()):n.push(Ae.parse(r.name,!0).toString())}catch{}}}n.length&&t.replace(Ti.uriList,o4(mk.create(n)))}for(const n of vxe)t.delete(n);return t}var r4=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},TC=function(s,e){return function(t,i){e(t,i,s)}};class a4{async provideDocumentPasteEdits(e,t,i,n,o){const r=await this.getEdit(i,o);if(r)return{dispose(){},edits:[{insertText:r.insertText,title:r.title,kind:r.kind,handledMimeType:r.handledMimeType,yieldTo:r.yieldTo}]}}async provideDocumentDropEdits(e,t,i,n){const o=await this.getEdit(i,n);return o?[{insertText:o.insertText,title:o.title,kind:o.kind,handledMimeType:o.handledMimeType,yieldTo:o.yieldTo}]:void 0}}class Kc extends a4{constructor(){super(...arguments),this.kind=Kc.kind,this.dropMimeTypes=[Ti.text],this.pasteMimeTypes=[Ti.text]}async getEdit(e,t){const i=e.get(Ti.text);if(!i||e.has(Ti.uriList))return;const n=await i.asString();return{handledMimeType:Ti.text,title:p("text.label","Insert Plain Text"),insertText:n,kind:this.kind}}}Kc.id="text";Kc.kind=new Bt("text.plain");class ZK extends a4{constructor(){super(...arguments),this.kind=new Bt("uri.absolute"),this.dropMimeTypes=[Ti.uriList],this.pasteMimeTypes=[Ti.uriList]}async getEdit(e,t){const i=await XK(e);if(!i.length||t.isCancellationRequested)return;let n=0;const o=i.map(({uri:a,originalText:l})=>a.scheme===Ge.file?a.fsPath:(n++,l)).join(" ");let r;return n>0?r=i.length>1?p("defaultDropProvider.uriList.uris","Insert Uris"):p("defaultDropProvider.uriList.uri","Insert Uri"):r=i.length>1?p("defaultDropProvider.uriList.paths","Insert Paths"):p("defaultDropProvider.uriList.path","Insert Path"),{handledMimeType:Ti.uriList,insertText:o,title:r,kind:this.kind}}}let aL=class extends a4{constructor(e){super(),this._workspaceContextService=e,this.kind=new Bt("uri.relative"),this.dropMimeTypes=[Ti.uriList],this.pasteMimeTypes=[Ti.uriList]}async getEdit(e,t){const i=await XK(e);if(!i.length||t.isCancellationRequested)return;const n=pd(i.map(({uri:o})=>{const r=this._workspaceContextService.getWorkspaceFolder(o);return r?Sme(r.uri,o):void 0}));if(n.length)return{handledMimeType:Ti.uriList,insertText:n.join(" "),title:i.length>1?p("defaultDropProvider.uriList.relativePaths","Insert Relative Paths"):p("defaultDropProvider.uriList.relativePath","Insert Relative Path"),kind:this.kind}}};aL=r4([TC(0,If)],aL);class bxe{constructor(){this.kind=new Bt("html"),this.pasteMimeTypes=["text/html"],this._yieldTo=[{mimeType:Ti.text}]}async provideDocumentPasteEdits(e,t,i,n,o){var r;if(n.triggerKind!==Nb.PasteAs&&!(!((r=n.only)===null||r===void 0)&&r.contains(this.kind)))return;const a=i.get("text/html"),l=await(a==null?void 0:a.asString());if(!(!l||o.isCancellationRequested))return{dispose(){},edits:[{insertText:l,yieldTo:this._yieldTo,title:p("pasteHtmlLabel","Insert HTML"),kind:this.kind}]}}}async function XK(s){const e=s.get(Ti.uriList);if(!e)return[];const t=await e.asString(),i=[];for(const n of mk.parse(t))try{i.push({uri:Ae.parse(n),originalText:n})}catch{}return i}let AM=class extends H{constructor(e,t){super(),this._register(e.documentDropEditProvider.register("*",new Kc)),this._register(e.documentDropEditProvider.register("*",new ZK)),this._register(e.documentDropEditProvider.register("*",new aL(t)))}};AM=r4([TC(0,Ce),TC(1,If)],AM);let MM=class extends H{constructor(e,t){super(),this._register(e.documentPasteEditProvider.register("*",new Kc)),this._register(e.documentPasteEditProvider.register("*",new ZK)),this._register(e.documentPasteEditProvider.register("*",new aL(t))),this._register(e.documentPasteEditProvider.register("*",new bxe))}};MM=r4([TC(0,Ce),TC(1,If)],MM);class ea{constructor(){this.value="",this.pos=0}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=ea._table[i],typeof n=="number")return this.pos+=1,{type:n,pos:e,len:1};if(ea.isDigitCharacter(i)){n=8;do t+=1,i=this.value.charCodeAt(e+t);while(ea.isDigitCharacter(i));return this.pos+=t,{type:n,pos:e,len:t}}if(ea.isVariableCharacter(i)){n=9;do i=this.value.charCodeAt(e+ ++t);while(ea.isVariableCharacter(i)||ea.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 ea._table[i]>"u"&&!ea.isDigitCharacter(i)&&!ea.isVariableCharacter(i));return this.pos+=t,{type:n,pos:e,len:t}}}ea._table={36:0,58:1,44:2,123:3,125:4,92:5,47:6,124:7,43:11,45:12,63:13};class C0{constructor(){this._children=[]}appendChild(e){return e instanceof Ts&&this._children[this._children.length-1]instanceof Ts?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),o=i.children.slice(0);o.splice(n,1,...t),i._children=o,function r(a,l){for(const d of a)d.parent=l,r(d.children,d)}(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 H1)return e;e=e.parent}}toString(){return this.children.reduce((e,t)=>e+t.toString(),"")}len(){return 0}}class Ts extends C0{constructor(e){super(),this.value=e}toString(){return this.value}len(){return this.value.length}clone(){return new Ts(this.value)}}class YK extends C0{}class yr extends YK{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 w0?this._children[0]:void 0}clone(){const e=new yr(this.index);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}}class w0 extends C0{constructor(){super(...arguments),this.options=[]}appendChild(e){return e instanceof Ts&&(e.parent=this,this.options.push(e)),this}toString(){return this.options[0].value}len(){return this.options[0].len()}clone(){const e=new w0;return this.options.forEach(e.appendChild,e),e}}class l4 extends C0{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(o=>o instanceof Oa&&!!o.elseValue)&&(n=this._replace([])),n}_replace(e){let t="";for(const i of this._children)if(i instanceof Oa){let n=e[i.index]||"";n=i.resolve(n),t+=n}else t+=i.toString();return t}toString(){return""}clone(){const e=new l4;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 Oa extends C0{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 Oa(this.index,this.shorthandName,this.ifValue,this.elseValue)}}class NC extends YK{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 Ts(t)],!0):!1}clone(){const e=new NC(this.name);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}}function M7(s,e){const t=[...s];for(;t.length>0;){const i=t.shift();if(!e(i))break;t.unshift(...i.children)}}class H1 extends C0{get placeholderInfo(){if(!this._placeholders){const e=[];let t;this.walk(function(i){return i instanceof yr&&(e.push(i),t=!t||t.indexn===e?(i=!0,!1):(t+=n.len(),!0)),i?t:-1}fullLen(e){let t=0;return M7([e],i=>(t+=i.len(),!0)),t}enclosingPlaceholders(e){const t=[];let{parent:i}=e;for(;i;)i instanceof yr&&t.push(i),i=i.parent;return t}resolveVariables(e){return this.walk(t=>(t instanceof NC&&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 H1;return this._children=this.children.map(t=>t.clone()),e}walk(e){M7(this.children,e)}}class Rf{constructor(){this._scanner=new ea,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 H1;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,o=[];t.walk(l=>(l instanceof yr&&(l.isFinalTabstop?n.set(0,void 0):!n.has(l.index)&&l.children.length>0?n.set(l.index,l.children):o.push(l)),!0));const r=(l,d)=>{const c=n.get(l.index);if(!c)return;const u=new yr(l.index);u.transform=l.transform;for(const h of c){const g=h.clone();u.appendChild(g),g instanceof yr&&n.has(g.index)&&!d.has(g.index)&&(d.add(g.index),r(g,d),d.delete(g.index))}t.replace(l,[u])},a=new Set;for(const l of o)r(l,a);return t.children.slice(i)}ensureFinalTabstop(e,t,i){(t||i&&e.placeholders.length>0)&&(e.placeholders.find(o=>o.index===0)||e.appendChild(new yr(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 Ts(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 yr(Number(t)):new NC(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 o=new yr(Number(t));if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(o),!0;if(!this._parse(o))return e.appendChild(new Ts("${"+t+":")),o.children.forEach(e.appendChild,e),!0}else if(o.index>0&&this._accept(7)){const r=new w0;for(;;){if(this._parseChoiceElement(r)){if(this._accept(2))continue;if(this._accept(7)&&(o.appendChild(r),this._accept(4)))return e.appendChild(o),!0}return this._backTo(i),!1}}else return this._accept(6)?this._parseTransform(o)?(e.appendChild(o),!0):(this._backTo(i),!1):this._accept(4)?(e.appendChild(o),!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 Ts(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 o=new NC(t);if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(o),!0;if(!this._parse(o))return e.appendChild(new Ts("${"+t+":")),o.children.forEach(e.appendChild,e),!0}else return this._accept(6)?this._parseTransform(o)?(e.appendChild(o),!0):(this._backTo(i),!1):this._accept(4)?(e.appendChild(o),!0):this._backTo(i)}_parseTransform(e){const t=new l4;let i="",n="";for(;!this._accept(6);){let o;if(o=this._accept(5,!0)){o=this._accept(6,!0)||o,i+=o;continue}if(this._token.type!==14){i+=this._accept(void 0,!0);continue}return!1}for(;!this._accept(6);){let o;if(o=this._accept(5,!0)){o=this._accept(5,!0)||this._accept(6,!0)||o,t.appendChild(new Ts(o));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 Oa(Number(n))),!0;if(!this._accept(1))return this._backTo(t),!1}else return e.appendChild(new Oa(Number(n))),!0;else return this._backTo(t),!1;if(this._accept(6)){const o=this._accept(9,!0);return!o||!this._accept(4)?(this._backTo(t),!1):(e.appendChild(new Oa(Number(n),o)),!0)}else if(this._accept(11)){const o=this._until(4);if(o)return e.appendChild(new Oa(Number(n),void 0,o,void 0)),!0}else if(this._accept(12)){const o=this._until(4);if(o)return e.appendChild(new Oa(Number(n),void 0,void 0,o)),!0}else if(this._accept(13)){const o=this._until(1);if(o){const r=this._until(4);if(r)return e.appendChild(new Oa(Number(n),void 0,o,r)),!0}}else{const o=this._until(4);if(o)return e.appendChild(new Oa(Number(n),void 0,void 0,o)),!0}return this._backTo(t),!1}_parseAnything(e){return this._token.type!==14?(e.appendChild(new Ts(this._scanner.tokenText(this._token))),this._accept(void 0),!0):!1}}function QK(s,e,t){var i,n,o,r;return(typeof t.insertText=="string"?t.insertText==="":t.insertText.snippet==="")?{edits:(n=(i=t.additionalEdit)===null||i===void 0?void 0:i.edits)!==null&&n!==void 0?n:[]}:{edits:[...e.map(a=>new dh(s,{range:a,text:typeof t.insertText=="string"?Rf.escape(t.insertText)+"$0":t.insertText.snippet,insertAsSnippet:!0})),...(r=(o=t.additionalEdit)===null||o===void 0?void 0:o.edits)!==null&&r!==void 0?r:[]]}}function JK(s){var e;function t(a,l){return"mimeType"in a?a.mimeType===l.handledMimeType:!!l.kind&&a.kind.contains(l.kind)}const i=new Map;for(const a of s)for(const l of(e=a.yieldTo)!==null&&e!==void 0?e:[])for(const d of s)if(d!==a&&t(l,d)){let c=i.get(a);c||(c=[],i.set(a,c)),c.push(d)}if(!i.size)return Array.from(s);const n=new Set,o=[];function r(a){if(!a.length)return[];const l=a[0];if(o.includes(l))return console.warn("Yield to cycle detected",l),a;if(n.has(l))return r(a.slice(1));let d=[];const c=i.get(l);return c&&(o.push(l),d=r(c),o.pop()),n.add(l),[...d,l,...r(a.slice(1))]}return r(Array.from(s))}var Cxe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},wxe=function(s,e){return function(t,i){e(t,i,s)}};const yxe=Ye.register({description:"inline-progress-widget",stickiness:1,showIfCollapsed:!0,after:{content:cz,inlineClassName:"inline-editor-progress-decoration",inlineClassNameAffectsLetterSpacing:!0}});class _k extends H{constructor(e,t,i,n,o){super(),this.typeId=e,this.editor=t,this.range=i,this.delegate=o,this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this.create(n),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this)}create(e){this.domNode=he(".inline-progress-widget"),this.domNode.role="button",this.domNode.title=e;const t=he("span.icon");this.domNode.append(t),t.classList.add(...Pe.asClassNameArray(oe.loading),"codicon-modifier-spin");const i=()=>{const n=this.editor.getOption(67);this.domNode.style.height=`${n}px`,this.domNode.style.width=`${Math.ceil(.8*n)}px`};i(),this._register(this.editor.onDidChangeConfiguration(n=>{(n.hasChanged(52)||n.hasChanged(67))&&i()})),this._register(K(this.domNode,ee.CLICK,n=>{this.delegate.cancel()}))}getId(){return _k.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)}}_k.baseId="editor.widget.inlineProgressWidget";let lL=class extends H{constructor(e,t,i){super(),this.id=e,this._editor=t,this._instantiationService=i,this._showDelay=500,this._showPromise=this._register(new $n),this._currentWidget=new $n,this._operationIdPool=0,this._currentDecorations=t.createDecorationsCollection()}async showWhile(e,t,i){const n=this._operationIdPool++;this._currentOperation=n,this.clear(),this._showPromise.value=kh(()=>{const o=x.fromPositions(e);this._currentDecorations.set([{range:o,options:yxe}]).length>0&&(this._currentWidget.value=this._instantiationService.createInstance(_k,this.id,this._editor,o,t,i))},this._showDelay);try{return await i}finally{this._currentOperation===n&&(this.clear(),this._currentOperation=void 0)}}clear(){this._showPromise.clear(),this._currentDecorations.clear(),this._currentWidget.clear()}};lL=Cxe([wxe(2,Ne)],lL);var Sxe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},R7=function(s,e){return function(t,i){e(t,i,s)}},lS;let Vs=lS=class{static get(e){return e.getContribution(lS.ID)}constructor(e,t,i){this._openerService=i,this._messageWidget=new $n,this._messageListeners=new Y,this._mouseOverMessage=!1,this._editor=e,this._visible=lS.MESSAGE_VISIBLE.bindTo(t)}dispose(){var e;(e=this._message)===null||e===void 0||e.dispose(),this._messageListeners.dispose(),this._messageWidget.dispose(),this._visible.reset()}showMessage(e,t){fo(tl(e)?e.value:e),this._visible.set(!0),this._messageWidget.clear(),this._messageListeners.clear(),this._message=tl(e)?Hx(e,{actionHandler:{callback:n=>{this.closeMessage(),wO(this._openerService,n,tl(e)?e.isTrusted:void 0)},disposables:this._messageListeners}}):void 0,this._messageWidget.value=new P7(this._editor,t,typeof e=="string"?e:this._message.element),this._messageListeners.add(le.debounce(this._editor.onDidBlurEditorText,(n,o)=>o,0)(()=>{this._mouseOverMessage||this._messageWidget.value&&An(Xn(),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(K(this._messageWidget.value.getDomNode(),ee.MOUSE_ENTER,()=>this._mouseOverMessage=!0,!0)),this._messageListeners.add(K(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 x(t.lineNumber-3,1,n.target.position.lineNumber+3,1))}))}closeMessage(){this._visible.reset(),this._messageListeners.clear(),this._messageWidget.value&&this._messageListeners.add(P7.fadeOut(this._messageWidget.value))}};Vs.ID="editor.contrib.messageController";Vs.MESSAGE_VISIBLE=new ue("messageVisible",!1,p("messageVisible","Whether the editor is currently showing an inline message"));Vs=lS=Sxe([R7(1,Be),R7(2,Bo)],Vs);const Dxe=mn.bindToContribution(Vs.get);de(new Dxe({id:"leaveEditorMessage",precondition:Vs.MESSAGE_VISIBLE,handler:s=>s.closeMessage(),kbOpts:{weight:130,primary:9}}));let P7=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 o=document.createElement("div");o.classList.add("anchor","top"),this._domNode.appendChild(o);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)}};kt(Vs.ID,Vs,4);var eq=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},ub=function(s,e){return function(t,i){e(t,i,s)}},RM;let dL=RM=class extends H{constructor(e,t,i,n,o,r,a,l,d,c){super(),this.typeId=e,this.editor=t,this.showCommand=n,this.range=o,this.edits=r,this.onSelectNewEdit=a,this._contextMenuService=l,this._keybindingService=c,this.allowEditorOverflow=!0,this.suppressMouseDown=!0,this.create(),this.visibleContext=i.bindTo(d),this.visibleContext.set(!0),this._register(Ie(()=>this.visibleContext.reset())),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this),this._register(Ie(()=>this.editor.removeContentWidget(this))),this._register(this.editor.onDidChangeCursorPosition(u=>{o.containsPosition(u.position)||this.dispose()})),this._register(le.runAndSubscribe(c.onDidUpdateKeybindings,()=>{this._updateButtonTitle()}))}_updateButtonTitle(){var e;const t=(e=this._keybindingService.lookupKeybinding(this.showCommand.id))===null||e===void 0?void 0:e.getLabel();this.button.element.title=this.showCommand.label+(t?` (${t})`:"")}create(){this.domNode=he(".post-edit-widget"),this.button=this._register(new KD(this.domNode,{supportIcons:!0})),this.button.label="$(insert)",this._register(K(this.domNode,ee.CLICK,()=>this.showSelector()))}getId(){return RM.baseId+"."+this.typeId}getDomNode(){return this.domNode}getPosition(){return{position:this.range.getEndPosition(),preference:[2]}}showSelector(){this._contextMenuService.showContextMenu({getAnchor:()=>{const e=qi(this.button.element);return{x:e.left+e.width,y:e.top+e.height}},getActions:()=>this.edits.allEdits.map((e,t)=>af({id:"",label:e.title,checked:t===this.edits.activeEditIndex,run:()=>{if(t!==this.edits.activeEditIndex)return this.onSelectNewEdit(t)}}))})}};dL.baseId="editor.widget.postEditWidget";dL=RM=eq([ub(7,Oo),ub(8,Be),ub(9,At)],dL);let cL=class extends H{constructor(e,t,i,n,o,r){super(),this._id=e,this._editor=t,this._visibleContext=i,this._showCommand=n,this._instantiationService=o,this._bulkEditService=r,this._currentWidget=this._register(new $n),this._register(le.any(t.onDidChangeModel,t.onDidChangeModelContent)(()=>this.clear()))}async applyEditAndShowIfNeeded(e,t,i,n,o){const r=this._editor.getModel();if(!r||!e.length)return;const a=t.allEdits.at(t.activeEditIndex);if(!a)return;const l=await n(a,o);if(o.isCancellationRequested)return;const d=QK(r.uri,e,l),c=e[0],u=r.deltaDecorations([],[{range:c,options:{description:"paste-line-suffix",stickiness:0}}]);this._editor.focus();let h,g;try{h=await this._bulkEditService.apply(d,{editor:this._editor,token:o}),g=r.getDecorationRange(u[0])}finally{r.deltaDecorations(u,[])}o.isCancellationRequested||i&&h.isApplied&&t.allEdits.length>1&&this.show(g??c,t,async f=>{const m=this._editor.getModel();m&&(await m.undo(),this.applyEditAndShowIfNeeded(e,{activeEditIndex:f,allEdits:t.allEdits},i,n,o))})}show(e,t,i){this.clear(),this._editor.hasModel()&&(this._currentWidget.value=this._instantiationService.createInstance(dL,this._id,this._editor,this._visibleContext,this._showCommand,e,t,i))}clear(){this._currentWidget.clear()}tryShowSelector(){var e;(e=this._currentWidget.value)===null||e===void 0||e.showSelector()}};cL=eq([ub(4,Ne),ub(5,x1)],cL);var Lxe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Mp=function(s,e){return function(t,i){e(t,i,s)}},Mg;const tq="editor.changePasteType",d4=new ue("pasteWidgetVisible",!1,p("pasteWidgetVisible","Whether the paste widget is showing")),iT="application/vnd.code.copyMetadata";let kd=Mg=class extends H{static get(e){return e.getContribution(Mg.ID)}constructor(e,t,i,n,o,r,a){super(),this._bulkEditService=i,this._clipboardService=n,this._languageFeaturesService=o,this._quickInputService=r,this._progressService=a,this._editor=e;const l=e.getContainerDomNode();this._register(K(l,"copy",d=>this.handleCopy(d))),this._register(K(l,"cut",d=>this.handleCopy(d))),this._register(K(l,"paste",d=>this.handlePaste(d),!0)),this._pasteProgressManager=this._register(new lL("pasteIntoEditor",e,t)),this._postPasteWidgetManager=this._register(t.createInstance(cL,"pasteIntoEditor",e,d4,{id:tq,label:p("postPasteWidgetTitle","Show paste options...")}))}changePasteType(){this._postPasteWidgetManager.tryShowSelector()}pasteAs(e){this._editor.focus();try{this._pasteAsActionContext={preferred:e},o0().execCommand("paste")}finally{this._pasteAsActionContext=void 0}}clearWidgets(){this._postPasteWidgetManager.clear()}isPasteAsEnabled(){return this._editor.getOption(85).enabled&&!this._editor.getOption(91)}async finishedPaste(){await this._currentPasteOperation}handleCopy(e){var t,i;if(!this._editor.hasTextFocus()||(Jh&&this._clipboardService.writeResources([]),!e.clipboardData||!this.isPasteAsEnabled()))return;const n=this._editor.getModel(),o=this._editor.getSelections();if(!n||!(o!=null&&o.length))return;const r=this._editor.getOption(37);let a=o;const l=o.length===1&&o[0].isEmpty();if(l){if(!r)return;a=[new x(a[0].startLineNumber,1,a[0].startLineNumber,1+n.getLineLength(a[0].startLineNumber))]}const d=(t=this._editor._getViewModel())===null||t===void 0?void 0:t.getPlainTextToCopy(o,r,as),u={multicursorText:Array.isArray(d)?d:null,pasteOnNewLine:l,mode:null},h=this._languageFeaturesService.documentPasteEditProvider.ordered(n).filter(v=>!!v.prepareDocumentPaste);if(!h.length){this.setCopyMetadata(e.clipboardData,{defaultPastePayload:u});return}const g=qK(e.clipboardData),f=h.flatMap(v=>{var b;return(b=v.copyMimeTypes)!==null&&b!==void 0?b:[]}),m=pk();this.setCopyMetadata(e.clipboardData,{id:m,providerCopyMimeTypes:f,defaultPastePayload:u});const _=Dn(async v=>{const b=pd(await Promise.all(h.map(async C=>{try{return await C.prepareDocumentPaste(n,a,g,v)}catch(w){console.error(w);return}})));b.reverse();for(const C of b)for(const[w,y]of C)g.replace(w,y);return g});(i=Mg._currentCopyOperation)===null||i===void 0||i.dataTransferPromise.cancel(),Mg._currentCopyOperation={handle:m,dataTransferPromise:_}}async handlePaste(e){var t,i,n,o;if(!e.clipboardData||!this._editor.hasTextFocus())return;(t=Vs.get(this._editor))===null||t===void 0||t.closeMessage(),(i=this._currentPasteOperation)===null||i===void 0||i.cancel(),this._currentPasteOperation=void 0;const r=this._editor.getModel(),a=this._editor.getSelections();if(!(a!=null&&a.length)||!r||!this.isPasteAsEnabled()&&!this._pasteAsActionContext)return;const l=this.fetchCopyMetadata(e),d=GK(e.clipboardData);d.delete(iT);const c=[...e.clipboardData.types,...(n=l==null?void 0:l.providerCopyMimeTypes)!==null&&n!==void 0?n:[],Ti.uriList],u=this._languageFeaturesService.documentPasteEditProvider.ordered(r).filter(h=>{var g,f;const m=(g=this._pasteAsActionContext)===null||g===void 0?void 0:g.preferred;return m&&h.providedPasteEditKinds&&!this.providerMatchesPreference(h,m)?!1:(f=h.pasteMimeTypes)===null||f===void 0?void 0:f.some(_=>jK(_,c))});if(!u.length){!((o=this._pasteAsActionContext)===null||o===void 0)&&o.preferred&&this.showPasteAsNoEditMessage(a,this._pasteAsActionContext.preferred);return}e.preventDefault(),e.stopImmediatePropagation(),this._pasteAsActionContext?this.showPasteAsPick(this._pasteAsActionContext.preferred,u,a,d,l):this.doPasteInline(u,a,d,l,e)}showPasteAsNoEditMessage(e,t){var i;(i=Vs.get(this._editor))===null||i===void 0||i.showMessage(p("pasteAsError","No paste edits for '{0}' found",t instanceof Bt?t.value:t.providerId),e[0].getStartPosition())}doPasteInline(e,t,i,n,o){const r=Dn(async a=>{const l=this._editor;if(!l.hasModel())return;const d=l.getModel(),c=new Bh(l,3,void 0,a);try{if(await this.mergeInDataFromCopy(i,n,c.token),c.token.isCancellationRequested)return;const u=e.filter(f=>this.isSupportedPasteProvider(f,i));if(!u.length||u.length===1&&u[0]instanceof Kc)return this.applyDefaultPasteHandler(i,n,c.token,o);const h={triggerKind:Nb.Automatic},g=await this.getPasteEdits(u,i,d,t,h,c.token);if(c.token.isCancellationRequested)return;if(g.length===1&&g[0].provider instanceof Kc)return this.applyDefaultPasteHandler(i,n,c.token,o);if(g.length){const f=l.getOption(85).showPasteSelector==="afterPaste";return this._postPasteWidgetManager.applyEditAndShowIfNeeded(t,{activeEditIndex:0,allEdits:g},f,async(m,_)=>{var v,b;const C=await((b=(v=m.provider).resolveDocumentPasteEdit)===null||b===void 0?void 0:b.call(v,m,_));return C&&(m.additionalEdit=C.additionalEdit),m},c.token)}await this.applyDefaultPasteHandler(i,n,c.token,o)}finally{c.dispose(),this._currentPasteOperation===r&&(this._currentPasteOperation=void 0)}});this._pasteProgressManager.showWhile(t[0].getEndPosition(),p("pasteIntoEditorProgress","Running paste handlers. Click to cancel"),r),this._currentPasteOperation=r}showPasteAsPick(e,t,i,n,o){const r=Dn(async a=>{const l=this._editor;if(!l.hasModel())return;const d=l.getModel(),c=new Bh(l,3,void 0,a);try{if(await this.mergeInDataFromCopy(n,o,c.token),c.token.isCancellationRequested)return;let u=t.filter(_=>this.isSupportedPasteProvider(_,n,e));e&&(u=u.filter(_=>this.providerMatchesPreference(_,e)));const h={triggerKind:Nb.PasteAs,only:e&&e instanceof Bt?e:void 0};let g=await this.getPasteEdits(u,n,d,i,h,c.token);if(c.token.isCancellationRequested)return;if(e&&(g=g.filter(_=>e instanceof Bt?e.contains(_.kind):e.providerId===_.provider.id)),!g.length){h.only&&this.showPasteAsNoEditMessage(i,h.only);return}let f;if(e)f=g.at(0);else{const _=await this._quickInputService.pick(g.map(v=>{var b;return{label:v.title,description:(b=v.kind)===null||b===void 0?void 0:b.value,edit:v}}),{placeHolder:p("pasteAsPickerPlaceholder","Select Paste Action")});f=_==null?void 0:_.edit}if(!f)return;const m=QK(d.uri,i,f);await this._bulkEditService.apply(m,{editor:this._editor})}finally{c.dispose(),this._currentPasteOperation===r&&(this._currentPasteOperation=void 0)}});this._progressService.withProgress({location:10,title:p("pasteAsProgress","Running paste handlers")},()=>r)}setCopyMetadata(e,t){e.setData(iT,JSON.stringify(t))}fetchCopyMetadata(e){var t;if(!e.clipboardData)return;const i=e.clipboardData.getData(iT);if(i)try{return JSON.parse(i)}catch{return}const[n,o]=AA.getTextData(e.clipboardData);if(o)return{defaultPastePayload:{mode:o.mode,multicursorText:(t=o.multicursorText)!==null&&t!==void 0?t:null,pasteOnNewLine:!!o.isFromEmptySelection}}}async mergeInDataFromCopy(e,t,i){var n;if(t!=null&&t.id&&((n=Mg._currentCopyOperation)===null||n===void 0?void 0:n.handle)===t.id){const o=await Mg._currentCopyOperation.dataTransferPromise;if(i.isCancellationRequested)return;for(const[r,a]of o)e.replace(r,a)}if(!e.has(Ti.uriList)){const o=await this._clipboardService.readResources();if(i.isCancellationRequested)return;o.length&&e.append(Ti.uriList,o4(mk.create(o)))}}async getPasteEdits(e,t,i,n,o,r){const a=await h1(Promise.all(e.map(async d=>{var c,u;try{const h=await((c=d.provideDocumentPasteEdits)===null||c===void 0?void 0:c.call(d,i,n,t,o,r));return(u=h==null?void 0:h.edits)===null||u===void 0?void 0:u.map(g=>({...g,provider:d}))}catch(h){console.error(h)}})),r),l=pd(a??[]).flat().filter(d=>!o.only||o.only.contains(d.kind));return JK(l)}async applyDefaultPasteHandler(e,t,i,n){var o,r,a,l;const d=(o=e.get(Ti.text))!==null&&o!==void 0?o:e.get("text"),c=(r=await(d==null?void 0:d.asString()))!==null&&r!==void 0?r:"";if(i.isCancellationRequested)return;const u={clipboardEvent:n,text:c,pasteOnNewLine:(a=t==null?void 0:t.defaultPastePayload.pasteOnNewLine)!==null&&a!==void 0?a:!1,multicursorText:(l=t==null?void 0:t.defaultPastePayload.multicursorText)!==null&&l!==void 0?l:null,mode:null};this._editor.trigger("keyboard","paste",u)}isSupportedPasteProvider(e,t,i){var n;return!((n=e.pasteMimeTypes)===null||n===void 0)&&n.some(o=>t.matches(o))?!i||this.providerMatchesPreference(e,i):!1}providerMatchesPreference(e,t){return t instanceof Bt?e.providedPasteEditKinds?e.providedPasteEditKinds.some(i=>t.contains(i)):!0:e.id===t.providerId}};kd.ID="editor.contrib.copyPasteActionController";kd=Mg=Lxe([Mp(1,Ne),Mp(2,x1),Mp(3,ru),Mp(4,Ce),Mp(5,hp),Mp(6,lj)],kd);const Pf="9_cutcopypaste",xxe=md||document.queryCommandSupported("cut"),iq=md||document.queryCommandSupported("copy"),kxe=typeof navigator.clipboard>"u"||Fr?document.queryCommandSupported("paste"):!0;function c4(s){return s.register(),s}const Exe=xxe?c4(new a0({id:"editor.action.clipboardCutAction",precondition:void 0,kbOpts:md?{primary:2102,win:{primary:2102,secondary:[1044]},weight:100}:void 0,menuOpts:[{menuId:E.MenubarEditMenu,group:"2_ccp",title:p({},"Cu&&t"),order:1},{menuId:E.EditorContext,group:Pf,title:p("actions.clipboard.cutLabel","Cut"),when:T.writable,order:1},{menuId:E.CommandPalette,group:"",title:p("actions.clipboard.cutLabel","Cut"),order:1},{menuId:E.SimpleEditorContext,group:Pf,title:p("actions.clipboard.cutLabel","Cut"),when:T.writable,order:1}]})):void 0,Ixe=iq?c4(new a0({id:"editor.action.clipboardCopyAction",precondition:void 0,kbOpts:md?{primary:2081,win:{primary:2081,secondary:[2067]},weight:100}:void 0,menuOpts:[{menuId:E.MenubarEditMenu,group:"2_ccp",title:p({},"&&Copy"),order:2},{menuId:E.EditorContext,group:Pf,title:p("actions.clipboard.copyLabel","Copy"),order:2},{menuId:E.CommandPalette,group:"",title:p("actions.clipboard.copyLabel","Copy"),order:1},{menuId:E.SimpleEditorContext,group:Pf,title:p("actions.clipboard.copyLabel","Copy"),order:2}]})):void 0;yn.appendMenuItem(E.MenubarEditMenu,{submenu:E.MenubarCopy,title:Ve("copy as","Copy As"),group:"2_ccp",order:3});yn.appendMenuItem(E.EditorContext,{submenu:E.EditorContextCopy,title:Ve("copy as","Copy As"),group:Pf,order:3});yn.appendMenuItem(E.EditorContext,{submenu:E.EditorContextShare,title:Ve("share","Share"),group:"11_share",order:-1,when:G.and(G.notEquals("resourceScheme","output"),T.editorTextFocus)});yn.appendMenuItem(E.EditorTitleContext,{submenu:E.EditorTitleContextShare,title:Ve("share","Share"),group:"11_share",order:-1});yn.appendMenuItem(E.ExplorerContext,{submenu:E.ExplorerContextShare,title:Ve("share","Share"),group:"11_share",order:-1});const nT=kxe?c4(new a0({id:"editor.action.clipboardPasteAction",precondition:void 0,kbOpts:md?{primary:2100,win:{primary:2100,secondary:[1043]},linux:{primary:2100,secondary:[1043]},weight:100}:void 0,menuOpts:[{menuId:E.MenubarEditMenu,group:"2_ccp",title:p({},"&&Paste"),order:4},{menuId:E.EditorContext,group:Pf,title:p("actions.clipboard.pasteLabel","Paste"),when:T.writable,order:4},{menuId:E.CommandPalette,group:"",title:p("actions.clipboard.pasteLabel","Paste"),order:1},{menuId:E.SimpleEditorContext,group:Pf,title:p("actions.clipboard.pasteLabel","Paste"),when:T.writable,order:4}]})):void 0;class Txe extends me{constructor(){super({id:"editor.action.clipboardCopyWithSyntaxHighlightingAction",label:p("actions.clipboard.copyWithSyntaxHighlightingLabel","Copy With Syntax Highlighting"),alias:"Copy With Syntax Highlighting",precondition:void 0,kbOpts:{kbExpr:T.textInputFocus,primary:0,weight:100}})}run(e,t){!t.hasModel()||!t.getOption(37)&&t.getSelection().isEmpty()||(TA.forceCopyWithSyntaxHighlighting=!0,t.focus(),t.getContainerDomNode().ownerDocument.execCommand("copy"),TA.forceCopyWithSyntaxHighlighting=!1)}}function nq(s,e){s&&(s.addImplementation(1e4,"code-editor",(t,i)=>{const n=t.get(xt).getFocusedCodeEditor();if(n&&n.hasTextFocus()){const o=n.getOption(37),r=n.getSelection();return r&&r.isEmpty()&&!o||n.getContainerDomNode().ownerDocument.execCommand(e),!0}return!1}),s.addImplementation(0,"generic-dom",(t,i)=>(o0().execCommand(e),!0)))}nq(Exe,"cut");nq(Ixe,"copy");nT&&(nT.addImplementation(1e4,"code-editor",(s,e)=>{var t,i;const n=s.get(xt),o=s.get(ru),r=n.getFocusedCodeEditor();return r&&r.hasTextFocus()?r.getContainerDomNode().ownerDocument.execCommand("paste")?(i=(t=kd.get(r))===null||t===void 0?void 0:t.finishedPaste())!==null&&i!==void 0?i:Promise.resolve():Jh?(async()=>{const l=await o.readText();if(l!==""){const d=Jb.INSTANCE.get(l);let c=!1,u=null,h=null;d&&(c=r.getOption(37)&&!!d.isFromEmptySelection,u=typeof d.multicursorText<"u"?d.multicursorText:null,h=d.mode),r.trigger("keyboard","paste",{text:l,pasteOnNewLine:c,multicursorText:u,mode:h})}})():!0:!1}),nT.addImplementation(0,"generic-dom",(s,e)=>(o0().execCommand("paste"),!0)));iq&&te(Txe);const li=new class{constructor(){this.QuickFix=new Bt("quickfix"),this.Refactor=new Bt("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 Bt("notebook"),this.Source=new Bt("source"),this.SourceOrganizeImports=this.Source.append("organizeImports"),this.SourceFixAll=this.Source.append("fixAll"),this.SurroundWith=this.Refactor.append("surround")}};var Ro;(function(s){s.Refactor="refactor",s.RefactorPreview="refactor preview",s.Lightbulb="lightbulb",s.Default="other (default)",s.SourceAction="source action",s.QuickFix="quick fix action",s.FixAll="fix all",s.OrganizeImports="organize imports",s.AutoFix="auto fix",s.QuickFixHover="quick fix hover window",s.OnSave="save participants",s.ProblemsView="problems view"})(Ro||(Ro={}));function Nxe(s,e){return!(s.include&&!s.include.intersects(e)||s.excludes&&s.excludes.some(t=>sq(e,t,s.include))||!s.includeSourceActions&&li.Source.contains(e))}function Axe(s,e){const t=e.kind?new Bt(e.kind):void 0;return!(s.include&&(!t||!s.include.contains(t))||s.excludes&&t&&s.excludes.some(i=>sq(t,i,s.include))||!s.includeSourceActions&&t&&li.Source.contains(t)||s.onlyIncludePreferredActions&&!e.isPreferred)}function sq(s,e,t){return!(!e.contains(s)||t&&e.contains(t))}class Gl{static fromUser(e,t){return!e||typeof e!="object"?new Gl(t.kind,t.apply,!1):new Gl(Gl.getKindFromUser(e,t.kind),Gl.getApplyFromUser(e,t.apply),Gl.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 Bt(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 Mxe{constructor(e,t,i){this.action=e,this.provider=t,this.highlightRange=i}async resolve(e){var t;if(!((t=this.provider)===null||t===void 0)&&t.resolveCodeAction&&!this.action.edit){let i;try{i=await this.provider.resolveCodeAction(this.action,e)}catch(n){Ai(n)}i&&(this.action.edit=i.edit)}return this}}const oq="editor.action.codeAction",u4="editor.action.quickFix",rq="editor.action.autoFix",aq="editor.action.refactor",lq="editor.action.sourceAction",h4="editor.action.organizeImports",g4="editor.action.fixAll";class hb extends H{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:rs(e.diagnostics)?rs(t.diagnostics)?hb.codeActionsPreferredComparator(e,t):-1:rs(t.diagnostics)?1:hb.codeActionsPreferredComparator(e,t)}constructor(e,t,i){super(),this.documentation=t,this._register(i),this.allActions=[...e].sort(hb.codeActionsComparator),this.validActions=this.allActions.filter(({action:n})=>!n.disabled)}get hasAutoFix(){return this.validActions.some(({action:e})=>!!e.kind&&li.QuickFix.contains(new Bt(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 F7={actions:[],documentation:void 0};async function gb(s,e,t,i,n,o){var r;const a=i.filter||{},l={...a,excludes:[...a.excludes||[],li.Notebook]},d={only:(r=a.include)===null||r===void 0?void 0:r.value,trigger:i.type},c=new s4(e,o),u=i.type===2,h=Rxe(s,e,u?l:a),g=new Y,f=h.map(async _=>{try{n.report(_);const v=await _.provideCodeActions(e,t,d,c.token);if(v&&g.add(v),c.token.isCancellationRequested)return F7;const b=((v==null?void 0:v.actions)||[]).filter(w=>w&&Axe(a,w)),C=Fxe(_,b,a.include);return{actions:b.map(w=>new Mxe(w,_)),documentation:C}}catch(v){if(Id(v))throw v;return Ai(v),F7}}),m=s.onDidChange(()=>{const _=s.all(e);Ci(_,h)||c.cancel()});try{const _=await Promise.all(f),v=_.map(C=>C.actions).flat(),b=[...pd(_.map(C=>C.documentation)),...Pxe(s,e,i,v)];return new hb(v,b,g)}finally{m.dispose(),c.dispose()}}function Rxe(s,e,t){return s.all(e).filter(i=>i.providedCodeActionKinds?i.providedCodeActionKinds.some(n=>Nxe(t,new Bt(n))):!0)}function*Pxe(s,e,t,i){var n,o,r;if(e&&i.length)for(const a of s.all(e))a._getAdditionalMenuItems&&(yield*(n=a._getAdditionalMenuItems)===null||n===void 0?void 0:n.call(a,{trigger:t.type,only:(r=(o=t.filter)===null||o===void 0?void 0:o.include)===null||r===void 0?void 0:r.value},i.map(l=>l.action)))}function Fxe(s,e,t){if(!s.documentation)return;const i=s.documentation.map(n=>({kind:new Bt(n.kind),command:n.command}));if(t){let n;for(const o of i)o.kind.contains(t)&&(n?n.kind.contains(o.kind)&&(n=o):n=o);if(n)return n==null?void 0:n.command}for(const n of e)if(n.kind){for(const o of i)if(o.kind.contains(new Bt(n.kind)))return o.command}}var nf;(function(s){s.OnSave="onSave",s.FromProblemsView="fromProblemsView",s.FromCodeActions="fromCodeActions",s.FromAILightbulb="fromAILightbulb"})(nf||(nf={}));async function Oxe(s,e,t,i,n=dt.None){var o;const r=s.get(x1),a=s.get(gi),l=s.get(Gs),d=s.get(en);if(l.publicLog2("codeAction.applyCodeAction",{codeActionTitle:e.action.title,codeActionKind:e.action.kind,codeActionIsPreferred:!!e.action.isPreferred,reason:t}),await e.resolve(n),!n.isCancellationRequested&&!(!((o=e.action.edit)===null||o===void 0)&&o.edits.length&&!(await r.apply(e.action.edit,{editor:i==null?void 0:i.editor,label:e.action.title,quotableLabel:e.action.title,code:"undoredo.codeAction",respectAutoSaveConfig:t!==nf.OnSave,showPreview:i==null?void 0:i.preview})).isApplied)&&e.action.command)try{await a.executeCommand(e.action.command.id,...e.action.command.arguments||[])}catch(c){const u=Bxe(c);d.error(typeof u=="string"?u:p("applyCodeActionFailed","An unknown error occurred while applying the code action"))}}function Bxe(s){return typeof s=="string"?s:s instanceof Error&&typeof s.message=="string"?s.message:void 0}pt.registerCommand("_executeCodeActionProvider",async function(s,e,t,i,n){if(!(e instanceof Ae))throw Mr();const{codeActionProvider:o}=s.get(Ce),r=s.get(_i).getModel(e);if(!r)throw Mr();const a=we.isISelection(t)?we.liftSelection(t):x.isIRange(t)?r.validateRange(t):void 0;if(!a)throw Mr();const l=typeof i=="string"?new Bt(i):void 0,d=await gb(o,r,a,{type:1,triggerAction:Ro.Default,filter:{includeSourceActions:!0,include:l}},Nc.None,dt.None),c=[],u=Math.min(d.validActions.length,typeof n=="number"?n:0);for(let h=0;hh.action)}finally{setTimeout(()=>d.dispose(),100)}});var Wxe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Hxe=function(s,e){return function(t,i){e(t,i,s)}},PM;let uL=PM=class{constructor(e){this.keybindingService=e}getResolver(){const e=new gl(()=>this.keybindingService.getKeybindings().filter(t=>PM.codeActionCommands.indexOf(t.command)>=0).filter(t=>t.resolvedKeybinding).map(t=>{let i=t.commandArgs;return t.command===h4?i={kind:li.SourceOrganizeImports.value}:t.command===g4&&(i={kind:li.SourceFixAll.value}),{resolvedKeybinding:t.resolvedKeybinding,...Gl.fromUser(i,{kind:Bt.None,apply:"never"})}}));return t=>{if(t.kind){const i=this.bestKeybindingForCodeAction(t,e.value);return i==null?void 0:i.resolvedKeybinding}}}bestKeybindingForCodeAction(e,t){if(!e.kind)return;const i=new Bt(e.kind);return t.filter(n=>n.kind.contains(i)).filter(n=>n.preferred?e.isPreferred:!0).reduceRight((n,o)=>n?n.kind.contains(o.kind)?o:n:o,void 0)}};uL.codeActionCommands=[aq,oq,lq,h4,g4];uL=PM=Wxe([Hxe(0,At)],uL);N("symbolIcon.arrayForeground",{dark:ae,light:ae,hcDark:ae,hcLight:ae},p("symbolIcon.arrayForeground","The foreground color for array symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));N("symbolIcon.booleanForeground",{dark:ae,light:ae,hcDark:ae,hcLight:ae},p("symbolIcon.booleanForeground","The foreground color for boolean symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));N("symbolIcon.classForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},p("symbolIcon.classForeground","The foreground color for class symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));N("symbolIcon.colorForeground",{dark:ae,light:ae,hcDark:ae,hcLight:ae},p("symbolIcon.colorForeground","The foreground color for color symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));N("symbolIcon.constantForeground",{dark:ae,light:ae,hcDark:ae,hcLight:ae},p("symbolIcon.constantForeground","The foreground color for constant symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));N("symbolIcon.constructorForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},p("symbolIcon.constructorForeground","The foreground color for constructor symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));N("symbolIcon.enumeratorForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},p("symbolIcon.enumeratorForeground","The foreground color for enumerator symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));N("symbolIcon.enumeratorMemberForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},p("symbolIcon.enumeratorMemberForeground","The foreground color for enumerator member symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));N("symbolIcon.eventForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},p("symbolIcon.eventForeground","The foreground color for event symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));N("symbolIcon.fieldForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},p("symbolIcon.fieldForeground","The foreground color for field symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));N("symbolIcon.fileForeground",{dark:ae,light:ae,hcDark:ae,hcLight:ae},p("symbolIcon.fileForeground","The foreground color for file symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));N("symbolIcon.folderForeground",{dark:ae,light:ae,hcDark:ae,hcLight:ae},p("symbolIcon.folderForeground","The foreground color for folder symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));N("symbolIcon.functionForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},p("symbolIcon.functionForeground","The foreground color for function symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));N("symbolIcon.interfaceForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},p("symbolIcon.interfaceForeground","The foreground color for interface symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));N("symbolIcon.keyForeground",{dark:ae,light:ae,hcDark:ae,hcLight:ae},p("symbolIcon.keyForeground","The foreground color for key symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));N("symbolIcon.keywordForeground",{dark:ae,light:ae,hcDark:ae,hcLight:ae},p("symbolIcon.keywordForeground","The foreground color for keyword symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));N("symbolIcon.methodForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},p("symbolIcon.methodForeground","The foreground color for method symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));N("symbolIcon.moduleForeground",{dark:ae,light:ae,hcDark:ae,hcLight:ae},p("symbolIcon.moduleForeground","The foreground color for module symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));N("symbolIcon.namespaceForeground",{dark:ae,light:ae,hcDark:ae,hcLight:ae},p("symbolIcon.namespaceForeground","The foreground color for namespace symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));N("symbolIcon.nullForeground",{dark:ae,light:ae,hcDark:ae,hcLight:ae},p("symbolIcon.nullForeground","The foreground color for null symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));N("symbolIcon.numberForeground",{dark:ae,light:ae,hcDark:ae,hcLight:ae},p("symbolIcon.numberForeground","The foreground color for number symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));N("symbolIcon.objectForeground",{dark:ae,light:ae,hcDark:ae,hcLight:ae},p("symbolIcon.objectForeground","The foreground color for object symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));N("symbolIcon.operatorForeground",{dark:ae,light:ae,hcDark:ae,hcLight:ae},p("symbolIcon.operatorForeground","The foreground color for operator symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));N("symbolIcon.packageForeground",{dark:ae,light:ae,hcDark:ae,hcLight:ae},p("symbolIcon.packageForeground","The foreground color for package symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));N("symbolIcon.propertyForeground",{dark:ae,light:ae,hcDark:ae,hcLight:ae},p("symbolIcon.propertyForeground","The foreground color for property symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));N("symbolIcon.referenceForeground",{dark:ae,light:ae,hcDark:ae,hcLight:ae},p("symbolIcon.referenceForeground","The foreground color for reference symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));N("symbolIcon.snippetForeground",{dark:ae,light:ae,hcDark:ae,hcLight:ae},p("symbolIcon.snippetForeground","The foreground color for snippet symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));N("symbolIcon.stringForeground",{dark:ae,light:ae,hcDark:ae,hcLight:ae},p("symbolIcon.stringForeground","The foreground color for string symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));N("symbolIcon.structForeground",{dark:ae,light:ae,hcDark:ae,hcLight:ae},p("symbolIcon.structForeground","The foreground color for struct symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));N("symbolIcon.textForeground",{dark:ae,light:ae,hcDark:ae,hcLight:ae},p("symbolIcon.textForeground","The foreground color for text symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));N("symbolIcon.typeParameterForeground",{dark:ae,light:ae,hcDark:ae,hcLight:ae},p("symbolIcon.typeParameterForeground","The foreground color for type parameter symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));N("symbolIcon.unitForeground",{dark:ae,light:ae,hcDark:ae,hcLight:ae},p("symbolIcon.unitForeground","The foreground color for unit symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));N("symbolIcon.variableForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},p("symbolIcon.variableForeground","The foreground color for variable symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));const dq=Object.freeze({kind:Bt.Empty,title:p("codeAction.widget.id.more","More Actions...")}),Vxe=Object.freeze([{kind:li.QuickFix,title:p("codeAction.widget.id.quickfix","Quick Fix")},{kind:li.RefactorExtract,title:p("codeAction.widget.id.extract","Extract"),icon:oe.wrench},{kind:li.RefactorInline,title:p("codeAction.widget.id.inline","Inline"),icon:oe.wrench},{kind:li.RefactorRewrite,title:p("codeAction.widget.id.convert","Rewrite"),icon:oe.wrench},{kind:li.RefactorMove,title:p("codeAction.widget.id.move","Move"),icon:oe.wrench},{kind:li.SurroundWith,title:p("codeAction.widget.id.surround","Surround With"),icon:oe.surroundWith},{kind:li.Source,title:p("codeAction.widget.id.source","Source Action"),icon:oe.symbolFile},dq]);function zxe(s,e,t){if(!e)return s.map(o=>{var r;return{kind:"action",item:o,group:dq,disabled:!!o.action.disabled,label:o.action.disabled||o.action.title,canPreview:!!(!((r=o.action.edit)===null||r===void 0)&&r.edits.length)}});const i=Vxe.map(o=>({group:o,actions:[]}));for(const o of s){const r=o.action.kind?new Bt(o.action.kind):Bt.None;for(const a of i)if(a.group.kind.contains(r)){a.actions.push(o);break}}const n=[];for(const o of i)if(o.actions.length){n.push({kind:"header",group:o.group});for(const r of o.actions){const a=o.group;n.push({kind:"action",item:r,group:r.action.isAI?{title:a.title,kind:a.kind,icon:oe.sparkle}:a,label:r.action.title,disabled:!!r.action.disabled,keybinding:t(r.action)})}}return n}var Uxe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},O7=function(s,e){return function(t,i){e(t,i,s)}},FM,bm;(function(s){s.Hidden={type:0};class e{constructor(i,n,o,r){this.actions=i,this.trigger=n,this.editorPosition=o,this.widgetPosition=r,this.type=1}}s.Showing=e})(bm||(bm={}));let Ff=FM=class extends H{constructor(e,t,i){super(),this._editor=e,this._keybindingService=t,this._onClick=this._register(new B),this.onClick=this._onClick.event,this._state=bm.Hidden,this._iconClasses=[],this._domNode=he("div.lightBulbWidget"),this._domNode.role="listbox",this._register(Gt.ignoreTarget(this._domNode)),this._editor.addContentWidget(this),this._register(this._editor.onDidChangeModelContent(n=>{const o=this._editor.getModel();(this.state.type!==1||!o||this.state.editorPosition.lineNumber>=o.getLineCount())&&this.hide()})),this._register(Pae(this._domNode,n=>{if(this.state.type!==1)return;this._editor.focus(),n.preventDefault();const{top:o,height:r}=qi(this._domNode),a=this._editor.getOption(67);let l=Math.floor(a/3);this.state.widgetPosition.position!==null&&this.state.widgetPosition.position.lineNumber{(n.buttons&1)===1&&this.hide()})),this._register(le.runAndSubscribe(this._keybindingService.onDidUpdateKeybindings,()=>{var n,o,r,a;this._preferredKbLabel=(o=(n=this._keybindingService.lookupKeybinding(rq))===null||n===void 0?void 0:n.getLabel())!==null&&o!==void 0?o:void 0,this._quickFixKbLabel=(a=(r=this._keybindingService.lookupKeybinding(u4))===null||r===void 0?void 0:r.getLabel())!==null&&a!==void 0?a:void 0,this._updateLightBulbTitleAndIcon()}))}dispose(){super.dispose(),this._editor.removeContentWidget(this)}getId(){return"LightBulbWidget"}getDomNode(){return this._domNode}getPosition(){return this._state.type===1?this._state.widgetPosition:null}update(e,t,i){if(e.validActions.length<=0)return this.hide();if(!this._editor.getOptions().get(65).enabled)return this.hide();const o=this._editor.getModel();if(!o)return this.hide();const{lineNumber:r,column:a}=o.validatePosition(i),l=o.getOptions().tabSize,d=this._editor.getOptions().get(50),c=o.getLineContent(r),u=Tx(c,l),h=d.spaceWidth*u>22,g=_=>_>2&&this._editor.getTopForLineNumber(_)===this._editor.getTopForLineNumber(_-1);let f=r,m=1;if(!h){if(r>1&&!g(r-1))f-=1;else if(r=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},OM=function(s,e){return function(t,i){e(t,i,s)}};const uq="acceptSelectedCodeAction",hq="previewSelectedCodeAction";class $xe{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){var n,o;i.text.textContent=(o=(n=e.group)===null||n===void 0?void 0:n.title)!==null&&o!==void 0?o:""}disposeTemplate(e){}}let BM=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=new m0(e,Lo);return{container:e,icon:t,text:i,keybinding:n}}renderElement(e,t,i){var n,o,r;if(!((n=e.group)===null||n===void 0)&&n.icon?(i.icon.className=Pe.asClassName(e.group.icon),e.group.icon.color&&(i.icon.style.color=fe(e.group.icon.color.id))):(i.icon.className=Pe.asClassName(oe.lightBulb),i.icon.style.color="var(--vscode-editorLightBulb-foreground)"),!e.item||!e.label)return;i.text.textContent=gq(e.label),i.keybinding.set(e.keybinding),Xae(!!e.keybinding,i.keybinding.element);const a=(o=this._keybindingService.lookupKeybinding(uq))===null||o===void 0?void 0:o.getLabel(),l=(r=this._keybindingService.lookupKeybinding(hq))===null||r===void 0?void 0:r.getLabel();i.container.classList.toggle("option-disabled",e.disabled),e.disabled?i.container.title=e.label:a&&l?this._supportsPreview&&e.canPreview?i.container.title=p({},"{0} to Apply, {1} to Preview",a,l):i.container.title=p({},"{0} to Apply",a):i.container.title=""}disposeTemplate(e){e.keybinding.dispose()}};BM=cq([OM(1,At)],BM);class jxe extends UIEvent{constructor(){super("acceptSelectedAction")}}class B7 extends UIEvent{constructor(){super("previewSelectedAction")}}function Kxe(s){if(s.kind==="action")return s.label}let WM=class extends H{constructor(e,t,i,n,o,r){super(),this._delegate=n,this._contextViewService=o,this._keybindingService=r,this._actionLineHeight=24,this._headerLineHeight=26,this.cts=this._register(new Vi),this.domNode=document.createElement("div"),this.domNode.classList.add("actionList");const a={getHeight:l=>l.kind==="header"?this._headerLineHeight:this._actionLineHeight,getTemplateId:l=>l.kind};this._list=this._register(new pr(e,this.domNode,a,[new BM(t,this._keybindingService),new $xe],{keyboardSupport:!1,typeNavigationEnabled:!0,keyboardNavigationLabelProvider:{getKeyboardNavigationLabel:Kxe},accessibilityProvider:{getAriaLabel:l=>{if(l.kind==="action"){let d=l.label?gq(l==null?void 0:l.label):"";return l.disabled&&(d=p({},"{0}, Disabled Reason: {1}",d,l.disabled)),d}return null},getWidgetAriaLabel:()=>p({},"Action Widget"),getRole:l=>l.kind==="action"?"option":"separator",getWidgetRole:()=>"listbox"}})),this._list.style(cp),this._register(this._list.onMouseClick(l=>this.onListClick(l))),this._register(this._list.onMouseOver(l=>this.onListHover(l))),this._register(this._list.onDidChangeFocus(()=>this.onFocus())),this._register(this._list.onDidChangeSelection(l=>this.onListSelection(l))),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(l=>l.kind==="header").length,n=this._allMenuItems.length*this._actionLineHeight+t*this._headerLineHeight-t*this._actionLineHeight;this._list.layout(n);let o=e;if(this._allMenuItems.length>=50)o=380;else{const l=this._allMenuItems.map((d,c)=>{const u=this.domNode.ownerDocument.getElementById(this._list.getElementID(c));if(u){u.style.width="auto";const h=u.getBoundingClientRect().width;return u.style.width="",h}return 0});o=Math.max(...l,e)}const a=Math.min(n,this.domNode.ownerDocument.body.clientHeight*.7);return this._list.layout(a,o),this.domNode.style.height=`${a}px`,this._list.domFocus(),o}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 o=e?new B7:new jxe;this._list.setSelection([i],o)}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 B7):this._list.setSelection([])}onFocus(){var e,t;const i=this._list.getFocus();if(i.length===0)return;const n=i[0],o=this._list.element(n);(t=(e=this._delegate).onFocus)===null||t===void 0||t.call(e,o.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([])}};WM=cq([OM(4,nu),OM(5,At)],WM);function gq(s){return s.replace(/\r\n|\r|\n/g," ")}var qxe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},sT=function(s,e){return function(t,i){e(t,i,s)}};N("actionBar.toggledBackground",{dark:Zg,light:Zg,hcDark:Zg,hcLight:Zg},p("actionBar.toggledBackground","Background color for toggled action items in action bar."));const Of={Visible:new ue("codeActionMenuVisible",!1,p("codeActionMenuVisible","Whether the action widget list is visible"))},mp=ut("actionWidgetService");let Bf=class extends H{get isVisible(){return Of.Visible.getValue(this._contextKeyService)||!1}constructor(e,t,i){super(),this._contextViewService=e,this._contextKeyService=t,this._instantiationService=i,this._list=this._register(new $n)}show(e,t,i,n,o,r,a){const l=Of.Visible.bindTo(this._contextKeyService),d=this._instantiationService.createInstance(WM,e,t,i,n);this._contextViewService.showContextView({getAnchor:()=>o,render:c=>(l.set(!0),this._renderWidget(c,d,a??[])),onHide:c=>{l.reset(),this._onWidgetClosed(c)}},r,!1)}acceptSelected(e){var t;(t=this._list.value)===null||t===void 0||t.acceptSelected(e)}focusPrevious(){var e,t;(t=(e=this._list)===null||e===void 0?void 0:e.value)===null||t===void 0||t.focusPrevious()}focusNext(){var e,t;(t=(e=this._list)===null||e===void 0?void 0:e.value)===null||t===void 0||t.focusNext()}hide(e){var t;(t=this._list.value)===null||t===void 0||t.hide(e),this._list.clear()}_renderWidget(e,t,i){var n;const o=document.createElement("div");if(o.classList.add("action-widget"),e.appendChild(o),this._list.value=t,this._list.value)o.appendChild(this._list.value.domNode);else throw new Error("List has no value");const r=new Y,a=document.createElement("div"),l=e.appendChild(a);l.classList.add("context-view-block"),r.add(K(l,ee.MOUSE_DOWN,f=>f.stopPropagation()));const d=document.createElement("div"),c=e.appendChild(d);c.classList.add("context-view-pointerBlock"),r.add(K(c,ee.POINTER_MOVE,()=>c.remove())),r.add(K(c,ee.MOUSE_DOWN,()=>c.remove()));let u=0;if(i.length){const f=this._createActionBar(".action-widget-action-bar",i);f&&(o.appendChild(f.getContainer().parentElement),r.add(f),u=f.getContainer().offsetWidth)}const h=(n=this._list.value)===null||n===void 0?void 0:n.layout(u);o.style.width=`${h}px`;const g=r.add(ba(e));return r.add(g.onDidBlur(()=>this.hide(!0))),r}_createActionBar(e,t){if(!t.length)return;const i=he(e),n=new Vr(i);return n.push(t,{icon:!1,label:!0}),n}_onWidgetClosed(e){var t;(t=this._list.value)===null||t===void 0||t.hide(e)}};Bf=qxe([sT(0,nu),sT(1,Be),sT(2,Ne)],Bf);mt(mp,Bf,1);const V1=1100;qt(class extends qs{constructor(){super({id:"hideCodeActionWidget",title:Ve("hideCodeActionWidget.title","Hide action widget"),precondition:Of.Visible,keybinding:{weight:V1,primary:9,secondary:[1033]}})}run(s){s.get(mp).hide(!0)}});qt(class extends qs{constructor(){super({id:"selectPrevCodeAction",title:Ve("selectPrevCodeAction.title","Select previous action"),precondition:Of.Visible,keybinding:{weight:V1,primary:16,secondary:[2064],mac:{primary:16,secondary:[2064,302]}}})}run(s){const e=s.get(mp);e instanceof Bf&&e.focusPrevious()}});qt(class extends qs{constructor(){super({id:"selectNextCodeAction",title:Ve("selectNextCodeAction.title","Select next action"),precondition:Of.Visible,keybinding:{weight:V1,primary:18,secondary:[2066],mac:{primary:18,secondary:[2066,300]}}})}run(s){const e=s.get(mp);e instanceof Bf&&e.focusNext()}});qt(class extends qs{constructor(){super({id:uq,title:Ve("acceptSelected.title","Accept selected action"),precondition:Of.Visible,keybinding:{weight:V1,primary:3,secondary:[2137]}})}run(s){const e=s.get(mp);e instanceof Bf&&e.acceptSelected()}});qt(class extends qs{constructor(){super({id:hq,title:Ve("previewSelected.title","Preview selected action"),precondition:Of.Visible,keybinding:{weight:V1,primary:2051}})}run(s){const e=s.get(mp);e instanceof Bf&&e.acceptSelected(!0)}});const fq=new ue("supportedCodeAction",""),W7="_typescript.applyFixAllCodeAction";class Gxe extends H{constructor(e,t,i,n=250){super(),this._editor=e,this._markerService=t,this._signalChange=i,this._delay=n,this._autoTriggerTimer=this._register(new ya),this._register(this._markerService.onMarkerChanged(o=>this._onMarkerChanges(o))),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=>ZF(i,t.uri))&&this._tryAutoTrigger()}_tryAutoTrigger(){this._autoTriggerTimer.cancelAndSet(()=>{this.trigger({type:2,triggerAction:Ro.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(65).enabled;if(i!==ia.Off){{if(i===ia.On)return t;if(i===ia.OnCode){if(!t.isEmpty())return t;const o=this._editor.getModel(),{lineNumber:r,column:a}=t.getPosition(),l=o.getLineContent(r);if(l.length===0)return;if(a===1){if(/\s/.test(l[0]))return}else if(a===o.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 $g;(function(s){s.Empty={type:0};class e{constructor(i,n,o){this.trigger=i,this.position=n,this._cancellablePromise=o,this.type=1,this.actions=o.catch(r=>{if(Id(r))return pq;throw r})}cancel(){this._cancellablePromise.cancel()}}s.Triggered=e})($g||($g={}));const pq=Object.freeze({allActions:[],validActions:[],dispose:()=>{},documentation:[],hasAutoFix:!1,hasAIFix:!1,allAIFixes:!1});class Zxe extends H{constructor(e,t,i,n,o,r){super(),this._editor=e,this._registry=t,this._markerService=i,this._progressService=o,this._configurationService=r,this._codeActionOracle=this._register(new $n),this._state=$g.Empty,this._onDidChangeState=this._register(new B),this.onDidChangeState=this._onDidChangeState.event,this._disposed=!1,this._supportedCodeActions=fq.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(65)&&this._update()})),this._update()}dispose(){this._disposed||(this._disposed=!0,super.dispose(),this.setState($g.Empty,!0))}_settingEnabledNearbyQuickfixes(){var e;const t=(e=this._editor)===null||e===void 0?void 0:e.getModel();return this._configurationService?this._configurationService.getValue("editor.codeActionWidget.includeNearbyQuickFixes",{resource:t==null?void 0:t.uri}):!1}_update(){if(this._disposed)return;this._codeActionOracle.value=void 0,this.setState($g.Empty);const e=this._editor.getModel();if(e&&this._registry.has(e)&&!this._editor.getOption(91)){const t=this._registry.all(e).flatMap(i=>{var n;return(n=i.providedCodeActionKinds)!==null&&n!==void 0?n:[]});this._supportedCodeActions.set(t.join(" ")),this._codeActionOracle.value=new Gxe(this._editor,this._markerService,i=>{var n;if(!i){this.setState($g.Empty);return}const o=i.selection.getStartPosition(),r=Dn(async d=>{var c,u,h,g,f,m,_,v,b,C;if(this._settingEnabledNearbyQuickfixes()&&i.trigger.type===1&&(i.trigger.triggerAction===Ro.QuickFix||!((u=(c=i.trigger.filter)===null||c===void 0?void 0:c.include)===null||u===void 0)&&u.contains(li.QuickFix))){const w=await gb(this._registry,e,i.selection,i.trigger,Nc.None,d),y=[...w.allActions];if(d.isCancellationRequested)return pq;const D=(h=w.validActions)===null||h===void 0?void 0:h.some(k=>k.action.kind?li.QuickFix.contains(new Bt(k.action.kind)):!1),L=this._markerService.read({resource:e.uri});if(D){for(const k of w.validActions)!((f=(g=k.action.command)===null||g===void 0?void 0:g.arguments)===null||f===void 0)&&f.some(I=>typeof I=="string"&&I.includes(W7))&&(k.action.diagnostics=[...L.filter(I=>I.relatedInformation)]);return{validActions:w.validActions,allActions:y,documentation:w.documentation,hasAutoFix:w.hasAutoFix,hasAIFix:w.hasAIFix,allAIFixes:w.allAIFixes,dispose:()=>{w.dispose()}}}else if(!D&&L.length>0){const k=i.selection.getPosition();let I=k,O=Number.MAX_VALUE;const R=[...w.validActions];for(const F of L){const V=F.endColumn,U=F.endLineNumber,J=F.startLineNumber;if(U===k.lineNumber||J===k.lineNumber){I=new W(U,V);const pe={type:i.trigger.type,triggerAction:i.trigger.triggerAction,filter:{include:!((m=i.trigger.filter)===null||m===void 0)&&m.include?(_=i.trigger.filter)===null||_===void 0?void 0:_.include:li.QuickFix},autoApply:i.trigger.autoApply,context:{notAvailableMessage:((v=i.trigger.context)===null||v===void 0?void 0:v.notAvailableMessage)||"",position:I}},De=new we(I.lineNumber,I.column,I.lineNumber,I.column),ge=await gb(this._registry,e,De,pe,Nc.None,d);if(ge.validActions.length!==0){for(const We of ge.validActions)!((C=(b=We.action.command)===null||b===void 0?void 0:b.arguments)===null||C===void 0)&&C.some(ye=>typeof ye=="string"&&ye.includes(W7))&&(We.action.diagnostics=[...L.filter(ye=>ye.relatedInformation)]);w.allActions.length===0&&y.push(...ge.allActions),Math.abs(k.column-V)U.findIndex(J=>J.action.title===F.action.title)===V);return P.sort((F,V)=>F.action.isPreferred&&!V.action.isPreferred?-1:!F.action.isPreferred&&V.action.isPreferred||F.action.isAI&&!V.action.isAI?1:!F.action.isAI&&V.action.isAI?-1:0),{validActions:P,allActions:y,documentation:w.documentation,hasAutoFix:w.hasAutoFix,hasAIFix:w.hasAIFix,allAIFixes:w.allAIFixes,dispose:()=>{w.dispose()}}}}return gb(this._registry,e,i.selection,i.trigger,Nc.None,d)});i.trigger.type===1&&((n=this._progressService)===null||n===void 0||n.showWhile(r,250));const a=new $g.Triggered(i.trigger,o,r);let l=!1;this._state.type===1&&(l=this._state.trigger.type===1&&a.type===1&&a.trigger.type===2&&this._state.position!==a.position),l?setTimeout(()=>{this.setState(a)},500):this.setState(a)},void 0),this._codeActionOracle.value.trigger({type:2,triggerAction:Ro.Default})}else this._supportedCodeActions.reset()}trigger(e){var t;(t=this._codeActionOracle.value)===null||t===void 0||t.trigger(e)}setState(e,t){e!==this._state&&(this._state.type===1&&this._state.cancel(),this._state=e,!t&&!this._disposed&&this._onDidChangeState.fire(e))}}var Xxe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Dl=function(s,e){return function(t,i){e(t,i,s)}},jp;const Yxe="quickfix-edit-highlight";let Hh=jp=class extends H{static get(e){return e.getContribution(jp.ID)}constructor(e,t,i,n,o,r,a,l,d,c,u){super(),this._commandService=a,this._configurationService=l,this._actionWidgetService=d,this._instantiationService=c,this._telemetryService=u,this._activeCodeActions=this._register(new $n),this._showDisabled=!1,this._disposed=!1,this._editor=e,this._model=this._register(new Zxe(this._editor,o.codeActionProvider,t,i,r,l)),this._register(this._model.onDidChangeState(h=>this.update(h))),this._lightBulbWidget=new gl(()=>{const h=this._editor.getContribution(Ff.ID);return h&&this._register(h.onClick(g=>this.showCodeActionsFromLightbulb(g.actions,g))),h}),this._resolver=n.createInstance(uL),this._register(this._editor.onDidLayoutChange(()=>this._actionWidgetService.hide()))}dispose(){this._disposed=!0,super.dispose()}async showCodeActionsFromLightbulb(e,t){if(this._telemetryService.publicLog2("codeAction.showCodeActionsFromLightbulb",{codeActionListLength:e.validActions.length,codeActions:e.validActions.map(i=>i.action.title),codeActionProviders:e.validActions.map(i=>{var n,o;return(o=(n=i.provider)===null||n===void 0?void 0:n.displayName)!==null&&o!==void 0?o:""})}),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],autoSend:!1}),await this._applyCodeAction(i,!1,!1,nf.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){var o;if(!this._editor.hasModel())return;(o=Vs.get(this._editor))===null||o===void 0||o.closeMessage();const r=this._editor.getPosition();this._trigger({type:1,triggerAction:t,filter:i,autoApply:n,context:{notAvailableMessage:e,position:r}})}_trigger(e){return this._model.trigger(e)}async _applyCodeAction(e,t,i,n){try{await this._instantiationService.invokeFunction(Oxe,e,n,{preview:i,editor:this._editor})}finally{t&&this._trigger({type:2,triggerAction:Ro.QuickFix,filter:{}})}}async update(e){var t,i,n,o,r,a,l;if(e.type!==1){(t=this._lightBulbWidget.rawValue)===null||t===void 0||t.hide();return}let d;try{d=await e.actions}catch(c){Xe(c);return}if(!this._disposed)if((i=this._lightBulbWidget.value)===null||i===void 0||i.update(d,e.trigger,e.position),e.trigger.type===1){if(!((n=e.trigger.filter)===null||n===void 0)&&n.include){const u=this.tryGetValidActionToApply(e.trigger,d);if(u){try{(o=this._lightBulbWidget.value)===null||o===void 0||o.hide(),await this._applyCodeAction(u,!1,!1,nf.FromCodeActions)}finally{d.dispose()}return}if(e.trigger.context){const h=this.getInvalidActionThatWouldHaveBeenApplied(e.trigger,d);if(h&&h.action.disabled){(r=Vs.get(this._editor))===null||r===void 0||r.showMessage(h.action.disabled,e.trigger.context.position),d.dispose();return}}}const c=!!(!((a=e.trigger.filter)===null||a===void 0)&&a.include);if(e.trigger.context&&(!d.allActions.length||!c&&!d.validActions.length)){(l=Vs.get(this._editor))===null||l===void 0||l.showMessage(e.trigger.context.notAvailableMessage,e.trigger.context.position),this._activeCodeActions.value=d,d.dispose();return}this._activeCodeActions.value=d,this.showCodeActionList(d,this.toCoords(e.position),{includeDisabledActions:c,fromLightbulb:!1})}else this._actionWidgetService.isVisible?d.dispose():this._activeCodeActions.value=d}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]}async showCodeActionList(e,t,i){const n=this._editor.createDecorationsCollection(),o=this._editor.getDomNode();if(!o)return;const r=i.includeDisabledActions&&(this._showDisabled||e.validActions.length===0)?e.allActions:e.validActions;if(!r.length)return;const a=W.isIPosition(t)?this.toCoords(t):t,l={onSelect:async(d,c)=>{this._applyCodeAction(d,!0,!!c,i.fromLightbulb?nf.FromAILightbulb:nf.FromCodeActions),this._actionWidgetService.hide(!1),n.clear()},onHide:d=>{var c;(c=this._editor)===null||c===void 0||c.focus(),n.clear(),i.fromLightbulb&&d!==void 0&&this._telemetryService.publicLog2("codeAction.showCodeActionList.onHide",{codeActionListLength:e.validActions.length,didCancel:d})},onHover:async(d,c)=>{var u;if(c.isCancellationRequested)return;let h=!1;const g=d.action.kind;if(g){const f=new Bt(g);h=[li.RefactorExtract,li.RefactorInline,li.RefactorRewrite,li.RefactorMove,li.Source].some(_=>_.contains(f))}return{canPreview:h||!!(!((u=d.action.edit)===null||u===void 0)&&u.edits.length)}},onFocus:d=>{var c,u;if(d&&d.action){const h=d.action.ranges,g=d.action.diagnostics;if(n.clear(),h&&h.length>0){const f=g&&(g==null?void 0:g.length)>1?g.map(m=>({range:m,options:jp.DECORATION})):h.map(m=>({range:m,options:jp.DECORATION}));n.set(f)}else if(g&&g.length>0){const f=g.map(_=>({range:_,options:jp.DECORATION}));n.set(f);const m=g[0];if(m.startLineNumber&&m.startColumn){const _=(u=(c=this._editor.getModel())===null||c===void 0?void 0:c.getWordAtPosition({lineNumber:m.startLineNumber,column:m.startColumn}))===null||u===void 0?void 0:u.word;Uc(p("editingNewSelection","Context: {0} at line {1} and column {2}.",_,m.startLineNumber,m.startColumn))}}}else n.clear()}};this._actionWidgetService.show("codeActionWidget",!0,zxe(r,this._shouldShowHeaders(),this._resolver.getResolver()),l,a,o,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=qi(this._editor.getDomNode()),n=i.left+t.left,o=i.top+t.top+t.height;return{x:n,y:o}}_shouldShowHeaders(){var e;const t=(e=this._editor)===null||e===void 0?void 0:e.getModel();return this._configurationService.getValue("editor.codeActionWidget.showHeaders",{resource:t==null?void 0:t.uri})}_getActionBarActions(e,t,i){if(i.fromLightbulb)return[];const n=e.documentation.map(o=>{var r;return{id:o.id,label:o.title,tooltip:(r=o.tooltip)!==null&&r!==void 0?r:"",class:void 0,enabled:!0,run:()=>{var a;return this._commandService.executeCommand(o.id,...(a=o.arguments)!==null&&a!==void 0?a:[])}}});return i.includeDisabledActions&&e.validActions.length>0&&e.allActions.length!==e.validActions.length&&n.push(this._showDisabled?{id:"hideMoreActions",label:p("hideMoreActions","Hide Disabled"),enabled:!0,tooltip:"",class:void 0,run:()=>(this._showDisabled=!1,this.showCodeActionList(e,t,i))}:{id:"showMoreActions",label:p("showMoreActions","Show Disabled"),enabled:!0,tooltip:"",class:void 0,run:()=>(this._showDisabled=!0,this.showCodeActionList(e,t,i))}),n}};Hh.ID="editor.contrib.codeActionController";Hh.DECORATION=Ye.register({description:"quickfix-highlight",className:Yxe});Hh=jp=Xxe([Dl(1,Pd),Dl(2,Be),Dl(3,Ne),Dl(4,Ce),Dl(5,sg),Dl(6,gi),Dl(7,rt),Dl(8,mp),Dl(9,Ne),Dl(10,Gs)],Hh);zr((s,e)=>{((n,o)=>{o&&e.addRule(`.monaco-editor ${n} { background-color: ${o}; }`)})(".quickfix-edit-highlight",s.getColor(pc));const i=s.getColor(zu);i&&e.addRule(`.monaco-editor .quickfix-edit-highlight { border: 1px ${dd(s.type)?"dotted":"solid"} ${i}; box-sizing: border-box; }`)});function z1(s){return G.regex(fq.keys()[0],new RegExp("(\\s|^)"+rr(s.value)+"\\b"))}const f4={type:"object",defaultSnippets:[{body:{kind:""}}],properties:{kind:{type:"string",description:p("args.schema.kind","Kind of the code action to run.")},apply:{type:"string",description:p("args.schema.apply","Controls when the returned actions are applied."),default:"ifSingle",enum:["first","ifSingle","never"],enumDescriptions:[p("args.schema.apply.first","Always apply the first returned code action."),p("args.schema.apply.ifSingle","Apply the first returned code action if it is the only one."),p("args.schema.apply.never","Do not apply the returned code actions.")]},preferred:{type:"boolean",default:!1,description:p("args.schema.preferred","Controls if only preferred code actions should be returned.")}}};function _p(s,e,t,i,n=Ro.Default){if(s.hasModel()){const o=Hh.get(s);o==null||o.manualTriggerAtCurrentPosition(e,n,t,i)}}class Qxe extends me{constructor(){super({id:u4,label:p("quickfix.trigger.label","Quick Fix..."),alias:"Quick Fix...",precondition:G.and(T.writable,T.hasCodeActionsProvider),kbOpts:{kbExpr:T.textInputFocus,primary:2137,weight:100}})}run(e,t){return _p(t,p("editor.action.quickFix.noneMessage","No code actions available"),void 0,void 0,Ro.QuickFix)}}class Jxe extends mn{constructor(){super({id:oq,precondition:G.and(T.writable,T.hasCodeActionsProvider),metadata:{description:"Trigger a code action",args:[{name:"args",schema:f4}]}})}runEditorCommand(e,t,i){const n=Gl.fromUser(i,{kind:Bt.Empty,apply:"ifSingle"});return _p(t,typeof(i==null?void 0:i.kind)=="string"?n.preferred?p("editor.action.codeAction.noneMessage.preferred.kind","No preferred code actions for '{0}' available",i.kind):p("editor.action.codeAction.noneMessage.kind","No code actions for '{0}' available",i.kind):n.preferred?p("editor.action.codeAction.noneMessage.preferred","No preferred code actions available"):p("editor.action.codeAction.noneMessage","No code actions available"),{include:n.kind,includeSourceActions:!0,onlyIncludePreferredActions:n.preferred},n.apply)}}class eke extends me{constructor(){super({id:aq,label:p("refactor.label","Refactor..."),alias:"Refactor...",precondition:G.and(T.writable,T.hasCodeActionsProvider),kbOpts:{kbExpr:T.textInputFocus,primary:3120,mac:{primary:1328},weight:100},contextMenuOpts:{group:"1_modification",order:2,when:G.and(T.writable,z1(li.Refactor))},metadata:{description:"Refactor...",args:[{name:"args",schema:f4}]}})}run(e,t,i){const n=Gl.fromUser(i,{kind:li.Refactor,apply:"never"});return _p(t,typeof(i==null?void 0:i.kind)=="string"?n.preferred?p("editor.action.refactor.noneMessage.preferred.kind","No preferred refactorings for '{0}' available",i.kind):p("editor.action.refactor.noneMessage.kind","No refactorings for '{0}' available",i.kind):n.preferred?p("editor.action.refactor.noneMessage.preferred","No preferred refactorings available"):p("editor.action.refactor.noneMessage","No refactorings available"),{include:li.Refactor.contains(n.kind)?n.kind:Bt.None,onlyIncludePreferredActions:n.preferred},n.apply,Ro.Refactor)}}class tke extends me{constructor(){super({id:lq,label:p("source.label","Source Action..."),alias:"Source Action...",precondition:G.and(T.writable,T.hasCodeActionsProvider),contextMenuOpts:{group:"1_modification",order:2.1,when:G.and(T.writable,z1(li.Source))},metadata:{description:"Source Action...",args:[{name:"args",schema:f4}]}})}run(e,t,i){const n=Gl.fromUser(i,{kind:li.Source,apply:"never"});return _p(t,typeof(i==null?void 0:i.kind)=="string"?n.preferred?p("editor.action.source.noneMessage.preferred.kind","No preferred source actions for '{0}' available",i.kind):p("editor.action.source.noneMessage.kind","No source actions for '{0}' available",i.kind):n.preferred?p("editor.action.source.noneMessage.preferred","No preferred source actions available"):p("editor.action.source.noneMessage","No source actions available"),{include:li.Source.contains(n.kind)?n.kind:Bt.None,includeSourceActions:!0,onlyIncludePreferredActions:n.preferred},n.apply,Ro.SourceAction)}}class ike extends me{constructor(){super({id:h4,label:p("organizeImports.label","Organize Imports"),alias:"Organize Imports",precondition:G.and(T.writable,z1(li.SourceOrganizeImports)),kbOpts:{kbExpr:T.textInputFocus,primary:1581,weight:100}})}run(e,t){return _p(t,p("editor.action.organize.noneMessage","No organize imports action available"),{include:li.SourceOrganizeImports,includeSourceActions:!0},"ifSingle",Ro.OrganizeImports)}}class nke extends me{constructor(){super({id:g4,label:p("fixAll.label","Fix All"),alias:"Fix All",precondition:G.and(T.writable,z1(li.SourceFixAll))})}run(e,t){return _p(t,p("fixAll.noneMessage","No fix all action available"),{include:li.SourceFixAll,includeSourceActions:!0},"ifSingle",Ro.FixAll)}}class ske extends me{constructor(){super({id:rq,label:p("autoFix.label","Auto Fix..."),alias:"Auto Fix...",precondition:G.and(T.writable,z1(li.QuickFix)),kbOpts:{kbExpr:T.textInputFocus,primary:1625,mac:{primary:2649},weight:100}})}run(e,t){return _p(t,p("editor.action.autoFix.noneMessage","No auto fixes available"),{include:li.QuickFix,onlyIncludePreferredActions:!0},"ifSingle",Ro.AutoFix)}}kt(Hh.ID,Hh,3);kt(Ff.ID,Ff,4);te(Qxe);te(eke);te(tke);te(ike);te(ske);te(nke);de(new Jxe);Ji.as(pl.Configuration).registerConfiguration({...Vx,properties:{"editor.codeActionWidget.showHeaders":{type:"boolean",scope:5,description:p("showCodeActionHeaders","Enable/disable showing group headers in the Code Action menu."),default:!0}}});Ji.as(pl.Configuration).registerConfiguration({...Vx,properties:{"editor.codeActionWidget.includeNearbyQuickFixes":{type:"boolean",scope:5,description:p("includeNearbyQuickFixes","Enable/disable showing nearest Quick Fix within a line when not currently on a diagnostic."),default:!0}}});class HM{constructor(){this.lenses=[],this._disposables=new Y}dispose(){this._disposables.dispose()}get isDisposed(){return this._disposables.isDisposed}add(e,t){this._disposables.add(e);for(const i of e.lenses)this.lenses.push({symbol:i,provider:t})}}async function mq(s,e,t){const i=s.ordered(e),n=new Map,o=new HM,r=i.map(async(a,l)=>{n.set(a,l);try{const d=await Promise.resolve(a.provideCodeLenses(e,t));d&&o.add(d,a)}catch(d){Ai(d)}});return await Promise.all(r),o.lenses=o.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),o}pt.registerCommand("_executeCodeLensProvider",function(s,...e){let[t,i]=e;yt(Ae.isUri(t)),yt(typeof i=="number"||!i);const{codeLensProvider:n}=s.get(Ce),o=s.get(_i).getModel(t);if(!o)throw Mr();const r=[],a=new Y;return mq(n,o,dt.None).then(l=>{a.add(l);const d=[];for(const c of l.lenses)i==null||c.symbol.command?r.push(c.symbol):i-- >0&&c.provider.resolveCodeLens&&d.push(Promise.resolve(c.provider.resolveCodeLens(o,c.symbol,dt.None)).then(u=>r.push(u||c.symbol)));return Promise.all(d)}).then(()=>r).finally(()=>{setTimeout(()=>a.dispose(),100)})});var oke=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},rke=function(s,e){return function(t,i){e(t,i,s)}};const _q=ut("ICodeLensCache");class H7{constructor(e,t){this.lineCount=e,this.data=t}}let VM=class{constructor(e){this._fakeProvider=new class{provideCodeLenses(){throw new Error("not supported")}},this._cache=new iu(20,.75);const t="codelens/cache";uv(Ht,()=>e.remove(t,1));const i="codelens/cache2",n=e.get(i,1,"{}");this._deserialize(n),le.once(e.onWillSaveState)(o=>{o.reason===ED.SHUTDOWN&&e.store(i,this._serialize(),1,1)})}put(e,t){const i=t.lenses.map(r=>{var a;return{range:r.symbol.range,command:r.symbol.command&&{id:"",title:(a=r.symbol.command)===null||a===void 0?void 0:a.title}}}),n=new HM;n.add({lenses:i,dispose:()=>{}},this._fakeProvider);const o=new H7(e.getLineCount(),n);this._cache.set(e.uri.toString(),o)}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 o of i.data.lenses)n.add(o.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],o=[];for(const a of n.lines)o.push({range:new x(a,1,a,11)});const r=new HM;r.add({lenses:o,dispose(){}},this._fakeProvider),this._cache.set(i,new H7(n.lineCount,r))}}catch{}}};VM=oke([rke(0,Rd)],VM);mt(_q,VM,1);class ake{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 AC{constructor(e,t){this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this._commands=new Map,this._isEmpty=!0,this._editor=e,this._id=`codelens.widget-${AC._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 o=0;o{d.symbol.command&&l.push(d.symbol),i.addDecoration({range:d.symbol.range,options:V7},u=>this._decorationIds[c]=u),a?a=x.plusRange(a,d.symbol.range):a=x.lift(d.symbol.range)}),this._viewZone=new ake(a.startLineNumber-1,o,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 AC(this._editor,this._viewZone.afterLineNumber+1),this._editor.addContentWidget(this._contentWidget))}dispose(e,t){this._decorationIds.forEach(e.removeDecoration,e),this._decorationIds=[],t==null||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&&x.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:V7},o=>this._decorationIds[n]=o)})}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=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},ev=function(s,e){return function(t,i){e(t,i,s)}};let W_=class{constructor(e,t,i,n,o,r){this._editor=e,this._languageFeaturesService=t,this._commandService=n,this._notificationService=o,this._codeLensCache=r,this._disposables=new Y,this._localToDispose=new Y,this._lenses=[],this._oldCodeLensModels=new Y,this._provideCodeLensDebounce=i.for(t.codeLensProvider,"CodeLensProvide",{min:250}),this._resolveCodeLensesDebounce=i.for(t.codeLensProvider,"CodeLensResolve",{min:250,salt:"resolve"}),this._resolveCodeLensesScheduler=new Wt(()=>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(50)||a.hasChanged(19)||a.hasChanged(18))&&this._updateLensStyle(),a.hasChanged(17)&&this._onModelChange()})),this._disposables.add(t.codeLensProvider.onDidChange(this._onModelChange,this)),this._onModelChange(),this._updateLensStyle()}dispose(){var e;this._localDispose(),this._disposables.dispose(),this._oldCodeLensModels.dispose(),(e=this._currentCodeLensModel)===null||e===void 0||e.dispose()}_getLayoutInfo(){const e=Math.max(1.3,this._editor.getOption(67)/this._editor.getOption(52));let t=this._editor.getOption(19);return(!t||t<5)&&(t=this._editor.getOption(52)*.9|0),{fontSize:t,codeLensHeight:t*e|0}}_updateLensStyle(){const{codeLensHeight:e,fontSize:t}=this._getLayoutInfo(),i=this._editor.getOption(18),n=this._editor.getOption(50),{style:o}=this._editor.getContainerDomNode();o.setProperty("--vscode-editorCodeLens-lineHeight",`${e}px`),o.setProperty("--vscode-editorCodeLens-fontSize",`${t}px`),o.setProperty("--vscode-editorCodeLens-fontFeatureSettings",n.fontFeatureSettings),i&&(o.setProperty("--vscode-editorCodeLens-fontFamily",i),o.setProperty("--vscode-editorCodeLens-fontFamilyDefault",co.fontFamily)),this._editor.changeViewZones(r=>{for(const a of this._lenses)a.updateHeight(e,r)})}_localDispose(){var e,t,i;(e=this._getCodeLensModelPromise)===null||e===void 0||e.cancel(),this._getCodeLensModelPromise=void 0,(t=this._resolveCodeLensesPromise)===null||t===void 0||t.cancel(),this._resolveCodeLensesPromise=void 0,this._localToDispose.clear(),this._oldCodeLensModels.clear(),(i=this._currentCodeLensModel)===null||i===void 0||i.dispose()}_onModelChange(){this._localDispose();const e=this._editor.getModel();if(!e||!this._editor.getOption(17)||e.isTooLargeForTokenization())return;const t=this._codeLensCache.get(e);if(t&&this._renderCodeLensSymbols(t),!this._languageFeaturesService.codeLensProvider.has(e)){t&&kh(()=>{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 o=n.onDidChange(()=>i.schedule());this._localToDispose.add(o)}const i=new Wt(()=>{var n;const o=Date.now();(n=this._getCodeLensModelPromise)===null||n===void 0||n.cancel(),this._getCodeLensModelPromise=Dn(r=>mq(this._languageFeaturesService.codeLensProvider,e,r)),this._getCodeLensModelPromise.then(r=>{this._currentCodeLensModel&&this._oldCodeLensModels.add(this._currentCodeLensModel),this._currentCodeLensModel=r,this._codeLensCache.put(e,r);const a=this._provideCodeLensDebounce.update(e,Date.now()-o);i.delay=a,this._renderCodeLensSymbols(r),this._resolveCodeLensesInViewportSoon()},Xe)},this._provideCodeLensDebounce.get(e));this._localToDispose.add(i),this._localToDispose.add(Ie(()=>this._resolveCodeLensesScheduler.cancel())),this._localToDispose.add(this._editor.onDidChangeModelContent(()=>{var n;this._editor.changeDecorations(o=>{this._editor.changeViewZones(r=>{const a=[];let l=-1;this._lenses.forEach(c=>{!c.isValid()||l===c.getLineNumber()?a.push(c):(c.update(r),l=c.getLineNumber())});const d=new oT;a.forEach(c=>{c.dispose(d,r),this._lenses.splice(this._lenses.indexOf(c),1)}),d.commit(o)})}),i.schedule(),this._resolveCodeLensesScheduler.cancel(),(n=this._resolveCodeLensesPromise)===null||n===void 0||n.cancel(),this._resolveCodeLensesPromise=void 0})),this._localToDispose.add(this._editor.onDidFocusEditorWidget(()=>{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(Ie(()=>{if(this._editor.getModel()){const n=cl.capture(this._editor);this._editor.changeDecorations(o=>{this._editor.changeViewZones(r=>{this._disposeAllLenses(o,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 o=n.target.element;if((o==null?void 0:o.tagName)==="SPAN"&&(o=o.parentElement),(o==null?void 0:o.tagName)==="A")for(const r of this._lenses){const a=r.getCommand(o);if(a){this._commandService.executeCommand(a.id,...a.arguments||[]).catch(l=>this._notificationService.error(l));break}}})),i.schedule()}_disposeAllLenses(e,t){const i=new oT;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 o=cl.capture(this._editor),r=this._getLayoutInfo();this._editor.changeDecorations(a=>{this._editor.changeViewZones(l=>{const d=new oT;let c=0,u=0;for(;uthis._resolveCodeLensesInViewportSoon())),c++,u++)}for(;cthis._resolveCodeLensesInViewportSoon())),u++;d.commit(a)})}),o.restore(this._editor)}_resolveCodeLensesInViewportSoon(){this._editor.getModel()&&this._resolveCodeLensesScheduler.schedule()}_resolveCodeLensesInViewport(){var e;(e=this._resolveCodeLensesPromise)===null||e===void 0||e.cancel(),this._resolveCodeLensesPromise=void 0;const t=this._editor.getModel();if(!t)return;const i=[],n=[];if(this._lenses.forEach(a=>{const l=a.computeIfNecessary(t);l&&(i.push(l),n.push(a))}),i.length===0)return;const o=Date.now(),r=Dn(a=>{const l=i.map((d,c)=>{const u=new Array(d.length),h=d.map((g,f)=>!g.symbol.command&&typeof g.provider.resolveCodeLens=="function"?Promise.resolve(g.provider.resolveCodeLens(t,g.symbol,a)).then(m=>{u[f]=m},Ai):(u[f]=g.symbol,Promise.resolve(void 0)));return Promise.all(h).then(()=>{!a.isCancellationRequested&&!n[c].isDisposed()&&n[c].updateCommands(u)})});return Promise.all(l)});this._resolveCodeLensesPromise=r,this._resolveCodeLensesPromise.then(()=>{const a=this._resolveCodeLensesDebounce.update(t,Date.now()-o);this._resolveCodeLensesScheduler.delay=a,this._currentCodeLensModel&&this._codeLensCache.put(t,this._currentCodeLensModel),this._oldCodeLensModels.clear(),r===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)},a=>{Xe(a),r===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)})}async getModel(){var e;return await this._getCodeLensModelPromise,await this._resolveCodeLensesPromise,!((e=this._currentCodeLensModel)===null||e===void 0)&&e.isDisposed?void 0:this._currentCodeLensModel}};W_.ID="css.editor.codeLens";W_=lke([ev(1,Ce),ev(2,Ur),ev(3,gi),ev(4,en),ev(5,_q)],W_);kt(W_.ID,W_,1);te(class extends me{constructor(){super({id:"codelens.showLensesInCurrentLine",precondition:T.hasCodeLensProvider,label:p("showLensOnLine","Show CodeLens Commands For Current Line"),alias:"Show CodeLens Commands For Current Line"})}async run(e,t){if(!t.hasModel())return;const i=e.get(hp),n=e.get(gi),o=e.get(en),r=t.getSelection().positionLineNumber,a=t.getContribution(W_.ID);if(!a)return;const l=await a.getModel();if(!l)return;const d=[];for(const h of l.lenses)h.symbol.command&&h.symbol.range.startLineNumber===r&&d.push({label:h.symbol.command.title,command:h.symbol.command});if(d.length===0)return;const c=await i.pick(d,{canPickMany:!1,placeHolder:p("placeHolder","Select a command")});if(!c)return;let u=c.command;if(l.isDisposed){const h=await a.getModel(),g=h==null?void 0:h.lenses.find(f=>{var m;return f.symbol.range.startLineNumber===r&&((m=f.symbol.command)===null||m===void 0?void 0:m.title)===u.title});if(!g||!g.symbol.command)return;u=g.symbol.command}try{await n.executeCommand(u.id,...u.arguments||[])}catch(h){o.error(h)}}});var dke=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},rT=function(s,e){return function(t,i){e(t,i,s)}};class p4{constructor(e,t){this._editorWorkerClient=new LF(e,!1,"editorWorkerService",t)}async provideDocumentColors(e,t){return this._editorWorkerClient.computeDefaultDocumentColors(e.uri)}provideColorPresentations(e,t,i){const n=t.range,o=t.color,r=o.alpha,a=new $(new bt(Math.round(255*o.red),Math.round(255*o.green),Math.round(255*o.blue),r)),l=r?$.Format.CSS.formatRGB(a):$.Format.CSS.formatRGBA(a),d=r?$.Format.CSS.formatHSL(a):$.Format.CSS.formatHSLA(a),c=r?$.Format.CSS.formatHex(a):$.Format.CSS.formatHexA(a),u=[];return u.push({label:l,textEdit:{range:n,text:l}}),u.push({label:d,textEdit:{range:n,text:d}}),u.push({label:c,textEdit:{range:n,text:c}}),u}}let zM=class extends H{constructor(e,t,i){super(),this._register(i.colorProvider.register("*",new p4(e,t)))}};zM=dke([rT(0,_i),rT(1,Yt),rT(2,Ce)],zM);F1(zM);async function vq(s,e,t,i=!0){return m4(new cke,s,e,t,i)}function bq(s,e,t,i){return Promise.resolve(t.provideColorPresentations(s,e,i))}class cke{constructor(){}async compute(e,t,i,n){const o=await e.provideDocumentColors(t,i);if(Array.isArray(o))for(const r of o)n.push({colorInfo:r,provider:e});return Array.isArray(o)}}class uke{constructor(){}async compute(e,t,i,n){const o=await e.provideDocumentColors(t,i);if(Array.isArray(o))for(const r of o)n.push({range:r.range,color:[r.color.red,r.color.green,r.color.blue,r.color.alpha]});return Array.isArray(o)}}class hke{constructor(e){this.colorInfo=e}async compute(e,t,i,n){const o=await e.provideColorPresentations(t,this.colorInfo,dt.None);return Array.isArray(o)&&n.push(...o),Array.isArray(o)}}async function m4(s,e,t,i,n){let o=!1,r;const a=[],l=e.ordered(t);for(let d=l.length-1;d>=0;d--){const c=l[d];if(c instanceof p4)r=c;else try{await s.compute(c,t,i,a)&&(o=!0)}catch(u){Ai(u)}}return o?a:r&&n?(await s.compute(r,t,i,a),a):[]}function Cq(s,e){const{colorProvider:t}=s.get(Ce),i=s.get(_i).getModel(e);if(!i)throw Mr();const n=s.get(rt).getValue("editor.defaultColorDecorators",{resource:e});return{model:i,colorProviderRegistry:t,isDefaultColorDecoratorsEnabled:n}}pt.registerCommand("_executeDocumentColorProvider",function(s,...e){const[t]=e;if(!(t instanceof Ae))throw Mr();const{model:i,colorProviderRegistry:n,isDefaultColorDecoratorsEnabled:o}=Cq(s,t);return m4(new uke,n,i,dt.None,o)});pt.registerCommand("_executeColorPresentationProvider",function(s,...e){const[t,i]=e,{uri:n,range:o}=i;if(!(n instanceof Ae)||!Array.isArray(t)||t.length!==4||!x.isIRange(o))throw Mr();const{model:r,colorProviderRegistry:a,isDefaultColorDecoratorsEnabled:l}=Cq(s,n),[d,c,u,h]=t;return m4(new hke({range:o,color:{red:d,green:c,blue:u,alpha:h}}),a,r,dt.None,l)});var gke=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},aT=function(s,e){return function(t,i){e(t,i,s)}},UM;const wq=Object.create({});let Vh=UM=class extends H{constructor(e,t,i,n){super(),this._editor=e,this._configurationService=t,this._languageFeaturesService=i,this._localToDispose=this._register(new Y),this._decorationsIds=[],this._colorDatas=new Map,this._colorDecoratorIds=this._editor.createDecorationsCollection(),this._ruleFactory=new v1(this._editor),this._decoratorLimitReporter=new fke,this._colorDecorationClassRefs=this._register(new Y),this._debounceInformation=n.for(i.colorProvider,"Document Colors",{min:UM.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(o=>{const r=this._isColorDecoratorsEnabled;this._isColorDecoratorsEnabled=this.isEnabled(),this._isDefaultColorDecoratorsEnabled=this._editor.getOption(147);const a=r!==this._isColorDecoratorsEnabled||o.hasChanged(21),l=o.hasChanged(147);(a||l)&&(this._isColorDecoratorsEnabled?this.updateColors():this.removeAllDecorations())})),this._timeoutTimer=null,this._computePromise=null,this._isColorDecoratorsEnabled=this.isEnabled(),this._isDefaultColorDecoratorsEnabled=this._editor.getOption(147),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(20)}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 ya,this._timeoutTimer.cancelAndSet(()=>{this._timeoutTimer=null,this.beginCompute()},this._debounceInformation.get(e)))})),this.beginCompute())}async beginCompute(){this._computePromise=Dn(async e=>{const t=this._editor.getModel();if(!t)return[];const i=new Jn(!1),n=await vq(this._languageFeaturesService.colorProvider,t,e,this._isDefaultColorDecoratorsEnabled);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){Xe(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:Ye.EMPTY}));this._editor.changeDecorations(i=>{this._decorationsIds=i.deltaDecorations(this._decorationsIds,t),this._colorDatas=new Map,this._decorationsIds.forEach((n,o)=>this._colorDatas.set(n,e[o]))})}updateColorDecorators(e){this._colorDecorationClassRefs.clear();const t=[],i=this._editor.getOption(21);for(let o=0;othis._colorDatas.has(n.id));return i.length===0?null:this._colorDatas.get(i[0].id)}isColorDecoration(e){return this._colorDecoratorIds.has(e)}};Vh.ID="editor.contrib.colorDetector";Vh.RECOMPUTE_TIME=1e3;Vh=UM=gke([aT(1,rt),aT(2,Ce),aT(3,Ur)],Vh);class fke{constructor(){this._onDidChange=new B,this._computed=0,this._limited=!1}update(e,t){(e!==this._computed||t!==this._limited)&&(this._computed=e,this._limited=t,this._onDidChange.fire())}}kt(Vh.ID,Vh,1);class pke{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 B,this.onColorFlushed=this._onColorFlushed.event,this._onDidChangeColor=new B,this.onDidChangeColor=this._onDidChangeColor.event,this._onDidChangePresentation=new B,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{this.backgroundColor=r.getColor(iD)||$.white})),this._register(K(this._pickedColorNode,ee.CLICK,()=>this.model.selectNextColorPresentation())),this._register(K(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=$.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.showingStandaloneColorPicker&&(this._domNode.classList.add("standalone-colorpicker"),this._closeButton=this._register(new _ke(this._domNode)))}get closeButton(){return this._closeButton}get pickedColorNode(){return this._pickedColorNode}get originalColorNode(){return this._originalColorNode}onDidChangeColor(e){this._pickedColorNode.style.backgroundColor=$.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:""}}class _ke extends H{constructor(e){super(),this._onClicked=this._register(new B),this.onClicked=this._onClicked.event,this._button=document.createElement("div"),this._button.classList.add("close-button"),Q(e,this._button);const t=document.createElement("div");t.classList.add("close-button-inner-div"),Q(this._button,t),Q(t,Yo(".button"+Pe.asCSSSelector(xi("color-picker-close",oe.close,p("closeIcon","Icon to close the color picker"))))).classList.add("close-icon"),this._register(K(this._button,ee.CLICK,()=>{this._onClicked.fire()}))}}class vke extends H{constructor(e,t,i,n=!1){super(),this.model=t,this.pixelRatio=i,this._insertButton=null,this._domNode=Yo(".colorpicker-body"),Q(e,this._domNode),this._saturationBox=new bke(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 Cke(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 wke(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&&(this._insertButton=this._register(new yke(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 $(new Yl(i.h,e,t,i.a))}onDidOpacityChange(e){const t=this.model.color.hsva;this.model.color=new $(new Yl(t.h,t.s,t.v,e))}onDidHueChange(e){const t=this.model.color.hsva,i=(1-e)*360;this.model.color=new $(new Yl(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()}}class bke extends H{constructor(e,t,i){super(),this.model=t,this.pixelRatio=i,this._onDidChange=new B,this.onDidChange=this._onDidChange.event,this._onColorFlushed=new B,this.onColorFlushed=this._onColorFlushed.event,this._domNode=Yo(".saturation-wrap"),Q(e,this._domNode),this._canvas=document.createElement("canvas"),this._canvas.className="saturation-box",Q(this._domNode,this._canvas),this.selection=Yo(".saturation-selection"),Q(this._domNode,this.selection),this.layout(),this._register(K(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 c0);const t=qi(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=K(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 $(new Yl(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 o=i.createLinearGradient(0,0,0,this._canvas.height);o.addColorStop(0,"rgba(0, 0, 0, 0)"),o.addColorStop(1,"rgba(0, 0, 0, 1)"),i.rect(0,0,this._canvas.width,this._canvas.height),i.fillStyle=$.Format.CSS.format(t),i.fill(),i.fillStyle=n,i.fill(),i.fillStyle=o,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 yq extends H{constructor(e,t,i=!1){super(),this.model=t,this._onDidChange=new B,this.onDidChange=this._onDidChange.event,this._onColorFlushed=new B,this.onColorFlushed=this._onColorFlushed.event,i?(this.domNode=Q(e,Yo(".standalone-strip")),this.overlay=Q(this.domNode,Yo(".standalone-overlay"))):(this.domNode=Q(e,Yo(".strip")),this.overlay=Q(this.domNode,Yo(".overlay"))),this.slider=Q(this.domNode,Yo(".slider")),this.slider.style.top="0px",this._register(K(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 c0),i=qi(this.domNode);this.domNode.classList.add("grabbing"),e.target!==this.slider&&this.onDidChangeTop(e.offsetY),t.startMonitoring(e.target,e.pointerId,e.buttons,o=>this.onDidChangeTop(o.pageY-i.top),()=>null);const n=K(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 Cke extends yq{constructor(e,t,i=!1){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,o=new $(new bt(t,i,n,1)),r=new $(new bt(t,i,n,0));this.overlay.style.background=`linear-gradient(to bottom, ${o} 0%, ${r} 100%)`}getValue(e){return e.hsva.a}}class wke extends yq{constructor(e,t,i=!1){super(e,t,i),this.domNode.classList.add("hue-strip")}getValue(e){return 1-e.hsva.h/360}}class yke extends H{constructor(e){super(),this._onClicked=this._register(new B),this.onClicked=this._onClicked.event,this._button=Q(e,document.createElement("button")),this._button.classList.add("insert-button"),this._button.textContent="Insert",this._register(K(this._button,ee.CLICK,()=>{this._onClicked.fire()}))}get button(){return this._button}}class Ske extends fr{constructor(e,t,i,n,o=!1){super(),this.model=t,this.pixelRatio=i,this._register(Ob.getInstance(Te(e)).onDidChange(()=>this.layout()));const r=Yo(".colorpicker-widget");e.appendChild(r),this.header=this._register(new mke(r,this.model,n,o)),this.body=this._register(new vke(r,this.model,this.pixelRatio,o))}layout(){this.body.layout()}}var Sq=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Dq=function(s,e){return function(t,i){e(t,i,s)}};class Dke{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}}let hL=class{constructor(e,t){this._editor=e,this._themeService=t,this.hoverOrdinal=2}computeSync(e,t){return[]}computeAsync(e,t,i){return Xi.fromPromise(this._computeAsync(e,t,i))}async _computeAsync(e,t,i){if(!this._editor.hasModel())return[];const n=Vh.get(this._editor);if(!n)return[];for(const o of t){if(!n.isColorDecoration(o))continue;const r=n.getColorData(o.range.getStartPosition());if(r)return[await Lq(this,this._editor.getModel(),r.colorInfo,r.provider)]}return[]}renderHoverParts(e,t){return xq(this,this._editor,this._themeService,t,e)}};hL=Sq([Dq(1,_n)],hL);class Lke{constructor(e,t,i,n){this.owner=e,this.range=t,this.model=i,this.provider=n}}let MC=class{constructor(e,t){this._editor=e,this._themeService=t,this._color=null}async createColorHover(e,t,i){if(!this._editor.hasModel()||!Vh.get(this._editor))return null;const o=await vq(i,this._editor.getModel(),dt.None);let r=null,a=null;for(const u of o){const h=u.colorInfo;x.containsRange(h.range,e.range)&&(r=h,a=u.provider)}const l=r??e,d=a??t,c=!!r;return{colorHover:await Lq(this,this._editor.getModel(),l,d),foundInEditor:c}}async updateEditorModel(e){if(!this._editor.hasModel())return;const t=e.model;let i=new x(e.range.startLineNumber,e.range.startColumn,e.range.endLineNumber,e.range.endColumn);this._color&&(await dS(this._editor.getModel(),t,this._color,i,e),i=kq(this._editor,i,t))}renderHoverParts(e,t){return xq(this,this._editor,this._themeService,t,e)}set color(e){this._color=e}get color(){return this._color}};MC=Sq([Dq(1,_n)],MC);async function Lq(s,e,t,i){const n=e.getValueInRange(t.range),{red:o,green:r,blue:a,alpha:l}=t.color,d=new bt(Math.round(o*255),Math.round(r*255),Math.round(a*255),l),c=new $(d),u=await bq(e,t,i,dt.None),h=new pke(c,[],0);return h.colorPresentations=u||[],h.guessColorPresentation(c,n),s instanceof hL?new Dke(s,x.lift(t.range),h,i):new Lke(s,x.lift(t.range),h,i)}function xq(s,e,t,i,n){if(i.length===0||!e.hasModel())return H.None;if(n.setMinimumDimensions){const h=e.getOption(67)+8;n.setMinimumDimensions(new Dt(302,h))}const o=new Y,r=i[0],a=e.getModel(),l=r.model,d=o.add(new Ske(n.fragment,l,e.getOption(143),t,s instanceof MC));n.setColorPicker(d);let c=!1,u=new x(r.range.startLineNumber,r.range.startColumn,r.range.endLineNumber,r.range.endColumn);if(s instanceof MC){const h=i[0].model.color;s.color=h,dS(a,l,h,u,r),o.add(l.onColorFlushed(g=>{s.color=g}))}else o.add(l.onColorFlushed(async h=>{await dS(a,l,h,u,r),c=!0,u=kq(e,u,l)}));return o.add(l.onDidChangeColor(h=>{dS(a,l,h,u,r)})),o.add(e.onDidChangeModelContent(h=>{c?c=!1:(n.hide(),e.focus())})),o}function kq(s,e,t){var i,n;const o=[],r=(i=t.presentation.textEdit)!==null&&i!==void 0?i:{range:e,text:t.presentation.label,forceMoveMarkers:!1};o.push(r),t.presentation.additionalTextEdits&&o.push(...t.presentation.additionalTextEdits);const a=x.lift(r.range),l=s.getModel()._setTrackedRange(null,a,3);return s.executeEdits("colorpicker",o),s.pushUndoStop(),(n=s.getModel()._getTrackedRange(l))!==null&&n!==void 0?n:a}async function dS(s,e,t,i,n){const o=await bq(s,{range:i,color:{red:t.rgba.r/255,green:t.rgba.g/255,blue:t.rgba.b/255,alpha:t.rgba.a}},n.provider,dt.None);e.colorPresentations=o||[]}const Eq="editor.action.showHover",xke="editor.action.showDefinitionPreviewHover",kke="editor.action.scrollUpHover",Eke="editor.action.scrollDownHover",Ike="editor.action.scrollLeftHover",Tke="editor.action.scrollRightHover",Nke="editor.action.pageUpHover",Ake="editor.action.pageDownHover",Mke="editor.action.goToTopHover",Rke="editor.action.goToBottomHover",_4="editor.action.increaseHoverVerbosityLevel",v4="editor.action.decreaseHoverVerbosityLevel",Iq="editor.action.inlineSuggest.commit",Tq="editor.action.inlineSuggest.showPrevious",Nq="editor.action.inlineSuggest.showNext";var b4=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},oa=function(s,e){return function(t,i){e(t,i,s)}},cS;let $M=class extends H{constructor(e,t,i){super(),this.editor=e,this.model=t,this.instantiationService=i,this.alwaysShowToolbar=Ot(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(62).showToolbar==="always"),this.sessionPosition=void 0,this.position=je(this,n=>{var o,r,a;const l=(o=this.model.read(n))===null||o===void 0?void 0:o.primaryGhostText.read(n);if(!this.alwaysShowToolbar.read(n)||!l||l.parts.length===0)return this.sessionPosition=void 0,null;const d=l.parts[0].column;this.sessionPosition&&this.sessionPosition.lineNumber!==l.lineNumber&&(this.sessionPosition=void 0);const c=new W(l.lineNumber,Math.min(d,(a=(r=this.sessionPosition)===null||r===void 0?void 0:r.column)!==null&&a!==void 0?a:Number.MAX_SAFE_INTEGER));return this.sessionPosition=c,c}),this._register(Hr((n,o)=>{const r=this.model.read(n);if(!r||!this.alwaysShowToolbar.read(n))return;const a=o.add(this.instantiationService.createInstance(zh,this.editor,!0,this.position,r.selectedInlineCompletionIndex,r.inlineCompletionsCount,r.activeCommands));e.addContentWidget(a),o.add(Ie(()=>e.removeContentWidget(a))),o.add(st(l=>{this.position.read(l)&&r.lastTriggerKind.read(l)!==kc.Explicit&&r.triggerExplicitly()}))}))}};$M=b4([oa(2,Ne)],$M);const Pke=xi("inline-suggestion-hints-next",oe.chevronRight,p("parameterHintsNextIcon","Icon for show next parameter hint.")),Fke=xi("inline-suggestion-hints-previous",oe.chevronLeft,p("parameterHintsPreviousIcon","Icon for show previous parameter hint."));let zh=cS=class extends H{static get dropDownVisible(){return this._dropDownVisible}createCommandAction(e,t,i){const n=new Eo(e,t,i,!0,()=>this._commandService.executeCommand(e)),o=this.keybindingService.lookupKeybinding(e,this._contextKeyService);let r=t;return o&&(r=p({},"{0} ({1})",t,o.getLabel())),n.tooltip=r,n}constructor(e,t,i,n,o,r,a,l,d,c,u){super(),this.editor=e,this.withBorder=t,this._position=i,this._currentSuggestionIdx=n,this._suggestionCount=o,this._extraCommands=r,this._commandService=a,this.keybindingService=d,this._contextKeyService=c,this._menuService=u,this.id=`InlineSuggestionHintsContentWidget${cS.id++}`,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this.nodes=Nt("div.inlineSuggestionsHints",{className:this.withBorder?".withBorder":""},[Nt("div@toolBar")]),this.previousAction=this.createCommandAction(Tq,p("previous","Previous"),Pe.asClassName(Fke)),this.availableSuggestionCountAction=new Eo("inlineSuggestionHints.availableSuggestionCount","",void 0,!1),this.nextAction=this.createCommandAction(Nq,p("next","Next"),Pe.asClassName(Pke)),this.inlineCompletionsActionsMenus=this._register(this._menuService.createMenu(E.InlineCompletionsActions,this._contextKeyService)),this.clearAvailableSuggestionCountLabelDebounced=this._register(new Wt(()=>{this.availableSuggestionCountAction.label=""},100)),this.disableButtonsDebounced=this._register(new Wt(()=>{this.previousAction.enabled=this.nextAction.enabled=!1},100)),this.toolBar=this._register(l.createInstance(jM,this.nodes.toolBar,E.InlineSuggestionToolbar,{menuOptions:{renderShortTitle:!0},toolbarOptions:{primaryGroup:h=>h.startsWith("primary")},actionViewItemProvider:(h,g)=>{if(h instanceof Io)return l.createInstance(Bke,h,void 0);if(h===this.availableSuggestionCountAction){const f=new Oke(void 0,h,{label:!0,icon:!1});return f.setClass("availableSuggestionCount"),f}},telemetrySource:"InlineSuggestionToolbar"})),this.toolBar.setPrependedPrimaryActions([this.previousAction,this.availableSuggestionCountAction,this.nextAction]),this._register(this.toolBar.onDidChangeDropdownVisibility(h=>{cS._dropDownVisible=h})),this._register(st(h=>{this._position.read(h),this.editor.layoutContentWidget(this)})),this._register(st(h=>{const g=this._suggestionCount.read(h),f=this._currentSuggestionIdx.read(h);g!==void 0?(this.clearAvailableSuggestionCountLabelDebounced.cancel(),this.availableSuggestionCountAction.label=`${f+1}/${g}`):this.clearAvailableSuggestionCountLabelDebounced.schedule(),g!==void 0&&g>1?(this.disableButtonsDebounced.cancel(),this.previousAction.enabled=this.nextAction.enabled=!0):this.disableButtonsDebounced.schedule()})),this._register(st(h=>{const f=this._extraCommands.read(h).map(m=>({class:void 0,id:m.id,enabled:!0,tooltip:m.tooltip||"",label:m.title,run:_=>this._commandService.executeCommand(m.id)}));for(const[m,_]of this.inlineCompletionsActionsMenus.getActions())for(const v of _)v instanceof Io&&f.push(v);f.length>0&&f.unshift(new rn),this.toolBar.setAdditionalSecondaryActions(f)}))}getId(){return this.id}getDomNode(){return this.nodes.root}getPosition(){return{position:this._position.get(),preference:[1,2],positionAffinity:3}}};zh._dropDownVisible=!1;zh.id=0;zh=cS=b4([oa(6,gi),oa(7,Ne),oa(8,At),oa(9,Be),oa(10,hr)],zh);class Oke extends N_{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(){}}let Bke=class extends Fh{updateLabel(){const e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService);if(!e)return super.updateLabel();if(this.label){const t=Nt("div.keybinding").root;this._register(new m0(t,Lo,{disableTitle:!0,...tK})).set(e),this.label.textContent=this._action.label,this.label.appendChild(t),this.label.classList.add("inlineSuggestionStatusBarItemLabel")}}updateTooltip(){}},jM=class extends LC{constructor(e,t,i,n,o,r,a,l,d){super(e,{resetMenu:t,...i},n,o,r,a,l,d),this.menuId=t,this.options2=i,this.menuService=n,this.contextKeyService=o,this.menu=this._store.add(this.menuService.createMenu(this.menuId,this.contextKeyService,{emitEventsForSubmenuChanges:!0})),this.additionalActions=[],this.prependedPrimaryActions=[],this._store.add(this.menu.onDidChange(()=>this.updateToolbar())),this.updateToolbar()}updateToolbar(){var e,t,i,n,o,r,a;const l=[],d=[];Qx(this.menu,(e=this.options2)===null||e===void 0?void 0:e.menuOptions,{primary:l,secondary:d},(i=(t=this.options2)===null||t===void 0?void 0:t.toolbarOptions)===null||i===void 0?void 0:i.primaryGroup,(o=(n=this.options2)===null||n===void 0?void 0:n.toolbarOptions)===null||o===void 0?void 0:o.shouldInlineSubmenu,(a=(r=this.options2)===null||r===void 0?void 0:r.toolbarOptions)===null||a===void 0?void 0:a.useSeparatorsInPrimaryActions),d.push(...this.additionalActions),l.unshift(...this.prependedPrimaryActions),this.setActions(l,d)}setPrependedPrimaryActions(e){Ci(this.prependedPrimaryActions,e,(t,i)=>t===i)||(this.prependedPrimaryActions=e,this.updateToolbar())}setAdditionalSecondaryActions(e){Ci(this.additionalActions,e,(t,i)=>t===i)||(this.additionalActions=e,this.updateToolbar())}};jM=b4([oa(3,hr),oa(4,Be),oa(5,Oo),oa(6,At),oa(7,gi),oa(8,Gs)],jM);class C4{constructor(){this._onDidWillResize=new B,this.onDidWillResize=this._onDidWillResize.event,this._onDidResize=new B,this.onDidResize=this._onDidResize.event,this._sashListener=new Y,this._size=new Dt(0,0),this._minSize=new Dt(0,0),this._maxSize=new Dt(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER),this.domNode=document.createElement("div"),this._eastSash=new is(this.domNode,{getVerticalSashLeft:()=>this._size.width},{orientation:0}),this._westSash=new is(this.domNode,{getVerticalSashLeft:()=>0},{orientation:0}),this._northSash=new is(this.domNode,{getHorizontalSashTop:()=>0},{orientation:1,orthogonalEdge:OD.North}),this._southSash=new is(this.domNode,{getHorizontalSashTop:()=>this._size.height},{orientation:1,orthogonalEdge:OD.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(le.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(le.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(le.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(le.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:o,width:r}=this._maxSize;e=Math.max(i,Math.min(o,e)),t=Math.max(n,Math.min(r,t));const a=new Dt(t,e);Dt.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 Wke=30,Hke=24;class Vke extends H{constructor(e,t=new Dt(10,10)){super(),this._editor=e,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._resizableNode=this._register(new C4),this._contentPosition=null,this._isResizing=!1,this._resizableNode.domNode.style.position="absolute",this._resizableNode.minSize=Dt.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 Dt(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(){var e;return!((e=this._contentPosition)===null||e===void 0)&&e.position?W.lift(this._contentPosition.position):void 0}_availableVerticalSpaceAbove(e){const t=this._editor.getDomNode(),i=this._editor.getScrolledVisiblePosition(e);return!t||!i?void 0:qi(t).top+i.top-Wke}_availableVerticalSpaceBelow(e){const t=this._editor.getDomNode(),i=this._editor.getScrolledVisiblePosition(e);if(!t||!i)return;const n=qi(t),o=Eh(t.ownerDocument.body),r=n.top+i.top+i.height;return o.height-r-Hke}_findPositionPreference(e,t){var i,n;const o=Math.min((i=this._availableVerticalSpaceBelow(t))!==null&&i!==void 0?i:1/0,e),r=Math.min((n=this._availableVerticalSpaceAbove(t))!==null&&n!==void 0?n:1/0,e),a=Math.min(Math.max(r,o),e),l=Math.min(e,a);let d;return this._editor.getOption(60).above?d=l<=r?1:2:d=l<=o?2:1,d===1?this._resizableNode.enableSashes(!0,!0,!1,!1):this._resizableNode.enableSashes(!1,!0,!0,!1),d}_resize(e){this._resizableNode.layout(e.height,e.width)}}var zke=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},ny=function(s,e){return function(t,i){e(t,i,s)}},Nl;const U7=30,Uke=6;let H_=Nl=class extends Vke{get isColorPickerVisible(){var e;return!!(!((e=this._visibleData)===null||e===void 0)&&e.colorPicker)}get isVisibleFromKeyboard(){var e;return((e=this._visibleData)===null||e===void 0?void 0:e.source)===1}get isVisible(){var e;return(e=this._hoverVisibleKey.get())!==null&&e!==void 0?e:!1}get isFocused(){var e;return(e=this._hoverFocusedKey.get())!==null&&e!==void 0?e:!1}constructor(e,t,i,n,o){const r=e.getOption(67)+8,a=150,l=new Dt(a,r);super(e,l),this._configurationService=i,this._accessibilityService=n,this._keybindingService=o,this._hover=this._register(new gO),this._minimumSize=l,this._hoverVisibleKey=T.hoverVisible.bindTo(t),this._hoverFocusedKey=T.hoverFocused.bindTo(t),Q(this._resizableNode.domNode,this._hover.containerDomNode),this._resizableNode.domNode.style.zIndex="50",this._register(this._editor.onDidLayoutChange(()=>{this.isVisible&&this._updateMaxDimensions()})),this._register(this._editor.onDidChangeConfiguration(c=>{c.hasChanged(50)&&this._updateFont()}));const d=this._register(ba(this._resizableNode.domNode));this._register(d.onDidFocus(()=>{this._hoverFocusedKey.set(!0)})),this._register(d.onDidBlur(()=>{this._hoverFocusedKey.set(!1)})),this._setHoverData(void 0),this._editor.addContentWidget(this)}dispose(){var e;super.dispose(),(e=this._visibleData)===null||e===void 0||e.disposables.dispose(),this._editor.removeContentWidget(this)}getId(){return Nl.ID}static _applyDimensions(e,t,i){const n=typeof t=="number"?`${t}px`:t,o=typeof i=="number"?`${i}px`:i;e.style.width=n,e.style.height=o}_setContentsDomNodeDimensions(e,t){const i=this._hover.contentsDomNode;return Nl._applyDimensions(i,e,t)}_setContainerDomNodeDimensions(e,t){const i=this._hover.containerDomNode;return Nl._applyDimensions(i,e,t)}_setHoverWidgetDimensions(e,t){this._setContentsDomNodeDimensions(e,t),this._setContainerDomNodeDimensions(e,t),this._layoutContentWidget()}static _applyMaxDimensions(e,t,i){const n=typeof t=="number"?`${t}px`:t,o=typeof i=="number"?`${i}px`:i;e.style.maxWidth=n,e.style.maxHeight=o}_setHoverWidgetMaxDimensions(e,t){Nl._applyMaxDimensions(this._hover.contentsDomNode,e,t),Nl._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");const t=e.width,i=e.height;this._setHoverWidgetDimensions(t,i)}_updateResizableNodeMaxDimensions(){var e,t;const i=(e=this._findMaximumRenderingWidth())!==null&&e!==void 0?e:1/0,n=(t=this._findMaximumRenderingHeight())!==null&&t!==void 0?t:1/0;this._resizableNode.maxSize=new Dt(i,n),this._setHoverWidgetMaxDimensions(i,n)}_resize(e){var t,i;Nl._lastDimensions=new Dt(e.width,e.height),this._setAdjustedHoverWidgetDimensions(e),this._resizableNode.layout(e.height,e.width),this._updateResizableNodeMaxDimensions(),this._hover.scrollbar.scanDomNode(),this._editor.layoutContentWidget(this),(i=(t=this._visibleData)===null||t===void 0?void 0:t.colorPicker)===null||i===void 0||i.layout()}_findAvailableSpaceVertically(){var e;const t=(e=this._visibleData)===null||e===void 0?void 0:e.showAtPosition;if(t)return this._positionPreference===1?this._availableVerticalSpaceAbove(t):this._availableVerticalSpaceBelow(t)}_findMaximumRenderingHeight(){const e=this._findAvailableSpaceVertically();if(!e)return;let t=Uke;return Array.from(this._hover.contentsDomNode.children).forEach(i=>{t+=i.clientHeight}),Math.min(e,t)}_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-2;return e||this._hover.containerDomNode.clientWidth"u"||typeof this._visibleData.initialMousePosY>"u")return this._visibleData.initialMousePosX=e,this._visibleData.initialMousePosY=t,!1;const i=qi(this.getDomNode());typeof this._visibleData.closestMouseDistance>"u"&&(this._visibleData.closestMouseDistance=$7(this._visibleData.initialMousePosX,this._visibleData.initialMousePosY,i.left,i.top,i.width,i.height));const n=$7(e,t,i.left,i.top,i.width,i.height);return n>this._visibleData.closestMouseDistance+4?!1:(this._visibleData.closestMouseDistance=Math.min(this._visibleData.closestMouseDistance,n),!0)}_setHoverData(e){var t;(t=this._visibleData)===null||t===void 0||t.disposables.dispose(),this._visibleData=e,this._hoverVisibleKey.set(!!e),this._hover.containerDomNode.classList.toggle("hidden",!e)}_updateFont(){const{fontSize:e,lineHeight:t}=this._editor.getOption(50),i=this._hover.contentsDomNode;i.style.fontSize=`${e}px`,i.style.lineHeight=`${t/e}`,Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName("code")).forEach(o=>this._editor.applyFontInfo(o))}_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,Nl._lastDimensions.height),t=Math.max(this._editor.getLayoutInfo().width*.66,500,Nl._lastDimensions.width);this._setHoverWidgetMaxDimensions(t,e)}_render(e,t){this._setHoverData(t),this._updateFont(),this._updateContent(e),this._updateMaxDimensions(),this.onContentsChanged(),this._editor.render()}getPosition(){var e;return this._visibleData?{position:this._visibleData.showAtPosition,secondaryPosition:this._visibleData.showAtSecondaryPosition,positionAffinity:this._visibleData.isBeforeContent?3:void 0,preference:[(e=this._positionPreference)!==null&&e!==void 0?e:1]}:null}showAt(e,t){var i,n,o,r;if(!this._editor||!this._editor.hasModel())return;this._render(e,t);const a=uc(this._hover.containerDomNode),l=t.showAtPosition;this._positionPreference=(i=this._findPositionPreference(a,l))!==null&&i!==void 0?i:1,this.onContentsChanged(),t.stoleFocus&&this._hover.containerDomNode.focus(),(n=t.colorPicker)===null||n===void 0||n.layout();const c=this._hover.containerDomNode.ownerDocument.activeElement===this._hover.containerDomNode&&q$(this._configurationService.getValue("accessibility.verbosity.hover")===!0&&this._accessibilityService.isScreenReaderOptimized(),(r=(o=this._keybindingService.lookupKeybinding("editor.action.accessibleView"))===null||o===void 0?void 0:o.getAriaLabel())!==null&&r!==void 0?r:"");c&&(this._hover.contentsDomNode.ariaLabel=this._hover.contentsDomNode.textContent+", "+c)}hide(){if(!this._visibleData)return;const e=this._visibleData.stoleFocus||this._hoverFocusedKey.get();this._setHoverData(void 0),this._resizableNode.maxSize=new Dt(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")}setMinimumDimensions(e){this._minimumSize=new Dt(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 Dt(e,this._minimumSize.height)}onContentsChanged(){var e;this._removeConstraintsRenderNormally();const t=this._hover.containerDomNode;let i=uc(t),n=wo(t);if(this._resizableNode.layout(i,n),this._setHoverWidgetDimensions(n,i),i=uc(t),n=wo(t),this._contentWidth=n,this._updateMinimumWidth(),this._resizableNode.layout(i,n),!((e=this._visibleData)===null||e===void 0)&&e.showAtPosition){const o=uc(this._hover.containerDomNode);this._positionPreference=this._findPositionPreference(o,this._visibleData.showAtPosition)}this._layoutContentWidget()}focus(){this._hover.containerDomNode.focus()}scrollUp(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._editor.getOption(50);this._hover.scrollbar.setScrollPosition({scrollTop:e-t.lineHeight})}scrollDown(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._editor.getOption(50);this._hover.scrollbar.setScrollPosition({scrollTop:e+t.lineHeight})}scrollLeft(){const e=this._hover.scrollbar.getScrollPosition().scrollLeft;this._hover.scrollbar.setScrollPosition({scrollLeft:e-U7})}scrollRight(){const e=this._hover.scrollbar.getScrollPosition().scrollLeft;this._hover.scrollbar.setScrollPosition({scrollLeft:e+U7})}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})}};H_.ID="editor.contrib.resizableContentHoverWidget";H_._lastDimensions=new Dt(0,0);H_=Nl=zke([ny(1,Be),ny(2,rt),ny(3,gr),ny(4,At)],H_);function $7(s,e,t,i,n,o){const r=t+n/2,a=i+o/2,l=Math.max(Math.abs(s-r)-n/2,0),d=Math.max(Math.abs(e-a)-o/2,0);return Math.sqrt(l*l+d*d)}let $ke=class{constructor(e,t,i){this.value=e,this.isComplete=t,this.hasLoadingMessage=i}};class Aq extends H{constructor(e,t){super(),this._editor=e,this._computer=t,this._onResult=this._register(new B),this.onResult=this._onResult.event,this._firstWaitScheduler=this._register(new Wt(()=>this._triggerAsyncComputation(),0)),this._secondWaitScheduler=this._register(new Wt(()=>this._triggerSyncComputation(),0)),this._loadingMessageScheduler=this._register(new Wt(()=>this._triggerLoadingMessage(),0)),this._state=0,this._asyncIterable=null,this._asyncIterableDone=!1,this._result=[]}dispose(){this._asyncIterable&&(this._asyncIterable.cancel(),this._asyncIterable=null),super.dispose()}get _hoverTime(){return this._editor.getOption(60).delay}get _firstWaitTime(){return this._hoverTime/2}get _secondWaitTime(){return this._hoverTime-this._firstWaitTime}get _loadingMessageTime(){return 3*this._hoverTime}_setState(e,t=!0){this._state=e,t&&this._fireResult()}_triggerAsyncComputation(){this._setState(2),this._secondWaitScheduler.schedule(this._secondWaitTime),this._computer.computeAsync?(this._asyncIterableDone=!1,this._asyncIterable=iae(e=>this._computer.computeAsync(e)),(async()=>{try{for await(const e of this._asyncIterable)e&&(this._result.push(e),this._fireResult());this._asyncIterableDone=!0,(this._state===3||this._state===4)&&this._setState(0)}catch(e){Xe(e)}})()):this._asyncIterableDone=!0}_triggerSyncComputation(){this._computer.computeSync&&(this._result=this._result.concat(this._computer.computeSync())),this._setState(this._asyncIterableDone?0:3)}_triggerLoadingMessage(){this._state===3&&this._setState(4)}_fireResult(){if(this._state===1||this._state===2)return;const e=this._state===0,t=this._state===4;this._onResult.fire(new $ke(this._result.slice(0),e,t))}start(e){if(e===0)this._state===0&&(this._setState(1),this._firstWaitScheduler.schedule(this._firstWaitTime),this._loadingMessageScheduler.schedule(this._loadingMessageTime));else switch(this._state){case 0:this._triggerAsyncComputation(),this._secondWaitScheduler.cancel(),this._triggerSyncComputation();break;case 2:this._secondWaitScheduler.cancel(),this._triggerSyncComputation();break}}cancel(){this._firstWaitScheduler.cancel(),this._secondWaitScheduler.cancel(),this._loadingMessageScheduler.cancel(),this._asyncIterable&&(this._asyncIterable.cancel(),this._asyncIterable=null),this._result=[],this._setState(0,!1)}}class lT{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 hf{constructor(e,t,i,n,o,r){this.priority=e,this.owner=t,this.range=i,this.initialMousePosX=n,this.initialMousePosY=o,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}}const ag=new class{constructor(){this._participants=[]}register(e){this._participants.push(e)}getAll(){return this._participants}};class jke{constructor(e,t,i){this.provider=e,this.hover=t,this.ordinal=i}}async function Kke(s,e,t,i,n){const o=await Promise.resolve(s.provideHover(t,i,n)).catch(Ai);if(!(!o||!Gke(o)))return new jke(s,o,e)}function w4(s,e,t,i){const o=s.ordered(e).map((r,a)=>Kke(r,a,e,t,i));return Xi.fromPromises(o).coalesce()}function qke(s,e,t,i){return w4(s,e,t,i).map(n=>n.hover).toPromise()}Ad("_executeHoverProvider",(s,e,t)=>{const i=s.get(Ce);return qke(i.hoverProvider,e,t,dt.None)});function Gke(s){const e=typeof s.range<"u",t=typeof s.contents<"u"&&s.contents&&s.contents.length>0;return e&&t}var Zke=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Rp=function(s,e){return function(t,i){e(t,i,s)}};const Cm=he,Xke=xi("hover-increase-verbosity",oe.add,p("increaseHoverVerbosity","Icon for increaseing hover verbosity.")),Yke=xi("hover-decrease-verbosity",oe.remove,p("decreaseHoverVerbosity","Icon for decreasing hover verbosity."));class Ka{constructor(e,t,i,n,o,r=void 0){this.owner=e,this.range=t,this.contents=i,this.isBeforeContent=n,this.ordinal=o,this.source=r}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}class Mq{constructor(e,t,i){this.hover=e,this.hoverProvider=t,this.hoverPosition=i}supportsVerbosityAction(e){var t,i;switch(e){case ja.Increase:return(t=this.hover.canIncreaseVerbosity)!==null&&t!==void 0?t:!1;case ja.Decrease:return(i=this.hover.canDecreaseVerbosity)!==null&&i!==void 0?i:!1}}}let RC=class{constructor(e,t,i,n,o,r,a){this._editor=e,this._languageService=t,this._openerService=i,this._configurationService=n,this._languageFeaturesService=o,this._keybindingService=r,this._hoverService=a,this.hoverOrdinal=3}createLoadingMessage(e){return new Ka(this,e.range,[new ss().appendText(p("modesContentHover.loading","Loading..."))],!1,2e3)}computeSync(e,t){if(!this._editor.hasModel()||e.type!==1)return[];const i=this._editor.getModel(),n=e.range.startLineNumber,o=i.getLineMaxColumn(n),r=[];let a=1e3;const l=i.getLineLength(n),d=i.getLanguageIdAtPosition(e.range.startLineNumber,e.range.startColumn),c=this._editor.getOption(117),u=this._configurationService.getValue("editor.maxTokenizationLineLength",{overrideIdentifier:d});let h=!1;c>=0&&l>c&&e.range.startColumn>=c&&(h=!0,r.push(new Ka(this,e.range,[{value:p("stopped rendering","Rendering paused for long line for performance reasons. This can be configured via `editor.stopRenderingLineAfter`.")}],!1,a++))),!h&&typeof u=="number"&&l>=u&&r.push(new Ka(this,e.range,[{value:p("too many characters","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 m=f.range.startLineNumber===n?f.range.startColumn:1,_=f.range.endLineNumber===n?f.range.endColumn:o,v=f.options.hoverMessage;if(!v||L_(v))continue;f.options.beforeContentClassName&&(g=!0);const b=new x(e.range.startLineNumber,m,e.range.startLineNumber,_);r.push(new Ka(this,b,OP(v),g,a++))}return r}computeAsync(e,t,i){if(!this._editor.hasModel()||e.type!==1)return Xi.EMPTY;const n=this._editor.getModel(),o=this._languageFeaturesService.hoverProvider;return o.has(n)?this._getMarkdownHovers(o,n,e,i):Xi.EMPTY}_getMarkdownHovers(e,t,i,n){const o=i.range.getStartPosition();return w4(e,t,o,n).filter(l=>!L_(l.hover.contents)).map(l=>{const d=l.hover.range?x.lift(l.hover.range):i.range,c=new Mq(l.hover,l.provider,o);return new Ka(this,d,l.hover.contents,!1,l.ordinal,c)})}renderHoverParts(e,t){return this._renderedHoverParts=new Qke(t,e.fragment,this._editor,this._languageService,this._openerService,this._keybindingService,this._hoverService,this._configurationService,e.onContentsChanged),this._renderedHoverParts}updateFocusedMarkdownHoverPartVerbosityLevel(e){var t;(t=this._renderedHoverParts)===null||t===void 0||t.updateFocusedHoverPartVerbosityLevel(e)}};RC=Zke([Rp(1,vi),Rp(2,Bo),Rp(3,rt),Rp(4,Ce),Rp(5,At),Rp(6,Md)],RC);class Qke extends H{constructor(e,t,i,n,o,r,a,l,d){super(),this._editor=i,this._languageService=n,this._openerService=o,this._keybindingService=r,this._hoverService=a,this._configurationService=l,this._onFinishedRendering=d,this._hoverFocusInfo={hoverPartIndex:-1,focusRemains:!1},this._renderedHoverParts=this._renderHoverParts(e,t,this._onFinishedRendering),this._register(Ie(()=>{this._renderedHoverParts.forEach(c=>{c.disposables.dispose()})}))}_renderHoverParts(e,t,i){return e.sort(ao(n=>n.ordinal,ua)),e.map((n,o)=>{const r=this._renderHoverPart(o,n.contents,n.source,i);return t.appendChild(r.renderedMarkdown),r})}_renderHoverPart(e,t,i,n){const{renderedMarkdown:o,disposables:r}=this._renderMarkdownContent(t,n);if(!i)return{renderedMarkdown:o,disposables:r};const a=i.supportsVerbosityAction(ja.Increase),l=i.supportsVerbosityAction(ja.Decrease);if(!a&&!l)return{renderedMarkdown:o,disposables:r,hoverSource:i};const d=Cm("div.verbosity-actions");o.prepend(d),r.add(this._renderHoverExpansionAction(d,ja.Increase,a)),r.add(this._renderHoverExpansionAction(d,ja.Decrease,l));const c=r.add(ba(o));return r.add(c.onDidFocus(()=>{this._hoverFocusInfo={hoverPartIndex:e,focusRemains:!0}})),r.add(c.onDidBlur(()=>{var u;if(!((u=this._hoverFocusInfo)===null||u===void 0)&&u.focusRemains){this._hoverFocusInfo.focusRemains=!1;return}})),{renderedMarkdown:o,disposables:r,hoverSource:i}}_renderMarkdownContent(e,t){const i=Cm("div.hover-row");i.tabIndex=0;const n=Cm("div.hover-row-contents");i.appendChild(n);const o=new Y;return o.add(Rq(this._editor,n,e,this._languageService,this._openerService,t)),{renderedMarkdown:i,disposables:o}}_renderHoverExpansionAction(e,t,i){const n=new Y,o=t===ja.Increase,r=Q(e,Cm(Pe.asCSSSelector(o?Xke:Yke)));r.tabIndex=0;const a=new S_("mouse",!1,{target:e,position:{hoverPosition:0}},this._configurationService,this._hoverService);if(o){const d=this._keybindingService.lookupKeybinding(_4);n.add(this._hoverService.setupUpdatableHover(a,r,d?p("increaseVerbosityWithKb","Increase Verbosity ({0})",d.getLabel()):p("increaseVerbosity","Increase Verbosity")))}else{const d=this._keybindingService.lookupKeybinding(v4);n.add(this._hoverService.setupUpdatableHover(a,r,d?p("decreaseVerbosityWithKb","Decrease Verbosity ({0})",d.getLabel()):p("decreaseVerbosity","Decrease Verbosity")))}if(!i)return r.classList.add("disabled"),n;r.classList.add("enabled");const l=()=>this.updateFocusedHoverPartVerbosityLevel(t);return n.add(new G$(r,l)),n.add(new Z$(r,l,[3,10])),n}async updateFocusedHoverPartVerbosityLevel(e){var t;const i=this._editor.getModel();if(!i)return;const n=this._hoverFocusInfo.hoverPartIndex,o=this._getRenderedHoverPartAtIndex(n);if(!o||!(!((t=o.hoverSource)===null||t===void 0)&&t.supportsVerbosityAction(e)))return;const r=o.hoverSource.hoverPosition,a=o.hoverSource.hoverProvider,l=o.hoverSource.hover,d={verbosityRequest:{action:e,previousHover:l}};let c;try{c=await Promise.resolve(a.provideHover(i,r,dt.None,d))}catch(g){Ai(g)}if(!c)return;const u=new Mq(c,a,r),h=this._renderHoverPart(n,c.contents,u,this._onFinishedRendering);this._replaceRenderedHoverPartAtIndex(n,h),this._focusOnHoverPartWithIndex(n),this._onFinishedRendering()}_replaceRenderedHoverPartAtIndex(e,t){if(e>=this._renderHoverParts.length||e<0)return;const i=this._renderedHoverParts[e];i.renderedMarkdown.replaceWith(t.renderedMarkdown),i.disposables.dispose(),this._renderedHoverParts[e]=t}_focusOnHoverPartWithIndex(e){this._renderedHoverParts[e].renderedMarkdown.focus(),this._hoverFocusInfo.focusRemains=!0}_getRenderedHoverPartAtIndex(e){return this._renderedHoverParts[e]}}function Jke(s,e,t,i,n){e.sort(ao(r=>r.ordinal,ua));const o=new Y;for(const r of e)o.add(Rq(t,s.fragment,r.contents,i,n,s.onContentsChanged));return o}function Rq(s,e,t,i,n,o){const r=new Y;for(const a of t){if(L_(a))continue;const l=Cm("div.markdown-hover"),d=Q(l,Cm("div.hover-contents")),c=r.add(new yd({editor:s},i,n));r.add(c.onDidRenderAsync(()=>{d.className="hover-contents code-hover-contents",o()}));const u=r.add(c.render(a));d.appendChild(u.element),e.appendChild(l)}return r}function KM(s,e){return!!s[e]}class dT{constructor(e,t){this.target=e.target,this.isLeftClick=e.event.leftButton,this.isMiddleClick=e.event.middleButton,this.isRightClick=e.event.rightButton,this.hasTriggerModifier=KM(e.event,t.triggerModifier),this.hasSideBySideModifier=KM(e.event,t.triggerSideBySideModifier),this.isNoneOrSingleMouseDown=e.event.detail<=1}}class j7{constructor(e,t){this.keyCodeIsTriggerKey=e.keyCode===t.triggerKey,this.keyCodeIsSideBySideKey=e.keyCode===t.triggerSideBySideKey,this.hasTriggerModifier=KM(e,t.triggerModifier)}}class sy{constructor(e,t,i,n){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}}function K7(s){return s==="altKey"?lt?new sy(57,"metaKey",6,"altKey"):new sy(5,"ctrlKey",6,"altKey"):lt?new sy(6,"altKey",57,"metaKey"):new sy(6,"altKey",5,"ctrlKey")}class vk extends H{constructor(e,t){var i;super(),this._onMouseMoveOrRelevantKeyDown=this._register(new B),this.onMouseMoveOrRelevantKeyDown=this._onMouseMoveOrRelevantKeyDown.event,this._onExecute=this._register(new B),this.onExecute=this._onExecute.event,this._onCancel=this._register(new B),this.onCancel=this._onCancel.event,this._editor=e,this._extractLineNumberFromMouseEvent=(i=t==null?void 0:t.extractLineNumberFromMouseEvent)!==null&&i!==void 0?i:n=>n.target.position?n.target.position.lineNumber:0,this._opts=K7(this._editor.getOption(78)),this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._lineNumberOnMouseDown=0,this._register(this._editor.onDidChangeConfiguration(n=>{if(n.hasChanged(78)){const o=K7(this._editor.getOption(78));if(this._opts.equals(o))return;this._opts=o,this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._lineNumberOnMouseDown=0,this._onCancel.fire()}})),this._register(this._editor.onMouseMove(n=>this._onEditorMouseMove(new dT(n,this._opts)))),this._register(this._editor.onMouseDown(n=>this._onEditorMouseDown(new dT(n,this._opts)))),this._register(this._editor.onMouseUp(n=>this._onEditorMouseUp(new dT(n,this._opts)))),this._register(this._editor.onKeyDown(n=>this._onEditorKeyDown(new j7(n,this._opts)))),this._register(this._editor.onKeyUp(n=>this._onEditorKeyUp(new j7(n,this._opts)))),this._register(this._editor.onMouseDrag(()=>this._resetHandler())),this._register(this._editor.onDidChangeCursorSelection(n=>this._onDidChangeCursorSelection(n))),this._register(this._editor.onDidChangeModel(n=>this._resetHandler())),this._register(this._editor.onDidChangeModelContent(()=>this._resetHandler())),this._register(this._editor.onDidScrollChange(n=>{(n.scrollTopChanged||n.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._hasTriggerKeyOnMouseDown&&this._lineNumberOnMouseDown&&this._lineNumberOnMouseDown===t&&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 Pq{constructor(e,t){this.range=e,this.direction=t}}class y4{constructor(e,t,i){this.hint=e,this.anchor=t,this.provider=i,this._isResolved=!1}with(e){const t=new y4(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){var t,i,n;try{const o=await Promise.resolve(this.provider.resolveInlayHint(this.hint,e));this.hint.tooltip=(t=o==null?void 0:o.tooltip)!==null&&t!==void 0?t:this.hint.tooltip,this.hint.label=(i=o==null?void 0:o.label)!==null&&i!==void 0?i:this.hint.label,this.hint.textEdits=(n=o==null?void 0:o.textEdits)!==null&&n!==void 0?n:this.hint.textEdits,this._isResolved=!0}catch(o){Ai(o),this._isResolved=!1}}}class gf{static async create(e,t,i,n){const o=[],r=e.ordered(t).reverse().map(a=>i.map(async l=>{try{const d=await a.provideInlayHints(t,l,n);(d!=null&&d.hints.length||a.onDidChangeInlayHints)&&o.push([d??gf._emptyInlayHintList,a])}catch(d){Ai(d)}}));if(await Promise.all(r.flat()),n.isCancellationRequested||t.isDisposed())throw new sl;return new gf(i,o,t)}constructor(e,t,i){this._disposables=new Y,this.ranges=e,this.provider=new Set;const n=[];for(const[o,r]of t){this._disposables.add(o),this.provider.add(r);for(const a of o.hints){const l=i.validatePosition(a.position);let d="before";const c=gf._getRangeAtPosition(i,l);let u;c.getStartPosition().isBefore(l)?(u=x.fromPositions(c.getStartPosition(),l),d="after"):(u=x.fromPositions(l,c.getEndPosition()),d="before"),n.push(new y4(a,new Pq(u,d),r))}}this.items=n.sort((o,r)=>W.compare(o.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 x(i,n.startColumn,i,n.endColumn);e.tokenization.tokenizeIfCheap(i);const o=e.tokenization.getLineTokens(i),r=t.column-1,a=o.findTokenIndexAtOffset(r);let l=o.getStartOffset(a),d=o.getEndOffset(a);return d-l===1&&(l===r&&a>1?(l=o.getStartOffset(a-1),d=o.getEndOffset(a-1)):d===r&&a=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Ud=function(s,e){return function(t,i){e(t,i,s)}};let Uh=class extends y_{constructor(e,t,i,n,o,r,a,l,d,c,u,h,g){super(e,{...n.getRawOptions(),overflowWidgetsDomNode:n.getOverflowWidgetsDomNode()},i,o,r,a,l,d,c,u,h,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){UL(this._overwriteOptions,e,!0),super.updateOptions(this._overwriteOptions)}};Uh=tEe([Ud(4,Ne),Ud(5,xt),Ud(6,gi),Ud(7,Be),Ud(8,_n),Ud(9,en),Ud(10,gr),Ud(11,Yt),Ud(12,Ce)],Uh);const q7=new $(new bt(0,122,204)),iEe={showArrow:!0,showFrame:!0,className:"",frameColor:q7,arrowColor:q7,keepEditorSelection:!1},nEe="vs.editor.contrib.zoneWidget";class sEe{constructor(e,t,i,n,o,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=o,this._onComputedHeight=r}onDomNodeTop(e){this._onDomNodeTop(e)}onComputedHeight(e){this._onComputedHeight(e)}}class oEe{constructor(e,t){this._id=e,this._domNode=t}getId(){return this._id}getDomNode(){return this._domNode}getPosition(){return null}}class bk{constructor(e){this._editor=e,this._ruleName=bk._IdGenerator.nextId(),this._decorations=this._editor.createDecorationsCollection(),this._color=null,this._height=-1}dispose(){this.hide(),oA(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(){oA(this._ruleName),$S(`.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:x.fromPositions(e),options:{description:"zone-widget-arrow",className:this._ruleName,stickiness:1}}])}hide(){this._decorations.clear()}}bk._IdGenerator=new bO(".arrow-decoration-");class rEe{constructor(e,t={}){this._arrow=null,this._overlayWidget=null,this._resizeSash=null,this._viewZone=null,this._disposables=new Y,this.container=null,this._isShowing=!1,this.editor=e,this._positionMarkerId=this.editor.createDecorationsCollection(),this.options=Jd(t),UL(this.options,iEe,!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 bk(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){var t;if(this.domNode.style.height=`${e}px`,this.container){const i=e-this._decoratingElementsHeight();this.container.style.height=`${i}px`;const n=this.editor.getLayoutInfo();this._doLayout(i,this._getWidth(n))}(t=this._resizeSash)===null||t===void 0||t.layout()}get position(){const e=this._positionMarkerId.getRange(0);if(e)return e.getStartPosition()}show(e,t){const i=x.isIRange(e)?x.lift(e):x.fromPositions(e);this._isShowing=!0,this._showImpl(i,t),this._isShowing=!1,this._positionMarkerId.set([{range:i,options:Ye.EMPTY}])}hide(){var e;this._viewZone&&(this.editor.changeViewZones(t=>{this._viewZone&&t.removeZone(this._viewZone.id)}),this._viewZone=null),this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),(e=this._arrow)===null||e===void 0||e.hide(),this._positionMarkerId.clear()}_decoratingElementsHeight(){const e=this.editor.getOption(67);let t=0;if(this.options.showArrow){const i=Math.round(e/3);t+=2*i}if(this.options.showFrame){const i=Math.round(e/9);t+=2*i}return t}_showImpl(e,t){const i=e.getStartPosition(),n=this.editor.getLayoutInfo(),o=this._getWidth(n);this.domNode.style.width=`${o}px`,this.domNode.style.left=this._getLeft(n)+"px";const r=document.createElement("div");r.style.overflow="hidden";const a=this.editor.getOption(67);if(!this.options.allowUnlimitedHeight){const h=Math.max(12,this.editor.getLayoutInfo().height/a*.8);t=Math.min(t,h)}let l=0,d=0;if(this._arrow&&this.options.showArrow&&(l=Math.round(a/3),this._arrow.height=l,this._arrow.show(i)),this.options.showFrame&&(d=Math.round(a/9)),this.editor.changeViewZones(h=>{this._viewZone&&h.removeZone(this._viewZone.id),this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),this.domNode.style.top="-1000px",this._viewZone=new sEe(r,i.lineNumber,i.column,t,g=>this._onViewZoneTop(g),g=>this._onViewZoneHeight(g),this.options.showInHiddenAreas,this.options.ordinal),this._viewZone.id=h.addZone(this._viewZone),this._overlayWidget=new oEe(nEe+this._viewZone.id,this.domNode),this.editor.addOverlayWidget(this._overlayWidget)}),this.container&&this.options.showFrame){const h=this.options.frameWidth?this.options.frameWidth:d;this.container.style.borderTopWidth=h+"px",this.container.style.borderBottomWidth=h+"px"}const c=t*a-this._decoratingElementsHeight();this.container&&(this.container.style.top=l+"px",this.container.style.height=c+"px",this.container.style.overflow="hidden"),this._doLayout(c,o),this.options.keepEditorSelection||this.editor.setSelection(e);const u=this.editor.getModel();if(u){const h=u.validateRange(new x(e.startLineNumber,1,e.endLineNumber+1,1));this.revealRange(h,h.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){this._viewZone&&this._viewZone.heightInLines!==e&&this.editor.changeViewZones(t=>{this._viewZone&&(this._viewZone.heightInLines=e,t.layoutZone(this._viewZone.id))})}_initSash(){if(this._resizeSash)return;this._resizeSash=this._disposables.add(new is(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._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(67),n=i<0?Math.ceil(i):Math.floor(i),o=e.heightInLines+n;o>5&&o<35&&this._relayout(o)}}))}getHorizontalSashLeft(){return 0}getHorizontalSashTop(){return(this.domNode.style.height===null?0:parseInt(this.domNode.style.height))-this._decoratingElementsHeight()/2}getHorizontalSashWidth(){const e=this.editor.getLayoutInfo();return e.width-e.minimap.minimapWidth}}var Fq=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Oq=function(s,e){return function(t,i){e(t,i,s)}};const Bq=ut("IPeekViewService");mt(Bq,class{constructor(){this._widgets=new Map}addExclusiveWidget(s,e){const t=this._widgets.get(s);t&&(t.listener.dispose(),t.widget.dispose());const i=()=>{const n=this._widgets.get(s);n&&n.widget===e&&(n.listener.dispose(),this._widgets.delete(s))};this._widgets.set(s,{widget:e,listener:e.onDidClose(i)})}},1);var po;(function(s){s.inPeekEditor=new ue("inReferenceSearchEditor",!0,p("inReferenceSearchEditor","Whether the current code editor is embedded inside peek")),s.notInPeekEditor=s.inPeekEditor.toNegated()})(po||(po={}));let PC=class{constructor(e,t){e instanceof Uh&&po.inPeekEditor.bindTo(t)}dispose(){}};PC.ID="editor.contrib.referenceController";PC=Fq([Oq(1,Be)],PC);kt(PC.ID,PC,0);function aEe(s){const e=s.get(xt).getFocusedCodeEditor();return e instanceof Uh?e.getParentEditor():e}const lEe={headerBackgroundColor:$.white,primaryHeadingColor:$.fromHex("#333333"),secondaryHeadingColor:$.fromHex("#6c6c6cb3")};let gL=class extends rEe{constructor(e,t,i){super(e,t),this.instantiationService=i,this._onDidClose=new B,this.onDidClose=this._onDidClose.event,UL(this.options,lEe,!1)}dispose(){this.disposed||(this.disposed=!0,super.dispose(),this._onDidClose.fire(this))}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=he(".head"),this._bodyElement=he(".body"),this._fillHead(this._headElement),this._fillBody(this._bodyElement),e.appendChild(this._headElement),e.appendChild(this._bodyElement)}_fillHead(e,t){this._titleElement=he(".peekview-title"),this.options.supportOnTitleClick&&(this._titleElement.classList.add("clickable"),Ni(this._titleElement,"click",o=>this._onTitleClick(o))),Q(this._headElement,this._titleElement),this._fillTitleIcon(this._titleElement),this._primaryHeading=he("span.filename"),this._secondaryHeading=he("span.dirname"),this._metaHeading=he("span.meta"),Q(this._titleElement,this._primaryHeading,this._secondaryHeading,this._metaHeading);const i=he(".peekview-actions");Q(this._headElement,i);const n=this._getActionBarOptions();this._actionbarWidget=new Vr(i,n),this._disposables.add(this._actionbarWidget),t||this._actionbarWidget.push(new Eo("peekview.close",p("label.close","Close"),Pe.asClassName(oe.close),!0,()=>(this.dispose(),Promise.resolve())),{label:!1,icon:!0})}_fillTitleIcon(e){}_getActionBarOptions(){return{actionViewItemProvider:kj.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:zn(this._secondaryHeading))}setMetaTitle(e){this._metaHeading&&(e?(this._metaHeading.innerText=e,Do(this._metaHeading)):Es(this._metaHeading))}_doLayout(e,t){if(!this._isShowing&&e<0){this.dispose();return}const i=Math.ceil(this.editor.getOption(67)*1.2),n=Math.round(e-(i+2));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`)}};gL=Fq([Oq(2,Ne)],gL);const dEe=N("peekViewTitle.background",{dark:"#252526",light:"#F3F3F3",hcDark:$.black,hcLight:$.white},p("peekViewTitleBackground","Background color of the peek view title area.")),Wq=N("peekViewTitleLabel.foreground",{dark:$.white,light:$.black,hcDark:$.white,hcLight:Tr},p("peekViewTitleForeground","Color of the peek view title.")),Hq=N("peekViewTitleDescription.foreground",{dark:"#ccccccb3",light:"#616161",hcDark:"#FFFFFF99",hcLight:"#292929"},p("peekViewTitleInfoForeground","Color of the peek view title info.")),cEe=N("peekView.border",{dark:ro,light:ro,hcDark:gt,hcLight:gt},p("peekViewBorder","Color of the peek view borders and arrow.")),uEe=N("peekViewResult.background",{dark:"#252526",light:"#F3F3F3",hcDark:$.black,hcLight:$.white},p("peekViewResultsBackground","Background color of the peek view result list."));N("peekViewResult.lineForeground",{dark:"#bbbbbb",light:"#646465",hcDark:$.white,hcLight:Tr},p("peekViewResultsMatchForeground","Foreground color for line nodes in the peek view result list."));N("peekViewResult.fileForeground",{dark:$.white,light:"#1E1E1E",hcDark:$.white,hcLight:Tr},p("peekViewResultsFileForeground","Foreground color for file nodes in the peek view result list."));N("peekViewResult.selectionBackground",{dark:"#3399ff33",light:"#3399ff33",hcDark:null,hcLight:null},p("peekViewResultsSelectionBackground","Background color of the selected entry in the peek view result list."));N("peekViewResult.selectionForeground",{dark:$.white,light:"#6C6C6C",hcDark:$.white,hcLight:Tr},p("peekViewResultsSelectionForeground","Foreground color of the selected entry in the peek view result list."));const Yu=N("peekViewEditor.background",{dark:"#001F33",light:"#F2F8FC",hcDark:$.black,hcLight:$.white},p("peekViewEditorBackground","Background color of the peek view editor."));N("peekViewEditorGutter.background",{dark:Yu,light:Yu,hcDark:Yu,hcLight:Yu},p("peekViewEditorGutterBackground","Background color of the gutter in the peek view editor."));N("peekViewEditorStickyScroll.background",{dark:Yu,light:Yu,hcDark:Yu,hcLight:Yu},p("peekViewEditorStickScrollBackground","Background color of sticky scroll in the peek view editor."));N("peekViewResult.matchHighlightBackground",{dark:"#ea5c004d",light:"#ea5c004d",hcDark:null,hcLight:null},p("peekViewResultsMatchHighlight","Match highlight color in the peek view result list."));N("peekViewEditor.matchHighlightBackground",{dark:"#ff8f0099",light:"#f5d802de",hcDark:null,hcLight:null},p("peekViewEditorMatchHighlight","Match highlight color in the peek view editor."));N("peekViewEditor.matchHighlightBorder",{dark:null,light:null,hcDark:di,hcLight:di},p("peekViewEditorMatchHighlightBorder","Match highlight border in the peek view editor."));class $h{constructor(e,t,i,n){this.isProviderFirst=e,this.parent=t,this.link=i,this._rangeCallback=n,this.id=c2.nextId()}get uri(){return this.link.uri}get range(){var e,t;return(t=(e=this._range)!==null&&e!==void 0?e:this.link.targetSelectionRange)!==null&&t!==void 0?t:this.link.range}set range(e){this._range=e,this._rangeCallback(this)}get ariaMessage(){var e;const t=(e=this.parent.getPreview(this))===null||e===void 0?void 0:e.preview(this.range);return t?p({},"{0} in {1} on line {2} at column {3}",t.value,Wr(this.uri),this.range.startLineNumber,this.range.startColumn):p("aria.oneReference","in {0} on line {1} at column {2}",Wr(this.uri),this.range.startLineNumber,this.range.startColumn)}}class hEe{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:o,endLineNumber:r,endColumn:a}=e,l=i.getWordUntilPosition({lineNumber:n,column:o-t}),d=new x(n,l.startColumn,n,o),c=new x(r,a,r,1073741824),u=i.getValueInRange(d).replace(/^\s+/,""),h=i.getValueInRange(e),g=i.getValueInRange(c).replace(/\s+$/,"");return{value:u+h+g,highlight:{start:u.length,end:u.length+h.length}}}}class FC{constructor(e,t){this.parent=e,this.uri=t,this.children=[],this._previews=new Wi}dispose(){jt(this._previews.values()),this._previews.clear()}getPreview(e){return this._previews.get(e.uri)}get ariaMessage(){const e=this.children.length;return e===1?p("aria.fileReferences.1","1 symbol in {0}, full path {1}",Wr(this.uri),this.uri.fsPath):p("aria.fileReferences.N","{0} symbols in {1}, full path {2}",e,Wr(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 hEe(i))}catch(i){Xe(i)}return this}}class To{constructor(e,t){this.groups=[],this.references=[],this._onDidChangeReferenceRange=new B,this.onDidChangeReferenceRange=this._onDidChangeReferenceRange.event,this._links=e,this._title=t;const[i]=e;e.sort(To._compareReferences);let n;for(const o of e)if((!n||!ci.isEqual(n.uri,o.uri,!0))&&(n=new FC(this,o.uri),this.groups.push(n)),n.children.length===0||To._compareReferences(o,n.children[n.children.length-1])!==0){const r=new $h(i===o,n,o,a=>this._onDidChangeReferenceRange.fire(a));this.references.push(r),n.children.push(r)}}dispose(){jt(this.groups),this._onDidChangeReferenceRange.dispose(),this.groups.length=0}clone(){return new To(this._links,this._title)}get title(){return this._title}get isEmpty(){return this.groups.length===0}get ariaMessage(){return this.isEmpty?p("aria.result.0","No results found"):this.references.length===1?p("aria.result.1","Found 1 symbol in {0}",this.references[0].uri.fsPath):this.groups.length===1?p("aria.result.n1","Found {0} symbols in {1}",this.references.length,this.groups[0].uri.fsPath):p("aria.result.nm","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 o=i.children.length,r=i.parent.groups.length;return r===1||t&&n+10?(t?n=(n+1)%o:n=(n+o-1)%o,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,o)=>({idx:o,prefixLen:Sh(n.uri.toString(),e.toString()),offsetDist:Math.abs(n.range.startLineNumber-t.lineNumber)*100+Math.abs(n.range.startColumn-t.column)})).sort((n,o)=>n.prefixLen>o.prefixLen?-1:n.prefixLeno.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()&&x.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 ci.compare(e.uri,t.uri)||x.compareRangesUsingStarts(e.range,t.range)}}var Ck=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},wk=function(s,e){return function(t,i){e(t,i,s)}},qM;let GM=class{constructor(e){this._resolverService=e}hasChildren(e){return e instanceof To||e instanceof FC}getChildren(e){if(e instanceof To)return e.groups;if(e instanceof FC)return e.resolve(this._resolverService).then(t=>t.children);throw new Error("bad tree")}};GM=Ck([wk(0,mo)],GM);class gEe{getHeight(){return 23}getTemplateId(e){return e instanceof FC?OC.id:U1.id}}let ZM=class{constructor(e){this._keybindingService=e}getKeyboardNavigationLabel(e){var t;if(e instanceof $h){const i=(t=e.parent.getPreview(e))===null||t===void 0?void 0:t.preview(e.range);if(i)return i.value}return Wr(e.uri)}};ZM=Ck([wk(0,At)],ZM);class fEe{getId(e){return e instanceof $h?e.id:e.uri}}let XM=class extends H{constructor(e,t){super(),this._labelService=t;const i=document.createElement("div");i.classList.add("reference-file"),this.file=this._register(new jD(i,{supportHighlights:!0})),this.badge=new K2(Q(i,he(".count")),{},Lj),e.appendChild(i)}set(e,t){const i=Ax(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(p("referencesCount","{0} references",n)):this.badge.setTitleFormat(p("referenceCount","{0} reference",n))}};XM=Ck([wk(1,k_)],XM);let OC=qM=class{constructor(e){this._instantiationService=e,this.templateId=qM.id}renderTemplate(e){return this._instantiationService.createInstance(XM,e)}renderElement(e,t,i){i.set(e.element,Bx(e.filterData))}disposeTemplate(e){e.dispose()}};OC.id="FileReferencesRenderer";OC=qM=Ck([wk(0,Ne)],OC);class pEe extends H{constructor(e){super(),this.label=this._register(new uh(e))}set(e,t){var i;const n=(i=e.parent.getPreview(e))===null||i===void 0?void 0:i.preview(e.range);if(!n||!n.value)this.label.set(`${Wr(e.uri)}:${e.range.startLineNumber+1}:${e.range.startColumn+1}`);else{const{value:o,highlight:r}=n;t&&!el.isDefault(t)?(this.label.element.classList.toggle("referenceMatch",!1),this.label.set(o,Bx(t))):(this.label.element.classList.toggle("referenceMatch",!0),this.label.set(o,[r]))}}}class U1{constructor(){this.templateId=U1.id}renderTemplate(e){return new pEe(e)}renderElement(e,t,i){i.set(e.element,e.filterData)}disposeTemplate(e){e.dispose()}}U1.id="OneReferenceRenderer";class mEe{getWidgetAriaLabel(){return p("treeAriaLabel","References")}getAriaLabel(e){return e.ariaMessage}}var _Ee=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},$d=function(s,e){return function(t,i){e(t,i,s)}};class yk{constructor(e,t){this._editor=e,this._model=t,this._decorations=new Map,this._decorationIgnoreSet=new Set,this._callOnDispose=new Y,this._callOnModelChange=new Y,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,o=e.children.length;n{const o=n.deltaDecorations([],t);for(let r=0;r{o.equals(9)&&(this._keybindingService.dispatchEvent(o,o.target),o.stopPropagation())},!0)),this._tree=this._instantiationService.createInstance(bEe,"ReferencesWidget",this._treeContainer,new gEe,[this._instantiationService.createInstance(OC),this._instantiationService.createInstance(U1)],this._instantiationService.createInstance(GM),i),this._splitView.addView({onDidChange:le.None,element:this._previewContainer,minimumSize:200,maximumSize:Number.MAX_VALUE,layout:o=>{this._preview.layout({height:this._dim.height,width:o})}},WD.Distribute),this._splitView.addView({onDidChange:le.None,element:this._treeContainer,minimumSize:100,maximumSize:Number.MAX_VALUE,layout:o=>{this._treeContainer.style.height=`${this._dim.height}px`,this._treeContainer.style.width=`${o}px`,this._tree.layout(this._dim.height,o)}},WD.Distribute),this._disposables.add(this._splitView.onDidSashChange(()=>{this._dim.width&&(this.layoutData.ratio=this._splitView.getViewSize(0)/this._dim.width)},void 0));const n=(o,r)=>{o instanceof $h&&(r==="show"&&this._revealReference(o,!1),this._onDidSelectReference.fire({element:o,kind:r,source:"tree"}))};this._tree.onDidOpen(o=>{o.sideBySide?n(o.element,"side"):o.editorOptions.pinned?n(o.element,"goto"):n(o.element,"show")}),Es(this._treeContainer)}_onWidth(e){this._dim&&this._doLayoutBody(this._dim.height,e)}_doLayoutBody(e,t){super._doLayoutBody(e,t),this._dim=new Dt(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=p("noResults","No results"),Do(this._messageContainer),Promise.resolve(void 0)):(Es(this._messageContainer),this._decorationsManager=new yk(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"),Do(this._treeContainer),Do(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 $h)return e;if(e instanceof FC&&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!==Ge.inMemory?this.setTitle(bme(e.uri),this._uriLabel.getUriLabel(Ax(e.uri))):this.setTitle(p("peekView.alternateTitle","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}jt(this._previewModelReference);const o=n.object;if(o){const r=this._preview.getModel()===o.textEditorModel?0:1,a=x.lift(e.range).collapseToStart();this._previewModelReference=n,this._preview.setModel(o.textEditorModel),this._preview.setSelection(a),this._preview.revealRangeInCenter(a,r)}else this._preview.setModel(this._previewNotAvailableMessage),n.dispose()}};YM=_Ee([$d(3,_n),$d(4,mo),$d(5,Ne),$d(6,Bq),$d(7,k_),$d(8,Mx),$d(9,At),$d(10,vi),$d(11,Yt)],YM);var CEe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Pp=function(s,e){return function(t,i){e(t,i,s)}},uS;const vp=new ue("referenceSearchVisible",!1,p("referenceSearchVisible","Whether reference peek is visible, like 'Peek References' or 'Peek Definition'"));let V_=uS=class{static get(e){return e.getContribution(uS.ID)}constructor(e,t,i,n,o,r,a,l){this._defaultTreeKeyboardSupport=e,this._editor=t,this._editorService=n,this._notificationService=o,this._instantiationService=r,this._storageService=a,this._configurationService=l,this._disposables=new Y,this._requestIdPool=0,this._ignoreModelChangeEvent=!1,this._referenceSearchVisible=vp.bindTo(i)}dispose(){var e,t;this._referenceSearchVisible.reset(),this._disposables.dispose(),(e=this._widget)===null||e===void 0||e.dispose(),(t=this._model)===null||t===void 0||t.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 o="peekViewLayout",r=vEe.fromJSON(this._storageService.get(o,0,"{}"));this._widget=this._instantiationService.createInstance(YM,this._editor,this._defaultTreeKeyboardSupport,r),this._widget.setTitle(p("labelLoading","Loading...")),this._widget.show(e),this._disposables.add(this._widget.onDidClose(()=>{t.cancel(),this._widget&&(this._storageService.store(o,JSON.stringify(this._widget.layoutData),0,1),this._widget=void 0),this.closeWidget()})),this._disposables.add(this._widget.onDidSelectReference(l=>{const{element:d,kind:c}=l;if(d)switch(c){case"open":(l.source!=="editor"||!this._configurationService.getValue("editor.stablePeek"))&&this.openReference(d,!1,!1);break;case"side":this.openReference(d,!0,!1);break;case"goto":i?this._gotoReference(d,!0):this.openReference(d,!1,!0);break}}));const a=++this._requestIdPool;t.then(l=>{var d;if(a!==this._requestIdPool||!this._widget){l.dispose();return}return(d=this._model)===null||d===void 0||d.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(p("metaTitle.N","{0} ({1})",this._model.title,this._model.references.length));const c=this._editor.getModel().uri,u=new W(e.startLineNumber,e.startColumn),h=this._model.nearestReference(c,u);if(h)return this._widget.setSelection(h).then(()=>{this._widget&&this._editor.getOption(87)==="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),o=this._editor.hasTextFocus(),r=this._widget.isPreviewEditorFocused();await this._widget.setSelection(n),await this._gotoReference(n,!1),o?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){var t,i;(t=this._widget)===null||t===void 0||t.dispose(),(i=this._model)===null||i===void 0||i.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){var i;(i=this._widget)===null||i===void 0||i.hide(),this._ignoreModelChangeEvent=!0;const n=x.lift(e.range).collapseToStart();return this._editorService.openCodeEditor({resource:e.uri,options:{selection:n,selectionSource:"code.jump",pinned:t}},this._editor).then(o=>{var r;if(this._ignoreModelChangeEvent=!1,!o||!this._widget){this.closeWidget();return}if(this._editor===o)this._widget.show(n),this._widget.focusOnReferenceTree();else{const a=uS.get(o),l=this._model.clone();this.closeWidget(),o.focus(),a==null||a.toggleWidget(n,Dn(d=>Promise.resolve(l)),(r=this._peekMode)!==null&&r!==void 0?r:!1)}},o=>{this._ignoreModelChangeEvent=!1,Xe(o)})}openReference(e,t,i){t||this.closeWidget();const{uri:n,range:o}=e;this._editorService.openCodeEditor({resource:n,options:{selection:o,selectionSource:"code.jump",pinned:i}},this._editor,t)}};V_.ID="editor.contrib.referencesController";V_=uS=CEe([Pp(2,Be),Pp(3,xt),Pp(4,en),Pp(5,Ne),Pp(6,Rd),Pp(7,rt)],V_);function bp(s,e){const t=aEe(s);if(!t)return;const i=V_.get(t);i&&e(i)}go.registerCommandAndKeybindingRule({id:"togglePeekWidgetFocus",weight:100,primary:an(2089,60),when:G.or(vp,po.inPeekEditor),handler(s){bp(s,e=>{e.changeFocusBetweenPreviewAndReferences()})}});go.registerCommandAndKeybindingRule({id:"goToNextReference",weight:90,primary:62,secondary:[70],when:G.or(vp,po.inPeekEditor),handler(s){bp(s,e=>{e.goToNextOrPreviousReference(!0)})}});go.registerCommandAndKeybindingRule({id:"goToPreviousReference",weight:90,primary:1086,secondary:[1094],when:G.or(vp,po.inPeekEditor),handler(s){bp(s,e=>{e.goToNextOrPreviousReference(!1)})}});pt.registerCommandAlias("goToNextReferenceFromEmbeddedEditor","goToNextReference");pt.registerCommandAlias("goToPreviousReferenceFromEmbeddedEditor","goToPreviousReference");pt.registerCommandAlias("closeReferenceSearchEditor","closeReferenceSearch");pt.registerCommand("closeReferenceSearch",s=>bp(s,e=>e.closeWidget()));go.registerKeybindingRule({id:"closeReferenceSearch",weight:-1,primary:9,secondary:[1033],when:G.and(po.inPeekEditor,G.not("config.editor.stablePeek"))});go.registerKeybindingRule({id:"closeReferenceSearch",weight:250,primary:9,secondary:[1033],when:G.and(vp,G.not("config.editor.stablePeek"),G.or(T.editorTextFocus,wwe.negate()))});go.registerCommandAndKeybindingRule({id:"revealReference",weight:200,primary:3,mac:{primary:3,secondary:[2066]},when:G.and(vp,Zj,HO.negate(),VO.negate()),handler(s){var e;const i=(e=s.get(Kr).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(i)&&i[0]instanceof $h&&bp(s,n=>n.revealReference(i[0]))}});go.registerCommandAndKeybindingRule({id:"openReferenceToSide",weight:100,primary:2051,mac:{primary:259},when:G.and(vp,Zj,HO.negate(),VO.negate()),handler(s){var e;const i=(e=s.get(Kr).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(i)&&i[0]instanceof $h&&bp(s,n=>n.openReference(i[0],!0,!0))}});pt.registerCommand("openReference",s=>{var e;const i=(e=s.get(Kr).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(i)&&i[0]instanceof $h&&bp(s,n=>n.openReference(i[0],!1,!0))});var Vq=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Tv=function(s,e){return function(t,i){e(t,i,s)}};const S4=new ue("hasSymbols",!1,p("hasSymbols","Whether there are symbol locations that can be navigated via keyboard-only.")),Sk=ut("ISymbolNavigationService");let QM=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=S4.bindTo(e)}reset(){var e,t;this._ctxHasSymbols.reset(),(e=this._currentState)===null||e===void 0||e.dispose(),(t=this._currentMessage)===null||t===void 0||t.dispose(),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 JM(this._editorService),n=i.onDidChange(o=>{if(this._ignoreEditorChange)return;const r=this._editorService.getActiveCodeEditor();if(!r)return;const a=r.getModel(),l=r.getPosition();if(!a||!l)return;let d=!1,c=!1;for(const u of t.references)if(ZF(u.uri,a.uri))d=!0,c=c||x.containsPosition(u.range,l);else if(d)break;(!d||!c)&&this.reset()});this._currentState=ha(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:x.collapseToStart(t.range),selectionRevealType:3}},e).finally(()=>{this._ignoreEditorChange=!1})}_showMessage(){var e;(e=this._currentMessage)===null||e===void 0||e.dispose();const t=this._keybindingService.lookupKeybinding("editor.gotoNextSymbolFromResult"),i=t?p("location.kb","Symbol {0} of {1}, {2} for next",this._currentIdx+1,this._currentModel.references.length,t.getLabel()):p("location","Symbol {0} of {1}",this._currentIdx+1,this._currentModel.references.length);this._currentMessage=this._notificationService.status(i)}};QM=Vq([Tv(0,Be),Tv(1,xt),Tv(2,en),Tv(3,At)],QM);mt(Sk,QM,1);de(new class extends mn{constructor(){super({id:"editor.gotoNextSymbolFromResult",precondition:S4,kbOpts:{weight:100,primary:70}})}runEditorCommand(s,e){return s.get(Sk).revealNext(e)}});go.registerCommandAndKeybindingRule({id:"editor.gotoNextSymbolFromResult.cancel",weight:100,when:S4,primary:9,handler(s){s.get(Sk).reset()}});let JM=class{constructor(e){this._listener=new Map,this._disposables=new Y,this._onDidChange=new B,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(),jt(this._listener.values())}_onDidAddEditor(e){this._listener.set(e,ha(e.onDidChangeCursorPosition(t=>this._onDidChange.fire({editor:e})),e.onDidChangeModelContent(t=>this._onDidChange.fire({editor:e}))))}_onDidRemoveEditor(e){var t;(t=this._listener.get(e))===null||t===void 0||t.dispose(),this._listener.delete(e)}};JM=Vq([Tv(0,xt)],JM);async function $1(s,e,t,i){const o=t.ordered(s).map(a=>Promise.resolve(i(a,s,e)).then(void 0,l=>{Ai(l)})),r=await Promise.all(o);return pd(r.flat())}function Dk(s,e,t,i){return $1(e,t,s,(n,o,r)=>n.provideDefinition(o,r,i))}function zq(s,e,t,i){return $1(e,t,s,(n,o,r)=>n.provideDeclaration(o,r,i))}function Uq(s,e,t,i){return $1(e,t,s,(n,o,r)=>n.provideImplementation(o,r,i))}function $q(s,e,t,i){return $1(e,t,s,(n,o,r)=>n.provideTypeDefinition(o,r,i))}function Lk(s,e,t,i,n){return $1(e,t,s,async(o,r,a)=>{const l=await o.provideReferences(r,a,{includeDeclaration:!0},n);if(!i||!l||l.length!==2)return l;const d=await o.provideReferences(r,a,{includeDeclaration:!1},n);return d&&d.length===1?d:l})}async function j1(s){const e=await s(),t=new To(e,""),i=t.references.map(n=>n.link);return t.dispose(),i}Ad("_executeDefinitionProvider",(s,e,t)=>{const i=s.get(Ce),n=Dk(i.definitionProvider,e,t,dt.None);return j1(()=>n)});Ad("_executeTypeDefinitionProvider",(s,e,t)=>{const i=s.get(Ce),n=$q(i.typeDefinitionProvider,e,t,dt.None);return j1(()=>n)});Ad("_executeDeclarationProvider",(s,e,t)=>{const i=s.get(Ce),n=zq(i.declarationProvider,e,t,dt.None);return j1(()=>n)});Ad("_executeReferenceProvider",(s,e,t)=>{const i=s.get(Ce),n=Lk(i.referenceProvider,e,t,!1,dt.None);return j1(()=>n)});Ad("_executeImplementationProvider",(s,e,t)=>{const i=s.get(Ce),n=Uq(i.implementationProvider,e,t,dt.None);return j1(()=>n)});var tv,iv,nv,oy,ry,ay,ly,dy;yn.appendMenuItem(E.EditorContext,{submenu:E.EditorContextPeek,title:p("peek.submenu","Peek"),group:"navigation",order:100});class z_{static is(e){return!e||typeof e!="object"?!1:!!(e instanceof z_||W.isIPosition(e.position)&&e.model)}constructor(e,t){this.model=e,this.position=t}}class _s extends fl{static all(){return _s._allSymbolNavigationCommands.values()}static _patchConfig(e){const t={...e,f1:!0};if(t.menu)for(const i of ft.wrap(t.menu))(i.id===E.EditorContext||i.id===E.EditorContextPeek)&&(i.when=G.and(e.precondition,i.when));return t}constructor(e,t){super(_s._patchConfig(t)),this.configuration=e,_s._allSymbolNavigationCommands.set(t.id,this)}runEditorCommand(e,t,i,n){if(!t.hasModel())return Promise.resolve(void 0);const o=e.get(en),r=e.get(xt),a=e.get(sg),l=e.get(Sk),d=e.get(Ce),c=e.get(Ne),u=t.getModel(),h=t.getPosition(),g=z_.is(i)?i:new z_(u,h),f=new Bh(t,5),m=h1(this._getLocationModel(d,g.model,g.position,f.token),f.token).then(async _=>{var v;if(!_||f.token.isCancellationRequested)return;fo(_.ariaMessage);let b;if(_.referenceAt(u.uri,h)){const w=this._getAlternativeCommand(t);!_s._activeAlternativeCommands.has(w)&&_s._allSymbolNavigationCommands.has(w)&&(b=_s._allSymbolNavigationCommands.get(w))}const C=_.references.length;if(C===0){if(!this.configuration.muteMessage){const w=u.getWordAtPosition(h);(v=Vs.get(t))===null||v===void 0||v.showMessage(this._getNoResultFoundMessage(w),h)}}else if(C===1&&b)_s._activeAlternativeCommands.add(this.desc.id),c.invokeFunction(w=>b.runEditorCommand(w,t,i,n).finally(()=>{_s._activeAlternativeCommands.delete(this.desc.id)}));else return this._onResult(r,l,t,_,n)},_=>{o.error(_)}).finally(()=>{f.dispose()});return a.showWhile(m,250),m}async _onResult(e,t,i,n,o){const r=this._getGoToPreference(i);if(!(i instanceof Uh)&&(this.configuration.openInPeek||r==="peek"&&n.references.length>1))this._openInPeek(i,n,o);else{const a=n.firstReference(),l=n.references.length>1&&r==="gotoAndPeek",d=await this._openReference(i,e,a,this.configuration.openToSide,!l);l&&d?this._openInPeek(d,n,o):n.dispose(),r==="goto"&&t.put(a)}}async _openReference(e,t,i,n,o){let r;if(wre(i)&&(r=i.targetSelectionRange),r||(r=i.range),!r)return;const a=await t.openCodeEditor({resource:i.uri,options:{selection:x.collapseToStart(r),selectionRevealType:3,selectionSource:"code.jump"}},e,n);if(a){if(o){const l=a.getModel(),d=a.createDecorationsCollection([{range:r,options:{description:"symbol-navigate-action-highlight",className:"symbolHighlight"}}]);setTimeout(()=>{a.getModel()===l&&d.clear()},350)}return a}}_openInPeek(e,t,i){const n=V_.get(e);n&&e.hasModel()?n.toggleWidget(i??e.getSelection(),Dn(o=>Promise.resolve(t)),this.configuration.openInPeek):t.dispose()}}_s._allSymbolNavigationCommands=new Map;_s._activeAlternativeCommands=new Set;class K1 extends _s{async _getLocationModel(e,t,i,n){return new To(await Dk(e.definitionProvider,t,i,n),p("def.title","Definitions"))}_getNoResultFoundMessage(e){return e&&e.word?p("noResultWord","No definition found for '{0}'",e.word):p("generic.noResults","No definition found")}_getAlternativeCommand(e){return e.getOption(58).alternativeDefinitionCommand}_getGoToPreference(e){return e.getOption(58).multipleDefinitions}}qt((tv=class extends K1{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:tv.id,title:{...Ve("actions.goToDecl.label","Go to Definition"),mnemonicTitle:p({},"Go to &&Definition")},precondition:T.hasDefinitionProvider,keybinding:[{when:T.editorTextFocus,primary:70,weight:100},{when:G.and(T.editorTextFocus,jj),primary:2118,weight:100}],menu:[{id:E.EditorContext,group:"navigation",order:1.1},{id:E.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:2}]}),pt.registerCommandAlias("editor.action.goToDeclaration",tv.id)}},tv.id="editor.action.revealDefinition",tv));qt((iv=class extends K1{constructor(){super({openToSide:!0,openInPeek:!1,muteMessage:!1},{id:iv.id,title:Ve("actions.goToDeclToSide.label","Open Definition to the Side"),precondition:G.and(T.hasDefinitionProvider,T.isInEmbeddedEditor.toNegated()),keybinding:[{when:T.editorTextFocus,primary:an(2089,70),weight:100},{when:G.and(T.editorTextFocus,jj),primary:an(2089,2118),weight:100}]}),pt.registerCommandAlias("editor.action.openDeclarationToTheSide",iv.id)}},iv.id="editor.action.revealDefinitionAside",iv));qt((nv=class extends K1{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:nv.id,title:Ve("actions.previewDecl.label","Peek Definition"),precondition:G.and(T.hasDefinitionProvider,po.notInPeekEditor,T.isInEmbeddedEditor.toNegated()),keybinding:{when:T.editorTextFocus,primary:582,linux:{primary:3140},weight:100},menu:{id:E.EditorContextPeek,group:"peek",order:2}}),pt.registerCommandAlias("editor.action.previewDeclaration",nv.id)}},nv.id="editor.action.peekDefinition",nv));class jq extends _s{async _getLocationModel(e,t,i,n){return new To(await zq(e.declarationProvider,t,i,n),p("decl.title","Declarations"))}_getNoResultFoundMessage(e){return e&&e.word?p("decl.noResultWord","No declaration found for '{0}'",e.word):p("decl.generic.noResults","No declaration found")}_getAlternativeCommand(e){return e.getOption(58).alternativeDeclarationCommand}_getGoToPreference(e){return e.getOption(58).multipleDeclarations}}qt((oy=class extends jq{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:oy.id,title:{...Ve("actions.goToDeclaration.label","Go to Declaration"),mnemonicTitle:p({},"Go to &&Declaration")},precondition:G.and(T.hasDeclarationProvider,T.isInEmbeddedEditor.toNegated()),menu:[{id:E.EditorContext,group:"navigation",order:1.3},{id:E.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:3}]})}_getNoResultFoundMessage(e){return e&&e.word?p("decl.noResultWord","No declaration found for '{0}'",e.word):p("decl.generic.noResults","No declaration found")}},oy.id="editor.action.revealDeclaration",oy));qt(class extends jq{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.peekDeclaration",title:Ve("actions.peekDecl.label","Peek Declaration"),precondition:G.and(T.hasDeclarationProvider,po.notInPeekEditor,T.isInEmbeddedEditor.toNegated()),menu:{id:E.EditorContextPeek,group:"peek",order:3}})}});class Kq extends _s{async _getLocationModel(e,t,i,n){return new To(await $q(e.typeDefinitionProvider,t,i,n),p("typedef.title","Type Definitions"))}_getNoResultFoundMessage(e){return e&&e.word?p("goToTypeDefinition.noResultWord","No type definition found for '{0}'",e.word):p("goToTypeDefinition.generic.noResults","No type definition found")}_getAlternativeCommand(e){return e.getOption(58).alternativeTypeDefinitionCommand}_getGoToPreference(e){return e.getOption(58).multipleTypeDefinitions}}qt((ry=class extends Kq{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:ry.ID,title:{...Ve("actions.goToTypeDefinition.label","Go to Type Definition"),mnemonicTitle:p({},"Go to &&Type Definition")},precondition:T.hasTypeDefinitionProvider,keybinding:{when:T.editorTextFocus,primary:0,weight:100},menu:[{id:E.EditorContext,group:"navigation",order:1.4},{id:E.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:3}]})}},ry.ID="editor.action.goToTypeDefinition",ry));qt((ay=class extends Kq{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:ay.ID,title:Ve("actions.peekTypeDefinition.label","Peek Type Definition"),precondition:G.and(T.hasTypeDefinitionProvider,po.notInPeekEditor,T.isInEmbeddedEditor.toNegated()),menu:{id:E.EditorContextPeek,group:"peek",order:4}})}},ay.ID="editor.action.peekTypeDefinition",ay));class qq extends _s{async _getLocationModel(e,t,i,n){return new To(await Uq(e.implementationProvider,t,i,n),p("impl.title","Implementations"))}_getNoResultFoundMessage(e){return e&&e.word?p("goToImplementation.noResultWord","No implementation found for '{0}'",e.word):p("goToImplementation.generic.noResults","No implementation found")}_getAlternativeCommand(e){return e.getOption(58).alternativeImplementationCommand}_getGoToPreference(e){return e.getOption(58).multipleImplementations}}qt((ly=class extends qq{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:ly.ID,title:{...Ve("actions.goToImplementation.label","Go to Implementations"),mnemonicTitle:p({},"Go to &&Implementations")},precondition:T.hasImplementationProvider,keybinding:{when:T.editorTextFocus,primary:2118,weight:100},menu:[{id:E.EditorContext,group:"navigation",order:1.45},{id:E.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:4}]})}},ly.ID="editor.action.goToImplementation",ly));qt((dy=class extends qq{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:dy.ID,title:Ve("actions.peekImplementation.label","Peek Implementations"),precondition:G.and(T.hasImplementationProvider,po.notInPeekEditor,T.isInEmbeddedEditor.toNegated()),keybinding:{when:T.editorTextFocus,primary:3142,weight:100},menu:{id:E.EditorContextPeek,group:"peek",order:5}})}},dy.ID="editor.action.peekImplementation",dy));class Gq extends _s{_getNoResultFoundMessage(e){return e?p("references.no","No references found for '{0}'",e.word):p("references.noGeneric","No references found")}_getAlternativeCommand(e){return e.getOption(58).alternativeReferenceCommand}_getGoToPreference(e){return e.getOption(58).multipleReferences}}qt(class extends Gq{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:"editor.action.goToReferences",title:{...Ve("goToReferences.label","Go to References"),mnemonicTitle:p({},"Go to &&References")},precondition:G.and(T.hasReferenceProvider,po.notInPeekEditor,T.isInEmbeddedEditor.toNegated()),keybinding:{when:T.editorTextFocus,primary:1094,weight:100},menu:[{id:E.EditorContext,group:"navigation",order:1.45},{id:E.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:5}]})}async _getLocationModel(e,t,i,n){return new To(await Lk(e.referenceProvider,t,i,!0,n),p("ref.title","References"))}});qt(class extends Gq{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.referenceSearch.trigger",title:Ve("references.action.label","Peek References"),precondition:G.and(T.hasReferenceProvider,po.notInPeekEditor,T.isInEmbeddedEditor.toNegated()),menu:{id:E.EditorContextPeek,group:"peek",order:6}})}async _getLocationModel(e,t,i,n){return new To(await Lk(e.referenceProvider,t,i,!1,n),p("ref.title","References"))}});class wEe extends _s{constructor(e,t,i){super(e,{id:"editor.action.goToLocation",title:Ve("label.generic","Go to Any Symbol"),precondition:G.and(po.notInPeekEditor,T.isInEmbeddedEditor.toNegated())}),this._references=t,this._gotoMultipleBehaviour=i}async _getLocationModel(e,t,i,n){return new To(this._references,p("generic.title","Locations"))}_getNoResultFoundMessage(e){return e&&p("generic.noResult","No results for '{0}'",e.word)||""}_getGoToPreference(e){var t;return(t=this._gotoMultipleBehaviour)!==null&&t!==void 0?t:e.getOption(58).multipleReferences}_getAlternativeCommand(){return""}}pt.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:Ae},{name:"position",description:"The position at which to start",constraint:W.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(s,e,t,i,n,o,r)=>{yt(Ae.isUri(e)),yt(W.isIPosition(t)),yt(Array.isArray(i)),yt(typeof n>"u"||typeof n=="string"),yt(typeof r>"u"||typeof r=="boolean");const a=s.get(xt),l=await a.openCodeEditor({resource:e},a.getFocusedCodeEditor());if(Wh(l))return l.setPosition(t),l.revealPositionInCenterIfOutsideViewport(t,0),l.invokeWithinContext(d=>{const c=new class extends wEe{_getNoResultFoundMessage(u){return o||super._getNoResultFoundMessage(u)}}({muteMessage:!o,openInPeek:!!r,openToSide:!1},i,n);d.get(Ne).invokeFunction(c.run.bind(c),l)})}});pt.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:Ae},{name:"position",description:"The position at which to start",constraint:W.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(s,e,t,i,n)=>{s.get(gi).executeCommand("editor.action.goToLocations",e,t,i,n,void 0,!0)}});pt.registerCommand({id:"editor.action.findReferences",handler:(s,e,t)=>{yt(Ae.isUri(e)),yt(W.isIPosition(t));const i=s.get(Ce),n=s.get(xt);return n.openCodeEditor({resource:e},n.getFocusedCodeEditor()).then(o=>{if(!Wh(o)||!o.hasModel())return;const r=V_.get(o);if(!r)return;const a=Dn(d=>Lk(i.referenceProvider,o.getModel(),W.lift(t),!1,d).then(c=>new To(c,p("ref.title","References")))),l=new x(t.lineNumber,t.column,t.lineNumber,t.column);return Promise.resolve(r.toggleWidget(l,a,!1))})}});pt.registerCommandAlias("editor.action.showReferences","editor.action.peekLocations");async function yEe(s,e,t,i){var n;const o=s.get(mo),r=s.get(Oo),a=s.get(gi),l=s.get(Ne),d=s.get(en);if(await i.item.resolve(dt.None),!i.part.location)return;const c=i.part.location,u=[],h=new Set(yn.getMenuItems(E.EditorContext).map(f=>tm(f)?f.command.id:pk()));for(const f of _s.all())h.has(f.desc.id)&&u.push(new Eo(f.desc.id,Io.label(f.desc,{renderShortTitle:!0}),void 0,!0,async()=>{const m=await o.createModelReference(c.uri);try{const _=new z_(m.object.textEditorModel,x.getStartPosition(c.range)),v=i.item.anchor.range;await l.invokeFunction(f.runEditorCommand.bind(f),e,_,v)}finally{m.dispose()}}));if(i.part.command){const{command:f}=i.part;u.push(new rn),u.push(new Eo(f.id,f.title,void 0,!0,async()=>{var m;try{await a.executeCommand(f.id,...(m=f.arguments)!==null&&m!==void 0?m:[])}catch(_){d.notify({severity:Rx.Error,source:i.item.provider.displayName,message:_})}}))}const g=e.getOption(127);r.showContextMenu({domForShadowRoot:g&&(n=e.getDomNode())!==null&&n!==void 0?n:void 0,getAnchor:()=>{const f=qi(t);return{x:f.left,y:f.top+f.height+8}},getActions:()=>u,onHide:()=>{e.focus()},autoSelectFirstItem:!0})}async function Zq(s,e,t,i){const o=await s.get(mo).createModelReference(i.uri);await t.invokeWithinContext(async r=>{const a=e.hasSideBySideModifier,l=r.get(Be),d=po.inPeekEditor.getValue(l),c=!a&&t.getOption(88)&&!d;return new K1({openToSide:a,openInPeek:c,muteMessage:!0},{title:{value:"",original:""},id:"",precondition:void 0}).run(r,new z_(o.object.textEditorModel,x.getStartPosition(i.range)),x.lift(i.range))}),o.dispose()}var SEe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Fp=function(s,e){return function(t,i){e(t,i,s)}},Kp;class fL{constructor(){this._entries=new iu(50)}get(e){const t=fL._key(e);return this._entries.get(t)}set(e,t){const i=fL._key(e);this._entries.set(i,t)}static _key(e){return`${e.uri.toString()}/${e.getVersionId()}`}}const Xq=ut("IInlayHintsCache");mt(Xq,fL,1);class eR{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 DEe{constructor(e,t){this.part=e,this.hasTriggerModifier=t}}let jh=Kp=class{static get(e){var t;return(t=e.getContribution(Kp.ID))!==null&&t!==void 0?t:void 0}constructor(e,t,i,n,o,r,a){this._editor=e,this._languageFeaturesService=t,this._inlayHintsCache=n,this._commandService=o,this._notificationService=r,this._instaService=a,this._disposables=new Y,this._sessionDisposables=new Y,this._decorationsMetadata=new Map,this._ruleFactory=new v1(this._editor),this._activeRenderMode=0,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(141)&&this._update()})),this._update()}dispose(){this._sessionDisposables.dispose(),this._removeAllDecorations(),this._disposables.dispose()}_update(){this._sessionDisposables.clear(),this._removeAllDecorations();const e=this._editor.getOption(141);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 a,l;e.enabled==="onUnlessPressed"?(a=0,l=1):(a=1,l=0),this._activeRenderMode=a,this._sessionDisposables.add(hc.getInstance().event(d=>{if(!this._editor.hasModel())return;const c=d.altKey&&d.ctrlKey&&!(d.shiftKey||d.metaKey)?l:a;if(c!==this._activeRenderMode){this._activeRenderMode=c;const u=this._editor.getModel(),h=this._copyInlayHintsWithCurrentAnchor(u);this._updateHintsDecorators([u.getFullModelRange()],h),r.schedule(0)}}))}const i=this._inlayHintsCache.get(t);i&&this._updateHintsDecorators([t.getFullModelRange()],i),this._sessionDisposables.add(Ie(()=>{t.isDisposed()||this._cacheHintsForFastRestore(t)}));let n;const o=new Set,r=new Wt(async()=>{const a=Date.now();n==null||n.dispose(!0),n=new Vi;const l=t.onWillDispose(()=>n==null?void 0:n.cancel());try{const d=n.token,c=await gf.create(this._languageFeaturesService.inlayHintsProvider,t,this._getHintsRanges(),d);if(r.delay=this._debounceInfo.update(t,Date.now()-a),d.isCancellationRequested){c.dispose();return}for(const u of c.provider)typeof u.onDidChangeInlayHints=="function"&&!o.has(u)&&(o.add(u),this._sessionDisposables.add(u.onDidChangeInlayHints(()=>{r.isScheduled()||r.schedule()})));this._sessionDisposables.add(c),this._updateHintsDecorators(c.ranges,c.items),this._cacheHintsForFastRestore(t)}catch(d){Xe(d)}finally{n.dispose(),l.dispose()}},this._debounceInfo.get(t));this._sessionDisposables.add(r),this._sessionDisposables.add(Ie(()=>n==null?void 0:n.dispose(!0))),r.schedule(0),this._sessionDisposables.add(this._editor.onDidScrollChange(a=>{(a.scrollTopChanged||!r.isScheduled())&&r.schedule()})),this._sessionDisposables.add(this._editor.onDidChangeModelContent(a=>{n==null||n.cancel();const l=Math.max(r.delay,1250);r.schedule(l)})),this._sessionDisposables.add(this._installDblClickGesture(()=>r.schedule(0))),this._sessionDisposables.add(this._installLinkGesture()),this._sessionDisposables.add(this._installContextMenu())}_installLinkGesture(){const e=new Y,t=e.add(new vk(this._editor)),i=new Y;return e.add(i),e.add(t.onMouseMoveOrRelevantKeyDown(n=>{const[o]=n,r=this._getInlayHintLabelPart(o),a=this._editor.getModel();if(!r||!a){i.clear();return}const l=new Vi;i.add(Ie(()=>l.dispose(!0))),r.item.resolve(l.token),this._activeInlayHintPart=r.part.command||r.part.location?new DEe(r,o.hasTriggerModifier):void 0;const d=a.validatePosition(r.item.hint.position).lineNumber,c=new x(d,1,d,a.getLineMaxColumn(d)),u=this._getInlineHintsForRange(c);this._updateHintsDecorators([c],u),i.add(Ie(()=>{this._activeInlayHintPart=void 0,this._updateHintsDecorators([c],u)}))})),e.add(t.onCancel(()=>i.clear())),e.add(t.onExecute(async n=>{const o=this._getInlayHintLabelPart(n);if(o){const r=o.part;r.location?this._instaService.invokeFunction(Zq,n,this._editor,r.location):sN.is(r.command)&&await this._invokeCommand(r.command,o.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(dt.None),rs(i.item.hint.textEdits))){const n=i.item.hint.textEdits.map(o=>pi.replace(x.lift(o.range),o.text));this._editor.executeEdits("inlayHint.default",n),e()}})}_installContextMenu(){return this._editor.onContextMenu(async e=>{if(!(e.event.target instanceof HTMLElement))return;const t=this._getInlayHintLabelPart(e);t&&await this._instaService.invokeFunction(yEe,this._editor,e.event.target,t)})}_getInlayHintLabelPart(e){var t;if(e.target.type!==6)return;const i=(t=e.target.detail.injectedText)===null||t===void 0?void 0:t.options;if(i instanceof Ph&&(i==null?void 0:i.attachedData)instanceof eR)return i.attachedData}async _invokeCommand(e,t){var i;try{await this._commandService.executeCommand(e.id,...(i=e.arguments)!==null&&i!==void 0?i:[])}catch(n){this._notificationService.notify({severity:Rx.Error,source:t.provider.displayName,message:n})}}_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 o=e.getDecorationRange(i);if(o){const r=new Pq(o,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 o of i.sort(x.compareRangesUsingStarts)){const r=t.validateRange(new x(o.startLineNumber-30,o.startColumn,o.endLineNumber+30,o.endColumn));n.length===0||!x.areIntersectingOrTouching(n[n.length-1],r)?n.push(r):n[n.length-1]=x.plusRange(n[n.length-1],r)}return n}_updateHintsDecorators(e,t){var i,n;const o=[],r=(_,v,b,C,w)=>{const y={content:b,inlineClassNameAffectsLetterSpacing:!0,inlineClassName:v.className,cursorStops:C,attachedData:w};o.push({item:_,classNameRef:v,decoration:{range:_.anchor.range,options:{description:"InlayHint",showIfCollapsed:_.anchor.range.isEmpty(),collapseOnReplaceEdit:!_.anchor.range.isEmpty(),stickiness:0,[_.anchor.direction]:this._activeRenderMode===0?y:void 0}}})},a=(_,v)=>{const b=this._ruleFactory.createClassNameRef({width:`${l/3|0}px`,display:"inline-block"});r(_,b," ",v?aa.Right:aa.None)},{fontSize:l,fontFamily:d,padding:c,isUniform:u}=this._getLayoutInfo(),h="--code-editorInlayHintsFontFamily";this._editor.getContainerDomNode().style.setProperty(h,d);let g={line:0,totalLen:0};for(const _ of t){if(g.line!==_.anchor.range.startLineNumber&&(g={line:_.anchor.range.startLineNumber,totalLen:0}),g.totalLen>Kp._MAX_LABEL_LEN)continue;_.hint.paddingLeft&&a(_,!1);const v=typeof _.hint.label=="string"?[{label:_.hint.label}]:_.hint.label;for(let b=0;b0&&(L=L.slice(0,-I)+"…",k=!0),r(_,this._ruleFactory.createClassNameRef(D),LEe(L),y&&!_.hint.paddingRight?aa.Right:aa.None,new eR(_,b)),k)break}if(_.hint.paddingRight&&a(_,!0),o.length>Kp._MAX_DECORATORS)break}const f=[];for(const[_,v]of this._decorationsMetadata){const b=(n=this._editor.getModel())===null||n===void 0?void 0:n.getDecorationRange(_);b&&e.some(C=>C.containsRange(b))&&(f.push(_),v.classNameRef.dispose(),this._decorationsMetadata.delete(_))}const m=cl.capture(this._editor);this._editor.changeDecorations(_=>{const v=_.deltaDecorations(f,o.map(b=>b.decoration));for(let b=0;bi)&&(o=i);const r=e.fontFamily||n;return{fontSize:o,fontFamily:r,padding:t,isUniform:!t&&r===n&&o===i}}_removeAllDecorations(){this._editor.removeDecorations(Array.from(this._decorationsMetadata.keys()));for(const e of this._decorationsMetadata.values())e.classNameRef.dispose();this._decorationsMetadata.clear()}};jh.ID="editor.contrib.InlayHints";jh._MAX_DECORATORS=1500;jh._MAX_LABEL_LEN=43;jh=Kp=SEe([Fp(1,Ce),Fp(2,Ur),Fp(3,Xq),Fp(4,gi),Fp(5,en),Fp(6,Ne)],jh);function LEe(s){return s.replace(/[ \t]/g," ")}pt.registerCommand("_executeInlayHintProvider",async(s,...e)=>{const[t,i]=e;yt(Ae.isUri(t)),yt(x.isIRange(i));const{inlayHintsProvider:n}=s.get(Ce),o=await s.get(mo).createModelReference(t);try{const r=await gf.create(n,o.object.textEditorModel,[x.lift(i)],dt.None),a=r.items.map(l=>l.hint);return setTimeout(()=>r.dispose(),0),a}finally{o.dispose()}});var xEe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Dg=function(s,e){return function(t,i){e(t,i,s)}};class G7 extends hf{constructor(e,t,i,n){super(10,t,e.item.anchor.range,i,n,!0),this.part=e}}let pL=class extends RC{constructor(e,t,i,n,o,r,a,l){super(e,t,i,r,l,n,o),this._resolverService=a,this.hoverOrdinal=6}suggestHoverAnchor(e){var t;if(!jh.get(this._editor)||e.target.type!==6)return null;const n=(t=e.target.detail.injectedText)===null||t===void 0?void 0:t.options;return n instanceof Ph&&n.attachedData instanceof eR?new G7(n.attachedData,this,e.event.posx,e.event.posy):null}computeSync(){return[]}computeAsync(e,t,i){return e instanceof G7?new Xi(async n=>{const{part:o}=e;if(await o.item.resolve(i),i.isCancellationRequested)return;let r;typeof o.item.hint.tooltip=="string"?r=new ss().appendText(o.item.hint.tooltip):o.item.hint.tooltip&&(r=o.item.hint.tooltip),r&&n.emitOne(new Ka(this,e.range,[r],!1,0)),rs(o.item.hint.textEdits)&&n.emitOne(new Ka(this,e.range,[new ss().appendText(p("hint.dbl","Double-click to insert"))],!1,10001));let a;if(typeof o.part.tooltip=="string"?a=new ss().appendText(o.part.tooltip):o.part.tooltip&&(a=o.part.tooltip),a&&n.emitOne(new Ka(this,e.range,[a],!1,1)),o.part.location||o.part.command){let d;const u=this._editor.getOption(78)==="altKey"?lt?p("links.navigate.kb.meta.mac","cmd + click"):p("links.navigate.kb.meta","ctrl + click"):lt?p("links.navigate.kb.alt.mac","option + click"):p("links.navigate.kb.alt","alt + click");o.part.location&&o.part.command?d=new ss().appendText(p("hint.defAndCommand","Go to Definition ({0}), right click for more",u)):o.part.location?d=new ss().appendText(p("hint.def","Go to Definition ({0})",u)):o.part.command&&(d=new ss(`[${p("hint.cmd","Execute Command")}](${eEe(o.part.command)} "${o.part.command.title}") (${u})`,{isTrusted:!0})),d&&n.emitOne(new Ka(this,e.range,[d],!1,1e4))}const l=await this._resolveInlayHintLabelPartHover(o,i);for await(const d of l)n.emitOne(d)}):Xi.EMPTY}async _resolveInlayHintLabelPartHover(e,t){if(!e.part.location)return Xi.EMPTY;const{uri:i,range:n}=e.part.location,o=await this._resolverService.createModelReference(i);try{const r=o.object.textEditorModel;return this._languageFeaturesService.hoverProvider.has(r)?w4(this._languageFeaturesService.hoverProvider,r,new W(n.startLineNumber,n.startColumn),t).filter(a=>!L_(a.hover.contents)).map(a=>new Ka(this,e.item.anchor.range,a.hover.contents,!1,2+a.ordinal)):Xi.EMPTY}finally{o.dispose()}}};pL=xEe([Dg(1,vi),Dg(2,Bo),Dg(3,At),Dg(4,Md),Dg(5,rt),Dg(6,mo),Dg(7,Ce)],pL);class mL{get anchor(){return this._anchor}set anchor(e){this._anchor=e}get shouldFocus(){return this._shouldFocus}set shouldFocus(e){this._shouldFocus=e}get source(){return this._source}set source(e){this._source=e}get insistOnKeepingHoverVisible(){return this._insistOnKeepingHoverVisible}set insistOnKeepingHoverVisible(e){this._insistOnKeepingHoverVisible=e}constructor(e,t){this._editor=e,this._participants=t,this._anchor=null,this._shouldFocus=!1,this._source=0,this._insistOnKeepingHoverVisible=!1}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 o=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:o;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){const t=this._anchor;if(!this._editor.hasModel()||!t)return Xi.EMPTY;const i=mL._getLineDecorations(this._editor,t);return Xi.merge(this._participants.map(n=>n.computeAsync?n.computeAsync(t,i,e):Xi.EMPTY))}computeSync(){if(!this._editor.hasModel()||!this._anchor)return[];const e=mL._getLineDecorations(this._editor,this._anchor);let t=[];for(const i of this._participants)t=t.concat(i.computeSync(this._anchor,e));return pd(t)}}class Yq{constructor(e,t,i){this.anchor=e,this.messages=t,this.isComplete=i}filter(e){const t=this.messages.filter(i=>i.isValidForHoverAnchor(e));return t.length===this.messages.length?this:new kEe(this,this.anchor,t,this.isComplete)}}class kEe extends Yq{constructor(e,t,i,n){super(t,i,n),this.original=e}filter(e){return this.original.filter(e)}}class EEe{constructor(e,t,i,n,o,r,a,l,d,c){this.initialMousePosX=e,this.initialMousePosY=t,this.colorPicker=i,this.showAtPosition=n,this.showAtSecondaryPosition=o,this.preferAbove=r,this.stoleFocus=a,this.source=l,this.isBeforeContent=d,this.disposables=c,this.closestMouseDistance=void 0}}var IEe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},TEe=function(s,e){return function(t,i){e(t,i,s)}};const Z7=he;let _L=class extends H{get hasContent(){return this._hasContent}constructor(e){super(),this._keybindingService=e,this._hasContent=!1,this.hoverElement=Z7("div.hover-row.status-bar"),this.hoverElement.tabIndex=0,this.actionsElement=Q(this.hoverElement,Z7("div.actions"))}addAction(e){const t=this._keybindingService.lookupKeybinding(e.commandId),i=t?t.getLabel():null;return this._hasContent=!0,this._register(Fx.render(this.actionsElement,e,i))}append(e){const t=Q(this.actionsElement,e);return this._hasContent=!0,t}};_L=IEe([TEe(0,At)],_L);var NEe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},X7=function(s,e){return function(t,i){e(t,i,s)}},hS;let vL=hS=class extends H{constructor(e,t,i){super(),this._editor=e,this._instantiationService=t,this._keybindingService=i,this._currentResult=null,this._widget=this._register(this._instantiationService.createInstance(H_,this._editor)),this._participants=[];for(const n of ag.getAll()){const o=this._instantiationService.createInstance(n,this._editor);o instanceof RC&&!(o instanceof pL)&&(this._markdownHoverParticipant=o),this._participants.push(o)}this._participants.sort((n,o)=>n.hoverOrdinal-o.hoverOrdinal),this._computer=new mL(this._editor,this._participants),this._hoverOperation=this._register(new Aq(this._editor,this._computer)),this._register(this._hoverOperation.onResult(n=>{if(!this._computer.anchor)return;const o=n.hasLoadingMessage?this._addLoadingMessage(n.value):n.value;this._withResult(new Yq(this._computer.anchor,o,n.isComplete))})),this._register(Ni(this._widget.getDomNode(),"keydown",n=>{n.equals(9)&&this.hide()})),this._register(Ki.onDidChange(()=>{this._widget.position&&this._currentResult&&this._setCurrentResult(this._currentResult)}))}_startShowingOrUpdateHover(e,t,i,n,o){return!this._widget.position||!this._currentResult?e?(this._startHoverOperationIfNecessary(e,t,i,n,!1),!0):!1:this._editor.getOption(60).sticky&&o&&this._widget.isMouseGettingCloser(o.event.posx,o.event.posy)?(e&&this._startHoverOperationIfNecessary(e,t,i,n,!0),!0):e?e&&this._currentResult.anchor.equals(e)?!0:e.canAdoptVisibleHover(this._currentResult.anchor,this._widget.position)?(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,o){this._computer.anchor&&this._computer.anchor.equals(e)||(this._hoverOperation.cancel(),this._computer.anchor=e,this._computer.shouldFocus=n,this._computer.source=i,this._computer.insistOnKeepingHoverVisible=o,this._hoverOperation.start(t))}_setCurrentResult(e){this._currentResult!==e&&(e&&e.messages.length===0&&(e=null),this._currentResult=e,this._currentResult?this._renderMessages(this._currentResult.anchor,this._currentResult.messages):this._widget.hide())}_addLoadingMessage(e){if(this._computer.anchor){for(const t of this._participants)if(t.createLoadingMessage){const i=t.createLoadingMessage(this._computer.anchor);if(i)return e.slice(0).concat([i])}}return e}_withResult(e){this._widget.position&&this._currentResult&&this._currentResult.isComplete&&(!e.isComplete||this._computer.insistOnKeepingHoverVisible&&e.messages.length===0)||this._setCurrentResult(e)}_renderMessages(e,t){const{showAtPosition:i,showAtSecondaryPosition:n,highlightRange:o}=hS.computeHoverRanges(this._editor,e.range,t),r=new Y,a=r.add(new _L(this._keybindingService)),l=document.createDocumentFragment();let d=null;const c={fragment:l,statusBar:a,setColorPicker:h=>d=h,onContentsChanged:()=>this._widget.onContentsChanged(),setMinimumDimensions:h=>this._widget.setMinimumDimensions(h),hide:()=>this.hide()};for(const h of this._participants){const g=t.filter(f=>f.owner===h);g.length>0&&r.add(h.renderHoverParts(c,g))}const u=t.some(h=>h.isBeforeContent);if(a.hasContent&&l.appendChild(a.hoverElement),l.hasChildNodes()){if(o){const h=this._editor.createDecorationsCollection();h.set([{range:o,options:hS._DECORATION_OPTIONS}]),r.add(Ie(()=>{h.clear()}))}this._widget.showAt(l,new EEe(e.initialMousePosX,e.initialMousePosY,d,i,n,this._editor.getOption(60).above,this._computer.shouldFocus,this._computer.source,u,r))}else r.dispose()}static computeHoverRanges(e,t,i){let n=1;if(e.hasModel()){const u=e._getViewModel(),h=u.coordinatesConverter,g=h.convertModelRangeToViewRange(t),f=new W(g.startLineNumber,u.getLineMinColumn(g.startLineNumber));n=h.convertViewPositionToModelPosition(f).column}const o=t.startLineNumber;let r=t.startColumn,a=i[0].range,l=null;for(const u of i)a=x.plusRange(a,u.range),u.range.startLineNumber===o&&u.range.endLineNumber===o&&(r=Math.max(Math.min(r,u.range.startColumn),n)),u.forceShowAtRange&&(l=u.range);const d=l?l.getStartPosition():new W(o,t.startColumn),c=l?l.getStartPosition():new W(o,r);return{showAtPosition:d,showAtSecondaryPosition:c,highlightRange:a}}showsOrWillShow(e){if(this._widget.isResizing)return!0;const t=[];for(const n of this._participants)if(n.suggestHoverAnchor){const o=n.suggestHoverAnchor(e);o&&t.push(o)}const i=e.target;if(i.type===6&&t.push(new lT(0,i.range,e.event.posx,e.event.posy)),i.type===7){const n=this._editor.getOption(50).typicalHalfwidthCharacterWidth/2;!i.detail.isAfterLines&&typeof i.detail.horizontalDistanceToText=="number"&&i.detail.horizontalDistanceToTexto.priority-n.priority),this._startShowingOrUpdateHover(t[0],0,0,!1,e))}startShowingAtRange(e,t,i,n){this._startShowingOrUpdateHover(new lT(0,e,void 0,void 0),t,i,n,null)}async updateFocusedMarkdownHoverVerbosityLevel(e){var t;(t=this._markdownHoverParticipant)===null||t===void 0||t.updateFocusedMarkdownHoverPartVerbosityLevel(e)}containsNode(e){return e?this._widget.getDomNode().contains(e):!1}focus(){this._widget.focus()}scrollUp(){this._widget.scrollUp()}scrollDown(){this._widget.scrollDown()}scrollLeft(){this._widget.scrollLeft()}scrollRight(){this._widget.scrollRight()}pageUp(){this._widget.pageUp()}pageDown(){this._widget.pageDown()}goToTop(){this._widget.goToTop()}goToBottom(){this._widget.goToBottom()}hide(){this._computer.anchor=null,this._hoverOperation.cancel(),this._setCurrentResult(null)}get isColorPickerVisible(){return this._widget.isColorPickerVisible}get isVisibleFromKeyboard(){return this._widget.isVisibleFromKeyboard}get isVisible(){return this._widget.isVisible}get isFocused(){return this._widget.isFocused}get isResizing(){return this._widget.isResizing}get widget(){return this._widget}};vL._DECORATION_OPTIONS=Ye.register({description:"content-hover-highlight",className:"hoverHighlight"});vL=hS=NEe([X7(1,Ne),X7(2,At)],vL);class AEe{get lineNumber(){return this._lineNumber}set lineNumber(e){this._lineNumber=e}get lane(){return this._laneOrLine}set lane(e){this._laneOrLine=e}constructor(e){this._editor=e,this._lineNumber=-1,this._laneOrLine=bd.Center}computeSync(){var e,t;const i=a=>({value:a}),n=this._editor.getLineDecorations(this._lineNumber),o=[],r=this._laneOrLine==="lineNo";if(!n)return o;for(const a of n){const l=(t=(e=a.options.glyphMargin)===null||e===void 0?void 0:e.position)!==null&&t!==void 0?t:bd.Center;if(!r&&l!==this._laneOrLine)continue;const d=r?a.options.lineNumberHoverMessage:a.options.glyphMarginHoverMessage;!d||L_(d)||o.push(...OP(d).map(i))}return o}}const Y7=he;class BC extends H{constructor(e,t,i){super(),this._renderDisposeables=this._register(new Y),this._editor=e,this._isVisible=!1,this._messages=[],this._hover=this._register(new gO),this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible),this._markdownRenderer=this._register(new yd({editor:this._editor},t,i)),this._computer=new AEe(this._editor),this._hoverOperation=this._register(new Aq(this._editor,this._computer)),this._register(this._hoverOperation.onResult(n=>{this._withResult(n.value)})),this._register(this._editor.onDidChangeModelDecorations(()=>this._onModelDecorationsChanged())),this._register(this._editor.onDidChangeConfiguration(n=>{n.hasChanged(50)&&this._updateFont()})),this._editor.addOverlayWidget(this)}dispose(){this._editor.removeOverlayWidget(this),super.dispose()}getId(){return BC.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._hoverOperation.cancel(),this._hoverOperation.start(0))}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._computer.lineNumber===e&&this._computer.lane===t||(this._hoverOperation.cancel(),this.hide(),this._computer.lineNumber=e,this._computer.lane=t,this._hoverOperation.start(0))}hide(){this._computer.lineNumber=-1,this._hoverOperation.cancel(),this._isVisible&&(this._isVisible=!1,this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible))}_withResult(e){this._messages=e,this._messages.length>0?this._renderMessages(this._computer.lineNumber,this._messages):this.hide()}_renderMessages(e,t){this._renderDisposeables.clear();const i=document.createDocumentFragment();for(const n of t){const o=Y7("div.hover-row.markdown-hover"),r=Q(o,Y7("div.hover-contents")),a=this._renderDisposeables.add(this._markdownRenderer.render(n.value));r.appendChild(a.element),i.appendChild(o)}this._updateContents(i),this._showAt(e)}_updateContents(e){this._hover.contentsDomNode.textContent="",this._hover.contentsDomNode.appendChild(e),this._updateFont()}_showAt(e){this._isVisible||(this._isVisible=!0,this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible));const t=this._editor.getLayoutInfo(),i=this._editor.getTopForLineNumber(e),n=this._editor.getScrollTop(),o=this._editor.getOption(67),r=this._hover.containerDomNode.clientHeight,a=i-n-(r-o)/2,l=t.glyphMarginLeft+t.glyphMarginWidth+(this._computer.lane==="lineNo"?t.lineNumbersWidth:0);this._hover.containerDomNode.style.left=`${l}px`,this._hover.containerDomNode.style.top=`${Math.max(Math.round(a),0)}px`}}BC.ID="editor.contrib.modesGlyphHoverWidget";var MEe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Q7=function(s,e){return function(t,i){e(t,i,s)}},tR;let ws=tR=class extends H{constructor(e,t,i){super(),this._editor=e,this._instantiationService=t,this._keybindingService=i,this._listenersStore=new Y,this._hoverState={mouseDown:!1,activatedByDecoratorClick:!1},this._reactToEditorMouseMoveRunner=this._register(new Wt(()=>this._reactToEditorMouseMove(this._mouseMoveEvent),0)),this._hookListeners(),this._register(this._editor.onDidChangeConfiguration(n=>{n.hasChanged(60)&&(this._unhookListeners(),this._hookListeners())}))}static get(e){return e.getContribution(tR.ID)}_hookListeners(){const e=this._editor.getOption(60);this._hoverSettings={enabled:e.enabled,sticky:e.sticky,hidingDelay:e.delay},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._hideWidgets()})),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._hideWidgets()}_onEditorMouseDown(e){this._hoverState.mouseDown=!0,!this._shouldNotHideCurrentHoverWidget(e)&&this._hideWidgets()}_shouldNotHideCurrentHoverWidget(e){return!!(this._isMouseOnContentHoverWidget(e)||this._isMouseOnMarginHoverWidget(e)||this._isContentWidgetResizing())}_isMouseOnMarginHoverWidget(e){const t=e.target;return t?t.type===12&&t.detail===BC.ID:!1}_isMouseOnContentHoverWidget(e){const t=e.target;return t?t.type===9&&t.detail===H_.ID:!1}_onEditorMouseUp(){this._hoverState.mouseDown=!1}_onEditorMouseLeave(e){this._cancelScheduler(),!this._shouldNotHideCurrentHoverWidget(e)&&this._hideWidgets()}_shouldNotRecomputeCurrentHoverWidget(e){const t=this._hoverSettings.sticky,i=(a,l)=>{const d=this._isMouseOnMarginHoverWidget(a);return l&&d},n=(a,l)=>{const d=this._isMouseOnContentHoverWidget(a);return l&&d},o=a=>{var l;const d=this._isMouseOnContentHoverWidget(a),c=(l=this._contentWidget)===null||l===void 0?void 0:l.isColorPickerVisible;return d&&c},r=(a,l)=>{var d,c,u,h;return l&&((d=this._contentWidget)===null||d===void 0?void 0:d.containsNode((c=a.event.browserEvent.view)===null||c===void 0?void 0:c.document.activeElement))&&!(!((h=(u=a.event.browserEvent.view)===null||u===void 0?void 0:u.getSelection())===null||h===void 0)&&h.isCollapsed)};return!!(i(e,t)||n(e,t)||o(e)||r(e,t))}_onEditorMouseMove(e){var t,i,n,o;if(this._mouseMoveEvent=e,!((t=this._contentWidget)===null||t===void 0)&&t.isFocused||!((i=this._contentWidget)===null||i===void 0)&&i.isResizing)return;const r=this._hoverSettings.sticky;if(r&&(!((n=this._contentWidget)===null||n===void 0)&&n.isVisibleFromKeyboard))return;if(this._shouldNotRecomputeCurrentHoverWidget(e)){this._reactToEditorMouseMoveRunner.cancel();return}const l=this._hoverSettings.hidingDelay;if(((o=this._contentWidget)===null||o===void 0?void 0:o.isVisible)&&r&&l>0){this._reactToEditorMouseMoveRunner.isScheduled()||this._reactToEditorMouseMoveRunner.schedule(l);return}this._reactToEditorMouseMove(e)}_reactToEditorMouseMove(e){var t;if(!e)return;const n=(t=e.target.element)===null||t===void 0?void 0:t.classList.contains("colorpicker-color-decoration"),o=this._editor.getOption(148),r=this._hoverSettings.enabled,a=this._hoverState.activatedByDecoratorClick;if(n&&(o==="click"&&!a||o==="hover"&&!r||o==="clickAndHover"&&!r&&!a)||!n&&!r&&!a){this._hideWidgets();return}this._tryShowHoverWidget(e,0)||this._tryShowHoverWidget(e,1)||this._hideWidgets()}_tryShowHoverWidget(e,t){const i=this._getOrCreateContentWidget(),n=this._getOrCreateGlyphWidget();let o,r;switch(t){case 0:o=i,r=n;break;case 1:o=n,r=i;break;default:throw new Error(`HoverWidgetType ${t} is unrecognized`)}const a=o.showsOrWillShow(e);return a&&r.hide(),a}_onKeyDown(e){var t;if(!this._editor.hasModel())return;const i=this._keybindingService.softDispatch(e,this._editor.getDomNode()),n=i.kind===1||i.kind===2&&(i.commandId===Eq||i.commandId===_4||i.commandId===v4)&&((t=this._contentWidget)===null||t===void 0?void 0:t.isVisible);e.keyCode===5||e.keyCode===6||e.keyCode===57||e.keyCode===4||n||this._hideWidgets()}_hideWidgets(){var e,t,i;this._hoverState.mouseDown&&(!((e=this._contentWidget)===null||e===void 0)&&e.isColorPickerVisible)||zh.dropDownVisible||(this._hoverState.activatedByDecoratorClick=!1,(t=this._glyphWidget)===null||t===void 0||t.hide(),(i=this._contentWidget)===null||i===void 0||i.hide())}_getOrCreateContentWidget(){return this._contentWidget||(this._contentWidget=this._instantiationService.createInstance(vL,this._editor)),this._contentWidget}_getOrCreateGlyphWidget(){return this._glyphWidget||(this._glyphWidget=this._instantiationService.createInstance(BC,this._editor)),this._glyphWidget}showContentHover(e,t,i,n,o=!1){this._hoverState.activatedByDecoratorClick=o,this._getOrCreateContentWidget().startShowingAtRange(e,t,i,n)}_isContentWidgetResizing(){var e;return((e=this._contentWidget)===null||e===void 0?void 0:e.widget.isResizing)||!1}updateFocusedMarkdownHoverVerbosityLevel(e){this._getOrCreateContentWidget().updateFocusedMarkdownHoverVerbosityLevel(e)}focus(){var e;(e=this._contentWidget)===null||e===void 0||e.focus()}scrollUp(){var e;(e=this._contentWidget)===null||e===void 0||e.scrollUp()}scrollDown(){var e;(e=this._contentWidget)===null||e===void 0||e.scrollDown()}scrollLeft(){var e;(e=this._contentWidget)===null||e===void 0||e.scrollLeft()}scrollRight(){var e;(e=this._contentWidget)===null||e===void 0||e.scrollRight()}pageUp(){var e;(e=this._contentWidget)===null||e===void 0||e.pageUp()}pageDown(){var e;(e=this._contentWidget)===null||e===void 0||e.pageDown()}goToTop(){var e;(e=this._contentWidget)===null||e===void 0||e.goToTop()}goToBottom(){var e;(e=this._contentWidget)===null||e===void 0||e.goToBottom()}get isColorPickerVisible(){var e;return(e=this._contentWidget)===null||e===void 0?void 0:e.isColorPickerVisible}get isHoverVisible(){var e;return(e=this._contentWidget)===null||e===void 0?void 0:e.isVisible}dispose(){var e,t;super.dispose(),this._unhookListeners(),this._listenersStore.dispose(),(e=this._glyphWidget)===null||e===void 0||e.dispose(),(t=this._contentWidget)===null||t===void 0||t.dispose()}};ws.ID="editor.contrib.hover";ws=tR=MEe([Q7(1,Ne),Q7(2,At)],ws);class iR extends H{constructor(e){super(),this._editor=e,this._register(e.onMouseDown(t=>this.onMouseDown(t)))}dispose(){super.dispose()}onMouseDown(e){const t=this._editor.getOption(148);if(t!=="click"&&t!=="clickAndHover")return;const i=e.target;if(i.type!==6||!i.detail.injectedText||i.detail.injectedText.options.attachedData!==wq||!i.range)return;const n=this._editor.getContribution(ws.ID);if(n&&!n.isColorPickerVisible){const o=new x(i.range.startLineNumber,i.range.startColumn+1,i.range.endLineNumber,i.range.endColumn+1);n.showContentHover(o,1,0,!1,!0)}}}iR.ID="editor.contrib.colorContribution";kt(iR.ID,iR,2);ag.register(hL);var Qq=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},za=function(s,e){return function(t,i){e(t,i,s)}},nR,sR;let Kh=nR=class extends H{constructor(e,t,i,n,o,r,a){super(),this._editor=e,this._modelService=i,this._keybindingService=n,this._instantiationService=o,this._languageFeatureService=r,this._languageConfigurationService=a,this._standaloneColorPickerWidget=null,this._standaloneColorPickerVisible=T.standaloneColorPickerVisible.bindTo(t),this._standaloneColorPickerFocused=T.standaloneColorPickerFocused.bindTo(t)}showOrFocus(){var e;this._editor.hasModel()&&(this._standaloneColorPickerVisible.get()?this._standaloneColorPickerFocused.get()||(e=this._standaloneColorPickerWidget)===null||e===void 0||e.focus():this._standaloneColorPickerWidget=new bL(this._editor,this._standaloneColorPickerVisible,this._standaloneColorPickerFocused,this._instantiationService,this._modelService,this._keybindingService,this._languageFeatureService,this._languageConfigurationService))}hide(){var e;this._standaloneColorPickerFocused.set(!1),this._standaloneColorPickerVisible.set(!1),(e=this._standaloneColorPickerWidget)===null||e===void 0||e.hide(),this._editor.focus()}insertColor(){var e;(e=this._standaloneColorPickerWidget)===null||e===void 0||e.updateEditor(),this.hide()}static get(e){return e.getContribution(nR.ID)}};Kh.ID="editor.contrib.standaloneColorPickerController";Kh=nR=Qq([za(1,Be),za(2,_i),za(3,At),za(4,Ne),za(5,Ce),za(6,Yt)],Kh);kt(Kh.ID,Kh,1);const J7=8,REe=22;let bL=sR=class extends H{constructor(e,t,i,n,o,r,a,l){var d;super(),this._editor=e,this._standaloneColorPickerVisible=t,this._standaloneColorPickerFocused=i,this._modelService=o,this._keybindingService=r,this._languageFeaturesService=a,this._languageConfigurationService=l,this.allowEditorOverflow=!0,this._position=void 0,this._body=document.createElement("div"),this._colorHover=null,this._selectionSetInEditor=!1,this._onResult=this._register(new B),this.onResult=this._onResult.event,this._standaloneColorPickerVisible.set(!0),this._standaloneColorPickerParticipant=n.createInstance(MC,this._editor),this._position=(d=this._editor._getViewModel())===null||d===void 0?void 0:d.getPrimaryCursorState().modelState.position;const c=this._editor.getSelection(),u=c?{startLineNumber:c.startLineNumber,startColumn:c.startColumn,endLineNumber:c.endLineNumber,endColumn:c.endColumn}:{startLineNumber:0,endLineNumber:0,endColumn:0,startColumn:0},h=this._register(ba(this._body));this._register(h.onDidBlur(g=>{this.hide()})),this._register(h.onDidFocus(g=>{this.focus()})),this._register(this._editor.onDidChangeCursorPosition(()=>{this._selectionSetInEditor?this._selectionSetInEditor=!1:this.hide()})),this._register(this._editor.onMouseMove(g=>{var f;const m=(f=g.target.element)===null||f===void 0?void 0:f.classList;m&&m.contains("colorpicker-color-decoration")&&this.hide()})),this._register(this.onResult(g=>{this._render(g.value,g.foundInEditor)})),this._start(u),this._body.style.zIndex="50",this._editor.addContentWidget(this)}updateEditor(){this._colorHover&&this._standaloneColorPickerParticipant.updateEditorModel(this._colorHover)}getId(){return sR.ID}getDomNode(){return this._body}getPosition(){if(!this._position)return null;const e=this._editor.getOption(60).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 PEe(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 p4(this._modelService,this._languageConfigurationService),this._languageFeaturesService.colorProvider);return i?{result:i.colorHover,foundInEditor:i.foundInEditor}:null}_render(e,t){const i=document.createDocumentFragment(),n=this._register(new _L(this._keybindingService));let o;const r={fragment:i,statusBar:n,setColorPicker:m=>o=m,onContentsChanged:()=>{},hide:()=>this.hide()};if(this._colorHover=e,this._register(this._standaloneColorPickerParticipant.renderHoverParts(r,[e])),o===void 0)return;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),o.layout();const a=o.body,l=a.saturationBox.domNode.clientWidth,d=a.domNode.clientWidth-l-REe-J7,c=o.body.enterButton;c==null||c.onClicked(()=>{this.updateEditor(),this.hide()});const u=o.header,h=u.pickedColorNode;h.style.width=l+J7+"px";const g=u.originalColorNode;g.style.width=d+"px";const f=o.header.closeButton;f==null||f.onClicked(()=>{this.hide()}),t&&(c&&(c.button.textContent="Replace"),this._selectionSetInEditor=!0,this._editor.setSelection(e.range)),this._editor.layoutContentWidget(this)}};bL.ID="editor.contrib.standaloneColorPickerWidget";bL=sR=Qq([za(3,Ne),za(4,_i),za(5,At),za(6,Ce),za(7,Yt)],bL);class PEe{constructor(e,t){this.value=e,this.foundInEditor=t}}class FEe extends fl{constructor(){super({id:"editor.action.showOrFocusStandaloneColorPicker",title:{...Ve("showOrFocusStandaloneColorPicker","Show or Focus Standalone Color Picker"),mnemonicTitle:p({},"&&Show or Focus Standalone Color Picker")},precondition:void 0,menu:[{id:E.CommandPalette}],metadata:{description:Ve("showOrFocusStandaloneColorPickerDescription","Show or focus a standalone color picker which uses the default color provider. It displays hex/rgb/hsl colors.")}})}runEditorCommand(e,t){var i;(i=Kh.get(t))===null||i===void 0||i.showOrFocus()}}class OEe extends me{constructor(){super({id:"editor.action.hideColorPicker",label:p({},"Hide the Color Picker"),alias:"Hide the Color Picker",precondition:T.standaloneColorPickerVisible.isEqualTo(!0),kbOpts:{primary:9,weight:100},metadata:{description:Ve("hideColorPickerDescription","Hide the standalone color picker.")}})}run(e,t){var i;(i=Kh.get(t))===null||i===void 0||i.hide()}}class BEe extends me{constructor(){super({id:"editor.action.insertColorWithStandaloneColorPicker",label:p({},"Insert Color with Standalone Color Picker"),alias:"Insert Color with Standalone Color Picker",precondition:T.standaloneColorPickerFocused.isEqualTo(!0),kbOpts:{primary:3,weight:100},metadata:{description:Ve("insertColorWithStandaloneColorPickerDescription","Insert hex/rgb/hsl colors with the focused standalone color picker.")}})}run(e,t){var i;(i=Kh.get(t))===null||i===void 0||i.insertColor()}}te(OEe);te(BEe);qt(FEe);class Qu{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,o=e.length;if(i+n>o)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,o,r){const a=e.startLineNumber,l=e.startColumn,d=e.endLineNumber,c=e.endColumn,u=o.getLineContent(a),h=o.getLineContent(d);let g=u.lastIndexOf(t,l-1+t.length),f=h.indexOf(i,c-1-i.length);if(g!==-1&&f!==-1)if(a===d)u.substring(g+t.length,f).indexOf(i)>=0&&(g=-1,f=-1);else{const _=u.substring(g+t.length),v=h.substring(0,f);(_.indexOf(i)>=0||v.indexOf(i)>=0)&&(g=-1,f=-1)}let m;g!==-1&&f!==-1?(n&&g+t.length0&&h.charCodeAt(f-1)===32&&(i=" "+i,f-=1),m=Qu._createRemoveBlockCommentOperations(new x(a,g+t.length+1,d,f+1),t,i)):(m=Qu._createAddBlockCommentOperations(e,t,i,this._insertSpace),this._usedEndToken=m.length===1?i:null);for(const _ of m)r.addTrackedEditOperation(_.range,_.text)}static _createRemoveBlockCommentOperations(e,t,i){const n=[];return x.isEmpty(e)?n.push(pi.delete(new x(e.startLineNumber,e.startColumn-t.length,e.endLineNumber,e.endColumn+i.length))):(n.push(pi.delete(new x(e.startLineNumber,e.startColumn-t.length,e.startLineNumber,e.startColumn))),n.push(pi.delete(new x(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn+i.length)))),n}static _createAddBlockCommentOperations(e,t,i,n){const o=[];return x.isEmpty(e)?o.push(pi.replace(new x(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),t+" "+i)):(o.push(pi.insert(new W(e.startLineNumber,e.startColumn),t+(n?" ":""))),o.push(pi.insert(new W(e.endLineNumber,e.endColumn),(n?" ":"")+i))),o}getEditOperations(e,t){const i=this._selection.startLineNumber,n=this._selection.startColumn;e.tokenization.tokenizeIfCheap(i);const o=e.getLanguageIdAtPosition(i,n),r=this.languageConfigurationService.getLanguageConfiguration(o).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],o=i[1];return new we(n.range.endLineNumber,n.range.endColumn,o.range.startLineNumber,o.range.startColumn)}else{const n=i[0].range,o=this._usedEndToken?-this._usedEndToken.length-1:0;return new we(n.endLineNumber,n.endColumn+o,n.endLineNumber,n.endColumn+o)}}}class Qd{constructor(e,t,i,n,o,r,a){this.languageConfigurationService=e,this._selection=t,this._indentSize=i,this._type=n,this._insertSpace=o,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 o=e.getLanguageIdAtPosition(t,1),r=n.getLanguageConfiguration(o).comments,a=r?r.lineCommentToken:null;if(!a)return null;const l=[];for(let d=0,c=i-t+1;do?t[l].commentStrOffset=r-1:t[l].commentStrOffset=r}}}class D4 extends me{constructor(e,t){super(t),this._type=e}run(e,t){const i=e.get(Yt);if(!t.hasModel())return;const n=t.getModel(),o=[],r=n.getOptions(),a=t.getOption(23),l=t.getSelections().map((c,u)=>({selection:c,index:u,ignoreFirstLine:!1}));l.sort((c,u)=>x.compareRangesUsingStarts(c.selection,u.selection));let d=l[0];for(let c=1;c=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Lg=function(s,e){return function(t,i){e(t,i,s)}},oR;let U_=oR=class{static get(e){return e.getContribution(oR.ID)}constructor(e,t,i,n,o,r,a,l){this._contextMenuService=t,this._contextViewService=i,this._contextKeyService=n,this._keybindingService=o,this._menuService=r,this._configurationService=a,this._workspaceContextService=l,this._toDispose=new Y,this._contextMenuIsBeingShownCount=0,this._editor=e,this._toDispose.add(this._editor.onContextMenu(d=>this._onContextMenu(d))),this._toDispose.add(this._editor.onMouseWheel(d=>{if(this._contextMenuIsBeingShownCount>0){const c=this._contextViewService.getContextViewElement(),u=d.srcElement;u.shadowRoot&&Sf(c)===u.shadowRoot||this._contextViewService.hideContextView()}})),this._toDispose.add(this._editor.onKeyDown(d=>{this._editor.getOption(24)&&d.keyCode===58&&(d.preventDefault(),d.stopPropagation(),this.showContextMenu())}))}_onContextMenu(e){if(!this._editor.hasModel())return;if(!this._editor.getOption(24)){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(24)||!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.createMenu(t,this._contextKeyService),o=n.getActions({arg:e.uri});n.dispose();for(const r of o){const[,a]=r;let l=0;for(const d of a)if(d instanceof Em){const c=this._getMenuActions(e,d.item.submenu);c.length>0&&(i.push(new c_(d.id,d.label,c)),l++)}else i.push(d),l++;l&&i.push(new rn)}return i.length&&i.pop(),i}_doShowContextMenu(e,t=null){if(!this._editor.hasModel())return;const i=this._editor.getOption(60);this._editor.updateOptions({hover:{enabled:!1}});let n=t;if(!n){this._editor.revealPosition(this._editor.getPosition(),1),this._editor.render();const r=this._editor.getScrolledVisiblePosition(this._editor.getPosition()),a=qi(this._editor.getDomNode()),l=a.left+r.left,d=a.top+r.top+r.height;n={x:l,y:d}}const o=this._editor.getOption(127)&&!_d;this._contextMenuIsBeingShownCount++,this._contextMenuService.showContextMenu({domForShadowRoot:o?this._editor.getDomNode():void 0,getAnchor:()=>n,getActions:()=>e,getActionViewItem:r=>{const a=this._keybindingFor(r);if(a)return new N_(r,r,{label:!0,keybinding:a.getLabel(),isMenu:!0});const l=r;return typeof l.getActionViewItem=="function"?l.getActionViewItem():new N_(r,r,{icon:!0,label:!0,isMenu:!0})},getKeyBinding:r=>this._keybindingFor(r),onHide:r=>{this._contextMenuIsBeingShownCount--,this._editor.updateOptions({hover:i})}})}_showScrollbarContextMenu(e){if(!this._editor.hasModel()||Fbe(this._workspaceContextService.getWorkspace()))return;const t=this._editor.getOption(73);let i=0;const n=d=>({id:`menu-action-${++i}`,label:d.label,tooltip:"",class:void 0,enabled:typeof d.enabled>"u"?!0:d.enabled,checked:d.checked,run:d.run}),o=(d,c)=>new c_(`menu-action-${++i}`,d,c,void 0),r=(d,c,u,h,g)=>{if(!c)return n({label:d,enabled:c,run:()=>{}});const f=_=>()=>{this._configurationService.updateValue(u,_)},m=[];for(const _ of g)m.push(n({label:_.label,checked:h===_.value,run:f(_.value)}));return o(d,m)},a=[];a.push(n({label:p("context.minimap.minimap","Minimap"),checked:t.enabled,run:()=>{this._configurationService.updateValue("editor.minimap.enabled",!t.enabled)}})),a.push(new rn),a.push(n({label:p("context.minimap.renderCharacters","Render Characters"),enabled:t.enabled,checked:t.renderCharacters,run:()=>{this._configurationService.updateValue("editor.minimap.renderCharacters",!t.renderCharacters)}})),a.push(r(p("context.minimap.size","Vertical size"),t.enabled,"editor.minimap.size",t.size,[{label:p("context.minimap.size.proportional","Proportional"),value:"proportional"},{label:p("context.minimap.size.fill","Fill"),value:"fill"},{label:p("context.minimap.size.fit","Fit"),value:"fit"}])),a.push(r(p("context.minimap.slider","Slider"),t.enabled,"editor.minimap.showSlider",t.showSlider,[{label:p("context.minimap.slider.mouseover","Mouse Over"),value:"mouseover"},{label:p("context.minimap.slider.always","Always"),value:"always"}]));const l=this._editor.getOption(127)&&!_d;this._contextMenuIsBeingShownCount++,this._contextMenuService.showContextMenu({domForShadowRoot:l?this._editor.getDomNode():void 0,getAnchor:()=>e,getActions:()=>a,onHide:d=>{this._contextMenuIsBeingShownCount--,this._editor.focus()}})}_keybindingFor(e){return this._keybindingService.lookupKeybinding(e.id)}dispose(){this._contextMenuIsBeingShownCount>0&&this._contextViewService.hideContextView(),this._toDispose.dispose()}};U_.ID="editor.contrib.contextmenu";U_=oR=UEe([Lg(1,Oo),Lg(2,nu),Lg(3,Be),Lg(4,At),Lg(5,hr),Lg(6,rt),Lg(7,If)],U_);class $Ee extends me{constructor(){super({id:"editor.action.showContextMenu",label:p("action.showContextMenu.label","Show Editor Context Menu"),alias:"Show Editor Context Menu",precondition:void 0,kbOpts:{kbExpr:T.textInputFocus,primary:1092,weight:100}})}run(e,t){var i;(i=U_.get(t))===null||i===void 0||i.showContextMenu()}}kt(U_.ID,U_,2);te($Ee);class cT{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 cT(t.oldSelections);this._undoStack.length>0&&this._undoStack[this._undoStack.length-1].cursorState.equals(i)||(this._undoStack.push(new uT(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 uT(new cT(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 uT(new cT(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}}Wf.ID="editor.contrib.cursorUndoRedoController";class jEe extends me{constructor(){super({id:"cursorUndo",label:p("cursor.undo","Cursor Undo"),alias:"Cursor Undo",precondition:void 0,kbOpts:{kbExpr:T.textInputFocus,primary:2099,weight:100}})}run(e,t,i){var n;(n=Wf.get(t))===null||n===void 0||n.cursorUndo()}}class KEe extends me{constructor(){super({id:"cursorRedo",label:p("cursor.redo","Cursor Redo"),alias:"Cursor Redo",precondition:void 0})}run(e,t,i){var n;(n=Wf.get(t))===null||n===void 0||n.cursorRedo()}}kt(Wf.ID,Wf,0);te(jEe);te(KEe);class qEe{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 x(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 we(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 we(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(35)||this._editor.getOption(22)||(Op(e)&&(this._modifierPressed=!0),this._mouseDown&&Op(e)&&this._editor.updateOptions({mouseStyle:"copy"}))}onEditorKeyUp(e){!this._editor.getOption(35)||this._editor.getOption(22)||(Op(e)&&(this._modifierPressed=!1),this._mouseDown&&e.keyCode===Ac.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(o=>t.position&&o.containsPosition(t.position));if(n.length===1)this._dragSelection=n[0];else return}Op(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 W(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:o,selectionStartColumn:r}=n;i=[new we(o,r,t.lineNumber,t.column)]}}else i=(this._editor.getSelections()||[]).map(n=>n.containsPosition(t)?new we(t.lineNumber,t.column,t.lineNumber,t.column):n);this._editor.setSelections(i||[],"mouse",3)}else(!this._dragSelection.containsPosition(t)||(Op(e.event)||this._modifierPressed)&&(this._dragSelection.getEndPosition().equals(t)||this._dragSelection.getStartPosition().equals(t)))&&(this._editor.pushUndoStop(),this._editor.executeCommand(Ac.ID,new qEe(this._dragSelection,t,Op(e.event)||this._modifierPressed)),this._editor.pushUndoStop())}this._editor.updateOptions({mouseStyle:"text"}),this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1}showAt(e){this._dndDecorationIds.set([{range:new x(e.lineNumber,e.column,e.lineNumber,e.column),options:Ac._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()}}Ac.ID="editor.contrib.dragAndDrop";Ac.TRIGGER_KEY_VALUE=lt?6:5;Ac._DECORATION_OPTIONS=Ye.register({description:"dnd-target",className:"dnd-target"});kt(Ac.ID,Ac,2);var cy;kt(kd.ID,kd,0);F1(MM);de(new class extends mn{constructor(){super({id:tq,precondition:d4,kbOpts:{weight:100,primary:2137}})}runEditorCommand(s,e){var t;return(t=kd.get(e))===null||t===void 0?void 0:t.changePasteType()}});de(new class extends mn{constructor(){super({id:"editor.hidePasteWidget",precondition:d4,kbOpts:{weight:100,primary:9}})}runEditorCommand(s,e){var t;(t=kd.get(e))===null||t===void 0||t.clearWidgets()}});te((cy=class extends me{constructor(){super({id:"editor.action.pasteAs",label:p("pasteAs","Paste As..."),alias:"Paste As...",precondition:T.writable,metadata:{description:"Paste as",args:[{name:"args",schema:cy.argsSchema}]}})}run(e,t,i){var n;let o=typeof(i==null?void 0:i.kind)=="string"?i.kind:void 0;return!o&&i&&(o=typeof i.id=="string"?i.id:void 0),(n=kd.get(t))===null||n===void 0?void 0:n.pasteAs(o?new Bt(o):void 0)}},cy.argsSchema={type:"object",properties:{kind:{type:"string",description:p("pasteAs.kind","The kind of the paste edit to try applying. If not provided or there are multiple edits for this kind, the editor will show a picker.")}}},cy));te(class extends me{constructor(){super({id:"editor.action.pasteAsText",label:p("pasteAsText","Paste as Text"),alias:"Paste as Text",precondition:T.writable})}run(s,e){var t;return(t=kd.get(e))===null||t===void 0?void 0:t.pasteAs({providerId:Kc.id})}});class GEe{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 e9{constructor(e){this.identifier=e}}const Jq=ut("treeViewsDndService");mt(Jq,GEe,1);var ZEe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},uy=function(s,e){return function(t,i){e(t,i,s)}},rR;const eG="editor.experimental.dropIntoEditor.defaultProvider",tG="editor.changeDropType",L4=new ue("dropWidgetVisible",!1,p("dropWidgetVisible","Whether the drop widget is showing"));let Hf=rR=class extends H{static get(e){return e.getContribution(rR.ID)}constructor(e,t,i,n,o){super(),this._configService=i,this._languageFeaturesService=n,this._treeViewsDragAndDropService=o,this.treeItemsTransfer=IC.getInstance(),this._dropProgressManager=this._register(t.createInstance(lL,"dropIntoEditor",e)),this._postDropWidgetManager=this._register(t.createInstance(cL,"dropIntoEditor",e,L4,{id:tG,label:p("postDropWidgetTitle","Show drop options...")})),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){var n;if(!i.dataTransfer||!e.hasModel())return;(n=this._currentOperation)===null||n===void 0||n.cancel(),e.focus(),e.setPosition(t);const o=Dn(async r=>{const a=new Bh(e,1,void 0,r);try{const l=await this.extractDataTransferData(i);if(l.size===0||a.token.isCancellationRequested)return;const d=e.getModel();if(!d)return;const c=this._languageFeaturesService.documentDropEditProvider.ordered(d).filter(h=>h.dropMimeTypes?h.dropMimeTypes.some(g=>l.matches(g)):!0),u=await this.getDropEdits(c,d,t,l,a);if(a.token.isCancellationRequested)return;if(u.length){const h=this.getInitialActiveEditIndex(d,u),g=e.getOption(36).showDropSelector==="afterDrop";await this._postDropWidgetManager.applyEditAndShowIfNeeded([x.fromPositions(t)],{activeEditIndex:h,allEdits:u},g,async f=>f,r)}}finally{a.dispose(),this._currentOperation===o&&(this._currentOperation=void 0)}});this._dropProgressManager.showWhile(t,p("dropIntoEditorProgress","Running drop handlers. Click to cancel"),o),this._currentOperation=o}async getDropEdits(e,t,i,n,o){const r=await h1(Promise.all(e.map(async l=>{try{const d=await l.provideDocumentDropEdits(t,i,n,o.token);return d==null?void 0:d.map(c=>({...c,providerId:l.id}))}catch(d){console.error(d)}})),o.token),a=pd(r??[]).flat();return JK(a)}getInitialActiveEditIndex(e,t){const i=this._configService.getValue(eG,{resource:e.uri});for(const[n,o]of Object.entries(i)){const r=new Bt(o),a=t.findIndex(l=>r.value===l.providerId&&l.handledMimeType&&jK(n,[l.handledMimeType]));if(a>=0)return a}return 0}async extractDataTransferData(e){if(!e.dataTransfer)return new $K;const t=GK(e.dataTransfer);if(this.treeItemsTransfer.hasData(e9.prototype)){const i=this.treeItemsTransfer.getData(e9.prototype);if(Array.isArray(i))for(const n of i){const o=await this._treeViewsDragAndDropService.removeDragOperationTransfer(n.identifier);if(o)for(const[r,a]of o)t.replace(r,a)}}return t}};Hf.ID="editor.contrib.dropIntoEditorController";Hf=rR=ZEe([uy(1,Ne),uy(2,rt),uy(3,Ce),uy(4,Jq)],Hf);kt(Hf.ID,Hf,2);F1(AM);de(new class extends mn{constructor(){super({id:tG,precondition:L4,kbOpts:{weight:100,primary:2137}})}runEditorCommand(s,e,t){var i;(i=Hf.get(e))===null||i===void 0||i.changeDropType()}});de(new class extends mn{constructor(){super({id:"editor.hideDropWidget",precondition:L4,kbOpts:{weight:100,primary:9}})}runEditorCommand(s,e,t){var i;(i=Hf.get(e))===null||i===void 0||i.clearWidgets()}});Ji.as(pl.Configuration).registerConfiguration({...Vx,properties:{[eG]:{type:"object",scope:5,description:p("defaultProviderDescription","Configures the default drop provider to use for content of a given mime type."),default:{},additionalProperties:{type:"string"}}}});class ps{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,ps._FIND_MATCH_DECORATION),this._highlightedDecorationId=null),t!==null&&(this._highlightedDecorationId=t,n.changeDecorationOptions(this._highlightedDecorationId,ps._CURRENT_FIND_MATCH_DECORATION)),this._rangeHighlightDecorationId!==null&&(n.removeDecoration(this._rangeHighlightDecorationId),this._rangeHighlightDecorationId=null),t!==null){let o=this._editor.getModel().getDecorationRange(t);if(o.startLineNumber!==o.endLineNumber&&o.endColumn===1){const r=o.endLineNumber-1,a=this._editor.getModel().getLineMaxColumn(r);o=new x(o.startLineNumber,o.startColumn,r,a)}this._rangeHighlightDecorationId=n.addDecoration(o,ps._RANGE_HIGHLIGHT_DECORATION)}}),i}set(e,t){this._editor.changeDecorations(i=>{let n=ps._FIND_MATCH_DECORATION;const o=[];if(e.length>1e3){n=ps._FIND_MATCH_NO_OVERVIEW_DECORATION;const a=this._editor.getModel().getLineCount(),d=this._editor.getLayoutInfo().height/a,c=Math.max(2,Math.ceil(3/d));let u=e[0].range.startLineNumber,h=e[0].range.endLineNumber;for(let g=1,f=e.length;g=m.startLineNumber?m.endLineNumber>h&&(h=m.endLineNumber):(o.push({range:new x(u,1,h,1),options:ps._FIND_MATCH_ONLY_OVERVIEW_DECORATION}),u=m.startLineNumber,h=m.endLineNumber)}o.push({range:new x(u,1,h,1),options:ps._FIND_MATCH_ONLY_OVERVIEW_DECORATION})}const r=new Array(e.length);for(let a=0,l=e.length;ai.removeDecoration(a)),this._findScopeDecorationIds=[]),t!=null&&t.length&&(this._findScopeDecorationIds=t.map(a=>i.addDecoration(a,ps._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 o;if(!(o.startColumn0){const i=[];for(let r=0;rx.compareRangesUsingStarts(r.range,a.range));const n=[];let o=i[0];for(let r=1;r0?e[0].toUpperCase()+e.substr(1):s[0][0].toUpperCase()!==s[0][0]&&e.length>0?e[0].toLowerCase()+e.substr(1):e}else return e}function t9(s,e,t){return s[0].indexOf(t)!==-1&&e.indexOf(t)!==-1&&s[0].split(t).length===e.split(t).length}function i9(s,e,t){const i=e.split(t),n=s[0].split(t);let o="";return i.forEach((r,a)=>{o+=iG([n[a]],r)+t}),o.slice(0,-1)}class n9{constructor(e){this.staticValue=e,this.kind=0}}class YEe{constructor(e){this.pieces=e,this.kind=1}}class $_{static fromStaticValue(e){return new $_([ff.staticValue(e)])}get hasReplacementPatterns(){return this._state.kind===1}constructor(e){!e||e.length===0?this._state=new n9(""):e.length===1&&e[0].staticValue!==null?this._state=new n9(e[0].staticValue):this._state=new YEe(e)}buildReplaceString(e,t){if(this._state.kind===0)return t?iG(e,this._state.staticValue):this._state.staticValue;let i="";for(let n=0,o=this._state.pieces.length;n0){const l=[],d=r.caseOps.length;let c=0;for(let u=0,h=a.length;u=d){l.push(a.slice(u));break}switch(r.caseOps[c]){case"U":l.push(a[u].toUpperCase());break;case"u":l.push(a[u].toUpperCase()),c++;break;case"L":l.push(a[u].toLowerCase());break;case"l":l.push(a[u].toLowerCase()),c++;break;default:l.push(a[u])}}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=s.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(o===36){if(i++,i>=n)break;const r=s.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+1this.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,jt(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)},eIe)):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 x(a.startLineNumber,1,l,this._editor.getModel().getLineMaxColumn(l))}return a}));const n=this._findMatches(i,!1,Ju);this._decorations.set(n,i);const o=this._editor.getSelection();let r=this._decorations.getCurrentMatchesPosition(o);if(r===0&&n.length>0){const a=Vb(n.map(l=>l.range),l=>x.compareRangesUsingStarts(l,o)>=0);r=a>0?a-1+1:r}this._state.changeMatchInfo(r,this._decorations.getCount(),void 0),e&&this._editor.getOption(41).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 o=this._editor.getModel();return t||n===1?(i===1?i=o.getLineCount():i--,n=o.getLineMaxColumn(i)):n--,new W(i,n)}_moveToPrevMatch(e,t=!1){if(!this._state.canNavigateBack()){const c=this._decorations.matchAfterPosition(e);c&&this._setCurrentFindMatch(c);return}if(this._decorations.getCount()=0||this._state.searchString.indexOf("$")>=0);let{lineNumber:i,column:n}=e;const o=this._editor.getModel();return t||n===o.getLineMaxColumn(i)?(i===o.getLineCount()?i=1:i++,n=1):n++,new W(i,n)}_moveToNextMatch(e){if(!this._state.canNavigateForward()){const i=this._decorations.matchBeforePosition(e);i&&this._setCurrentFindMatch(i);return}if(this._decorations.getCount()fb._getSearchRange(this._editor.getModel(),o));return this._editor.getModel().findMatches(this._state.searchString,n,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(131):null,t,i)}replaceAll(){if(!this._hasMatches())return;const e=this._decorations.getFindScopes();e===null&&this._state.matchesCount>=Ju?this._largeReplaceAll():this._regularReplaceAll(e),this.research(!1)}_largeReplaceAll(){const t=new Ig(this._state.searchString,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(131):null).parseSearchRequest();if(!t)return;let i=t.regex;if(!i.multiline){let u="mu";i.ignoreCase&&(u+="i"),i.global&&(u+="g"),i=new RegExp(i.source,u)}const n=this._editor.getModel(),o=n.getValue(1),r=n.getFullModelRange(),a=this._getReplacePattern();let l;const d=this._state.preserveCase;a.hasReplacementPatterns||d?l=o.replace(i,function(){return a.buildReplaceString(arguments,d)}):l=o.replace(i,a.buildReplaceString(null,d));const c=new zF(r,l,this._editor.getSelection());this._executeEditorCommand("replaceAll",c)}_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",o)}selectAllMatches(){if(!this._hasMatches())return;const e=this._decorations.getFindScopes();let i=this._findMatches(e,!1,1073741824).map(o=>new we(o.range.startLineNumber,o.range.startColumn,o.range.endLineNumber,o.range.endColumn));const n=this._editor.getSelection();for(let o=0,r=i.length;othis._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:fe(RF),inputActiveOptionForeground:fe(PF),inputActiveOptionBackground:fe(Zg)},o=this._register(I_());this.caseSensitive=this._register(new Mj({appendTitle:this._keybindingLabelFor(ti.ToggleCaseSensitiveCommand),isChecked:this._state.matchCase,hoverDelegate:o,...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 Rj({appendTitle:this._keybindingLabelFor(ti.ToggleWholeWordCommand),isChecked:this._state.wholeWord,hoverDelegate:o,...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 Pj({appendTitle:this._keybindingLabelFor(ti.ToggleRegexCommand),isChecked:this._state.isRegex,hoverDelegate:o,...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(K(this._domNode,ee.MOUSE_LEAVE,r=>this._onMouseLeave())),this._register(K(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 kk.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")}}kk.ID="editor.contrib.findOptionsWidget";function _y(s,e){return s===1?!0:s===2?!1:e}class tIe extends H{get searchString(){return this._searchString}get replaceString(){return this._replaceString}get isRevealed(){return this._isRevealed}get isReplaceRevealed(){return this._isReplaceRevealed}get isRegex(){return _y(this._isRegexOverride,this._isRegex)}get wholeWord(){return _y(this._wholeWordOverride,this._wholeWord)}get matchCase(){return _y(this._matchCaseOverride,this._matchCase)}get preserveCase(){return _y(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 B),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 o=!1;t===0&&(e=0),e>t&&(e=t),this._matchesPosition!==e&&(this._matchesPosition=e,n.matchesPosition=!0,o=!0),this._matchesCount!==t&&(this._matchesCount=t,n.matchesCount=!0,o=!0),typeof i<"u"&&(x.equalsRange(this._currentMatch,i)||(this._currentMatch=i,n.currentMatch=!0,o=!0)),o&&this._onFindReplaceStateChange.fire(n)}change(e,t,i=!0){var n;const o={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 r=!1;const a=this.isRegex,l=this.wholeWord,d=this.matchCase,c=this.preserveCase;typeof e.searchString<"u"&&this._searchString!==e.searchString&&(this._searchString=e.searchString,o.searchString=!0,r=!0),typeof e.replaceString<"u"&&this._replaceString!==e.replaceString&&(this._replaceString=e.replaceString,o.replaceString=!0,r=!0),typeof e.isRevealed<"u"&&this._isRevealed!==e.isRevealed&&(this._isRevealed=e.isRevealed,o.isRevealed=!0,r=!0),typeof e.isReplaceRevealed<"u"&&this._isReplaceRevealed!==e.isReplaceRevealed&&(this._isReplaceRevealed=e.isReplaceRevealed,o.isReplaceRevealed=!0,r=!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"&&(!((n=e.searchScope)===null||n===void 0)&&n.every(u=>{var h;return(h=this._searchScope)===null||h===void 0?void 0:h.some(g=>!x.equalsRange(g,u))})||(this._searchScope=e.searchScope,o.searchScope=!0,r=!0)),typeof e.loop<"u"&&this._loop!==e.loop&&(this._loop=e.loop,o.loop=!0,r=!0),typeof e.isSearching<"u"&&this._isSearching!==e.isSearching&&(this._isSearching=e.isSearching,o.isSearching=!0,r=!0),typeof e.filters<"u"&&(this._filters?this._filters.update(e.filters):this._filters=e.filters,o.filters=!0,r=!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,a!==this.isRegex&&(r=!0,o.isRegex=!0),l!==this.wholeWord&&(r=!0,o.wholeWord=!0),d!==this.matchCase&&(r=!0,o.matchCase=!0),c!==this.preserveCase&&(r=!0,o.preserveCase=!0),r&&this._onFindReplaceStateChange.fire(o)}canNavigateBack(){return this.canNavigateInLoop()||this.matchesPosition!==1}canNavigateForward(){return this.canNavigateInLoop()||this.matchesPosition=Ju}}const iIe=p("defaultLabel","input"),nIe=p("label.preserveCaseToggle","Preserve Case");class sIe extends f0{constructor(e){var t;super({icon:oe.preserveCase,title:nIe+e.appendTitle,isChecked:e.isChecked,hoverDelegate:(t=e.hoverDelegate)!==null&&t!==void 0?t:Xs("element"),inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class oIe extends fr{constructor(e,t,i,n){super(),this._showOptionButtons=i,this.fixFocusOnOptionClickEnabled=!0,this.cachedOptionsWidth=0,this._onDidOptionChange=this._register(new B),this.onDidOptionChange=this._onDidOptionChange.event,this._onKeyDown=this._register(new B),this.onKeyDown=this._onKeyDown.event,this._onMouseDown=this._register(new B),this._onInput=this._register(new B),this._onKeyUp=this._register(new B),this._onPreserveCaseKeyDown=this._register(new B),this.onPreserveCaseKeyDown=this._onPreserveCaseKeyDown.event,this.contextViewProvider=t,this.placeholder=n.placeholder||"",this.validation=n.validation,this.label=n.label||iIe;const o=n.appendPreserveCaseLabel||"",r=n.history||[],a=!!n.flexibleHeight,l=!!n.flexibleWidth,d=n.flexibleMaxHeight;this.domNode=document.createElement("div"),this.domNode.classList.add("monaco-findInput"),this.inputBox=this._register(new Fj(this.domNode,this.contextViewProvider,{ariaLabel:this.label||"",placeholder:this.placeholder||"",validationOptions:{validation:this.validation},history:r,showHistoryHint:n.showHistoryHint,flexibleHeight:a,flexibleWidth:l,flexibleMaxHeight:d,inputBoxStyles:n.inputBoxStyles})),this.preserveCase=this._register(new sIe({appendTitle:o,isChecked:!1,...n.toggleStyles})),this._register(this.preserveCase.onChange(h=>{this._onDidOptionChange.fire(h),!h&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this._register(this.preserveCase.onKeyDown(h=>{this._onPreserveCaseKeyDown.fire(h)})),this._showOptionButtons?this.cachedOptionsWidth=this.preserveCase.width():this.cachedOptionsWidth=0;const c=[this.preserveCase.domNode];this.onkeydown(this.domNode,h=>{if(h.equals(15)||h.equals(17)||h.equals(9)){const g=c.indexOf(this.domNode.ownerDocument.activeElement);if(g>=0){let f=-1;h.equals(17)?f=(g+1)%c.length:h.equals(15)&&(g===0?f=c.length-1:f=g-1),h.equals(9)?(c[g].blur(),this.inputBox.focus()):f>=0&&c[f].focus(),nt.stop(h,!0)}}});const u=document.createElement("div");u.className="controls",u.style.display=this._showOptionButtons?"block":"none",u.appendChild(this.preserveCase.domNode),this.domNode.appendChild(u),e==null||e.appendChild(this.domNode),this.onkeydown(this.inputBox.inputElement,h=>this._onKeyDown.fire(h)),this.onkeyup(this.inputBox.inputElement,h=>this._onKeyUp.fire(h)),this.oninput(this.inputBox.inputElement,h=>this._onInput.fire()),this.onmousedown(this.inputBox.inputElement,h=>this._onMouseDown.fire(h))}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(){var e;(e=this.inputBox)===null||e===void 0||e.validate()}set width(e){this.inputBox.paddingRight=this.cachedOptionsWidth,this.domNode.style.width=e+"px"}dispose(){super.dispose()}}var nG=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},sG=function(s,e){return function(t,i){e(t,i,s)}};const k4=new ue("suggestWidgetVisible",!1,p("suggestWidgetVisible","Whether suggestion are visible")),E4="historyNavigationWidgetFocus",oG="historyNavigationForwardsEnabled",rG="historyNavigationBackwardsEnabled";let Mc;const vy=[];function aG(s,e){if(vy.includes(e))throw new Error("Cannot register the same widget multiple times");vy.push(e);const t=new Y,i=new ue(E4,!1).bindTo(s),n=new ue(oG,!0).bindTo(s),o=new ue(rG,!0).bindTo(s),r=()=>{i.set(!0),Mc=e},a=()=>{i.set(!1),Mc===e&&(Mc=void 0)};return tx(e.element)&&r(),t.add(e.onDidFocus(()=>r())),t.add(e.onDidBlur(()=>a())),t.add(Ie(()=>{vy.splice(vy.indexOf(e),1),a()})),{historyNavigationForwardsEnablement:n,historyNavigationBackwardsEnablement:o,dispose(){t.dispose()}}}let aR=class extends Oj{constructor(e,t,i,n){super(e,t,i);const o=this._register(n.createScoped(this.inputBox.element));this._register(aG(o,this.inputBox))}};aR=nG([sG(3,Be)],aR);let lR=class extends oIe{constructor(e,t,i,n,o=!1){super(e,t,o,i);const r=this._register(n.createScoped(this.inputBox.element));this._register(aG(r,this.inputBox))}};lR=nG([sG(3,Be)],lR);go.registerCommandAndKeybindingRule({id:"history.showPrevious",weight:200,when:G.and(G.has(E4),G.equals(rG,!0),G.not("isComposing"),k4.isEqualTo(!1)),primary:16,secondary:[528],handler:s=>{Mc==null||Mc.showPreviousValue()}});go.registerCommandAndKeybindingRule({id:"history.showNext",weight:200,when:G.and(G.has(E4),G.equals(oG,!0),G.not("isComposing"),k4.isEqualTo(!1)),primary:18,secondary:[530],handler:s=>{Mc==null||Mc.showNextValue()}});function s9(s){var e,t;return((e=s.lookupKeybinding("history.showPrevious"))===null||e===void 0?void 0:e.getElectronAccelerator())==="Up"&&((t=s.lookupKeybinding("history.showNext"))===null||t===void 0?void 0:t.getElectronAccelerator())==="Down"}const rIe=xi("find-selection",oe.selection,p("findSelectionIcon","Icon for 'Find in Selection' in the editor find widget.")),o9=xi("find-collapsed",oe.chevronRight,p("findCollapsedIcon","Icon to indicate that the editor find widget is collapsed.")),r9=xi("find-expanded",oe.chevronDown,p("findExpandedIcon","Icon to indicate that the editor find widget is expanded.")),aIe=xi("find-replace",oe.replace,p("findReplaceIcon","Icon for 'Replace' in the editor find widget.")),lIe=xi("find-replace-all",oe.replaceAll,p("findReplaceAllIcon","Icon for 'Replace All' in the editor find widget.")),dIe=xi("find-previous-match",oe.arrowUp,p("findPreviousMatchIcon","Icon for 'Find Previous' in the editor find widget.")),cIe=xi("find-next-match",oe.arrowDown,p("findNextMatchIcon","Icon for 'Find Next' in the editor find widget.")),uIe=p("label.findDialog","Find / Replace"),hIe=p("label.find","Find"),gIe=p("placeholder.find","Find"),fIe=p("label.previousMatchButton","Previous Match"),pIe=p("label.nextMatchButton","Next Match"),mIe=p("label.toggleSelectionFind","Find in Selection"),_Ie=p("label.closeButton","Close"),vIe=p("label.replace","Replace"),bIe=p("placeholder.replace","Replace"),CIe=p("label.replaceButton","Replace"),wIe=p("label.replaceAllButton","Replace All"),yIe=p("label.toggleReplaceButton","Toggle Replace"),SIe=p("title.matchesCountLimit","Only the first {0} results are highlighted, but all find operations work on the entire text.",Ju),DIe=p("label.matchesLocation","{0} of {1}"),a9=p("label.noResults","No results"),Ll=419,LIe=275,xIe=LIe-54;let sv=69;const kIe=33,l9="ctrlEnterReplaceAll.windows.donotask",d9=lt?256:2048;class hT{constructor(e){this.afterLineNumber=e,this.heightInPx=kIe,this.suppressMouseDown=!1,this.domNode=document.createElement("div"),this.domNode.className="dock-find-viewzone"}}function c9(s,e,t){const i=!!e.match(/\n/);if(t&&i&&t.selectionStart>0){s.stopPropagation();return}}function u9(s,e,t){const i=!!e.match(/\n/);if(t&&i&&t.selectionEndthis._updateHistoryDelayer.cancel())),this._register(this._state.onFindReplaceStateChange(u=>this._onStateChanged(u))),this._buildDomNode(),this._updateButtons(),this._tryUpdateWidgetWidth(),this._findInput.inputBox.layout(),this._register(this._codeEditor.onDidChangeConfiguration(u=>{if(u.hasChanged(91)&&(this._codeEditor.getOption(91)&&this._state.change({isReplaceRevealed:!1},!1),this._updateButtons()),u.hasChanged(145)&&this._tryUpdateWidgetWidth(),u.hasChanged(2)&&this.updateAccessibilitySupport(),u.hasChanged(41)){const h=this._codeEditor.getOption(41).loop;this._state.change({loop:h},!1);const g=this._codeEditor.getOption(41).addExtraSpaceOnTop;g&&!this._viewZone&&(this._viewZone=new hT(0),this._showViewZone()),!g&&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 u=await this._controller.getGlobalBufferTerm();u&&u!==this._state.searchString&&(this._state.change({searchString:u},!1),this._findInput.select())}})),this._findInputFocused=xk.bindTo(r),this._findFocusTracker=this._register(ba(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=x4.bindTo(r),this._replaceFocusTracker=this._register(ba(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(41).addExtraSpaceOnTop&&(this._viewZone=new hT(0)),this._register(this._codeEditor.onDidChangeModel(()=>{this._isVisible&&(this._viewZoneId=void 0)})),this._register(this._codeEditor.onDidScrollChange(u=>{if(u.scrollTopChanged){this._layoutViewZone();return}setTimeout(()=>{this._layoutViewZone()},0)}))}getId(){return Ek.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(91)&&!this._isReplaceVisible&&(this._isReplaceVisible=!0,this._replaceInput.width=wo(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,Xe)}_updateHistory(){this._state.searchString&&this._findInput.inputBox.addToHistory(),this._state.replaceString&&this._replaceInput.inputBox.addToHistory()}_updateMatchesCount(){this._matchesCount.style.minWidth=sv+"px",this._state.matchesCount>=Ju?this._matchesCount.title=SIe:this._matchesCount.title="",this._matchesCount.firstChild&&this._matchesCount.removeChild(this._matchesCount.firstChild);let e;if(this._state.matchesCount>0){let t=String(this._state.matchesCount);this._state.matchesCount>=Ju&&(t+="+");let i=String(this._state.matchesPosition);i==="0"&&(i="?"),e=l_(DIe,i,t)}else e=a9;this._matchesCount.appendChild(document.createTextNode(e)),fo(this._getAriaLabel(e,this._state.currentMatch,this._state.searchString)),sv=Math.max(sv,this._matchesCount.clientWidth)}_getAriaLabel(e,t,i){if(e===a9)return i===""?p("ariaSearchNoResultEmpty","{0} found",e):p("ariaSearchNoResult","{0} found for '{1}'",e,i);if(t){const n=p("ariaSearchNoResultWithLineNum","{0} found for '{1}', at {2}",e,i,t.startLineNumber+":"+t.startColumn),o=this._codeEditor.getModel();return o&&t.startLineNumber<=o.getLineCount()&&t.startLineNumber>=1?`${o.getLineContent(t.startLineNumber)}, ${n}`:n}return p("ariaSearchNoResultWithLineNumNoCurrentMatch","{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(91);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(41).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(41).seedSearchStringFromSelection&&e){const i=this._codeEditor.getDomNode();if(i){const n=qi(i),o=this._codeEditor.getScrolledVisiblePosition(e.getStartPosition()),r=n.left+(o?o.left:0),a=o?o.top:0;if(this._viewZone&&ae.startLineNumber&&(t=!1);const l=kz(this._domNode).left;r>l&&(t=!1);const d=this._codeEditor.getScrolledVisiblePosition(e.getEndPosition());n.left+(d?d.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(41).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(41).addExtraSpaceOnTop)return;this._viewZone===void 0&&(this._viewZone=new hT(0));const i=this._viewZone;this._codeEditor.changeViewZones(n=>{if(this._viewZoneId!==void 0){const o=this._getHeight();if(o===i.heightInPx)return;const r=o-i.heightInPx;i.heightInPx=o,n.layoutZone(this._viewZoneId),e&&this._codeEditor.setScrollTop(this._codeEditor.getScrollTop()+r);return}else{let o=this._getHeight();if(o-=this._codeEditor.getOption(84).top,o<=0)return;i.heightInPx=o,this._viewZoneId=n.addZone(i),e&&this._codeEditor.setScrollTop(this._codeEditor.getScrollTop()+o)}})}_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 o=!1,r=!1,a=!1;if(this._resized&&wo(this._domNode)>Ll){this._domNode.style.maxWidth=`${i-28-n-15}px`,this._replaceInput.width=wo(this._findInput.domNode);return}if(Ll+28+n>=i&&(r=!0),Ll+28+n-sv>=i&&(a=!0),Ll+28+n-sv>=i+50&&(o=!0),this._domNode.classList.toggle("collapsed-find-widget",o),this._domNode.classList.toggle("narrow-find-widget",a),this._domNode.classList.toggle("reduced-find-widget",r),!a&&!o&&(this._domNode.style.maxWidth=`${i-28-n-15}px`),this._findInput.layout({collapsedFindWidget:o,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=wo(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&&!x.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(d9|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 c9(e,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea"));if(e.equals(18))return u9(e,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea"))}_onReplaceInputKeyDown(e){if(e.equals(d9|3))if(this._keybindingService.dispatchEvent(e,e.target)){e.preventDefault();return}else{as&&md&&!this._ctrlEnterReplaceAllWarningPrompted&&(this._notificationService.info(p("ctrlEnter.keybindingChanged","Ctrl+Enter now inserts line break instead of replacing all. You can modify the keybinding for editor.action.replaceAll to override this behavior.")),this._ctrlEnterReplaceAllWarningPrompted=!0,this._storageService.store(l9,!0,0,0)),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 c9(e,this._replaceInput.inputBox.value,this._replaceInput.inputBox.element.querySelector("textarea"));if(e.equals(18))return u9(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(){this._findInput=this._register(new aR(null,this._contextViewProvider,{width:xIe,label:hIe,placeholder:gIe,appendCaseSensitiveLabel:this._keybindingLabelFor(ti.ToggleCaseSensitiveCommand),appendWholeWordsLabel:this._keybindingLabelFor(ti.ToggleWholeWordCommand),appendRegexLabel:this._keybindingLabelFor(ti.ToggleRegexCommand),validation:c=>{if(c.length===0||!this._findInput.getRegex())return null;try{return new RegExp(c,"gu"),null}catch(u){return{content:u.message}}},flexibleHeight:!0,flexibleWidth:!0,flexibleMaxHeight:118,showCommonFindToggles:!0,showHistoryHint:()=>s9(this._keybindingService),inputBoxStyles:TD,toggleStyles:ID},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(c=>this._onFindInputKeyDown(c))),this._register(this._findInput.inputBox.onDidChange(()=>{this._ignoreChangeEvent||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(c=>{c.equals(1026)&&this._isReplaceVisible&&(this._replaceInput.focus(),c.preventDefault())})),this._register(this._findInput.onRegexKeyDown(c=>{c.equals(2)&&this._isReplaceVisible&&(this._replaceInput.focusOnPreserve(),c.preventDefault())})),this._register(this._findInput.inputBox.onDidHeightChange(c=>{this._tryUpdateHeight()&&this._showViewZone()})),$s&&this._register(this._findInput.onMouseDown(c=>this._onFindInputMouseDown(c))),this._matchesCount=document.createElement("div"),this._matchesCount.className="matchesCount",this._updateMatchesCount();const i=this._register(I_());this._prevBtn=this._register(new Bp({label:fIe+this._keybindingLabelFor(ti.PreviousMatchFindAction),icon:dIe,hoverDelegate:i,onTrigger:()=>{Ou(this._codeEditor.getAction(ti.PreviousMatchFindAction)).run().then(void 0,Xe)}},this._hoverService)),this._nextBtn=this._register(new Bp({label:pIe+this._keybindingLabelFor(ti.NextMatchFindAction),icon:cIe,hoverDelegate:i,onTrigger:()=>{Ou(this._codeEditor.getAction(ti.NextMatchFindAction)).run().then(void 0,Xe)}},this._hoverService));const n=document.createElement("div");n.className="find-part",n.appendChild(this._findInput.domNode);const o=document.createElement("div");o.className="find-actions",n.appendChild(o),o.appendChild(this._matchesCount),o.appendChild(this._prevBtn.domNode),o.appendChild(this._nextBtn.domNode),this._toggleSelectionFind=this._register(new f0({icon:rIe,title:mIe+this._keybindingLabelFor(ti.ToggleSearchScopeCommand),isChecked:!1,hoverDelegate:i,inputActiveOptionBackground:fe(Zg),inputActiveOptionBorder:fe(RF),inputActiveOptionForeground:fe(PF)})),this._register(this._toggleSelectionFind.onChange(()=>{if(this._toggleSelectionFind.checked){if(this._codeEditor.hasModel()){let c=this._codeEditor.getSelections();c=c.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),c.length&&this._state.change({searchScope:c},!0)}}else this._state.change({searchScope:null},!0)})),o.appendChild(this._toggleSelectionFind.domNode),this._closeBtn=this._register(new Bp({label:_Ie+this._keybindingLabelFor(ti.CloseFindWidgetCommand),icon:cK,hoverDelegate:i,onTrigger:()=>{this._state.change({isRevealed:!1,searchScope:null},!1)},onKeyDown:c=>{c.equals(2)&&this._isReplaceVisible&&(this._replaceBtn.isEnabled()?this._replaceBtn.focus():this._codeEditor.focus(),c.preventDefault())}},this._hoverService)),this._replaceInput=this._register(new lR(null,void 0,{label:vIe,placeholder:bIe,appendPreserveCaseLabel:this._keybindingLabelFor(ti.TogglePreserveCaseCommand),history:[],flexibleHeight:!0,flexibleWidth:!0,flexibleMaxHeight:118,showHistoryHint:()=>s9(this._keybindingService),inputBoxStyles:TD,toggleStyles:ID},this._contextKeyService,!0)),this._replaceInput.setPreserveCase(!!this._state.preserveCase),this._register(this._replaceInput.onKeyDown(c=>this._onReplaceInputKeyDown(c))),this._register(this._replaceInput.inputBox.onDidChange(()=>{this._state.change({replaceString:this._replaceInput.inputBox.value},!1)})),this._register(this._replaceInput.inputBox.onDidHeightChange(c=>{this._isReplaceVisible&&this._tryUpdateHeight()&&this._showViewZone()})),this._register(this._replaceInput.onDidOptionChange(()=>{this._state.change({preserveCase:this._replaceInput.getPreserveCase()},!0)})),this._register(this._replaceInput.onPreserveCaseKeyDown(c=>{c.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(),c.preventDefault())}));const r=this._register(I_());this._replaceBtn=this._register(new Bp({label:CIe+this._keybindingLabelFor(ti.ReplaceOneAction),icon:aIe,hoverDelegate:r,onTrigger:()=>{this._controller.replace()},onKeyDown:c=>{c.equals(1026)&&(this._closeBtn.focus(),c.preventDefault())}},this._hoverService)),this._replaceAllBtn=this._register(new Bp({label:wIe+this._keybindingLabelFor(ti.ReplaceAllAction),icon:lIe,hoverDelegate:r,onTrigger:()=>{this._controller.replaceAll()}},this._hoverService));const a=document.createElement("div");a.className="replace-part",a.appendChild(this._replaceInput.domNode);const l=document.createElement("div");l.className="replace-actions",a.appendChild(l),l.appendChild(this._replaceBtn.domNode),l.appendChild(this._replaceAllBtn.domNode),this._toggleReplaceBtn=this._register(new Bp({label:yIe,className:"codicon toggle left",onTrigger:()=>{this._state.change({isReplaceRevealed:!this._isReplaceVisible},!1),this._isReplaceVisible&&(this._replaceInput.width=wo(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=uIe,this._domNode.role="dialog",this._domNode.style.width=`${Ll}px`,this._domNode.appendChild(this._toggleReplaceBtn.domNode),this._domNode.appendChild(n),this._domNode.appendChild(this._closeBtn.domNode),this._domNode.appendChild(a),this._resizeSash=this._register(new is(this._domNode,this,{orientation:0,size:2})),this._resized=!1;let d=Ll;this._register(this._resizeSash.onDidStart(()=>{d=wo(this._domNode)})),this._register(this._resizeSash.onDidChange(c=>{this._resized=!0;const u=d+c.startX-c.currentX;if(uh||(this._domNode.style.width=`${u}px`,this._isReplaceVisible&&(this._replaceInput.width=wo(this._findInput.domNode)),this._findInput.inputBox.layout(),this._tryUpdateHeight())})),this._register(this._resizeSash.onDidReset(()=>{const c=wo(this._domNode);if(c{this._opts.onTrigger(),o.preventDefault()}),this.onkeydown(this._domNode,o=>{var r,a;if(o.equals(10)||o.equals(3)){this._opts.onTrigger(),o.preventDefault();return}(a=(r=this._opts).onKeyDown)===null||a===void 0||a.call(r,o)})}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(...Pe.asClassNameArray(o9)),this._domNode.classList.add(...Pe.asClassNameArray(r9))):(this._domNode.classList.remove(...Pe.asClassNameArray(r9)),this._domNode.classList.add(...Pe.asClassNameArray(o9)))}}zr((s,e)=>{const t=s.getColor(zu);t&&e.addRule(`.monaco-editor .findMatch { border: 1px ${dd(s.type)?"dotted":"solid"} ${t}; box-sizing: border-box; }`);const i=s.getColor(Oue);i&&e.addRule(`.monaco-editor .findScope { border: 1px ${dd(s.type)?"dashed":"solid"} ${i}; }`);const n=s.getColor(gt);n&&e.addRule(`.monaco-editor .find-widget { border: 1px solid ${n}; }`)});var lG=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Cr=function(s,e){return function(t,i){e(t,i,s)}},dR;const EIe=524288;function cR(s,e="single",t=!1){if(!s.hasModel())return null;const i=s.getSelection();if(e==="single"&&i.startLineNumber===i.endLineNumber||e==="multiple"){if(i.isEmpty()){const n=s.getConfiguredWordAtPosition(i.getStartPosition());if(n&&t===!1)return n.word}else if(s.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(41).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!!xk.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=rr(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=cR(this._editor,e.seedSearchStringFromSelection,e.seedSearchStringFromNonEmptySelection);n&&(this._state.isRegex?i.searchString=rr(n):i.searchString=n)}else if(e.seedSearchStringFromSelection==="multiple"&&!e.updateSearchScope){const n=cR(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(o=>!o.isEmpty())&&(i.searchScope=n)}i.loop=e.loop,this._state.change(i,!1),this._model||(this._model=new fb(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(){var e;return this._model?!((e=this._editor.getModel())===null||e===void 0)&&e.isTooLargeForHeapOperation()?(this._notificationService.warn(p("too.large.for.replaceall","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(41).globalFindClipboard&&this._editor.hasModel()&&!this._editor.getModel().isTooLargeForSyncing()?this._clipboardService.readFindText():""}setGlobalBufferTerm(e){this._editor.getOption(41).globalFindClipboard&&this._editor.hasModel()&&!this._editor.getModel().isTooLargeForSyncing()&&this._clipboardService.writeFindText(e)}};Ks.ID="editor.contrib.findController";Ks=dR=lG([Cr(1,Be),Cr(2,Rd),Cr(3,ru),Cr(4,en),Cr(5,Md)],Ks);let uR=class extends Ks{constructor(e,t,i,n,o,r,a,l,d){super(e,i,a,l,r,d),this._contextViewService=t,this._keybindingService=n,this._themeService=o,this._widget=null,this._findOptionsWidget=null}async _start(e,t){this._widget||this._createFindWidget();const i=this._editor.getSelection();let n=!1;switch(this._editor.getOption(41).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 Ek(this._editor,this,this._state,this._contextViewService,this._keybindingService,this._contextKeyService,this._themeService,this._storageService,this._notificationService,this._hoverService)),this._findOptionsWidget=this._register(new kk(this._editor,this._state,this._keybindingService))}};uR=lG([Cr(1,nu),Cr(2,Be),Cr(3,At),Cr(4,_n),Cr(5,en),Cr(6,Rd),Cr(7,ru),Cr(8,Md)],uR);const IIe=$z(new Uz({id:ti.StartFindAction,label:p("startFindAction","Find"),alias:"Find",precondition:G.or(T.focus,G.has("editorIsOpen")),kbOpts:{kbExpr:null,primary:2084,weight:100},menuOpts:{menuId:E.MenubarEditMenu,group:"3_find",title:p({},"&&Find"),order:1}}));IIe.addImplementation(0,(s,e,t)=>{const i=Ks.get(e);return i?i.start({forceRevealReplace:!1,seedSearchStringFromSelection:e.getOption(41).seedSearchStringFromSelection!=="never"?"single":"none",seedSearchStringFromNonEmptySelection:e.getOption(41).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:e.getOption(41).globalFindClipboard,shouldFocus:1,shouldAnimate:!0,updateSearchScope:!1,loop:e.getOption(41).loop}):!1});const TIe={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 NIe extends me{constructor(){super({id:ti.StartFindWithArgs,label:p("startFindWithArgsAction","Find With Arguments"),alias:"Find With Arguments",precondition:void 0,kbOpts:{kbExpr:null,primary:0,weight:100},metadata:TIe})}async run(e,t,i){const n=Ks.get(t);if(n){const o=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(41).seedSearchStringFromSelection!=="never"?"single":"none",seedSearchStringFromNonEmptySelection:t.getOption(41).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:!0,shouldFocus:1,shouldAnimate:!0,updateSearchScope:(i==null?void 0:i.findInSelection)||!1,loop:t.getOption(41).loop},o),n.setGlobalBufferTerm(n.getState().searchString)}}}class AIe extends me{constructor(){super({id:ti.StartFindWithSelection,label:p("startFindWithSelectionAction","Find With Selection"),alias:"Find With Selection",precondition:void 0,kbOpts:{kbExpr:null,primary:0,mac:{primary:2083},weight:100}})}async run(e,t){const i=Ks.get(t);i&&(await i.start({forceRevealReplace:!1,seedSearchStringFromSelection:"multiple",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(41).loop}),i.setGlobalBufferTerm(i.getState().searchString))}}class dG extends me{async run(e,t){const i=Ks.get(t);i&&!this._run(i)&&(await i.start({forceRevealReplace:!1,seedSearchStringFromSelection:i.getState().searchString.length===0&&t.getOption(41).seedSearchStringFromSelection!=="never"?"single":"none",seedSearchStringFromNonEmptySelection:t.getOption(41).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:!0,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(41).loop}),this._run(i))}}class MIe extends dG{constructor(){super({id:ti.NextMatchFindAction,label:p("findNextMatchAction","Find Next"),alias:"Find Next",precondition:void 0,kbOpts:[{kbExpr:T.focus,primary:61,mac:{primary:2085,secondary:[61]},weight:100},{kbExpr:G.and(T.focus,xk),primary:3,weight:100}]})}_run(e){return e.moveToNextMatch()?(e.editor.pushUndoStop(),!0):!1}}class RIe extends dG{constructor(){super({id:ti.PreviousMatchFindAction,label:p("findPreviousMatchAction","Find Previous"),alias:"Find Previous",precondition:void 0,kbOpts:[{kbExpr:T.focus,primary:1085,mac:{primary:3109,secondary:[1085]},weight:100},{kbExpr:G.and(T.focus,xk),primary:1027,weight:100}]})}_run(e){return e.moveToPrevMatch()}}class PIe extends me{constructor(){super({id:ti.GoToMatchFindAction,label:p("findMatchAction.goToMatch","Go to Match..."),alias:"Go to Match...",precondition:lu}),this._highlightDecorations=[]}run(e,t,i){const n=Ks.get(t);if(!n)return;const o=n.getState().matchesCount;if(o<1){e.get(en).notify({severity:Rx.Warning,message:p("findMatchAction.noResults","No matches. Try searching for something else.")});return}const a=e.get(hp).createInputBox();a.placeholder=p("findMatchAction.inputPlaceHolder","Type a number to go to a specific match (between 1 and {0})",o);const l=c=>{const u=parseInt(c);if(isNaN(u))return;const h=n.getState().matchesCount;if(u>0&&u<=h)return u-1;if(u<0&&u>=-h)return h+u},d=c=>{const u=l(c);if(typeof u=="number"){a.validationMessage=void 0,n.goToMatch(u);const h=n.getState().currentMatch;h&&this.addDecorations(t,h)}else a.validationMessage=p("findMatchAction.inputValidationMessage","Please type a number between 1 and {0}",n.getState().matchesCount),this.clearDecorations(t)};a.onDidChangeValue(c=>{d(c)}),a.onDidAccept(()=>{const c=l(a.value);typeof c=="number"?(n.goToMatch(c),a.hide()):a.validationMessage=p("findMatchAction.inputValidationMessage","Please type a number between 1 and {0}",n.getState().matchesCount)}),a.onDidHide(()=>{this.clearDecorations(t),a.dispose()}),a.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:Ei(ofe),position:Br.Full}}}])})}}class cG extends me{async run(e,t){const i=Ks.get(t);if(!i)return;const n=cR(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(41).loop}),this._run(i))}}class FIe extends cG{constructor(){super({id:ti.NextSelectionMatchFindAction,label:p("nextSelectionMatchFindAction","Find Next Selection"),alias:"Find Next Selection",precondition:void 0,kbOpts:{kbExpr:T.focus,primary:2109,weight:100}})}_run(e){return e.moveToNextMatch()}}class OIe extends cG{constructor(){super({id:ti.PreviousSelectionMatchFindAction,label:p("previousSelectionMatchFindAction","Find Previous Selection"),alias:"Find Previous Selection",precondition:void 0,kbOpts:{kbExpr:T.focus,primary:3133,weight:100}})}_run(e){return e.moveToPrevMatch()}}const BIe=$z(new Uz({id:ti.StartFindReplaceAction,label:p("startReplace","Replace"),alias:"Replace",precondition:G.or(T.focus,G.has("editorIsOpen")),kbOpts:{kbExpr:null,primary:2086,mac:{primary:2596},weight:100},menuOpts:{menuId:E.MenubarEditMenu,group:"3_find",title:p({},"&&Replace"),order:2}}));BIe.addImplementation(0,(s,e,t)=>{if(!e.hasModel()||e.getOption(91))return!1;const i=Ks.get(e);if(!i)return!1;const n=e.getSelection(),o=i.isFindInputFocused(),r=!n.isEmpty()&&n.startLineNumber===n.endLineNumber&&e.getOption(41).seedSearchStringFromSelection!=="never"&&!o,a=o||r?2:1;return i.start({forceRevealReplace:!0,seedSearchStringFromSelection:r?"single":"none",seedSearchStringFromNonEmptySelection:e.getOption(41).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:e.getOption(41).seedSearchStringFromSelection!=="never",shouldFocus:a,shouldAnimate:!0,updateSearchScope:!1,loop:e.getOption(41).loop})});kt(Ks.ID,uR,0);te(NIe);te(AIe);te(MIe);te(RIe);te(PIe);te(FIe);te(OIe);const vl=mn.bindToContribution(Ks.get);de(new vl({id:ti.CloseFindWidgetCommand,precondition:lu,handler:s=>s.closeFindWidget(),kbOpts:{weight:105,kbExpr:G.and(T.focus,G.not("isComposing")),primary:9,secondary:[1033]}}));de(new vl({id:ti.ToggleCaseSensitiveCommand,precondition:void 0,handler:s=>s.toggleCaseSensitive(),kbOpts:{weight:105,kbExpr:T.focus,primary:hy.primary,mac:hy.mac,win:hy.win,linux:hy.linux}}));de(new vl({id:ti.ToggleWholeWordCommand,precondition:void 0,handler:s=>s.toggleWholeWords(),kbOpts:{weight:105,kbExpr:T.focus,primary:gy.primary,mac:gy.mac,win:gy.win,linux:gy.linux}}));de(new vl({id:ti.ToggleRegexCommand,precondition:void 0,handler:s=>s.toggleRegex(),kbOpts:{weight:105,kbExpr:T.focus,primary:fy.primary,mac:fy.mac,win:fy.win,linux:fy.linux}}));de(new vl({id:ti.ToggleSearchScopeCommand,precondition:void 0,handler:s=>s.toggleSearchScope(),kbOpts:{weight:105,kbExpr:T.focus,primary:py.primary,mac:py.mac,win:py.win,linux:py.linux}}));de(new vl({id:ti.TogglePreserveCaseCommand,precondition:void 0,handler:s=>s.togglePreserveCase(),kbOpts:{weight:105,kbExpr:T.focus,primary:my.primary,mac:my.mac,win:my.win,linux:my.linux}}));de(new vl({id:ti.ReplaceOneAction,precondition:lu,handler:s=>s.replace(),kbOpts:{weight:105,kbExpr:T.focus,primary:3094}}));de(new vl({id:ti.ReplaceOneAction,precondition:lu,handler:s=>s.replace(),kbOpts:{weight:105,kbExpr:G.and(T.focus,x4),primary:3}}));de(new vl({id:ti.ReplaceAllAction,precondition:lu,handler:s=>s.replaceAll(),kbOpts:{weight:105,kbExpr:T.focus,primary:2563}}));de(new vl({id:ti.ReplaceAllAction,precondition:lu,handler:s=>s.replaceAll(),kbOpts:{weight:105,kbExpr:G.and(T.focus,x4),primary:void 0,mac:{primary:2051}}}));de(new vl({id:ti.SelectAllMatchesAction,precondition:lu,handler:s=>s.selectAllMatches(),kbOpts:{weight:105,kbExpr:T.focus,primary:515}}));const WIe={0:" ",1:"u",2:"r"},h9=65535,Ba=16777215,g9=4278190080;class gT{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<h9)throw new Error("invalid startIndexes or endIndexes size");this._startIndexes=e,this._endIndexes=t,this._collapseStates=new gT(e.length),this._userDefinedStates=new gT(e.length),this._recoveredStates=new gT(e.length),this._types=i,this._parentsComputed=!1}ensureParentIndices(){if(!this._parentsComputed){this._parentsComputed=!0;const e=[],t=(i,n)=>{const o=e[e.length-1];return this.getStartLineNumber(o)<=i&&this.getEndLineNumber(o)>=n};for(let i=0,n=this._startIndexes.length;iBa||r>Ba)throw new Error("startLineNumber or endLineNumber must not exceed "+Ba);for(;e.length>0&&!t(o,r);)e.pop();const a=e.length>0?e[e.length-1]:-1;e.push(i),this._startIndexes[i]=o+((a&255)<<24),this._endIndexes[i]=r+((a&65280)<<16)}}}get length(){return this._startIndexes.length}getStartLineNumber(e){return this._startIndexes[e]&Ba}getEndLineNumber(e){return this._endIndexes[e]&Ba}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]&g9)>>>16);return t===h9?-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(m)?v=>v<_?m[v]:void 0:v=>v<_?m.toFoldRange(v):void 0,o=n(e,e.length),r=n(t,t.length);let a=0,l=0,d=o(0),c=r(0);const u=[];let h,g=0;const f=[];for(;d||c;){let m;if(c&&(!d||d.startLineNumber>=c.startLineNumber))d&&d.startLineNumber===c.startLineNumber?(c.source===1?m=c:(m=d,m.isCollapsed=c.isCollapsed&&d.endLineNumber===c.endLineNumber,m.source=0),d=o(++a)):(m=c,c.isCollapsed&&c.source===0&&(m.source=2)),c=r(++l);else{let _=l,v=c;for(;;){if(!v||v.startLineNumber>d.endLineNumber){m=d;break}if(v.source===1&&v.endLineNumber>d.endLineNumber)break;v=r(++_)}d=o(++a)}if(m){for(;h&&h.endLineNumberm.startLineNumber&&m.startLineNumber>g&&m.endLineNumber<=i&&(!h||h.endLineNumber>=m.endLineNumber)&&(f.push(m),g=m.startLineNumber,h&&u.push(h),h=m)}}return f}}class HIe{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 VIe{get regions(){return this._regions}get textModel(){return this._textModel}constructor(e,t){this._updateEventEmitter=new B,this.onDidChange=this._updateEventEmitter.event,this._textModel=e,this._decorationProvider=t,this._regions=new qo(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,o=-1,r=-1;const a=l=>{for(;nr&&(r=d),n++}};for(const l of e){const d=l.regionIndex,c=this._editorDecorationIds[d];if(c&&!t[c]){t[c]=!0,a(d);const u=!this._regions.isCollapsed(d);this._regions.setCollapsed(d,u),o=Math.max(o,this._regions.getEndLineNumber(d))}}a(this._regions.length)}),this._updateEventEmitter.fire({model:this,collapseStateChanged:e})}removeManualRanges(e){const t=new Array,i=n=>{for(const o of e)if(!(o.startLineNumber>n.endLineNumber||n.startLineNumber>o.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=(n,o)=>{for(const r of e)if(n=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){var t,i;if(!Array.isArray(e))return;const n=[],o=this._textModel.getLineCount();for(const a of e){if(a.startLineNumber>=a.endLineNumber||a.startLineNumber<1||a.endLineNumber>o)continue;const l=this._getLinesChecksum(a.startLineNumber+1,a.endLineNumber);(!a.checksum||l===a.checksum)&&n.push({startLineNumber:a.startLineNumber,endLineNumber:a.endLineNumber,type:void 0,isCollapsed:(t=a.isCollapsed)!==null&&t!==void 0?t:!0,source:(i=a.source)!==null&&i!==void 0?i:0})}const r=qo.sanitizeAndMerge(this._regions,n,o);this.updatePost(qo.fromFoldRanges(r))}_getLinesChecksum(e,t){return XL(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),o=1;for(;n>=0;){const r=this._regions.toRegion(n);(!t||t(r,o))&&i.push(r),o++,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,o=e?e.endLineNumber:Number.MAX_VALUE;if(t&&t.length===2){const r=[];for(let a=n,l=this._regions.length;a0&&!d.containedBy(r[r.length-1]);)r.pop();r.push(d),t(d,r.length)&&i.push(d)}else break}}else for(let r=n,a=this._regions.length;r1){const a=s.getRegionsInside(o,(l,d)=>l.isCollapsed!==r&&d0)for(const o of i){const r=s.getRegionAtLine(o);if(r&&(r.isCollapsed!==e&&n.push(r),t>1)){const a=s.getRegionsInside(r,(l,d)=>l.isCollapsed!==e&&dr.isCollapsed!==e&&aa.isCollapsed!==e&&l<=t);n.push(...r)}s.toggleCollapseState(n)}function zIe(s,e,t){const i=[];for(const n of t){const o=s.getAllRegionsAtLine(n,r=>r.isCollapsed!==e);o.length>0&&i.push(o[0])}s.toggleCollapseState(i)}function UIe(s,e,t,i){const n=(r,a)=>a===e&&r.isCollapsed!==t&&!i.some(l=>r.containsLine(l)),o=s.getRegionsInside(null,n);s.toggleCollapseState(o)}function gG(s,e,t){const i=[];for(const r of t){const a=s.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,o=s.getRegionsInside(null,n);s.toggleCollapseState(o)}function I4(s,e,t){const i=s.textModel,n=s.regions,o=[];for(let r=n.length-1;r>=0;r--)if(t!==n.isCollapsed(r)){const a=n.getStartLineNumber(r);e.test(i.getLineContent(a))&&o.push(n.toRegion(r))}s.toggleCollapseState(o)}function T4(s,e,t){const i=s.regions,n=[];for(let o=i.length-1;o>=0;o--)t!==i.isCollapsed(o)&&e===i.getType(o)&&n.push(i.toRegion(o));s.toggleCollapseState(n)}function $Ie(s,e){let t=null;const i=e.getRegionAtLine(s);if(i!==null&&(t=i.startLineNumber,s===t)){const n=i.parentIndex;n!==-1?t=e.regions.getStartLineNumber(n):t=null}return t}function jIe(s,e){let t=e.getRegionAtLine(s);if(t!==null&&t.startLineNumber===s){if(s!==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 KIe(s,e){let t=e.getRegionAtLine(s);if(t!==null&&t.startLineNumber===s){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>s)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||Ah(t.text)[0]!==0))}updateHiddenRanges(){let e=!1;const t=[];let i=0,n=0,o=Number.MAX_VALUE,r=-1;const a=this._foldingModel.regions;for(;i0}isHidden(e){return f9(this._hiddenRanges,e)!==null}adjustSelections(e){let t=!1;const i=this._foldingModel.textModel;let n=null;const o=r=>((!n||!GIe(r,n))&&(n=f9(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 GIe(s,e){return s>=e.startLineNumber&&s<=e.endLineNumber}function f9(s,e){const t=Vb(s,i=>e=0&&s[t].endLineNumber>=e?s[t]:null}const ZIe=5e3,XIe="indent";class N4{constructor(e,t,i){this.editorModel=e,this.languageConfigurationService=t,this.foldingRangesLimit=i,this.id=XIe}dispose(){}compute(e){const t=this.languageConfigurationService.getLanguageConfiguration(this.editorModel.getLanguageId()).foldingRules,i=t&&!!t.offSide,n=t&&t.markers;return Promise.resolve(JIe(this.editorModel,i,n,this.foldingRangesLimit))}}let YIe=class{constructor(e){this._startIndexes=[],this._endIndexes=[],this._indentOccurrences=[],this._length=0,this._foldingRangesLimit=e}insertFirst(e,t,i){if(e>Ba||t>Ba)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 o=this._length-1,r=0;o>=0;o--,r++)i[r]=this._startIndexes[o],n[r]=this._endIndexes[o];return new qo(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+=d}}const o=e.getOptions().tabSize,r=new Uint32Array(t),a=new Uint32Array(t);for(let l=this._length-1,d=0;l>=0;l--){const c=this._startIndexes[l],u=e.getLineContent(c),h=Tx(u,o);(h{}};function JIe(s,e,t,i=QIe){const n=s.getOptions().tabSize,o=new YIe(i);let r;t&&(r=new RegExp(`(${t.start.source})|(?:${t.end.source})`));const a=[],l=s.getLineCount()+1;a.push({indent:-1,endAbove:l,line:l});for(let d=s.getLineCount();d>0;d--){const c=s.getLineContent(d),u=Tx(c,n);let h=a[a.length-1];if(u===-1){e&&(h.endAbove=d);continue}let g;if(r&&(g=c.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,h=a[f],o.insertFirst(d,h.line,u),h.line=d,h.indent=u,h.endAbove=d;continue}}else{a.push({indent:-2,endAbove:d,line:d});continue}if(h.indent>u){do a.pop(),h=a[a.length-1];while(h.indent>u);const f=h.endAbove-1;f-d>=1&&o.insertFirst(d,f,u)}h.indent===u?h.endAbove=d:a.push({indent:u,endAbove:d,line:d})}return o.toIndentRanges(s)}const eTe=N("editor.foldBackground",{light:Ee(Vu,.3),dark:Ee(Vu,.3),hcDark:null,hcLight:null},p("foldBackgroundBackground","Background color behind folded ranges. The color must not be opaque so as not to hide underlying decorations."),!0);N("editorGutter.foldingControlForeground",{dark:Ql,light:Ql,hcDark:Ql,hcLight:Ql},p("editorGutter.foldingControlForeground","Color of the folding control in the editor gutter."));const Ik=xi("folding-expanded",oe.chevronDown,p("foldingExpandedIcon","Icon for expanded ranges in the editor glyph margin.")),Tk=xi("folding-collapsed",oe.chevronRight,p("foldingCollapsedIcon","Icon for collapsed ranges in the editor glyph margin.")),fG=xi("folding-manual-collapsed",Tk,p("foldingManualCollapedIcon","Icon for manually collapsed ranges in the editor glyph margin.")),pG=xi("folding-manual-expanded",Ik,p("foldingManualExpandedIcon","Icon for manually expanded ranges in the editor glyph margin.")),A4={color:Ei(eTe),position:1},S0=p("linesCollapsed","Click to expand the range."),Nk=p("linesExpanded","Click to collapse the range.");class Zi{constructor(e){this.editor=e,this.showFoldingControls="mouseover",this.showFoldingHighlights=!0}getDecorationOption(e,t,i){return t?Zi.HIDDEN_RANGE_DECORATION:this.showFoldingControls==="never"?e?this.showFoldingHighlights?Zi.NO_CONTROLS_COLLAPSED_HIGHLIGHTED_RANGE_DECORATION:Zi.NO_CONTROLS_COLLAPSED_RANGE_DECORATION:Zi.NO_CONTROLS_EXPANDED_RANGE_DECORATION:e?i?this.showFoldingHighlights?Zi.MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION:Zi.MANUALLY_COLLAPSED_VISUAL_DECORATION:this.showFoldingHighlights?Zi.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION:Zi.COLLAPSED_VISUAL_DECORATION:this.showFoldingControls==="mouseover"?i?Zi.MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION:Zi.EXPANDED_AUTO_HIDE_VISUAL_DECORATION:i?Zi.MANUALLY_EXPANDED_VISUAL_DECORATION:Zi.EXPANDED_VISUAL_DECORATION}changeDecorations(e){return this.editor.changeDecorations(e)}removeDecorations(e){this.editor.removeDecorations(e)}}Zi.COLLAPSED_VISUAL_DECORATION=Ye.register({description:"folding-collapsed-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0,linesDecorationsTooltip:S0,firstLineDecorationClassName:Pe.asClassName(Tk)});Zi.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION=Ye.register({description:"folding-collapsed-highlighted-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:A4,isWholeLine:!0,linesDecorationsTooltip:S0,firstLineDecorationClassName:Pe.asClassName(Tk)});Zi.MANUALLY_COLLAPSED_VISUAL_DECORATION=Ye.register({description:"folding-manually-collapsed-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0,linesDecorationsTooltip:S0,firstLineDecorationClassName:Pe.asClassName(fG)});Zi.MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION=Ye.register({description:"folding-manually-collapsed-highlighted-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:A4,isWholeLine:!0,linesDecorationsTooltip:S0,firstLineDecorationClassName:Pe.asClassName(fG)});Zi.NO_CONTROLS_COLLAPSED_RANGE_DECORATION=Ye.register({description:"folding-no-controls-range-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0,linesDecorationsTooltip:S0});Zi.NO_CONTROLS_COLLAPSED_HIGHLIGHTED_RANGE_DECORATION=Ye.register({description:"folding-no-controls-range-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:A4,isWholeLine:!0,linesDecorationsTooltip:S0});Zi.EXPANDED_VISUAL_DECORATION=Ye.register({description:"folding-expanded-visual-decoration",stickiness:1,isWholeLine:!0,firstLineDecorationClassName:"alwaysShowFoldIcons "+Pe.asClassName(Ik),linesDecorationsTooltip:Nk});Zi.EXPANDED_AUTO_HIDE_VISUAL_DECORATION=Ye.register({description:"folding-expanded-auto-hide-visual-decoration",stickiness:1,isWholeLine:!0,firstLineDecorationClassName:Pe.asClassName(Ik),linesDecorationsTooltip:Nk});Zi.MANUALLY_EXPANDED_VISUAL_DECORATION=Ye.register({description:"folding-manually-expanded-visual-decoration",stickiness:0,isWholeLine:!0,firstLineDecorationClassName:"alwaysShowFoldIcons "+Pe.asClassName(pG),linesDecorationsTooltip:Nk});Zi.MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION=Ye.register({description:"folding-manually-expanded-auto-hide-visual-decoration",stickiness:0,isWholeLine:!0,firstLineDecorationClassName:Pe.asClassName(pG),linesDecorationsTooltip:Nk});Zi.NO_CONTROLS_EXPANDED_RANGE_DECORATION=Ye.register({description:"folding-no-controls-range-decoration",stickiness:0,isWholeLine:!0});Zi.HIDDEN_RANGE_DECORATION=Ye.register({description:"folding-hidden-range-decoration",stickiness:1});const tTe={},iTe="syntax";class M4{constructor(e,t,i,n,o){this.editorModel=e,this.providers=t,this.handleFoldingRangesChange=i,this.foldingRangesLimit=n,this.fallbackRangeProvider=o,this.id=iTe,this.disposables=new Y,o&&this.disposables.add(o);for(const r of t)typeof r.onDidChange=="function"&&this.disposables.add(r.onDidChange(i))}compute(e){return nTe(this.providers,this.editorModel,e).then(t=>{var i,n;return t?oTe(t,this.foldingRangesLimit):(n=(i=this.fallbackRangeProvider)===null||i===void 0?void 0:i.compute(e))!==null&&n!==void 0?n:null})}dispose(){this.disposables.dispose()}}function nTe(s,e,t){let i=null;const n=s.map((o,r)=>Promise.resolve(o.provideFoldingRanges(e,tTe,t)).then(a=>{if(!t.isCancellationRequested&&Array.isArray(a)){Array.isArray(i)||(i=[]);const l=e.getLineCount();for(const d of a)d.start>0&&d.end>d.start&&d.end<=l&&i.push({start:d.start,end:d.end,rank:r,kind:d.kind})}},Ai));return Promise.all(n).then(o=>i)}class sTe{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>Ba||t>Ba)return;const o=this._length;this._startIndexes[o]=e,this._endIndexes[o]=t,this._nestingLevels[o]=n,this._types[o]=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),o=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 sTe(e);let n;const o=[];for(const r of t)if(!n)n=r,i.add(r.start,r.end,r.kind&&r.kind.value,o.length);else if(r.start>n.start)if(r.end<=n.end)o.push(n),n=r,i.add(r.start,r.end,r.kind&&r.kind.value,o.length);else{if(r.start>n.end){do n=o.pop();while(n&&r.start>n.end);n&&o.push(n),n=r}i.add(r.start,r.end,r.kind&&r.kind.value,o.length)}return i.toIndentRanges()}var rTe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},ov=function(s,e){return function(t,i){e(t,i,s)}},qp;const ds=new ue("foldingEnabled",!1);let qc=qp=class extends H{static get(e){return e.getContribution(qp.ID)}static getFoldingRangeProviders(e,t){var i,n;const o=e.foldingRangeProvider.ordered(t);return(n=(i=qp._foldingRangeSelector)===null||i===void 0?void 0:i.call(qp,o,t))!==null&&n!==void 0?n:o}constructor(e,t,i,n,o,r){super(),this.contextKeyService=t,this.languageConfigurationService=i,this.languageFeaturesService=r,this.localToDispose=this._register(new Y),this.editor=e,this._foldingLimitReporter=new mG(e);const a=this.editor.getOptions();this._isEnabled=a.get(43),this._useFoldingProviders=a.get(44)!=="indentation",this._unfoldOnClickAfterEndOfLine=a.get(48),this._restoringViewState=!1,this._currentModelHasFoldedImports=!1,this._foldingImportsByDefault=a.get(46),this.updateDebounceInfo=o.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 Zi(e),this.foldingDecorationProvider.showFoldingControls=a.get(110),this.foldingDecorationProvider.showFoldingHighlights=a.get(45),this.foldingEnabled=ds.bindTo(this.contextKeyService),this.foldingEnabled.set(this._isEnabled),this._register(this.editor.onDidChangeModel(()=>this.onModelChanged())),this._register(this.editor.onDidChangeConfiguration(l=>{if(l.hasChanged(43)&&(this._isEnabled=this.editor.getOptions().get(43),this.foldingEnabled.set(this._isEnabled),this.onModelChanged()),l.hasChanged(47)&&this.onModelChanged(),l.hasChanged(110)||l.hasChanged(45)){const d=this.editor.getOptions();this.foldingDecorationProvider.showFoldingControls=d.get(110),this.foldingDecorationProvider.showFoldingHighlights=d.get(45),this.triggerFoldingModelChanged()}l.hasChanged(44)&&(this._useFoldingProviders=this.editor.getOptions().get(44)!=="indentation",this.onFoldingStrategyChanged()),l.hasChanged(48)&&(this._unfoldOnClickAfterEndOfLine=this.editor.getOptions().get(48)),l.hasChanged(46)&&(this._foldingImportsByDefault=this.editor.getOptions().get(46))})),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 VIe(e,this.foldingDecorationProvider),this.localToDispose.add(this.foldingModel),this.hiddenRangeModel=new qIe(this.foldingModel),this.localToDispose.add(this.hiddenRangeModel),this.localToDispose.add(this.hiddenRangeModel.onDidChange(t=>this.onHiddenRangesChanges(t))),this.updateScheduler=new _a(this.updateDebounceInfo.get(e)),this.cursorChangedScheduler=new Wt(()=>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:()=>{var t,i;this.foldingRegionPromise&&(this.foldingRegionPromise.cancel(),this.foldingRegionPromise=null),(t=this.updateScheduler)===null||t===void 0||t.cancel(),this.updateScheduler=null,this.foldingModel=null,this.foldingModelPromise=null,this.hiddenRangeModel=null,this.cursorChangedScheduler=null,(i=this.rangeProvider)===null||i===void 0||i.dispose(),this.rangeProvider=null}}),this.triggerFoldingModelChanged())}onFoldingStrategyChanged(){var e;(e=this.rangeProvider)===null||e===void 0||e.dispose(),this.rangeProvider=null,this.triggerFoldingModelChanged()}getRangeProvider(e){if(this.rangeProvider)return this.rangeProvider;const t=new N4(e,this.languageConfigurationService,this._foldingLimitReporter);if(this.rangeProvider=t,this._useFoldingProviders&&this.foldingModel){const i=qp.getFoldingRangeProviders(this.languageFeaturesService,e);i.length>0&&(this.rangeProvider=new M4(e,i,()=>this.triggerFoldingModelChanged(),this._foldingLimitReporter,t))}return this.rangeProvider}getFoldingModel(){return this.foldingModelPromise}onDidChangeModelContent(e){var t;(t=this.hiddenRangeModel)===null||t===void 0||t.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 Jn,i=this.getRangeProvider(e.textModel),n=this.foldingRegionPromise=Dn(o=>i.compute(o));return n.then(o=>{if(o&&n===this.foldingRegionPromise){let r;if(this._foldingImportsByDefault&&!this._currentModelHasFoldedImports){const c=o.setCollapsedAllOfType(Ps.Imports.value,!0);c&&(r=cl.capture(this.editor),this._currentModelHasFoldedImports=c)}const a=this.editor.getSelections(),l=a?a.map(c=>c.startLineNumber):[];e.update(o,l),r==null||r.restore(this.editor);const d=this.updateDebounceInfo.update(e.textModel,t.elapsed());this.updateScheduler&&(this.updateScheduler.defaultDelay=d)}return e})}).then(void 0,e=>(Xe(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 o of i){const r=o.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,Xe)}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,o=e.target.element.offsetLeft;if(n.offsetX-o<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,o=e.target.range;if(!o||o.startLineNumber!==i)return;if(n){if(e.target.type!==4)return}else{const a=this.editor.getModel();if(!a||o.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 d=[];if(l){const c=h=>!h.containedBy(r)&&!r.containedBy(h),u=t.getRegionsInside(null,c);for(const h of u)h.isCollapsed&&d.push(h);d.length===0&&(d=u)}else{const c=e.event.middleButton||e.event.shiftKey;if(c)for(const u of t.getRegionsInside(r))u.isCollapsed===a&&d.push(u);(a||!c||d.length===0)&&d.push(r)}t.toggleCollapseState(d),this.reveal({lineNumber:i,column:1})}}}reveal(e){this.editor.revealPositionInCenterIfOutsideViewport(e,0)}};qc.ID="editor.contrib.folding";qc=qp=rTe([ov(1,Be),ov(2,Yt),ov(3,en),ov(4,Ur),ov(5,Ce)],qc);class mG{constructor(e){this.editor=e,this._onDidChange=new B,this._computed=0,this._limited=!1}get limit(){return this.editor.getOptions().get(47)}update(e,t){(e!==this._computed||t!==this._limited)&&(this._computed=e,this._limited=t,this._onDidChange.fire())}}class Ss extends me{runEditorCommand(e,t,i){const n=e.get(Yt),o=qc.get(t);if(!o)return;const r=o.getFoldingModel();if(r)return this.reportTelemetry(e,t),r.then(a=>{if(a){this.invoke(o,a,t,i,n);const l=t.getSelection();l&&o.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 _G(s){if(!oo(s)){if(!Ms(s))return!1;const e=s;if(!oo(e.levels)&&!yh(e.levels)||!oo(e.direction)&&!lo(e.direction)||!oo(e.selectionLines)&&(!Array.isArray(e.selectionLines)||!e.selectionLines.every(yh)))return!1}return!0}class aTe extends Ss{constructor(){super({id:"editor.unfold",label:p("unfoldAction.label","Unfold"),alias:"Unfold",precondition:ds,kbOpts:{kbExpr:T.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:_G,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 o=n&&n.levels||1,r=this.getLineNumbers(n,i);n&&n.direction==="up"?hG(t,!1,o,r):y0(t,!1,o,r)}}class lTe extends Ss{constructor(){super({id:"editor.unfoldRecursively",label:p("unFoldRecursivelyAction.label","Unfold Recursively"),alias:"Unfold Recursively",precondition:ds,kbOpts:{kbExpr:T.editorTextFocus,primary:an(2089,2142),weight:100}})}invoke(e,t,i,n){y0(t,!1,Number.MAX_VALUE,this.getSelectedLines(i))}}class dTe extends Ss{constructor(){super({id:"editor.fold",label:p("foldAction.label","Fold"),alias:"Fold",precondition:ds,kbOpts:{kbExpr:T.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:_G,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 o=this.getLineNumbers(n,i),r=n&&n.levels,a=n&&n.direction;typeof r!="number"&&typeof a!="string"?zIe(t,!0,o):a==="up"?hG(t,!0,r||1,o):y0(t,!0,r||1,o)}}class cTe extends Ss{constructor(){super({id:"editor.toggleFold",label:p("toggleFoldAction.label","Toggle Fold"),alias:"Toggle Fold",precondition:ds,kbOpts:{kbExpr:T.editorTextFocus,primary:an(2089,2090),weight:100}})}invoke(e,t,i){const n=this.getSelectedLines(i);uG(t,1,n)}}class uTe extends Ss{constructor(){super({id:"editor.foldRecursively",label:p("foldRecursivelyAction.label","Fold Recursively"),alias:"Fold Recursively",precondition:ds,kbOpts:{kbExpr:T.editorTextFocus,primary:an(2089,2140),weight:100}})}invoke(e,t,i){const n=this.getSelectedLines(i);y0(t,!0,Number.MAX_VALUE,n)}}class hTe extends Ss{constructor(){super({id:"editor.foldAllBlockComments",label:p("foldAllBlockComments.label","Fold All Block Comments"),alias:"Fold All Block Comments",precondition:ds,kbOpts:{kbExpr:T.editorTextFocus,primary:an(2089,2138),weight:100}})}invoke(e,t,i,n,o){if(t.regions.hasTypes())T4(t,Ps.Comment.value,!0);else{const r=i.getModel();if(!r)return;const a=o.getLanguageConfiguration(r.getLanguageId()).comments;if(a&&a.blockCommentStartToken){const l=new RegExp("^\\s*"+rr(a.blockCommentStartToken));I4(t,l,!0)}}}}class gTe extends Ss{constructor(){super({id:"editor.foldAllMarkerRegions",label:p("foldAllMarkerRegions.label","Fold All Regions"),alias:"Fold All Regions",precondition:ds,kbOpts:{kbExpr:T.editorTextFocus,primary:an(2089,2077),weight:100}})}invoke(e,t,i,n,o){if(t.regions.hasTypes())T4(t,Ps.Region.value,!0);else{const r=i.getModel();if(!r)return;const a=o.getLanguageConfiguration(r.getLanguageId()).foldingRules;if(a&&a.markers&&a.markers.start){const l=new RegExp(a.markers.start);I4(t,l,!0)}}}}class fTe extends Ss{constructor(){super({id:"editor.unfoldAllMarkerRegions",label:p("unfoldAllMarkerRegions.label","Unfold All Regions"),alias:"Unfold All Regions",precondition:ds,kbOpts:{kbExpr:T.editorTextFocus,primary:an(2089,2078),weight:100}})}invoke(e,t,i,n,o){if(t.regions.hasTypes())T4(t,Ps.Region.value,!1);else{const r=i.getModel();if(!r)return;const a=o.getLanguageConfiguration(r.getLanguageId()).foldingRules;if(a&&a.markers&&a.markers.start){const l=new RegExp(a.markers.start);I4(t,l,!1)}}}}class pTe extends Ss{constructor(){super({id:"editor.foldAllExcept",label:p("foldAllExcept.label","Fold All Except Selected"),alias:"Fold All Except Selected",precondition:ds,kbOpts:{kbExpr:T.editorTextFocus,primary:an(2089,2136),weight:100}})}invoke(e,t,i){const n=this.getSelectedLines(i);gG(t,!0,n)}}class mTe extends Ss{constructor(){super({id:"editor.unfoldAllExcept",label:p("unfoldAllExcept.label","Unfold All Except Selected"),alias:"Unfold All Except Selected",precondition:ds,kbOpts:{kbExpr:T.editorTextFocus,primary:an(2089,2134),weight:100}})}invoke(e,t,i){const n=this.getSelectedLines(i);gG(t,!1,n)}}class _Te extends Ss{constructor(){super({id:"editor.foldAll",label:p("foldAllAction.label","Fold All"),alias:"Fold All",precondition:ds,kbOpts:{kbExpr:T.editorTextFocus,primary:an(2089,2069),weight:100}})}invoke(e,t,i){y0(t,!0)}}class vTe extends Ss{constructor(){super({id:"editor.unfoldAll",label:p("unfoldAllAction.label","Unfold All"),alias:"Unfold All",precondition:ds,kbOpts:{kbExpr:T.editorTextFocus,primary:an(2089,2088),weight:100}})}invoke(e,t,i){y0(t,!1)}}class Vf extends Ss{getFoldingLevel(){return parseInt(this.id.substr(Vf.ID_PREFIX.length))}invoke(e,t,i){UIe(t,this.getFoldingLevel(),!0,this.getSelectedLines(i))}}Vf.ID_PREFIX="editor.foldLevel";Vf.ID=s=>Vf.ID_PREFIX+s;class bTe extends Ss{constructor(){super({id:"editor.gotoParentFold",label:p("gotoParentFold.label","Go to Parent Fold"),alias:"Go to Parent Fold",precondition:ds,kbOpts:{kbExpr:T.editorTextFocus,weight:100}})}invoke(e,t,i){const n=this.getSelectedLines(i);if(n.length>0){const o=$Ie(n[0],t);o!==null&&i.setSelection({startLineNumber:o,startColumn:1,endLineNumber:o,endColumn:1})}}}class CTe extends Ss{constructor(){super({id:"editor.gotoPreviousFold",label:p("gotoPreviousFold.label","Go to Previous Folding Range"),alias:"Go to Previous Folding Range",precondition:ds,kbOpts:{kbExpr:T.editorTextFocus,weight:100}})}invoke(e,t,i){const n=this.getSelectedLines(i);if(n.length>0){const o=jIe(n[0],t);o!==null&&i.setSelection({startLineNumber:o,startColumn:1,endLineNumber:o,endColumn:1})}}}class wTe extends Ss{constructor(){super({id:"editor.gotoNextFold",label:p("gotoNextFold.label","Go to Next Folding Range"),alias:"Go to Next Folding Range",precondition:ds,kbOpts:{kbExpr:T.editorTextFocus,weight:100}})}invoke(e,t,i){const n=this.getSelectedLines(i);if(n.length>0){const o=KIe(n[0],t);o!==null&&i.setSelection({startLineNumber:o,startColumn:1,endLineNumber:o,endColumn:1})}}}class yTe extends Ss{constructor(){super({id:"editor.createFoldingRangeFromSelection",label:p("createManualFoldRange.label","Create Folding Range from Selection"),alias:"Create Folding Range from Selection",precondition:ds,kbOpts:{kbExpr:T.editorTextFocus,primary:an(2089,2135),weight:100}})}invoke(e,t,i){var n;const o=[],r=i.getSelections();if(r){for(const a of r){let l=a.endLineNumber;a.endColumn===1&&--l,l>a.startLineNumber&&(o.push({startLineNumber:a.startLineNumber,endLineNumber:l,type:void 0,isCollapsed:!0,source:1}),i.setSelection({startLineNumber:a.startLineNumber,startColumn:1,endLineNumber:a.startLineNumber,endColumn:1}))}if(o.length>0){o.sort((l,d)=>l.startLineNumber-d.startLineNumber);const a=qo.sanitizeAndMerge(t.regions,o,(n=i.getModel())===null||n===void 0?void 0:n.getLineCount());t.updatePost(qo.fromFoldRanges(a))}}}}class STe extends Ss{constructor(){super({id:"editor.removeManualFoldingRanges",label:p("removeManualFoldingRanges.label","Remove Manual Folding Ranges"),alias:"Remove Manual Folding Ranges",precondition:ds,kbOpts:{kbExpr:T.editorTextFocus,primary:an(2089,2137),weight:100}})}invoke(e,t,i){const n=i.getSelections();if(n){const o=[];for(const r of n){const{startLineNumber:a,endLineNumber:l}=r;o.push(l>=a?{startLineNumber:a,endLineNumber:l}:{endLineNumber:l,startLineNumber:a})}t.removeManualRanges(o),e.triggerFoldingModelChanged()}}}kt(qc.ID,qc,0);te(aTe);te(lTe);te(dTe);te(uTe);te(_Te);te(vTe);te(hTe);te(gTe);te(fTe);te(pTe);te(mTe);te(cTe);te(bTe);te(CTe);te(wTe);te(yTe);te(STe);for(let s=1;s<=7;s++)Ale(new Vf({id:Vf.ID(s),label:p("foldLevelAction.label","Fold Level {0}",s),alias:`Fold Level ${s}`,precondition:ds,kbOpts:{kbExpr:T.editorTextFocus,primary:an(2089,2048|21+s),weight:100}}));pt.registerCommand("_executeFoldingRangeProvider",async function(s,...e){const[t]=e;if(!(t instanceof Ae))throw Mr();const i=s.get(Ce),n=s.get(_i).getModel(t);if(!n)throw Mr();const o=s.get(rt);if(!o.getValue("editor.folding",{resource:t}))return[];const r=s.get(Yt),a=o.getValue("editor.foldingStrategy",{resource:t}),l={get limit(){return o.getValue("editor.foldingMaximumRegions",{resource:t})},update:(g,f)=>{}},d=new N4(n,r,l);let c=d;if(a!=="indentation"){const g=qc.getFoldingRangeProviders(i,n);g.length&&(c=new M4(n,g,()=>{},l,d))}const u=await c.compute(dt.None),h=[];try{if(u)for(let g=0;g=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},pb=function(s,e){return function(t,i){e(t,i,s)}};let WC=class{constructor(e,t,i,n){this._editor=e,this._languageFeaturesService=t,this._workerService=i,this._accessibilitySignalService=n,this._disposables=new Y,this._sessionDisposables=new Y,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(o=>{o.hasChanged(56)&&this._update()})),this._update()}dispose(){this._disposables.dispose(),this._sessionDisposables.dispose()}_update(){if(this._sessionDisposables.clear(),!this._editor.getOption(56)||!this._editor.hasModel())return;const e=this._editor.getModel(),[t]=this._languageFeaturesService.onTypeFormattingEditProvider.ordered(e);if(!t||!t.autoFormatTriggerCharacters)return;const i=new ZS;for(const n of t.autoFormatTriggerCharacters)i.add(n.charCodeAt(0));this._sessionDisposables.add(this._editor.onDidType(n=>{const o=n.charCodeAt(n.length-1);i.has(o)&&this._trigger(String.fromCharCode(o))}))}_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 Vi,o=this._editor.onDidChangeModelContent(r=>{if(r.isFlush){n.cancel(),o.dispose();return}for(let a=0,l=r.changes.length;a{n.token.isCancellationRequested||rs(r)&&(this._accessibilitySignalService.playSignal(Ke.format,{userGesture:!1}),B_.execute(this._editor,r,!0))}).finally(()=>{o.dispose()})}};WC.ID="editor.contrib.autoFormat";WC=vG([pb(1,Ce),pb(2,jr),pb(3,rg)],WC);let HC=class{constructor(e,t,i){this.editor=e,this._languageFeaturesService=t,this._instantiationService=i,this._callOnDispose=new Y,this._callOnModel=new Y,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(55)&&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(PK,this.editor,e,2,Nc.None,dt.None,!1).catch(Xe))}};HC.ID="editor.contrib.formatOnPaste";HC=vG([pb(1,Ce),pb(2,Ne)],HC);class kTe extends me{constructor(){super({id:"editor.action.formatDocument",label:p("formatDocument.label","Format Document"),alias:"Format Document",precondition:G.and(T.notInCompositeEditor,T.writable,T.hasDocumentFormattingProvider),kbOpts:{kbExpr:T.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(Ne);await e.get(sg).showWhile(i.invokeFunction(SLe,t,1,Nc.None,dt.None,!0),250)}}}class ETe extends me{constructor(){super({id:"editor.action.formatSelection",label:p("formatSelection.label","Format Selection"),alias:"Format Selection",precondition:G.and(T.writable,T.hasDocumentSelectionFormattingProvider),kbOpts:{kbExpr:T.editorTextFocus,primary:an(2089,2084),weight:100},contextMenuOpts:{when:T.hasNonEmptySelection,group:"1_modification",order:1.31}})}async run(e,t){if(!t.hasModel())return;const i=e.get(Ne),n=t.getModel(),o=t.getSelections().map(a=>a.isEmpty()?new x(a.startLineNumber,1,a.startLineNumber,n.getLineMaxColumn(a.startLineNumber)):a);await e.get(sg).showWhile(i.invokeFunction(PK,t,o,1,Nc.None,dt.None,!0),250)}}kt(WC.ID,WC,2);kt(HC.ID,HC,2);te(kTe);te(ETe);pt.registerCommand("editor.action.format",async s=>{const e=s.get(xt).getFocusedCodeEditor();if(!e||!e.hasModel())return;const t=s.get(gi);e.getSelection().isEmpty()?await t.executeCommand("editor.action.formatDocument"):await t.executeCommand("editor.action.formatSelection")});var ITe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},fT=function(s,e){return function(t,i){e(t,i,s)}};class wm{remove(){var e;(e=this.parent)===null||e===void 0||e.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 o=0;t.children.get(n)!==void 0;o++)n=`${i}_${o}`;return n}static empty(e){return e.children.size===0}}class hR extends wm{constructor(e,t,i){super(),this.id=e,this.parent=t,this.symbol=i,this.children=new Map}}class bG extends wm{constructor(e,t,i,n){super(),this.id=e,this.parent=t,this.label=i,this.order=n,this.children=new Map}}class nc extends wm{static create(e,t,i){const n=new Vi(i),o=new nc(t.uri),r=e.ordered(t),a=r.map((d,c)=>{var u;const h=wm.findId(`provider_${c}`,o),g=new bG(h,o,(u=d.displayName)!==null&&u!==void 0?u:"Unknown Outline Provider",c);return Promise.resolve(d.provideDocumentSymbols(t,n.token)).then(f=>{for(const m of f||[])nc._makeOutlineElement(m,g);return g},f=>(Ai(f),g)).then(f=>{wm.empty(f)?f.remove():o._groups.set(h,f)})}),l=e.onDidChange(()=>{const d=e.ordered(t);Ci(d,r)||n.cancel()});return Promise.all(a).then(()=>n.token.isCancellationRequested&&!i.isCancellationRequested?nc.create(e,t,i):o._compact()).finally(()=>{n.dispose(),l.dispose(),n.dispose()})}static _makeOutlineElement(e,t){const i=wm.findId(e,t),n=new hR(i,t,e);if(e.children)for(const o of e.children)nc._makeOutlineElement(o,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=ft.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 hR?e.push(t.symbol):e.push(...ft.map(t.children.values(),i=>i.symbol));return e.sort((t,i)=>x.compareRangesUsingStarts(t.range,i.range))}asListOfDocumentSymbols(){const e=this.getTopLevelSymbols(),t=[];return nc._flattenDocumentSymbols(t,e,""),t.sort((i,n)=>W.compare(x.getStartPosition(i.range),x.getStartPosition(n.range))||W.compare(x.getEndPosition(n.range),x.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&&nc._flattenDocumentSymbols(e,n.children,n.name)}}const R4=ut("IOutlineModelService");let gR=class{constructor(e,t,i){this._languageFeaturesService=e,this._disposables=new Y,this._cache=new iu(10,.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 o=this._cache.get(e.id);if(!o||o.versionId!==e.getVersionId()||!Ci(o.provider,n)){const a=new Vi;o={versionId:e.getVersionId(),provider:n,promiseCnt:0,source:a,promise:nc.create(i,e,a.token),model:void 0},this._cache.set(e.id,o);const l=Date.now();o.promise.then(d=>{o.model=d,this._debounceInformation.update(e,Date.now()-l)}).catch(d=>{this._cache.delete(e.id)})}if(o.model)return o.model;o.promiseCnt+=1;const r=t.onCancellationRequested(()=>{--o.promiseCnt===0&&(o.source.cancel(),this._cache.delete(e.id))});try{return await o.promise}finally{r.dispose()}}};gR=ITe([fT(0,Ce),fT(1,Ur),fT(2,_i)],gR);mt(R4,gR,1);pt.registerCommand("_executeDocumentSymbolProvider",async function(s,...e){const[t]=e;yt(Ae.isUri(t));const i=s.get(R4),o=await s.get(mo).createModelReference(t);try{return(await i.getOrCreate(o.object.textEditorModel,dt.None)).getTopLevelSymbols()}finally{o.dispose()}});class Mn extends H{constructor(e,t){super(),this.contextKeyService=e,this.model=t,this.inlineCompletionVisible=Mn.inlineSuggestionVisible.bindTo(this.contextKeyService),this.inlineCompletionSuggestsIndentation=Mn.inlineSuggestionHasIndentation.bindTo(this.contextKeyService),this.inlineCompletionSuggestsIndentationLessThanTabSize=Mn.inlineSuggestionHasIndentationLessThanTabSize.bindTo(this.contextKeyService),this.suppressSuggestions=Mn.suppressSuggestions.bindTo(this.contextKeyService),this._register(st(i=>{const n=this.model.read(i),o=n==null?void 0:n.state.read(i),r=!!(o!=null&&o.inlineCompletion)&&(o==null?void 0:o.primaryGhostText)!==void 0&&!(o!=null&&o.primaryGhostText.isEmpty());this.inlineCompletionVisible.set(r),o!=null&&o.primaryGhostText&&(o!=null&&o.inlineCompletion)&&this.suppressSuggestions.set(o.inlineCompletion.inlineCompletion.source.inlineCompletions.suppressSuggestions)})),this._register(st(i=>{const n=this.model.read(i);let o=!1,r=!0;const a=n==null?void 0:n.primaryGhostText.read(i);if(n!=null&&n.selectedSuggestItem&&a&&a.parts.length>0){const{column:l,lines:d}=a.parts[0],c=d[0],u=n.textModel.getLineIndentColumn(a.lineNumber);if(l<=u){let g=Cs(c);g===-1&&(g=c.length-1),o=g>0;const f=n.textModel.getOptions().tabSize;r=hn.visibleColumnFromColumn(c,g+1,f)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 yF([...this.parts.map(o=>new zc(x.fromPositions(new W(1,o.column)),o.lines.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 CL{constructor(e,t,i){this.column=e,this.text=t,this.preview=i,this.lines=Td(this.text)}equals(e){return this.column===e.column&&this.lines.length===e.lines.length&&this.lines.every((t,i)=>t===e.lines[i])}}class fR{constructor(e,t,i,n=0){this.lineNumber=e,this.columnRange=t,this.text=i,this.additionalReservedLineCount=n,this.parts=[new CL(this.columnRange.endColumnExclusive,this.text,!1)],this.newLines=Td(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 p9(s,e){return Ci(s,e,CG)}function CG(s,e){return s===e?!0:!s||!e?!1:s instanceof VC&&e instanceof VC||s instanceof fR&&e instanceof fR?s.equals(e):!1}const TTe=[];function NTe(){return TTe}class wG{constructor(e,t){if(this.startColumn=e,this.endColumnExclusive=t,e>t)throw new Ut(`startColumn ${e} cannot be after endColumnExclusive ${t}`)}toRange(e){return new x(e,this.startColumn,e,this.endColumnExclusive)}equals(e){return this.startColumn===e.startColumn&&this.endColumnExclusive===e.endColumnExclusive}}function yG(s,e){const t=new Y,i=s.createDecorationsCollection();return t.add(qx({debugName:()=>`Apply decorations from ${e.debugName}`},n=>{const o=e.read(n);i.set(o)})),t.add({dispose:()=>{i.clear()}}),t}function ATe(s,e){return new W(s.lineNumber+e.lineNumber-1,e.lineNumber===1?s.column+e.column-1:e.column)}function m9(s,e){return new W(s.lineNumber-e.lineNumber+1,s.lineNumber-e.lineNumber===0?s.column-e.column+1:s.column)}var MTe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},RTe=function(s,e){return function(t,i){e(t,i,s)}};const _9="ghost-text";let pR=class extends H{constructor(e,t,i){super(),this.editor=e,this.model=t,this.languageService=i,this.isDisposed=vt(this,!1),this.currentTextModel=Ot(this.editor.onDidChangeModel,()=>this.editor.getModel()),this.uiState=je(this,n=>{if(this.isDisposed.read(n))return;const o=this.currentTextModel.read(n);if(o!==this.model.targetTextModel.read(n))return;const r=this.model.ghostText.read(n);if(!r)return;const a=r instanceof fR?r.columnRange:void 0,l=[],d=[];function c(m,_){if(d.length>0){const v=d[d.length-1];_&&v.decorations.push(new Os(v.content.length+1,v.content.length+1+m[0].length,_,0)),v.content+=m[0],m=m.slice(1)}for(const v of m)d.push({content:v,decorations:_?[new Os(1,v.length+1,_,0)]:[]})}const u=o.getLineContent(r.lineNumber);let h,g=0;for(const m of r.parts){let _=m.lines;h===void 0?(l.push({column:m.column,text:_[0],preview:m.preview}),_=_.slice(1)):c([u.substring(g,m.column-1)],void 0),_.length>0&&(c(_,_9),h===void 0&&m.column<=u.length&&(h=m.column)),g=m.column-1}h!==void 0&&c([u.substring(g)],void 0);const f=h!==void 0?new wG(h,u.length+1):void 0;return{replacedRange:a,inlineTexts:l,additionalLines:d,hiddenRange:f,lineNumber:r.lineNumber,additionalReservedLineCount:this.model.minReservedLineCount.read(n),targetTextModel:o}}),this.decorations=je(this,n=>{const o=this.uiState.read(n);if(!o)return[];const r=[];o.replacedRange&&r.push({range:o.replacedRange.toRange(o.lineNumber),options:{inlineClassName:"inline-completion-text-to-replace",description:"GhostTextReplacement"}}),o.hiddenRange&&r.push({range:o.hiddenRange.toRange(o.lineNumber),options:{inlineClassName:"ghost-text-hidden",description:"ghost-text-hidden"}});for(const a of o.inlineTexts)r.push({range:x.fromPositions(new W(o.lineNumber,a.column)),options:{description:_9,after:{content:a.text,inlineClassName:a.preview?"ghost-text-decoration-preview":"ghost-text-decoration",cursorStops:aa.Left},showIfCollapsed:!0}});return r}),this.additionalLinesWidget=this._register(new SG(this.editor,this.languageService.languageIdCodec,je(n=>{const o=this.uiState.read(n);return o?{lineNumber:o.lineNumber,additionalLines:o.additionalLines,minReservedLineCount:o.additionalReservedLineCount,targetTextModel:o.targetTextModel}:void 0}))),this._register(Ie(()=>{this.isDisposed.set(!0,void 0)})),this._register(yG(this.editor,this.decorations))}ownsViewZone(e){return this.additionalLinesWidget.viewZoneId===e}};pR=MTe([RTe(2,vi)],pR);class SG extends H{get viewZoneId(){return this._viewZoneId}constructor(e,t,i){super(),this.editor=e,this.languageIdCodec=t,this.lines=i,this._viewZoneId=void 0,this.editorOptionsChanged=os("editorOptionChanged",le.filter(this.editor.onDidChangeConfiguration,n=>n.hasChanged(33)||n.hasChanged(117)||n.hasChanged(99)||n.hasChanged(94)||n.hasChanged(51)||n.hasChanged(50)||n.hasChanged(67))),this._register(st(n=>{const o=this.lines.read(n);this.editorOptionsChanged.read(n),o?this.updateLines(o.lineNumber,o.additionalLines,o.minReservedLineCount):this.clear()}))}dispose(){super.dispose(),this.clear()}clear(){this.editor.changeViewZones(e=>{this._viewZoneId&&(e.removeZone(this._viewZoneId),this._viewZoneId=void 0)})}updateLines(e,t,i){const n=this.editor.getModel();if(!n)return;const{tabSize:o}=n.getOptions();this.editor.changeViewZones(r=>{this._viewZoneId&&(r.removeZone(this._viewZoneId),this._viewZoneId=void 0);const a=Math.max(t.length,i);if(a>0){const l=document.createElement("div");PTe(l,o,t,this.editor.getOptions(),this.languageIdCodec),this._viewZoneId=r.addZone({afterLineNumber:e,heightInLines:a,domNode:l,afterColumnAffinity:1})}})}}function PTe(s,e,t,i,n){const o=i.get(33),r=i.get(117),a="none",l=i.get(94),d=i.get(51),c=i.get(50),u=i.get(67),h=new l0(1e4);h.appendString('
    ');for(let m=0,_=t.length;m<_;m++){const v=t[m],b=v.content;h.appendString('
    ');const C=c1(b),w=d_(b),y=wn.createEmpty(b,n);m1(new tg(c.isMonospace&&!o,c.canUseHalfwidthRightwardsArrow,b,!1,C,w,0,y,v.decorations,e,0,c.spaceWidth,c.middotWidth,c.wsmiddotWidth,r,a,l,d!==Zo.OFF,null),h),h.appendString("
    ")}h.appendString("
    "),Un(s,c);const g=h.build(),f=v9?v9.createHTML(g):g;s.innerHTML=f}const v9=tu("editorGhostText",{createHTML:s=>s});function FTe(s,e){const t=new g$,i=new p$(t,d=>e.getLanguageConfiguration(d)),n=new f$(new OTe([s]),i),o=HA(n,[],void 0,!0);let r="";const a=s.getLineContent();function l(d,c){if(d.kind===2)if(l(d.openingBracket,c),c=Di(c,d.openingBracket.length),d.child&&(l(d.child,c),c=Di(c,d.child.length)),d.closingBracket)l(d.closingBracket,c),c=Di(c,d.closingBracket.length);else{const h=i.getSingleLanguageBracketTokens(d.openingBracket.languageId).findClosingTokenText(d.openingBracket.bracketIds);r+=h}else if(d.kind!==3){if(d.kind===0||d.kind===1)r+=a.substring(c,Di(c,d.length));else if(d.kind===4)for(const u of d.children)l(u,c),c=Di(c,u.length)}}return l(o,Bs),r}class OTe{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}}async function BTe(s,e,t,i,n=dt.None,o){const r=VTe(e,t),a=s.all(t),l=new _F;for(const v of a)v.groupId&&l.add(v.groupId,v);function d(v){if(!v.yieldsToGroupIds)return[];const b=[];for(const C of v.yieldsToGroupIds||[]){const w=l.get(C);for(const y of w)b.push(y)}return b}const c=new Map,u=new Set;function h(v,b){if(b=[...b,v],u.has(v))return b;u.add(v);try{const C=d(v);for(const w of C){const y=h(w,b);if(y)return y}}finally{u.delete(v)}}function g(v){const b=c.get(v);if(b)return b;const C=h(v,[]);C&&Ai(new Error(`Inline completions: cyclic yield-to dependency detected. Path: ${C.map(y=>y.toString?y.toString():""+y).join(" -> ")}`));const w=new ZL;return c.set(v,w.p),(async()=>{if(!C){const y=d(v);for(const D of y){const L=await g(D);if(L&&L.items.length>0)return}}try{return await v.provideInlineCompletions(t,e,i,n)}catch(y){Ai(y);return}})().then(y=>w.complete(y),y=>w.error(y)),w.p}const f=await Promise.all(a.map(async v=>({provider:v,completions:await g(v)}))),m=new Map,_=[];for(const v of f){const b=v.completions;if(!b)continue;const C=new HTe(b,v.provider);_.push(C);for(const w of b.items){const y=wL.from(w,C,r,t,o);m.set(y.hash(),y)}}return new WTe(Array.from(m.values()),new Set(m.keys()),_)}class WTe{constructor(e,t,i){this.completions=e,this.hashs=t,this.providerResults=i}has(e){return this.hashs.has(e.hash())}dispose(){for(const e of this.providerResults)e.removeRef()}}class HTe{constructor(e,t){this.inlineCompletions=e,this.provider=t,this.refCount=1}addRef(){this.refCount++}removeRef(){this.refCount--,this.refCount===0&&this.provider.freeInlineCompletions(this.inlineCompletions)}}class wL{static from(e,t,i,n,o){let r,a,l=e.range?x.lift(e.range):i;if(typeof e.insertText=="string"){if(r=e.insertText,o&&e.completeBracketPairs){r=b9(r,l.getStartPosition(),n,o);const d=r.length-e.insertText.length;d!==0&&(l=new x(l.startLineNumber,l.startColumn,l.endLineNumber,l.endColumn+d))}a=void 0}else if("snippet"in e.insertText){const d=e.insertText.snippet.length;if(o&&e.completeBracketPairs){e.insertText.snippet=b9(e.insertText.snippet,l.getStartPosition(),n,o);const u=e.insertText.snippet.length-d;u!==0&&(l=new x(l.startLineNumber,l.startColumn,l.endLineNumber,l.endColumn+u))}const c=new Rf().parse(e.insertText.snippet);c.children.length===1&&c.children[0]instanceof Ts?(r=c.children[0].value,a=void 0):(r=c.toString(),a={snippet:e.insertText.snippet,range:l})}else ux(e.insertText);return new wL(r,e.command,l,r,a,e.additionalTextEdits||NTe(),e,t)}constructor(e,t,i,n,o,r,a,l){this.filterText=e,this.command=t,this.range=i,this.insertText=n,this.snippetInfo=o,this.additionalTextEdits=r,this.sourceInlineCompletion=a,this.source=l,e=e.replace(/\r\n|\r/g,` `),n=e.replace(/\r\n|\r/g,` `)}withRange(e){return new wL(this.filterText,this.command,e,this.insertText,this.snippetInfo,this.additionalTextEdits,this.sourceInlineCompletion,this.source)}hash(){return JSON.stringify({insertText:this.insertText,range:this.range.toString()})}}function VTe(s,e){const t=e.getWordAtPosition(s),i=e.getLineMaxColumn(s.lineNumber);return t?new x(s.lineNumber,t.startColumn,s.lineNumber,i):x.fromPositions(s,s.with(void 0,i))}function b9(s,e,t,i){const o=t.getLineContent(e.lineNumber).substring(0,e.column-1)+s,r=t.tokenization.tokenizeLineWithEdit(e,o.length-(e.column-1),s),a=r==null?void 0:r.sliceAndInflate(e.column-1,o.length,0);return a?FTe(a,i):s}function pf(s,e,t){const i=t?s.range.intersectRanges(t):s.range;if(!i)return s;const n=e.getValueInRange(i,1),o=Sh(n,s.text),r=Fs.ofText(n.substring(0,o)).addToPosition(s.range.getStartPosition()),a=s.text.substring(o),l=x.fromPositions(r,s.range.getEndPosition());return new zc(l,a)}function DG(s,e){return s.text.startsWith(e.text)&&zTe(s.range,e.range)}function C9(s,e,t,i,n=0){let o=pf(s,e);if(o.range.endLineNumber!==o.range.startLineNumber)return;const r=e.getLineContent(o.range.startLineNumber),a=Zt(r).length;if(o.range.startColumn-1<=a){const f=Zt(o.text).length,m=r.substring(o.range.startColumn-1,a),[_,v]=[o.range.getStartPosition(),o.range.getEndPosition()],b=_.column+m.length<=v.column?_.delta(0,m.length):v,C=x.fromPositions(b,v),w=o.text.startsWith(m)?o.text.substring(m.length):o.text.substring(f);o=new zc(C,w)}const d=e.getValueInRange(o.range),c=UTe(d,o.text);if(!c)return;const u=o.range.startLineNumber,h=new Array;if(t==="prefix"){const f=c.filter(m=>m.originalLength===0);if(f.length>1||f.length===1&&f[0].originalStart!==d.length)return}const g=o.text.length-n;for(const f of c){const m=o.range.startColumn+f.originalStart+f.originalLength;if(t==="subwordSmart"&&i&&i.lineNumber===o.range.startLineNumber&&m0)return;if(f.modifiedLength===0)continue;const _=f.modifiedStart+f.modifiedLength,v=Math.max(f.modifiedStart,Math.min(_,g)),b=o.text.substring(f.modifiedStart,v),C=o.text.substring(v,Math.max(f.modifiedStart,_));b.length>0&&h.push(new CL(m,b,!1)),C.length>0&&h.push(new CL(m,C,!0))}return new VC(u,h)}function zTe(s,e){return e.getStartPosition().equals(s.getStartPosition())&&e.getEndPosition().isBeforeOrEqual(s.getEndPosition())}let xl;function UTe(s,e){if((xl==null?void 0:xl.originalValue)===s&&(xl==null?void 0:xl.newValue)===e)return xl==null?void 0:xl.changes;{let t=y9(s,e,!0);if(t){const i=w9(t);if(i>0){const n=y9(s,e,!1);n&&w9(n)5e3||e.length>5e3)return;function i(d){let c=0;for(let u=0,h=d.length;uc&&(c=g)}return c}const n=Math.max(i(s),i(e));function o(d){if(d<0)throw new Error("unexpected");return n+d+1}function r(d){let c=0,u=0;const h=new Int32Array(d.length);for(let g=0,f=d.length;ga},{getElements:()=>l}).ComputeDiff(!1).changes}var $Te=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},S9=function(s,e){return function(t,i){e(t,i,s)}};let mR=class extends H{constructor(e,t,i,n,o){super(),this.textModel=e,this.versionId=t,this._debounceValue=i,this.languageFeaturesService=n,this.languageConfigurationService=o,this._updateOperation=this._register(new $n),this.inlineCompletions=gC("inlineCompletions",void 0),this.suggestWidgetInlineCompletions=gC("suggestWidgetInlineCompletions",void 0),this._register(this.textModel.onDidChangeContent(()=>{this._updateOperation.clear()}))}fetch(e,t,i){var n,o;const r=new KTe(e,t,this.textModel.getVersionId()),a=t.selectedSuggestionInfo?this.suggestWidgetInlineCompletions:this.inlineCompletions;if(!((n=this._updateOperation.value)===null||n===void 0)&&n.request.satisfies(r))return this._updateOperation.value.promise;if(!((o=a.get())===null||o===void 0)&&o.request.satisfies(r))return Promise.resolve(!0);const l=!!this._updateOperation.value;this._updateOperation.clear();const d=new Vi,c=(async()=>{if((l||t.triggerKind===kc.Automatic)&&await jTe(this._debounceValue.get(this.textModel),d.token),d.token.isCancellationRequested||this.textModel.getVersionId()!==r.versionId)return!1;const g=new Date,f=await BTe(this.languageFeaturesService.inlineCompletionsProvider,e,this.textModel,t,d.token,this.languageConfigurationService);if(d.token.isCancellationRequested||this.textModel.getVersionId()!==r.versionId)return!1;const m=new Date;this._debounceValue.update(this.textModel,m.getTime()-g.getTime());const _=new GTe(f,r,this.textModel,this.versionId);if(i){const v=i.toInlineCompletion(void 0);i.canBeReused(this.textModel,e)&&!f.has(v)&&_.prepend(i.inlineCompletion,v.range,!0)}return this._updateOperation.clear(),$t(v=>{a.set(_,v)}),!0})(),u=new qTe(r,d,c);return this._updateOperation.value=u,c}clear(e){this._updateOperation.clear(),this.inlineCompletions.set(void 0,e),this.suggestWidgetInlineCompletions.set(void 0,e)}clearSuggestWidgetInlineCompletions(e){var t;!((t=this._updateOperation.value)===null||t===void 0)&&t.request.context.selectedSuggestionInfo&&this._updateOperation.clear(),this.suggestWidgetInlineCompletions.set(void 0,e)}cancelUpdate(){this._updateOperation.clear()}};mR=$Te([S9(3,Ce),S9(4,Yt)],mR);function jTe(s,e){return new Promise(t=>{let i;const n=setTimeout(()=>{i&&i.dispose(),t()},s);e&&(i=e.onCancellationRequested(()=>{clearTimeout(n),i&&i.dispose(),t()}))})}class KTe{constructor(e,t,i){this.position=e,this.context=t,this.versionId=i}satisfies(e){return this.position.equals(e.position)&&oCe(this.context.selectedSuggestionInfo,e.context.selectedSuggestionInfo,gj())&&(e.context.triggerKind===kc.Automatic||this.context.triggerKind===kc.Explicit)&&this.versionId===e.versionId}}class qTe{constructor(e,t,i){this.request=e,this.cancellationTokenSource=t,this.promise=i}dispose(){this.cancellationTokenSource.cancel()}}class GTe{get inlineCompletions(){return this._inlineCompletions}constructor(e,t,i,n){this.inlineCompletionProviderResult=e,this.request=t,this._textModel=i,this._versionId=n,this._refCount=1,this._prependedInlineCompletionItems=[];const o=i.deltaDecorations([],e.completions.map(r=>({range:r.range,options:{description:"inline-completion-tracking-range"}})));this._inlineCompletions=e.completions.map((r,a)=>new D9(r,o[a],this._textModel,this._versionId))}clone(){return this._refCount++,this}dispose(){if(this._refCount--,this._refCount===0){setTimeout(()=>{this._textModel.isDisposed()||this._textModel.deltaDecorations(this._inlineCompletions.map(e=>e.decorationId),[])},0),this.inlineCompletionProviderResult.dispose();for(const e of this._prependedInlineCompletionItems)e.source.removeRef()}}prepend(e,t,i){i&&e.source.addRef();const n=this._textModel.deltaDecorations([],[{range:t,options:{description:"inline-completion-tracking-range"}}])[0];this._inlineCompletions.unshift(new D9(e,n,this._textModel,this._versionId)),this._prependedInlineCompletionItems.push(e)}}class D9{get forwardStable(){var e;return(e=this.inlineCompletion.source.inlineCompletions.enableForwardStability)!==null&&e!==void 0?e:!1}constructor(e,t,i,n){this.inlineCompletion=e,this.decorationId=t,this._textModel=i,this._modelVersion=n,this.semanticId=JSON.stringify([this.inlineCompletion.filterText,this.inlineCompletion.insertText,this.inlineCompletion.range.getStartPosition().toString()]),this._updatedRange=dc({owner:this,equalsFn:x.equalsRange},o=>(this._modelVersion.read(o),this._textModel.getDecorationRange(this.decorationId)))}toInlineCompletion(e){var t;return this.inlineCompletion.withRange((t=this._updatedRange.read(e))!==null&&t!==void 0?t:pT)}toSingleTextEdit(e){var t;return new zc((t=this._updatedRange.read(e))!==null&&t!==void 0?t:pT,this.inlineCompletion.insertText)}isVisible(e,t,i){const n=pf(this._toFilterTextReplacement(i),e),o=this._updatedRange.read(i);if(!o||!this.inlineCompletion.range.getStartPosition().equals(o.getStartPosition())||t.lineNumber!==n.range.startLineNumber)return!1;const r=e.getValueInRange(n.range,1),a=n.text,l=Math.max(0,t.column-n.range.startColumn);let d=a.substring(0,l),c=a.substring(l),u=r.substring(0,l),h=r.substring(l);const g=e.getLineIndentColumn(n.range.startLineNumber);return n.range.startColumn<=g&&(u=u.trimStart(),u.length===0&&(h=h.trimStart()),d=d.trimStart(),d.length===0&&(c=c.trimStart())),d.startsWith(u)&&!!J$(h,c)}canBeReused(e,t){const i=this._updatedRange.read(void 0);return!!i&&i.containsPosition(t)&&this.isVisible(e,t,void 0)&&Fs.ofRange(i).isGreaterThanOrEqualTo(Fs.ofRange(this.inlineCompletion.range))}_toFilterTextReplacement(e){var t;return new zc((t=this._updatedRange.read(e))!==null&&t!==void 0?t:pT,this.inlineCompletion.filterText)}}const pT=new x(1,1,1,1),it={Visible:k4,HasFocusedSuggestion:new ue("suggestWidgetHasFocusedSuggestion",!1,p("suggestWidgetHasSelection","Whether any suggestion is focused")),DetailsVisible:new ue("suggestWidgetDetailsVisible",!1,p("suggestWidgetDetailsVisible","Whether suggestion details are visible")),MultipleSuggestions:new ue("suggestWidgetMultipleSuggestions",!1,p("suggestWidgetMultipleSuggestions","Whether there are multiple suggestions to pick from")),MakesTextEdit:new ue("suggestionMakesTextEdit",!0,p("suggestionMakesTextEdit","Whether inserting the current suggestion yields in a change or has everything already been typed")),AcceptSuggestionsOnEnter:new ue("acceptSuggestionOnEnter",!0,p("acceptSuggestionOnEnter","Whether suggestions are inserted when pressing Enter")),HasInsertAndReplaceRange:new ue("suggestionHasInsertAndReplaceRange",!1,p("suggestionHasInsertAndReplaceRange","Whether the current suggestion has insert and replace behaviour")),InsertMode:new ue("suggestionInsertMode",void 0,{type:"string",description:p("suggestionInsertMode","Whether the default behaviour is to insert or replace")}),CanResolve:new ue("suggestionCanResolve",!1,p("suggestionCanResolve","Whether the current suggestion supports to resolve further details"))},gh=new E("suggestWidgetStatusBar");class ZTe{constructor(e,t,i,n){var o;this.position=e,this.completion=t,this.container=i,this.provider=n,this.isInvalid=!1,this.score=el.Default,this.distance=0,this.textLabel=typeof t.label=="string"?t.label:(o=t.label)===null||o===void 0?void 0:o.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,x.isIRange(t.range)?(this.editStart=new W(t.range.startLineNumber,t.range.startColumn),this.editInsertEnd=new W(t.range.endLineNumber,t.range.endColumn),this.editReplaceEnd=new W(t.range.endLineNumber,t.range.endColumn),this.isInvalid=this.isInvalid||x.spansMultipleLines(t.range)||t.range.startLineNumber!==e.lineNumber):(this.editStart=new W(t.range.insert.startLineNumber,t.range.insert.startColumn),this.editInsertEnd=new W(t.range.insert.endLineNumber,t.range.insert.endColumn),this.editReplaceEnd=new W(t.range.replace.endLineNumber,t.range.replace.endColumn),this.isInvalid=this.isInvalid||x.spansMultipleLines(t.range.insert)||x.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 Jn(!0);this._resolveCache=Promise.resolve(this.provider.resolveCompletionItem(this.completion,e)).then(n=>{Object.assign(this.completion,n),this._resolveDuration=i.elapsed()},n=>{Id(n)&&(this._resolveCache=void 0,this._resolveDuration=void 0)}).finally(()=>{t.dispose()})}return this._resolveCache}}class zC{constructor(e=2,t=new Set,i=new Set,n=new Map,o=!0){this.snippetSortOrder=e,this.kindFilter=t,this.providerFilter=i,this.providerItemsToReuse=n,this.showDeprecated=o}}zC.default=new zC;let XTe;function YTe(){return XTe}class QTe{constructor(e,t,i,n){this.items=e,this.needsClipboard=t,this.durations=i,this.disposable=n}}async function P4(s,e,t,i=zC.default,n={triggerKind:0},o=dt.None){const r=new Jn;t=t.clone();const a=e.getWordAtPosition(t),l=a?new x(t.lineNumber,a.startColumn,t.lineNumber,a.endColumn):x.fromPositions(t),d={replace:l,insert:l.setEndPosition(t.lineNumber,t.column)},c=[],u=new Y,h=[];let g=!1;const f=(_,v,b)=>{var C,w,y;let D=!1;if(!v)return D;for(const L of v.suggestions)if(!i.kindFilter.has(L.kind)){if(!i.showDeprecated&&(!((C=L==null?void 0:L.tags)===null||C===void 0)&&C.includes(1)))continue;L.range||(L.range=d),L.sortText||(L.sortText=typeof L.label=="string"?L.label:L.label.label),!g&&L.insertTextRules&&L.insertTextRules&4&&(g=Rf.guessNeedsClipboard(L.insertText)),c.push(new ZTe(t,L,v,_)),D=!0}return jL(v)&&u.add(v),h.push({providerName:(w=_._debugDisplayName)!==null&&w!==void 0?w:"unknown_provider",elapsedProvider:(y=v.duration)!==null&&y!==void 0?y:-1,elapsedOverall:b.elapsed()}),D},m=(async()=>{})();for(const _ of s.orderedGroups(e)){let v=!1;if(await Promise.all(_.map(async b=>{if(i.providerItemsToReuse.has(b)){const C=i.providerItemsToReuse.get(b);C.forEach(w=>c.push(w)),v=v||C.length>0;return}if(!(i.providerFilter.size>0&&!i.providerFilter.has(b)))try{const C=new Jn,w=await b.provideCompletionItems(e,t,n,o);v=f(b,w,C)||v}catch(C){Ai(C)}})),v||o.isCancellationRequested)break}return await m,o.isCancellationRequested?(u.dispose(),Promise.reject(new sl)):new QTe(c.sort(tNe(i.snippetSortOrder)),g,{entries:h,elapsed:r.elapsed()},u)}function F4(s,e){if(s.sortTextLow&&e.sortTextLow){if(s.sortTextLowe.sortTextLow)return 1}return s.textLabele.textLabel?1:s.completion.kind-e.completion.kind}function JTe(s,e){if(s.completion.kind!==e.completion.kind){if(s.completion.kind===27)return-1;if(e.completion.kind===27)return 1}return F4(s,e)}function eNe(s,e){if(s.completion.kind!==e.completion.kind){if(s.completion.kind===27)return 1;if(e.completion.kind===27)return-1}return F4(s,e)}const Ak=new Map;Ak.set(0,JTe);Ak.set(2,eNe);Ak.set(1,F4);function tNe(s){return Ak.get(s)}pt.registerCommand("_executeCompletionItemProvider",async(s,...e)=>{const[t,i,n,o]=e;yt(Ae.isUri(t)),yt(W.isIPosition(i)),yt(typeof n=="string"||!n),yt(typeof o=="number"||!o);const{completionProvider:r}=s.get(Ce),a=await s.get(mo).createModelReference(t);try{const l={incomplete:!1,suggestions:[]},d=[],c=a.object.textEditorModel.validatePosition(i),u=await P4(r,a.object.textEditorModel,c,void 0,{triggerCharacter:n??void 0,triggerKind:n?1:0});for(const h of u.items)d.length<(o??0)&&d.push(h.resolve(dt.None)),l.incomplete=l.incomplete||h.container.incomplete,l.suggestions.push(h.completion);try{return await Promise.all(d),l}finally{setTimeout(()=>u.disposable.dispose(),100)}}finally{a.dispose()}});function iNe(s,e){var t;(t=s.getContribution("editor.contrib.suggestController"))===null||t===void 0||t.triggerSuggest(new Set().add(e),void 0,!0)}class ym{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}}}function L9(s,e=as){return _me(s,e)?s.charAt(0).toUpperCase()+s.slice(1):s}var nNe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},sNe=function(s,e){return function(t,i){e(t,i,s)}};class x9{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 k9{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 o=this._overtypingCapturer.getLastOvertypedInfo(this._selectionIdx);o&&(i=o.value,n=o.multiline)}if(i&&n&&e.snippet){const o=this._model.getLineContent(this._selection.startLineNumber),r=Zt(o,0,this._selection.startColumn-1);let a=r;e.snippet.walk(d=>d===e?!1:(d instanceof Ts&&(a=Zt(Td(d.value).pop())),!0));const l=Sh(a,r);i=i.replace(/(\r\n|\r|\n)(.*)/g,(d,c,u)=>`${c}${a.substr(l)}${u}`)}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 E9{constructor(e,t){this._labelService=e,this._model=t}resolve(e){const{name:t}=e;if(t==="TM_FILENAME")return nh(this._model.uri.fsPath);if(t==="TM_FILENAME_BASE"){const i=nh(this._model.uri.fsPath),n=i.lastIndexOf(".");return n<=0?i:i.slice(0,n)}else{if(t==="TM_DIRECTORY")return XV(this._model.uri.fsPath)==="."?"":this._labelService.getUriLabel(Ax(this._model.uri));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 I9{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=>!sz(n));if(i.length===this._selectionCount)return i[this._selectionIdx]}return t}}}let yL=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}}};yL=nNe([sNe(2,Yt)],yL);class Za{constructor(){this._date=new Date}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 Za.dayNames[this._date.getDay()];if(t==="CURRENT_DAY_NAME_SHORT")return Za.dayNamesShort[this._date.getDay()];if(t==="CURRENT_MONTH_NAME")return Za.monthNames[this._date.getMonth()];if(t==="CURRENT_MONTH_NAME_SHORT")return Za.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?"-":"+",o=Math.trunc(Math.abs(i/60)),r=o<10?"0"+o:o,a=Math.abs(i)-o*60,l=a<10?"0"+a:a;return n+r+":"+l}}}Za.dayNames=[p("Sunday","Sunday"),p("Monday","Monday"),p("Tuesday","Tuesday"),p("Wednesday","Wednesday"),p("Thursday","Thursday"),p("Friday","Friday"),p("Saturday","Saturday")];Za.dayNamesShort=[p("SundayShort","Sun"),p("MondayShort","Mon"),p("TuesdayShort","Tue"),p("WednesdayShort","Wed"),p("ThursdayShort","Thu"),p("FridayShort","Fri"),p("SaturdayShort","Sat")];Za.monthNames=[p("January","January"),p("February","February"),p("March","March"),p("April","April"),p("May","May"),p("June","June"),p("July","July"),p("August","August"),p("September","September"),p("October","October"),p("November","November"),p("December","December")];Za.monthNamesShort=[p("JanuaryShort","Jan"),p("FebruaryShort","Feb"),p("MarchShort","Mar"),p("AprilShort","Apr"),p("MayShort","May"),p("JuneShort","Jun"),p("JulyShort","Jul"),p("AugustShort","Aug"),p("SeptemberShort","Sep"),p("OctoberShort","Oct"),p("NovemberShort","Nov"),p("DecemberShort","Dec")];class T9{constructor(e){this._workspaceService=e}resolve(e){if(!this._workspaceService)return;const t=Mbe(this._workspaceService.getWorkspace());if(!Nbe(t)){if(e.name==="WORKSPACE_NAME")return this._resolveWorkspaceName(t);if(e.name==="WORKSPACE_FOLDER")return this._resoveWorkspacePath(t)}}_resolveWorkspaceName(e){if(v2(e))return nh(e.uri.path);let t=nh(e.configPath.path);return t.endsWith(b2)&&(t=t.substr(0,t.length-b2.length-1)),t}_resoveWorkspacePath(e){if(v2(e))return L9(e.uri.fsPath);const t=nh(e.configPath.path);let i=e.configPath.fsPath;return i.endsWith(t)&&(i=i.substr(0,i.length-t.length-1)),i?L9(i):"/"}}class N9{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 pk()}}var oNe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},rNe=function(s,e){return function(t,i){e(t,i,s)}},Ma;class br{constructor(e,t,i){this._editor=e,this._snippet=t,this._snippetLineLeadingWhitespace=i,this._offset=-1,this._nestingLevel=1,this._placeholderGroups=K5(t.placeholders,yr.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),o=this._snippet.fullLen(i),r=x.fromPositions(e.getPositionAt(this._offset+n),e.getPositionAt(this._offset+n+o)),a=i.isFinalTabstop?br._decor.inactiveFinal:br._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 o of this._placeholderGroups[this._placeholderGroupsIdx])if(o.transform){const r=this._placeholderDecorations.get(o),a=this._editor.getModel().getDecorationRange(r),l=this._editor.getModel().getValueInRange(a),d=o.transform.resolve(l).split(/\r\n|\r|\n/);for(let c=1;c0&&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 o=new Set,r=[];for(const a of this._placeholderGroups[this._placeholderGroupsIdx]){const l=this._placeholderDecorations.get(a),d=this._editor.getModel().getDecorationRange(l);r.push(new we(d.startLineNumber,d.startColumn,d.endLineNumber,d.endColumn)),t=t&&this._hasPlaceholderBeenCollapsed(a),n.changeDecorationOptions(l,a.isFinalTabstop?br._decor.activeFinal:br._decor.active),o.add(a);for(const c of this._snippet.enclosingPlaceholders(a)){const u=this._placeholderDecorations.get(c);n.changeDecorationOptions(u,c.isFinalTabstop?br._decor.activeFinal:br._decor.active),o.add(c)}}for(const[a,l]of this._placeholderDecorations)o.has(a)||n.changeDecorationOptions(l,a.isFinalTabstop?br._decor.inactiveFinal:br._decor.inactive);return r});return t?this.move(e):i??[]}_hasPlaceholderBeenCollapsed(e){let t=e;for(;t;){if(t instanceof yr){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 o=this._placeholderDecorations.get(n),r=this._editor.getModel().getDecorationRange(o);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!=null&&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 w0,!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 o=e.shift();console.assert(o._offset!==-1),console.assert(!o._placeholderDecorations);const r=o._snippet.placeholderInfo.last.index;for(const l of o._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,o._snippet.children);const a=this._placeholderDecorations.get(n);i.removeDecoration(a),this._placeholderDecorations.delete(n);for(const l of o._snippet.placeholders){const d=o._snippet.offset(l),c=o._snippet.fullLen(l),u=x.fromPositions(t.getPositionAt(o._offset+d),t.getPositionAt(o._offset+d+c)),h=i.addDecoration(u,br._decor.inactive);this._placeholderDecorations.set(l,h)}}this._placeholderGroups=K5(this._snippet.placeholders,yr.compareByIndex)})}}br._decor={active:Ye.register({description:"snippet-placeholder-1",stickiness:0,className:"snippet-placeholder"}),inactive:Ye.register({description:"snippet-placeholder-2",stickiness:1,className:"snippet-placeholder"}),activeFinal:Ye.register({description:"snippet-placeholder-3",stickiness:1,className:"finish-snippet-placeholder"}),inactiveFinal:Ye.register({description:"snippet-placeholder-4",stickiness:1,className:"finish-snippet-placeholder"})};const A9={overwriteBefore:0,overwriteAfter:0,adjustWhitespace:!0,clipboardText:void 0,overtypingCapturer:void 0};let SL=Ma=class{static adjustWhitespace(e,t,i,n,o){const r=e.getLineContent(t.lineNumber),a=Zt(r,0,t.column-1);let l;return n.walk(d=>{if(!(d instanceof Ts)||d.parent instanceof w0||o&&!o.has(d))return!0;const c=d.value.split(/\r\n|\r|\n/);if(i){const h=n.offset(d);if(h===0)c[0]=e.normalizeIndentation(c[0]);else{l=l??n.toString();const g=l.charCodeAt(h-1);(g===10||g===13)&&(c[0]=e.normalizeIndentation(a+c[0]))}for(let g=1;gw.get(If)),f=e.invokeWithinContext(w=>new E9(w.get(k_),h)),m=()=>a,_=h.getValueInRange(Ma.adjustSelection(h,e.getSelection(),i,0)),v=h.getValueInRange(Ma.adjustSelection(h,e.getSelection(),0,n)),b=h.getLineFirstNonWhitespaceColumn(e.getSelection().positionLineNumber),C=e.getSelections().map((w,y)=>({selection:w,idx:y})).sort((w,y)=>x.compareRangesUsingStarts(w.selection,y.selection));for(const{selection:w,idx:y}of C){let D=Ma.adjustSelection(h,w,i,0),L=Ma.adjustSelection(h,w,0,n);_!==h.getValueInRange(D)&&(D=w),v!==h.getValueInRange(L)&&(L=w);const k=w.setStartPosition(D.startLineNumber,D.startColumn).setEndPosition(L.endLineNumber,L.endColumn),I=new Rf().parse(t,!0,o),O=k.getStartPosition(),R=Ma.adjustWhitespace(h,O,r||y>0&&b!==h.getLineFirstNonWhitespaceColumn(w.positionLineNumber),I);I.resolveVariables(new x9([f,new I9(m,y,C.length,e.getOption(79)==="spread"),new k9(h,w,y,l),new yL(h,w,d),new Za,new T9(g),new N9])),c[y]=pi.replace(k,I.toString()),c[y].identifier={major:y,minor:0},c[y]._isTracked=!0,u[y]=new br(e,I,R)}return{edits:c,snippets:u}}static createEditsAndSnippetsFromEdits(e,t,i,n,o,r,a){if(!e.hasModel()||t.length===0)return{edits:[],snippets:[]};const l=[],d=e.getModel(),c=new Rf,u=new H1,h=new x9([e.invokeWithinContext(f=>new E9(f.get(k_),d)),new I9(()=>o,0,e.getSelections().length,e.getOption(79)==="spread"),new k9(d,e.getSelection(),0,r),new yL(d,e.getSelection(),a),new Za,new T9(e.invokeWithinContext(f=>f.get(If))),new N9]);t=t.sort((f,m)=>x.compareRangesUsingStarts(f.range,m.range));let g=0;for(let f=0;f0){const y=t[f-1].range,D=x.fromPositions(y.getEndPosition(),m.getStartPosition()),L=new Ts(d.getValueInRange(D));u.appendChild(L),g+=L.value.length}const v=c.parseFragment(_,u);Ma.adjustWhitespace(d,m.getStartPosition(),!0,u,new Set(v)),u.resolveVariables(h);const b=u.toString(),C=b.slice(g);g=b.length;const w=pi.replace(m,C);w.identifier={major:f,minor:0},w._isTracked=!0,l.push(w)}return c.ensureFinalTabstop(u,i,!0),{edits:l,snippets:[new br(e,u,"")]}}constructor(e,t,i=A9,n){this._editor=e,this._template=t,this._options=i,this._languageConfigurationService=n,this._templateMerges=[],this._snippets=[]}dispose(){jt(this._snippets)}_logInfo(){return`template="${this._template}", merged_templates="${this._templateMerges.join(" -> ")}"`}insert(){if(!this._editor.hasModel())return;const{edits:e,snippets:t}=typeof this._template=="string"?Ma.createEditsAndSnippetsFromSelections(this._editor,this._template,this._options.overwriteBefore,this._options.overwriteAfter,!1,this._options.adjustWhitespace,this._options.clipboardText,this._options.overtypingCapturer,this._languageConfigurationService):Ma.createEditsAndSnippetsFromEdits(this._editor,this._template,!1,this._options.adjustWhitespace,this._options.clipboardText,this._options.overtypingCapturer,this._languageConfigurationService);this._snippets=t,this._editor.executeEdits("snippet",e,i=>{const n=i.filter(o=>!!o.identifier);for(let o=0;owe.fromPositions(o.range.getEndPosition()))}),this._editor.revealRange(this._editor.getSelections()[0])}merge(e,t=A9){if(!this._editor.hasModel())return;this._templateMerges.push([this._snippets[0]._nestingLevel,this._snippets[0]._placeholderGroupsIdx,e]);const{edits:i,snippets:n}=Ma.createEditsAndSnippetsFromSelections(this._editor,e,t.overwriteBefore,t.overwriteAfter,!0,t.adjustWhitespace,t.clipboardText,t.overtypingCapturer,this._languageConfigurationService);this._editor.executeEdits("snippet",i,o=>{const r=o.filter(l=>!!l.identifier);for(let l=0;lwe.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{o.push(...n.get(r))})}e.sort(x.compareRangesUsingStarts);for(const[i,n]of t){if(n.length!==e.length){t.delete(i);continue}n.sort(x.compareRangesUsingStarts);for(let o=0;o0}};SL=Ma=oNe([rNe(3,Yt)],SL);var aNe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},by=function(s,e){return function(t,i){e(t,i,s)}},Gp;const M9={overwriteBefore:0,overwriteAfter:0,undoStopBefore:!0,undoStopAfter:!0,adjustWhitespace:!0,clipboardText:void 0,overtypingCapturer:void 0};let jn=Gp=class{static get(e){return e.getContribution(Gp.ID)}constructor(e,t,i,n,o){this._editor=e,this._logService=t,this._languageFeaturesService=i,this._languageConfigurationService=o,this._snippetListener=new Y,this._modelVersionId=-1,this._inSnippet=Gp.InSnippetMode.bindTo(n),this._hasNextTabstop=Gp.HasNextTabstop.bindTo(n),this._hasPrevTabstop=Gp.HasPrevTabstop.bindTo(n)}dispose(){var e;this._inSnippet.reset(),this._hasPrevTabstop.reset(),this._hasNextTabstop.reset(),(e=this._session)===null||e===void 0||e.dispose(),this._snippetListener.dispose()}insert(e,t){try{this._doInsert(e,typeof t>"u"?M9:{...M9,...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){var i;if(this._editor.hasModel()){if(this._snippetListener.clear(),t.undoStopBefore&&this._editor.getModel().pushStackElement(),this._session&&typeof e!="string"&&this.cancel(),this._session?(yt(typeof e=="string"),this._session.merge(e,t)):(this._modelVersionId=this._editor.getModel().getAlternativeVersionId(),this._session=new SL(this._editor,e,t,this._languageConfigurationService),this._session.insert()),t.undoStopAfter&&this._editor.getModel().pushStackElement(),!((i=this._session)===null||i===void 0)&&i.hasChoice){const n={_debugDisplayName:"snippetChoiceCompletions",provideCompletionItems:(c,u)=>{if(!this._session||c!==this._editor.getModel()||!W.equals(this._editor.getPosition(),u))return;const{activeChoice:h}=this._session;if(!h||h.choice.options.length===0)return;const g=c.getValueInRange(h.range),f=!!h.choice.options.find(_=>_.value===g),m=[];for(let _=0;_{r==null||r.dispose(),a=!1},d=()=>{a||(r=this._languageFeaturesService.completionProvider.register({language:o.getLanguageId(),pattern:o.uri.fsPath,scheme:o.uri.scheme,exclusive:!0},n),this._snippetListener.add(r),a=!0)};this._choiceCompletions={provider:n,enable:d,disable:l}}this._updateState(),this._snippetListener.add(this._editor.onDidChangeModelContent(n=>n.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._hasPrevTabstop.set(!this._session.isAtFirstPlaceholder),this._hasNextTabstop.set(!this._session.isAtLastPlaceholder),this._handleChoice()}}_handleChoice(){var e;if(!this._session||!this._editor.hasModel()){this._currentChoice=void 0;return}const{activeChoice:t}=this._session;if(!t||!this._choiceCompletions){(e=this._choiceCompletions)===null||e===void 0||e.disable(),this._currentChoice=void 0;return}this._currentChoice!==t.choice&&(this._currentChoice=t.choice,this._choiceCompletions.enable(),queueMicrotask(()=>{iNe(this._editor,this._choiceCompletions.provider)}))}finish(){for(;this._inSnippet.get();)this.next()}cancel(e=!1){var t;this._inSnippet.reset(),this._hasPrevTabstop.reset(),this._hasNextTabstop.reset(),this._snippetListener.clear(),this._currentChoice=void 0,(t=this._session)===null||t===void 0||t.dispose(),this._session=void 0,this._modelVersionId=-1,e&&this._editor.setSelections([this._editor.getSelection()])}prev(){var e;(e=this._session)===null||e===void 0||e.prev(),this._updateState()}next(){var e;(e=this._session)===null||e===void 0||e.next(),this._updateState()}isInSnippet(){return!!this._inSnippet.get()}};jn.ID="snippetController2";jn.InSnippetMode=new ue("inSnippetMode",!1,p("inSnippetMode","Whether the editor in current in snippet mode"));jn.HasNextTabstop=new ue("hasNextTabstop",!1,p("hasNextTabstop","Whether there is a next tab stop when in snippet mode"));jn.HasPrevTabstop=new ue("hasPrevTabstop",!1,p("hasPrevTabstop","Whether there is a previous tab stop when in snippet mode"));jn=Gp=aNe([by(1,ys),by(2,Ce),by(3,Be),by(4,Yt)],jn);kt(jn.ID,jn,4);const Mk=mn.bindToContribution(jn.get);de(new Mk({id:"jumpToNextSnippetPlaceholder",precondition:G.and(jn.InSnippetMode,jn.HasNextTabstop),handler:s=>s.next(),kbOpts:{weight:130,kbExpr:T.textInputFocus,primary:2}}));de(new Mk({id:"jumpToPrevSnippetPlaceholder",precondition:G.and(jn.InSnippetMode,jn.HasPrevTabstop),handler:s=>s.prev(),kbOpts:{weight:130,kbExpr:T.textInputFocus,primary:1026}}));de(new Mk({id:"leaveSnippet",precondition:jn.InSnippetMode,handler:s=>s.cancel(!0),kbOpts:{weight:130,kbExpr:T.textInputFocus,primary:9,secondary:[1033]}}));de(new Mk({id:"acceptSnippet",precondition:jn.InSnippetMode,handler:s=>s.finish()}));var lNe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},mT=function(s,e){return function(t,i){e(t,i,s)}},$o;(function(s){s[s.Undo=0]="Undo",s[s.Redo=1]="Redo",s[s.AcceptWord=2]="AcceptWord",s[s.Other=3]="Other"})($o||($o={}));let _R=class extends H{get isAcceptingPartially(){return this._isAcceptingPartially}constructor(e,t,i,n,o,r,a,l,d,c,u,h){super(),this.textModel=e,this.selectedSuggestItem=t,this.textModelVersionId=i,this._positions=n,this._debounceValue=o,this._suggestPreviewEnabled=r,this._suggestPreviewMode=a,this._inlineSuggestMode=l,this._enabled=d,this._instantiationService=c,this._commandService=u,this._languageConfigurationService=h,this._source=this._register(this._instantiationService.createInstance(mR,this.textModel,this.textModelVersionId,this._debounceValue)),this._isActive=vt(this,!1),this._forceUpdateExplicitlySignal=Zx(this),this._selectedInlineCompletionId=vt(this,void 0),this._primaryPosition=je(this,f=>{var m;return(m=this._positions.read(f)[0])!==null&&m!==void 0?m:new W(1,1)}),this._isAcceptingPartially=!1,this._preserveCurrentCompletionReasons=new Set([$o.Redo,$o.Undo,$o.AcceptWord]),this._fetchInlineCompletionsPromise=_Ce({owner:this,createEmptyChangeSummary:()=>({preserveCurrentCompletion:!1,inlineCompletionTriggerKind:kc.Automatic}),handleChange:(f,m)=>(f.didChange(this.textModelVersionId)&&this._preserveCurrentCompletionReasons.has(f.change)?m.preserveCurrentCompletion=!0:f.didChange(this._forceUpdateExplicitlySignal)&&(m.inlineCompletionTriggerKind=kc.Explicit),!0)},(f,m)=>{if(this._forceUpdateExplicitlySignal.read(f),!(this._enabled.read(f)&&this.selectedSuggestItem.read(f)||this._isActive.read(f))){this._source.cancelUpdate();return}this.textModelVersionId.read(f);const v=this._source.suggestWidgetInlineCompletions.get(),b=this.selectedSuggestItem.read(f);if(v&&!b){const L=this._source.inlineCompletions.get();$t(k=>{(!L||v.request.versionId>L.request.versionId)&&this._source.inlineCompletions.set(v.clone(),k),this._source.clearSuggestWidgetInlineCompletions(k)})}const C=this._primaryPosition.read(f),w={triggerKind:m.inlineCompletionTriggerKind,selectedSuggestionInfo:b==null?void 0:b.toSelectedSuggestionInfo()},y=this.selectedInlineCompletion.get(),D=m.preserveCurrentCompletion||y!=null&&y.forwardStable?y:void 0;return this._source.fetch(C,w,D)}),this._filteredInlineCompletionItems=dc({owner:this,equalsFn:y2()},f=>{const m=this._source.inlineCompletions.read(f);if(!m)return[];const _=this._primaryPosition.read(f);return m.inlineCompletions.filter(b=>b.isVisible(this.textModel,_,f))}),this.selectedInlineCompletionIndex=je(this,f=>{const m=this._selectedInlineCompletionId.read(f),_=this._filteredInlineCompletionItems.read(f),v=this._selectedInlineCompletionId===void 0?-1:_.findIndex(b=>b.semanticId===m);return v===-1?(this._selectedInlineCompletionId.set(void 0,void 0),0):v}),this.selectedInlineCompletion=je(this,f=>{const m=this._filteredInlineCompletionItems.read(f),_=this.selectedInlineCompletionIndex.read(f);return m[_]}),this.activeCommands=dc({owner:this,equalsFn:y2()},f=>{var m,_;return(_=(m=this.selectedInlineCompletion.read(f))===null||m===void 0?void 0:m.inlineCompletion.source.inlineCompletions.commands)!==null&&_!==void 0?_:[]}),this.lastTriggerKind=this._source.inlineCompletions.map(this,f=>f==null?void 0:f.request.context.triggerKind),this.inlineCompletionsCount=je(this,f=>{if(this.lastTriggerKind.read(f)===kc.Explicit)return this._filteredInlineCompletionItems.read(f).length}),this.state=dc({owner:this,equalsFn:(f,m)=>!f||!m?f===m:p9(f.ghostTexts,m.ghostTexts)&&f.inlineCompletion===m.inlineCompletion&&f.suggestItem===m.suggestItem},f=>{var m,_;const v=this.textModel,b=this.selectedSuggestItem.read(f);if(b){const C=pf(b.toSingleTextEdit(),v),w=this._computeAugmentation(C,f);if(!this._suggestPreviewEnabled.read(f)&&!w)return;const D=(m=w==null?void 0:w.edit)!==null&&m!==void 0?m:C,L=w?w.edit.text.length-C.text.length:0,k=this._suggestPreviewMode.read(f),I=this._positions.read(f),O=[D,..._T(this.textModel,I,D)],R=O.map((F,V)=>C9(F,v,k,I[V],L)).filter(rd),P=(_=R[0])!==null&&_!==void 0?_:new VC(D.range.endLineNumber,[]);return{edits:O,primaryGhostText:P,ghostTexts:R,inlineCompletion:w==null?void 0:w.completion,suggestItem:b}}else{if(!this._isActive.read(f))return;const C=this.selectedInlineCompletion.read(f);if(!C)return;const w=C.toSingleTextEdit(f),y=this._inlineSuggestMode.read(f),D=this._positions.read(f),L=[w,..._T(this.textModel,D,w)],k=L.map((I,O)=>C9(I,v,y,D[O],0)).filter(rd);return k[0]?{edits:L,primaryGhostText:k[0],ghostTexts:k,inlineCompletion:C,suggestItem:void 0}:void 0}}),this.ghostTexts=dc({owner:this,equalsFn:p9},f=>{const m=this.state.read(f);if(m)return m.ghostTexts}),this.primaryGhostText=dc({owner:this,equalsFn:CG},f=>{const m=this.state.read(f);if(m)return m==null?void 0:m.primaryGhostText}),this._register(T1(this._fetchInlineCompletionsPromise));let g;this._register(st(f=>{var m,_;const v=this.state.read(f),b=v==null?void 0:v.inlineCompletion;if((b==null?void 0:b.semanticId)!==(g==null?void 0:g.semanticId)&&(g=b,b)){const C=b.inlineCompletion,w=C.source;(_=(m=w.provider).handleItemDidShow)===null||_===void 0||_.call(m,w.inlineCompletions,C.sourceInlineCompletion,C.insertText)}}))}async trigger(e){this._isActive.set(!0,e),await this._fetchInlineCompletionsPromise.get()}async triggerExplicitly(e){hC(e,t=>{this._isActive.set(!0,t),this._forceUpdateExplicitlySignal.trigger(t)}),await this._fetchInlineCompletionsPromise.get()}stop(e){hC(e,t=>{this._isActive.set(!1,t),this._source.clear(t)})}_computeAugmentation(e,t){const i=this.textModel,n=this._source.suggestWidgetInlineCompletions.read(t),o=n?n.inlineCompletions:[this.selectedInlineCompletion.read(t)].filter(rd);return ice(o,a=>{let l=a.toSingleTextEdit(t);return l=pf(l,i,x.fromPositions(l.range.getStartPosition(),e.range.getEndPosition())),DG(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)}async accept(e){var t;if(e.getModel()!==this.textModel)throw new Ut;const i=this.state.get();if(!i||i.primaryGhostText.isEmpty()||!i.inlineCompletion)return;const n=i.inlineCompletion.toInlineCompletion(void 0);if(e.pushUndoStop(),n.snippetInfo)e.executeEdits("inlineSuggestion.accept",[pi.replace(n.range,""),...n.additionalTextEdits]),e.setPosition(n.snippetInfo.range.getStartPosition(),"inlineCompletionAccept"),(t=jn.get(e))===null||t===void 0||t.insert(n.snippetInfo.snippet,{undoStopBefore:!1});else{const o=i.edits,r=R9(o).map(a=>we.fromPositions(a));e.executeEdits("inlineSuggestion.accept",[...o.map(a=>pi.replace(a.range,a.text)),...n.additionalTextEdits]),e.setSelections(r,"inlineCompletionAccept")}n.command&&n.source.addRef(),$t(o=>{this._source.clear(o),this._isActive.set(!1,o)}),n.command&&(await this._commandService.executeCommand(n.command.id,...n.command.arguments||[]).then(void 0,Ai),n.source.removeRef())}async acceptNextWord(e){await this._acceptNext(e,(t,i)=>{const n=this.textModel.getLanguageIdAtPosition(t.lineNumber,t.column),o=this._languageConfigurationService.getLanguageConfiguration(n),r=new RegExp(o.wordDefinition.source,o.wordDefinition.flags.replace("g","")),a=i.match(r);let l=0;a&&a.index!==void 0?a.index===0?l=a[0].length:l=a.index:l=i.length;const c=/\s+/g.exec(i);return c&&c.index!==void 0&&c.index+c[0].length{const n=i.match(/\n/);return n&&n.index!==void 0?n.index+1:i.length},1)}async _acceptNext(e,t,i){if(e.getModel()!==this.textModel)throw new Ut;const n=this.state.get();if(!n||n.primaryGhostText.isEmpty()||!n.inlineCompletion)return;const o=n.primaryGhostText,r=n.inlineCompletion.toInlineCompletion(void 0);if(r.snippetInfo||r.filterText!==r.insertText){await this.accept(e);return}const a=o.parts[0],l=new W(o.lineNumber,a.column),d=a.text,c=t(l,d);if(c===d.length&&o.parts.length===1){this.accept(e);return}const u=d.substring(0,c),h=this._positions.get(),g=h[0];r.source.addRef();try{this._isAcceptingPartially=!0;try{e.pushUndoStop();const f=x.fromPositions(g,l),m=e.getModel().getValueInRange(f)+u,_=new zc(f,m),v=[_,..._T(this.textModel,h,_)],b=R9(v).map(C=>we.fromPositions(C));e.executeEdits("inlineSuggestion.accept",v.map(C=>pi.replace(C.range,C.text))),e.setSelections(b,"inlineCompletionPartialAccept")}finally{this._isAcceptingPartially=!1}if(r.source.provider.handlePartialAccept){const f=x.fromPositions(r.range.getStartPosition(),Fs.ofText(u).addToPosition(l)),m=e.getModel().getValueInRange(f,1);r.source.provider.handlePartialAccept(r.source.inlineCompletions,r.sourceInlineCompletion,m.length,{kind:i})}}finally{r.source.removeRef()}}handleSuggestAccepted(e){var t,i;const n=pf(e.toSingleTextEdit(),this.textModel),o=this._computeAugmentation(n,void 0);if(!o)return;const r=o.completion.inlineCompletion;(i=(t=r.source.provider).handlePartialAccept)===null||i===void 0||i.call(t,r.source.inlineCompletions,r.sourceInlineCompletion,n.text.length,{kind:2})}};_R=lNe([mT(9,Ne),mT(10,gi),mT(11,Yt)],_R);function _T(s,e,t){if(e.length===1)return[];const i=e[0],n=e.slice(1),o=t.range.getStartPosition(),r=t.range.getEndPosition(),a=s.getValueInRange(x.fromPositions(i,r)),l=m9(i,o);if(l.lineNumber<1)return Xe(new Ut(`positionWithinTextEdit line number should be bigger than 0. Invalid subtraction between ${i.toString()} and ${o.toString()}`)),[];const d=dNe(t.text,l);return n.map(c=>{const u=ATe(m9(c,o),r),h=s.getValueInRange(x.fromPositions(c,u)),g=Sh(a,h),f=x.fromPositions(c,c.delta(0,g));return new zc(f,d)})}function dNe(s,e){let t="";const i=Tre(s);for(let n=e.lineNumber-1;nx.compareRangesUsingStarts(o.range,r.range)),i=new yF(e.apply(s)).getNewRanges();return e.inverse().apply(i).map(o=>o.getEndPosition())}var cNe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},P9=function(s,e){return function(t,i){e(t,i,s)}},Nv;class O4{constructor(e){this.name=e}select(e,t,i){if(i.length===0)return 0;const n=i[0].score[0];for(let o=0;ol&&u.type===i[d].completion.kind&&u.insertText===i[d].completion.insertText&&(l=u.touch,a=d),i[d].completion.preselect&&r===-1)return r=d}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:Tb.fromString(n.type),this._cache.set(i,n);this._seq=this._cache.size}}class hNe extends O4{constructor(){super("recentlyUsedByPrefix"),this._trie=$m.forStrings(),this._seq=0}memorize(e,t,i){const{word:n}=e.getWordUntilPosition(t),o=`${e.getLanguageId()}/${n}`;this._trie.set(o,{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 o=`${e.getLanguageId()}/${n}`;let r=this._trie.get(o);if(r||(r=this._trie.findSubstr(o)),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:Tb.fromString(i.type),this._trie.set(t,i)}}}let UC=Nv=class{constructor(e,t){this._storageService=e,this._configService=t,this._disposables=new Y,this._persistSoon=new Wt(()=>this._saveState(),500),this._disposables.add(e.onWillSaveState(i=>{i.reason===ED.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){var i;const n=this._configService.getValue("editor.suggestSelection",{overrideIdentifier:e.getLanguageIdAtPosition(t.lineNumber,t.column),resource:e.uri});if(((i=this._strategy)===null||i===void 0?void 0:i.name)!==n){this._saveState();const o=Nv._strategyCtors.get(n)||LG;this._strategy=new o;try{const a=this._configService.getValue("editor.suggest.shareSuggestSelections")?0:1,l=this._storageService.get(`${Nv._storagePrefix}/${n}`,a);l&&this._strategy.fromJSON(JSON.parse(l))}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(`${Nv._storagePrefix}/${this._strategy.name}`,i,t,1)}}};UC._strategyCtors=new Map([["recentlyUsedByPrefix",hNe],["recentlyUsed",uNe],["first",LG]]);UC._storagePrefix="suggest/memories";UC=Nv=cNe([P9(0,Rd),P9(1,rt)],UC);const Rk=ut("ISuggestMemories");mt(Rk,UC,1);var gNe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},fNe=function(s,e){return function(t,i){e(t,i,s)}},vR;let $C=vR=class{constructor(e,t){this._editor=e,this._enabled=!1,this._ckAtEnd=vR.AtEnd.bindTo(t),this._configListener=this._editor.onDidChangeConfiguration(i=>i.hasChanged(123)&&this._update()),this._update()}dispose(){var e;this._configListener.dispose(),(e=this._selectionListener)===null||e===void 0||e.dispose(),this._ckAtEnd.reset()}_update(){const e=this._editor.getOption(123)==="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(),o=i.getWordAtPosition(n.getStartPosition());if(!o){this._ckAtEnd.set(!1);return}this._ckAtEnd.set(o.endColumn===n.getStartPosition().column)};this._selectionListener=this._editor.onDidChangeCursorSelection(t),t()}else this._selectionListener&&(this._ckAtEnd.reset(),this._selectionListener.dispose(),this._selectionListener=void 0)}};$C.AtEnd=new ue("atEndOfWord",!1);$C=vR=gNe([fNe(1,Be)],$C);var pNe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},mNe=function(s,e){return function(t,i){e(t,i,s)}},Av;let zf=Av=class{constructor(e,t){this._editor=e,this._index=0,this._ckOtherSuggestions=Av.OtherSuggestions.bindTo(t)}dispose(){this.reset()}reset(){var e;this._ckOtherSuggestions.reset(),(e=this._listener)===null||e===void 0||e.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(Av._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 o=t.items.length;o>0&&(n=(n+t.items.length+(e?1:-1))%t.items.length,!(n===i||!t.items[n].completion.additionalTextEdits));o--);return n}next(){this._move(!0)}prev(){this._move(!1)}_move(e){if(this._model)try{this._ignore=!0,this._index=Av._moveIndex(e,this._model,this._index),this._acceptNext({index:this._index,item:this._model.items[this._index],model:this._model})}finally{this._ignore=!1}}};zf.OtherSuggestions=new ue("hasOtherSuggestions",!1);zf=Av=pNe([mNe(1,Be)],zf);class _Ne{constructor(e,t,i,n){this._disposables=new Y,this._disposables.add(i.onDidSuggest(o=>{o.completionModel.items.length===0&&this.reset()})),this._disposables.add(i.onDidCancel(o=>{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(o=>{if(this._active&&!t.isFrozen()&&i.state!==0){const r=o.charCodeAt(o.length-1);this._active.acceptCharacters.has(r)&&e.getOption(0)&&n(this._active.item)}}))}_onItem(e){if(!e||!rs(e.item.completion.commitCharacters)){this.reset();return}if(this._active&&this._active.item.item===e.item)return;const t=new ZS;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 jo{async provideSelectionRanges(e,t){const i=[];for(const n of t){const o=[];i.push(o);const r=new Map;await new Promise(a=>jo._bracketsRightYield(a,0,e,n,r)),await new Promise(a=>jo._bracketsLeftYield(a,0,e,n,r,o))}return i}static _bracketsRightYield(e,t,i,n,o){const r=new Map,a=Date.now();for(;;){if(t>=jo._maxRounds){e();break}if(!n){e();break}const l=i.bracketPairs.findNextBracket(n);if(!l){e();break}if(Date.now()-a>jo._maxDuration){setTimeout(()=>jo._bracketsRightYield(e,t+1,i,n,o));break}if(l.bracketInfo.isOpeningBracket){const c=l.bracketInfo.bracketText,u=r.has(c)?r.get(c):0;r.set(c,u+1)}else{const c=l.bracketInfo.getOpeningBrackets()[0].bracketText;let u=r.has(c)?r.get(c):0;if(u-=1,r.set(c,Math.max(0,u)),u<0){let h=o.get(c);h||(h=new Rs,o.set(c,h)),h.push(l.range)}}n=l.range.getEndPosition()}}static _bracketsLeftYield(e,t,i,n,o,r){const a=new Map,l=Date.now();for(;;){if(t>=jo._maxRounds&&o.size===0){e();break}if(!n){e();break}const d=i.bracketPairs.findPrevBracket(n);if(!d){e();break}if(Date.now()-l>jo._maxDuration){setTimeout(()=>jo._bracketsLeftYield(e,t+1,i,n,o,r));break}if(d.bracketInfo.isOpeningBracket){const u=d.bracketInfo.bracketText;let h=a.has(u)?a.get(u):0;if(h-=1,a.set(u,Math.max(0,h)),h<0){const g=o.get(u);if(g){const f=g.shift();g.size===0&&o.delete(u);const m=x.fromPositions(d.range.getEndPosition(),f.getStartPosition()),_=x.fromPositions(d.range.getStartPosition(),f.getEndPosition());r.push({range:m}),r.push({range:_}),jo._addBracketLeading(i,_,r)}}}else{const u=d.bracketInfo.getOpeningBrackets()[0].bracketText,h=a.has(u)?a.get(u):0;a.set(u,h+1)}n=d.range.getStartPosition()}}static _addBracketLeading(e,t,i){if(t.startLineNumber===t.endLineNumber)return;const n=t.startLineNumber,o=e.getLineFirstNonWhitespaceColumn(n);o!==0&&o!==t.startColumn&&(i.push({range:x.fromPositions(new W(n,o),t.getEndPosition())}),i.push({range:x.fromPositions(new W(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:x.fromPositions(new W(r,a),t.getEndPosition())}),i.push({range:x.fromPositions(new W(r,1),t.getEndPosition())}))}}}jo._maxDuration=30;jo._maxRounds=2;class Ua{static async create(e,t){if(!t.getOption(118).localityBonus||!t.hasModel())return Ua.None;const i=t.getModel(),n=t.getPosition();if(!e.canComputeWordRanges(i.uri))return Ua.None;const[o]=await new jo().provideSelectionRanges(i,[n]);if(o.length===0)return Ua.None;const r=await e.computeWordRanges(i.uri,o[0].range);if(!r)return Ua.None;const a=i.getWordUntilPosition(n);return delete r[a.word],new class extends Ua{distance(l,d){if(!n.equals(t.getPosition()))return 0;if(d.kind===17)return 2<<20;const c=typeof d.label=="string"?d.label:d.label.label,u=r[c];if(LV(u))return 2<<20;const h=xb(u,x.fromPositions(l),x.compareRangesUsingStarts),g=h>=0?u[h]:u[Math.max(0,~h-1)];let f=o.length;for(const m of o){if(!x.containsRange(m.range,g))break;f-=1}return f}}}}Ua.None=new class extends Ua{distance(){return 0}};let F9=class{constructor(e,t){this.leadingLineContent=e,this.characterCountDelta=t}};class Pu{constructor(e,t,i,n,o,r,a=Wx.default,l=void 0){this.clipboardText=l,this._snippetCompareFn=Pu._compareCompletionItems,this._items=e,this._column=t,this._wordDistance=n,this._options=o,this._refilterKind=1,this._lineContext=i,this._fuzzyScoreOptions=a,r==="top"?this._snippetCompareFn=Pu._compareCompletionItemsSnippetsUp:r==="bottom"&&(this._snippetCompareFn=Pu._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="",o="";const r=this._refilterKind===1?this._items:this._filteredItems,a=[],l=!this._options.filterGraceful||r.length>2e3?D_:Cve;for(let d=0;d=g)c.score=el.Default;else if(typeof c.completion.filterText=="string"){const m=l(n,o,f,c.completion.filterText,c.filterTextLow,0,this._fuzzyScoreOptions);if(!m)continue;YN(c.completion.filterText,c.textLabel)===0?c.score=m:(c.score=mve(n,o,f,c.textLabel,c.labelLow,0),c.score[0]=m[0])}else{const m=l(n,o,f,c.textLabel,c.labelLow,0,this._fuzzyScoreOptions);if(!m)continue;c.score=m}}c.idx=d,c.distance=this._wordDistance.distance(c.position,c.completion),a.push(c),e.push(c.textLabel.length)}this._filteredItems=a.sort(this._snippetCompareFn),this._refilterKind=0,this._stats={pLabelLen:e.length?KT(e.length-.85,e,(d,c)=>d-c):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===27)return 1;if(t.completion.kind===27)return-1}return Pu._compareCompletionItems(e,t)}static _compareCompletionItemsSnippetsUp(e,t){if(e.completion.kind!==t.completion.kind){if(e.completion.kind===27)return-1;if(t.completion.kind===27)return 1}return Pu._compareCompletionItems(e,t)}}var vNe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},_u=function(s,e){return function(t,i){e(t,i,s)}},bR;class xg{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 bNe(s,e,t){if(!e.getContextKeyValue(Mn.inlineSuggestionVisible.key))return!0;const i=e.getContextKeyValue(Mn.suppressSuggestions.key);return i!==void 0?!i:!s.getOption(62).suppressSuggestions}function CNe(s,e,t){if(!e.getContextKeyValue("inlineSuggestionVisible"))return!0;const i=e.getContextKeyValue(Mn.suppressSuggestions.key);return i!==void 0?!i:!s.getOption(62).suppressSuggestions}let DL=bR=class{constructor(e,t,i,n,o,r,a,l,d){this._editor=e,this._editorWorkerService=t,this._clipboardService=i,this._telemetryService=n,this._logService=o,this._contextKeyService=r,this._configurationService=a,this._languageFeaturesService=l,this._envService=d,this._toDispose=new Y,this._triggerCharacterListener=new Y,this._triggerQuickSuggest=new ya,this._triggerState=void 0,this._completionDisposables=new Y,this._onDidCancel=new B,this._onDidTrigger=new B,this._onDidSuggest=new B,this.onDidCancel=this._onDidCancel.event,this.onDidTrigger=this._onDidTrigger.event,this.onDidSuggest=this._onDidSuggest.event,this._telemetryGate=0,this._currentSelection=this._editor.getSelection()||new we(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 c=!1;this._toDispose.add(this._editor.onDidCompositionStart(()=>{c=!0})),this._toDispose.add(this._editor.onDidCompositionEnd(()=>{c=!1,this._onCompositionEnd()})),this._toDispose.add(this._editor.onDidChangeCursorSelection(u=>{c||this._onCursorChange(u)})),this._toDispose.add(this._editor.onDidChangeModelContent(()=>{!c&&this._triggerState!==void 0&&this._refilterCompletionItems()})),this._updateTriggerCharacters()}dispose(){jt(this._triggerCharacterListener),jt([this._onDidCancel,this._onDidSuggest,this._onDidTrigger,this._triggerQuickSuggest]),this._toDispose.dispose(),this._completionDisposables.dispose(),this.cancel()}_updateTriggerCharacters(){if(this._triggerCharacterListener.clear(),this._editor.getOption(91)||!this._editor.hasModel()||!this._editor.getOption(121))return;const e=new Map;for(const i of this._languageFeaturesService.completionProvider.all(this._editor.getModel()))for(const n of i.triggerCharacters||[]){let o=e.get(n);o||(o=new Set,o.add(YTe()),e.set(n,o)),o.add(i)}const t=i=>{var n;if(!CNe(this._editor,this._contextKeyService,this._configurationService)||xg.shouldAutoTrigger(this._editor))return;if(!i){const a=this._editor.getPosition();i=this._editor.getModel().getLineContent(a.lineNumber).substr(0,a.column-1)}let o="";Cf(i.charCodeAt(i.length-1))?Cn(i.charCodeAt(i.length-2))&&(o=i.substr(i.length-2)):o=i.charAt(i.length-1);const r=e.get(o);if(r){const a=new Map;if(this._completionModel)for(const[l,d]of this._completionModel.getItemsByProvider())r.has(l)||a.set(l,d);this.trigger({auto:!0,triggerKind:1,triggerCharacter:o,retrigger:!!this._completionModel,clipboardText:(n=this._completionModel)===null||n===void 0?void 0:n.clipboardText,completionOptions:{providerFilter:r,providerItemsToReuse:a}})}};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){var t;this._triggerState!==void 0&&(this._triggerQuickSuggest.cancel(),(t=this._requestToken)===null||t===void 0||t.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(){var e;ym.isAllOff(this._editor.getOption(89))||this._editor.getOption(118).snippetsPreventQuickSuggestions&&(!((e=jn.get(this._editor))===null||e===void 0)&&e.isInSnippet())||(this.cancel(),this._triggerQuickSuggest.cancelAndSet(()=>{if(this._triggerState!==void 0||!xg.shouldAutoTrigger(this._editor)||!this._editor.hasModel()||!this._editor.hasWidgetFocus())return;const t=this._editor.getModel(),i=this._editor.getPosition(),n=this._editor.getOption(89);if(!ym.isAllOff(n)){if(!ym.isAllOn(n)){t.tokenization.tokenizeIfCheap(i.lineNumber);const o=t.tokenization.getLineTokens(i.lineNumber),r=o.getStandardTokenType(o.findTokenIndexAtOffset(Math.max(i.column-1-1,0)));if(ym.valueFor(n,r)!=="on")return}bNe(this._editor,this._contextKeyService,this._configurationService)&&this._languageFeaturesService.completionProvider.has(t)&&this.trigger({auto:!0})}},this._editor.getOption(90)))}_refilterCompletionItems(){yt(this._editor.hasModel()),yt(this._triggerState!==void 0);const e=this._editor.getModel(),t=this._editor.getPosition(),i=new xg(e,t,{...this._triggerState,refilter:!0});this._onNewContext(i)}trigger(e){var t,i,n,o,r,a;if(!this._editor.hasModel())return;const l=this._editor.getModel(),d=new xg(l,this._editor.getPosition(),e);this.cancel(e.retrigger),this._triggerState=e,this._onDidTrigger.fire({auto:e.auto,shy:(t=e.shy)!==null&&t!==void 0?t:!1,position:this._editor.getPosition()}),this._context=d;let c={triggerKind:(i=e.triggerKind)!==null&&i!==void 0?i:0};e.triggerCharacter&&(c={triggerKind:1,triggerCharacter:e.triggerCharacter}),this._requestToken=new Vi;const u=this._editor.getOption(112);let h=1;switch(u){case"top":h=0;break;case"bottom":h=2;break}const{itemKind:g,showDeprecated:f}=bR.createSuggestFilter(this._editor),m=new zC(h,(o=(n=e.completionOptions)===null||n===void 0?void 0:n.kindFilter)!==null&&o!==void 0?o:g,(r=e.completionOptions)===null||r===void 0?void 0:r.providerFilter,(a=e.completionOptions)===null||a===void 0?void 0:a.providerItemsToReuse,f),_=Ua.create(this._editorWorkerService,this._editor),v=P4(this._languageFeaturesService.completionProvider,l,this._editor.getPosition(),m,c,this._requestToken.token);Promise.all([v,_]).then(async([b,C])=>{var w;if((w=this._requestToken)===null||w===void 0||w.dispose(),!this._editor.hasModel())return;let y=e==null?void 0:e.clipboardText;if(!y&&b.needsClipboard&&(y=await this._clipboardService.readText()),this._triggerState===void 0)return;const D=this._editor.getModel(),L=new xg(D,this._editor.getPosition(),e),k={...Wx.default,firstMatchCanBeWeak:!this._editor.getOption(118).matchOnWordStartOnly};if(this._completionModel=new Pu(b.items,this._context.column,{leadingLineContent:L.leadingLineContent,characterCountDelta:L.column-this._context.column},C,this._editor.getOption(118),this._editor.getOption(112),k,y),this._completionDisposables.add(b.disposable),this._onNewContext(L),this._reportDurationsTelemetry(b.durations),!this._envService.isBuilt||this._envService.isExtensionDevelopment)for(const I of b.items)I.isInvalid&&this._logService.warn(`[suggest] did IGNORE invalid completion item from ${I.provider._debugDisplayName}`,I.completion)}).catch(Xe)}_reportDurationsTelemetry(e){this._telemetryGate++%230===0&&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(112)==="none"&&t.add(27);const n=e.getOption(118);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(27),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(Zt(e.leadingLineContent)!==Zt(this._context.leadingLineContent)){this.cancel();return}if(e.columnthis._context.leadingWord.startColumn){if(xg.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,o]of this._completionModel.getItemsByProvider())o.length>0&&o[0].container.incomplete?i.add(n):t.set(n,o);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=xg.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})}}}}};DL=bR=vNe([_u(1,jr),_u(2,ru),_u(3,Gs),_u(4,ys),_u(5,Be),_u(6,rt),_u(7,Ce),_u(8,cO)],DL);class Pk{constructor(e,t){this._disposables=new Y,this._lastOvertyped=[],this._locked=!1,this._disposables.add(e.onWillType(()=>{if(this._locked||!e.hasModel())return;const i=e.getSelections(),n=i.length;let o=!1;for(let a=0;aPk._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=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},vT=function(s,e){return function(t,i){e(t,i,s)}};let yNe=class xG extends Fh{updateLabel(){const e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService);if(!e)return super.updateLabel();this.label&&(this.label.textContent=p({},"{0} ({1})",this._action.label,xG.symbolPrintEnter(e)))}static symbolPrintEnter(e){var t;return(t=e.getLabel())===null||t===void 0?void 0:t.replace(/\benter\b/gi,"⏎")}},CR=class{constructor(e,t,i,n,o){this._menuId=t,this._menuService=n,this._contextKeyService=o,this._menuDisposables=new Y,this.element=Q(e,he(".suggest-status-bar"));const r=a=>a instanceof Io?i.createInstance(yNe,a,void 0):void 0;this._leftActions=new Vr(this.element,{actionViewItemProvider:r}),this._rightActions=new Vr(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[o,r]of e.getActions())o==="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()}};CR=wNe([vT(2,Ne),vT(3,hr),vT(4,Be)],CR);var SNe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},DNe=function(s,e){return function(t,i){e(t,i,s)}};function B4(s){return!!s&&!!(s.completion.documentation||s.completion.detail&&s.completion.detail!==s.completion.label)}let wR=class{constructor(e,t){this._editor=e,this._onDidClose=new B,this.onDidClose=this._onDidClose.event,this._onDidChangeContents=new B,this.onDidChangeContents=this._onDidChangeContents.event,this._disposables=new Y,this._renderDisposeable=new Y,this._borderWidth=1,this._size=new Dt(330,0),this.domNode=he(".suggest-details"),this.domNode.classList.add("no-docs"),this._markdownRenderer=t.createInstance(yd,{editor:e}),this._body=he(".body"),this._scrollbar=new C1(this._body,{alwaysConsumeMouseWheel:!0}),Q(this.domNode,this._scrollbar.getDomNode()),this._disposables.add(this._scrollbar),this._header=Q(this._body,he(".header")),this._close=Q(this._header,he("span"+Pe.asCSSSelector(oe.close))),this._close.title=p("details.close","Close"),this._type=Q(this._header,he("p.type")),this._docs=Q(this._body,he("p.docs")),this._configureFont(),this._disposables.add(this._editor.onDidChangeConfiguration(i=>{i.hasChanged(50)&&this._configureFont()}))}dispose(){this._disposables.dispose(),this._renderDisposeable.dispose()}_configureFont(){const e=this._editor.getOptions(),t=e.get(50),i=t.getMassagedFontFamily(),n=e.get(119)||t.fontSize,o=e.get(120)||t.lineHeight,r=t.fontWeight,a=`${n}px`,l=`${o}px`;this.domNode.style.fontSize=a,this.domNode.style.lineHeight=`${o/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(120)||this._editor.getOption(50).lineHeight,t=this._borderWidth,i=t*2;return{lineHeight:e,borderWidth:t,borderHeight:i,verticalPadding:22,horizontalPadding:14}}renderLoading(){this._type.textContent=p("loading","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){var i,n;this._renderDisposeable.clear();let{detail:o,documentation:r}=e.completion;if(t){let a="";a+=`score: ${e.score[0]} `,a+=`prefix: ${(i=e.word)!==null&&i!==void 0?i:"(no prefix)"} `,a+=`word: ${e.completion.filterText?e.completion.filterText+" (filterText)":e.textLabel} `,a+=`distance: ${e.distance} (localityBonus-setting) `,a+=`index: ${e.idx}, based on ${e.completion.sortText&&`sortText: "${e.completion.sortText}"`||"label"} `,a+=`commit_chars: ${(n=e.completion.commitCharacters)===null||n===void 0?void 0:n.join("")} `,r=new ss().appendCodeblock("empty",a),o=`Provider: ${e.provider._debugDisplayName}`}if(!t&&!B4(e)){this.clearContents();return}if(this.domNode.classList.remove("no-docs","no-type"),o){const a=o.length>1e5?`${o.substr(0,1e5)}…`:o;this._type.textContent=a,this._type.title=a,Do(this._type),this._type.classList.toggle("auto-wrap",!/\r?\n^\s+/gmi.test(a))}else zn(this._type),this._type.title="",Es(this._type),this.domNode.classList.add("no-type");if(zn(this._docs),typeof r=="string")this._docs.classList.remove("markdown-docs"),this._docs.textContent=r;else if(r){this._docs.classList.add("markdown-docs"),zn(this._docs);const a=this._markdownRenderer.render(r);this._docs.appendChild(a.element),this._renderDisposeable.add(a),this._renderDisposeable.add(this._markdownRenderer.onDidRenderAsync(()=>{this.layout(this._size.width,this._type.clientHeight+this._docs.clientHeight),this._onDidChangeContents.fire(this)}))}this.domNode.style.userSelect="text",this.domNode.tabIndex=-1,this._close.onmousedown=a=>{a.preventDefault(),a.stopPropagation()},this._close.onclick=a=>{a.preventDefault(),a.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 Dt(e,t);Dt.equals(i,this._size)||(this._size=i,Oae(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)}set borderWidth(e){this._borderWidth=e}get borderWidth(){return this._borderWidth}};wR=SNe([DNe(1,Ne)],wR);class LNe{constructor(e,t){this.widget=e,this._editor=t,this.allowEditorOverflow=!0,this._disposables=new Y,this._added=!1,this._preferAlignAtTop=!0,this._resizable=new C4,this._resizable.domNode.classList.add("suggest-details-container"),this._resizable.domNode.appendChild(e.domNode),this._resizable.enableSashes(!1,!0,!0,!1);let i,n,o=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&&(o=n.height-a.dimension.height,l=!0),l&&this._applyTopLeft({top:i.top+o,left:i.left+r})}a.done&&(i=void 0,n=void 0,o=0,r=0,this._userSize=a.dimension)})),this._disposables.add(this.widget.onDidChangeContents(()=>{var a;this._anchorBox&&this._placeAtAnchor(this._anchorBox,(a=this._userSize)!==null&&a!==void 0?a: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){var i;const n=e.getBoundingClientRect();this._anchorBox=n,this._preferAlignAtTop=t,this._placeAtAnchor(this._anchorBox,(i=this._userSize)!==null&&i!==void 0?i:this.widget.size,t)}_placeAtAnchor(e,t,i){var n;const o=Eh(this.getDomNode().ownerDocument.body),r=this.widget.getLayoutInfo(),a=new Dt(220,2*r.lineHeight),l=e.top,d=function(){const D=o.width-(e.left+e.width+r.borderWidth+r.horizontalPadding),L=-r.borderWidth+e.left+e.width,k=new Dt(D,o.height-e.top-r.borderHeight-r.verticalPadding),I=k.with(void 0,e.top+e.height-r.borderHeight-r.verticalPadding);return{top:l,left:L,fit:D-t.width,maxSizeTop:k,maxSizeBottom:I,minSize:a.with(Math.min(D,a.width))}}(),c=function(){const D=e.left-r.borderWidth-r.horizontalPadding,L=Math.max(r.horizontalPadding,e.left-t.width-r.borderWidth),k=new Dt(D,o.height-e.top-r.borderHeight-r.verticalPadding),I=k.with(void 0,e.top+e.height-r.borderHeight-r.verticalPadding);return{top:l,left:L,fit:D-t.width,maxSizeTop:k,maxSizeBottom:I,minSize:a.with(Math.min(D,a.width))}}(),u=function(){const D=e.left,L=-r.borderWidth+e.top+e.height,k=new Dt(e.width-r.borderHeight,o.height-e.top-e.height-r.verticalPadding);return{top:L,left:D,fit:k.height-t.height,maxSizeBottom:k,maxSizeTop:k,minSize:a.with(k.width)}}(),h=[d,c,u],g=(n=h.find(D=>D.fit>=0))!==null&&n!==void 0?n:h.sort((D,L)=>L.fit-D.fit)[0],f=e.top+e.height-r.borderHeight;let m,_=t.height;const v=Math.max(g.maxSizeTop.height,g.maxSizeBottom.height);_>v&&(_=v);let b;i?_<=g.maxSizeTop.height?(m=!0,b=g.maxSizeTop):(m=!1,b=g.maxSizeBottom):_<=g.maxSizeBottom.height?(m=!1,b=g.maxSizeBottom):(m=!0,b=g.maxSizeTop);let{top:C,left:w}=g;!m&&_>e.height&&(C=f-_);const y=this._editor.getDomNode();if(y){const D=y.getBoundingClientRect();C-=D.top,w-=D.left}this._applyTopLeft({left:w,top:C}),this._resizable.enableSashes(!m,g===d,m,g!==d),this._resizable.minSize=g.minSize,this._resizable.maxSize=b,this._resizable.layout(_,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)}}var nd;(function(s){s[s.FILE=0]="FILE",s[s.FOLDER=1]="FOLDER",s[s.ROOT_FOLDER=2]="ROOT_FOLDER"})(nd||(nd={}));const xNe=/(?:\/|^)(?:([^\/]+)\/)?([^\/]+)$/;function Cy(s,e,t,i,n){const o=i===nd.ROOT_FOLDER?["rootfolder-icon"]:i===nd.FOLDER?["folder-icon"]:["file-icon"];if(t){let r;if(t.scheme===Ge.data)r=Mh.parseMetaData(t).get(Mh.META_DATA_LABEL);else{const a=t.path.match(xNe);a?(r=wy(a[2].toLowerCase()),a[1]&&o.push(`${wy(a[1].toLowerCase())}-name-dir-icon`)):r=wy(t.authority.toLowerCase())}if(i===nd.ROOT_FOLDER)o.push(`${r}-root-name-folder-icon`);else if(i===nd.FOLDER)o.push(`${r}-name-folder-icon`);else{if(r){if(o.push(`${r}-name-file-icon`),o.push("name-file-icon"),r.length<=255){const l=r.split(".");for(let d=1;d=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},bT=function(s,e){return function(t,i){e(t,i,s)}},vu;function kG(s){return`suggest-aria-id:${s}`}const INe=xi("suggest-more-info",oe.chevronRight,p("suggestMoreInfoIcon","Icon for more information in the suggest widget.")),TNe=new(vu=class{extract(e,t){if(e.textLabel.match(vu._regexStrict))return t[0]=e.textLabel,!0;if(e.completion.detail&&e.completion.detail.match(vu._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=vu._regexRelaxed.exec(i);if(n&&(n.index===0||n.index+n[0].length===i.length))return t[0]=n[0],!0}return!1}},vu._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*\))/,vu._regexStrict=new RegExp(`^${vu._regexRelaxed.source}$`,"i"),vu);let yR=class{constructor(e,t,i,n){this._editor=e,this._modelService=t,this._languageService=i,this._themeService=n,this._onDidToggleDetails=new B,this.onDidToggleDetails=this._onDidToggleDetails.event,this.templateId="suggestion"}dispose(){this._onDidToggleDetails.dispose()}renderTemplate(e){const t=new Y,i=e;i.classList.add("show-file-icons");const n=Q(e,he(".icon")),o=Q(n,he("span.colorspan")),r=Q(e,he(".contents")),a=Q(r,he(".main")),l=Q(a,he(".icon-label.codicon")),d=Q(a,he("span.left")),c=Q(a,he("span.right")),u=new jD(d,{supportHighlights:!0,supportIcons:!0});t.add(u);const h=Q(d,he("span.signature-label")),g=Q(d,he("span.qualifier-label")),f=Q(c,he("span.details-label")),m=Q(c,he("span.readMore"+Pe.asCSSSelector(INe)));return m.title=p("readMore","Read More"),{root:i,left:d,right:c,icon:n,colorspan:o,iconLabel:u,iconContainer:l,parametersLabel:h,qualifierLabel:g,detailsLabel:f,readMore:m,disposables:t,configureFont:()=>{const v=this._editor.getOptions(),b=v.get(50),C=b.getMassagedFontFamily(),w=b.fontFeatureSettings,y=v.get(119)||b.fontSize,D=v.get(120)||b.lineHeight,L=b.fontWeight,k=b.letterSpacing,I=`${y}px`,O=`${D}px`,R=`${k}px`;i.style.fontSize=I,i.style.fontWeight=L,i.style.letterSpacing=R,a.style.fontFamily=C,a.style.fontFeatureSettings=w,a.style.lineHeight=O,n.style.height=O,n.style.width=O,m.style.height=O,m.style.width=O}}}renderElement(e,t,i){i.configureFont();const{completion:n}=e;i.root.id=kG(t),i.colorspan.style.backgroundColor="";const o={labelEscapeNewLines:!0,matches:Bx(e.score)},r=[];if(n.kind===19&&TNe.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=Cy(this._modelService,this._languageService,Ae.from({scheme:"fake",path:e.textLabel}),nd.FILE),l=Cy(this._modelService,this._languageService,Ae.from({scheme:"fake",path:n.detail}),nd.FILE);o.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",o.extraClasses=[Cy(this._modelService,this._languageService,Ae.from({scheme:"fake",path:e.textLabel}),nd.FOLDER),Cy(this._modelService,this._languageService,Ae.from({scheme:"fake",path:n.detail}),nd.FOLDER)].flat()):(i.icon.className="icon hide",i.iconContainer.className="",i.iconContainer.classList.add("suggest-icon",...Pe.asClassNameArray(Tb.toIcon(n.kind))));n.tags&&n.tags.indexOf(1)>=0&&(o.extraClasses=(o.extraClasses||[]).concat(["deprecated"]),o.matches=[]),i.iconLabel.setLabel(e.textLabel,void 0,o),typeof n.label=="string"?(i.parametersLabel.textContent="",i.detailsLabel.textContent=CT(n.detail||""),i.root.classList.add("string-label")):(i.parametersLabel.textContent=CT(n.label.detail||""),i.detailsLabel.textContent=CT(n.label.description||""),i.root.classList.remove("string-label")),this._editor.getOption(118).showInlineDetails?Do(i.detailsLabel):Es(i.detailsLabel),B4(e)?(i.right.classList.add("can-expand-details"),Do(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"),Es(i.readMore),i.readMore.onmousedown=null,i.readMore.onclick=null)}disposeTemplate(e){e.disposables.dispose()}};yR=ENe([bT(1,_i),bT(2,vi),bT(3,_n)],yR);function CT(s){return s.replace(/\r\n|\r|\n/g,"")}var NNe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},yy=function(s,e){return function(t,i){e(t,i,s)}},Zp;N("editorSuggestWidget.background",{dark:Hi,light:Hi,hcDark:Hi,hcLight:Hi},p("editorSuggestWidgetBackground","Background color of the suggest widget."));N("editorSuggestWidget.border",{dark:fc,light:fc,hcDark:fc,hcLight:fc},p("editorSuggestWidgetBorder","Border color of the suggest widget."));const Sy=N("editorSuggestWidget.foreground",{dark:Tr,light:Tr,hcDark:Tr,hcLight:Tr},p("editorSuggestWidgetForeground","Foreground color of the suggest widget."));N("editorSuggestWidget.selectedForeground",{dark:Uu,light:Uu,hcDark:Uu,hcLight:Uu},p("editorSuggestWidgetSelectedForeground","Foreground color of the selected entry in the suggest widget."));N("editorSuggestWidget.selectedIconForeground",{dark:cm,light:cm,hcDark:cm,hcLight:cm},p("editorSuggestWidgetSelectedIconForeground","Icon foreground color of the selected entry in the suggest widget."));const ANe=N("editorSuggestWidget.selectedBackground",{dark:$u,light:$u,hcDark:$u,hcLight:$u},p("editorSuggestWidgetSelectedBackground","Background color of the selected entry in the suggest widget."));N("editorSuggestWidget.highlightForeground",{dark:da,light:da,hcDark:da,hcLight:da},p("editorSuggestWidgetHighlightForeground","Color of the match highlights in the suggest widget."));N("editorSuggestWidget.focusHighlightForeground",{dark:ww,light:ww,hcDark:ww,hcLight:ww},p("editorSuggestWidgetFocusHighlightForeground","Color of the match highlights in the suggest widget when an item is focused."));N("editorSuggestWidgetStatus.foreground",{dark:Ee(Sy,.5),light:Ee(Sy,.5),hcDark:Ee(Sy,.5),hcLight:Ee(Sy,.5)},p("editorSuggestWidgetStatusForeground","Foreground color of the suggest widget status."));class MNe{constructor(e,t){this._service=e,this._key=`suggestWidget.size/${t.getEditorType()}/${t instanceof Uh}`}restore(){var e;const t=(e=this._service.get(this._key,0))!==null&&e!==void 0?e:"";try{const i=JSON.parse(t);if(Dt.is(i))return Dt.lift(i)}catch{}}store(e){this._service.store(this._key,JSON.stringify(e),0,1)}reset(){this._service.remove(this._key,0)}}let jC=Zp=class{constructor(e,t,i,n,o){this.editor=e,this._storageService=t,this._state=0,this._isAuto=!1,this._pendingLayout=new $n,this._pendingShowDetails=new $n,this._ignoreFocusEvents=!1,this._forceRenderingAbove=!1,this._explainMode=!1,this._showTimeout=new ya,this._disposables=new Y,this._onDidSelect=new bf,this._onDidFocus=new bf,this._onDidHide=new B,this._onDidShow=new B,this.onDidSelect=this._onDidSelect.event,this.onDidFocus=this._onDidFocus.event,this.onDidHide=this._onDidHide.event,this.onDidShow=this._onDidShow.event,this._onDetailsKeydown=new B,this.onDetailsKeyDown=this._onDetailsKeydown.event,this.element=new C4,this.element.domNode.classList.add("editor-widget","suggest-widget"),this._contentWidget=new RNe(this,e),this._persistedSize=new MNe(t,e);class r{constructor(g,f,m=!1,_=!1){this.persistedSize=g,this.currentSize=f,this.persistHeight=m,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(h=>{var g,f,m,_;if(this._resize(h.dimension.width,h.dimension.height),a&&(a.persistHeight=a.persistHeight||!!h.north||!!h.south,a.persistWidth=a.persistWidth||!!h.east||!!h.west),!!h.done){if(a){const{itemHeight:v,defaultSize:b}=this.getLayoutInfo(),C=Math.round(v/2);let{width:w,height:y}=this.element.size;(!a.persistHeight||Math.abs(a.currentSize.height-y)<=C)&&(y=(f=(g=a.persistedSize)===null||g===void 0?void 0:g.height)!==null&&f!==void 0?f:b.height),(!a.persistWidth||Math.abs(a.currentSize.width-w)<=C)&&(w=(_=(m=a.persistedSize)===null||m===void 0?void 0:m.width)!==null&&_!==void 0?_:b.width),this._persistedSize.store(new Dt(w,y))}this._contentWidget.unlockPreference(),a=void 0}})),this._messageElement=Q(this.element.domNode,he(".message")),this._listElement=Q(this.element.domNode,he(".tree"));const l=this._disposables.add(o.createInstance(wR,this.editor));l.onDidClose(this.toggleDetails,this,this._disposables),this._details=new LNe(l,this.editor);const d=()=>this.element.domNode.classList.toggle("no-icons",!this.editor.getOption(118).showIcons);d();const c=o.createInstance(yR,this.editor);this._disposables.add(c),this._disposables.add(c.onDidToggleDetails(()=>this.toggleDetails())),this._list=new pr("SuggestWidget",this._listElement,{getHeight:h=>this.getLayoutInfo().itemHeight,getTemplateId:h=>"suggestion"},[c],{alwaysConsumeMouseWheel:!0,useShadows:!1,mouseSupport:!1,multipleSelectionSupport:!1,accessibilityProvider:{getRole:()=>"option",getWidgetAriaLabel:()=>p("suggest","Suggest"),getWidgetRole:()=>"listbox",getAriaLabel:h=>{let g=h.textLabel;if(typeof h.completion.label!="string"){const{detail:v,description:b}=h.completion.label;v&&b?g=p("label.full","{0} {1}, {2}",g,v,b):v?g=p("label.detail","{0} {1}",g,v):b&&(g=p("label.desc","{0}, {1}",g,b))}if(!h.isResolved||!this._isDetailsVisible())return g;const{documentation:f,detail:m}=h.completion,_=l_("{0}{1}",m||"",f?typeof f=="string"?f:f.value:"");return p("ariaCurrenttSuggestionReadDetails","{0}, docs: {1}",g,_)}}}),this._list.style(up({listInactiveFocusBackground:ANe,listInactiveFocusOutline:di})),this._status=o.createInstance(CR,this.element.domNode,gh);const u=()=>this.element.domNode.classList.toggle("with-status-bar",this.editor.getOption(118).showStatusBar);u(),this._disposables.add(n.onDidColorThemeChange(h=>this._onThemeChange(h))),this._onThemeChange(n.getColorTheme()),this._disposables.add(this._list.onMouseDown(h=>this._onListMouseDownOrTap(h))),this._disposables.add(this._list.onTap(h=>this._onListMouseDownOrTap(h))),this._disposables.add(this._list.onDidChangeSelection(h=>this._onListSelection(h))),this._disposables.add(this._list.onDidChangeFocus(h=>this._onListFocus(h))),this._disposables.add(this.editor.onDidChangeCursorSelection(()=>this._onCursorSelectionChanged())),this._disposables.add(this.editor.onDidChangeConfiguration(h=>{h.hasChanged(118)&&(u(),d()),this._completionModel&&(h.hasChanged(50)||h.hasChanged(119)||h.hasChanged(120))&&this._list.splice(0,this._list.length,this._completionModel.items)})),this._ctxSuggestWidgetVisible=it.Visible.bindTo(i),this._ctxSuggestWidgetDetailsVisible=it.DetailsVisible.bindTo(i),this._ctxSuggestWidgetMultipleSuggestions=it.MultipleSuggestions.bindTo(i),this._ctxSuggestWidgetHasFocusedSuggestion=it.HasFocusedSuggestion.bindTo(i),this._disposables.add(Ni(this._details.widget.domNode,"keydown",h=>{this._onDetailsKeydown.fire(h)})),this._disposables.add(this.editor.onMouseDown(h=>this._onEditorMouseDown(h)))}dispose(){var e;this._details.widget.dispose(),this._details.dispose(),this._list.dispose(),this._status.dispose(),this._disposables.dispose(),(e=this._loadingTimeout)===null||e===void 0||e.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())}_onThemeChange(e){this._details.widget.borderWidth=dd(e.type)?2:1}_onListFocus(e){var t;if(this._ignoreFocusEvents)return;if(!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 i=e.elements[0],n=e.indexes[0];i!==this._focusedItem&&((t=this._currentSuggestionDetails)===null||t===void 0||t.cancel(),this._currentSuggestionDetails=void 0,this._focusedItem=i,this._list.reveal(n),this._currentSuggestionDetails=Dn(async o=>{const r=kh(()=>{this._isDetailsVisible()&&this.showDetails(!0)},250),a=o.onCancellationRequested(()=>r.dispose());try{return await i.resolve(o)}finally{r.dispose(),a.dispose()}}),this._currentSuggestionDetails.then(()=>{n>=this._list.length||i!==this._list.element(n)||(this._ignoreFocusEvents=!0,this._list.splice(n,1,[i]),this._list.setFocus([n]),this._ignoreFocusEvents=!1,this._isDetailsVisible()?this.showDetails(!1):this.element.domNode.classList.remove("docs-side"),this.editor.setAriaOptions({activeDescendant:kG(n)}))}).catch(Xe)),this._onDidFocus.fire({item:i,index:n,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:Es(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=Zp.LOADING_MESSAGE,Es(this._listElement,this._status.element),Do(this._messageElement),this._details.hide(),this._show(),this._focusedItem=void 0,Uc(Zp.LOADING_MESSAGE);break;case 2:this.element.domNode.classList.add("message"),this._messageElement.textContent=Zp.NO_SUGGESTIONS_MESSAGE,Es(this._listElement,this._status.element),Do(this._messageElement),this._details.hide(),this._show(),this._focusedItem=void 0,Uc(Zp.NO_SUGGESTIONS_MESSAGE);break;case 3:Es(this._messageElement),Do(this._listElement,this._status.element),this._show();break;case 4:Es(this._messageElement),Do(this._listElement,this._status.element),this._show();break;case 5:Es(this._messageElement),Do(this._listElement,this._status.element),this._details.show(),this._show();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=kh(()=>this._setState(1),t)))}showSuggestions(e,t,i,n,o){var r,a;if(this._contentWidget.setPosition(this.editor.getPosition()),(r=this._loadingTimeout)===null||r===void 0||r.dispose(),(a=this._currentSuggestionDetails)===null||a===void 0||a.cancel(),this._currentSuggestionDetails=void 0,this._completionModel!==e&&(this._completionModel=e),i&&this._state!==2&&this._state!==0){this._setState(4);return}const l=this._completionModel.items.length,d=l===0;if(this._ctxSuggestWidgetMultipleSuggestions.set(l>1),d){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),this._list.setFocus(o?[]:[t])}finally{this._onDidFocus.resume(),this._onDidSelect.resume()}this._pendingLayout.value=zS(Te(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._setState(3),this._details.widget.domNode.classList.remove("focused")):this._state===3&&this._isDetailsVisible()&&(this._setState(5),this._details.widget.domNode.classList.add("focused"))}toggleDetails(){this._isDetailsVisible()?(this._pendingShowDetails.clear(),this._ctxSuggestWidgetDetailsVisible.set(!1),this._setDetailsVisible(!1),this._details.hide(),this.element.domNode.classList.remove("shows-details")):(B4(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))}showDetails(e){this._pendingShowDetails.value=zS(Te(this.element.domNode),()=>{this._pendingShowDetails.clear(),this._details.show(),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")),this.editor.focus()})}toggleExplainMode(){this._list.getFocusedElements()[0]&&(this._explainMode=!this._explainMode,this._isDetailsVisible()?this.showDetails(!1):this.toggleDetails())}resetPersistedSize(){this._persistedSize.reset()}hideWidget(){var e;this._pendingLayout.clear(),this._pendingShowDetails.clear(),(e=this._loadingTimeout)===null||e===void 0||e.dispose(),this._setState(0),this._onDidHide.fire(this),this.element.clearSashHoverState();const t=this._persistedSize.restore(),i=Math.ceil(this.getLayoutInfo().itemHeight*4.3);t&&t.heightd&&(l=d);const c=this._completionModel?this._completionModel.stats.pLabelLen*r.typicalHalfwidthCharacterWidth:l,u=r.statusBarHeight+this._list.contentHeight+r.borderHeight,h=r.itemHeight+r.statusBarHeight,g=qi(this.editor.getDomNode()),f=this.editor.getScrolledVisiblePosition(this.editor.getPosition()),m=g.top+f.top+f.height,_=Math.min(o.height-m-r.verticalPadding,u),v=g.top+f.top-r.verticalPadding,b=Math.min(v,u);let C=Math.min(Math.max(b,_)+r.borderHeight,u);a===((t=this._cappedHeight)===null||t===void 0?void 0:t.capped)&&(a=this._cappedHeight.wanted),aC&&(a=C),a>_||this._forceRenderingAbove&&v>150?(this._contentWidget.setPreference(1),this.element.enableSashes(!0,!0,!1,!1),C=b):(this._contentWidget.setPreference(2),this.element.enableSashes(!1,!0,!0,!1),C=_),this.element.preferredSize=new Dt(c,r.defaultSize.height),this.element.maxSize=new Dt(d,C),this.element.minSize=new Dt(220,h),this._cappedHeight=a===u?{wanted:(n=(i=this._cappedHeight)===null||i===void 0?void 0:i.wanted)!==null&&n!==void 0?n:e.height,capped:a}:void 0}this._resize(l,a)}_resize(e,t){const{width:i,height:n}=this.element.maxSize;e=Math.min(i,e),t=Math.min(n,t);const{statusBarHeight:o}=this.getLayoutInfo();this._list.layout(t-o,e),this._listElement.style.height=`${t-o}px`,this.element.layout(t,e),this._contentWidget.layout(),this._positionDetails()}_positionDetails(){var e;this._isDetailsVisible()&&this._details.placeAtAnchor(this.element.domNode,((e=this._contentWidget.getPosition())===null||e===void 0?void 0:e.preference[0])===2)}getLayoutInfo(){const e=this.editor.getOption(50),t=xs(this.editor.getOption(120)||e.lineHeight,8,1e3),i=!this.editor.getOption(118).showStatusBar||this._state===2||this._state===1?0:t,n=this._details.widget.borderWidth,o=2*n;return{itemHeight:t,statusBarHeight:i,borderWidth:n,borderHeight:o,typicalHalfwidthCharacterWidth:e.typicalHalfwidthCharacterWidth,verticalPadding:22,horizontalPadding:14,defaultSize:new Dt(430,i+12*t+o)}}_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}};jC.LOADING_MESSAGE=p("suggestWidget.loading","Loading...");jC.NO_SUGGESTIONS_MESSAGE=p("suggestWidget.noSuggestions","No suggestions.");jC=Zp=NNe([yy(1,Rd),yy(2,Be),yy(3,_n),yy(4,Ne)],jC);class RNe{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 Dt(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 PNe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Wp=function(s,e){return function(t,i){e(t,i,s)}},SR;class FNe{constructor(e,t){if(this._model=e,this._position=t,this._decorationOptions=Ye.register({description:"suggest-line-suffix",stickiness:1}),e.getLineMaxColumn(t.lineNumber)!==t.column){const n=e.getOffsetAt(t),o=e.getPositionAt(n+1);e.changeDecorations(r=>{this._marker&&r.removeDecoration(this._marker),this._marker=r.addDecoration(x.fromPositions(t,o),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 ca=SR=class{static get(e){return e.getContribution(SR.ID)}constructor(e,t,i,n,o,r,a){this._memoryService=t,this._commandService=i,this._contextKeyService=n,this._instantiationService=o,this._logService=r,this._telemetryService=a,this._lineSuffix=new $n,this._toDispose=new Y,this._selectors=new ONe(u=>u.priority),this._onWillInsertSuggestItem=new B,this.onWillInsertSuggestItem=this._onWillInsertSuggestItem.event,this.editor=e,this.model=o.createInstance(DL,this.editor),this._selectors.register({priority:0,select:(u,h,g)=>this._memoryService.select(u,h,g)});const l=it.InsertMode.bindTo(n);l.set(e.getOption(118).insertMode),this._toDispose.add(this.model.onDidTrigger(()=>l.set(e.getOption(118).insertMode))),this.widget=this._toDispose.add(new zE(Te(e.getDomNode()),()=>{const u=this._instantiationService.createInstance(jC,this.editor);this._toDispose.add(u),this._toDispose.add(u.onDidSelect(_=>this._insertSuggestion(_,0),this));const h=new _Ne(this.editor,u,this.model,_=>this._insertSuggestion(_,2));this._toDispose.add(h);const g=it.MakesTextEdit.bindTo(this._contextKeyService),f=it.HasInsertAndReplaceRange.bindTo(this._contextKeyService),m=it.CanResolve.bindTo(this._contextKeyService);return this._toDispose.add(Ie(()=>{g.reset(),f.reset(),m.reset()})),this._toDispose.add(u.onDidFocus(({item:_})=>{const v=this.editor.getPosition(),b=_.editStart.column,C=v.column;let w=!0;this.editor.getOption(1)==="smart"&&this.model.state===2&&!_.completion.additionalTextEdits&&!(_.completion.insertTextRules&4)&&C-b===_.completion.insertText.length&&(w=this.editor.getModel().getValueInRange({startLineNumber:v.lineNumber,startColumn:b,endLineNumber:v.lineNumber,endColumn:C})!==_.completion.insertText),g.set(w),f.set(!W.equals(_.editInsertEnd,_.editReplaceEnd)),m.set(!!_.provider.resolveCompletionItem||!!_.completion.documentation||_.completion.detail!==_.completion.label)})),this._toDispose.add(u.onDetailsKeyDown(_=>{if(_.toKeyCodeChord().equals(new Vc(!0,!1,!1,!1,33))||lt&&_.toKeyCodeChord().equals(new Vc(!1,!1,!1,!0,33))){_.stopPropagation();return}_.toKeyCodeChord().isModifierKey()||this.editor.focus()})),u})),this._overtypingCapturer=this._toDispose.add(new zE(Te(e.getDomNode()),()=>this._toDispose.add(new Pk(this.editor,this.model)))),this._alternatives=this._toDispose.add(new zE(Te(e.getDomNode()),()=>this._toDispose.add(new zf(this.editor,this._contextKeyService)))),this._toDispose.add(o.createInstance($C,e)),this._toDispose.add(this.model.onDidTrigger(u=>{this.widget.value.showTriggered(u.auto,u.shy?250:50),this._lineSuffix.value=new FNe(this.editor.getModel(),u.position)})),this._toDispose.add(this.model.onDidSuggest(u=>{if(u.triggerOptions.shy)return;let h=-1;for(const f of this._selectors.itemsOrderedByPriorityDesc)if(h=f.select(this.editor.getModel(),this.editor.getPosition(),u.completionModel.items),h!==-1)break;if(h===-1&&(h=0),this.model.state===0)return;let g=!1;if(u.triggerOptions.auto){const f=this.editor.getOption(118);f.selectionMode==="never"||f.selectionMode==="always"?g=f.selectionMode==="never":f.selectionMode==="whenTriggerCharacter"?g=u.triggerOptions.triggerKind!==1:f.selectionMode==="whenQuickSuggestion"&&(g=u.triggerOptions.triggerKind===1&&!u.triggerOptions.refilter)}this.widget.value.showSuggestions(u.completionModel,h,u.isFrozen,u.triggerOptions.auto,g)})),this._toDispose.add(this.model.onDidCancel(u=>{u.retrigger||this.widget.value.hideWidget()})),this._toDispose.add(this.editor.onDidBlurEditorWidget(()=>{this.model.cancel(),this.model.clear()}));const d=it.AcceptSuggestionsOnEnter.bindTo(n),c=()=>{const u=this.editor.getOption(1);d.set(u==="on"||u==="smart")};this._toDispose.add(this.editor.onDidChangeConfiguration(()=>c())),c()}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=jn.get(this.editor);if(!i)return;this._onWillInsertSuggestItem.fire({item:e.item});const n=this.editor.getModel(),o=n.getAlternativeVersionId(),{item:r}=e,a=[],l=new Vi;t&1||this.editor.pushUndoStop();const d=this.getOverwriteInfo(r,!!(t&8));this._memoryService.memorize(n,this.editor.getPosition(),r);const c=r.isResolved;let u=-1,h=-1;if(Array.isArray(r.completion.additionalTextEdits)){this.model.cancel();const f=cl.capture(this.editor);this.editor.executeEdits("suggestController.additionalTextEdits.sync",r.completion.additionalTextEdits.map(m=>{let _=x.lift(m.range);if(_.startLineNumber===r.position.lineNumber&&_.startColumn>r.position.column){const v=this.editor.getPosition().column-r.position.column,b=v,C=x.spansMultipleLines(_)?0:v;_=new x(_.startLineNumber,_.startColumn+b,_.endLineNumber,_.endColumn+C)}return pi.replaceMove(_,m.text)})),f.restoreRelativeVerticalPositionOfCursor(this.editor)}else if(!c){const f=new Jn;let m;const _=n.onDidChangeContent(w=>{if(w.isFlush){l.cancel(),_.dispose();return}for(const y of w.changes){const D=x.getEndPosition(y.range);(!m||W.isBefore(D,m))&&(m=D)}}),v=t;t|=2;let b=!1;const C=this.editor.onWillType(()=>{C.dispose(),b=!0,v&2||this.editor.pushUndoStop()});a.push(r.resolve(l.token).then(()=>{if(!r.completion.additionalTextEdits||l.token.isCancellationRequested)return;if(m&&r.completion.additionalTextEdits.some(y=>W.isBefore(m,x.getStartPosition(y.range))))return!1;b&&this.editor.pushUndoStop();const w=cl.capture(this.editor);return this.editor.executeEdits("suggestController.additionalTextEdits.async",r.completion.additionalTextEdits.map(y=>pi.replaceMove(x.lift(y.range),y.text))),w.restoreRelativeVerticalPositionOfCursor(this.editor),(b||!(v&2))&&this.editor.pushUndoStop(),!0}).then(w=>{this._logService.trace("[suggest] async resolving of edits DONE (ms, applied?)",f.elapsed(),w),h=w===!0?1:w===!1?0:-2}).finally(()=>{_.dispose(),C.dispose()}))}let{insertText:g}=r.completion;if(r.completion.insertTextRules&4||(g=Rf.escape(g)),this.model.cancel(),i.insert(g,{overwriteBefore:d.overwriteBefore,overwriteAfter:d.overwriteAfter,undoStopBefore:!1,undoStopAfter:!1,adjustWhitespace:!(r.completion.insertTextRules&1),clipboardText:e.model.clipboardText,overtypingCapturer:this._overtypingCapturer.value}),t&2||this.editor.pushUndoStop(),r.completion.command)if(r.completion.command.id===q1.id)this.model.trigger({auto:!0,retrigger:!0});else{const f=new Jn;a.push(this._commandService.executeCommand(r.completion.command.id,...r.completion.command.arguments?[...r.completion.command.arguments]:[]).catch(m=>{r.completion.extensionId?Ai(m):Xe(m)}).finally(()=>{u=f.elapsed()}))}t&4&&this._alternatives.value.set(e,f=>{for(l.cancel();n.canUndo();){o!==n.getAlternativeVersionId()&&n.undo(),this._insertSuggestion(f,3|(t&8?8:0));break}}),this._alertCompletionItem(r),Promise.all(a).finally(()=>{this._reportSuggestionAcceptedTelemetry(r,n,c,u,h),this.model.clear(),l.dispose()})}_reportSuggestionAcceptedTelemetry(e,t,i,n,o){var r,a,l;Math.floor(Math.random()*100)!==0&&this._telemetryService.publicLog2("suggest.acceptedSuggestion",{extensionId:(a=(r=e.extensionId)===null||r===void 0?void 0:r.value)!==null&&a!==void 0?a:"unknown",providerId:(l=e.provider._debugDisplayName)!==null&&l!==void 0?l:"unknown",kind:e.completion.kind,basenameHash:XL(Wr(t.uri)).toString(16),languageId:t.getLanguageId(),fileExtension:Cme(t.uri),resolveInfo:e.provider.resolveCompletionItem?i?1:0:-1,resolveDuration:e.resolveDuration,commandDuration:n,additionalEditsAsync:o})}getOverwriteInfo(e,t){yt(this.editor.hasModel());let i=this.editor.getOption(118).insertMode==="replace";t&&(i=!i);const n=e.position.column-e.editStart.column,o=(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:o+a}}_alertCompletionItem(e){if(rs(e.completion.additionalTextEdits)){const t=p("aria.alert.snippet","Accepting '{0}' made {1} additional edits",e.textLabel,e.completion.additionalTextEdits.length);fo(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=o=>{if(o.completion.insertTextRules&4||o.completion.additionalTextEdits)return!0;const r=this.editor.getPosition(),a=o.editStart.column,l=r.column;return l-a!==o.completion.insertText.length?!0:this.editor.getModel().getValueInRange({startLineNumber:r.lineNumber,startColumn:a,endLineNumber:r.lineNumber,endColumn:l})!==o.completion.insertText};le.once(this.model.onDidTrigger)(o=>{const r=[];le.any(this.model.onDidTrigger,this.model.onDidCancel)(()=>{jt(r),i()},void 0,r),this.model.onDidSuggest(({completionModel:a})=>{if(jt(r),a.items.length===0){i();return}const l=this._memoryService.select(this.editor.getModel(),this.editor.getPosition(),a.items),d=a.items[l];if(!n(d)){i();return}this.editor.pushUndoStop(),this._insertSuggestion({index:l,item:d,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.value.forceRenderingAbove()}stopForceRenderingAbove(){this.widget.isInitialized&&this.widget.value.stopForceRenderingAbove()}registerSelector(e){return this._selectors.register(e)}};ca.ID="editor.contrib.suggestController";ca=SR=PNe([Wp(1,Rk),Wp(2,gi),Wp(3,Be),Wp(4,Ne),Wp(5,ys),Wp(6,Gs)],ca);class ONe{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 q1 extends me{constructor(){super({id:q1.id,label:p("suggest.trigger.label","Trigger Suggest"),alias:"Trigger Suggest",precondition:G.and(T.writable,T.hasCompletionItemProvider,it.Visible.toNegated()),kbOpts:{kbExpr:T.textInputFocus,primary:2058,secondary:[2087],mac:{primary:266,secondary:[521,2087]},weight:100}})}run(e,t,i){const n=ca.get(t);if(!n)return;let o;i&&typeof i=="object"&&i.auto===!0&&(o=!0),n.triggerSuggest(void 0,o,void 0)}}q1.id="editor.action.triggerSuggest";kt(ca.ID,ca,2);te(q1);const dr=190,Qs=mn.bindToContribution(ca.get);de(new Qs({id:"acceptSelectedSuggestion",precondition:G.and(it.Visible,it.HasFocusedSuggestion),handler(s){s.acceptSelectedSuggestion(!0,!1)},kbOpts:[{primary:2,kbExpr:G.and(it.Visible,T.textInputFocus),weight:dr},{primary:3,kbExpr:G.and(it.Visible,T.textInputFocus,it.AcceptSuggestionsOnEnter,it.MakesTextEdit),weight:dr}],menuOpts:[{menuId:gh,title:p("accept.insert","Insert"),group:"left",order:1,when:it.HasInsertAndReplaceRange.toNegated()},{menuId:gh,title:p("accept.insert","Insert"),group:"left",order:1,when:G.and(it.HasInsertAndReplaceRange,it.InsertMode.isEqualTo("insert"))},{menuId:gh,title:p("accept.replace","Replace"),group:"left",order:1,when:G.and(it.HasInsertAndReplaceRange,it.InsertMode.isEqualTo("replace"))}]}));de(new Qs({id:"acceptAlternativeSelectedSuggestion",precondition:G.and(it.Visible,T.textInputFocus,it.HasFocusedSuggestion),kbOpts:{weight:dr,kbExpr:T.textInputFocus,primary:1027,secondary:[1026]},handler(s){s.acceptSelectedSuggestion(!1,!0)},menuOpts:[{menuId:gh,group:"left",order:2,when:G.and(it.HasInsertAndReplaceRange,it.InsertMode.isEqualTo("insert")),title:p("accept.replace","Replace")},{menuId:gh,group:"left",order:2,when:G.and(it.HasInsertAndReplaceRange,it.InsertMode.isEqualTo("replace")),title:p("accept.insert","Insert")}]}));pt.registerCommandAlias("acceptSelectedSuggestionOnEnter","acceptSelectedSuggestion");de(new Qs({id:"hideSuggestWidget",precondition:it.Visible,handler:s=>s.cancelSuggestWidget(),kbOpts:{weight:dr,kbExpr:T.textInputFocus,primary:9,secondary:[1033]}}));de(new Qs({id:"selectNextSuggestion",precondition:G.and(it.Visible,G.or(it.MultipleSuggestions,it.HasFocusedSuggestion.negate())),handler:s=>s.selectNextSuggestion(),kbOpts:{weight:dr,kbExpr:T.textInputFocus,primary:18,secondary:[2066],mac:{primary:18,secondary:[2066,300]}}}));de(new Qs({id:"selectNextPageSuggestion",precondition:G.and(it.Visible,G.or(it.MultipleSuggestions,it.HasFocusedSuggestion.negate())),handler:s=>s.selectNextPageSuggestion(),kbOpts:{weight:dr,kbExpr:T.textInputFocus,primary:12,secondary:[2060]}}));de(new Qs({id:"selectLastSuggestion",precondition:G.and(it.Visible,G.or(it.MultipleSuggestions,it.HasFocusedSuggestion.negate())),handler:s=>s.selectLastSuggestion()}));de(new Qs({id:"selectPrevSuggestion",precondition:G.and(it.Visible,G.or(it.MultipleSuggestions,it.HasFocusedSuggestion.negate())),handler:s=>s.selectPrevSuggestion(),kbOpts:{weight:dr,kbExpr:T.textInputFocus,primary:16,secondary:[2064],mac:{primary:16,secondary:[2064,302]}}}));de(new Qs({id:"selectPrevPageSuggestion",precondition:G.and(it.Visible,G.or(it.MultipleSuggestions,it.HasFocusedSuggestion.negate())),handler:s=>s.selectPrevPageSuggestion(),kbOpts:{weight:dr,kbExpr:T.textInputFocus,primary:11,secondary:[2059]}}));de(new Qs({id:"selectFirstSuggestion",precondition:G.and(it.Visible,G.or(it.MultipleSuggestions,it.HasFocusedSuggestion.negate())),handler:s=>s.selectFirstSuggestion()}));de(new Qs({id:"focusSuggestion",precondition:G.and(it.Visible,it.HasFocusedSuggestion.negate()),handler:s=>s.focusSuggestion(),kbOpts:{weight:dr,kbExpr:T.textInputFocus,primary:2058,secondary:[2087],mac:{primary:266,secondary:[2087]}}}));de(new Qs({id:"focusAndAcceptSuggestion",precondition:G.and(it.Visible,it.HasFocusedSuggestion.negate()),handler:s=>{s.focusSuggestion(),s.acceptSelectedSuggestion(!0,!1)}}));de(new Qs({id:"toggleSuggestionDetails",precondition:G.and(it.Visible,it.HasFocusedSuggestion),handler:s=>s.toggleSuggestionDetails(),kbOpts:{weight:dr,kbExpr:T.textInputFocus,primary:2058,secondary:[2087],mac:{primary:266,secondary:[2087]}},menuOpts:[{menuId:gh,group:"right",order:1,when:G.and(it.DetailsVisible,it.CanResolve),title:p("detail.more","show less")},{menuId:gh,group:"right",order:1,when:G.and(it.DetailsVisible.toNegated(),it.CanResolve),title:p("detail.less","show more")}]}));de(new Qs({id:"toggleExplainMode",precondition:it.Visible,handler:s=>s.toggleExplainMode(),kbOpts:{weight:100,primary:2138}}));de(new Qs({id:"toggleSuggestionFocus",precondition:it.Visible,handler:s=>s.toggleSuggestionFocus(),kbOpts:{weight:dr,kbExpr:T.textInputFocus,primary:2570,mac:{primary:778}}}));de(new Qs({id:"insertBestCompletion",precondition:G.and(T.textInputFocus,G.equals("config.editor.tabCompletion","on"),$C.AtEnd,it.Visible.toNegated(),zf.OtherSuggestions.toNegated(),jn.InSnippetMode.toNegated()),handler:(s,e)=>{s.triggerSuggestAndAcceptBest(Ms(e)?{fallback:"tab",...e}:{fallback:"tab"})},kbOpts:{weight:dr,primary:2}}));de(new Qs({id:"insertNextSuggestion",precondition:G.and(T.textInputFocus,G.equals("config.editor.tabCompletion","on"),zf.OtherSuggestions,it.Visible.toNegated(),jn.InSnippetMode.toNegated()),handler:s=>s.acceptNextSuggestion(),kbOpts:{weight:dr,kbExpr:T.textInputFocus,primary:2}}));de(new Qs({id:"insertPrevSuggestion",precondition:G.and(T.textInputFocus,G.equals("config.editor.tabCompletion","on"),zf.OtherSuggestions,it.Visible.toNegated(),jn.InSnippetMode.toNegated()),handler:s=>s.acceptPrevSuggestion(),kbOpts:{weight:dr,kbExpr:T.textInputFocus,primary:1026}}));te(class extends me{constructor(){super({id:"editor.action.resetSuggestSize",label:p("suggest.reset.label","Reset Suggest Widget Size"),alias:"Reset Suggest Widget Size",precondition:void 0})}run(s,e){var t;(t=ca.get(e))===null||t===void 0||t.resetWidgetSize()}});class BNe extends H{get selectedItem(){return this._selectedItem}constructor(e,t,i,n){super(),this.editor=e,this.suggestControllerPreselector=t,this.checkModelVersion=i,this.onWillAccept=n,this.isSuggestWidgetVisible=!1,this.isShiftKeyPressed=!1,this._isActive=!1,this._currentSuggestItemInfo=void 0,this._selectedItem=vt(this,void 0),this._register(e.onKeyDown(r=>{r.shiftKey&&!this.isShiftKeyPressed&&(this.isShiftKeyPressed=!0,this.update(this._isActive))})),this._register(e.onKeyUp(r=>{r.shiftKey&&this.isShiftKeyPressed&&(this.isShiftKeyPressed=!1,this.update(this._isActive))}));const o=ca.get(this.editor);if(o){this._register(o.registerSelector({priority:100,select:(l,d,c)=>{$t(v=>this.checkModelVersion(v));const u=this.editor.getModel();if(!u)return-1;const h=this.suggestControllerPreselector(),g=h?pf(h,u):void 0;if(!g)return-1;const f=W.lift(d),m=c.map((v,b)=>{const C=mb.fromSuggestion(o,u,f,v,this.isShiftKeyPressed),w=pf(C.toSingleTextEdit(),u),y=DG(g,w);return{index:b,valid:y,prefixLength:w.text.length,suggestItem:v}}).filter(v=>v&&v.valid&&v.prefixLength>0),_=wF(m,ao(v=>v.prefixLength,ua));return _?_.index:-1}}));let r=!1;const a=()=>{r||(r=!0,this._register(o.widget.value.onDidShow(()=>{this.isSuggestWidgetVisible=!0,this.update(!0)})),this._register(o.widget.value.onDidHide(()=>{this.isSuggestWidgetVisible=!1,this.update(!1)})),this._register(o.widget.value.onDidFocus(()=>{this.isSuggestWidgetVisible=!0,this.update(!0)})))};this._register(le.once(o.model.onDidTrigger)(l=>{a()})),this._register(o.onWillInsertSuggestItem(l=>{const d=this.editor.getPosition(),c=this.editor.getModel();if(!d||!c)return;const u=mb.fromSuggestion(o,c,d,l.item,this.isShiftKeyPressed);this.onWillAccept(u)}))}this.update(this._isActive)}update(e){const t=this.getSuggestItemInfo();(this._isActive!==e||!WNe(this._currentSuggestItemInfo,t))&&(this._isActive=e,this._currentSuggestItemInfo=t,$t(i=>{this.checkModelVersion(i),this._selectedItem.set(this._isActive?this._currentSuggestItemInfo:void 0,i)}))}getSuggestItemInfo(){const e=ca.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 mb.fromSuggestion(e,n,i,t.item,this.isShiftKeyPressed)}stopForceRenderingAbove(){const e=ca.get(this.editor);e==null||e.stopForceRenderingAbove()}forceRenderingAbove(){const e=ca.get(this.editor);e==null||e.forceRenderingAbove()}}class mb{static fromSuggestion(e,t,i,n,o){let{insertText:r}=n.completion,a=!1;if(n.completion.insertTextRules&4){const d=new Rf().parse(r);d.children.length<100&&SL.adjustWhitespace(t,i,!0,d),r=d.toString(),a=!0}const l=e.getOverwriteInfo(n,o);return new mb(x.fromPositions(i.delta(0,-l.overwriteBefore),i.delta(0,Math.max(l.overwriteAfter,0))),r,n.completion.kind,a)}constructor(e,t,i,n){this.range=e,this.insertText=t,this.completionItemKind=i,this.isSnippetText=n}equals(e){return this.range.equalsRange(e.range)&&this.insertText===e.insertText&&this.completionItemKind===e.completionItemKind&&this.isSnippetText===e.isSnippetText}toSelectedSuggestionInfo(){return new tz(this.range,this.insertText,this.completionItemKind,this.isSnippetText)}toSingleTextEdit(){return new zc(this.range,this.insertText)}}function WNe(s,e){return s===e?!0:!s||!e?!1:s.equals(e)}var HNe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},jd=function(s,e){return function(t,i){e(t,i,s)}},DR;let cr=DR=class extends H{static get(e){return e.getContribution(DR.ID)}constructor(e,t,i,n,o,r,a,l,d,c){super(),this.editor=e,this._instantiationService=t,this._contextKeyService=i,this._configurationService=n,this._commandService=o,this._debounceService=r,this._languageFeaturesService=a,this._accessibilitySignalService=l,this._keybindingService=d,this._accessibilityService=c,this.model=this._register(gC("inlineCompletionModel",void 0)),this._textModelVersionId=vt(this,-1),this._positions=pCe({owner:this,equalsFn:y2(gj())},[new W(1,1)]),this._suggestWidgetAdaptor=this._register(new BNe(this.editor,()=>{var m,_;return(_=(m=this.model.get())===null||m===void 0?void 0:m.selectedInlineCompletion.get())===null||_===void 0?void 0:_.toSingleTextEdit(void 0)},m=>this.updateObservables(m,$o.Other),m=>{$t(_=>{var v;this.updateObservables(_,$o.Other),(v=this.model.get())===null||v===void 0||v.handleSuggestAccepted(m)})})),this._enabledInConfig=Ot(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(62).enabled),this._isScreenReaderEnabled=Ot(this._accessibilityService.onDidChangeScreenReaderOptimized,()=>this._accessibilityService.isScreenReaderOptimized()),this._editorDictationInProgress=Ot(this._contextKeyService.onDidChangeContext,()=>this._contextKeyService.getContext(this.editor.getDomNode()).getValue("editorDictation.inProgress")===!0),this._enabled=je(this,m=>this._enabledInConfig.read(m)&&(!this._isScreenReaderEnabled.read(m)||!this._editorDictationInProgress.read(m))),this._fontFamily=Ot(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(62).fontFamily),this._ghostTexts=je(this,m=>{var _;const v=this.model.read(m);return(_=v==null?void 0:v.ghostTexts.read(m))!==null&&_!==void 0?_:[]}),this._stablizedGhostTexts=VNe(this._ghostTexts,this._store),this._ghostTextWidgets=wCe(this,this._stablizedGhostTexts,(m,_)=>_.add(this._instantiationService.createInstance(pR,this.editor,{ghostText:m,minReservedLineCount:Ga(0),targetTextModel:this.model.map(v=>v==null?void 0:v.textModel)}))).recomputeInitiallyAndOnChange(this._store),this._debounceValue=this._debounceService.for(this._languageFeaturesService.inlineCompletionsProvider,"InlineCompletionsDebounce",{min:50,max:50}),this._playAccessibilitySignal=Zx(this),this._isReadonly=Ot(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(91)),this._textModel=Ot(this.editor.onDidChangeModel,()=>this.editor.getModel()),this._textModelIfWritable=je(m=>this._isReadonly.read(m)?void 0:this._textModel.read(m)),this._register(new Mn(this._contextKeyService,this.model)),this._register(st(m=>{const _=this._textModelIfWritable.read(m);$t(v=>{if(this.model.set(void 0,v),this.updateObservables(v,$o.Other),_){const b=t.createInstance(_R,_,this._suggestWidgetAdaptor.selectedItem,this._textModelVersionId,this._positions,this._debounceValue,Ot(e.onDidChangeConfiguration,()=>e.getOption(118).preview),Ot(e.onDidChangeConfiguration,()=>e.getOption(118).previewMode),Ot(e.onDidChangeConfiguration,()=>e.getOption(62).mode),this._enabled);this.model.set(b,v)}})}));const u=this._register(Nz());this._register(st(m=>{const _=this._fontFamily.read(m);u.setStyle(_===""||_==="default"?"":` .monaco-editor .ghost-text-decoration, .monaco-editor .ghost-text-decoration-preview, .monaco-editor .ghost-text { font-family: ${_}; }`)}));const h=m=>{var _;return m.isUndoing?$o.Undo:m.isRedoing?$o.Redo:!((_=this.model.get())===null||_===void 0)&&_.isAcceptingPartially?$o.AcceptWord:$o.Other};this._register(e.onDidChangeModelContent(m=>$t(_=>this.updateObservables(_,h(m))))),this._register(e.onDidChangeCursorPosition(m=>$t(_=>{var v;this.updateObservables(_,$o.Other),(m.reason===3||m.source==="api")&&((v=this.model.get())===null||v===void 0||v.stop(_))}))),this._register(e.onDidType(()=>$t(m=>{var _;this.updateObservables(m,$o.Other),this._enabled.get()&&((_=this.model.get())===null||_===void 0||_.trigger(m))}))),this._register(this._commandService.onDidExecuteCommand(m=>{new Set([Om.Tab.id,Om.DeleteLeft.id,Om.DeleteRight.id,Iq,"acceptSelectedSuggestion"]).has(m.commandId)&&e.hasTextFocus()&&this._enabled.get()&&$t(v=>{var b;(b=this.model.get())===null||b===void 0||b.trigger(v)})})),this._register(this.editor.onDidBlurEditorWidget(()=>{this._contextKeyService.getContextKeyValue("accessibleViewIsShown")||this._configurationService.getValue("editor.inlineSuggest.keepOnBlur")||e.getOption(62).keepOnBlur||zh.dropDownVisible||$t(m=>{var _;(_=this.model.get())===null||_===void 0||_.stop(m)})})),this._register(st(m=>{var _;const v=(_=this.model.read(m))===null||_===void 0?void 0:_.state.read(m);v!=null&&v.suggestItem?v.primaryGhostText.lineCount>=2&&this._suggestWidgetAdaptor.forceRenderingAbove():this._suggestWidgetAdaptor.stopForceRenderingAbove()})),this._register(Ie(()=>{this._suggestWidgetAdaptor.stopForceRenderingAbove()}));const g=this._register(new Y);let f;this._register(I1({handleChange:(m,_)=>(m.didChange(this._playAccessibilitySignal)&&(f=void 0),!0)},async(m,_)=>{this._playAccessibilitySignal.read(m);const v=this.model.read(m),b=v==null?void 0:v.state.read(m);if(!v||!b||!b.inlineCompletion){f=void 0;return}if(b.inlineCompletion.semanticId!==f){g.clear(),f=b.inlineCompletion.semanticId;const C=v.textModel.getLineContent(b.primaryGhostText.lineNumber);await xh(50,i3(g)),await _j(this._suggestWidgetAdaptor.selectedItem,oo,()=>!1,i3(g)),await this._accessibilitySignalService.playSignal(Ke.inlineSuggestion),this.editor.getOption(8)&&this.provideScreenReaderUpdate(b.primaryGhostText.renderForScreenReader(C))}})),this._register(new $M(this.editor,this.model,this._instantiationService)),this._register(this._configurationService.onDidChangeConfiguration(m=>{m.affectsConfiguration("accessibility.verbosity.inlineCompletions")&&this.editor.updateOptions({inlineCompletionsAccessibilityVerbose:this._configurationService.getValue("accessibility.verbosity.inlineCompletions")})})),this.editor.updateOptions({inlineCompletionsAccessibilityVerbose:this._configurationService.getValue("accessibility.verbosity.inlineCompletions")})}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(149)&&(n=p("showAccessibleViewHint","Inspect this in the accessible view ({0})",i.getAriaLabel())),fo(n?e+", "+n:e)}updateObservables(e,t){var i,n,o;const r=this.editor.getModel();this._textModelVersionId.set((i=r==null?void 0:r.getVersionId())!==null&&i!==void 0?i:-1,e,t),this._positions.set((o=(n=this.editor.getSelections())===null||n===void 0?void 0:n.map(a=>a.getPosition()))!==null&&o!==void 0?o:[new W(1,1)],e)}shouldShowHoverAt(e){var t;const i=(t=this.model.get())===null||t===void 0?void 0:t.primaryGhostText.get();return i?i.parts.some(n=>e.containsPosition(new W(i.lineNumber,n.column))):!1}shouldShowHoverAtViewZone(e){var t,i;return(i=(t=this._ghostTextWidgets.get()[0])===null||t===void 0?void 0:t.ownsViewZone(e))!==null&&i!==void 0?i:!1}};cr.ID="editor.contrib.inlineCompletionsController";cr=DR=HNe([jd(1,Ne),jd(2,Be),jd(3,rt),jd(4,gi),jd(5,Ur),jd(6,Ce),jd(7,rg),jd(8,At),jd(9,gr)],cr);function VNe(s,e){const t=vt("result",[]),i=[];return e.add(st(n=>{const o=s.read(n);$t(r=>{if(o.length!==i.length){i.length=o.length;for(let a=0;aa.set(o[l],r))})})),t}class Fk extends me{constructor(){super({id:Fk.ID,label:p("action.inlineSuggest.showNext","Show Next Inline Suggestion"),alias:"Show Next Inline Suggestion",precondition:G.and(T.writable,Mn.inlineSuggestionVisible),kbOpts:{weight:100,primary:606}})}async run(e,t){var i;const n=cr.get(t);(i=n==null?void 0:n.model.get())===null||i===void 0||i.next()}}Fk.ID=Nq;class Ok extends me{constructor(){super({id:Ok.ID,label:p("action.inlineSuggest.showPrevious","Show Previous Inline Suggestion"),alias:"Show Previous Inline Suggestion",precondition:G.and(T.writable,Mn.inlineSuggestionVisible),kbOpts:{weight:100,primary:604}})}async run(e,t){var i;const n=cr.get(t);(i=n==null?void 0:n.model.get())===null||i===void 0||i.previous()}}Ok.ID=Tq;class zNe extends me{constructor(){super({id:"editor.action.inlineSuggest.trigger",label:p("action.inlineSuggest.trigger","Trigger Inline Suggestion"),alias:"Trigger Inline Suggestion",precondition:T.writable})}async run(e,t){const i=cr.get(t);await fCe(async n=>{var o;await((o=i==null?void 0:i.model.get())===null||o===void 0?void 0:o.triggerExplicitly(n)),i==null||i.playAccessibilitySignal(n)})}}class UNe extends me{constructor(){super({id:"editor.action.inlineSuggest.acceptNextWord",label:p("action.inlineSuggest.acceptNextWord","Accept Next Word Of Inline Suggestion"),alias:"Accept Next Word Of Inline Suggestion",precondition:G.and(T.writable,Mn.inlineSuggestionVisible),kbOpts:{weight:101,primary:2065,kbExpr:G.and(T.writable,Mn.inlineSuggestionVisible)},menuOpts:[{menuId:E.InlineSuggestionToolbar,title:p("acceptWord","Accept Word"),group:"primary",order:2}]})}async run(e,t){var i;const n=cr.get(t);await((i=n==null?void 0:n.model.get())===null||i===void 0?void 0:i.acceptNextWord(n.editor))}}class $Ne extends me{constructor(){super({id:"editor.action.inlineSuggest.acceptNextLine",label:p("action.inlineSuggest.acceptNextLine","Accept Next Line Of Inline Suggestion"),alias:"Accept Next Line Of Inline Suggestion",precondition:G.and(T.writable,Mn.inlineSuggestionVisible),kbOpts:{weight:101},menuOpts:[{menuId:E.InlineSuggestionToolbar,title:p("acceptLine","Accept Line"),group:"secondary",order:2}]})}async run(e,t){var i;const n=cr.get(t);await((i=n==null?void 0:n.model.get())===null||i===void 0?void 0:i.acceptNextLine(n.editor))}}class jNe extends me{constructor(){super({id:Iq,label:p("action.inlineSuggest.accept","Accept Inline Suggestion"),alias:"Accept Inline Suggestion",precondition:Mn.inlineSuggestionVisible,menuOpts:[{menuId:E.InlineSuggestionToolbar,title:p("accept","Accept"),group:"primary",order:1}],kbOpts:{primary:2,weight:200,kbExpr:G.and(Mn.inlineSuggestionVisible,T.tabMovesFocus.toNegated(),Mn.inlineSuggestionHasIndentationLessThanTabSize,it.Visible.toNegated(),T.hoverFocused.toNegated())}})}async run(e,t){var i;const n=cr.get(t);n&&((i=n.model.get())===null||i===void 0||i.accept(n.editor),n.editor.focus())}}class Bk extends me{constructor(){super({id:Bk.ID,label:p("action.inlineSuggest.hide","Hide Inline Suggestion"),alias:"Hide Inline Suggestion",precondition:Mn.inlineSuggestionVisible,kbOpts:{weight:100,primary:9}})}async run(e,t){const i=cr.get(t);$t(n=>{var o;(o=i==null?void 0:i.model.get())===null||o===void 0||o.stop(n)})}}Bk.ID="editor.action.inlineSuggest.hide";class Wk extends qs{constructor(){super({id:Wk.ID,title:p("action.inlineSuggest.alwaysShowToolbar","Always Show Toolbar"),f1:!1,precondition:void 0,menu:[{id:E.InlineSuggestionToolbar,group:"secondary",order:10}],toggled:G.equals("config.editor.inlineSuggest.showToolbar","always")})}async run(e,t){const i=e.get(rt),o=i.getValue("editor.inlineSuggest.showToolbar")==="always"?"onHover":"always";i.updateValue("editor.inlineSuggest.showToolbar",o)}}Wk.ID="editor.action.inlineSuggest.toggleAlwaysShowToolbar";var KNe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},rv=function(s,e){return function(t,i){e(t,i,s)}};class qNe{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 LR=class{constructor(e,t,i,n,o,r){this._editor=e,this._languageService=t,this._openerService=i,this.accessibilityService=n,this._instantiationService=o,this._telemetryService=r,this.hoverOrdinal=4}suggestHoverAnchor(e){const t=cr.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 hf(1e3,this,x.fromPositions(this._editor.getModel().validatePosition(n.positionBefore||n.position)),e.event.posx,e.event.posy,!1)}return i.type===7&&t.shouldShowHoverAt(i.range)?new hf(1e3,this,i.range,e.event.posx,e.event.posy,!1):i.type===6&&i.detail.mightBeForeignElement&&t.shouldShowHoverAt(i.range)?new hf(1e3,this,i.range,e.event.posx,e.event.posy,!1):null}computeSync(e,t){if(this._editor.getOption(62).showToolbar!=="onHover")return[];const i=cr.get(this._editor);return i&&i.shouldShowHoverAt(e.range)?[new qNe(this,e.range,i)]:[]}renderHoverParts(e,t){const i=new Y,n=t[0];this._telemetryService.publicLog2("inlineCompletionHover.shown"),this.accessibilityService.isScreenReaderOptimized()&&!this._editor.getOption(8)&&this.renderScreenReaderText(e,n,i);const o=n.controller.model.get(),r=this._instantiationService.createInstance(zh,this._editor,!1,Ga(null),o.selectedInlineCompletionIndex,o.inlineCompletionsCount,o.activeCommands);return e.fragment.appendChild(r.getDomNode()),o.triggerExplicitly(),i.add(r),i}renderScreenReaderText(e,t,i){const n=he,o=n("div.hover-row.markdown-hover"),r=Q(o,n("div.hover-contents",{"aria-live":"assertive"})),a=i.add(new yd({editor:this._editor},this._languageService,this._openerService)),l=d=>{i.add(a.onDidRenderAsync(()=>{r.className="hover-contents code-hover-contents",e.onContentsChanged()}));const c=p("inlineSuggestionFollows","Suggestion:"),u=i.add(a.render(new ss().appendText(c).appendCodeblock("text",d)));r.replaceChildren(u.element)};i.add(st(d=>{var c;const u=(c=t.controller.model.read(d))===null||c===void 0?void 0:c.primaryGhostText.read(d);if(u){const h=this._editor.getModel().getLineContent(u.lineNumber);l(u.renderForScreenReader(h))}else Yn(r)})),e.fragment.appendChild(o)}};LR=KNe([rv(1,vi),rv(2,Bo),rv(3,gr),rv(4,Ne),rv(5,Gs)],LR);kt(cr.ID,cr,3);te(zNe);te(Fk);te(Ok);te(UNe);te($Ne);te(jNe);te(Bk);qt(Wk);ag.register(LR);var GNe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},wT=function(s,e){return function(t,i){e(t,i,s)}},Mv;let Uf=Mv=class{constructor(e,t,i,n){this.textModelResolverService=t,this.languageService=i,this.languageFeaturesService=n,this.toUnhook=new Y,this.toUnhookForKeyboard=new Y,this.currentWordAtPosition=null,this.previousPromise=null,this.editor=e,this.linkDecorations=this.editor.createDecorationsCollection();const o=new vk(e);this.toUnhook.add(o),this.toUnhook.add(o.onMouseMoveOrRelevantKeyDown(([r,a])=>{this.startFindDefinitionFromMouse(r,a??void 0)})),this.toUnhook.add(o.onExecute(r=>{this.isEnabled(r)&&this.gotoDefinition(r.target.position,r.hasSideBySideModifier).catch(a=>{Xe(a)}).finally(()=>{this.removeLinkDecorations()})})),this.toUnhook.add(o.onCancel(()=>{this.removeLinkDecorations(),this.currentWordAtPosition=null}))}static get(e){return e.getContribution(Mv.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){var t;this.toUnhookForKeyboard.clear();const i=e?(t=this.editor.getModel())===null||t===void 0?void 0:t.getWordAtPosition(e):null;if(!i){this.currentWordAtPosition=null,this.removeLinkDecorations();return}if(this.currentWordAtPosition&&this.currentWordAtPosition.startColumn===i.startColumn&&this.currentWordAtPosition.endColumn===i.endColumn&&this.currentWordAtPosition.word===i.word)return;this.currentWordAtPosition=i;const n=new MK(this.editor,15);this.previousPromise&&(this.previousPromise.cancel(),this.previousPromise=null),this.previousPromise=Dn(a=>this.findDefinition(e,a));let o;try{o=await this.previousPromise}catch(a){Xe(a);return}if(!o||!o.length||!n.validate(this.editor)){this.removeLinkDecorations();return}const r=o[0].originSelectionRange?x.lift(o[0].originSelectionRange):new x(e.lineNumber,i.startColumn,e.lineNumber,i.endColumn);if(o.length>1){let a=r;for(const{originSelectionRange:l}of o)l&&(a=x.plusRange(a,l));this.addDecoration(a,new ss().appendText(p("multipleResults","Click to show {0} definitions.",o.length)))}else{const a=o[0];if(!a.uri)return;this.textModelResolverService.createModelReference(a.uri).then(l=>{if(!l.object||!l.object.textEditorModel){l.dispose();return}const{object:{textEditorModel:d}}=l,{startLineNumber:c}=a.range;if(c<1||c>d.getLineCount()){l.dispose();return}const u=this.getPreviewValue(d,c,a),h=this.languageService.guessLanguageIdByFilepathOrFirstLine(d.uri);this.addDecoration(r,u?new ss().appendCodeblock(h||"",u):void 0),l.dispose()})}}getPreviewValue(e,t,i){let n=i.range;return n.endLineNumber-n.startLineNumber>=Mv.MAX_SOURCE_PREVIEW_LINES&&(n=this.getPreviewRangeBasedOnIndentation(e,t)),this.stripIndentationFromPreviewRange(e,t,n)}stripIndentationFromPreviewRange(e,t,i){let o=e.getLineFirstNonWhitespaceColumn(t);for(let a=t+1;a{const n=!t&&this.editor.getOption(88)&&!this.isInPeekEditor(i);return new K1({openToSide:t,openInPeek:n,muteMessage:!0},{title:{value:"",original:""},id:"",precondition:void 0}).run(i)})}isInPeekEditor(e){const t=e.get(Be);return po.inPeekEditor.getValue(t)}dispose(){this.toUnhook.dispose(),this.toUnhookForKeyboard.dispose()}};Uf.ID="editor.contrib.gotodefinitionatposition";Uf.MAX_SOURCE_PREVIEW_LINES=8;Uf=Mv=GNe([wT(1,mo),wT(2,vi),wT(3,Ce)],Uf);kt(Uf.ID,Uf,2);var EG=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},LL=function(s,e){return function(t,i){e(t,i,s)}};class O9{constructor(e,t,i){this.marker=e,this.index=t,this.total=i}}let xR=class{constructor(e,t,i){this._markerService=t,this._configService=i,this._onDidChange=new B,this.onDidChange=this._onDidChange.event,this._dispoables=new Y,this._markers=[],this._nextIdx=-1,Ae.isUri(e)?this._resourceFilter=a=>a.toString()===e.toString():e&&(this._resourceFilter=e);const n=this._configService.getValue("problems.sortOrder"),o=(a,l)=>{let d=Rb(a.resource.toString(),l.resource.toString());return d===0&&(n==="position"?d=x.compareRangesUsingStarts(a,l)||Li.compare(a.severity,l.severity):d=Li.compare(a.severity,l.severity)||x.compareRangesUsingStarts(a,l)),d},r=()=>{this._markers=this._markerService.read({resource:Ae.isUri(e)?e:void 0,severities:Li.Error|Li.Warning|Li.Info}),typeof e=="function"&&(this._markers=this._markers.filter(a=>this._resourceFilter(a.resource))),this._markers.sort(o)};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 O9(e,this._nextIdx+1,this._markers.length)}_initIdx(e,t,i){let n=!1,o=this._markers.findIndex(r=>r.resource.toString()===e.uri.toString());o<0&&(o=xb(this._markers,{resource:e.uri},(r,a)=>Rb(r.resource.toString(),a.resource.toString())),o<0&&(o=~o));for(let r=o;rn.resource.toString()===e.toString());if(!(i<0)){for(;i=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Hp=function(s,e){return function(t,i){e(t,i,s)}},IR;class XNe{constructor(e,t,i,n,o){this._openerService=n,this._labelService=o,this._lines=0,this._longestLineLength=0,this._relatedDiagnostics=new WeakMap,this._disposables=new Y,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(Ni(this._relatedBlock,"click",a=>{a.preventDefault();const l=this._relatedDiagnostics.get(a.target);l&&i(l)})),this._scrollable=new VU(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(){jt(this._disposables)}update(e){const{source:t,message:i,relatedInformation:n,code:o}=e;let r=((t==null?void 0:t.length)||0)+2;o&&(typeof o=="string"?r+=o.length:r+=o.value.length);const a=Td(i);this._lines=a.length,this._longestLineLength=0;for(const h of a)this._longestLineLength=Math.max(h.length+r,this._longestLineLength);zn(this._messageBlock),this._messageBlock.setAttribute("aria-label",this.getAriaLabel(e)),this._editor.applyFontInfo(this._messageBlock);let l=this._messageBlock;for(const h of a)l=document.createElement("div"),l.innerText=h,h===""&&(l.style.height=this._messageBlock.style.lineHeight),this._messageBlock.appendChild(l);if(t||o){const h=document.createElement("span");if(h.classList.add("details"),l.appendChild(h),t){const g=document.createElement("span");g.innerText=t,g.classList.add("source"),h.appendChild(g)}if(o)if(typeof o=="string"){const g=document.createElement("span");g.innerText=`(${o})`,g.classList.add("code"),h.appendChild(g)}else{this._codeLink=he("a.code-link"),this._codeLink.setAttribute("href",`${o.target.toString()}`),this._codeLink.onclick=f=>{this._openerService.open(o.target,{allowCommands:!0}),f.preventDefault(),f.stopPropagation()};const g=Q(this._codeLink,he("span"));g.innerText=o.value,h.appendChild(this._codeLink)}}if(zn(this._relatedBlock),this._editor.applyFontInfo(this._relatedBlock),rs(n)){const h=this._relatedBlock.appendChild(document.createElement("div"));h.style.paddingTop=`${Math.floor(this._editor.getOption(67)*.66)}px`,this._lines+=1;for(const g of n){const f=document.createElement("div"),m=document.createElement("a");m.classList.add("filename"),m.innerText=`${this._labelService.getUriBasenameLabel(g.resource)}(${g.startLineNumber}, ${g.startColumn}): `,m.title=this._labelService.getUriLabel(g.resource),this._relatedDiagnostics.set(m,g);const _=document.createElement("span");_.innerText=g.message,f.appendChild(m),f.appendChild(_),this._lines+=1,h.appendChild(f)}}const d=this._editor.getOption(50),c=Math.ceil(d.typicalFullwidthCharacterWidth*this._longestLineLength*.75),u=d.lineHeight*this._lines;this._scrollable.setScrollDimensions({scrollWidth:c,scrollHeight:u})}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 Li.Error:t=p("Error","Error");break;case Li.Warning:t=p("Warning","Warning");break;case Li.Info:t=p("Info","Info");break;case Li.Hint:t=p("Hint","Hint");break}let i=p("marker aria","{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 j_=IR=class extends gL{constructor(e,t,i,n,o,r,a){super(e,{showArrow:!0,showFrame:!0,isAccessible:!0,frameWidth:1},o),this._themeService=t,this._openerService=i,this._menuService=n,this._contextKeyService=r,this._labelService=a,this._callOnDispose=new Y,this._onDidSelectRelatedInformation=new B,this.onDidSelectRelatedInformation=this._onDidSelectRelatedInformation.event,this._severity=Li.Warning,this._backgroundColor=$.white,this._applyTheme(t.getColorTheme()),this._callOnDispose.add(t.onDidColorThemeChange(this._applyTheme.bind(this))),this.create()}_applyTheme(e){this._backgroundColor=e.getColor(eAe);let t=TR,i=YNe;this._severity===Li.Warning?(t=gS,i=QNe):this._severity===Li.Info&&(t=NR,i=JNe);const n=e.getColor(t),o=e.getColor(i);this.style({arrowColor:n,frameColor:n,headerBackgroundColor:o,primaryHeadingColor:e.getColor(Wq),secondaryHeadingColor:e.getColor(Hq)})}_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=[],i=this._menuService.createMenu(IR.TitleMenu,this._contextKeyService);Qx(i,void 0,t),this._actionbarWidget.push(t,{label:!1,icon:!0,index:0}),i.dispose()}_fillTitleIcon(e){this._icon=Q(e,he(""))}_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 XNe(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=x.lift(e),o=this.editor.getPosition(),r=o&&n.containsPosition(o)?o:n.getStartPosition();super.show(r,this.computeRequiredHeight());const a=this.editor.getModel();if(a){const l=i>1?p("problems","{0} of {1} problems",t,i):p("change","{0} of {1} problem",t,i);this.setTitle(Wr(a.uri),l)}this._icon.className=`codicon ${ER.className(Li.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()}};j_.TitleMenu=new E("gotoErrorTitleMenu");j_=IR=ZNe([Hp(1,_n),Hp(2,Bo),Hp(3,hr),Hp(4,Ne),Hp(5,Be),Hp(6,k_)],j_);const B9=Gb(Jl,Mue),W9=Gb(vs,Zb),H9=Gb(ro,Xb),TR=N("editorMarkerNavigationError.background",{dark:B9,light:B9,hcDark:gt,hcLight:gt},p("editorMarkerNavigationError","Editor marker navigation widget error color.")),YNe=N("editorMarkerNavigationError.headerBackground",{dark:Ee(TR,.1),light:Ee(TR,.1),hcDark:null,hcLight:null},p("editorMarkerNavigationErrorHeaderBackground","Editor marker navigation widget error heading background.")),gS=N("editorMarkerNavigationWarning.background",{dark:W9,light:W9,hcDark:gt,hcLight:gt},p("editorMarkerNavigationWarning","Editor marker navigation widget warning color.")),QNe=N("editorMarkerNavigationWarning.headerBackground",{dark:Ee(gS,.1),light:Ee(gS,.1),hcDark:"#0C141F",hcLight:Ee(gS,.2)},p("editorMarkerNavigationWarningBackground","Editor marker navigation widget warning heading background.")),NR=N("editorMarkerNavigationInfo.background",{dark:H9,light:H9,hcDark:gt,hcLight:gt},p("editorMarkerNavigationInfo","Editor marker navigation widget info color.")),JNe=N("editorMarkerNavigationInfo.headerBackground",{dark:Ee(NR,.1),light:Ee(NR,.1),hcDark:null,hcLight:null},p("editorMarkerNavigationInfoHeaderBackground","Editor marker navigation widget info heading background.")),eAe=N("editorMarkerNavigation.background",{dark:Sn,light:Sn,hcDark:Sn,hcLight:Sn},p("editorMarkerNavigationBackground","Editor marker navigation widget background."));var tAe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Dy=function(s,e){return function(t,i){e(t,i,s)}},Rv;let qh=Rv=class{static get(e){return e.getContribution(Rv.ID)}constructor(e,t,i,n,o){this._markerNavigationService=t,this._contextKeyService=i,this._editorService=n,this._instantiationService=o,this._sessionDispoables=new Y,this._editor=e,this._widgetVisible=TG.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(j_,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=>{var n,o,r;(!(!((n=this._model)===null||n===void 0)&&n.selected)||!x.containsPosition((o=this._model)===null||o===void 0?void 0:o.selected.marker,i.position))&&((r=this._model)===null||r===void 0||r.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:x.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()){const t=this._getOrCreateModel(this._editor.getModel().uri);t.resetIndex(),t.move(!0,this._editor.getModel(),new W(e.startLineNumber,e.startColumn)),t.selected&&this._widget.showAtMarker(t.selected.marker,t.selected.index,t.selected.total)}}async nagivate(e,t){var i,n;if(this._editor.hasModel()){const o=this._getOrCreateModel(t?void 0:this._editor.getModel().uri);if(o.move(e,this._editor.getModel(),this._editor.getPosition()),!o.selected)return;if(o.selected.marker.resource.toString()!==this._editor.getModel().uri.toString()){this._cleanUp();const r=await this._editorService.openCodeEditor({resource:o.selected.marker.resource,options:{pinned:!1,revealIfOpened:!0,selectionRevealType:2,selection:o.selected.marker}},this._editor);r&&((i=Rv.get(r))===null||i===void 0||i.close(),(n=Rv.get(r))===null||n===void 0||n.nagivate(e,t))}else this._widget.showAtMarker(o.selected.marker,o.selected.index,o.selected.total)}}};qh.ID="editor.contrib.markerController";qh=Rv=tAe([Dy(1,IG),Dy(2,Be),Dy(3,xt),Dy(4,Ne)],qh);class Hk extends me{constructor(e,t,i){super(i),this._next=e,this._multiFile=t}async run(e,t){var i;t.hasModel()&&((i=qh.get(t))===null||i===void 0||i.nagivate(this._next,this._multiFile))}}class fh extends Hk{constructor(){super(!0,!1,{id:fh.ID,label:fh.LABEL,alias:"Go to Next Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:T.focus,primary:578,weight:100},menuOpts:{menuId:j_.TitleMenu,title:fh.LABEL,icon:xi("marker-navigation-next",oe.arrowDown,p("nextMarkerIcon","Icon for goto next marker.")),group:"navigation",order:1}})}}fh.ID="editor.action.marker.next";fh.LABEL=p("markerAction.next.label","Go to Next Problem (Error, Warning, Info)");class mf extends Hk{constructor(){super(!1,!1,{id:mf.ID,label:mf.LABEL,alias:"Go to Previous Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:T.focus,primary:1602,weight:100},menuOpts:{menuId:j_.TitleMenu,title:mf.LABEL,icon:xi("marker-navigation-previous",oe.arrowUp,p("previousMarkerIcon","Icon for goto previous marker.")),group:"navigation",order:2}})}}mf.ID="editor.action.marker.prev";mf.LABEL=p("markerAction.previous.label","Go to Previous Problem (Error, Warning, Info)");class iAe extends Hk{constructor(){super(!0,!0,{id:"editor.action.marker.nextInFiles",label:p("markerAction.nextInFiles.label","Go to Next Problem in Files (Error, Warning, Info)"),alias:"Go to Next Problem in Files (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:T.focus,primary:66,weight:100},menuOpts:{menuId:E.MenubarGoMenu,title:p({},"Next &&Problem"),group:"6_problem_nav",order:1}})}}class nAe extends Hk{constructor(){super(!1,!0,{id:"editor.action.marker.prevInFiles",label:p("markerAction.previousInFiles.label","Go to Previous Problem in Files (Error, Warning, Info)"),alias:"Go to Previous Problem in Files (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:T.focus,primary:1090,weight:100},menuOpts:{menuId:E.MenubarGoMenu,title:p({},"Previous &&Problem"),group:"6_problem_nav",order:2}})}}kt(qh.ID,qh,4);te(fh);te(mf);te(iAe);te(nAe);const TG=new ue("markersNavigationVisible",!1),sAe=mn.bindToContribution(qh.get);de(new sAe({id:"closeMarkersNavigation",precondition:TG,handler:s=>s.close(),kbOpts:{weight:150,kbExpr:T.focus,primary:9,secondary:[1033]}}));var Ra;(function(s){s.NoAutoFocus="noAutoFocus",s.FocusIfVisible="focusIfVisible",s.AutoFocusImmediately="autoFocusImmediately"})(Ra||(Ra={}));class oAe extends me{constructor(){super({id:Eq,label:p({},"Show or Focus Hover"),metadata:{description:Ve("showOrFocusHoverDescription","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:[Ra.NoAutoFocus,Ra.FocusIfVisible,Ra.AutoFocusImmediately],enumDescriptions:[p("showOrFocusHover.focus.noAutoFocus","The hover will not automatically take focus."),p("showOrFocusHover.focus.focusIfVisible","The hover will take focus only if it is already visible."),p("showOrFocusHover.focus.autoFocusImmediately","The hover will automatically take focus when it appears.")],default:Ra.FocusIfVisible}}}}]},alias:"Show or Focus Hover",precondition:void 0,kbOpts:{kbExpr:T.editorTextFocus,primary:an(2089,2087),weight:100}})}run(e,t,i){if(!t.hasModel())return;const n=ws.get(t);if(!n)return;const o=i==null?void 0:i.focus;let r=Ra.FocusIfVisible;Object.values(Ra).includes(o)?r=o:typeof o=="boolean"&&o&&(r=Ra.AutoFocusImmediately);const a=d=>{const c=t.getPosition(),u=new x(c.lineNumber,c.column,c.lineNumber,c.column);n.showContentHover(u,1,1,d)},l=t.getOption(2)===2;n.isHoverVisible?r!==Ra.NoAutoFocus?n.focus():a(l):a(l||r===Ra.AutoFocusImmediately)}}class rAe extends me{constructor(){super({id:xke,label:p({},"Show Definition Preview Hover"),alias:"Show Definition Preview Hover",precondition:void 0,metadata:{description:Ve("showDefinitionPreviewHoverDescription","Show the definition preview hover in the editor.")}})}run(e,t){const i=ws.get(t);if(!i)return;const n=t.getPosition();if(!n)return;const o=new x(n.lineNumber,n.column,n.lineNumber,n.column),r=Uf.get(t);if(!r)return;r.startFindDefinitionFromCursor(n).then(()=>{i.showContentHover(o,1,1,!0)})}}class aAe extends me{constructor(){super({id:kke,label:p({},"Scroll Up Hover"),alias:"Scroll Up Hover",precondition:T.hoverFocused,kbOpts:{kbExpr:T.hoverFocused,primary:16,weight:100},metadata:{description:Ve("scrollUpHoverDescription","Scroll up the editor hover.")}})}run(e,t){const i=ws.get(t);i&&i.scrollUp()}}class lAe extends me{constructor(){super({id:Eke,label:p({},"Scroll Down Hover"),alias:"Scroll Down Hover",precondition:T.hoverFocused,kbOpts:{kbExpr:T.hoverFocused,primary:18,weight:100},metadata:{description:Ve("scrollDownHoverDescription","Scroll down the editor hover.")}})}run(e,t){const i=ws.get(t);i&&i.scrollDown()}}class dAe extends me{constructor(){super({id:Ike,label:p({},"Scroll Left Hover"),alias:"Scroll Left Hover",precondition:T.hoverFocused,kbOpts:{kbExpr:T.hoverFocused,primary:15,weight:100},metadata:{description:Ve("scrollLeftHoverDescription","Scroll left the editor hover.")}})}run(e,t){const i=ws.get(t);i&&i.scrollLeft()}}class cAe extends me{constructor(){super({id:Tke,label:p({},"Scroll Right Hover"),alias:"Scroll Right Hover",precondition:T.hoverFocused,kbOpts:{kbExpr:T.hoverFocused,primary:17,weight:100},metadata:{description:Ve("scrollRightHoverDescription","Scroll right the editor hover.")}})}run(e,t){const i=ws.get(t);i&&i.scrollRight()}}class uAe extends me{constructor(){super({id:Nke,label:p({},"Page Up Hover"),alias:"Page Up Hover",precondition:T.hoverFocused,kbOpts:{kbExpr:T.hoverFocused,primary:11,secondary:[528],weight:100},metadata:{description:Ve("pageUpHoverDescription","Page up the editor hover.")}})}run(e,t){const i=ws.get(t);i&&i.pageUp()}}class hAe extends me{constructor(){super({id:Ake,label:p({},"Page Down Hover"),alias:"Page Down Hover",precondition:T.hoverFocused,kbOpts:{kbExpr:T.hoverFocused,primary:12,secondary:[530],weight:100},metadata:{description:Ve("pageDownHoverDescription","Page down the editor hover.")}})}run(e,t){const i=ws.get(t);i&&i.pageDown()}}class gAe extends me{constructor(){super({id:Mke,label:p({},"Go To Top Hover"),alias:"Go To Bottom Hover",precondition:T.hoverFocused,kbOpts:{kbExpr:T.hoverFocused,primary:14,secondary:[2064],weight:100},metadata:{description:Ve("goToTopHoverDescription","Go to the top of the editor hover.")}})}run(e,t){const i=ws.get(t);i&&i.goToTop()}}class fAe extends me{constructor(){super({id:Rke,label:p({},"Go To Bottom Hover"),alias:"Go To Bottom Hover",precondition:T.hoverFocused,kbOpts:{kbExpr:T.hoverFocused,primary:13,secondary:[2066],weight:100},metadata:{description:Ve("goToBottomHoverDescription","Go to the bottom of the editor hover.")}})}run(e,t){const i=ws.get(t);i&&i.goToBottom()}}class pAe extends me{constructor(){super({id:_4,label:p({},"Increase Hover Verbosity Level"),alias:"Increase Hover Verbosity Level",precondition:T.hoverFocused})}run(e,t){var i;(i=ws.get(t))===null||i===void 0||i.updateFocusedMarkdownHoverVerbosityLevel(ja.Increase)}}class mAe extends me{constructor(){super({id:v4,label:p({},"Decrease Hover Verbosity Level"),alias:"Decrease Hover Verbosity Level",precondition:T.hoverFocused})}run(e,t,i){var n;(n=ws.get(t))===null||n===void 0||n.updateFocusedMarkdownHoverVerbosityLevel(ja.Decrease)}}var _Ae=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},yT=function(s,e){return function(t,i){e(t,i,s)}};const Xr=he;class vAe{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 V9={type:1,filter:{include:li.QuickFix},triggerAction:Ro.QuickFixHover};let AR=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.startLineNumber,o=i.getLineMaxColumn(n),r=[];for(const a of t){const l=a.range.startLineNumber===n?a.range.startColumn:1,d=a.range.endLineNumber===n?a.range.endColumn:o,c=this._markerDecorationsService.getMarker(i.uri,a);if(!c)continue;const u=new x(e.range.startLineNumber,l,e.range.startLineNumber,d);r.push(new vAe(this,u,c))}return r}renderHoverParts(e,t){if(!t.length)return H.None;const i=new Y;t.forEach(o=>e.fragment.appendChild(this.renderMarkerHover(o,i)));const n=t.length===1?t[0]:t.sort((o,r)=>Li.compare(o.marker.severity,r.marker.severity))[0];return this.renderMarkerStatusbar(e,n,i),i}renderMarkerHover(e,t){const i=Xr("div.hover-row");i.tabIndex=0;const n=Q(i,Xr("div.marker.hover-contents")),{source:o,message:r,code:a,relatedInformation:l}=e.marker;this._editor.applyFontInfo(n);const d=Q(n,Xr("span"));if(d.style.whiteSpace="pre-wrap",d.innerText=r,o||a)if(a&&typeof a!="string"){const c=Xr("span");if(o){const f=Q(c,Xr("span"));f.innerText=o}const u=Q(c,Xr("a.code-link"));u.setAttribute("href",a.target.toString()),t.add(K(u,"click",f=>{this._openerService.open(a.target,{allowCommands:!0}),f.preventDefault(),f.stopPropagation()}));const h=Q(u,Xr("span"));h.innerText=a.value;const g=Q(n,c);g.style.opacity="0.6",g.style.paddingLeft="6px"}else{const c=Q(n,Xr("span"));c.style.opacity="0.6",c.style.paddingLeft="6px",c.innerText=o&&a?`${o}(${a})`:o||`(${a})`}if(rs(l))for(const{message:c,resource:u,startLineNumber:h,startColumn:g}of l){const f=Q(n,Xr("div"));f.style.marginTop="8px";const m=Q(f,Xr("a"));m.innerText=`${Wr(u)}(${h}, ${g}): `,m.style.cursor="pointer",t.add(K(m,"click",v=>{v.stopPropagation(),v.preventDefault(),this._openerService&&this._openerService.open(u,{fromUserGesture:!0,editorOptions:{selection:{startLineNumber:h,startColumn:g}}}).catch(Xe)}));const _=Q(f,Xr("span"));_.innerText=c,this._editor.applyFontInfo(_)}return i}renderMarkerStatusbar(e,t,i){if(t.marker.severity===Li.Error||t.marker.severity===Li.Warning||t.marker.severity===Li.Info){const n=qh.get(this._editor);n&&e.statusBar.addAction({label:p("view problem","View Problem"),commandId:fh.ID,run:()=>{e.hide(),n.showAtMarker(t.marker),this._editor.focus()}})}if(!this._editor.getOption(91)){const n=e.statusBar.append(Xr("div"));this.recentMarkerCodeActionsInfo&&(RD.makeKey(this.recentMarkerCodeActionsInfo.marker)===RD.makeKey(t.marker)?this.recentMarkerCodeActionsInfo.hasCodeActions||(n.textContent=p("noQuickFixes","No quick fixes available")):this.recentMarkerCodeActionsInfo=void 0);const o=this.recentMarkerCodeActionsInfo&&!this.recentMarkerCodeActionsInfo.hasCodeActions?H.None:kh(()=>n.textContent=p("checkingForQuickFixes","Checking for quick fixes..."),200,i);n.textContent||(n.textContent=" ");const r=this.getCodeActions(t.marker);i.add(Ie(()=>r.cancel())),r.then(a=>{if(o.dispose(),this.recentMarkerCodeActionsInfo={marker:t.marker,hasCodeActions:a.validActions.length>0},!this.recentMarkerCodeActionsInfo.hasCodeActions){a.dispose(),n.textContent=p("noQuickFixes","No quick fixes available");return}n.style.display="none";let l=!1;i.add(Ie(()=>{l||a.dispose()})),e.statusBar.addAction({label:p("quick fixes","Quick Fix..."),commandId:u4,run:d=>{l=!0;const c=Hh.get(this._editor),u=qi(d);e.hide(),c==null||c.showCodeActions(V9,a,{x:u.left,y:u.top,width:u.width,height:u.height})}})},Xe)}}getCodeActions(e){return Dn(t=>gb(this._languageFeaturesService.codeActionProvider,this._editor.getModel(),new x(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),V9,Nc.None,t))}};AR=_Ae([yT(1,TF),yT(2,Bo),yT(3,Ce)],AR);kt(ws.ID,ws,2);te(oAe);te(rAe);te(aAe);te(lAe);te(dAe);te(cAe);te(uAe);te(hAe);te(gAe);te(fAe);te(pAe);te(mAe);ag.register(RC);ag.register(AR);zr((s,e)=>{const t=s.getColor(EU);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)}; }`))});function bo(s,e){let t=0;for(let i=0;ii-1)return[];const{tabSize:r,indentSize:a,insertSpaces:l}=s.getOptions(),d=(_,v)=>(v=v||1,xr.shiftIndent(_,_.length+v,r,a,l)),c=(_,v)=>(v=v||1,xr.unshiftIndent(_,_.length+v,r,a,l)),u=[];let h;const g=s.getLineContent(t);let f=g;h=Zt(g);let m=h;o.increaseIndentPattern&&o.increaseIndentPattern.test(f)?(m=d(m),h=d(h)):o.indentNextLinePattern&&o.indentNextLinePattern.test(f)&&(m=d(m)),t++;for(let _=t;_<=i;_++){const v=s.getLineContent(_),b=Zt(v),C=m+v.substring(b.length);o.decreaseIndentPattern&&o.decreaseIndentPattern.test(C)&&(m=c(m),h=c(h)),b!==m&&u.push(pi.replaceMove(new we(_,1,_,b.length+1),VF(m,a,l))),!(o.unIndentedLinePattern&&o.unIndentedLinePattern.test(v))&&(o.increaseIndentPattern&&o.increaseIndentPattern.test(C)?(h=d(h),m=h):o.indentNextLinePattern&&o.indentNextLinePattern.test(C)?m=d(m):m=h)}return u}var bAe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},CAe=function(s,e){return function(t,i){e(t,i,s)}};class Vk extends me{constructor(){super({id:Vk.ID,label:p("indentationToSpaces","Convert Indentation to Spaces"),alias:"Convert Indentation to Spaces",precondition:T.writable,metadata:{description:Ve("indentationToSpacesDescription","Convert the tab indentation to spaces.")}})}run(e,t){const i=t.getModel();if(!i)return;const n=i.getOptions(),o=t.getSelection();if(!o)return;const r=new DAe(o,n.tabSize);t.pushUndoStop(),t.executeCommands(this.id,[r]),t.pushUndoStop(),i.updateOptions({insertSpaces:!0})}}Vk.ID="editor.action.indentationToSpaces";class zk extends me{constructor(){super({id:zk.ID,label:p("indentationToTabs","Convert Indentation to Tabs"),alias:"Convert Indentation to Tabs",precondition:T.writable,metadata:{description:Ve("indentationToTabsDescription","Convert the spaces indentation to tabs.")}})}run(e,t){const i=t.getModel();if(!i)return;const n=i.getOptions(),o=t.getSelection();if(!o)return;const r=new LAe(o,n.tabSize);t.pushUndoStop(),t.executeCommands(this.id,[r]),t.pushUndoStop(),i.updateOptions({insertSpaces:!1})}}zk.ID="editor.action.indentationToTabs";class W4 extends me{constructor(e,t,i){super(i),this.insertSpaces=e,this.displaySizeOnly=t}run(e,t){const i=e.get(hp),n=e.get(_i),o=t.getModel();if(!o)return;const r=n.getCreationOptions(o.getLanguageId(),o.uri,o.isForSimpleWidget),a=o.getOptions(),l=[1,2,3,4,5,6,7,8].map(c=>({id:c.toString(),label:c.toString(),description:c===r.tabSize&&c===a.tabSize?p("configuredTabSize","Configured Tab Size"):c===r.tabSize?p("defaultTabSize","Default Tab Size"):c===a.tabSize?p("currentTabSize","Current Tab Size"):void 0})),d=Math.min(o.getOptions().tabSize-1,7);setTimeout(()=>{i.pick(l,{placeHolder:p({},"Select Tab Size for Current File"),activeItem:l[d]}).then(c=>{if(c&&o&&!o.isDisposed()){const u=parseInt(c.label,10);this.displaySizeOnly?o.updateOptions({tabSize:u}):o.updateOptions({tabSize:u,indentSize:u,insertSpaces:this.insertSpaces})}})},50)}}class Uk extends W4{constructor(){super(!1,!1,{id:Uk.ID,label:p("indentUsingTabs","Indent Using Tabs"),alias:"Indent Using Tabs",precondition:void 0,metadata:{description:Ve("indentUsingTabsDescription","Use indentation with tabs.")}})}}Uk.ID="editor.action.indentUsingTabs";class $k extends W4{constructor(){super(!0,!1,{id:$k.ID,label:p("indentUsingSpaces","Indent Using Spaces"),alias:"Indent Using Spaces",precondition:void 0,metadata:{description:Ve("indentUsingSpacesDescription","Use indentation with spaces.")}})}}$k.ID="editor.action.indentUsingSpaces";class jk extends W4{constructor(){super(!0,!0,{id:jk.ID,label:p("changeTabDisplaySize","Change Tab Display Size"),alias:"Change Tab Display Size",precondition:void 0,metadata:{description:Ve("changeTabDisplaySizeDescription","Change the space size equivalent of the tab.")}})}}jk.ID="editor.action.changeTabDisplaySize";class Kk extends me{constructor(){super({id:Kk.ID,label:p("detectIndentation","Detect Indentation from Content"),alias:"Detect Indentation from Content",precondition:void 0,metadata:{description:Ve("detectIndentationDescription","Detect the indentation from content.")}})}run(e,t){const i=e.get(_i),n=t.getModel();if(!n)return;const o=i.getCreationOptions(n.getLanguageId(),n.uri,n.isForSimpleWidget);n.detectIndentation(o.insertSpaces,o.tabSize)}}Kk.ID="editor.action.detectIndentation";class wAe extends me{constructor(){super({id:"editor.action.reindentlines",label:p("editor.reindentlines","Reindent Lines"),alias:"Reindent Lines",precondition:T.writable,metadata:{description:Ve("editor.reindentlinesDescription","Reindent the lines of the editor.")}})}run(e,t){const i=e.get(Yt),n=t.getModel();if(!n)return;const o=NG(n,i,1,n.getLineCount());o.length>0&&(t.pushUndoStop(),t.executeEdits(this.id,o),t.pushUndoStop())}}class yAe extends me{constructor(){super({id:"editor.action.reindentselectedlines",label:p("editor.reindentselectedlines","Reindent Selected Lines"),alias:"Reindent Selected Lines",precondition:T.writable,metadata:{description:Ve("editor.reindentselectedlinesDescription","Reindent the selected lines of the editor.")}})}run(e,t){const i=e.get(Yt),n=t.getModel();if(!n)return;const o=t.getSelections();if(o===null)return;const r=[];for(const a of o){let l=a.startLineNumber,d=a.endLineNumber;if(l!==d&&a.endColumn===1&&d--,l===1){if(l===d)continue}else l--;const c=NG(n,i,l,d);r.push(...c)}r.length>0&&(t.pushUndoStop(),t.executeEdits(this.id,r),t.pushUndoStop())}}class SAe{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(x.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 KC=class{constructor(e,t){this.editor=e,this._languageConfigurationService=t,this.callOnDispose=new Y,this.callOnModel=new Y,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(12)<4||this.editor.getOption(55))&&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||!i.tokenization.isCheapToTokenize(e.getStartPosition().lineNumber))return;const n=this.editor.getOption(12),{tabSize:o,indentSize:r,insertSpaces:a}=i.getOptions(),l=[],d={shiftIndent:g=>xr.shiftIndent(g,g.length+1,o,r,a),unshiftIndent:g=>xr.unshiftIndent(g,g.length+1,o,r,a)};let c=e.startLineNumber;for(;c<=e.endLineNumber;){if(this.shouldIgnoreLine(i,c)){c++;continue}break}if(c>e.endLineNumber)return;let u=i.getLineContent(c);if(!/\S/.test(u.substring(0,e.startColumn-1))){const g=qv(n,i,i.getLanguageId(),c,d,this._languageConfigurationService);if(g!==null){const f=Zt(u),m=bo(g,o),_=bo(f,o);if(m!==_){const v=_b(m,o,a);l.push({range:new x(c,1,c,f.length+1),text:v}),u=v+u.substr(f.length)}else{const v=e$(i,c,this._languageConfigurationService);if(v===0||v===8)return}}}const h=c;for(;ci.tokenization.getLineTokens(m),getLanguageId:()=>i.getLanguageId(),getLanguageIdAtPosition:(m,_)=>i.getLanguageIdAtPosition(m,_)},getLineContent:m=>m===h?u:i.getLineContent(m)},i.getLanguageId(),c+1,d,this._languageConfigurationService);if(f!==null){const m=bo(f,o),_=bo(Zt(i.getLineContent(c+1)),o);if(m!==_){const v=m-_;for(let b=c+1;b<=e.endLineNumber;b++){const C=i.getLineContent(b),w=Zt(C),D=bo(w,o)+v,L=_b(D,o,a);L!==w&&l.push({range:new x(b,1,b,w.length+1),text:L})}}}}if(l.length>0){this.editor.pushUndoStop();const g=new SAe(l,this.editor.getSelection());this.editor.executeCommand("autoIndentOnPaste",g),this.editor.pushUndoStop()}}shouldIgnoreLine(e,t){e.tokenization.forceTokenization(t);const i=e.getLineFirstNonWhitespaceColumn(t);if(i===0)return!0;const n=e.tokenization.getLineTokens(t);if(n.getCount()>0){const o=n.findTokenIndexAtOffset(i);if(o>=0&&n.getStandardTokenType(o)===1)return!0}return!1}dispose(){this.callOnDispose.dispose(),this.callOnModel.dispose()}};KC.ID="editor.contrib.autoIndentOnPaste";KC=bAe([CAe(1,Yt)],KC);function AG(s,e,t,i){if(s.getLineCount()===1&&s.getLineMaxColumn(1)===1)return;let n="";for(let r=0;r=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},EAe=function(s,e){return function(t,i){e(t,i,s)}},fS;let Gh=fS=class{static get(e){return e.getContribution(fS.ID)}constructor(e,t){this.editor=e,this.editorWorkerService=t,this.decorations=this.editor.createDecorationsCollection()}dispose(){}run(e,t){var i;(i=this.currentRequest)===null||i===void 0||i.cancel();const n=this.editor.getSelection(),o=this.editor.getModel();if(!o||!n)return;let r=n;if(r.startLineNumber!==r.endLineNumber)return;const a=new MK(this.editor,5),l=o.uri;return this.editorWorkerService.canNavigateValueSet(l)?(this.currentRequest=Dn(d=>this.editorWorkerService.navigateValueSet(l,r,t)),this.currentRequest.then(d=>{var c;if(!d||!d.range||!d.value||!a.validate(this.editor))return;const u=x.lift(d.range);let h=d.range;const g=d.value.length-(r.endColumn-r.startColumn);h={startLineNumber:h.startLineNumber,startColumn:h.startColumn,endLineNumber:h.endLineNumber,endColumn:h.startColumn+d.value.length},g>1&&(r=new we(r.startLineNumber,r.startColumn,r.endLineNumber,r.endColumn+g-1));const f=new xAe(u,r,d.value);this.editor.pushUndoStop(),this.editor.executeCommand(e,f),this.editor.pushUndoStop(),this.decorations.set([{range:h,options:fS.DECORATION}]),(c=this.decorationRemover)===null||c===void 0||c.cancel(),this.decorationRemover=xh(350),this.decorationRemover.then(()=>this.decorations.clear()).catch(Xe)}).catch(Xe)):Promise.resolve(void 0)}};Gh.ID="editor.contrib.inPlaceReplaceController";Gh.DECORATION=Ye.register({description:"in-place-replace",className:"valueSetReplacement"});Gh=fS=kAe([EAe(1,jr)],Gh);class IAe extends me{constructor(){super({id:"editor.action.inPlaceReplace.up",label:p("InPlaceReplaceAction.previous.label","Replace with Previous Value"),alias:"Replace with Previous Value",precondition:T.writable,kbOpts:{kbExpr:T.editorTextFocus,primary:3159,weight:100}})}run(e,t){const i=Gh.get(t);return i?i.run(this.id,!1):Promise.resolve(void 0)}}class TAe extends me{constructor(){super({id:"editor.action.inPlaceReplace.down",label:p("InPlaceReplaceAction.next.label","Replace with Next Value"),alias:"Replace with Next Value",precondition:T.writable,kbOpts:{kbExpr:T.editorTextFocus,primary:3161,weight:100}})}run(e,t){const i=Gh.get(t);return i?i.run(this.id,!0):Promise.resolve(void 0)}}kt(Gh.ID,Gh,4);te(IAe);te(TAe);class NAe extends me{constructor(){super({id:"expandLineSelection",label:p("expandLineSelection","Expand Line Selection"),alias:"Expand Line Selection",precondition:void 0,kbOpts:{weight:0,kbExpr:T.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,On.expandLineSelection(n,n.getCursorStates())),n.revealAllCursors(i.source,!0)}}te(NAe);class AAe{constructor(e,t,i){this._selection=e,this._cursors=t,this._selectionId=null,this._trimInRegexesAndStrings=i}getEditOperations(e,t){const i=MAe(e,this._cursors,this._trimInRegexesAndStrings);for(let n=0,o=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,o=0;const r=e.length;for(let a=1,l=s.getLineCount();a<=l;a++){const d=s.getLineContent(a),c=d.length+1;let u=0;if(o=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},PAe=function(s,e){return function(t,i){e(t,i,s)}};let MR=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.getLineCount();if(this._isMovingDown&&this._selection.endLineNumber===i){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 n=this._selection;n.startLineNumbere.tokenization.getLineTokens(c),getLanguageId:()=>e.getLanguageId(),getLanguageIdAtPosition:(c,u)=>e.getLanguageIdAtPosition(c,u)},getLineContent:null};if(n.startLineNumber===n.endLineNumber&&e.getLineMaxColumn(n.startLineNumber)===1){const c=n.startLineNumber,u=this._isMovingDown?c+1:c-1;e.getLineMaxColumn(u)===1?t.addEditOperation(new x(1,1,1,1),null):(t.addEditOperation(new x(c,1,c,1),e.getLineContent(u)),t.addEditOperation(new x(u,1,u,e.getLineMaxColumn(u)),null)),n=new we(u,1,u,1)}else{let c,u;if(this._isMovingDown){c=n.endLineNumber+1,u=e.getLineContent(c),t.addEditOperation(new x(c-1,e.getLineMaxColumn(c-1),c,e.getLineMaxColumn(c)),null);let h=u;if(this.shouldAutoIndent(e,n)){const g=this.matchEnterRule(e,l,o,c,n.startLineNumber-1);if(g!==null){const m=Zt(e.getLineContent(c)),_=g+bo(m,o);h=_b(_,o,a)+this.trimStart(u)}else{d.getLineContent=_=>_===n.startLineNumber?e.getLineContent(c):e.getLineContent(_);const m=qv(this._autoIndent,d,e.getLanguageIdAtPosition(c,1),n.startLineNumber,l,this._languageConfigurationService);if(m!==null){const _=Zt(e.getLineContent(c)),v=bo(m,o),b=bo(_,o);v!==b&&(h=_b(v,o,a)+this.trimStart(u))}}t.addEditOperation(new x(n.startLineNumber,1,n.startLineNumber,1),h+` `);const f=this.matchEnterRuleMovingDown(e,l,o,n.startLineNumber,c,h);if(f!==null)f!==0&&this.getIndentEditsOfMovingBlock(e,t,n,o,a,f);else{d.getLineContent=_=>_===n.startLineNumber?h:_>=n.startLineNumber+1&&_<=n.endLineNumber+1?e.getLineContent(_-1):e.getLineContent(_);const m=qv(this._autoIndent,d,e.getLanguageIdAtPosition(c,1),n.startLineNumber+1,l,this._languageConfigurationService);if(m!==null){const _=Zt(e.getLineContent(n.startLineNumber)),v=bo(m,o),b=bo(_,o);if(v!==b){const C=v-b;this.getIndentEditsOfMovingBlock(e,t,n,o,a,C)}}}}else t.addEditOperation(new x(n.startLineNumber,1,n.startLineNumber,1),h+` `)}else if(c=n.startLineNumber-1,u=e.getLineContent(c),t.addEditOperation(new x(c,1,c+1,1),null),t.addEditOperation(new x(n.endLineNumber,e.getLineMaxColumn(n.endLineNumber),n.endLineNumber,e.getLineMaxColumn(n.endLineNumber)),` `+u),this.shouldAutoIndent(e,n)){d.getLineContent=g=>g===c?e.getLineContent(n.startLineNumber):e.getLineContent(g);const h=this.matchEnterRule(e,l,o,n.startLineNumber,n.startLineNumber-2);if(h!==null)h!==0&&this.getIndentEditsOfMovingBlock(e,t,n,o,a,h);else{const g=qv(this._autoIndent,d,e.getLanguageIdAtPosition(n.startLineNumber,1),c,l,this._languageConfigurationService);if(g!==null){const f=Zt(e.getLineContent(n.startLineNumber)),m=bo(g,o),_=bo(f,o);if(m!==_){const v=m-_;this.getIndentEditsOfMovingBlock(e,t,n,o,a,v)}}}}}this._selectionId=t.trackSelection(n)}buildIndentConverter(e,t,i){return{shiftIndent:n=>xr.shiftIndent(n,n.length+1,e,t,i),unshiftIndent:n=>xr.unshiftIndent(n,n.length+1,e,t,i)}}parseEnterResult(e,t,i,n,o){if(o){let r=o.indentation;o.indentAction===Qi.None||o.indentAction===Qi.Indent?r=o.indentation+o.appendText:o.indentAction===Qi.IndentOutdent?r=o.indentation:o.indentAction===Qi.Outdent&&(r=t.unshiftIndent(o.indentation)+o.appendText);const a=e.getLineContent(n);if(this.trimStart(a).indexOf(this.trimStart(r))>=0){const l=Zt(e.getLineContent(n));let d=Zt(r);const c=e$(e,n,this._languageConfigurationService);c!==null&&c&2&&(d=t.unshiftIndent(d));const u=bo(d,i),h=bo(l,i);return u-h}}return null}matchEnterRuleMovingDown(e,t,i,n,o,r){if(Ya(r)>=0){const a=e.getLineMaxColumn(o),l=Fm(this._autoIndent,e,new x(o,a,o,a),this._languageConfigurationService);return this.parseEnterResult(e,t,i,n,l)}else{let a=n-1;for(;a>=1;){const c=e.getLineContent(a);if(Ya(c)>=0)break;a--}if(a<1||n>e.getLineCount())return null;const l=e.getLineMaxColumn(a),d=Fm(this._autoIndent,e,new x(a,l,a,l),this._languageConfigurationService);return this.parseEnterResult(e,t,i,n,d)}}matchEnterRule(e,t,i,n,o,r){let a=o;for(;a>=1;){let c;if(a===o&&r!==void 0?c=r:c=e.getLineContent(a),Ya(c)>=0)break;a--}if(a<1||n>e.getLineCount())return null;const l=e.getLineMaxColumn(a),d=Fm(this._autoIndent,e,new x(a,l,a,l),this._languageConfigurationService);return this.parseEnterResult(e,t,i,n,d)}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,o,r){for(let a=i.startLineNumber;a<=i.endLineNumber;a++){const l=e.getLineContent(a),d=Zt(l),u=bo(d,n)+r,h=_b(u,n,o);h!==d&&(t.addEditOperation(new x(a,1,a,d.length+1),h),a===i.endLineNumber&&i.endColumn<=d.length+1&&h===""&&(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 o=[];for(let a=i;a<=n;a++)o.push(s.getLineContent(a));let r=o.slice(0);return r.sort(ph.getCollator().compare),t===!0&&(r=r.reverse()),{startLineNumber:i,endLineNumber:n,before:o,after:r}}function FAe(s,e,t){const i=RG(s,e,t);return i?pi.replace(new x(i.startLineNumber,1,i.endLineNumber,s.getLineMaxColumn(i.endLineNumber)),i.after.join(` `)):null}class PG extends me{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)=>x.compareRangesUsingStarts(r.selection,a.selection));let n=i[0];for(let r=1;rnew W(c.positionLineNumber,c.positionColumn)));const o=t.getSelection();if(o===null)return;const r=e.get(rt),a=t.getModel(),l=r.getValue("files.trimTrailingWhitespaceInRegexAndStrings",{overrideIdentifier:a==null?void 0:a.getLanguageId(),resource:a==null?void 0:a.uri}),d=new AAe(o,n,l);t.pushUndoStop(),t.executeCommands(this.id,[d]),t.pushUndoStop()}}qk.ID="editor.action.trimTrailingWhitespace";class jAe extends me{constructor(){super({id:"editor.action.deleteLines",label:p("lines.delete","Delete Line"),alias:"Delete Line",precondition:T.writable,kbOpts:{kbExpr:T.textInputFocus,primary:3113,weight:100}})}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 o=0;const r=[],a=[];for(let l=0,d=i.length;l1&&(u-=1,g=n.getLineMaxColumn(u)),r.push(pi.replace(new we(u,g,h,f),"")),a.push(new we(u-o,c.positionColumn,u-o,c.positionColumn)),o+=c.endLineNumber-c.startLineNumber+1}t.pushUndoStop(),t.executeEdits(this.id,r,a),t.pushUndoStop()}_getLinesToRemove(e){const t=e.getSelections().map(o=>{let r=o.endLineNumber;return o.startLineNumbero.startLineNumber===r.startLineNumber?o.endLineNumber-r.endLineNumber:o.startLineNumber-r.startLineNumber);const i=[];let n=t[0];for(let o=1;o=t[o].startLineNumber?n.endLineNumber=t[o].endLineNumber:(i.push(n),n=t[o]);return i.push(n),i}}class KAe extends me{constructor(){super({id:"editor.action.indentLines",label:p("lines.indent","Indent Line"),alias:"Indent Line",precondition:T.writable,kbOpts:{kbExpr:T.editorTextFocus,primary:2142,weight:100}})}run(e,t){const i=t._getViewModel();i&&(t.pushUndoStop(),t.executeCommands(this.id,bi.indent(i.cursorConfig,t.getModel(),t.getSelections())),t.pushUndoStop())}}class qAe extends me{constructor(){super({id:"editor.action.outdentLines",label:p("lines.outdent","Outdent Line"),alias:"Outdent Line",precondition:T.writable,kbOpts:{kbExpr:T.editorTextFocus,primary:2140,weight:100}})}run(e,t){Om.Outdent.runEditorCommand(e,t,null)}}class GAe extends me{constructor(){super({id:"editor.action.insertLineBefore",label:p("lines.insertBefore","Insert Line Above"),alias:"Insert Line Above",precondition:T.writable,kbOpts:{kbExpr:T.editorTextFocus,primary:3075,weight:100}})}run(e,t){const i=t._getViewModel();i&&(t.pushUndoStop(),t.executeCommands(this.id,bi.lineInsertBefore(i.cursorConfig,t.getModel(),t.getSelections())))}}class ZAe extends me{constructor(){super({id:"editor.action.insertLineAfter",label:p("lines.insertAfter","Insert Line Below"),alias:"Insert Line Below",precondition:T.writable,kbOpts:{kbExpr:T.editorTextFocus,primary:2051,weight:100}})}run(e,t){const i=t._getViewModel();i&&(t.pushUndoStop(),t.executeCommands(this.id,bi.lineInsertAfter(i.cursorConfig,t.getModel(),t.getSelections())))}}class BG extends me{run(e,t){if(!t.hasModel())return;const i=t.getSelection(),n=this._getRangesToDelete(t),o=[];for(let l=0,d=n.length-1;lpi.replace(l,""));t.pushUndoStop(),t.executeEdits(this.id,a,r),t.pushUndoStop()}}class XAe extends BG{constructor(){super({id:"deleteAllLeft",label:p("lines.deleteAllLeft","Delete All Left"),alias:"Delete All Left",precondition:T.writable,kbOpts:{kbExpr:T.textInputFocus,primary:0,mac:{primary:2049},weight:100}})}_getEndCursorState(e,t){let i=null;const n=[];let o=0;return t.forEach(r=>{let a;if(r.endColumn===1&&o>0){const l=r.startLineNumber-o;a=new we(l,r.startColumn,l,r.startColumn)}else a=new we(r.startLineNumber,r.startColumn,r.startLineNumber,r.startColumn);o+=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(x.compareRangesUsingStarts),i=i.map(o=>{if(o.isEmpty())if(o.startColumn===1){const r=Math.max(1,o.startLineNumber-1),a=o.startLineNumber===1?1:n.getLineLength(r)+1;return new x(r,a,o.startLineNumber,1)}else return new x(o.startLineNumber,1,o.startLineNumber,o.startColumn);else return new x(o.startLineNumber,1,o.endLineNumber,o.endColumn)}),i)}}class YAe extends BG{constructor(){super({id:"deleteAllRight",label:p("lines.deleteAllRight","Delete All Right"),alias:"Delete All Right",precondition:T.writable,kbOpts:{kbExpr:T.textInputFocus,primary:0,mac:{primary:297,secondary:[2068]},weight:100}})}_getEndCursorState(e,t){let i=null;const n=[];for(let o=0,r=t.length,a=0;o{if(o.isEmpty()){const r=t.getLineMaxColumn(o.startLineNumber);return o.startColumn===r?new x(o.startLineNumber,o.startColumn,o.startLineNumber+1,1):new x(o.startLineNumber,o.startColumn,o.startLineNumber,r)}return o});return n.sort(x.compareRangesUsingStarts),n}}class QAe extends me{constructor(){super({id:"editor.action.joinLines",label:p("lines.joinLines","Join Lines"),alias:"Join Lines",precondition:T.writable,kbOpts:{kbExpr:T.editorTextFocus,primary:0,mac:{primary:296},weight:100}})}run(e,t){const i=t.getSelections();if(i===null)return;let n=t.getSelection();if(n===null)return;i.sort(x.compareRangesUsingStarts);const o=[],r=i.reduce((h,g)=>h.isEmpty()?h.endLineNumber===g.startLineNumber?(n.equalsSelection(h)&&(n=g),g):g.startLineNumber>h.endLineNumber+1?(o.push(h),g):new we(h.startLineNumber,h.startColumn,g.endLineNumber,g.endColumn):g.startLineNumber>h.endLineNumber?(o.push(h),g):new we(h.startLineNumber,h.startColumn,g.endLineNumber,g.endColumn));o.push(r);const a=t.getModel();if(a===null)return;const l=[],d=[];let c=n,u=0;for(let h=0,g=o.length;h=1){let O=!0;y===""&&(O=!1),O&&(y.charAt(y.length-1)===" "||y.charAt(y.length-1)===" ")&&(O=!1,y=y.replace(/[\s\uFEFF\xA0]+$/g," "));const R=k.substr(I-1);y+=(O?" ":"")+R,O?v=R.length+1:v=R.length}else v=0}const D=new x(m,_,b,C);if(!D.isEmpty()){let L;f.isEmpty()?(l.push(pi.replace(D,y)),L=new we(D.startLineNumber-u,y.length-v+1,m-u,y.length-v+1)):f.startLineNumber===f.endLineNumber?(l.push(pi.replace(D,y)),L=new we(f.startLineNumber-u,f.startColumn,f.endLineNumber-u,f.endColumn)):(l.push(pi.replace(D,y)),L=new we(f.startLineNumber-u,f.startColumn,f.startLineNumber-u,y.length-w)),x.intersectRanges(D,n)!==null?c=L:d.push(L)}u+=D.endLineNumber-D.startLineNumber}d.unshift(c),t.pushUndoStop(),t.executeEdits(this.id,l,d),t.pushUndoStop()}}class JAe extends me{constructor(){super({id:"editor.action.transpose",label:p("editor.transpose","Transpose Characters around the Cursor"),alias:"Transpose Characters around the Cursor",precondition:T.writable})}run(e,t){const i=t.getSelections();if(i===null)return;const n=t.getModel();if(n===null)return;const o=[];for(let r=0,a=i.length;r=c){if(d.lineNumber===n.getLineCount())continue;const u=new x(d.lineNumber,Math.max(1,d.column-1),d.lineNumber+1,1),h=n.getValueInRange(u).split("").reverse().join("");o.push(new qn(new we(d.lineNumber,Math.max(1,d.column-1),d.lineNumber+1,1),h))}else{const u=new x(d.lineNumber,Math.max(1,d.column-1),d.lineNumber,d.column+1),h=n.getValueInRange(u).split("").reverse().join("");o.push(new zF(u,h,new we(d.lineNumber,d.column+1,d.lineNumber,d.column+1)))}}t.pushUndoStop(),t.executeCommands(this.id,o),t.pushUndoStop()}}class Cp extends me{run(e,t){const i=t.getSelections();if(i===null)return;const n=t.getModel();if(n===null)return;const o=t.getOption(131),r=[];for(const a of i)if(a.isEmpty()){const l=a.getStartPosition(),d=t.getConfiguredWordAtPosition(l);if(!d)continue;const c=new x(l.lineNumber,d.startColumn,l.lineNumber,d.endColumn),u=n.getValueInRange(c);r.push(pi.replace(c,this._modifyText(u,o)))}else{const l=n.getValueInRange(a);r.push(pi.replace(a,this._modifyText(l,o)))}t.pushUndoStop(),t.executeEdits(this.id,r),t.pushUndoStop()}}class e2e extends Cp{constructor(){super({id:"editor.action.transformToUppercase",label:p("editor.transformToUppercase","Transform to Uppercase"),alias:"Transform to Uppercase",precondition:T.writable})}_modifyText(e,t){return e.toLocaleUpperCase()}}class t2e extends Cp{constructor(){super({id:"editor.action.transformToLowercase",label:p("editor.transformToLowercase","Transform to Lowercase"),alias:"Transform to Lowercase",precondition:T.writable})}_modifyText(e,t){return e.toLocaleLowerCase()}}class du{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 qC extends Cp{constructor(){super({id:"editor.action.transformToTitlecase",label:p("editor.transformToTitlecase","Transform to Title Case"),alias:"Transform to Title Case",precondition:T.writable})}_modifyText(e,t){const i=qC.titleBoundary.get();return i?e.toLocaleLowerCase().replace(i,n=>n.toLocaleUpperCase()):e}}qC.titleBoundary=new du("(^|[^\\p{L}\\p{N}']|((^|\\P{L})'))\\p{L}","gmu");class mh extends Cp{constructor(){super({id:"editor.action.transformToSnakecase",label:p("editor.transformToSnakecase","Transform to Snake Case"),alias:"Transform to Snake Case",precondition:T.writable})}_modifyText(e,t){const i=mh.caseBoundary.get(),n=mh.singleLetters.get();return!i||!n?e:e.replace(i,"$1_$2").replace(n,"$1_$2$3").toLocaleLowerCase()}}mh.caseBoundary=new du("(\\p{Ll})(\\p{Lu})","gmu");mh.singleLetters=new du("(\\p{Lu}|\\p{N})(\\p{Lu})(\\p{Ll})","gmu");class GC extends Cp{constructor(){super({id:"editor.action.transformToCamelcase",label:p("editor.transformToCamelcase","Transform to Camel Case"),alias:"Transform to Camel Case",precondition:T.writable})}_modifyText(e,t){const i=GC.wordBoundary.get();if(!i)return e;const n=e.split(i);return n.shift()+n.map(r=>r.substring(0,1).toLocaleUpperCase()+r.substring(1)).join("")}}GC.wordBoundary=new du("[_\\s-]","gm");class $f extends Cp{constructor(){super({id:"editor.action.transformToPascalcase",label:p("editor.transformToPascalcase","Transform to Pascal Case"),alias:"Transform to Pascal Case",precondition:T.writable})}_modifyText(e,t){const i=$f.wordBoundary.get(),n=$f.wordBoundaryToMaintain.get();return!i||!n?e:e.split(n).map(a=>a.split(i)).flat().map(a=>a.substring(0,1).toLocaleUpperCase()+a.substring(1)).join("")}}$f.wordBoundary=new du("[_\\s-]","gm");$f.wordBoundaryToMaintain=new du("(?<=\\.)","gm");class Rc extends Cp{static isSupported(){return[this.caseBoundary,this.singleLetters,this.underscoreBoundary].every(t=>t.isSupported())}constructor(){super({id:"editor.action.transformToKebabcase",label:p("editor.transformToKebabcase","Transform to Kebab Case"),alias:"Transform to Kebab Case",precondition:T.writable})}_modifyText(e,t){const i=Rc.caseBoundary.get(),n=Rc.singleLetters.get(),o=Rc.underscoreBoundary.get();return!i||!n||!o?e:e.replace(o,"$1-$3").replace(i,"$1-$2").replace(n,"$1-$2").toLocaleLowerCase()}}Rc.caseBoundary=new du("(\\p{Ll})(\\p{Lu})","gmu");Rc.singleLetters=new du("(\\p{Lu}|\\p{N})(\\p{Lu}\\p{Ll})","gmu");Rc.underscoreBoundary=new du("(\\S)(_)(\\S)","gm");te(OAe);te(BAe);te(WAe);te(HAe);te(VAe);te(zAe);te(UAe);te($Ae);te(qk);te(jAe);te(KAe);te(qAe);te(GAe);te(ZAe);te(XAe);te(YAe);te(QAe);te(JAe);te(e2e);te(t2e);mh.caseBoundary.isSupported()&&mh.singleLetters.isSupported()&&te(mh);GC.wordBoundary.isSupported()&&te(GC);$f.wordBoundary.isSupported()&&te($f);qC.titleBoundary.isSupported()&&te(qC);Rc.isSupported()&&te(Rc);var i2e=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Ly=function(s,e){return function(t,i){e(t,i,s)}},pS;const WG=new ue("LinkedEditingInputVisible",!1),n2e="linked-editing-decoration";let Zh=pS=class extends H{static get(e){return e.getContribution(pS.ID)}constructor(e,t,i,n,o){super(),this.languageConfigurationService=n,this._syncRangesToken=0,this._localToDispose=this._register(new Y),this._editor=e,this._providers=i.linkedEditingRangeProvider,this._enabled=!1,this._visibleContextKey=WG.bindTo(t),this._debounceInformation=o.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 Y),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(70)||r.hasChanged(93))&&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(70)||this._editor.getOption(93))&&this._providers.has(t);if(i===this._enabled&&!e||(this._enabled=i,this.clearRanges(),this._localToDispose.clear(),!i||t===null))return;this._localToDispose.add(le.runAndSubscribe(t.onDidChangeLanguageConfiguration,()=>{this._languageWordPattern=this.languageConfigurationService.getLanguageConfiguration(t.getLanguageId()).getWordDefinition()}));const n=new _a(this._debounceInformation.get(t)),o=()=>{var l;this._rangeUpdateTriggerPromise=n.trigger(()=>this.updateRanges(),(l=this._debounceDuration)!==null&&l!==void 0?l:this._debounceInformation.get(t))},r=new _a(0),a=l=>{this._rangeSyncTriggerPromise=r.trigger(()=>this._syncRanges(l))};this._localToDispose.add(this._editor.onDidChangeCursorPosition(()=>{o()})),this._localToDispose.add(this._editor.onDidChangeModelContent(l=>{if(!this._ignoreChangeEvent&&this._currentDecorations.length>0){const d=this._currentDecorations.getRange(0);if(d&&l.changes.every(c=>d.intersectRanges(c.range))){a(this._syncRangesToken);return}}o()})),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 o=[];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.clearRanges(),this._currentRequestPosition=t,this._currentRequestModelVersion=n;const o=this._currentRequestCts=new Vi;try{const r=new Jn(!1),a=await HG(this._providers,i,t,o.token);if(this._debounceInformation.update(i,r.elapsed()),o!==this._currentRequestCts||(this._currentRequestCts=null,n!==i.getVersionId()))return;let l=[];a!=null&&a.ranges&&(l=a.ranges),this._currentWordPattern=(a==null?void 0:a.wordPattern)||this._languageWordPattern;let d=!1;for(let u=0,h=l.length;u({range:u,options:pS.DECORATION}));this._visibleContextKey.set(!0),this._currentDecorations.set(c),this._syncRangesToken++}catch(r){Id(r)||Xe(r),(this._currentRequestCts===o||!this._currentRequestCts)&&this.clearRanges()}}};Zh.ID="editor.contrib.linkedEditing";Zh.DECORATION=Ye.register({description:"linked-editing",stickiness:0,className:n2e});Zh=pS=i2e([Ly(1,Be),Ly(2,Ce),Ly(3,Yt),Ly(4,Ur)],Zh);class s2e extends me{constructor(){super({id:"editor.action.linkedEditing",label:p("linkedEditing.label","Start Linked Editing"),alias:"Start Linked Editing",precondition:G.and(T.writable,T.hasRenameProvider),kbOpts:{kbExpr:T.editorTextFocus,primary:3132,weight:100}})}runCommand(e,t){const i=e.get(xt),[n,o]=Array.isArray(t)&&t||[void 0,void 0];return Ae.isUri(n)&&W.isIPosition(o)?i.openCodeEditor({resource:n},i.getActiveCodeEditor()).then(r=>{r&&(r.setPosition(o),r.invokeWithinContext(a=>(this.reportTelemetry(a,r),this.run(a,r))))},Xe):super.runCommand(e,t)}run(e,t){const i=Zh.get(t);return i?Promise.resolve(i.updateRanges(!0)):Promise.resolve()}}const o2e=mn.bindToContribution(Zh.get);de(new o2e({id:"cancelLinkedEditingInput",precondition:WG,handler:s=>s.clearRanges(),kbOpts:{kbExpr:T.editorTextFocus,weight:199,primary:9,secondary:[1033]}}));function HG(s,e,t,i){const n=s.ordered(e);return sF(n.map(o=>async()=>{try{return await o.provideLinkedEditingRanges(e,t,i)}catch(r){Ai(r);return}}),o=>!!o&&rs(o==null?void 0:o.ranges))}N("editor.linkedEditingBackground",{dark:$.fromHex("#f00").transparent(.3),light:$.fromHex("#f00").transparent(.3),hcDark:$.fromHex("#f00").transparent(.3),hcLight:$.white},p("editorLinkedEditingBackground","Background color when the editor auto renames on type."));Ad("_executeLinkedEditingProvider",(s,e,t)=>{const{linkedEditingRangeProvider:i}=s.get(Ce);return HG(i,e,t,dt.None)});kt(Zh.ID,Zh,1);te(s2e);let r2e=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 xL{constructor(e){this._disposables=new Y;let t=[];for(const[i,n]of e){const o=i.links.map(r=>new r2e(r,n));t=xL._union(t,o),jL(i)&&this._disposables.add(i)}this.links=t}dispose(){this._disposables.dispose(),this.links.length=0}static _union(e,t){const i=[];let n,o,r,a;for(n=0,r=0,o=e.length,a=t.length;nPromise.resolve(o.provideLinks(e,t)).then(a=>{a&&(i[r]=[a,o])},Ai));return Promise.all(n).then(()=>{const o=new xL(pd(i));return t.isCancellationRequested?(o.dispose(),new xL([])):o})}pt.registerCommand("_executeLinkProvider",async(s,...e)=>{let[t,i]=e;yt(t instanceof Ae),typeof i!="number"&&(i=0);const{linkProvider:n}=s.get(Ce),o=s.get(_i).getModel(t);if(!o)return[];const r=await VG(n,o,dt.None);if(!r)return[];for(let l=0;l=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},xy=function(s,e){return function(t,i){e(t,i,s)}},RR;let K_=RR=class extends H{static get(e){return e.getContribution(RR.ID)}constructor(e,t,i,n,o){super(),this.editor=e,this.openerService=t,this.notificationService=i,this.languageFeaturesService=n,this.providers=this.languageFeaturesService.linkProvider,this.debounceInformation=o.for(this.providers,"Links",{min:1e3,max:4e3}),this.computeLinks=this._register(new Wt(()=>this.computeLinksNow(),1e3)),this.computePromise=null,this.activeLinksList=null,this.currentOccurrences={},this.activeLinkDecorationId=null;const r=this._register(new vk(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(71)&&(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(71))return;const e=this.editor.getModel();if(!e.isTooLargeForSyncing()&&this.providers.has(e)){this.activeLinksList&&(this.activeLinksList.dispose(),this.activeLinksList=null),this.computePromise=Dn(t=>VG(this.providers,e,t));try{const t=new Jn(!1);if(this.activeLinksList=await this.computePromise,this.debounceInformation.update(e,t.elapsed()),e.isDisposed())return;this.updateDecorations(this.activeLinksList.links)}catch(t){Xe(t)}finally{this.computePromise=null}}}updateDecorations(e){const t=this.editor.getOption(78)==="altKey",i=[],n=Object.keys(this.currentOccurrences);for(const r of n){const a=this.currentOccurrences[r];i.push(a.decorationId)}const o=[];if(e)for(const r of e)o.push(Xm.decoration(r,t));this.editor.changeDecorations(r=>{const a=r.deltaDecorations(i,o);this.currentOccurrences={},this.activeLinkDecorationId=null;for(let l=0,d=a.length;l{n.activate(o,i),this.activeLinkDecorationId=n.decorationId})}else this.cleanUpActiveLinkDecoration()}cleanUpActiveLinkDecoration(){const e=this.editor.getOption(78)==="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(dt.None).then(o=>{if(typeof o=="string"&&this.editor.hasModel()){const r=this.editor.getModel().uri;if(r.scheme===Ge.file&&o.startsWith(`${Ge.file}:`)){const a=Ae.parse(o);if(a.scheme===Ge.file){const l=Tl(a);let d=null;l.startsWith("/./")||l.startsWith("\\.\\")?d=`.${l.substr(1)}`:(l.startsWith("//./")||l.startsWith("\\\\.\\"))&&(d=`.${l.substr(2)}`),d&&(o=wme(r,d))}}}return this.openerService.open(o,{openToSide:t,fromUserGesture:i,allowContributedOpeners:!0,allowCommands:!0,fromWorkspace:!0})},o=>{const r=o instanceof Error?o.message:o;r==="invalid"?this.notificationService.warn(p("invalid.url","Failed to open this link because it is not well-formed: {0}",n.url.toString())):r==="missing"?this.notificationService.warn(p("missing.url","Failed to open this link because its target is missing.")):Xe(o)})}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))}stop(){var e;this.computeLinks.cancel(),this.activeLinksList&&((e=this.activeLinksList)===null||e===void 0||e.dispose(),this.activeLinksList=null),this.computePromise&&(this.computePromise.cancel(),this.computePromise=null)}dispose(){super.dispose(),this.stop()}};K_.ID="editor.linkDetector";K_=RR=a2e([xy(1,Bo),xy(2,en),xy(3,Ce),xy(4,Ur)],K_);const z9={general:Ye.register({description:"detected-link",stickiness:1,collapseOnReplaceEdit:!0,inlineClassName:"detected-link"}),active:Ye.register({description:"detected-link-active",stickiness:1,collapseOnReplaceEdit:!0,inlineClassName:"detected-link-active"})};class Xm{static decoration(e,t){return{range:e.range,options:Xm._getOptions(e,t,!1)}}static _getOptions(e,t,i){const n={...i?z9.active:z9.general};return n.hoverMessage=l2e(e,t),n}constructor(e,t){this.link=e,this.decorationId=t}activate(e,t){e.changeDecorationOptions(this.decorationId,Xm._getOptions(this.link,t,!0))}deactivate(e,t){e.changeDecorationOptions(this.decorationId,Xm._getOptions(this.link,t,!1))}}function l2e(s,e){const t=s.url&&/^command:/i.test(s.url.toString()),i=s.tooltip?s.tooltip:t?p("links.navigate.executeCmd","Execute command"):p("links.navigate.follow","Follow link"),n=e?lt?p("links.navigate.kb.meta.mac","cmd + click"):p("links.navigate.kb.meta","ctrl + click"):lt?p("links.navigate.kb.alt.mac","option + click"):p("links.navigate.kb.alt","alt + click");if(s.url){let o="";if(/^command:/i.test(s.url.toString())){const a=s.url.toString().match(/^command:([^?#]+)/);if(a){const l=a[1];o=p("tooltip.explanation","Execute command {0}",l)}}return new ss("",!0).appendLink(s.url.toString(!0).replace(/ /g,"%20"),i,o).appendMarkdown(` (${n})`)}else return new ss().appendText(`${i} (${n})`)}class d2e extends me{constructor(){super({id:"editor.action.openLink",label:p("label","Open Link"),alias:"Open Link",precondition:void 0})}run(e,t){const i=K_.get(t);if(!i||!t.hasModel())return;const n=t.getSelections();for(const o of n){const r=i.getLinkOccurrence(o.getEndPosition());r&&i.openLinkOccurrence(r,!1)}}}kt(K_.ID,K_,1);te(d2e);class PR extends H{constructor(e){super(),this._editor=e,this._register(this._editor.onMouseDown(t=>{const i=this._editor.getOption(117);i>=0&&t.target.type===6&&t.target.position.column>=i&&this._editor.updateOptions({stopRenderingLineAfter:-1})}))}}PR.ID="editor.contrib.longLinesHelper";kt(PR.ID,PR,2);const ky=N("editor.wordHighlightBackground",{dark:"#575757B8",light:"#57575740",hcDark:null,hcLight:null},p("wordHighlight","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);N("editor.wordHighlightStrongBackground",{dark:"#004972B8",light:"#0e639c40",hcDark:null,hcLight:null},p("wordHighlightStrong","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);N("editor.wordHighlightTextBackground",{light:ky,dark:ky,hcDark:ky,hcLight:ky},p("wordHighlightText","Background color of a textual occurrence for a symbol. The color must not be opaque so as not to hide underlying decorations."),!0);const Ey=N("editor.wordHighlightBorder",{light:null,dark:null,hcDark:di,hcLight:di},p("wordHighlightBorder","Border color of a symbol during read-access, like reading a variable."));N("editor.wordHighlightStrongBorder",{light:null,dark:null,hcDark:di,hcLight:di},p("wordHighlightStrongBorder","Border color of a symbol during write-access, like writing to a variable."));N("editor.wordHighlightTextBorder",{light:Ey,dark:Ey,hcDark:Ey,hcLight:Ey},p("wordHighlightTextBorder","Border color of a textual occurrence for a symbol."));const c2e=N("editorOverviewRuler.wordHighlightForeground",{dark:"#A0A0A0CC",light:"#A0A0A0CC",hcDark:"#A0A0A0CC",hcLight:"#A0A0A0CC"},p("overviewRulerWordHighlightForeground","Overview ruler marker color for symbol highlights. The color must not be opaque so as not to hide underlying decorations."),!0),u2e=N("editorOverviewRuler.wordHighlightStrongForeground",{dark:"#C0A0C0CC",light:"#C0A0C0CC",hcDark:"#C0A0C0CC",hcLight:"#C0A0C0CC"},p("overviewRulerWordHighlightStrongForeground","Overview ruler marker color for write-access symbol highlights. The color must not be opaque so as not to hide underlying decorations."),!0),h2e=N("editorOverviewRuler.wordHighlightTextForeground",{dark:_v,light:_v,hcDark:_v,hcLight:_v},p("overviewRulerWordHighlightTextForeground","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),g2e=Ye.register({description:"word-highlight-strong",stickiness:1,className:"wordHighlightStrong",overviewRuler:{color:Ei(u2e),position:Br.Center},minimap:{color:Ei(wx),position:1}}),f2e=Ye.register({description:"word-highlight-text",stickiness:1,className:"wordHighlightText",overviewRuler:{color:Ei(h2e),position:Br.Center},minimap:{color:Ei(wx),position:1}}),p2e=Ye.register({description:"selection-highlight-overview",stickiness:1,className:"selectionHighlight",overviewRuler:{color:Ei(_v),position:Br.Center},minimap:{color:Ei(wx),position:1}}),m2e=Ye.register({description:"selection-highlight",stickiness:1,className:"selectionHighlight"}),_2e=Ye.register({description:"word-highlight",stickiness:1,className:"wordHighlight",overviewRuler:{color:Ei(c2e),position:Br.Center},minimap:{color:Ei(wx),position:1}});function v2e(s){return s===Ab.Write?g2e:s===Ab.Text?f2e:_2e}function b2e(s){return s?m2e:p2e}zr((s,e)=>{const t=s.getColor(AF);t&&e.addRule(`.monaco-editor .selectionHighlight { background-color: ${t.transparent(.5)}; }`)});var C2e=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},w2e=function(s,e){return function(t,i){e(t,i,s)}},FR;function lg(s,e){const t=e.filter(i=>!s.find(n=>n.equals(i)));if(t.length>=1){const i=t.map(o=>`line ${o.viewState.position.lineNumber} column ${o.viewState.position.column}`).join(", "),n=t.length===1?p("cursorAdded","Cursor added: {0}",i):p("cursorsAdded","Cursors added: {0}",i);Uc(n)}}class y2e extends me{constructor(){super({id:"editor.action.insertCursorAbove",label:p("mutlicursor.insertAbove","Add Cursor Above"),alias:"Add Cursor Above",precondition:void 0,kbOpts:{kbExpr:T.editorTextFocus,primary:2576,linux:{primary:1552,secondary:[3088]},weight:100},menuOpts:{menuId:E.MenubarSelectionMenu,group:"3_multi",title:p({},"&&Add Cursor Above"),order:2}})}run(e,t,i){if(!t.hasModel())return;let n=!0;i&&i.logicalLine===!1&&(n=!1);const o=t._getViewModel();if(o.cursorConfig.readOnly)return;o.model.pushStackElement();const r=o.getCursorStates();o.setCursorStates(i.source,3,On.addCursorUp(o,r,n)),o.revealTopMostCursor(i.source),lg(r,o.getCursorStates())}}class S2e extends me{constructor(){super({id:"editor.action.insertCursorBelow",label:p("mutlicursor.insertBelow","Add Cursor Below"),alias:"Add Cursor Below",precondition:void 0,kbOpts:{kbExpr:T.editorTextFocus,primary:2578,linux:{primary:1554,secondary:[3090]},weight:100},menuOpts:{menuId:E.MenubarSelectionMenu,group:"3_multi",title:p({},"A&&dd Cursor Below"),order:3}})}run(e,t,i){if(!t.hasModel())return;let n=!0;i&&i.logicalLine===!1&&(n=!1);const o=t._getViewModel();if(o.cursorConfig.readOnly)return;o.model.pushStackElement();const r=o.getCursorStates();o.setCursorStates(i.source,3,On.addCursorDown(o,r,n)),o.revealBottomMostCursor(i.source),lg(r,o.getCursorStates())}}class D2e extends me{constructor(){super({id:"editor.action.insertCursorAtEndOfEachLineSelected",label:p("mutlicursor.insertAtEndOfEachLineSelected","Add Cursors to Line Ends"),alias:"Add Cursors to Line Ends",precondition:void 0,kbOpts:{kbExpr:T.editorTextFocus,primary:1575,weight:100},menuOpts:{menuId:E.MenubarSelectionMenu,group:"3_multi",title:p({},"Add C&&ursors to Line Ends"),order:4}})}getCursorsForSelection(e,t,i){if(!e.isEmpty()){for(let n=e.startLineNumber;n1&&i.push(new we(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn))}}run(e,t){if(!t.hasModel())return;const i=t.getModel(),n=t.getSelections(),o=t._getViewModel(),r=o.getCursorStates(),a=[];n.forEach(l=>this.getCursorsForSelection(l,i,a)),a.length>0&&t.setSelections(a),lg(r,o.getCursorStates())}}class L2e extends me{constructor(){super({id:"editor.action.addCursorsToBottom",label:p("mutlicursor.addCursorsToBottom","Add Cursors To Bottom"),alias:"Add Cursors To Bottom",precondition:void 0})}run(e,t){if(!t.hasModel())return;const i=t.getSelections(),n=t.getModel().getLineCount(),o=[];for(let l=i[0].startLineNumber;l<=n;l++)o.push(new we(l,i[0].startColumn,l,i[0].endColumn));const r=t._getViewModel(),a=r.getCursorStates();o.length>0&&t.setSelections(o),lg(a,r.getCursorStates())}}class x2e extends me{constructor(){super({id:"editor.action.addCursorsToTop",label:p("mutlicursor.addCursorsToTop","Add Cursors To Top"),alias:"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 we(a,i[0].startColumn,a,i[0].endColumn));const o=t._getViewModel(),r=o.getCursorStates();n.length>0&&t.setSelections(n),lg(r,o.getCursorStates())}}class Iy{constructor(e,t,i){this.selections=e,this.revealRange=t,this.revealScrollType=i}}class ZC{static create(e,t){if(!e.hasModel())return null;const i=t.getState();if(!e.hasTextFocus()&&i.isRevealed&&i.searchString.length>0)return new ZC(e,t,!1,i.searchString,i.wholeWord,i.matchCase,null);let n=!1,o,r;const a=e.getSelections();a.length===1&&a[0].isEmpty()?(n=!0,o=!0,r=!0):(o=i.wholeWord,r=i.matchCase);const l=e.getSelection();let d,c=null;if(l.isEmpty()){const u=e.getConfiguredWordAtPosition(l.getStartPosition());if(!u)return null;d=u.word,c=new we(l.startLineNumber,u.startColumn,l.startLineNumber,u.endColumn)}else d=e.getModel().getValueInRange(l).replace(/\r\n/g,` `);return new ZC(e,t,n,d,o,r,c)}constructor(e,t,i,n,o,r,a){this._editor=e,this.findController=t,this.isDisconnectedFromFindController=i,this.searchText=n,this.wholeWord=o,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 Iy(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 Iy(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(131):null,!1);return i?new we(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 Iy(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 Iy(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(131):null,!1);return i?new we(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(131):null,!1,1073741824):t.findMatches(this.searchText,!0,!1,this.matchCase,this.wholeWord?this._editor.getOption(131):null,!1,1073741824)}}class jf extends H{static get(e){return e.getContribution(jf.ID)}constructor(e){super(),this._sessionDispose=this._register(new Y),this._editor=e,this._ignoreSelectionChange=!1,this._session=null}dispose(){this._endSession(),super.dispose()}_beginSessionIfNeeded(e){if(!this._session){const t=ZC.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 we(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(!zG(this._editor.getModel(),t,n)){const r=this._editor.getModel(),a=[];for(let l=0,d=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(131):null,!1,1073741824):t=n.findMatches(i.searchString,!0,i.isRegex,i.matchCase,i.wholeWord?this._editor.getOption(131):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 o=0,r=t.length;onew we(o.range.startLineNumber,o.range.startColumn,o.range.endLineNumber,o.range.endColumn)))}}}jf.ID="editor.contrib.multiCursorController";class D0 extends me{run(e,t){const i=jf.get(t);if(!i)return;const n=t._getViewModel();if(n){const o=n.getCursorStates(),r=Ks.get(t);if(r)this._run(i,r);else{const a=e.get(Ne).createInstance(Ks,t);this._run(i,a),a.dispose()}lg(o,n.getCursorStates())}}}class k2e extends D0{constructor(){super({id:"editor.action.addSelectionToNextFindMatch",label:p("addSelectionToNextFindMatch","Add Selection To Next Find Match"),alias:"Add Selection To Next Find Match",precondition:void 0,kbOpts:{kbExpr:T.focus,primary:2082,weight:100},menuOpts:{menuId:E.MenubarSelectionMenu,group:"3_multi",title:p({},"Add &&Next Occurrence"),order:5}})}_run(e,t){e.addSelectionToNextFindMatch(t)}}class E2e extends D0{constructor(){super({id:"editor.action.addSelectionToPreviousFindMatch",label:p("addSelectionToPreviousFindMatch","Add Selection To Previous Find Match"),alias:"Add Selection To Previous Find Match",precondition:void 0,menuOpts:{menuId:E.MenubarSelectionMenu,group:"3_multi",title:p({},"Add P&&revious Occurrence"),order:6}})}_run(e,t){e.addSelectionToPreviousFindMatch(t)}}class I2e extends D0{constructor(){super({id:"editor.action.moveSelectionToNextFindMatch",label:p("moveSelectionToNextFindMatch","Move Last Selection To Next Find Match"),alias:"Move Last Selection To Next Find Match",precondition:void 0,kbOpts:{kbExpr:T.focus,primary:an(2089,2082),weight:100}})}_run(e,t){e.moveSelectionToNextFindMatch(t)}}class T2e extends D0{constructor(){super({id:"editor.action.moveSelectionToPreviousFindMatch",label:p("moveSelectionToPreviousFindMatch","Move Last Selection To Previous Find Match"),alias:"Move Last Selection To Previous Find Match",precondition:void 0})}_run(e,t){e.moveSelectionToPreviousFindMatch(t)}}class N2e extends D0{constructor(){super({id:"editor.action.selectHighlights",label:p("selectAllOccurrencesOfFindMatch","Select All Occurrences of Find Match"),alias:"Select All Occurrences of Find Match",precondition:void 0,kbOpts:{kbExpr:T.focus,primary:3114,weight:100},menuOpts:{menuId:E.MenubarSelectionMenu,group:"3_multi",title:p({},"Select All &&Occurrences"),order:7}})}_run(e,t){e.selectAll(t)}}class A2e extends D0{constructor(){super({id:"editor.action.changeAll",label:p("changeAll.label","Change All Occurrences"),alias:"Change All Occurrences",precondition:G.and(T.writable,T.editorTextFocus),kbOpts:{kbExpr:T.editorTextFocus,primary:2108,weight:100},contextMenuOpts:{group:"1_modification",order:1.2}})}_run(e,t){e.selectAll(t)}}class M2e{constructor(e,t,i,n,o){this._model=e,this._searchText=t,this._matchCase=i,this._wordSeparators=n,this._modelVersionId=this._model.getVersionId(),this._cachedFindMatches=null,o&&this._model===o._model&&this._searchText===o._searchText&&this._matchCase===o._matchCase&&this._wordSeparators===o._wordSeparators&&this._modelVersionId===o._modelVersionId&&(this._cachedFindMatches=o._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(x.compareRangesUsingStarts)),this._cachedFindMatches}}let XC=FR=class extends H{constructor(e,t){super(),this._languageFeaturesService=t,this.editor=e,this._isEnabled=e.getOption(108),this._decorations=e.createDecorationsCollection(),this.updateSoon=this._register(new Wt(()=>this._update(),300)),this.state=null,this._register(e.onDidChangeConfiguration(n=>{this._isEnabled=e.getOption(108)})),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=Ks.get(e);i&&this._register(i.getState().onFindReplaceStateChange(n=>{this._update()})),this.updateSoon.schedule()}_update(){this._setState(FR._createState(this.state,this._isEnabled,this.editor))}static _createState(e,t,i){if(!t||!i.hasModel())return null;const n=i.getSelection();if(n.startLineNumber!==n.endLineNumber)return null;const o=jf.get(i);if(!o)return null;const r=Ks.get(i);if(!r)return null;let a=o.getSession(r);if(!a){const c=i.getSelections();if(c.length>1){const h=r.getState().matchCase;if(!zG(i.getModel(),c,h))return null}a=ZC.create(i,r)}if(!a||a.currentMatch||/^[ \t]+$/.test(a.searchText)||a.searchText.length>200)return null;const l=r.getState(),d=l.matchCase;if(l.isRevealed){let c=l.searchString;d||(c=c.toLowerCase());let u=a.searchText;if(d||(u=u.toLowerCase()),c===u&&a.matchCase===l.matchCase&&a.wholeWord===l.wholeWord&&!l.isRegex)return null}return new M2e(i.getModel(),a.searchText,a.matchCase,a.wholeWord?i.getOption(131):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(x.compareRangesUsingStarts);const o=[];for(let d=0,c=0,u=i.length,h=n.length;d=h)o.push(g),d++;else{const f=x.compareRangesUsingStarts(g,n[c]);f<0?((n[c].isEmpty()||!x.areIntersecting(g,n[c]))&&o.push(g),d++):(f>0||d++,c++)}}const r=this.editor.getOption(81)!=="off",a=this._languageFeaturesService.documentHighlightProvider.has(t)&&r,l=o.map(d=>({range:d,options:b2e(a)}));this._decorations.set(l)}dispose(){this._setState(null),super.dispose()}};XC.ID="editor.contrib.selectionHighlighter";XC=FR=C2e([w2e(1,Ce)],XC);function zG(s,e,t){const i=U9(s,e[0],!t);for(let n=1,o=e.length;n=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},V2e=function(s,e){return function(t,i){e(t,i,s)}};const ST="inline-edit";let OR=class extends H{constructor(e,t,i){super(),this.editor=e,this.model=t,this.languageService=i,this.isDisposed=vt(this,!1),this.currentTextModel=Ot(this.editor.onDidChangeModel,()=>this.editor.getModel()),this.uiState=je(this,n=>{var o;if(this.isDisposed.read(n))return;const r=this.currentTextModel.read(n);if(r!==this.model.targetTextModel.read(n))return;const a=this.model.ghostText.read(n);if(!a)return;let l=(o=this.model.range)===null||o===void 0?void 0:o.read(n);l&&l.startLineNumber===l.endLineNumber&&l.startColumn===l.endColumn&&(l=void 0);const d=(l?l.startLineNumber===l.endLineNumber:!0)&&a.parts.length===1&&a.parts[0].lines.length===1,c=a.parts.length===1&&a.parts[0].lines.every(C=>C.length===0),u=[],h=[];function g(C,w){if(h.length>0){const y=h[h.length-1];w&&y.decorations.push(new Os(y.content.length+1,y.content.length+1+C[0].length,w,0)),y.content+=C[0],C=C.slice(1)}for(const y of C)h.push({content:y,decorations:w?[new Os(1,y.length+1,w,0)]:[]})}const f=r.getLineContent(a.lineNumber);let m,_=0;if(!c){for(const C of a.parts){let w=C.lines;l&&!d&&(g(w,ST),w=[]),m===void 0?(u.push({column:C.column,text:w[0],preview:C.preview}),w=w.slice(1)):g([f.substring(_,C.column-1)],void 0),w.length>0&&(g(w,ST),m===void 0&&C.column<=f.length&&(m=C.column)),_=C.column-1}m!==void 0&&g([f.substring(_)],void 0)}const v=m!==void 0?new wG(m,f.length+1):void 0,b=d||!l?a.lineNumber:l.endLineNumber-1;return{inlineTexts:u,additionalLines:h,hiddenRange:v,lineNumber:b,additionalReservedLineCount:this.model.minReservedLineCount.read(n),targetTextModel:r,range:l,isSingleLine:d,isPureRemove:c,backgroundColoring:this.model.backgroundColoring.read(n)}}),this.decorations=je(this,n=>{const o=this.uiState.read(n);if(!o)return[];const r=[];if(o.hiddenRange&&r.push({range:o.hiddenRange.toRange(o.lineNumber),options:{inlineClassName:"inline-edit-hidden",description:"inline-edit-hidden"}}),o.range){const a=[];if(o.isSingleLine)a.push(o.range);else if(o.isPureRemove){const d=o.range.endLineNumber-o.range.startLineNumber;for(let c=0;c{const o=this.uiState.read(n);return o&&!o.isPureRemove?{lineNumber:o.lineNumber,additionalLines:o.additionalLines,minReservedLineCount:o.additionalReservedLineCount,targetTextModel:o.targetTextModel}:void 0}))),this._register(Ie(()=>{this.isDisposed.set(!0,void 0)})),this._register(yG(this.editor,this.decorations))}ownsViewZone(e){return this.additionalLinesWidget.viewZoneId===e}};OR=H2e([V2e(2,vi)],OR);var H4=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Wl=function(s,e){return function(t,i){e(t,i,s)}},mS;let BR=class extends H{constructor(e,t,i){super(),this.editor=e,this.model=t,this.instantiationService=i,this.alwaysShowToolbar=Ot(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(63).showToolbar==="always"),this.sessionPosition=void 0,this.position=je(this,n=>{var o,r,a;const l=(o=this.model.read(n))===null||o===void 0?void 0:o.widget.model.ghostText.read(n);if(!this.alwaysShowToolbar.read(n)||!l||l.parts.length===0)return this.sessionPosition=void 0,null;const d=l.parts[0].column;this.sessionPosition&&this.sessionPosition.lineNumber!==l.lineNumber&&(this.sessionPosition=void 0);const c=new W(l.lineNumber,Math.min(d,(a=(r=this.sessionPosition)===null||r===void 0?void 0:r.column)!==null&&a!==void 0?a:Number.MAX_SAFE_INTEGER));return this.sessionPosition=c,c}),this._register(Hr((n,o)=>{if(!this.model.read(n)||!this.alwaysShowToolbar.read(n))return;const a=o.add(this.instantiationService.createInstance(q_,this.editor,!0,this.position));e.addContentWidget(a),o.add(Ie(()=>e.removeContentWidget(a)))}))}};BR=H4([Wl(2,Ne)],BR);let q_=mS=class extends H{constructor(e,t,i,n,o,r){super(),this.editor=e,this.withBorder=t,this._position=i,this._contextKeyService=o,this._menuService=r,this.id=`InlineEditHintsContentWidget${mS.id++}`,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this.nodes=Nt("div.inlineEditHints",{className:this.withBorder?".withBorder":""},[Nt("div@toolBar")]),this.inlineCompletionsActionsMenus=this._register(this._menuService.createMenu(E.InlineEditActions,this._contextKeyService)),this.toolBar=this._register(n.createInstance(WR,this.nodes.toolBar,this.editor,E.InlineEditToolbar,{menuOptions:{renderShortTitle:!0},toolbarOptions:{primaryGroup:a=>a.startsWith("primary")},actionViewItemProvider:(a,l)=>{if(a instanceof Io)return n.createInstance(z2e,a,void 0)},telemetrySource:"InlineEditToolbar"})),this._register(this.toolBar.onDidChangeDropdownVisibility(a=>{mS._dropDownVisible=a})),this._register(st(a=>{this._position.read(a),this.editor.layoutContentWidget(this)})),this._register(st(a=>{const l=[];for(const[d,c]of this.inlineCompletionsActionsMenus.getActions())for(const u of c)u instanceof Io&&l.push(u);l.length>0&&l.unshift(new rn),this.toolBar.setAdditionalSecondaryActions(l)}))}getId(){return this.id}getDomNode(){return this.nodes.root}getPosition(){return{position:this._position.get(),preference:[1,2],positionAffinity:3}}};q_._dropDownVisible=!1;q_.id=0;q_=mS=H4([Wl(3,Ne),Wl(4,Be),Wl(5,hr)],q_);class z2e extends Fh{updateLabel(){const e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService);if(!e)return super.updateLabel();if(this.label){const t=Nt("div.keybinding").root;this._register(new m0(t,Lo,{disableTitle:!0,...tK})).set(e),this.label.textContent=this._action.label,this.label.appendChild(t),this.label.classList.add("inlineEditStatusBarItemLabel")}}updateTooltip(){}}let WR=class extends LC{constructor(e,t,i,n,o,r,a,l,d,c){super(e,{resetMenu:i,...n},o,r,a,l,d,c),this.editor=t,this.menuId=i,this.options2=n,this.menuService=o,this.contextKeyService=r,this.menu=this._store.add(this.menuService.createMenu(this.menuId,this.contextKeyService,{emitEventsForSubmenuChanges:!0})),this.additionalActions=[],this.prependedPrimaryActions=[],this._store.add(this.menu.onDidChange(()=>this.updateToolbar())),this._store.add(this.editor.onDidChangeCursorPosition(()=>this.updateToolbar())),this.updateToolbar()}updateToolbar(){var e,t,i,n,o,r,a;const l=[],d=[];Qx(this.menu,(e=this.options2)===null||e===void 0?void 0:e.menuOptions,{primary:l,secondary:d},(i=(t=this.options2)===null||t===void 0?void 0:t.toolbarOptions)===null||i===void 0?void 0:i.primaryGroup,(o=(n=this.options2)===null||n===void 0?void 0:n.toolbarOptions)===null||o===void 0?void 0:o.shouldInlineSubmenu,(a=(r=this.options2)===null||r===void 0?void 0:r.toolbarOptions)===null||a===void 0?void 0:a.useSeparatorsInPrimaryActions),d.push(...this.additionalActions),l.unshift(...this.prependedPrimaryActions),this.setActions(l,d)}setAdditionalSecondaryActions(e){Ci(this.additionalActions,e,(t,i)=>t===i)||(this.additionalActions=e,this.updateToolbar())}};WR=H4([Wl(4,hr),Wl(5,Be),Wl(6,Oo),Wl(7,At),Wl(8,gi),Wl(9,Gs)],WR);var U2e=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},av=function(s,e){return function(t,i){e(t,i,s)}},sf;class $2e{constructor(e,t){this.widget=e,this.edit=t}dispose(){this.widget.dispose()}}let fn=sf=class extends H{static get(e){return e.getContribution(sf.ID)}constructor(e,t,i,n,o,r){super(),this.editor=e,this.instantiationService=t,this.contextKeyService=i,this.languageFeaturesService=n,this._commandService=o,this._configurationService=r,this._isVisibleContext=sf.inlineEditVisibleContext.bindTo(this.contextKeyService),this._isCursorAtInlineEditContext=sf.cursorAtInlineEditContext.bindTo(this.contextKeyService),this._currentEdit=this._register(gC(this,void 0)),this._isAccepting=vt(this,!1),this._enabled=Ot(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(63).enabled),this._fontFamily=Ot(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(63).fontFamily),this._backgroundColoring=Ot(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(63).backgroundColoring);const a=os("InlineEditController.modelContentChangedSignal",e.onDidChangeModelContent);this._register(st(h=>{this._enabled.read(h)&&(a.read(h),!this._isAccepting.read(h)&&this.getInlineEdit(e,!0))}));const l=Ot(e.onDidChangeCursorPosition,()=>e.getPosition());this._register(st(h=>{if(!this._enabled.read(h))return;const g=l.read(h);g&&this.checkCursorPosition(g)})),this._register(st(h=>{const g=this._currentEdit.read(h);if(this._isCursorAtInlineEditContext.set(!1),!g){this._isVisibleContext.set(!1);return}this._isVisibleContext.set(!0);const f=e.getPosition();f&&this.checkCursorPosition(f)}));const d=os("InlineEditController.editorBlurSignal",e.onDidBlurEditorWidget);this._register(st(async h=>{var g;this._enabled.read(h)&&(d.read(h),!(this._configurationService.getValue("editor.experimentalInlineEdit.keepOnBlur")||e.getOption(63).keepOnBlur)&&((g=this._currentRequestCts)===null||g===void 0||g.dispose(!0),this._currentRequestCts=void 0,await this.clear(!1)))}));const c=os("InlineEditController.editorFocusSignal",e.onDidFocusEditorText);this._register(st(h=>{this._enabled.read(h)&&(c.read(h),this.getInlineEdit(e,!0))}));const u=this._register(Nz());this._register(st(h=>{const g=this._fontFamily.read(h);u.setStyle(g===""||g==="default"?"":` .monaco-editor .inline-edit-decoration, .monaco-editor .inline-edit-decoration-preview, .monaco-editor .inline-edit { font-family: ${g}; }`)})),this._register(new BR(this.editor,this._currentEdit,this.instantiationService))}checkCursorPosition(e){var t;if(!this._currentEdit){this._isCursorAtInlineEditContext.set(!1);return}const i=(t=this._currentEdit.get())===null||t===void 0?void 0:t.edit;if(!i){this._isCursorAtInlineEditContext.set(!1);return}this._isCursorAtInlineEditContext.set(x.containsPosition(i.range,e))}validateInlineEdit(e,t){var i,n;if(t.text.includes(` `)&&t.range.startLineNumber!==t.range.endLineNumber&&t.range.startColumn!==t.range.endColumn){if(t.range.startColumn!==1)return!1;const r=t.range.endLineNumber,a=t.range.endColumn,l=(n=(i=e.getModel())===null||i===void 0?void 0:i.getLineLength(r))!==null&&n!==void 0?n:0;if(a!==l+1)return!1}return!0}async fetchInlineEdit(e,t){this._currentRequestCts&&this._currentRequestCts.dispose(!0);const i=e.getModel();if(!i)return;const n=i.getVersionId(),o=this.languageFeaturesService.inlineEditProvider.all(i);if(o.length===0)return;const r=o[0];this._currentRequestCts=new Vi;const a=this._currentRequestCts.token,l=t?FS.Automatic:FS.Invoke;if(t&&await j2e(50,a),a.isCancellationRequested||i.isDisposed()||i.getVersionId()!==n)return;const c=await r.provideInlineEdit(i,{triggerKind:l},a);if(c&&!(a.isCancellationRequested||i.isDisposed()||i.getVersionId()!==n)&&this.validateInlineEdit(e,c))return c}async getInlineEdit(e,t){var i;this._isCursorAtInlineEditContext.set(!1),await this.clear();const n=await this.fetchInlineEdit(e,t);if(!n)return;const o=n.range.endLineNumber,r=n.range.endColumn,a=n.text.endsWith(` `)&&!(n.range.startLineNumber===n.range.endLineNumber&&n.range.startColumn===n.range.endColumn)?n.text.slice(0,-1):n.text,l=new VC(o,[new CL(r,a,!1)]),d=this.instantiationService.createInstance(OR,this.editor,{ghostText:Ga(l),minReservedLineCount:Ga(0),targetTextModel:Ga((i=this.editor.getModel())!==null&&i!==void 0?i:void 0),range:Ga(n.range),backgroundColoring:this._backgroundColoring});this._currentEdit.set(new $2e(d,n),void 0)}async trigger(){await this.getInlineEdit(this.editor,!1)}async jumpBack(){this._jumpBackPosition&&(this.editor.setPosition(this._jumpBackPosition),this.editor.revealPositionInCenterIfOutsideViewport(this._jumpBackPosition))}async accept(){var e;this._isAccepting.set(!0,void 0);const t=(e=this._currentEdit.get())===null||e===void 0?void 0:e.edit;if(!t)return;let i=t.text;t.text.startsWith(` `)&&(i=t.text.substring(1)),this.editor.pushUndoStop(),this.editor.executeEdits("acceptCurrent",[pi.replace(x.lift(t.range),i)]),t.accepted&&await this._commandService.executeCommand(t.accepted.id,...t.accepted.arguments||[]).then(void 0,Ai),this.freeEdit(t),$t(n=>{this._currentEdit.set(void 0,n),this._isAccepting.set(!1,n)})}jumpToCurrent(){var e,t;this._jumpBackPosition=(e=this.editor.getSelection())===null||e===void 0?void 0:e.getStartPosition();const i=(t=this._currentEdit.get())===null||t===void 0?void 0:t.edit;if(!i)return;const n=W.lift({lineNumber:i.range.startLineNumber,column:i.range.startColumn});this.editor.setPosition(n),this.editor.revealPositionInCenterIfOutsideViewport(n)}async clear(e=!0){var t;const i=(t=this._currentEdit.get())===null||t===void 0?void 0:t.edit;i&&(i!=null&&i.rejected)&&e&&await this._commandService.executeCommand(i.rejected.id,...i.rejected.arguments||[]).then(void 0,Ai),i&&this.freeEdit(i),this._currentEdit.set(void 0,void 0)}freeEdit(e){const t=this.editor.getModel();if(!t)return;const i=this.languageFeaturesService.inlineEditProvider.all(t);i.length!==0&&i[0].freeInlineEdit(e)}shouldShowHoverAt(e){const t=this._currentEdit.get();if(!t)return!1;const i=t.edit,n=t.widget.model;if(x.containsPosition(i.range,e.getStartPosition())||x.containsPosition(i.range,e.getEndPosition()))return!0;const r=n.ghostText.get();return r?r.parts.some(a=>e.containsPosition(new W(r.lineNumber,a.column))):!1}shouldShowHoverAtViewZone(e){var t,i;return(i=(t=this._currentEdit.get())===null||t===void 0?void 0:t.widget.ownsViewZone(e))!==null&&i!==void 0?i:!1}};fn.ID="editor.contrib.inlineEditController";fn.inlineEditVisibleKey="inlineEditVisible";fn.inlineEditVisibleContext=new ue(sf.inlineEditVisibleKey,!1);fn.cursorAtInlineEditKey="cursorAtInlineEdit";fn.cursorAtInlineEditContext=new ue(sf.cursorAtInlineEditKey,!1);fn=sf=U2e([av(1,Ne),av(2,Be),av(3,Ce),av(4,gi),av(5,rt)],fn);function j2e(s,e){return new Promise(t=>{let i;const n=setTimeout(()=>{i&&i.dispose(),t()},s);e&&(i=e.onCancellationRequested(()=>{clearTimeout(n),i&&i.dispose(),t()}))})}class K2e extends me{constructor(){super({id:F2e,label:"Accept Inline Edit",alias:"Accept Inline Edit",precondition:G.and(T.writable,fn.inlineEditVisibleContext),kbOpts:[{weight:101,primary:2,kbExpr:G.and(T.writable,fn.inlineEditVisibleContext,fn.cursorAtInlineEditContext)}],menuOpts:[{menuId:E.InlineEditToolbar,title:"Accept",group:"primary",order:1}]})}async run(e,t){const i=fn.get(t);await(i==null?void 0:i.accept())}}class q2e extends me{constructor(){const e=G.and(T.writable,G.not(fn.inlineEditVisibleKey));super({id:"editor.action.inlineEdit.trigger",label:"Trigger Inline Edit",alias:"Trigger Inline Edit",precondition:e,kbOpts:{weight:101,primary:2646,kbExpr:e}})}async run(e,t){const i=fn.get(t);i==null||i.trigger()}}class G2e extends me{constructor(){const e=G.and(T.writable,fn.inlineEditVisibleContext,G.not(fn.cursorAtInlineEditKey));super({id:B2e,label:"Jump to Inline Edit",alias:"Jump to Inline Edit",precondition:e,kbOpts:{weight:101,primary:2646,kbExpr:e},menuOpts:[{menuId:E.InlineEditToolbar,title:"Jump To Edit",group:"primary",order:3,when:e}]})}async run(e,t){const i=fn.get(t);i==null||i.jumpToCurrent()}}class Z2e extends me{constructor(){const e=G.and(T.writable,fn.cursorAtInlineEditContext);super({id:W2e,label:"Jump Back from Inline Edit",alias:"Jump Back from Inline Edit",precondition:e,kbOpts:{weight:110,primary:2646,kbExpr:e},menuOpts:[{menuId:E.InlineEditToolbar,title:"Jump Back",group:"primary",order:3,when:e}]})}async run(e,t){const i=fn.get(t);i==null||i.jumpBack()}}class X2e extends me{constructor(){const e=G.and(T.writable,fn.inlineEditVisibleContext);super({id:O2e,label:"Reject Inline Edit",alias:"Reject Inline Edit",precondition:e,kbOpts:{weight:100,primary:9,kbExpr:e},menuOpts:[{menuId:E.InlineEditToolbar,title:"Reject",group:"secondary",order:2}]})}async run(e,t){const i=fn.get(t);await(i==null?void 0:i.clear())}}var Y2e=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},$9=function(s,e){return function(t,i){e(t,i,s)}};class Q2e{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 HR=class{constructor(e,t,i){this._editor=e,this._instantiationService=t,this._telemetryService=i,this.hoverOrdinal=5}suggestHoverAnchor(e){const t=fn.get(this._editor);if(!t)return null;const i=e.target;if(i.type===8){const n=i.detail;if(t.shouldShowHoverAtViewZone(n.viewZoneId)){const o=i.range;return new hf(1e3,this,o,e.event.posx,e.event.posy,!1)}}return i.type===7&&t.shouldShowHoverAt(i.range)?new hf(1e3,this,i.range,e.event.posx,e.event.posy,!1):i.type===6&&i.detail.mightBeForeignElement&&t.shouldShowHoverAt(i.range)?new hf(1e3,this,i.range,e.event.posx,e.event.posy,!1):null}computeSync(e,t){if(this._editor.getOption(63).showToolbar!=="onHover")return[];const i=fn.get(this._editor);return i&&i.shouldShowHoverAt(e.range)?[new Q2e(this,e.range,i)]:[]}renderHoverParts(e,t){const i=new Y;this._telemetryService.publicLog2("inlineEditHover.shown");const n=this._instantiationService.createInstance(q_,this._editor,!1,Ga(null));return e.fragment.appendChild(n.getDomNode()),i.add(n),i}};HR=Y2e([$9(1,Ne),$9(2,Gs)],HR);te(K2e);te(X2e);te(G2e);te(Z2e);te(q2e);kt(fn.ID,fn,3);ag.register(HR);const Kf={Visible:new ue("parameterHintsVisible",!1),MultipleSignatures:new ue("parameterHintsMultipleSignatures",!1)};async function UG(s,e,t,i,n){const o=s.ordered(e);for(const r of o)try{const a=await r.provideSignatureHelp(e,t,n,i);if(a)return a}catch(a){Ai(a)}}pt.registerCommand("_executeSignatureHelpProvider",async(s,...e)=>{const[t,i,n]=e;yt(Ae.isUri(t)),yt(W.isIPosition(i)),yt(typeof n=="string"||!n);const o=s.get(Ce),r=await s.get(mo).createModelReference(t);try{const a=await UG(o.signatureHelpProvider,r.object.textEditorModel,W.lift(i),{triggerKind:ad.Invoke,isRetrigger:!1,triggerCharacter:n},dt.None);return a?(setTimeout(()=>a.dispose(),0),a.value):void 0}finally{r.dispose()}});var Eu;(function(s){s.Default={type:0};class e{constructor(n,o){this.request=n,this.previouslyActiveHints=o,this.type=2}}s.Pending=e;class t{constructor(n){this.hints=n,this.type=1}}s.Active=t})(Eu||(Eu={}));class Gk extends H{constructor(e,t,i=Gk.DEFAULT_DELAY){super(),this._onChangedHints=this._register(new B),this.onChangedHints=this._onChangedHints.event,this.triggerOnType=!1,this._state=Eu.Default,this._pendingTriggers=[],this._lastSignatureHelpResult=this._register(new $n),this.triggerChars=new ZS,this.retriggerChars=new ZS,this.triggerId=0,this.editor=e,this.providers=t,this.throttledDelayer=new _a(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=Eu.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(Xe)}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(86).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(86).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 Eu.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(J2e);this._pendingTriggers=[];const o={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 Eu.Pending(Dn(l=>UG(this.providers,r,a,o,l)),i);try{const l=await this.state.request;return e!==this.triggerId?(l==null||l.dispose(),!1):!l||!l.value.signatures||l.value.signatures.length===0?(l==null||l.dispose(),this._lastSignatureHelpResult.clear(),this.cancel(),!1):(this.state=new Eu.Active(l.value),this._lastSignatureHelpResult.value=l,this._onChangedHints.fire(this.state.hints),!0)}catch(l){return e===this.triggerId&&(this.state=Eu.Default),Xe(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:ad.TriggerCharacter,triggerCharacter:e.charAt(t)})}onCursorChange(e){e.source==="mouse"?this.cancel():this.isTriggered&&this.trigger({triggerKind:ad.ContentChange})}onModelContentChange(){this.isTriggered&&this.trigger({triggerKind:ad.ContentChange})}onEditorConfigurationChange(){this.triggerOnType=this.editor.getOption(86).enabled,this.triggerOnType||this.cancel()}dispose(){this.cancel(!0),super.dispose()}}Gk.DEFAULT_DELAY=120;function J2e(s,e){switch(e.triggerKind){case ad.Invoke:return e;case ad.ContentChange:return s;case ad.TriggerCharacter:default:return e}}var eMe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},DT=function(s,e){return function(t,i){e(t,i,s)}},VR;const Ho=he,tMe=xi("parameter-hints-next",oe.chevronDown,p("parameterHintsNextIcon","Icon for show next parameter hint.")),iMe=xi("parameter-hints-previous",oe.chevronUp,p("parameterHintsPreviousIcon","Icon for show previous parameter hint."));let kL=VR=class extends H{constructor(e,t,i,n,o){super(),this.editor=e,this.model=t,this.renderDisposeables=this._register(new Y),this.visible=!1,this.announcedLabel=null,this.allowEditorOverflow=!0,this.markdownRenderer=this._register(new yd({editor:e},o,n)),this.keyVisible=Kf.Visible.bindTo(i),this.keyMultipleSignatures=Kf.MultipleSignatures.bindTo(i)}createParameterHintDOMNodes(){const e=Ho(".editor-widget.parameter-hints-widget"),t=Q(e,Ho(".phwrapper"));t.tabIndex=-1;const i=Q(t,Ho(".controls")),n=Q(i,Ho(".button"+Pe.asCSSSelector(iMe))),o=Q(i,Ho(".overloads")),r=Q(i,Ho(".button"+Pe.asCSSSelector(tMe)));this._register(K(n,"click",h=>{nt.stop(h),this.previous()})),this._register(K(r,"click",h=>{nt.stop(h),this.next()}));const a=Ho(".body"),l=new C1(a,{alwaysConsumeMouseWheel:!0});this._register(l),t.appendChild(l.getDomNode());const d=Q(a,Ho(".signature")),c=Q(a,Ho(".docs"));e.style.userSelect="text",this.domNodes={element:e,signature:d,overloads:o,docs:c,scrollbar:l},this.editor.addContentWidget(this),this.hide(),this._register(this.editor.onDidChangeCursorSelection(h=>{this.visible&&this.editor.layoutContentWidget(this)}));const u=()=>{if(!this.domNodes)return;const h=this.editor.getOption(50);this.domNodes.element.style.fontSize=`${h.fontSize}px`,this.domNodes.element.style.lineHeight=`${h.lineHeight/h.fontSize}`};u(),this._register(le.chain(this.editor.onDidChangeConfiguration.bind(this.editor),h=>h.filter(g=>g.hasChanged(50)))(u)),this._register(this.editor.onDidLayoutChange(h=>this.updateMaxHeight())),this.updateMaxHeight()}show(){this.visible||(this.domNodes||this.createParameterHintDOMNodes(),this.keyVisible.set(!0),this.visible=!0,setTimeout(()=>{var e;(e=this.domNodes)===null||e===void 0||e.element.classList.add("visible")},100),this.editor.layoutContentWidget(this))}hide(){var e;this.renderDisposeables.clear(),this.visible&&(this.keyVisible.reset(),this.visible=!1,this.announcedLabel=null,(e=this.domNodes)===null||e===void 0||e.element.classList.remove("visible"),this.editor.layoutContentWidget(this))}getPosition(){return this.visible?{position:this.editor.getPosition(),preference:[1,2]}:null}render(e){var t;if(this.renderDisposeables.clear(),!this.domNodes)return;const i=e.signatures.length>1;this.domNodes.element.classList.toggle("multiple",i),this.keyMultipleSignatures.set(i),this.domNodes.signature.innerText="",this.domNodes.docs.innerText="";const n=e.signatures[e.activeSignature];if(!n)return;const o=Q(this.domNodes.signature,Ho(".code")),r=this.editor.getOption(50);o.style.fontSize=`${r.fontSize}px`,o.style.fontFamily=r.fontFamily;const a=n.parameters.length>0,l=(t=n.activeParameter)!==null&&t!==void 0?t:e.activeParameter;if(a)this.renderParameters(o,n,l);else{const u=Q(o,Ho("span"));u.textContent=n.label}const d=n.parameters[l];if(d!=null&&d.documentation){const u=Ho("span.documentation");if(typeof d.documentation=="string")u.textContent=d.documentation;else{const h=this.renderMarkdownDocs(d.documentation);u.appendChild(h.element)}Q(this.domNodes.docs,Ho("p",{},u))}if(n.documentation!==void 0)if(typeof n.documentation=="string")Q(this.domNodes.docs,Ho("p",{},n.documentation));else{const u=this.renderMarkdownDocs(n.documentation);Q(this.domNodes.docs,u.element)}const c=this.hasDocs(n,d);if(this.domNodes.signature.classList.toggle("has-docs",c),this.domNodes.docs.classList.toggle("empty",!c),this.domNodes.overloads.textContent=String(e.activeSignature+1).padStart(e.signatures.length.toString().length,"0")+"/"+e.signatures.length,d){let u="";const h=n.parameters[l];Array.isArray(h.label)?u=n.label.substring(h.label[0],h.label[1]):u=h.label,h.documentation&&(u+=typeof h.documentation=="string"?`, ${h.documentation}`:`, ${h.documentation.value}`),n.documentation&&(u+=typeof n.documentation=="string"?`, ${n.documentation}`:`, ${n.documentation.value}`),this.announcedLabel!==u&&(fo(p("hint","{0}, hint",u)),this.announcedLabel=u)}this.editor.layoutContentWidget(this),this.domNodes.scrollbar.scanDomNode()}renderMarkdownDocs(e){const t=this.renderDisposeables.add(this.markdownRenderer.render(e,{asyncRenderCallback:()=>{var i;(i=this.domNodes)===null||i===void 0||i.scrollbar.scanDomNode()}}));return t.element.classList.add("markdown-docs"),t}hasDocs(e,t){return!!(t&&typeof t.documentation=="string"&&Ou(t.documentation).length>0||t&&typeof t.documentation=="object"&&Ou(t.documentation).value.length>0||e.documentation&&typeof e.documentation=="string"&&Ou(e.documentation).length>0||e.documentation&&typeof e.documentation=="object"&&Ou(e.documentation.value).length>0)}renderParameters(e,t,i){const[n,o]=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,o),a.className="parameter active";const l=document.createElement("span");l.textContent=t.label.substring(o),Q(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|^)${rr(i.label)}(?=\\W|$)`,"g");n.test(e.label);const o=n.lastIndex-i.label.length;return o>=0?[o,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 VR.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)}};kL.ID="editor.widget.parameterHintsWidget";kL=VR=eMe([DT(2,Be),DT(3,Bo),DT(4,vi)],kL);N("editorHoverWidget.highlightForeground",{dark:da,light:da,hcDark:da,hcLight:da},p("editorHoverWidgetHighlightForeground","Foreground color of the active item in the parameter hint."));var nMe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},j9=function(s,e){return function(t,i){e(t,i,s)}},zR;let qf=zR=class extends H{static get(e){return e.getContribution(zR.ID)}constructor(e,t,i){super(),this.editor=e,this.model=this._register(new Gk(e,i.signatureHelpProvider)),this._register(this.model.onChangedHints(n=>{var o;n?(this.widget.value.show(),this.widget.value.render(n)):(o=this.widget.rawValue)===null||o===void 0||o.hide()})),this.widget=new gl(()=>this._register(t.createInstance(kL,this.editor,this.model)))}cancel(){this.model.cancel()}previous(){var e;(e=this.widget.rawValue)===null||e===void 0||e.previous()}next(){var e;(e=this.widget.rawValue)===null||e===void 0||e.next()}trigger(e){this.model.trigger(e,0)}};qf.ID="editor.controller.parameterHints";qf=zR=nMe([j9(1,Ne),j9(2,Ce)],qf);class sMe extends me{constructor(){super({id:"editor.action.triggerParameterHints",label:p("parameterHints.trigger.label","Trigger Parameter Hints"),alias:"Trigger Parameter Hints",precondition:T.hasSignatureHelpProvider,kbOpts:{kbExpr:T.editorTextFocus,primary:3082,weight:100}})}run(e,t){const i=qf.get(t);i==null||i.trigger({triggerKind:ad.Invoke})}}kt(qf.ID,qf,2);te(sMe);const V4=175,z4=mn.bindToContribution(qf.get);de(new z4({id:"closeParameterHints",precondition:Kf.Visible,handler:s=>s.cancel(),kbOpts:{weight:V4,kbExpr:T.focus,primary:9,secondary:[1033]}}));de(new z4({id:"showPrevParameterHint",precondition:G.and(Kf.Visible,Kf.MultipleSignatures),handler:s=>s.previous(),kbOpts:{weight:V4,kbExpr:T.focus,primary:16,secondary:[528],mac:{primary:16,secondary:[528,302]}}}));de(new z4({id:"showNextParameterHint",precondition:G.and(Kf.Visible,Kf.MultipleSignatures),handler:s=>s.next(),kbOpts:{weight:V4,kbExpr:T.focus,primary:18,secondary:[530],mac:{primary:18,secondary:[530,300]}}}));var oMe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Ty=function(s,e){return function(t,i){e(t,i,s)}};const L0=new ue("renameInputVisible",!1,p("renameInputVisible","Whether the rename input widget is visible"));new ue("renameInputFocused",!1,p("renameInputFocused","Whether the rename input widget is focused"));let UR=class{constructor(e,t,i,n,o,r){this._editor=e,this._acceptKeybindings=t,this._themeService=i,this._keybindingService=n,this._logService=r,this.allowEditorOverflow=!0,this._disposables=new Y,this._visibleContextKey=L0.bindTo(o),this._isEditingRenameCandidate=!1,this._nRenameSuggestionsInvocations=0,this._hadAutomaticRenameSuggestionsInvocation=!1,this._candidates=new Set,this._beforeFirstInputFieldEditSW=new Jn,this._inputWithButton=new rMe,this._disposables.add(this._inputWithButton),this._editor.addContentWidget(this),this._disposables.add(this._editor.onDidChangeConfiguration(a=>{a.hasChanged(50)&&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 U4(this._domNode,{fontInfo:this._editor.getOption(50),onFocusChange:e=>{this._inputWithButton.input.value=e,this._isEditingRenameCandidate=!1},onSelectionChange:()=>{this._isEditingRenameCandidate=!1,this.acceptInput(!1)}})),this._disposables.add(this._inputWithButton.onDidInputChange(()=>{var e,t,i,n;((e=this._renameCandidateListView)===null||e===void 0?void 0:e.focusedCandidate)!==void 0&&(this._isEditingRenameCandidate=!0),(t=this._timeBeforeFirstInputFieldEdit)!==null&&t!==void 0||(this._timeBeforeFirstInputFieldEdit=this._beforeFirstInputFieldEditSW.elapsed()),((i=this._renameCandidateProvidersCts)===null||i===void 0?void 0:i.token.isCancellationRequested)===!1&&this._renameCandidateProvidersCts.cancel(),(n=this._renameCandidateListView)===null||n===void 0||n.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){var t,i,n,o,r;if(!this._domNode)return;const a=e.getColor(vc),l=e.getColor(IU);this._domNode.style.backgroundColor=String((t=e.getColor(Hi))!==null&&t!==void 0?t:""),this._domNode.style.boxShadow=a?` 0 0 8px 2px ${a}`:"",this._domNode.style.border=l?`1px solid ${l}`:"",this._domNode.style.color=String((i=e.getColor(NU))!==null&&i!==void 0?i:"");const d=e.getColor(AU);this._inputWithButton.domNode.style.backgroundColor=String((n=e.getColor(EA))!==null&&n!==void 0?n:""),this._inputWithButton.input.style.backgroundColor=String((o=e.getColor(EA))!==null&&o!==void 0?o:""),this._inputWithButton.domNode.style.borderWidth=d?"1px":"0px",this._inputWithButton.domNode.style.borderStyle=d?"solid":"none",this._inputWithButton.domNode.style.borderColor=(r=d==null?void 0:d.toString())!==null&&r!==void 0?r:"none"}_updateFont(){if(this._domNode===void 0)return;yt(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(50);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=Eh(this.getDomNode().ownerDocument.body),t=qi(this._editor.getDomNode()),i=this._getTopForPosition();this._nPxAvailableAbove=i+t.top,this._nPxAvailableBelow=e.height-this._nPxAvailableAbove;const n=this._editor.getOption(67),{totalHeight:o}=Gf.getLayoutInfo({lineHeight:n}),r=this._nPxAvailableBelow>o*6?[2,1]:[1,2];return{position:this._position,preference:r}}beforeRender(){var e,t;const[i,n]=this._acceptKeybindings;return this._label.innerText=p({},"{0} to Rename, {1} to Preview",(e=this._keybindingService.lookupKeybinding(i))===null||e===void 0?void 0:e.getLabel(),(t=this._keybindingService.lookupKeybinding(n))===null||t===void 0?void 0:t.getLabel()),this._domNode.style.minWidth="200px",null}afterRender(e){if(this._trace("invoking afterRender, position: ",e?"not null":"null"),e===null){this.cancelInput(!0,"afterRender (because position is null)");return}if(!this._editor.hasModel()||!this._editor.getDomNode())return;yt(this._renameCandidateListView),yt(this._nPxAvailableAbove!==void 0),yt(this._nPxAvailableBelow!==void 0);const t=uc(this._inputWithButton.domNode),i=uc(this._label);let n;e===2?n=this._nPxAvailableBelow:n=this._nPxAvailableAbove,this._renameCandidateListView.layout({height:n-i-t,width:wo(this._inputWithButton.domNode)})}acceptInput(e){var t;this._trace("invoking acceptInput"),(t=this._currentAcceptInput)===null||t===void 0||t.call(this,e)}cancelInput(e,t){var i;this._trace(`invoking cancelInput, caller: ${t}, _currentCancelInput: ${this._currentAcceptInput?"not undefined":"undefined"}`),(i=this._currentCancelInput)===null||i===void 0||i.call(this,e)}focusNextRenameSuggestion(){var e;!((e=this._renameCandidateListView)===null||e===void 0)&&e.focusNext()||(this._inputWithButton.input.value=this._currentName)}focusPreviousRenameSuggestion(){var e;!((e=this._renameCandidateListView)===null||e===void 0)&&e.focusPrevious()||(this._inputWithButton.input.value=this._currentName)}getInput(e,t,i,n,o){const{start:r,end:a}=this._getSelection(e,t);this._renameCts=o;const l=new Y;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(K(this._inputWithButton.button,"click",()=>this._requestRenameCandidates(t,!0))),l.add(K(this._inputWithButton.button,ee.KEY_DOWN,c=>{const u=new Kt(c);(u.equals(3)||u.equals(10))&&(u.stopPropagation(),u.preventDefault(),this._requestRenameCandidates(t,!0))}))),this._isEditingRenameCandidate=!1,this._domNode.classList.toggle("preview",i),this._position=new W(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(Ie(()=>{this._renameCts=void 0,o.dispose(!0)})),l.add(Ie(()=>{this._renameCandidateProvidersCts!==void 0&&(this._renameCandidateProvidersCts.dispose(!0),this._renameCandidateProvidersCts=void 0)})),l.add(Ie(()=>this._candidates.clear()));const d=new ZL;return d.p.finally(()=>{l.dispose(),this._hide()}),this._currentCancelInput=c=>{var u;return this._trace("invoking _currentCancelInput"),this._currentAcceptInput=void 0,this._currentCancelInput=void 0,(u=this._renameCandidateListView)===null||u===void 0||u.clearCandidates(),d.complete(c),!0},this._currentAcceptInput=c=>{this._trace("invoking _currentAcceptInput"),yt(this._renameCandidateListView!==void 0);const u=this._renameCandidateListView.nCandidates;let h,g;const f=this._renameCandidateListView.focusedCandidate;if(f!==void 0?(this._trace("using new name from renameSuggestion"),h=f,g={k:"renameSuggestion"}):(this._trace("using new name from inputField"),h=this._inputWithButton.input.value,g=this._isEditingRenameCandidate?{k:"userEditedRenameSuggestion"}:{k:"inputField"}),h===t||h.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(),d.complete({newName:h,wantsPreview:i&&c,stats:{source:g,nRenameSuggestions:u,timeBeforeFirstInputFieldEdit:this._timeBeforeFirstInputFieldEdit,nRenameSuggestionsInvocations:this._nRenameSuggestionsInvocations,hadAutomaticRenameSuggestionsInvocation:this._hadAutomaticRenameSuggestionsInvocation}})},l.add(o.token.onCancellationRequested(()=>this.cancelInput(!0,"cts.token.onCancellationRequested"))),l.add(this._editor.onDidBlurEditorWidget(()=>{var c;return this.cancelInput(!(!((c=this._domNode)===null||c===void 0)&&c.ownerDocument.hasFocus()),"editor.onDidBlurEditorWidget")})),this._show(),d.p}_requestRenameCandidates(e,t){if(this._requestRenameCandidatesOnce!==void 0&&(this._renameCandidateProvidersCts!==void 0&&this._renameCandidateProvidersCts.dispose(!0),yt(this._renameCts),this._inputWithButton.buttonState!=="stop")){this._renameCandidateProvidersCts=new Vi;const i=t?Mb.Invoke:Mb.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){yt(this._editor.hasModel());const i=this._editor.getSelection();let n=0,o=t.length;return!x.isEmpty(i)&&!x.spansMultipleLines(i)&&x.containsRange(e,i)&&(n=Math.max(0,i.startColumn-e.startColumn),o=Math.min(e.endColumn,i.endColumn)-e.startColumn),{start:n,end:o}}_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=(...d)=>this._trace("_updateRenameCandidates",...d);n("start");const o=await h1(Promise.allSettled(e),i);if(this._inputWithButton.setSparkleButton(),o===void 0){n("returning early - received updateRenameCandidates results - undefined");return}const r=o.flatMap(d=>d.status==="fulfilled"&&rd(d.value)?d.value:[]);n(`received updateRenameCandidates results - total (unfiltered) ${r.length} candidates.`);const a=Wc(r,d=>d.newSymbolName);n(`distinct candidates - ${a.length} candidates.`);const l=a.filter(({newSymbolName:d})=>d.trim().length>0&&d!==this._inputWithButton.input.value&&d!==t&&!this._candidates.has(d));if(n(`valid distinct candidates - ${r.length} candidates.`),l.forEach(d=>this._candidates.add(d.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)}};UR=oMe([Ty(2,_n),Ty(3,At),Ty(4,Be),Ty(5,ys)],UR);class U4{constructor(e,t){this._disposables=new Y,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=U4._createListWidget(this._listContainer,this._candidateViewHeight,t.fontInfo),this._listWidget.onDidChangeFocus(i=>{i.elements.length===1&&t.onFocusChange(i.elements[0].newSymbolName)},this._disposables),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(up({listInactiveFocusForeground:Uu,listInactiveFocusBackground:$u}))}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`,Uc(p("renameSuggestionsReceivedAria","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}=Gf.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}},o=new class{constructor(){this.templateId="candidate"}renderTemplate(r){return new Gf(r,i)}renderElement(r,a,l){l.populate(r)}disposeTemplate(r){r.dispose()}};return new pr("NewSymbolNameCandidates",e,n,[o],{keyboardSupport:!1,mouseSupport:!0,multipleSelectionSupport:!1})}}class rMe{constructor(){this._onDidInputChange=new B,this.onDidInputChange=this._onDidInputChange.event,this._disposables=new Y}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",p("renameAriaLabel","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=p("generateRenameSuggestionsButton","Generate new name suggestions"),this._buttonCancelHoverText=p("cancelRenameSuggestionsButton","Cancel"),this._buttonHover=_l().setupUpdatableHover(Xs("element"),this._buttonNode,this._buttonGenHoverText),this._disposables.add(this._buttonHover),this._domNode.appendChild(this._buttonNode),this._disposables.add(K(this.input,ee.INPUT,()=>this._onDidInputChange.fire())),this._disposables.add(K(this.input,ee.KEY_DOWN,e=>{const t=new Kt(e);(t.keyCode===15||t.keyCode===17)&&this._onDidInputChange.fire()})),this._disposables.add(K(this.input,ee.CLICK,()=>this._onDidInputChange.fire())),this._disposables.add(K(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(K(this.input,ee.BLUR,()=>{this.domNode.style.outline="none"}))),this._domNode}get input(){return yt(this._inputNode),this._inputNode}get button(){return yt(this._buttonNode),this._buttonNode}get buttonState(){return this._buttonState}setSparkleButton(){var e,t;this._buttonState="sparkle",(e=this._sparkleIcon)!==null&&e!==void 0||(this._sparkleIcon=Ef(oe.sparkle)),zn(this.button),this.button.appendChild(this._sparkleIcon),this.button.setAttribute("aria-label","Generating new name suggestions"),(t=this._buttonHover)===null||t===void 0||t.update(this._buttonGenHoverText),this.input.focus()}setStopButton(){var e,t;this._buttonState="stop",(e=this._stopIcon)!==null&&e!==void 0||(this._stopIcon=Ef(oe.primitiveSquare)),zn(this.button),this.button.appendChild(this._stopIcon),this.button.setAttribute("aria-label","Cancel generating new name suggestions"),(t=this._buttonHover)===null||t===void 0||t.update(this._buttonCancelHoverText),this.input.focus()}dispose(){this._disposables.dispose()}}class Gf{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=`${Gf._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=Ef(oe.sparkle),this._icon.style.display="none",i.appendChild(this._icon),this._label=document.createElement("div"),Un(this._label,t),this._domNode.appendChild(this._label),e.appendChild(this._domNode)}populate(e){this._updateIcon(e),this._updateLabel(e)}_updateIcon(e){var t;const i=!!(!((t=e.tags)===null||t===void 0)&&t.includes(nN.AIGenerated));this._icon.style.display=i?"inherit":"none"}_updateLabel(e){this._label.innerText=e.newSymbolName}static getLayoutInfo({lineHeight:e}){return{totalHeight:e+Gf._PADDING*2}}dispose(){}}Gf._PADDING=2;var aMe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},bu=function(s,e){return function(t,i){e(t,i,s)}},$R;class $4{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:x.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 o=this._providers[t];if(!o)return{edits:[],rejectReason:i.join(` `)};const r=await o.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(p("no result","No result.")),n);return r}}async function lMe(s,e,t,i){const n=new $4(e,t,s),o=await n.resolveRenameLocation(dt.None);return o!=null&&o.rejectReason?{edits:[],rejectReason:o.rejectReason}:n.provideRenameEdits(i,dt.None)}let Gc=$R=class{static get(e){return e.getContribution($R.ID)}constructor(e,t,i,n,o,r,a,l,d){this.editor=e,this._instaService=t,this._notificationService=i,this._bulkEditService=n,this._progressService=o,this._logService=r,this._configService=a,this._languageFeaturesService=l,this._telemetryService=d,this._disposableStore=new Y,this._cts=new Vi,this._renameWidget=this._disposableStore.add(this._instaService.createInstance(UR,this.editor,["acceptRenameInput","acceptRenameInputWithPreview"]))}dispose(){this._disposableStore.dispose(),this._cts.dispose(!0)}async run(){var e,t;const i=this._logService.trace.bind(this._logService,"[rename]");if(this._cts.dispose(!0),this._cts=new Vi,!this.editor.hasModel()){i("editor has no model");return}const n=this.editor.getPosition(),o=new $4(this.editor.getModel(),n,this._languageFeaturesService.renameProvider);if(!o.hasProvider()){i("skeleton has no provider");return}const r=new Bh(this.editor,5,void 0,this._cts.token);let a;try{i("resolving rename location");const _=o.resolveRenameLocation(r.token);this._progressService.showWhile(_,250),a=await _,i("resolved rename location")}catch(_){_ instanceof sl?i("resolve rename location cancelled",JSON.stringify(_,null," ")):(i("resolve rename location failed",_ instanceof Error?_:JSON.stringify(_,null," ")),(typeof _=="string"||tl(_))&&((e=Vs.get(this.editor))===null||e===void 0||e.showMessage(_||p("resolveRenameLocationFailed","An unknown error occurred while resolving rename location"),n)));return}finally{r.dispose()}if(!a){i("returning early - no loc");return}if(a.rejectReason){i(`returning early - rejected with reason: ${a.rejectReason}`,a.rejectReason),(t=Vs.get(this.editor))===null||t===void 0||t.showMessage(a.rejectReason,n);return}if(r.token.isCancellationRequested){i("returning early - cts1 cancelled");return}const l=new Bh(this.editor,5,a.range,this._cts.token),d=this.editor.getModel(),c=this._languageFeaturesService.newSymbolNamesProvider.all(d),u=await Promise.all(c.map(async _=>{var v;return[_,(v=await _.supportsAutomaticNewSymbolNamesTriggerKind)!==null&&v!==void 0?v:!1]})),h=(_,v)=>{let b=u.slice();return _===Mb.Automatic&&(b=b.filter(([C,w])=>w)),b.map(([C])=>C.provideNewSymbolNames(d,a.range,_,v))};i("creating rename input field and awaiting its result");const g=this._bulkEditService.hasPreviewHandler()&&this._configService.getValue(this.editor.getModel().uri,"editor.rename.enablePreview"),f=await this._renameWidget.getInput(a.range,a.text,g,c.length>0?h:void 0,l);if(i("received response from rename input field"),c.length>0&&this._reportTelemetry(c.length,d.getLanguageId(),f),typeof f=="boolean"){i(`returning early - rename input field response - ${f}`),f&&this.editor.focus(),l.dispose();return}this.editor.focus(),i("requesting rename edits");const m=h1(o.provideRenameEdits(f.newName,l.token),l.token).then(async _=>{if(!_){i("returning early - no rename edits result");return}if(!this.editor.hasModel()){i("returning early - no model after rename edits are provided");return}if(_.rejectReason){i(`returning early - rejected with reason: ${_.rejectReason}`),this._notificationService.info(_.rejectReason);return}this.editor.setSelection(x.fromPositions(this.editor.getSelection().getPosition())),i("applying edits"),this._bulkEditService.apply(_,{editor:this.editor,showPreview:f.wantsPreview,label:p("label","Renaming '{0}' to '{1}'",a==null?void 0:a.text,f.newName),code:"undoredo.rename",quotableLabel:p("quotableLabel","Renaming {0} to {1}",a==null?void 0:a.text,f.newName),respectAutoSaveConfig:!0}).then(v=>{i("edits applied"),v.ariaSummary&&fo(p("aria","Successfully renamed '{0}' to '{1}'. Summary: {2}",a.text,f.newName,v.ariaSummary))}).catch(v=>{i(`error when applying edits ${JSON.stringify(v,null," ")}`),this._notificationService.error(p("rename.failedApply","Rename failed to apply edits")),this._logService.error(v)})},_=>{i("error when providing rename edits",JSON.stringify(_,null," ")),this._notificationService.error(p("rename.failed","Rename failed to compute edits")),this._logService.error(_)}).finally(()=>{l.dispose()});return i("returning rename operation"),this._progressService.showWhile(m,250),m}acceptRenameInput(e){this._renameWidget.acceptInput(e)}cancelRenameInput(){this._renameWidget.cancelInput(!0,"cancelRenameInput command")}focusNextRenameSuggestion(){this._renameWidget.focusNextRenameSuggestion()}focusPreviousRenameSuggestion(){this._renameWidget.focusPreviousRenameSuggestion()}_reportTelemetry(e,t,i){const n=typeof i=="boolean"?{kind:"cancelled",languageId:t,nRenameSuggestionProviders:e}:{kind:"accepted",languageId:t,nRenameSuggestionProviders:e,source:i.stats.source.k,nRenameSuggestions:i.stats.nRenameSuggestions,timeBeforeFirstInputFieldEdit:i.stats.timeBeforeFirstInputFieldEdit,wantsPreview:i.wantsPreview,nRenameSuggestionsInvocations:i.stats.nRenameSuggestionsInvocations,hadAutomaticRenameSuggestionsInvocation:i.stats.hadAutomaticRenameSuggestionsInvocation};this._telemetryService.publicLog2("renameInvokedEvent",n)}};Gc.ID="editor.contrib.renameController";Gc=$R=aMe([bu(1,Ne),bu(2,en),bu(3,x1),bu(4,sg),bu(5,ys),bu(6,DF),bu(7,Ce),bu(8,Gs)],Gc);class dMe extends me{constructor(){super({id:"editor.action.rename",label:p("rename.label","Rename Symbol"),alias:"Rename Symbol",precondition:G.and(T.writable,T.hasRenameProvider),kbOpts:{kbExpr:T.editorTextFocus,primary:60,weight:100},contextMenuOpts:{group:"1_modification",order:1.1}})}runCommand(e,t){const i=e.get(xt),[n,o]=Array.isArray(t)&&t||[void 0,void 0];return Ae.isUri(n)&&W.isIPosition(o)?i.openCodeEditor({resource:n},i.getActiveCodeEditor()).then(r=>{r&&(r.setPosition(o),r.invokeWithinContext(a=>(this.reportTelemetry(a,r),this.run(a,r))))},Xe):super.runCommand(e,t)}run(e,t){const i=e.get(ys),n=Gc.get(t);return n?(i.trace("[RenameAction] got controller, running..."),n.run()):(i.trace("[RenameAction] returning early - controller missing"),Promise.resolve())}}kt(Gc.ID,Gc,4);te(dMe);const j4=mn.bindToContribution(Gc.get);de(new j4({id:"acceptRenameInput",precondition:L0,handler:s=>s.acceptRenameInput(!1),kbOpts:{weight:199,kbExpr:G.and(T.focus,G.not("isComposing")),primary:3}}));de(new j4({id:"acceptRenameInputWithPreview",precondition:G.and(L0,G.has("config.editor.rename.enablePreview")),handler:s=>s.acceptRenameInput(!0),kbOpts:{weight:199,kbExpr:G.and(T.focus,G.not("isComposing")),primary:2051}}));de(new j4({id:"cancelRenameInput",precondition:L0,handler:s=>s.cancelRenameInput(),kbOpts:{weight:199,kbExpr:T.focus,primary:9,secondary:[1033]}}));qt(class extends qs{constructor(){super({id:"focusNextRenameSuggestion",title:{...Ve("focusNextRenameSuggestion","Focus Next Rename Suggestion")},precondition:L0,keybinding:[{primary:18,weight:199}]})}run(e){const t=e.get(xt).getFocusedCodeEditor();if(!t)return;const i=Gc.get(t);i&&i.focusNextRenameSuggestion()}});qt(class extends qs{constructor(){super({id:"focusPreviousRenameSuggestion",title:{...Ve("focusPreviousRenameSuggestion","Focus Previous Rename Suggestion")},precondition:L0,keybinding:[{primary:16,weight:199}]})}run(e){const t=e.get(xt).getFocusedCodeEditor();if(!t)return;const i=Gc.get(t);i&&i.focusPreviousRenameSuggestion()}});Ad("_executeDocumentRenameProvider",function(s,e,t,...i){const[n]=i;yt(typeof n=="string");const{renameProvider:o}=s.get(Ce);return lMe(o,e,t,n)});Ad("_executePrepareRename",async function(s,e,t){const{renameProvider:i}=s.get(Ce),o=await new $4(e,t,i).resolveRenameLocation(dt.None);if(o!=null&&o.rejectReason)throw new Error(o.rejectReason);return o});Ji.as(pl.Configuration).registerConfiguration({id:"editor",properties:{"editor.rename.enablePreview":{scope:5,description:p("enablePreview","Enable/disable the ability to preview changes before renaming"),default:!0,type:"boolean"}}});var cMe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},K9=function(s,e){return function(t,i){e(t,i,s)}};let YC=class extends H{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(73)),this.computePromise=null,this.currentOccurrences={},this._register(e.onDidChangeModel(n=>{this.currentOccurrences={},this.options=this.createOptions(e.getOption(73)),this.stop(),this.computeSectionHeaders.schedule(0)})),this._register(e.onDidChangeModelLanguage(n=>{this.currentOccurrences={},this.options=this.createOptions(e.getOption(73)),this.stop(),this.computeSectionHeaders.schedule(0)})),this._register(t.onDidChange(n=>{var o;const r=(o=this.editor.getModel())===null||o===void 0?void 0:o.getLanguageId();r&&n.affects(r)&&(this.currentOccurrences={},this.options=this.createOptions(e.getOption(73)),this.stop(),this.computeSectionHeaders.schedule(0))})),this._register(e.onDidChangeConfiguration(n=>{this.options&&!n.hasChanged(73)||(this.options=this.createOptions(e.getOption(73)),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 Wt(()=>{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!=null&&n.markers)))return{foldingRules:n,findMarkSectionHeaders:e.showMarkSectionHeaders,findRegionSectionHeaders:e.showRegionSectionHeaders}}findSectionHeaders(){var e,t;if(!this.editor.hasModel()||!(!((e=this.options)===null||e===void 0)&&e.findMarkSectionHeaders)&&!(!((t=this.options)===null||t===void 0)&&t.findRegionSectionHeaders))return;const i=this.editor.getModel();if(i.isDisposed()||i.isTooLargeForSyncing())return;const n=i.getVersionId();this.editorWorkerService.findSectionHeaders(i.uri,this.options).then(o=>{i.isDisposed()||i.getVersionId()!==n||this.updateDecorations(o)})}updateDecorations(e){const t=this.editor.getModel();t&&(e=e.filter(o=>{if(!o.shouldBeInComments)return!0;const r=t.validateRange(o.range),a=t.tokenization.getLineTokens(r.startLineNumber),l=a.findTokenIndexAtOffset(r.startColumn-1),d=a.getStandardTokenType(l);return a.getLanguageId(l)===t.getLanguageId()&&d===1}));const i=Object.values(this.currentOccurrences).map(o=>o.decorationId),n=e.map(o=>uMe(o));this.editor.changeDecorations(o=>{const r=o.deltaDecorations(i,n);this.currentOccurrences={};for(let a=0,l=r.length;a0?t[0]:[]}async function qG(s,e,t,i,n){const o=mMe(s,e),r=await Promise.all(o.map(async a=>{let l,d=null;try{l=await a.provideDocumentSemanticTokens(e,a===t?i:null,n)}catch(c){d=c,l=null}return(!l||!Zk(l)&&!jG(l))&&(l=null),new pMe(a,l,d)}));for(const a of r){if(a.error)throw a.error;if(a.tokens)return a}return r.length>0?r[0]:null}function _Me(s,e){const t=s.orderedGroups(e);return t.length>0?t[0]:null}class vMe{constructor(e,t){this.provider=e,this.tokens=t}}function bMe(s,e){return s.has(e)}function GG(s,e){const t=s.orderedGroups(e);return t.length>0?t[0]:[]}async function K4(s,e,t,i){const n=GG(s,e),o=await Promise.all(n.map(async r=>{let a;try{a=await r.provideDocumentRangeSemanticTokens(e,t,i)}catch(l){Ai(l),a=null}return(!a||!Zk(a))&&(a=null),new vMe(r,a)}));for(const r of o)if(r.tokens)return r;return o.length>0?o[0]:null}pt.registerCommand("_provideDocumentSemanticTokensLegend",async(s,...e)=>{const[t]=e;yt(t instanceof Ae);const i=s.get(_i).getModel(t);if(!i)return;const{documentSemanticTokensProvider:n}=s.get(Ce),o=_Me(n,i);return o?o[0].getLegend():s.get(gi).executeCommand("_provideDocumentRangeSemanticTokensLegend",t)});pt.registerCommand("_provideDocumentSemanticTokens",async(s,...e)=>{const[t]=e;yt(t instanceof Ae);const i=s.get(_i).getModel(t);if(!i)return;const{documentSemanticTokensProvider:n}=s.get(Ce);if(!KG(n,i))return s.get(gi).executeCommand("_provideDocumentRangeSemanticTokens",t,i.getFullModelRange());const o=await qG(n,i,null,null,dt.None);if(!o)return;const{provider:r,tokens:a}=o;if(!a||!Zk(a))return;const l=$G({id:0,type:"full",data:a.data});return a.resultId&&r.releaseDocumentSemanticTokens(a.resultId),l});pt.registerCommand("_provideDocumentRangeSemanticTokensLegend",async(s,...e)=>{const[t,i]=e;yt(t instanceof Ae);const n=s.get(_i).getModel(t);if(!n)return;const{documentRangeSemanticTokensProvider:o}=s.get(Ce),r=GG(o,n);if(r.length===0)return;if(r.length===1)return r[0].getLegend();if(!i||!x.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 K4(o,n,x.lift(i),dt.None);if(a)return a.provider.getLegend()});pt.registerCommand("_provideDocumentRangeSemanticTokens",async(s,...e)=>{const[t,i]=e;yt(t instanceof Ae),yt(x.isIRange(i));const n=s.get(_i).getModel(t);if(!n)return;const{documentRangeSemanticTokensProvider:o}=s.get(Ce),r=await K4(o,n,x.lift(i),dt.None);if(!(!r||!r.tokens))return $G({id:0,type:"full",data:r.tokens.data})});const q4="editor.semanticHighlighting";function _S(s,e,t){var i;const n=(i=t.getValue(q4,{overrideIdentifier:s.getLanguageId(),resource:s.uri}))===null||i===void 0?void 0:i.enabled;return typeof n=="boolean"?n:e.getColorTheme().semanticHighlighting}var ZG=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Hl=function(s,e){return function(t,i){e(t,i,s)}},xu;let jR=class extends H{constructor(e,t,i,n,o,r){super(),this._watchers=Object.create(null);const a=c=>{this._watchers[c.uri.toString()]=new QC(c,e,i,o,r)},l=(c,u)=>{u.dispose(),delete this._watchers[c.uri.toString()]},d=()=>{for(const c of t.getModels()){const u=this._watchers[c.uri.toString()];_S(c,i,n)?u||a(c):u&&l(c,u)}};t.getModels().forEach(c=>{_S(c,i,n)&&a(c)}),this._register(t.onModelAdded(c=>{_S(c,i,n)&&a(c)})),this._register(t.onModelRemoved(c=>{const u=this._watchers[c.uri.toString()];u&&l(c,u)})),this._register(n.onDidChangeConfiguration(c=>{c.affectsConfiguration(q4)&&d()})),this._register(i.onDidColorThemeChange(d))}dispose(){for(const e of Object.values(this._watchers))e.dispose();super.dispose()}};jR=ZG([Hl(0,Px),Hl(1,_i),Hl(2,_n),Hl(3,rt),Hl(4,Ur),Hl(5,Ce)],jR);let QC=xu=class extends H{constructor(e,t,i,n,o){super(),this._semanticTokensStylingService=t,this._isDisposed=!1,this._model=e,this._provider=o.documentSemanticTokensProvider,this._debounceInformation=n.for(this._provider,"DocumentSemanticTokens",{min:xu.REQUEST_MIN_DELAY,max:xu.REQUEST_MAX_DELAY}),this._fetchDocumentSemanticTokens=this._register(new Wt(()=>this._fetchDocumentSemanticTokensNow(),xu.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=()=>{jt(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),jt(this._documentProvidersChangeListeners),this._documentProvidersChangeListeners=[],this._setDocumentSemanticTokens(null,null,null,[]),this._isDisposed=!0,super.dispose()}_fetchDocumentSemanticTokensNow(){if(this._currentDocumentRequestCancellationTokenSource)return;if(!KG(this._provider,this._model)){this._currentDocumentResponse&&this._model.tokenization.setSemanticTokens(null,!1);return}if(!this._model.isAttachedToEditor())return;const e=new Vi,t=this._currentDocumentResponse?this._currentDocumentResponse.provider:null,i=this._currentDocumentResponse&&this._currentDocumentResponse.resultId||null,n=qG(this._provider,this._model,t,i,e.token);this._currentDocumentRequestCancellationTokenSource=e,this._providersChangedDuringRequest=!1;const o=[],r=this._model.onDidChangeContent(l=>{o.push(l)}),a=new Jn(!1);n.then(l=>{if(this._debounceInformation.update(this._model,a.elapsed()),this._currentDocumentRequestCancellationTokenSource=null,r.dispose(),!l)this._setDocumentSemanticTokens(null,null,null,o);else{const{provider:d,tokens:c}=l,u=this._semanticTokensStylingService.getStyling(d);this._setDocumentSemanticTokens(d,c||null,u,o)}},l=>{l&&(Id(l)||typeof l.message=="string"&&l.message.indexOf("busy")!==-1)||Xe(l),this._currentDocumentRequestCancellationTokenSource=null,r.dispose(),(o.length>0||this._providersChangedDuringRequest)&&(this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model)))})}static _copy(e,t,i,n,o){o=Math.min(o,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(jG(t)){if(!o){this._model.tokenization.setSemanticTokens(null,!0);return}if(t.edits.length===0)t={resultId:t.resultId,data:o.data};else{let a=0;for(const h of t.edits)a+=(h.data?h.data.length:0)-h.deleteCount;const l=o.data,d=new Uint32Array(l.length+a);let c=l.length,u=d.length;for(let h=t.edits.length-1;h>=0;h--){const g=t.edits[h];if(g.start>l.length){i.warnInvalidEditStart(o.resultId,t.resultId,h,g.start,l.length),this._model.tokenization.setSemanticTokens(null,!0);return}const f=c-(g.start+g.deleteCount);f>0&&(xu._copy(l,c-f,d,u-f,f),u-=f),g.data&&(xu._copy(g.data,0,d,u-g.data.length,g.data.length),u-=g.data.length),c=g.start}c>0&&xu._copy(l,0,d,0,c),t={resultId:t.resultId,data:d}}}if(Zk(t)){this._currentDocumentResponse=new CMe(e,t.resultId,t.data);const a=z$(t,i,this._model.getLanguageId());if(n.length>0)for(const l of n)for(const d of a)for(const c of l.changes)d.applyEdit(c.range,c.text);this._model.tokenization.setSemanticTokens(a,!0)}else this._model.tokenization.setSemanticTokens(null,!0);r()}};QC.REQUEST_MIN_DELAY=300;QC.REQUEST_MAX_DELAY=2e3;QC=xu=ZG([Hl(1,Px),Hl(2,_n),Hl(3,Ur),Hl(4,Ce)],QC);class CMe{constructor(e,t,i){this.provider=e,this.resultId=t,this.data=i}dispose(){this.provider.releaseDocumentSemanticTokens(this.resultId)}}F1(jR);var wMe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},lv=function(s,e){return function(t,i){e(t,i,s)}};let JC=class extends H{constructor(e,t,i,n,o,r){super(),this._semanticTokensStylingService=t,this._themeService=i,this._configurationService=n,this._editor=e,this._provider=r.documentRangeSemanticTokensProvider,this._debounceInformation=o.for(this._provider,"DocumentRangeSemanticTokens",{min:100,max:500}),this._tokenizeViewport=this._register(new Wt(()=>this._tokenizeViewportNow(),100)),this._outstandingRequests=[];const a=()=>{this._editor.hasModel()&&this._tokenizeViewport.schedule(this._debounceInformation.get(this._editor.getModel()))};this._register(this._editor.onDidScrollChange(()=>{a()})),this._register(this._editor.onDidChangeModel(()=>{this._cancelAll(),a()})),this._register(this._editor.onDidChangeModelContent(l=>{this._cancelAll(),a()})),this._register(this._provider.onDidChange(()=>{this._cancelAll(),a()})),this._register(this._configurationService.onDidChangeConfiguration(l=>{l.affectsConfiguration(q4)&&(this._cancelAll(),a())})),this._register(this._themeService.onDidColorThemeChange(()=>{this._cancelAll(),a()})),a()}_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=Dn(r=>Promise.resolve(K4(this._provider,e,t,r))),o=new Jn(!1);return n.then(r=>{if(this._debounceInformation.update(e,o.elapsed()),!r||!r.tokens||e.isDisposed()||e.getVersionId()!==i)return;const{provider:a,tokens:l}=r,d=this._semanticTokensStylingService.getStyling(a);e.tokenization.setPartialSemanticTokens(t,z$(l,d,e.getLanguageId()))}).then(()=>this._removeOutstandingRequest(n),()=>this._removeOutstandingRequest(n)),n}};JC.ID="editor.contrib.viewportSemanticTokens";JC=wMe([lv(1,Px),lv(2,_n),lv(3,rt),lv(4,Ur),lv(5,Ce)],JC);kt(JC.ID,JC,1);class yMe{constructor(e=!0){this.selectSubwords=e}provideSelectionRanges(e,t){const i=[];for(const n of t){const o=[];i.push(o),this.selectSubwords&&this._addInWordRanges(o,e,n),this._addWordRanges(o,e,n),this._addWhitespaceLine(o,e,n),o.push({range:e.getFullModelRange()})}return i}_addInWordRanges(e,t,i){const n=t.getWordAtPosition(i);if(!n)return;const{word:o,startColumn:r}=n,a=i.column-r;let l=a,d=a,c=0;for(;l>=0;l--){const u=o.charCodeAt(l);if(l!==a&&(u===95||u===45))break;if(Bu(u)&&Fl(c))break;c=u}for(l+=1;d0&&t.getLineFirstNonWhitespaceColumn(i.lineNumber)===0&&t.getLineLastNonWhitespaceColumn(i.lineNumber)===0&&e.push({range:new x(i.lineNumber,1,i.lineNumber,t.getLineMaxColumn(i.lineNumber))})}}var SMe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},DMe=function(s,e){return function(t,i){e(t,i,s)}},KR;class G4{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 G4(t,this.ranges);return i.ranges[t].equalsRange(this.ranges[this.index])?i.mov(e):i}}let G_=KR=class{static get(e){return e.getContribution(KR.ID)}constructor(e,t){this._editor=e,this._languageFeaturesService=t,this._ignoreSelection=!1}dispose(){var e;(e=this._selectionListener)===null||e===void 0||e.dispose()}async run(e){if(!this._editor.hasModel())return;const t=this._editor.getSelections(),i=this._editor.getModel();if(this._state||await YG(this._languageFeaturesService.selectionRangeProvider,i,t.map(o=>o.getPosition()),this._editor.getOption(113),dt.None).then(o=>{var r;if(!(!rs(o)||o.length!==t.length)&&!(!this._editor.hasModel()||!Ci(this._editor.getSelections(),t,(a,l)=>a.equalsSelection(l)))){for(let a=0;al.containsPosition(t[a].getStartPosition())&&l.containsPosition(t[a].getEndPosition())),o[a].unshift(t[a]);this._state=o.map(a=>new G4(0,a)),(r=this._selectionListener)===null||r===void 0||r.dispose(),this._selectionListener=this._editor.onDidChangeCursorPosition(()=>{var a;this._ignoreSelection||((a=this._selectionListener)===null||a===void 0||a.dispose(),this._state=void 0)})}}),!this._state)return;this._state=this._state.map(o=>o.mov(e));const n=this._state.map(o=>we.fromPositions(o.ranges[o.index].getStartPosition(),o.ranges[o.index].getEndPosition()));this._ignoreSelection=!0;try{this._editor.setSelections(n)}finally{this._ignoreSelection=!1}}};G_.ID="editor.contrib.smartSelectController";G_=KR=SMe([DMe(1,Ce)],G_);class XG extends me{constructor(e,t){super(t),this._forward=e}async run(e,t){const i=G_.get(t);i&&await i.run(this._forward)}}class LMe extends XG{constructor(){super(!0,{id:"editor.action.smartSelect.expand",label:p("smartSelect.expand","Expand Selection"),alias:"Expand Selection",precondition:void 0,kbOpts:{kbExpr:T.editorTextFocus,primary:1553,mac:{primary:3345,secondary:[1297]},weight:100},menuOpts:{menuId:E.MenubarSelectionMenu,group:"1_basic",title:p({},"&&Expand Selection"),order:2}})}}pt.registerCommandAlias("editor.action.smartSelect.grow","editor.action.smartSelect.expand");class xMe extends XG{constructor(){super(!1,{id:"editor.action.smartSelect.shrink",label:p("smartSelect.shrink","Shrink Selection"),alias:"Shrink Selection",precondition:void 0,kbOpts:{kbExpr:T.editorTextFocus,primary:1551,mac:{primary:3343,secondary:[1295]},weight:100},menuOpts:{menuId:E.MenubarSelectionMenu,group:"1_basic",title:p({},"&&Shrink Selection"),order:3}})}}kt(G_.ID,G_,4);te(LMe);te(xMe);async function YG(s,e,t,i,n){const o=s.all(e).concat(new yMe(i.selectSubwords));o.length===1&&o.unshift(new jo);const r=[],a=[];for(const l of o)r.push(Promise.resolve(l.provideSelectionRanges(e,t,n)).then(d=>{if(rs(d)&&d.length===t.length)for(let c=0;c{if(l.length===0)return[];l.sort((h,g)=>W.isBefore(h.getStartPosition(),g.getStartPosition())?1:W.isBefore(g.getStartPosition(),h.getStartPosition())||W.isBefore(h.getEndPosition(),g.getEndPosition())?-1:W.isBefore(g.getEndPosition(),h.getEndPosition())?1:0);const d=[];let c;for(const h of l)(!c||x.containsRange(h,c)&&!x.equalsRange(h,c))&&(d.push(h),c=h);if(!i.selectLeadingAndTrailingWhitespace)return d;const u=[d[0]];for(let h=1;hs}),LT="data-sticky-line-index",Z9="data-sticky-is-line",EMe="data-sticky-is-line-number",X9="data-sticky-is-folding-icon";class IMe extends H{constructor(e){super(),this._editor=e,this._foldingIconStore=new Y,this._rootDomNode=document.createElement("div"),this._lineNumbersDomNode=document.createElement("div"),this._linesDomNodeScrollable=document.createElement("div"),this._linesDomNode=document.createElement("div"),this._lineHeight=this._editor.getOption(67),this._renderedStickyLines=[],this._lineNumbers=[],this._lastLineRelativePosition=0,this._minContentWidthInPx=0,this._isOnGlyphMargin=!1,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 Uh),this._rootDomNode.appendChild(this._lineNumbersDomNode),this._rootDomNode.appendChild(this._linesDomNodeScrollable);const t=()=>{this._linesDomNode.style.left=this._editor.getOption(115).scrollWithEditor?`-${this._editor.getScrollLeft()}px`:"0px"};this._register(this._editor.onDidChangeConfiguration(i=>{i.hasChanged(115)&&t(),i.hasChanged(67)&&(this._lineHeight=this._editor.getOption(67))})),this._register(this._editor.onDidScrollChange(i=>{i.scrollLeftChanged&&t(),i.scrollWidthChanged&&this._updateWidgetWidth()})),this._register(this._editor.onDidChangeModel(()=>{t(),this._updateWidgetWidth()})),this._register(this._foldingIconStore),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){if(i===void 0&&(!this._previousState&&!e||this._previousState&&this._previousState.equals(e)))return;const n=this._isWidgetHeightZero(e),o=n?void 0:e,r=n?0:this._findLineToRebuildWidgetFrom(e,i);this._renderRootNode(o,t,r),this._previousState=e}_isWidgetHeightZero(e){if(!e)return!0;const t=e.startLineNumbers.length*this._lineHeight+e.lastLineRelativePosition;if(t>0){this._lastLineRelativePosition=e.lastLineRelativePosition;const i=[...e.startLineNumbers];e.showEndForLine!==null&&(i[e.showEndForLine]=e.endLineNumbers[e.showEndForLine]),this._lineNumbers=i}else this._lastLineRelativePosition=0,this._lineNumbers=[];return t===0}_findLineToRebuildWidgetFrom(e,t){if(!e||!this._previousState)return 0;if(t!==void 0)return t;const i=this._previousState,n=e.startLineNumbers.findIndex(o=>!i.startLineNumbers.includes(o));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`}_clearStickyLinesFromLine(e){this._foldingIconStore.clear();for(let t=e;ta.scrollWidth))+n.verticalScrollbarWidth,this._editor.layoutOverlayWidget(this)}_setFoldingHoverListeners(){this._editor.getOption(110)==="mouseover"&&(this._foldingIconStore.add(K(this._lineNumbersDomNode,ee.MOUSE_ENTER,()=>{this._isOnGlyphMargin=!0,this._setFoldingIconsVisibility(!0)})),this._foldingIconStore.add(K(this._lineNumbersDomNode,ee.MOUSE_LEAVE,()=>{this._isOnGlyphMargin=!1,this._useFoldingOpacityTransition(!0),this._setFoldingIconsVisibility(!1)})))}_renderChildNode(e,t,i,n){const o=this._editor._getViewModel();if(!o)return;const r=o.coordinatesConverter.convertModelPositionToViewPosition(new W(t,1)).lineNumber,a=o.getViewLineRenderingData(r),l=this._editor.getOption(68);let d;try{d=Os.filter(a.inlineDecorations,r,a.minColumn,a.maxColumn)}catch{d=[]}const c=new tg(!0,!0,a.content,a.continuesWithWrappedLine,a.isBasicASCII,a.containsRTL,0,a.tokens,d,a.tabSize,a.startVisibleColumn,1,1,1,500,"none",!0,!0,null),u=new l0(2e3),h=m1(c,u);let g;G9?g=G9.createHTML(u.build()):g=u.build();const f=document.createElement("span");f.setAttribute(LT,String(e)),f.setAttribute(Z9,""),f.setAttribute("role","listitem"),f.tabIndex=0,f.className="sticky-line-content",f.classList.add(`stickyLine${t}`),f.style.lineHeight=`${this._lineHeight}px`,f.innerHTML=g;const m=document.createElement("span");m.setAttribute(LT,String(e)),m.setAttribute(EMe,""),m.className="sticky-line-number",m.style.lineHeight=`${this._lineHeight}px`;const _=n.contentLeft;m.style.width=`${_}px`;const v=document.createElement("span");l.renderType===1||l.renderType===3&&t%10===0?v.innerText=t.toString():l.renderType===2&&(v.innerText=Math.abs(t-this._editor.getPosition().lineNumber).toString()),v.className="sticky-line-number-inner",v.style.lineHeight=`${this._lineHeight}px`,v.style.width=`${n.lineNumbersWidth}px`,v.style.paddingLeft=`${n.lineNumbersLeft}px`,m.appendChild(v);const b=this._renderFoldingIconForLine(i,t);b&&m.appendChild(b.domNode),this._editor.applyFontInfo(f),this._editor.applyFontInfo(v),m.style.lineHeight=`${this._lineHeight}px`,f.style.lineHeight=`${this._lineHeight}px`,m.style.height=`${this._lineHeight}px`,f.style.height=`${this._lineHeight}px`;const C=new TMe(e,t,f,m,b,h.characterMapping,f.scrollWidth);return this._updateTopAndZIndexOfStickyLine(C)}_updateTopAndZIndexOfStickyLine(e){var t;const i=e.index,n=e.lineDomNode,o=e.lineNumberDomNode,r=i===this._lineNumbers.length-1,a="0",l="1";n.style.zIndex=r?a:l,o.style.zIndex=r?a:l;const d=`${i*this._lineHeight+this._lastLineRelativePosition+(!((t=e.foldingIcon)===null||t===void 0)&&t.isCollapsed?1:0)}px`,c=`${i*this._lineHeight}px`;return n.style.top=r?d:c,o.style.top=r?d:c,e}_renderFoldingIconForLine(e,t){const i=this._editor.getOption(110);if(!e||i==="never")return;const n=e.regions,o=n.findRange(t),r=n.getStartLineNumber(o);if(!(t===r))return;const l=n.isCollapsed(o),d=new NMe(l,r,n.getEndLineNumber(o),this._lineHeight);return d.setVisible(this._isOnGlyphMargin?!0:l||i==="always"),d.domNode.setAttribute(X9,""),d}getId(){return"editor.contrib.stickyScrollWidget"}getDomNode(){return this._rootDomNode}getPosition(){return{preference:null}}getMinContentWidthInPx(){return this._minContentWidthInPx}focusLineWithIndex(e){0<=e&&e0)return null;const t=this._getRenderedStickyLineFromChildDomNode(e);if(!t)return null;const i=BF(t.characterMapping,e,0);return new W(t.lineNumber,i)}getLineNumberFromChildDomNode(e){var t,i;return(i=(t=this._getRenderedStickyLineFromChildDomNode(e))===null||t===void 0?void 0:t.lineNumber)!==null&&i!==void 0?i: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,LT);return t?parseInt(t,10):null}isInStickyLine(e){return this._getAttributeValue(e,Z9)!==void 0}isInFoldingIconDomNode(e){return this._getAttributeValue(e,X9)!==void 0}_getAttributeValue(e,t){for(;e&&e!==this._rootDomNode;){const i=e.getAttribute(t);if(i!==null)return i;e=e.parentElement}}}class TMe{constructor(e,t,i,n,o,r,a){this.index=e,this.lineNumber=t,this.lineDomNode=i,this.lineNumberDomNode=n,this.foldingIcon=o,this.characterMapping=r,this.scrollWidth=a}}class NMe{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=`${n}px`,this.domNode.style.height=`${n}px`,this.domNode.className=Pe.asClassName(e?Tk:Ik)}setVisible(e){this.domNode.style.cursor=e?"pointer":"default",this.domNode.style.opacity=e?"1":"0"}}class vb{constructor(e,t){this.startLineNumber=e,this.endLineNumber=t}}class EL{constructor(e,t,i){this.range=e,this.children=t,this.parent=i}}class QG{constructor(e,t,i,n){this.uri=e,this.version=t,this.element=i,this.outlineProviderId=n}}var Xk=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},e1=function(s,e){return function(t,i){e(t,i,s)}},bb;(function(s){s.OUTLINE_MODEL="outlineModel",s.FOLDING_PROVIDER_MODEL="foldingProviderModel",s.INDENTATION_MODEL="indentationModel"})(bb||(bb={}));var eh;(function(s){s[s.VALID=0]="VALID",s[s.INVALID=1]="INVALID",s[s.CANCELED=2]="CANCELED"})(eh||(eh={}));let qR=class extends H{constructor(e,t,i,n){switch(super(),this._editor=e,this._modelProviders=[],this._modelPromise=null,this._updateScheduler=this._register(new _a(300)),this._updateOperation=this._register(new Y),this._editor.getOption(115).defaultModel){case bb.OUTLINE_MODEL:this._modelProviders.push(new GR(this._editor,n));case bb.FOLDING_PROVIDER_MODEL:this._modelProviders.push(new XR(this._editor,t,n));case bb.INDENTATION_MODEL:this._modelProviders.push(new ZR(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 o=await i;if(this._modelPromise!==n)return null;switch(o){case eh.CANCELED:return this._updateOperation.clear(),null;case eh.VALID:return t.stickyModel}}return null}).catch(t=>(Xe(t),null))}};qR=Xk([e1(2,Ne),e1(3,Ce)],qR);class JG extends H{constructor(e){super(),this._editor=e,this._stickyModel=null}get stickyModel(){return this._stickyModel}_invalid(){return this._stickyModel=null,eh.INVALID}computeStickyModel(e){if(e.isCancellationRequested||!this.isProviderValid())return{statusPromise:this._invalid(),modelPromise:null};const t=Dn(i=>this.createModelFromProvider(i));return{statusPromise:t.then(i=>this.isModelValid(i)?e.isCancellationRequested?eh.CANCELED:(this._stickyModel=this.createStickyModel(e,i),eh.VALID):this._invalid()).then(void 0,i=>(Xe(i),eh.CANCELED)),modelPromise:t}}isModelValid(e){return!0}isProviderValid(){return!0}}let GR=class extends JG{constructor(e,t){super(e),this._languageFeaturesService=t}createModelFromProvider(e){return nc.create(this._languageFeaturesService.documentSymbolProvider,this._editor.getModel(),e)}createStickyModel(e,t){var i;const{stickyOutlineElement:n,providerID:o}=this._stickyModelFromOutlineModel(t,(i=this._stickyModel)===null||i===void 0?void 0:i.outlineProviderId),r=this._editor.getModel();return new QG(r.uri,r.getVersionId(),n,o)}isModelValid(e){return e&&e.children.size>0}_stickyModelFromOutlineModel(e,t){let i;if(ft.first(e.children.values())instanceof bG){const a=ft.find(e.children.values(),l=>l.id===t);if(a)i=a.children;else{let l="",d=-1,c;for(const[u,h]of e.children.entries()){const g=this._findSumOfRangesOfGroup(h);g>d&&(c=h,d=g,l=h.id)}t=l,i=c.children}}else i=e.children;const n=[],o=Array.from(i.values()).sort((a,l)=>{const d=new vb(a.symbol.range.startLineNumber,a.symbol.range.endLineNumber),c=new vb(l.symbol.range.startLineNumber,l.symbol.range.endLineNumber);return this._comparator(d,c)});for(const a of o)n.push(this._stickyModelFromOutlineElement(a,a.symbol.selectionRange.startLineNumber));return{stickyOutlineElement:new EL(void 0,n,void 0),providerID:t}}_stickyModelFromOutlineElement(e,t){const i=[];for(const o of e.children.values())if(o.symbol.selectionRange.startLineNumber!==o.symbol.range.endLineNumber)if(o.symbol.selectionRange.startLineNumber!==t)i.push(this._stickyModelFromOutlineElement(o,o.symbol.selectionRange.startLineNumber));else for(const r of o.children.values())i.push(this._stickyModelFromOutlineElement(r,o.symbol.selectionRange.startLineNumber));i.sort((o,r)=>this._comparator(o.range,r.range));const n=new vb(e.symbol.selectionRange.startLineNumber,e.symbol.range.endLineNumber);return new EL(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 hR?t+e.symbol.range.endLineNumber-e.symbol.selectionRange.startLineNumber:t}};GR=Xk([e1(1,Ce)],GR);class eZ extends JG{constructor(e){super(e),this._foldingLimitReporter=new mG(e)}createStickyModel(e,t){const i=this._fromFoldingRegions(t),n=this._editor.getModel();return new QG(n.uri,n.getVersionId(),i,void 0)}isModelValid(e){return e!==null}_fromFoldingRegions(e){const t=e.length,i=[],n=new EL(void 0,[],void 0);for(let o=0;o0&&(this.provider=this._register(new M4(e.getModel(),n,t,this._foldingLimitReporter,void 0)))}isProviderValid(){return this.provider!==void 0}async createModelFromProvider(e){var t,i;return(i=(t=this.provider)===null||t===void 0?void 0:t.compute(e))!==null&&i!==void 0?i:null}};XR=Xk([e1(2,Ce)],XR);var AMe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Y9=function(s,e){return function(t,i){e(t,i,s)}};class MMe{constructor(e,t,i){this.startLineNumber=e,this.endLineNumber=t,this.nestingDepth=i}}let YR=class extends H{constructor(e,t,i){super(),this._languageFeaturesService=t,this._languageConfigurationService=i,this._onDidChangeStickyScroll=this._register(new B),this.onDidChangeStickyScroll=this._onDidChangeStickyScroll.event,this._model=null,this._cts=null,this._stickyModelProvider=null,this._editor=e,this._sessionStore=this._register(new Y),this._updateSoon=this._register(new Wt(()=>this.update(),50)),this._register(this._editor.onDidChangeConfiguration(n=>{n.hasChanged(115)&&this.readConfiguration()})),this.readConfiguration()}readConfiguration(){this._sessionStore.clear(),this._editor.getOption(115).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(Ie(()=>{var t;(t=this._stickyModelProvider)===null||t===void 0||t.dispose(),this._stickyModelProvider=null})),this.updateStickyModelProvider(),this.update())}getVersionId(){var e;return(e=this._model)===null||e===void 0?void 0:e.version}updateStickyModelProvider(){var e;(e=this._stickyModelProvider)===null||e===void 0||e.dispose(),this._stickyModelProvider=null;const t=this._editor;t.hasModel()&&(this._stickyModelProvider=new qR(t,()=>this._updateSoon.schedule(),this._languageConfigurationService,this._languageFeaturesService))}async update(){var e;(e=this._cts)===null||e===void 0||e.dispose(!0),this._cts=new Vi,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)}updateIndex(e){return e===-1?e=0:e<0&&(e=-e-2),e}getCandidateStickyLinesIntersectingFromStickyModel(e,t,i,n,o){if(t.children.length===0)return;let r=o;const a=[];for(let c=0;cc-u)),d=this.updateIndex(xb(a,e.startLineNumber+n,(c,u)=>c-u));for(let c=l;c<=d;c++){const u=t.children[c];if(!u)return;if(u.range){const h=u.range.startLineNumber,g=u.range.endLineNumber;e.startLineNumber<=g+1&&h-1<=e.endLineNumber&&h!==r&&(r=h,i.push(new MMe(h,g-1,n+1)),this.getCandidateStickyLinesIntersectingFromStickyModel(e,u,i,n+1,h))}else this.getCandidateStickyLinesIntersectingFromStickyModel(e,u,i,n,o)}}getCandidateStickyLinesIntersecting(e){var t,i;if(!(!((t=this._model)===null||t===void 0)&&t.element))return[];let n=[];this.getCandidateStickyLinesIntersectingFromStickyModel(e,this._model.element,n,0,-1);const o=(i=this._editor._getViewModel())===null||i===void 0?void 0:i.getHiddenAreas();if(o)for(const r of o)n=n.filter(a=>!(a.startLineNumber>=r.startLineNumber&&a.endLineNumber<=r.endLineNumber+1));return n}};YR=AMe([Y9(1,Ce),Y9(2,Yt)],YR);var RMe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Vp=function(s,e){return function(t,i){e(t,i,s)}},QR;let Ed=QR=class extends H{constructor(e,t,i,n,o,r,a){super(),this._editor=e,this._contextMenuService=t,this._languageFeaturesService=i,this._instaService=n,this._contextKeyService=a,this._sessionStore=new Y,this._foldingModel=null,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._showEndForLine=null,this._stickyScrollWidget=new IMe(this._editor),this._stickyLineCandidateProvider=new YR(this._editor,i,o),this._register(this._stickyScrollWidget),this._register(this._stickyLineCandidateProvider),this._widgetState=new q9([],[],0),this._onDidResize(),this._readConfiguration();const l=this._stickyScrollWidget.getDomNode();this._register(this._editor.onDidChangeConfiguration(c=>{this._readConfigurationChange(c)})),this._register(K(l,ee.CONTEXT_MENU,async c=>{this._onContextMenu(Te(l),c)})),this._stickyScrollFocusedContextKey=T.stickyScrollFocused.bindTo(this._contextKeyService),this._stickyScrollVisibleContextKey=T.stickyScrollVisible.bindTo(this._contextKeyService);const d=this._register(ba(l));this._register(d.onDidBlur(c=>{this._positionRevealed===!1&&l.clientHeight===0?(this._focusedStickyElementIndex=-1,this.focus()):this._disposeFocusStickyScrollStore()})),this._register(d.onDidFocus(c=>{this.focus()})),this._registerMouseListeners(),this._register(K(l,ee.MOUSE_DOWN,c=>{this._onMouseDown=!0}))}static get(e){return e.getContribution(QR.ID)}_disposeFocusStickyScrollStore(){var e;this._stickyScrollFocusedContextKey.set(!1),(e=this._focusDisposableStore)===null||e===void 0||e.dispose(),this._focused=!1,this._positionRevealed=!1,this._onMouseDown=!1}focus(){if(this._onMouseDown){this._onMouseDown=!1,this._editor.focus();return}this._stickyScrollFocusedContextKey.get()!==!0&&(this._focused=!0,this._focusDisposableStore=new Y,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(x.fromPositions(e)),this._editor.focus()}_registerMouseListeners(){const e=this._register(new Y),t=this._register(new vk(this._editor,{extractLineNumberFromMouseEvent:o=>{const r=this._stickyScrollWidget.getEditorPositionFromNode(o.target.element);return r?r.lineNumber:0}})),i=o=>{if(!this._editor.hasModel()||o.target.type!==12||o.target.detail!==this._stickyScrollWidget.getId())return null;const r=o.target.element;if(!r||r.innerText!==r.innerHTML)return null;const a=this._stickyScrollWidget.getEditorPositionFromNode(r);return a?{range:new x(a.lineNumber,a.column,a.lineNumber,a.column+r.innerText.length),textElement:r}:null},n=this._stickyScrollWidget.getDomNode();this._register(Ni(n,ee.CLICK,o=>{if(o.ctrlKey||o.altKey||o.metaKey||!o.leftButton)return;if(o.shiftKey){const d=this._stickyScrollWidget.getLineIndexFromChildDomNode(o.target);if(d===null)return;const c=new W(this._endLineNumbers[d],1);this._revealLineInCenterIfOutsideViewport(c);return}if(this._stickyScrollWidget.isInFoldingIconDomNode(o.target)){const d=this._stickyScrollWidget.getLineNumberFromChildDomNode(o.target);this._toggleFoldingRegionForLine(d);return}if(!this._stickyScrollWidget.isInStickyLine(o.target))return;let l=this._stickyScrollWidget.getEditorPositionFromNode(o.target);if(!l){const d=this._stickyScrollWidget.getLineNumberFromChildDomNode(o.target);if(d===null)return;l=new W(d,1)}this._revealPosition(l)})),this._register(Ni(n,ee.MOUSE_MOVE,o=>{if(o.shiftKey){const r=this._stickyScrollWidget.getLineIndexFromChildDomNode(o.target);if(r===null||this._showEndForLine!==null&&this._showEndForLine===r)return;this._showEndForLine=r,this._renderStickyScroll();return}this._showEndForLine!==null&&(this._showEndForLine=null,this._renderStickyScroll())})),this._register(K(n,ee.MOUSE_LEAVE,o=>{this._showEndForLine!==null&&(this._showEndForLine=null,this._renderStickyScroll())})),this._register(t.onMouseMoveOrRelevantKeyDown(([o,r])=>{const a=i(o);if(!a||!o.hasTriggerModifier||!this._editor.hasModel()){e.clear();return}const{range:l,textElement:d}=a;if(!l.equalsRange(this._stickyRangeProjectedOnEditor))this._stickyRangeProjectedOnEditor=l,e.clear();else if(d.style.textDecoration==="underline")return;const c=new Vi;e.add(Ie(()=>c.dispose(!0)));let u;Dk(this._languageFeaturesService.definitionProvider,this._editor.getModel(),new W(l.startLineNumber,l.startColumn+1),c.token).then(h=>{if(!c.token.isCancellationRequested)if(h.length!==0){this._candidateDefinitionsLength=h.length;const g=d;u!==g?(e.clear(),u=g,u.style.textDecoration="underline",e.add(Ie(()=>{u.style.textDecoration="none"}))):u||(u=g,u.style.textDecoration="underline",e.add(Ie(()=>{u.style.textDecoration="none"})))}else e.clear()})})),this._register(t.onCancel(()=>{e.clear()})),this._register(t.onExecute(async o=>{if(o.target.type!==12||o.target.detail!==this._stickyScrollWidget.getId())return;const r=this._stickyScrollWidget.getEditorPositionFromNode(o.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(Zq,o,this._editor,{uri:this._editor.getModel().uri,range:this._stickyRangeProjectedOnEditor})))}))}_onContextMenu(e,t){const i=new ra(e,t);this._contextMenuService.showContextMenu({menuId:E.StickyScrollContext,getAnchor:()=>i})}_toggleFoldingRegionForLine(e){if(!this._foldingModel||e===null)return;const t=this._stickyScrollWidget.getRenderedStickyLine(e),i=t==null?void 0:t.foldingIcon;if(!i)return;uG(this._foldingModel,Number.MAX_VALUE,[e]),i.isCollapsed=!i.isCollapsed;const n=(i.isCollapsed?this._editor.getTopForLineNumber(i.foldingEndLine):this._editor.getTopForLineNumber(i.foldingStartLine))-this._editor.getOption(67)*t.index+1;this._editor.setScrollTop(n),this._renderStickyScroll(e)}_readConfiguration(){const e=this._editor.getOption(115);if(e.enabled===!1){this._editor.removeOverlayWidget(this._stickyScrollWidget),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=null,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=null,this._renderStickyScroll()})),this._enabled=!0);this._editor.getOption(68).renderType===2&&this._sessionStore.add(this._editor.onDidChangeCursorPosition(()=>{this._showEndForLine=null,this._renderStickyScroll(0)}))}_readConfigurationChange(e){(e.hasChanged(115)||e.hasChanged(73)||e.hasChanged(67)||e.hasChanged(110)||e.hasChanged(68))&&this._readConfiguration(),e.hasChanged(68)&&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(67);this._maxStickyLines=Math.round(t*.25)}async _renderStickyScroll(e){var t,i;const n=this._editor.getModel();if(!n||n.isTooLargeForTokenization()){this._foldingModel=null,this._stickyScrollWidget.setState(void 0,null);return}const o=this._stickyLineCandidateProvider.getVersionId();if(o===void 0||o===n.getVersionId())if(this._foldingModel=(i=await((t=qc.get(this._editor))===null||t===void 0?void 0:t.getFoldingModel()))!==null&&i!==void 0?i:null,this._widgetState=this.findScrollWidgetState(),this._stickyScrollVisibleContextKey.set(this._widgetState.startLineNumbers.length!==0),!this._focused)this._stickyScrollWidget.setState(this._widgetState,this._foldingModel,e);else if(this._focusedStickyElementIndex===-1)this._stickyScrollWidget.setState(this._widgetState,this._foldingModel,e),this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumberCount-1,this._focusedStickyElementIndex!==-1&&this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex);else{const r=this._stickyScrollWidget.lineNumbers[this._focusedStickyElementIndex];this._stickyScrollWidget.setState(this._widgetState,this._foldingModel,e),this._stickyScrollWidget.lineNumberCount===0?this._focusedStickyElementIndex=-1:(this._stickyScrollWidget.lineNumbers.includes(r)||(this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumberCount-1),this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex))}}findScrollWidgetState(){const e=this._editor.getOption(67),t=Math.min(this._maxStickyLines,this._editor.getOption(115).maxLineCount),i=this._editor.getScrollTop();let n=0;const o=[],r=[],a=this._editor.getVisibleRanges();if(a.length!==0){const l=new vb(a[0].startLineNumber,a[a.length-1].endLineNumber),d=this._stickyLineCandidateProvider.getCandidateStickyLinesIntersecting(l);for(const c of d){const u=c.startLineNumber,h=c.endLineNumber,g=c.nestingDepth;if(h-u>0){const f=(g-1)*e,m=g*e,_=this._editor.getBottomForLineNumber(u)-i,v=this._editor.getTopForLineNumber(h)-i,b=this._editor.getBottomForLineNumber(h)-i;if(f>v&&f<=b){o.push(u),r.push(h+1),n=b-m;break}else m>_&&m<=b&&(o.push(u),r.push(h+1));if(o.length===t)break}}}return this._endLineNumbers=r,new q9(o,r,n,this._showEndForLine)}dispose(){super.dispose(),this._sessionStore.dispose()}};Ed.ID="store.contrib.stickyScrollController";Ed=QR=RMe([Vp(1,Oo),Vp(2,Ce),Vp(3,Ne),Vp(4,Yt),Vp(5,Ur),Vp(6,Be)],Ed);class PMe extends qs{constructor(){super({id:"editor.action.toggleStickyScroll",title:{...Ve("toggleEditorStickyScroll","Toggle Editor Sticky Scroll"),mnemonicTitle:p({},"&&Toggle Editor Sticky Scroll")},metadata:{description:Ve("toggleEditorStickyScroll.description","Toggle/enable the editor sticky scroll which shows the nested scopes at the top of the viewport")},category:kMe.View,toggled:{condition:G.equals("config.editor.stickyScroll.enabled",!0),title:p("stickyScroll","Sticky Scroll"),mnemonicTitle:p({},"&&Sticky Scroll")},menu:[{id:E.CommandPalette},{id:E.MenubarAppearanceMenu,group:"4_editor",order:3},{id:E.StickyScrollContext}]})}async run(e){const t=e.get(rt),i=!t.getValue("editor.stickyScroll.enabled");return t.updateValue("editor.stickyScroll.enabled",i)}}const Yk=100;class FMe extends fl{constructor(){super({id:"editor.action.focusStickyScroll",title:{...Ve("focusStickyScroll","Focus on the editor sticky scroll"),mnemonicTitle:p({},"&&Focus Sticky Scroll")},precondition:G.and(G.has("config.editor.stickyScroll.enabled"),T.stickyScrollVisible),menu:[{id:E.CommandPalette}]})}runEditorCommand(e,t){var i;(i=Ed.get(t))===null||i===void 0||i.focus()}}class OMe extends fl{constructor(){super({id:"editor.action.selectNextStickyScrollLine",title:Ve("selectNextStickyScrollLine.title","Select the next editor sticky scroll line"),precondition:T.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:Yk,primary:18}})}runEditorCommand(e,t){var i;(i=Ed.get(t))===null||i===void 0||i.focusNext()}}class BMe extends fl{constructor(){super({id:"editor.action.selectPreviousStickyScrollLine",title:Ve("selectPreviousStickyScrollLine.title","Select the previous sticky scroll line"),precondition:T.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:Yk,primary:16}})}runEditorCommand(e,t){var i;(i=Ed.get(t))===null||i===void 0||i.focusPrevious()}}class WMe extends fl{constructor(){super({id:"editor.action.goToFocusedStickyScrollLine",title:Ve("goToFocusedStickyScrollLine.title","Go to the focused sticky scroll line"),precondition:T.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:Yk,primary:3}})}runEditorCommand(e,t){var i;(i=Ed.get(t))===null||i===void 0||i.goToFocused()}}class HMe extends fl{constructor(){super({id:"editor.action.selectEditor",title:Ve("selectEditor.title","Select Editor"),precondition:T.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:Yk,primary:9}})}runEditorCommand(e,t){var i;(i=Ed.get(t))===null||i===void 0||i.selectEditor()}}kt(Ed.ID,Ed,1);qt(PMe);qt(FMe);qt(BMe);qt(OMe);qt(WMe);qt(HMe);var tZ=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Pv=function(s,e){return function(t,i){e(t,i,s)}};class VMe{constructor(e,t,i,n,o,r){this.range=e,this.insertText=t,this.filterText=i,this.additionalTextEdits=n,this.command=o,this.completion=r}}let JR=class extends Voe{constructor(e,t,i,n,o,r){super(o.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&&l.resolve(dt.None)}return t}};JR=tZ([Pv(5,Rk)],JR);let eP=class extends H{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){var o;if(i.selectedSuggestionInfo)return;let r;for(const f of this._editorService.listCodeEditors())if(f.getModel()===e){r=f;break}if(!r)return;const a=r.getOption(89);if(ym.isAllOff(a))return;e.tokenization.tokenizeIfCheap(t.lineNumber);const l=e.tokenization.getLineTokens(t.lineNumber),d=l.getStandardTokenType(l.findTokenIndexAtOffset(Math.max(t.column-1-1,0)));if(ym.valueFor(a,d)!=="inline")return;let c=e.getWordAtPosition(t),u;if(c!=null&&c.word||(u=this._getTriggerCharacterInfo(e,t)),!(c!=null&&c.word)&&!u||(c||(c=e.getWordUntilPosition(t)),c.endColumn!==t.column))return;let h;const g=e.getValueInRange(new x(t.lineNumber,1,t.lineNumber,t.column));if(!u&&(!((o=this._lastResult)===null||o===void 0)&&o.canBeReused(e,t.lineNumber,c))){const f=new F9(g,t.column-this._lastResult.word.endColumn);this._lastResult.completionModel.lineContext=f,this._lastResult.acquire(),h=this._lastResult}else{const f=await P4(this._languageFeatureService.completionProvider,e,t,new zC(void 0,DL.createSuggestFilter(r).itemKind,u==null?void 0:u.providers),u&&{triggerKind:1,triggerCharacter:u.ch},n);let m;f.needsClipboard&&(m=await this._clipboardService.readText());const _=new Pu(f.items,t.column,new F9(g,0),Ua.None,r.getOption(118),r.getOption(112),{boostFullMatch:!1,firstMatchCanBeWeak:!1},m);h=new JR(e,t.lineNumber,c,_,f,this._suggestMemoryService)}return this._lastResult=h,h}handleItemDidShow(e,t){t.completion.resolve(dt.None)}freeInlineCompletions(e){e.release()}_getTriggerCharacterInfo(e,t){var i;const n=e.getValueInRange(x.fromPositions({lineNumber:t.lineNumber,column:t.column-1},t)),o=new Set;for(const r of this._languageFeatureService.completionProvider.all(e))!((i=r.triggerCharacters)===null||i===void 0)&&i.includes(n)&&o.add(r);if(o.size!==0)return{providers:o,ch:n}}};eP=tZ([Pv(0,Ce),Pv(1,ru),Pv(2,Rk),Pv(3,xt)],eP);F1(eP);class zMe extends me{constructor(){super({id:"editor.action.forceRetokenize",label:p("forceRetokenize","Developer: Force Retokenize"),alias:"Developer: Force Retokenize",precondition:void 0})}run(e,t){if(!t.hasModel())return;const i=t.getModel();i.tokenization.resetTokenization();const n=new Jn;i.tokenization.forceTokenization(i.getLineCount()),n.stop(),console.log(`tokenization took ${n.elapsed()}`)}}te(zMe);class Qk extends qs{constructor(){super({id:Qk.ID,title:Ve({},"Toggle Tab Key Moves Focus"),precondition:void 0,keybinding:{primary:2091,mac:{primary:1323},weight:100},metadata:{description:Ve("tabMovesFocusDescriptions","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=!p_.getTabFocusMode();p_.setTabFocusMode(t),fo(t?p("toggle.tabMovesFocus.on","Pressing Tab will now move focus to the next focusable element"):p("toggle.tabMovesFocus.off","Pressing Tab will now insert the tab character"))}}Qk.ID="editor.action.toggleTabFocusMode";qt(Qk);var UMe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Q9=function(s,e){return function(t,i){e(t,i,s)}};let tP=class extends H{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,o){var r,a;super(),this._link=t,this._hoverService=n,this._enabled=!0,this.el=Q(e,he("a.monaco-link",{tabIndex:(r=t.tabIndex)!==null&&r!==void 0?r:0,href:t.href},t.label)),this.hoverDelegate=(a=i.hoverDelegate)!==null&&a!==void 0?a:Xs("mouse"),this.setTooltip(t.title),this.el.setAttribute("role","button");const l=this._register(new ht(this.el,"click")),d=this._register(new ht(this.el,"keypress")),c=le.chain(d.event,g=>g.map(f=>new Kt(f)).filter(f=>f.keyCode===3)),u=this._register(new ht(this.el,Xt.Tap)).event;this._register(Gt.addTarget(this.el));const h=le.any(l.event,c,u);this._register(h(g=>{this.enabled&&(nt.stop(g,!0),i!=null&&i.opener?i.opener(this._link.href):o.open(this._link.href,{allowCommands:!0}))})),this.enabled=!0}setTooltip(e){this.hoverDelegate.showNativeHover?this.el.title=e??"":!this.hover&&e?this.hover=this._register(this._hoverService.setupUpdatableHover(this.hoverDelegate,this.el,e)):this.hover&&this.hover.update(e)}};tP=UMe([Q9(3,Md),Q9(4,Bo)],tP);var iZ=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},nZ=function(s,e){return function(t,i){e(t,i,s)}};const $Me=26;let iP=class extends H{constructor(e,t){super(),this._editor=e,this.instantiationService=t,this.banner=this._register(this.instantiationService.createInstance(nP))}hide(){this._editor.setBanner(null,0),this.banner.clear()}show(e){this.banner.show({...e,onClose:()=>{var t;this.hide(),(t=e.onClose)===null||t===void 0||t.call(e)}}),this._editor.setBanner(this.banner.element,$Me)}};iP=iZ([nZ(1,Ne)],iP);let nP=class extends H{constructor(e){super(),this.instantiationService=e,this.markdownRenderer=this.instantiationService.createInstance(yd,{}),this.element=he("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=he("span");return t.innerText=e,t}return this.markdownRenderer.render(e).element}clear(){zn(this.element)}show(e){zn(this.element);const t=this.getAriaLabel(e);t&&this.element.setAttribute("aria-label",t);const i=Q(this.element,he("div.icon-container"));i.setAttribute("aria-hidden","true"),e.icon&&i.appendChild(he(`div${Pe.asCSSSelector(e.icon)}`));const n=Q(this.element,he("div.message-container"));if(n.setAttribute("aria-hidden","true"),n.appendChild(this.getBannerMessage(e.message)),this.messageActionsContainer=Q(this.element,he("div.message-actions-container")),e.actions)for(const r of e.actions)this._register(this.instantiationService.createInstance(tP,this.messageActionsContainer,{...r,tabIndex:-1},{}));const o=Q(this.element,he("div.action-container"));this.actionBar=this._register(new Vr(o)),this.actionBar.push(this._register(new Eo("banner.close","Close Banner",Pe.asClassName(cK),!0,()=>{typeof e.onClose=="function"&&e.onClose()})),{icon:!0,label:!1}),this.actionBar.setFocusable(!1)}};nP=iZ([nZ(0,Ne)],nP);var Z4=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Ym=function(s,e){return function(t,i){e(t,i,s)}};const jMe=xi("extensions-warning-message",oe.warning,p("warningIcon","Icon shown with a warning message in the extensions editor."));let Z_=class extends H{constructor(e,t,i,n){super(),this._editor=e,this._editorWorkerService=t,this._workspaceTrustService=i,this._highlighter=null,this._bannerClosed=!1,this._updateState=o=>{if(o&&o.hasMore){if(this._bannerClosed)return;const r=Math.max(o.ambiguousCharacterCount,o.nonBasicAsciiCharacterCount,o.invisibleCharacterCount);let a;if(o.nonBasicAsciiCharacterCount>=r)a={message:p("unicodeHighlighting.thisDocumentHasManyNonBasicAsciiUnicodeCharacters","This document contains many non-basic ASCII unicode characters"),command:new k0};else if(o.ambiguousCharacterCount>=r)a={message:p("unicodeHighlighting.thisDocumentHasManyAmbiguousUnicodeCharacters","This document contains many ambiguous unicode characters"),command:new dg};else if(o.invisibleCharacterCount>=r)a={message:p("unicodeHighlighting.thisDocumentHasManyInvisibleUnicodeCharacters","This document contains many invisible unicode characters"),command:new x0};else throw new Error("Unreachable");this._bannerController.show({id:"unicodeHighlightBanner",message:a.message,icon:jMe,actions:[{label:a.command.shortLabel,href:`command:${a.command.id}`}],onClose:()=>{this._bannerClosed=!0}})}else this._bannerController.hide()},this._bannerController=this._register(n.createInstance(iP,e)),this._register(this._editor.onDidChangeModel(()=>{this._bannerClosed=!1,this._updateHighlighter()})),this._options=e.getOption(125),this._register(i.onDidChangeTrust(o=>{this._updateHighlighter()})),this._register(e.onDidChangeConfiguration(o=>{o.hasChanged(125)&&(this._options=e.getOption(125),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=KMe(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"?new Intl.NumberFormat().resolvedOptions().locale:i==="_vscode"?Hse:i)};this._editorWorkerService.canComputeUnicodeHighlights(this._editor.getModel().uri)?this._highlighter=new sP(this._editor,t,this._updateState,this._editorWorkerService):this._highlighter=new qMe(this._editor,t,this._updateState)}getDecorationInfo(e){return this._highlighter?this._highlighter.getDecorationInfo(e):null}};Z_.ID="editor.contrib.unicodeHighlighter";Z_=Z4([Ym(1,jr),Ym(2,cj),Ym(3,Ne)],Z_);function KMe(s,e){return{nonBasicASCII:e.nonBasicASCII===zo?!s:e.nonBasicASCII,ambiguousCharacters:e.ambiguousCharacters,invisibleCharacters:e.invisibleCharacters,includeComments:e.includeComments===zo?!s:e.includeComments,includeStrings:e.includeStrings===zo?!s:e.includeStrings,allowedCharacters:e.allowedCharacters,allowedLocales:e.allowedLocales}}let sP=class extends H{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 Wt(()=>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:IL.instance.getDecorationFromOptions(this._options)});this._decorations.set(i)})}getDecorationInfo(e){if(!this._decorations.has(e))return null;const t=this._editor.getModel();if(!oO(t,e))return null;const i=t.getValueInRange(e.range);return{reason:oZ(i,this._options),inComment:rO(t,e),inString:aO(t,e)}}};sP=Z4([Ym(3,jr)],sP);class qMe extends H{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 Wt(()=>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 o=bF.computeUnicodeHighlights(this._model,this._options,n);for(const r of o.ranges)i.ranges.push(r);i.ambiguousCharacterCount+=i.ambiguousCharacterCount,i.invisibleCharacterCount+=i.invisibleCharacterCount,i.nonBasicAsciiCharacterCount+=i.nonBasicAsciiCharacterCount,i.hasMore=i.hasMore||o.hasMore}if(!i.hasMore)for(const n of i.ranges)t.push({range:n,options:IL.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 oO(t,e)?{reason:oZ(i,this._options),inComment:rO(t,e),inString:aO(t,e)}:null}}const sZ=p("unicodeHighlight.configureUnicodeHighlightOptions","Configure Unicode Highlight Options");let oP=class{constructor(e,t,i){this._editor=e,this._languageService=t,this._openerService=i,this.hoverOrdinal=5}computeSync(e,t){if(!this._editor.hasModel()||e.type!==1)return[];const i=this._editor.getModel(),n=this._editor.getContribution(Z_.ID);if(!n)return[];const o=[],r=new Set;let a=300;for(const l of t){const d=n.getDecorationInfo(l);if(!d)continue;const u=i.getValueInRange(l.range).codePointAt(0),h=xT(u);let g;switch(d.reason.kind){case 0:{c1(d.reason.confusableWith)?g=p("unicodeHighlight.characterIsAmbiguousASCII","The character {0} could be confused with the ASCII character {1}, which is more common in source code.",h,xT(d.reason.confusableWith.codePointAt(0))):g=p("unicodeHighlight.characterIsAmbiguous","The character {0} could be confused with the character {1}, which is more common in source code.",h,xT(d.reason.confusableWith.codePointAt(0)));break}case 1:g=p("unicodeHighlight.characterIsInvisible","The character {0} is invisible.",h);break;case 2:g=p("unicodeHighlight.characterIsNonBasicAscii","The character {0} is not a basic ASCII character.",h);break}if(r.has(g))continue;r.add(g);const f={codePoint:u,reason:d.reason,inComment:d.inComment,inString:d.inString},m=p("unicodeHighlight.adjustSettings","Adjust settings"),_=`command:${G1.ID}?${encodeURIComponent(JSON.stringify(f))}`,v=new ss("",!0).appendMarkdown(g).appendText(" ").appendLink(_,m,sZ);o.push(new Ka(this,l.range,[v],!1,a++))}return o}renderHoverParts(e,t){return Jke(e,t,this._editor,this._languageService,this._openerService)}};oP=Z4([Ym(1,vi),Ym(2,Bo)],oP);function rP(s){return`U+${s.toString(16).padStart(4,"0")}`}function xT(s){let e=`\`${rP(s)}\``;return ld.isInvisibleCharacter(s)||(e+=` "${`${GMe(s)}`}"`),e}function GMe(s){return s===96?"`` ` ``":"`"+String.fromCodePoint(s)+"`"}function oZ(s,e){return bF.computeUnicodeHighlightReason(s,e)}class IL{constructor(){this.map=new Map}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=Ye.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}}IL.instance=new IL;class ZMe extends me{constructor(){super({id:dg.ID,label:p("action.unicodeHighlight.disableHighlightingInComments","Disable highlighting of characters in comments"),alias:"Disable highlighting of characters in comments",precondition:void 0}),this.shortLabel=p("unicodeHighlight.disableHighlightingInComments.shortLabel","Disable Highlight In Comments")}async run(e,t,i){const n=e==null?void 0:e.get(rt);n&&this.runAction(n)}async runAction(e){await e.updateValue(no.includeComments,!1,2)}}class XMe extends me{constructor(){super({id:dg.ID,label:p("action.unicodeHighlight.disableHighlightingInStrings","Disable highlighting of characters in strings"),alias:"Disable highlighting of characters in strings",precondition:void 0}),this.shortLabel=p("unicodeHighlight.disableHighlightingInStrings.shortLabel","Disable Highlight In Strings")}async run(e,t,i){const n=e==null?void 0:e.get(rt);n&&this.runAction(n)}async runAction(e){await e.updateValue(no.includeStrings,!1,2)}}class dg extends me{constructor(){super({id:dg.ID,label:p("action.unicodeHighlight.disableHighlightingOfAmbiguousCharacters","Disable highlighting of ambiguous characters"),alias:"Disable highlighting of ambiguous characters",precondition:void 0}),this.shortLabel=p("unicodeHighlight.disableHighlightingOfAmbiguousCharacters.shortLabel","Disable Ambiguous Highlight")}async run(e,t,i){const n=e==null?void 0:e.get(rt);n&&this.runAction(n)}async runAction(e){await e.updateValue(no.ambiguousCharacters,!1,2)}}dg.ID="editor.action.unicodeHighlight.disableHighlightingOfAmbiguousCharacters";class x0 extends me{constructor(){super({id:x0.ID,label:p("action.unicodeHighlight.disableHighlightingOfInvisibleCharacters","Disable highlighting of invisible characters"),alias:"Disable highlighting of invisible characters",precondition:void 0}),this.shortLabel=p("unicodeHighlight.disableHighlightingOfInvisibleCharacters.shortLabel","Disable Invisible Highlight")}async run(e,t,i){const n=e==null?void 0:e.get(rt);n&&this.runAction(n)}async runAction(e){await e.updateValue(no.invisibleCharacters,!1,2)}}x0.ID="editor.action.unicodeHighlight.disableHighlightingOfInvisibleCharacters";class k0 extends me{constructor(){super({id:k0.ID,label:p("action.unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters","Disable highlighting of non basic ASCII characters"),alias:"Disable highlighting of non basic ASCII characters",precondition:void 0}),this.shortLabel=p("unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters.shortLabel","Disable Non ASCII Highlight")}async run(e,t,i){const n=e==null?void 0:e.get(rt);n&&this.runAction(n)}async runAction(e){await e.updateValue(no.nonBasicASCII,!1,2)}}k0.ID="editor.action.unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters";class G1 extends me{constructor(){super({id:G1.ID,label:p("action.unicodeHighlight.showExcludeOptions","Show Exclude Options"),alias:"Show Exclude Options",precondition:void 0})}async run(e,t,i){const{codePoint:n,reason:o,inString:r,inComment:a}=i,l=String.fromCodePoint(n),d=e.get(hp),c=e.get(rt);function u(f){return ld.isInvisibleCharacter(f)?p("unicodeHighlight.excludeInvisibleCharFromBeingHighlighted","Exclude {0} (invisible character) from being highlighted",rP(f)):p("unicodeHighlight.excludeCharFromBeingHighlighted","Exclude {0} from being highlighted",`${rP(f)} "${l}"`)}const h=[];if(o.kind===0)for(const f of o.notAmbiguousInLocales)h.push({label:p("unicodeHighlight.allowCommonCharactersInLanguage",'Allow unicode characters that are more common in the language "{0}".',f),run:async()=>{QMe(c,[f])}});if(h.push({label:u(n),run:()=>YMe(c,[n])}),a){const f=new ZMe;h.push({label:f.label,run:async()=>f.runAction(c)})}else if(r){const f=new XMe;h.push({label:f.label,run:async()=>f.runAction(c)})}if(o.kind===0){const f=new dg;h.push({label:f.label,run:async()=>f.runAction(c)})}else if(o.kind===1){const f=new x0;h.push({label:f.label,run:async()=>f.runAction(c)})}else if(o.kind===2){const f=new k0;h.push({label:f.label,run:async()=>f.runAction(c)})}else JMe(o);const g=await d.pick(h,{title:sZ});g&&await g.run()}}G1.ID="editor.action.unicodeHighlight.showExcludeOptions";async function YMe(s,e){const t=s.getValue(no.allowedCharacters);let i;typeof t=="object"&&t?i=t:i={};for(const n of e)i[String.fromCodePoint(n)]=!0;await s.updateValue(no.allowedCharacters,i,2)}async function QMe(s,e){var t;const i=(t=s.inspect(no.allowedLocales).user)===null||t===void 0?void 0:t.value;let n;typeof i=="object"&&i?n=Object.assign({},i):n={};for(const o of e)n[o]=!0;await s.updateValue(no.allowedLocales,n,2)}function JMe(s){throw new Error(`Unexpected value: ${s}`)}te(dg);te(x0);te(k0);te(G1);kt(Z_.ID,Z_,1);ag.register(oP);var eRe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},J9=function(s,e){return function(t,i){e(t,i,s)}};const rZ="ignoreUnusualLineTerminators";function tRe(s,e,t){s.setModelProperty(e.uri,rZ,t)}function iRe(s,e){return s.getModelProperty(e.uri,rZ)}let t1=class extends H{constructor(e,t,i){super(),this._editor=e,this._dialogService=t,this._codeEditorService=i,this._isPresentingDialog=!1,this._config=this._editor.getOption(126),this._register(this._editor.onDidChangeConfiguration(n=>{n.hasChanged(126)&&(this._config=this._editor.getOption(126),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()||iRe(this._codeEditorService,e)===!0||this._editor.getOption(91))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:p("unusualLineTerminators.title","Unusual Line Terminators"),message:p("unusualLineTerminators.message","Detected unusual line terminators"),detail:p("unusualLineTerminators.detail","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`.",Wr(e.uri)),primaryButton:p({key:"unusualLineTerminators.fix",comment:["&& denotes a mnemonic"]},"&&Remove Unusual Line Terminators"),cancelButton:p("unusualLineTerminators.ignore","Ignore")})}finally{this._isPresentingDialog=!1}if(!i.confirmed){tRe(this._codeEditorService,e,!0);return}e.removeUnusualLineTerminators(this._editor.getSelections())}};t1.ID="editor.contrib.unusualLineTerminatorsDetector";t1=eRe([J9(1,dO),J9(2,xt)],t1);kt(t1.ID,t1,1);var aZ=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},vS=function(s,e){return function(t,i){e(t,i,s)}},un,aP;const Jk=new ue("hasWordHighlights",!1);function lZ(s,e,t,i){const n=s.ordered(e);return sF(n.map(o=>()=>Promise.resolve(o.provideDocumentHighlights(e,t,i)).then(void 0,Ai)),rs).then(o=>{if(o){const r=new Wi;return r.set(e.uri,o),r}return new Wi})}function nRe(s,e,t,i,n,o){const r=s.ordered(e);return sF(r.map(a=>()=>{const l=o.filter(d=>aU(d)).filter(d=>hO(a.selector,d.uri,d.getLanguageId(),!0,void 0,void 0)>0);return Promise.resolve(a.provideMultiDocumentHighlights(e,t,l,n)).then(void 0,Ai)}),a=>a instanceof Wi&&a.size>0)}class X4{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=Dn(e=>this._compute(this._model,this._selection,this._wordSeparators,e))),this._result}_getCurrentWordRange(e,t){const i=e.getWordAtPosition(t.getPosition());return i?new x(t.startLineNumber,i.startColumn,t.startLineNumber,i.endColumn):null}isValid(e,t,i){const n=t.startLineNumber,o=t.startColumn,r=t.endColumn,a=this._getCurrentWordRange(e,t);let l=!!(this._wordRange&&this._wordRange.equalsRange(a));for(let d=0,c=i.length;!l&&d=r&&(l=!0)}return l}cancel(){this.result.cancel()}}class sRe extends X4{constructor(e,t,i,n){super(e,t,i),this._providers=n}_compute(e,t,i,n){return lZ(this._providers,e,t.getPosition(),n).then(o=>o||new Wi)}}class oRe extends X4{constructor(e,t,i,n,o){super(e,t,i),this._providers=n,this._otherModels=o}_compute(e,t,i,n){return nRe(this._providers,e,t.getPosition(),i,n,this._otherModels).then(o=>o||new Wi)}}class dZ extends X4{constructor(e,t,i,n,o){super(e,t,n),this._otherModels=o,this._selectionIsEmpty=t.isEmpty(),this._word=i}_compute(e,t,i,n){return xh(250,n).then(()=>{const o=new Wi;let r;if(this._word?r=this._word:r=e.getWordAtPosition(t.getPosition()),!r)return new Wi;const a=[e,...this._otherModels];for(const l of a){if(l.isDisposed())continue;const c=l.findMatches(r.word,!0,!1,!0,i,!1).map(u=>({range:u.range,kind:Ab.Text}));c&&o.set(l.uri,c)}return o})}isValid(e,t,i){const n=t.isEmpty();return this._selectionIsEmpty!==n?!1:super.isValid(e,t,i)}}function rRe(s,e,t,i,n){return s.has(e)?new sRe(e,t,n,s):new dZ(e,t,i,n,[])}function aRe(s,e,t,i,n,o){return s.has(e)?new oRe(e,t,n,s,o):new dZ(e,t,i,n,o)}Ad("_executeDocumentHighlights",async(s,e,t)=>{const i=s.get(Ce),n=await lZ(i.documentHighlightProvider,e,t,dt.None);return n==null?void 0:n.get(e.uri)});let i1=un=class{constructor(e,t,i,n,o){this.toUnhook=new Y,this.workerRequestTokenId=0,this.workerRequestCompleted=!1,this.workerRequestValue=new Wi,this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=-1,this.editor=e,this.providers=t,this.multiDocumentProviders=i,this.codeEditorService=o,this._hasWordHighlights=Jk.bindTo(n),this._ignorePositionChangeEvent=!1,this.occurrencesHighlight=this.editor.getOption(81),this.model=this.editor.getModel(),this.toUnhook.add(e.onDidChangeCursorPosition(r=>{this._ignorePositionChangeEvent||this.occurrencesHighlight!=="off"&&this._onPositionChanged(r)})),this.toUnhook.add(e.onDidFocusEditorText(r=>{this.occurrencesHighlight!=="off"&&(this.workerRequest||this._run())})),this.toUnhook.add(e.onDidChangeModelContent(r=>{this._stopAll()})),this.toUnhook.add(e.onDidChangeModel(r=>{!r.newModelUrl&&r.oldModelUrl?this._stopSingular():un.query&&this._run()})),this.toUnhook.add(e.onDidChangeConfiguration(r=>{const a=this.editor.getOption(81);this.occurrencesHighlight!==a&&(this.occurrencesHighlight=a,this._stopAll())})),this.decorations=this.editor.createDecorationsCollection(),this.workerRequestTokenId=0,this.workerRequest=null,this.workerRequestCompleted=!1,this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=-1,un.query&&this._run()}hasDecorations(){return this.decorations.length>0}restore(){this.occurrencesHighlight!=="off"&&this._run()}_getSortedHighlights(){return this.decorations.getRanges().sort(x.compareRangesUsingStarts)}moveNext(){const e=this._getSortedHighlights(),i=(e.findIndex(o=>o.containsPosition(this.editor.getPosition()))+1)%e.length,n=e[i];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(n.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(n);const o=this._getWord();if(o){const r=this.editor.getModel().getLineContent(n.startLineNumber);fo(`${r}, ${i+1} of ${e.length} for '${o.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}moveBack(){const e=this._getSortedHighlights(),i=(e.findIndex(o=>o.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 o=this._getWord();if(o){const r=this.editor.getModel().getLineContent(n.startLineNumber);fo(`${r}, ${i+1} of ${e.length} for '${o.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}_removeSingleDecorations(){if(!this.editor.hasModel())return;const e=un.storedDecorations.get(this.editor.getModel().uri);e&&(this.editor.removeDecorations(e),un.storedDecorations.delete(this.editor.getModel().uri),this.decorations.length>0&&(this.decorations.clear(),this._hasWordHighlights.set(!1)))}_removeAllDecorations(){const e=this.codeEditorService.listCodeEditors(),t=[];for(const i of e){if(!i.hasModel())continue;const n=un.storedDecorations.get(i.getModel().uri);if(!n)continue;i.removeDecorations(n),t.push(i.getModel().uri);const o=Zc.get(i);o!=null&&o.wordHighlighter&&o.wordHighlighter.decorations.length>0&&(o.wordHighlighter.decorations.clear(),o.wordHighlighter.workerRequest=null,o.wordHighlighter._hasWordHighlights.set(!1))}for(const i of t)un.storedDecorations.delete(i)}_stopSingular(){var e,t,i,n;this._removeSingleDecorations(),this.editor.hasTextFocus()&&(((e=this.editor.getModel())===null||e===void 0?void 0:e.uri.scheme)!==Ge.vscodeNotebookCell&&((i=(t=un.query)===null||t===void 0?void 0:t.modelInfo)===null||i===void 0?void 0:i.model.uri.scheme)!==Ge.vscodeNotebookCell?(un.query=null,this._run()):!((n=un.query)===null||n===void 0)&&n.modelInfo&&(un.query.modelInfo=null)),this.renderDecorationsTimer!==-1&&(clearTimeout(this.renderDecorationsTimer),this.renderDecorationsTimer=-1),this.workerRequest!==null&&(this.workerRequest.cancel(),this.workerRequest=null),this.workerRequestCompleted||(this.workerRequestTokenId++,this.workerRequestCompleted=!0)}_stopAll(){this._removeAllDecorations(),this.renderDecorationsTimer!==-1&&(clearTimeout(this.renderDecorationsTimer),this.renderDecorationsTimer=-1),this.workerRequest!==null&&(this.workerRequest.cancel(),this.workerRequest=null),this.workerRequestCompleted||(this.workerRequestTokenId++,this.workerRequestCompleted=!0)}_onPositionChanged(e){var t;if(this.occurrencesHighlight==="off"){this._stopAll();return}if(e.reason!==3&&((t=this.editor.getModel())===null||t===void 0?void 0:t.uri.scheme)!==Ge.vscodeNotebookCell){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===Ge.vscodeNotebookCell){const o=[],r=this.codeEditorService.listCodeEditors();for(const a of r){const l=a.getModel();l&&l!==e&&l.uri.scheme===Ge.vscodeNotebookCell&&o.push(l)}return o}const i=[],n=this.codeEditorService.listCodeEditors();for(const o of n){if(!CLe(o))continue;const r=o.getModel();r&&e===r.modified&&i.push(r.modified)}if(i.length)return i;if(this.occurrencesHighlight==="singleFile")return[];for(const o of n){const r=o.getModel();r&&r!==e&&i.push(r)}return i}_run(){var e;let t;if(this.editor.hasTextFocus()){const n=this.editor.getSelection();if(!n||n.startLineNumber!==n.endLineNumber){un.query=null,this._stopAll();return}const o=n.startColumn,r=n.endColumn,a=this._getWord();if(!a||a.startColumn>o||a.endColumn{n===this.workerRequestTokenId&&(this.workerRequestCompleted=!0,this.workerRequestValue=r||[],this._beginRenderDecorations())},Xe)}}computeWithModel(e,t,i,n){return n.length?aRe(this.multiDocumentProviders,e,t,i,this.editor.getOption(131),n):rRe(this.providers,e,t,i,this.editor.getOption(131))}_beginRenderDecorations(){const e=new Date().getTime(),t=this.lastCursorPositionChangeTime+250;e>=t?(this.renderDecorationsTimer=-1,this.renderDecorations()):this.renderDecorationsTimer=setTimeout(()=>{this.renderDecorations()},t-e)}renderDecorations(){var e,t,i;this.renderDecorationsTimer=-1;const n=this.codeEditorService.listCodeEditors();for(const o of n){const r=Zc.get(o);if(!r)continue;const a=[],l=(e=o.getModel())===null||e===void 0?void 0:e.uri;if(l&&this.workerRequestValue.has(l)){const d=un.storedDecorations.get(l),c=this.workerRequestValue.get(l);if(c)for(const h of c)h.range&&a.push({range:h.range,options:v2e(h.kind)});let u=[];o.changeDecorations(h=>{u=h.deltaDecorations(d??[],a)}),un.storedDecorations=un.storedDecorations.set(l,u),a.length>0&&((t=r.wordHighlighter)===null||t===void 0||t.decorations.set(a),(i=r.wordHighlighter)===null||i===void 0||i._hasWordHighlights.set(!0))}}}dispose(){this._stopSingular(),this.toUnhook.dispose()}};i1.storedDecorations=new Wi;i1.query=null;i1=un=aZ([vS(4,xt)],i1);let Zc=aP=class extends H{static get(e){return e.getContribution(aP.ID)}constructor(e,t,i,n){super(),this._wordHighlighter=null;const o=()=>{e.hasModel()&&!e.getModel().isTooLargeForTokenization()&&(this._wordHighlighter=new i1(e,i.documentHighlightProvider,i.multiDocumentHighlightProvider,t,n))};this._register(e.onDidChangeModel(r=>{this._wordHighlighter&&(this._wordHighlighter.dispose(),this._wordHighlighter=null),o()})),o()}get wordHighlighter(){return this._wordHighlighter}saveViewState(){return!!(this._wordHighlighter&&this._wordHighlighter.hasDecorations())}moveNext(){var e;(e=this._wordHighlighter)===null||e===void 0||e.moveNext()}moveBack(){var e;(e=this._wordHighlighter)===null||e===void 0||e.moveBack()}restoreViewState(e){this._wordHighlighter&&e&&this._wordHighlighter.restore()}dispose(){this._wordHighlighter&&(this._wordHighlighter.dispose(),this._wordHighlighter=null),super.dispose()}};Zc.ID="editor.contrib.wordHighlighter";Zc=aP=aZ([vS(1,Be),vS(2,Ce),vS(3,xt)],Zc);class cZ extends me{constructor(e,t){super(t),this._isNext=e}run(e,t){const i=Zc.get(t);i&&(this._isNext?i.moveNext():i.moveBack())}}class lRe extends cZ{constructor(){super(!0,{id:"editor.action.wordHighlight.next",label:p("wordHighlight.next.label","Go to Next Symbol Highlight"),alias:"Go to Next Symbol Highlight",precondition:Jk,kbOpts:{kbExpr:T.editorTextFocus,primary:65,weight:100}})}}class dRe extends cZ{constructor(){super(!1,{id:"editor.action.wordHighlight.prev",label:p("wordHighlight.previous.label","Go to Previous Symbol Highlight"),alias:"Go to Previous Symbol Highlight",precondition:Jk,kbOpts:{kbExpr:T.editorTextFocus,primary:1089,weight:100}})}}class cRe extends me{constructor(){super({id:"editor.action.wordHighlight.trigger",label:p("wordHighlight.trigger.label","Trigger Symbol Highlight"),alias:"Trigger Symbol Highlight",precondition:Jk.toNegated(),kbOpts:{kbExpr:T.editorTextFocus,primary:0,weight:100}})}run(e,t,i){const n=Zc.get(t);n&&n.restoreViewState(!0)}}kt(Zc.ID,Zc,0);te(lRe);te(dRe);te(cRe);class eE extends mn{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,i){if(!t.hasModel())return;const n=Or(t.getOption(131),t.getOption(130)),o=t.getModel(),a=t.getSelections().map(l=>{const d=new W(l.positionLineNumber,l.positionColumn),c=this._move(n,o,d,this._wordNavigationType);return this._moveTo(l,c,this._inSelectionMode)});if(o.pushStackElement(),t._getViewModel().setCursorStates("moveWordCommand",3,a.map(l=>wt.fromModelSelection(l))),a.length===1){const l=new W(a[0].positionLineNumber,a[0].positionColumn);t.revealPosition(l,0)}}_moveTo(e,t,i){return i?new we(e.selectionStartLineNumber,e.selectionStartColumn,t.lineNumber,t.column):new we(t.lineNumber,t.column,t.lineNumber,t.column)}}class cg extends eE{_move(e,t,i,n){return Et.moveWordLeft(e,t,i,n)}}class ug extends eE{_move(e,t,i,n){return Et.moveWordRight(e,t,i,n)}}class uRe extends cg{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordStartLeft",precondition:void 0})}}class hRe extends cg{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordEndLeft",precondition:void 0})}}class gRe extends cg{constructor(){var e;super({inSelectionMode:!1,wordNavigationType:1,id:"cursorWordLeft",precondition:void 0,kbOpts:{kbExpr:G.and(T.textInputFocus,(e=G.and(_1,tk))===null||e===void 0?void 0:e.negate()),primary:2063,mac:{primary:527},weight:100}})}}class fRe extends cg{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordStartLeftSelect",precondition:void 0})}}class pRe extends cg{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordEndLeftSelect",precondition:void 0})}}class mRe extends cg{constructor(){var e;super({inSelectionMode:!0,wordNavigationType:1,id:"cursorWordLeftSelect",precondition:void 0,kbOpts:{kbExpr:G.and(T.textInputFocus,(e=G.and(_1,tk))===null||e===void 0?void 0:e.negate()),primary:3087,mac:{primary:1551},weight:100}})}}class _Re extends cg{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:"cursorWordAccessibilityLeft",precondition:void 0})}_move(e,t,i,n){return super._move(Or(hl.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,n)}}class vRe extends cg{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:"cursorWordAccessibilityLeftSelect",precondition:void 0})}_move(e,t,i,n){return super._move(Or(hl.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,n)}}class bRe extends ug{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordStartRight",precondition:void 0})}}class CRe extends ug{constructor(){var e;super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordEndRight",precondition:void 0,kbOpts:{kbExpr:G.and(T.textInputFocus,(e=G.and(_1,tk))===null||e===void 0?void 0:e.negate()),primary:2065,mac:{primary:529},weight:100}})}}class wRe extends ug{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordRight",precondition:void 0})}}class yRe extends ug{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordStartRightSelect",precondition:void 0})}}class SRe extends ug{constructor(){var e;super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordEndRightSelect",precondition:void 0,kbOpts:{kbExpr:G.and(T.textInputFocus,(e=G.and(_1,tk))===null||e===void 0?void 0:e.negate()),primary:3089,mac:{primary:1553},weight:100}})}}class DRe extends ug{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordRightSelect",precondition:void 0})}}class LRe extends ug{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:"cursorWordAccessibilityRight",precondition:void 0})}_move(e,t,i,n){return super._move(Or(hl.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,n)}}class xRe extends ug{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:"cursorWordAccessibilityRightSelect",precondition:void 0})}_move(e,t,i,n){return super._move(Or(hl.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,n)}}class tE extends mn{constructor(e){super(e),this._whitespaceHeuristics=e.whitespaceHeuristics,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,i){const n=e.get(Yt);if(!t.hasModel())return;const o=Or(t.getOption(131),t.getOption(130)),r=t.getModel(),a=t.getSelections(),l=t.getOption(6),d=t.getOption(11),c=n.getLanguageConfiguration(r.getLanguageId()).getAutoClosingPairs(),u=t._getViewModel(),h=a.map(g=>{const f=this._delete({wordSeparators:o,model:r,selection:g,whitespaceHeuristics:this._whitespaceHeuristics,autoClosingDelete:t.getOption(9),autoClosingBrackets:l,autoClosingQuotes:d,autoClosingPairs:c,autoClosedCharacters:u.getCursorAutoClosedCharacters()},this._wordNavigationType);return new qn(f,"")});t.pushUndoStop(),t.executeCommands(this.id,h),t.pushUndoStop()}}class Y4 extends tE{_delete(e,t){const i=Et.deleteWordLeft(e,t);return i||new x(1,1,1,1)}}class Q4 extends tE{_delete(e,t){const i=Et.deleteWordRight(e,t);if(i)return i;const n=e.model.getLineCount(),o=e.model.getLineMaxColumn(n);return new x(n,o,n,o)}}class kRe extends Y4{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:"deleteWordStartLeft",precondition:T.writable})}}class ERe extends Y4{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:"deleteWordEndLeft",precondition:T.writable})}}class IRe extends Y4{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:"deleteWordLeft",precondition:T.writable,kbOpts:{kbExpr:T.textInputFocus,primary:2049,mac:{primary:513},weight:100}})}}class TRe extends Q4{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:"deleteWordStartRight",precondition:T.writable})}}class NRe extends Q4{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:"deleteWordEndRight",precondition:T.writable})}}class ARe extends Q4{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:"deleteWordRight",precondition:T.writable,kbOpts:{kbExpr:T.textInputFocus,primary:2068,mac:{primary:532},weight:100}})}}class MRe extends me{constructor(){super({id:"deleteInsideWord",precondition:T.writable,label:p("deleteInsideWord","Delete Word"),alias:"Delete Word"})}run(e,t,i){if(!t.hasModel())return;const n=Or(t.getOption(131),t.getOption(130)),o=t.getModel(),a=t.getSelections().map(l=>{const d=Et.deleteInsideWord(n,o,l);return new qn(d,"")});t.pushUndoStop(),t.executeCommands(this.id,a),t.pushUndoStop()}}de(new uRe);de(new hRe);de(new gRe);de(new fRe);de(new pRe);de(new mRe);de(new bRe);de(new CRe);de(new wRe);de(new yRe);de(new SRe);de(new DRe);de(new _Re);de(new vRe);de(new LRe);de(new xRe);de(new kRe);de(new ERe);de(new IRe);de(new TRe);de(new NRe);de(new ARe);te(MRe);class RRe extends tE{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:"deleteWordPartLeft",precondition:T.writable,kbOpts:{kbExpr:T.textInputFocus,primary:0,mac:{primary:769},weight:100}})}_delete(e,t){const i=kx.deleteWordPartLeft(e);return i||new x(1,1,1,1)}}class PRe extends tE{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:"deleteWordPartRight",precondition:T.writable,kbOpts:{kbExpr:T.textInputFocus,primary:0,mac:{primary:788},weight:100}})}_delete(e,t){const i=kx.deleteWordPartRight(e);if(i)return i;const n=e.model.getLineCount(),o=e.model.getLineMaxColumn(n);return new x(n,o,n,o)}}class uZ extends eE{_move(e,t,i,n){return kx.moveWordPartLeft(e,t,i)}}class FRe extends uZ{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordPartLeft",precondition:void 0,kbOpts:{kbExpr:T.textInputFocus,primary:0,mac:{primary:783},weight:100}})}}pt.registerCommandAlias("cursorWordPartStartLeft","cursorWordPartLeft");class ORe extends uZ{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordPartLeftSelect",precondition:void 0,kbOpts:{kbExpr:T.textInputFocus,primary:0,mac:{primary:1807},weight:100}})}}pt.registerCommandAlias("cursorWordPartStartLeftSelect","cursorWordPartLeftSelect");class hZ extends eE{_move(e,t,i,n){return kx.moveWordPartRight(e,t,i)}}class BRe extends hZ{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordPartRight",precondition:void 0,kbOpts:{kbExpr:T.textInputFocus,primary:0,mac:{primary:785},weight:100}})}}class WRe extends hZ{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordPartRightSelect",precondition:void 0,kbOpts:{kbExpr:T.textInputFocus,primary:0,mac:{primary:1809},weight:100}})}}de(new RRe);de(new PRe);de(new FRe);de(new ORe);de(new BRe);de(new WRe);class lP extends H{constructor(e){super(),this.editor=e,this._register(this.editor.onDidAttemptReadOnlyEdit(()=>this._onDidAttemptReadOnlyEdit()))}_onDidAttemptReadOnlyEdit(){const e=Vs.get(this.editor);if(e&&this.editor.hasModel()){let t=this.editor.getOptions().get(92);t||(this.editor.isSimpleWidget?t=new ss(p("editor.simple.readonly","Cannot edit in read-only input")):t=new ss(p("editor.readonly","Cannot edit in read-only editor"))),e.showMessage(t,this.editor.getPosition())}}}lP.ID="editor.contrib.readOnlyMessageController";kt(lP.ID,lP,2);var HRe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},eW=function(s,e){return function(t,i){e(t,i,s)}};let dP=class extends H{constructor(e,t,i){super(),this._textModel=e,this._languageFeaturesService=t,this._outlineModelService=i,this._currentModel=vt(this,void 0);const n=os("documentSymbolProvider.onDidChange",this._languageFeaturesService.documentSymbolProvider.onDidChange),o=os("_textModel.onDidChangeContent",le.debounce(r=>this._textModel.onDidChangeContent(r),()=>{},100));this._register(Hr(async(r,a)=>{n.read(r),o.read(r);const l=a.add(new Xye),d=await this._outlineModelService.getOrCreate(this._textModel,l.token);a.isDisposed||this._currentModel.set(d,void 0)}))}getBreadcrumbItems(e,t){const i=this._currentModel.read(t);if(!i)return[];const n=i.asListOfDocumentSymbols().filter(o=>e.contains(o.range.startLineNumber)&&!e.contains(o.range.endLineNumber));return n.sort(kV(ao(o=>o.range.endLineNumber-o.range.startLineNumber,ua))),n.map(o=>({name:o.name,kind:o.kind,startLineNumber:o.range.startLineNumber}))}};dP=HRe([eW(1,Ce),eW(2,R4)],dP);xC.setBreadcrumbsSourceFactory((s,e)=>e.createInstance(dP,s));/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.49.0(383fdf3fc0e1e1a024068b8d0fd4f3dcbae74d04) * Released under the MIT license * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt *-----------------------------------------------------------------------------*/var VRe=Object.defineProperty,zRe=Object.getOwnPropertyDescriptor,URe=Object.getOwnPropertyNames,$Re=Object.prototype.hasOwnProperty,jRe=(s,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of URe(e))!$Re.call(s,n)&&n!==t&&VRe(s,n,{get:()=>e[n],enumerable:!(i=zRe(e,n))||i.enumerable});return s},KRe=(s,e,t)=>(jRe(s,e,"default"),t),E0={};KRe(E0,_0);var J4=class{constructor(e,t,i){this._onDidChange=new E0.Emitter,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)}},e5={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}},t5={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},gZ=new J4("css",e5,t5),fZ=new J4("scss",e5,t5),pZ=new J4("less",e5,t5);E0.languages.css={cssDefaults:gZ,lessDefaults:pZ,scssDefaults:fZ};function i5(){return er(()=>import("./cssMode-CMP9zKWk.js"),__vite__mapDeps([8,1,2,3]))}E0.languages.onLanguage("less",()=>{i5().then(s=>s.setupMode(pZ))});E0.languages.onLanguage("scss",()=>{i5().then(s=>s.setupMode(fZ))});E0.languages.onLanguage("css",()=>{i5().then(s=>s.setupMode(gZ))});/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.49.0(383fdf3fc0e1e1a024068b8d0fd4f3dcbae74d04) * Released under the MIT license * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt *-----------------------------------------------------------------------------*/var qRe=Object.defineProperty,GRe=Object.getOwnPropertyDescriptor,ZRe=Object.getOwnPropertyNames,XRe=Object.prototype.hasOwnProperty,YRe=(s,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of ZRe(e))!XRe.call(s,n)&&n!==t&&qRe(s,n,{get:()=>e[n],enumerable:!(i=GRe(e,n))||i.enumerable});return s},QRe=(s,e,t)=>(YRe(s,e,"default"),t),iE={};QRe(iE,_0);var JRe=class{constructor(e,t,i){this._onDidChange=new iE.Emitter,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)}},ePe={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"},nE={format:ePe,suggest:{},data:{useDefaultDataProvider:!0}};function sE(s){return{completionItems:!0,hovers:!0,documentSymbols:!0,links:!0,documentHighlights:!0,rename:!0,colors:!0,foldingRanges:!0,selectionRanges:!0,diagnostics:s===Cb,documentFormattingEdits:s===Cb,documentRangeFormattingEdits:s===Cb}}var Cb="html",tW="handlebars",iW="razor",mZ=oE(Cb,nE,sE(Cb)),tPe=mZ.defaults,_Z=oE(tW,nE,sE(tW)),iPe=_Z.defaults,vZ=oE(iW,nE,sE(iW)),nPe=vZ.defaults;iE.languages.html={htmlDefaults:tPe,razorDefaults:nPe,handlebarDefaults:iPe,htmlLanguageService:mZ,handlebarLanguageService:_Z,razorLanguageService:vZ,registerHTMLLanguageService:oE};function sPe(){return er(()=>import("./htmlMode-BZEeRbEQ.js"),__vite__mapDeps([9,1,2,3]))}function oE(s,e=nE,t=sE(s)){const i=new JRe(s,e,t);let n;const o=iE.languages.onLanguage(s,async()=>{n=(await sPe()).setupMode(i)});return{defaults:i,dispose(){o.dispose(),n==null||n.dispose(),n=void 0}}}var oPe=class{constructor(e,t,i){this._onDidChange=new OK,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)}},rPe={validate:!0,allowComments:!0,schemas:[],enableSchemaRequest:!1,schemaRequest:"warning",schemaValidation:"warning",comments:"error",trailingCommas:"error"},aPe={documentFormattingEdits:!0,documentRangeFormattingEdits:!0,completionItems:!0,hovers:!0,documentSymbols:!0,tokens:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0},bZ=new oPe("json",rPe,aPe),lPe=()=>CZ().then(s=>s.getWorker());O1.json={jsonDefaults:bZ,getWorker:lPe};function CZ(){return er(()=>import("./jsonMode-CWFvP3uU.js"),__vite__mapDeps([10,1,2,3]))}O1.register({id:"json",extensions:[".json",".bowerrc",".jshintrc",".jscsrc",".eslintrc",".babelrc",".har"],aliases:["JSON","json"],mimetypes:["application/json"]});O1.onLanguage("json",()=>{CZ().then(s=>s.setupMode(bZ))});/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.49.0(383fdf3fc0e1e1a024068b8d0fd4f3dcbae74d04) * Released under the MIT license * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt *-----------------------------------------------------------------------------*/var dPe=Object.defineProperty,cPe=Object.getOwnPropertyDescriptor,uPe=Object.getOwnPropertyNames,hPe=Object.prototype.hasOwnProperty,gPe=(s,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of uPe(e))!hPe.call(s,n)&&n!==t&&dPe(s,n,{get:()=>e[n],enumerable:!(i=cPe(e,n))||i.enumerable});return s},fPe=(s,e,t)=>(gPe(s,e,"default"),t),pPe="5.0.2",X_={};fPe(X_,_0);var wZ=(s=>(s[s.None=0]="None",s[s.CommonJS=1]="CommonJS",s[s.AMD=2]="AMD",s[s.UMD=3]="UMD",s[s.System=4]="System",s[s.ES2015=5]="ES2015",s[s.ESNext=99]="ESNext",s))(wZ||{}),yZ=(s=>(s[s.None=0]="None",s[s.Preserve=1]="Preserve",s[s.React=2]="React",s[s.ReactNative=3]="ReactNative",s[s.ReactJSX=4]="ReactJSX",s[s.ReactJSXDev=5]="ReactJSXDev",s))(yZ||{}),SZ=(s=>(s[s.CarriageReturnLineFeed=0]="CarriageReturnLineFeed",s[s.LineFeed=1]="LineFeed",s))(SZ||{}),DZ=(s=>(s[s.ES3=0]="ES3",s[s.ES5=1]="ES5",s[s.ES2015=2]="ES2015",s[s.ES2016=3]="ES2016",s[s.ES2017=4]="ES2017",s[s.ES2018=5]="ES2018",s[s.ES2019=6]="ES2019",s[s.ES2020=7]="ES2020",s[s.ESNext=99]="ESNext",s[s.JSON=100]="JSON",s[s.Latest=99]="Latest",s))(DZ||{}),LZ=(s=>(s[s.Classic=1]="Classic",s[s.NodeJs=2]="NodeJs",s))(LZ||{}),xZ=class{constructor(s,e,t,i,n){this._onDidChange=new X_.Emitter,this._onDidExtraLibsChange=new X_.Emitter,this._extraLibs=Object.create(null),this._removedExtraLibs=Object.create(null),this._eagerModelSync=!1,this.setCompilerOptions(s),this.setDiagnosticsOptions(e),this.setWorkerOptions(t),this.setInlayHintsOptions(i),this.setModeConfiguration(n),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(s,e){let t;if(typeof e>"u"?t=`ts:extralib-${Math.random().toString(36).substring(2,15)}`:t=e,this._extraLibs[t]&&this._extraLibs[t].content===s)return{dispose:()=>{}};let i=1;return this._removedExtraLibs[t]&&(i=this._removedExtraLibs[t]+1),this._extraLibs[t]&&(i=this._extraLibs[t].version+1),this._extraLibs[t]={content:s,version:i},this._fireOnDidExtraLibsChangeSoon(),{dispose:()=>{let n=this._extraLibs[t];n&&n.version===i&&(delete this._extraLibs[t],this._removedExtraLibs[t]=i,this._fireOnDidExtraLibsChangeSoon())}}}setExtraLibs(s){for(const e in this._extraLibs)this._removedExtraLibs[e]=this._extraLibs[e].version;if(this._extraLibs=Object.create(null),s&&s.length>0)for(const e of s){const t=e.filePath||`ts:extralib-${Math.random().toString(36).substring(2,15)}`,i=e.content;let n=1;this._removedExtraLibs[t]&&(n=this._removedExtraLibs[t]+1),this._extraLibs[t]={content:i,version:n}}this._fireOnDidExtraLibsChangeSoon()}_fireOnDidExtraLibsChangeSoon(){this._onDidExtraLibsChangeTimeout===-1&&(this._onDidExtraLibsChangeTimeout=window.setTimeout(()=>{this._onDidExtraLibsChangeTimeout=-1,this._onDidExtraLibsChange.fire(void 0)},0))}getCompilerOptions(){return this._compilerOptions}setCompilerOptions(s){this._compilerOptions=s||Object.create(null),this._onDidChange.fire(void 0)}getDiagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(s){this._diagnosticsOptions=s||Object.create(null),this._onDidChange.fire(void 0)}setWorkerOptions(s){this._workerOptions=s||Object.create(null),this._onDidChange.fire(void 0)}setInlayHintsOptions(s){this._inlayHintsOptions=s||Object.create(null),this._onDidChange.fire(void 0)}setMaximumWorkerIdleTime(s){}setEagerModelSync(s){this._eagerModelSync=s}getEagerModelSync(){return this._eagerModelSync}setModeConfiguration(s){this._modeConfiguration=s||Object.create(null),this._onDidChange.fire(void 0)}},mPe=pPe,kZ={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},EZ=new xZ({allowNonTsExtensions:!0,target:99},{noSemanticValidation:!1,noSyntaxValidation:!1,onlyVisible:!1},{},{},kZ),IZ=new xZ({allowNonTsExtensions:!0,allowJs:!0,target:99},{noSemanticValidation:!0,noSyntaxValidation:!1,onlyVisible:!1},{},{},kZ),_Pe=()=>rE().then(s=>s.getTypeScriptWorker()),vPe=()=>rE().then(s=>s.getJavaScriptWorker());X_.languages.typescript={ModuleKind:wZ,JsxEmit:yZ,NewLineKind:SZ,ScriptTarget:DZ,ModuleResolutionKind:LZ,typescriptVersion:mPe,typescriptDefaults:EZ,javascriptDefaults:IZ,getTypeScriptWorker:_Pe,getJavaScriptWorker:vPe};function rE(){return er(()=>import("./tsMode-FcR9Jej8.js"),__vite__mapDeps([11,1,2,3]))}X_.languages.onLanguage("typescript",()=>rE().then(s=>s.setupTypeScript(EZ)));X_.languages.onLanguage("javascript",()=>rE().then(s=>s.setupJavaScript(IZ)));globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(s,e){return this.cache.has(s)?this.cache.get(s):(this.cache.set(s,e),e)}};O1.css.cssDefaults.setOptions({data:{dataProviders:{tailwindcssData:sQ}}});rQ(_0,{tailwindConfig:{darkMode:["class"],theme:{extend:{colors:{border:"hsl(var(--border))",input:"hsl(var(--input))",ring:"hsl(var(--ring))",background:"hsl(var(--background))",foreground:"hsl(var(--foreground))",primary:{DEFAULT:"hsl(var(--primary))",foreground:"hsl(var(--primary-foreground))"},secondary:{DEFAULT:"hsl(var(--secondary))",foreground:"hsl(var(--secondary-foreground))"},destructive:{DEFAULT:"hsl(var(--destructive))",foreground:"hsl(var(--destructive-foreground))"},muted:{DEFAULT:"hsl(var(--muted))",foreground:"hsl(var(--muted-foreground))"},accent:{DEFAULT:"hsl(var(--accent))",foreground:"hsl(var(--accent-foreground))"},popover:{DEFAULT:"hsl(var(--popover))",foreground:"hsl(var(--popover-foreground))"},card:{DEFAULT:"hsl(var(--card))",foreground:"hsl(var(--card-foreground))"}}}}}});NL.config({monaco:_0});NL.init().catch(s=>{console.error("Unable to initialize monaco",s)});const bPe=s=>{f5.base="vs-dark",s.editor.defineTheme("openui",f5)};function CPe({code:s,framework:e}){const o=RZ().id??"new",r=_t.useContext(jZ),[a,l]=_t.useState(e!=="html"),d=_t.useRef(),[c,u]=_t.useState(),[h,g]=_t.useState(""),[f,m]=_t.useState(""),_=_t.useRef(),[v,b]=_t.useState(!1),C=PZ(s),w=FZ(),[y,D]=OZ(BZ({id:o})),L=WZ(HZ),k=_t.useMemo(()=>new VZ(y,D,w),[y,D,w]),[I,O]=zZ(k);_t.useEffect(()=>{if(c){if(!k.version(I).includes(".")){const V=k.editChapter(h,I);O(V),setTimeout(()=>{var U;(U=d.current)==null||U.setPosition(c)},100)}u(void 0)}},[c,u,I,O]);const R=(F,V)=>{V.editor.setTheme("openui"),d.current=F;let U,J=!1;F.onDidChangeModelContent(()=>{U&&(U=void 0)}),F.onDidChangeCursorPosition(pe=>{J&&(U=pe.position,J=!1,u(U))}),F.onDidFocusEditorWidget(()=>{J=!0}),d.current.setValue(h.trim())};_t.useEffect(()=>{l(e!=="html")},[e]);const P=_t.useMemo(()=>{const[F]=UZ(e);return`${o}.${I}${F}`},[o,I,e]);return _t.useEffect(()=>{m(""),b(!1)},[P]),_t.useEffect(()=>{clearTimeout(_.current),f!==""&&(_.current=setTimeout(()=>{r.emit("ui-state",{editedHTML:f}),k.editChapter(f,I)},2e3))},[f,I]),_t.useEffect(()=>{d.current&&!v&&d.current.setValue(h.trim())},[L.rendering,v,h,P]),_t.useEffect(()=>{(async()=>{const V=await er(()=>import("./standalone-BS_cqyLa.js"),[]),J=[await er(()=>import("./html-B2LDEzWk.js"),[])];if(e!=="html"){const De=await er(()=>import("./babel-CqqbTYm7.js"),[]);J.unshift(De),J.unshift(Cse)}const pe=await V.format(s,{plugins:J,parser:e==="html"?"html":"babel",semi:!1,singleQuote:!0,trailingComma:"all",jsxBracketSameLine:!0,tabWidth:2,printWidth:200});g(pe)})().catch(()=>{console.warn("Unable to format code"),g(s)})},[C,e]),$Z.jsx(YX,{defaultValue:h.trim(),path:P,options:{readOnly:a,lineNumbers:"off",minimap:{enabled:!1},overviewRulerLanes:0,scrollBeyondLastLine:!1},className:"h-[calc(100vh-364px)] pt-2",beforeMount:bPe,onMount:R,onChange:F=>{F&&e==="html"&&!L.rendering&&F!==h.trim()&&(console.log("Edit mode enabled for code editor"),b(!0),m(F))}},P)}const d3e=Object.freeze(Object.defineProperty({__proto__:null,default:CPe},Symbol.toStringTag,{value:"Module"}));export{d3e as C,_0 as m,EZ as t}; ================================================ FILE: backend/openui/dist/assets/babel-CqqbTYm7.js ================================================ var Br=Object.create,Ze=Object.defineProperty,Mr=Object.getOwnPropertyDescriptor,Or=Object.getOwnPropertyNames,Rr=Object.getPrototypeOf,jr=Object.prototype.hasOwnProperty,Ur=(p,c)=>()=>(c||p((c={exports:{}}).exports,c),c.exports),_r=(p,c)=>{for(var m in c)Ze(p,m,{get:c[m],enumerable:!0})},Hr=(p,c,m,x)=>{if(c&&typeof c=="object"||typeof c=="function")for(let f of Or(c))!jr.call(p,f)&&f!==m&&Ze(p,f,{get:()=>c[f],enumerable:!(x=Mr(c,f))||x.enumerable});return p},Vt=(p,c,m)=>(m=p!=null?Br(Rr(p)):{},Hr(Ze(m,"default",{value:p,enumerable:!0}),p)),qt=Ur(p=>{Object.defineProperty(p,"__esModule",{value:!0});function c(t,e){if(t==null)return{};var s={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.includes(r))continue;s[r]=t[r]}return s}var m=class{constructor(t,e,s){this.line=void 0,this.column=void 0,this.index=void 0,this.line=t,this.column=e,this.index=s}},x=class{constructor(t,e){this.start=void 0,this.end=void 0,this.filename=void 0,this.identifierName=void 0,this.start=t,this.end=e}};function f(t,e){let{line:s,column:r,index:i}=t;return new m(s,r+e,i+e)}var C="BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED",S={ImportMetaOutsideModule:{message:`import.meta may appear only with 'sourceType: "module"'`,code:C},ImportOutsideModule:{message:`'import' and 'export' may appear only with 'sourceType: "module"'`,code:C}},M={ArrayPattern:"array destructuring pattern",AssignmentExpression:"assignment expression",AssignmentPattern:"assignment expression",ArrowFunctionExpression:"arrow function expression",ConditionalExpression:"conditional expression",CatchClause:"catch clause",ForOfStatement:"for-of statement",ForInStatement:"for-in statement",ForStatement:"for-loop",FormalParameters:"function parameter list",Identifier:"identifier",ImportSpecifier:"import specifier",ImportDefaultSpecifier:"import default specifier",ImportNamespaceSpecifier:"import namespace specifier",ObjectPattern:"object destructuring pattern",ParenthesizedExpression:"parenthesized expression",RestElement:"rest element",UpdateExpression:{true:"prefix operation",false:"postfix operation"},VariableDeclarator:"variable declaration",YieldExpression:"yield expression"},R=t=>t.type==="UpdateExpression"?M.UpdateExpression[`${t.prefix}`]:M[t.type],Se={AccessorIsGenerator:({kind:t})=>`A ${t}ter cannot be a generator.`,ArgumentsInClass:"'arguments' is only allowed in functions and class methods.",AsyncFunctionInSingleStatementContext:"Async functions can only be declared at the top level or inside a block.",AwaitBindingIdentifier:"Can not use 'await' as identifier inside an async function.",AwaitBindingIdentifierInStaticBlock:"Can not use 'await' as identifier inside a static block.",AwaitExpressionFormalParameter:"'await' is not allowed in async function parameters.",AwaitUsingNotInAsyncContext:"'await using' is only allowed within async functions and at the top levels of modules.",AwaitNotInAsyncContext:"'await' is only allowed within async functions and at the top levels of modules.",AwaitNotInAsyncFunction:"'await' is only allowed within async functions.",BadGetterArity:"A 'get' accessor must not have any formal parameters.",BadSetterArity:"A 'set' accessor must have exactly one formal parameter.",BadSetterRestParameter:"A 'set' accessor function argument must not be a rest parameter.",ConstructorClassField:"Classes may not have a field named 'constructor'.",ConstructorClassPrivateField:"Classes may not have a private field named '#constructor'.",ConstructorIsAccessor:"Class constructor may not be an accessor.",ConstructorIsAsync:"Constructor can't be an async function.",ConstructorIsGenerator:"Constructor can't be a generator.",DeclarationMissingInitializer:({kind:t})=>`Missing initializer in ${t} declaration.`,DecoratorArgumentsOutsideParentheses:"Decorator arguments must be moved inside parentheses: use '@(decorator(args))' instead of '@(decorator)(args)'.",DecoratorBeforeExport:"Decorators must be placed *before* the 'export' keyword. Remove the 'decoratorsBeforeExport: true' option to use the 'export @decorator class {}' syntax.",DecoratorsBeforeAfterExport:"Decorators can be placed *either* before or after the 'export' keyword, but not in both locations at the same time.",DecoratorConstructor:"Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?",DecoratorExportClass:"Decorators must be placed *after* the 'export' keyword. Remove the 'decoratorsBeforeExport: false' option to use the '@decorator export class {}' syntax.",DecoratorSemicolon:"Decorators must not be followed by a semicolon.",DecoratorStaticBlock:"Decorators can't be used with a static block.",DeferImportRequiresNamespace:'Only `import defer * as x from "./module"` is valid.',DeletePrivateField:"Deleting a private field is not allowed.",DestructureNamedImport:"ES2015 named imports do not destructure. Use another statement for destructuring after the import.",DuplicateConstructor:"Duplicate constructor in the same class.",DuplicateDefaultExport:"Only one default export allowed per module.",DuplicateExport:({exportName:t})=>`\`${t}\` has already been exported. Exported identifiers must be unique.`,DuplicateProto:"Redefinition of __proto__ property.",DuplicateRegExpFlags:"Duplicate regular expression flag.",DynamicImportPhaseRequiresImportExpressions:({phase:t})=>`'import.${t}(...)' can only be parsed when using the 'createImportExpressions' option.`,ElementAfterRest:"Rest element must be last element.",EscapedCharNotAnIdentifier:"Invalid Unicode escape.",ExportBindingIsString:({localName:t,exportName:e})=>`A string literal cannot be used as an exported binding without \`from\`. - Did you mean \`export { '${t}' as '${e}' } from 'some-module'\`?`,ExportDefaultFromAsIdentifier:"'from' is not allowed as an identifier after 'export default'.",ForInOfLoopInitializer:({type:t})=>`'${t==="ForInStatement"?"for-in":"for-of"}' loop variable declaration may not have an initializer.`,ForInUsing:"For-in loop may not start with 'using' declaration.",ForOfAsync:"The left-hand side of a for-of loop may not be 'async'.",ForOfLet:"The left-hand side of a for-of loop may not start with 'let'.",GeneratorInSingleStatementContext:"Generators can only be declared at the top level or inside a block.",IllegalBreakContinue:({type:t})=>`Unsyntactic ${t==="BreakStatement"?"break":"continue"}.`,IllegalLanguageModeDirective:"Illegal 'use strict' directive in function with non-simple parameter list.",IllegalReturn:"'return' outside of function.",ImportAttributesUseAssert:"The `assert` keyword in import attributes is deprecated and it has been replaced by the `with` keyword. You can enable the `deprecatedImportAssert` parser plugin to suppress this error.",ImportBindingIsString:({importName:t})=>`A string literal cannot be used as an imported binding. - Did you mean \`import { "${t}" as foo }\`?`,ImportCallArity:"`import()` requires exactly one or two arguments.",ImportCallNotNewExpression:"Cannot use new with import(...).",ImportCallSpreadArgument:"`...` is not allowed in `import()`.",ImportJSONBindingNotDefault:"A JSON module can only be imported with `default`.",ImportReflectionHasAssertion:"`import module x` cannot have assertions.",ImportReflectionNotBinding:'Only `import module x from "./module"` is valid.',IncompatibleRegExpUVFlags:"The 'u' and 'v' regular expression flags cannot be enabled at the same time.",InvalidBigIntLiteral:"Invalid BigIntLiteral.",InvalidCodePoint:"Code point out of bounds.",InvalidCoverInitializedName:"Invalid shorthand property initializer.",InvalidDecimal:"Invalid decimal.",InvalidDigit:({radix:t})=>`Expected number in radix ${t}.`,InvalidEscapeSequence:"Bad character escape sequence.",InvalidEscapeSequenceTemplate:"Invalid escape sequence in template.",InvalidEscapedReservedWord:({reservedWord:t})=>`Escape sequence in keyword ${t}.`,InvalidIdentifier:({identifierName:t})=>`Invalid identifier ${t}.`,InvalidLhs:({ancestor:t})=>`Invalid left-hand side in ${R(t)}.`,InvalidLhsBinding:({ancestor:t})=>`Binding invalid left-hand side in ${R(t)}.`,InvalidLhsOptionalChaining:({ancestor:t})=>`Invalid optional chaining in the left-hand side of ${R(t)}.`,InvalidNumber:"Invalid number.",InvalidOrMissingExponent:"Floating-point numbers require a valid exponent after the 'e'.",InvalidOrUnexpectedToken:({unexpected:t})=>`Unexpected character '${t}'.`,InvalidParenthesizedAssignment:"Invalid parenthesized assignment pattern.",InvalidPrivateFieldResolution:({identifierName:t})=>`Private name #${t} is not defined.`,InvalidPropertyBindingPattern:"Binding member expression.",InvalidRecordProperty:"Only properties and spread elements are allowed in record definitions.",InvalidRestAssignmentPattern:"Invalid rest operator's argument.",LabelRedeclaration:({labelName:t})=>`Label '${t}' is already declared.`,LetInLexicalBinding:"'let' is disallowed as a lexically bound name.",LineTerminatorBeforeArrow:"No line break is allowed before '=>'.",MalformedRegExpFlags:"Invalid regular expression flag.",MissingClassName:"A class name is required.",MissingEqInAssignment:"Only '=' operator can be used for specifying default value.",MissingSemicolon:"Missing semicolon.",MissingPlugin:({missingPlugin:t})=>`This experimental syntax requires enabling the parser plugin: ${t.map(e=>JSON.stringify(e)).join(", ")}.`,MissingOneOfPlugins:({missingPlugin:t})=>`This experimental syntax requires enabling one of the following parser plugin(s): ${t.map(e=>JSON.stringify(e)).join(", ")}.`,MissingUnicodeEscape:"Expecting Unicode escape sequence \\uXXXX.",MixingCoalesceWithLogical:"Nullish coalescing operator(??) requires parens when mixing with logical operators.",ModuleAttributeDifferentFromType:"The only accepted module attribute is `type`.",ModuleAttributeInvalidValue:"Only string literals are allowed as module attribute values.",ModuleAttributesWithDuplicateKeys:({key:t})=>`Duplicate key "${t}" is not allowed in module attributes.`,ModuleExportNameHasLoneSurrogate:({surrogateCharCode:t})=>`An export name cannot include a lone surrogate, found '\\u${t.toString(16)}'.`,ModuleExportUndefined:({localName:t})=>`Export '${t}' is not defined.`,MultipleDefaultsInSwitch:"Multiple default clauses.",NewlineAfterThrow:"Illegal newline after throw.",NoCatchOrFinally:"Missing catch or finally clause.",NumberIdentifier:"Identifier directly after number.",NumericSeparatorInEscapeSequence:"Numeric separators are not allowed inside unicode escape sequences or hex escape sequences.",ObsoleteAwaitStar:"'await*' has been removed from the async functions proposal. Use Promise.all() instead.",OptionalChainingNoNew:"Constructors in/after an Optional Chain are not allowed.",OptionalChainingNoTemplate:"Tagged Template Literals are not allowed in optionalChain.",OverrideOnConstructor:"'override' modifier cannot appear on a constructor declaration.",ParamDupe:"Argument name clash.",PatternHasAccessor:"Object pattern can't contain getter or setter.",PatternHasMethod:"Object pattern can't contain methods.",PrivateInExpectedIn:({identifierName:t})=>`Private names are only allowed in property accesses (\`obj.#${t}\`) or in \`in\` expressions (\`#${t} in obj\`).`,PrivateNameRedeclaration:({identifierName:t})=>`Duplicate private name #${t}.`,RecordExpressionBarIncorrectEndSyntaxType:"Record expressions ending with '|}' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",RecordExpressionBarIncorrectStartSyntaxType:"Record expressions starting with '{|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",RecordExpressionHashIncorrectStartSyntaxType:"Record expressions starting with '#{' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.",RecordNoProto:"'__proto__' is not allowed in Record expressions.",RestTrailingComma:"Unexpected trailing comma after rest element.",SloppyFunction:"In non-strict mode code, functions can only be declared at top level or inside a block.",SloppyFunctionAnnexB:"In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement.",SourcePhaseImportRequiresDefault:'Only `import source x from "./module"` is valid.',StaticPrototype:"Classes may not have static property named prototype.",SuperNotAllowed:"`super()` is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class?",SuperPrivateField:"Private fields can't be accessed on super.",TrailingDecorator:"Decorators must be attached to a class element.",TupleExpressionBarIncorrectEndSyntaxType:"Tuple expressions ending with '|]' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",TupleExpressionBarIncorrectStartSyntaxType:"Tuple expressions starting with '[|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",TupleExpressionHashIncorrectStartSyntaxType:"Tuple expressions starting with '#[' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.",UnexpectedArgumentPlaceholder:"Unexpected argument placeholder.",UnexpectedAwaitAfterPipelineBody:'Unexpected "await" after pipeline body; await must have parentheses in minimal proposal.',UnexpectedDigitAfterHash:"Unexpected digit after hash token.",UnexpectedImportExport:"'import' and 'export' may only appear at the top level.",UnexpectedKeyword:({keyword:t})=>`Unexpected keyword '${t}'.`,UnexpectedLeadingDecorator:"Leading decorators must be attached to a class declaration.",UnexpectedLexicalDeclaration:"Lexical declaration cannot appear in a single-statement context.",UnexpectedNewTarget:"`new.target` can only be used in functions or class properties.",UnexpectedNumericSeparator:"A numeric separator is only allowed between two digits.",UnexpectedPrivateField:"Unexpected private name.",UnexpectedReservedWord:({reservedWord:t})=>`Unexpected reserved word '${t}'.`,UnexpectedSuper:"'super' is only allowed in object methods and classes.",UnexpectedToken:({expected:t,unexpected:e})=>`Unexpected token${e?` '${e}'.`:""}${t?`, expected "${t}"`:""}`,UnexpectedTokenUnaryExponentiation:"Illegal expression. Wrap left hand side or entire exponentiation in parentheses.",UnexpectedUsingDeclaration:"Using declaration cannot appear in the top level when source type is `script`.",UnsupportedBind:"Binding should be performed on object property.",UnsupportedDecoratorExport:"A decorated export must export a class declaration.",UnsupportedDefaultExport:"Only expressions, functions or classes are allowed as the `default` export.",UnsupportedImport:"`import` can only be used in `import()` or `import.meta`.",UnsupportedMetaProperty:({target:t,onlyValidPropertyName:e})=>`The only valid meta property for ${t} is ${t}.${e}.`,UnsupportedParameterDecorator:"Decorators cannot be used to decorate parameters.",UnsupportedPropertyDecorator:"Decorators cannot be used to decorate object literal properties.",UnsupportedSuper:"'super' can only be used with function calls (i.e. super()) or in property accesses (i.e. super.prop or super[prop]).",UnterminatedComment:"Unterminated comment.",UnterminatedRegExp:"Unterminated regular expression.",UnterminatedString:"Unterminated string constant.",UnterminatedTemplate:"Unterminated template.",UsingDeclarationExport:"Using declaration cannot be exported.",UsingDeclarationHasBindingPattern:"Using declaration cannot have destructuring patterns.",VarRedeclaration:({identifierName:t})=>`Identifier '${t}' has already been declared.`,YieldBindingIdentifier:"Can not use 'yield' as identifier inside a generator.",YieldInParameter:"Yield expression is not allowed in formal parameters.",ZeroDigitNumericSeparator:"Numeric separator can not be used after leading 0."},ss={StrictDelete:"Deleting local variable in strict mode.",StrictEvalArguments:({referenceName:t})=>`Assigning to '${t}' in strict mode.`,StrictEvalArgumentsBinding:({bindingName:t})=>`Binding '${t}' in strict mode.`,StrictFunction:"In strict mode code, functions can only be declared at top level or inside a block.",StrictNumericEscape:"The only valid numeric escape in strict mode is '\\0'.",StrictOctalLiteral:"Legacy octal literals are not allowed in strict mode.",StrictWith:"'with' in strict mode."},rs=new Set(["ArrowFunctionExpression","AssignmentExpression","ConditionalExpression","YieldExpression"]),is=Object.assign({PipeBodyIsTighter:"Unexpected yield after pipeline body; any yield expression acting as Hack-style pipe body must be parenthesized due to its loose operator precedence.",PipeTopicRequiresHackPipes:'Topic reference is used, but the pipelineOperator plugin was not passed a "proposal": "hack" or "smart" option.',PipeTopicUnbound:"Topic reference is unbound; it must be inside a pipe body.",PipeTopicUnconfiguredToken:({token:t})=>`Invalid topic token ${t}. In order to use ${t} as a topic reference, the pipelineOperator plugin must be configured with { "proposal": "hack", "topicToken": "${t}" }.`,PipeTopicUnused:"Hack-style pipe body does not contain a topic reference; Hack-style pipes must use topic at least once.",PipeUnparenthesizedBody:({type:t})=>`Hack-style pipe body cannot be an unparenthesized ${R({type:t})}; please wrap it in parentheses.`},{PipelineBodyNoArrow:'Unexpected arrow "=>" after pipeline body; arrow function in pipeline body must be parenthesized.',PipelineBodySequenceExpression:"Pipeline body may not be a comma-separated sequence expression.",PipelineHeadSequenceExpression:"Pipeline head should not be a comma-separated sequence expression.",PipelineTopicUnused:"Pipeline is in topic style but does not use topic reference.",PrimaryTopicNotAllowed:"Topic reference was used in a lexical context without topic binding.",PrimaryTopicRequiresSmartPipeline:'Topic reference is used, but the pipelineOperator plugin was not passed a "proposal": "hack" or "smart" option.'}),as=["message"];function tt(t,e,s){Object.defineProperty(t,e,{enumerable:!1,configurable:!0,value:s})}function ns({toMessage:t,code:e,reasonCode:s,syntaxPlugin:r}){let i=s==="MissingPlugin"||s==="MissingOneOfPlugins";{let a={AccessorCannotDeclareThisParameter:"AccesorCannotDeclareThisParameter",AccessorCannotHaveTypeParameters:"AccesorCannotHaveTypeParameters",ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference:"ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference",SetAccessorCannotHaveOptionalParameter:"SetAccesorCannotHaveOptionalParameter",SetAccessorCannotHaveRestParameter:"SetAccesorCannotHaveRestParameter",SetAccessorCannotHaveReturnType:"SetAccesorCannotHaveReturnType"};a[s]&&(s=a[s])}return function a(n,o){let h=new SyntaxError;return h.code=e,h.reasonCode=s,h.loc=n,h.pos=n.index,h.syntaxPlugin=r,i&&(h.missingPlugin=o.missingPlugin),tt(h,"clone",function(l={}){var d;let{line:y,column:A,index:T}=(d=l.loc)!=null?d:n;return a(new m(y,A,T),Object.assign({},o,l.details))}),tt(h,"details",o),Object.defineProperty(h,"message",{configurable:!0,get(){let l=`${t(o)} (${n.line}:${n.column})`;return this.message=l,l},set(l){Object.defineProperty(this,"message",{value:l,writable:!0})}}),h}}function H(t,e){if(Array.isArray(t))return r=>H(r,t[0]);let s={};for(let r of Object.keys(t)){let i=t[r],a=typeof i=="string"?{message:()=>i}:typeof i=="function"?{message:i}:i,{message:n}=a,o=c(a,as),h=typeof n=="string"?()=>n:n;s[r]=ns(Object.assign({code:"BABEL_PARSER_SYNTAX_ERROR",reasonCode:r,toMessage:h},e?{syntaxPlugin:e}:{},o))}return s}var u=Object.assign({},H(S),H(Se),H(ss),H`pipelineOperator`(is));function os(){return{sourceType:"script",sourceFilename:void 0,startIndex:0,startColumn:0,startLine:1,allowAwaitOutsideFunction:!1,allowReturnOutsideFunction:!1,allowNewTargetOutsideFunction:!1,allowImportExportEverywhere:!1,allowSuperOutsideMethod:!1,allowUndeclaredExports:!1,plugins:[],strictMode:null,ranges:!1,tokens:!1,createImportExpressions:!1,createParenthesizedExpressions:!1,errorRecovery:!1,attachComment:!0,annexB:!0}}function ls(t){let e=os();if(t==null)return e;if(t.annexB!=null&&t.annexB!==!1)throw new Error("The `annexB` option can only be set to `false`.");for(let s of Object.keys(e))t[s]!=null&&(e[s]=t[s]);if(e.startLine===1)t.startIndex==null&&e.startColumn>0?e.startIndex=e.startColumn:t.startColumn==null&&e.startIndex>0&&(e.startColumn=e.startIndex);else if((t.startColumn==null||t.startIndex==null)&&t.startIndex!=null)throw new Error("With a `startLine > 1` you must also specify `startIndex` and `startColumn`.");return e}var{defineProperty:hs}=Object,st=(t,e)=>{t&&hs(t,e,{enumerable:!1,value:t[e]})};function ne(t){return st(t.loc.start,"index"),st(t.loc.end,"index"),t}var ps=t=>class extends t{parse(){let e=ne(super.parse());return this.optionFlags&128&&(e.tokens=e.tokens.map(ne)),e}parseRegExpLiteral({pattern:e,flags:s}){let r=null;try{r=new RegExp(e,s)}catch{}let i=this.estreeParseLiteral(r);return i.regex={pattern:e,flags:s},i}parseBigIntLiteral(e){let s;try{s=BigInt(e)}catch{s=null}let r=this.estreeParseLiteral(s);return r.bigint=String(r.value||e),r}parseDecimalLiteral(e){let s=this.estreeParseLiteral(null);return s.decimal=String(s.value||e),s}estreeParseLiteral(e){return this.parseLiteral(e,"Literal")}parseStringLiteral(e){return this.estreeParseLiteral(e)}parseNumericLiteral(e){return this.estreeParseLiteral(e)}parseNullLiteral(){return this.estreeParseLiteral(null)}parseBooleanLiteral(e){return this.estreeParseLiteral(e)}directiveToStmt(e){let s=e.value;delete e.value,s.type="Literal",s.raw=s.extra.raw,s.value=s.extra.expressionValue;let r=e;return r.type="ExpressionStatement",r.expression=s,r.directive=s.extra.rawValue,delete s.extra,r}initFunction(e,s){super.initFunction(e,s),e.expression=!1}checkDeclaration(e){e!=null&&this.isObjectProperty(e)?this.checkDeclaration(e.value):super.checkDeclaration(e)}getObjectOrClassMethodParams(e){return e.value.params}isValidDirective(e){var s;return e.type==="ExpressionStatement"&&e.expression.type==="Literal"&&typeof e.expression.value=="string"&&!((s=e.expression.extra)!=null&&s.parenthesized)}parseBlockBody(e,s,r,i,a){super.parseBlockBody(e,s,r,i,a);let n=e.directives.map(o=>this.directiveToStmt(o));e.body=n.concat(e.body),delete e.directives}parsePrivateName(){let e=super.parsePrivateName();return this.getPluginOption("estree","classFeatures")?this.convertPrivateNameToPrivateIdentifier(e):e}convertPrivateNameToPrivateIdentifier(e){let s=super.getPrivateNameSV(e);return e=e,delete e.id,e.name=s,e.type="PrivateIdentifier",e}isPrivateName(e){return this.getPluginOption("estree","classFeatures")?e.type==="PrivateIdentifier":super.isPrivateName(e)}getPrivateNameSV(e){return this.getPluginOption("estree","classFeatures")?e.name:super.getPrivateNameSV(e)}parseLiteral(e,s){let r=super.parseLiteral(e,s);return r.raw=r.extra.raw,delete r.extra,r}parseFunctionBody(e,s,r=!1){super.parseFunctionBody(e,s,r),e.expression=e.body.type!=="BlockStatement"}parseMethod(e,s,r,i,a,n,o=!1){let h=this.startNode();h.kind=e.kind,h=super.parseMethod(h,s,r,i,a,n,o),h.type="FunctionExpression",delete h.kind,e.value=h;let{typeParameters:l}=e;return l&&(delete e.typeParameters,h.typeParameters=l,this.resetStartLocationFromNode(h,l)),n==="ClassPrivateMethod"&&(e.computed=!1),this.finishNode(e,"MethodDefinition")}nameIsConstructor(e){return e.type==="Literal"?e.value==="constructor":super.nameIsConstructor(e)}parseClassProperty(...e){let s=super.parseClassProperty(...e);return this.getPluginOption("estree","classFeatures")&&(s.type="PropertyDefinition"),s}parseClassPrivateProperty(...e){let s=super.parseClassPrivateProperty(...e);return this.getPluginOption("estree","classFeatures")&&(s.type="PropertyDefinition",s.computed=!1),s}parseObjectMethod(e,s,r,i,a){let n=super.parseObjectMethod(e,s,r,i,a);return n&&(n.type="Property",n.kind==="method"&&(n.kind="init"),n.shorthand=!1),n}parseObjectProperty(e,s,r,i){let a=super.parseObjectProperty(e,s,r,i);return a&&(a.kind="init",a.type="Property"),a}isValidLVal(e,s,r){return e==="Property"?"value":super.isValidLVal(e,s,r)}isAssignable(e,s){return e!=null&&this.isObjectProperty(e)?this.isAssignable(e.value,s):super.isAssignable(e,s)}toAssignable(e,s=!1){if(e!=null&&this.isObjectProperty(e)){let{key:r,value:i}=e;this.isPrivateName(r)&&this.classScope.usePrivateName(this.getPrivateNameSV(r),r.loc.start),this.toAssignable(i,s)}else super.toAssignable(e,s)}toAssignableObjectExpressionProp(e,s,r){e.type==="Property"&&(e.kind==="get"||e.kind==="set")?this.raise(u.PatternHasAccessor,e.key):e.type==="Property"&&e.method?this.raise(u.PatternHasMethod,e.key):super.toAssignableObjectExpressionProp(e,s,r)}finishCallExpression(e,s){let r=super.finishCallExpression(e,s);if(r.callee.type==="Import"){var i,a;r.type="ImportExpression",r.source=r.arguments[0],r.options=(i=r.arguments[1])!=null?i:null,r.attributes=(a=r.arguments[1])!=null?a:null,delete r.arguments,delete r.callee}return r}toReferencedArguments(e){e.type!=="ImportExpression"&&super.toReferencedArguments(e)}parseExport(e,s){let r=this.state.lastTokStartLoc,i=super.parseExport(e,s);switch(i.type){case"ExportAllDeclaration":i.exported=null;break;case"ExportNamedDeclaration":i.specifiers.length===1&&i.specifiers[0].type==="ExportNamespaceSpecifier"&&(i.type="ExportAllDeclaration",i.exported=i.specifiers[0].exported,delete i.specifiers);case"ExportDefaultDeclaration":{var a;let{declaration:n}=i;(n==null?void 0:n.type)==="ClassDeclaration"&&((a=n.decorators)==null?void 0:a.length)>0&&n.start===i.start&&this.resetStartLocation(i,r)}break}return i}parseSubscript(e,s,r,i){let a=super.parseSubscript(e,s,r,i);if(i.optionalChainMember){if((a.type==="OptionalMemberExpression"||a.type==="OptionalCallExpression")&&(a.type=a.type.substring(8)),i.stop){let n=this.startNodeAtNode(a);return n.expression=a,this.finishNode(n,"ChainExpression")}}else(a.type==="MemberExpression"||a.type==="CallExpression")&&(a.optional=!1);return a}isOptionalMemberExpression(e){return e.type==="ChainExpression"?e.expression.type==="MemberExpression":super.isOptionalMemberExpression(e)}hasPropertyAsPrivateName(e){return e.type==="ChainExpression"&&(e=e.expression),super.hasPropertyAsPrivateName(e)}isObjectProperty(e){return e.type==="Property"&&e.kind==="init"&&!e.method}isObjectMethod(e){return e.type==="Property"&&(e.method||e.kind==="get"||e.kind==="set")}finishNodeAt(e,s,r){return ne(super.finishNodeAt(e,s,r))}resetStartLocation(e,s){super.resetStartLocation(e,s),ne(e)}resetEndLocation(e,s=this.state.lastTokEndLoc){super.resetEndLocation(e,s),ne(e)}},oe=class{constructor(t,e){this.token=void 0,this.preserveSpace=void 0,this.token=t,this.preserveSpace=!!e}},k={brace:new oe("{"),j_oTag:new oe("...
    ",!0)};k.template=new oe("`",!0);var w=!0,P=!0,we=!0,le=!0,J=!0,us=!0,rt=class{constructor(t,e={}){this.label=void 0,this.keyword=void 0,this.beforeExpr=void 0,this.startsExpr=void 0,this.rightAssociative=void 0,this.isLoop=void 0,this.isAssign=void 0,this.prefix=void 0,this.postfix=void 0,this.binop=void 0,this.label=t,this.keyword=e.keyword,this.beforeExpr=!!e.beforeExpr,this.startsExpr=!!e.startsExpr,this.rightAssociative=!!e.rightAssociative,this.isLoop=!!e.isLoop,this.isAssign=!!e.isAssign,this.prefix=!!e.prefix,this.postfix=!!e.postfix,this.binop=e.binop!=null?e.binop:null,this.updateContext=null}},Ie=new Map;function v(t,e={}){e.keyword=t;let s=b(t,e);return Ie.set(t,s),s}function O(t,e){return b(t,{beforeExpr:w,binop:e})}var he=-1,z=[],Ne=[],ve=[],ke=[],De=[],Fe=[];function b(t,e={}){var s,r,i,a;return++he,Ne.push(t),ve.push((s=e.binop)!=null?s:-1),ke.push((r=e.beforeExpr)!=null?r:!1),De.push((i=e.startsExpr)!=null?i:!1),Fe.push((a=e.prefix)!=null?a:!1),z.push(new rt(t,e)),he}function I(t,e={}){var s,r,i,a;return++he,Ie.set(t,he),Ne.push(t),ve.push((s=e.binop)!=null?s:-1),ke.push((r=e.beforeExpr)!=null?r:!1),De.push((i=e.startsExpr)!=null?i:!1),Fe.push((a=e.prefix)!=null?a:!1),z.push(new rt("name",e)),he}var cs={bracketL:b("[",{beforeExpr:w,startsExpr:P}),bracketHashL:b("#[",{beforeExpr:w,startsExpr:P}),bracketBarL:b("[|",{beforeExpr:w,startsExpr:P}),bracketR:b("]"),bracketBarR:b("|]"),braceL:b("{",{beforeExpr:w,startsExpr:P}),braceBarL:b("{|",{beforeExpr:w,startsExpr:P}),braceHashL:b("#{",{beforeExpr:w,startsExpr:P}),braceR:b("}"),braceBarR:b("|}"),parenL:b("(",{beforeExpr:w,startsExpr:P}),parenR:b(")"),comma:b(",",{beforeExpr:w}),semi:b(";",{beforeExpr:w}),colon:b(":",{beforeExpr:w}),doubleColon:b("::",{beforeExpr:w}),dot:b("."),question:b("?",{beforeExpr:w}),questionDot:b("?."),arrow:b("=>",{beforeExpr:w}),template:b("template"),ellipsis:b("...",{beforeExpr:w}),backQuote:b("`",{startsExpr:P}),dollarBraceL:b("${",{beforeExpr:w,startsExpr:P}),templateTail:b("...`",{startsExpr:P}),templateNonTail:b("...${",{beforeExpr:w,startsExpr:P}),at:b("@"),hash:b("#",{startsExpr:P}),interpreterDirective:b("#!..."),eq:b("=",{beforeExpr:w,isAssign:le}),assign:b("_=",{beforeExpr:w,isAssign:le}),slashAssign:b("_=",{beforeExpr:w,isAssign:le}),xorAssign:b("_=",{beforeExpr:w,isAssign:le}),moduloAssign:b("_=",{beforeExpr:w,isAssign:le}),incDec:b("++/--",{prefix:J,postfix:us,startsExpr:P}),bang:b("!",{beforeExpr:w,prefix:J,startsExpr:P}),tilde:b("~",{beforeExpr:w,prefix:J,startsExpr:P}),doubleCaret:b("^^",{startsExpr:P}),doubleAt:b("@@",{startsExpr:P}),pipeline:O("|>",0),nullishCoalescing:O("??",1),logicalOR:O("||",1),logicalAND:O("&&",2),bitwiseOR:O("|",3),bitwiseXOR:O("^",4),bitwiseAND:O("&",5),equality:O("==/!=/===/!==",6),lt:O("/<=/>=",7),gt:O("/<=/>=",7),relational:O("/<=/>=",7),bitShift:O("<>/>>>",8),bitShiftL:O("<>/>>>",8),bitShiftR:O("<>/>>>",8),plusMin:b("+/-",{beforeExpr:w,binop:9,prefix:J,startsExpr:P}),modulo:b("%",{binop:10,startsExpr:P}),star:b("*",{binop:10}),slash:O("/",10),exponent:b("**",{beforeExpr:w,binop:11,rightAssociative:!0}),_in:v("in",{beforeExpr:w,binop:7}),_instanceof:v("instanceof",{beforeExpr:w,binop:7}),_break:v("break"),_case:v("case",{beforeExpr:w}),_catch:v("catch"),_continue:v("continue"),_debugger:v("debugger"),_default:v("default",{beforeExpr:w}),_else:v("else",{beforeExpr:w}),_finally:v("finally"),_function:v("function",{startsExpr:P}),_if:v("if"),_return:v("return",{beforeExpr:w}),_switch:v("switch"),_throw:v("throw",{beforeExpr:w,prefix:J,startsExpr:P}),_try:v("try"),_var:v("var"),_const:v("const"),_with:v("with"),_new:v("new",{beforeExpr:w,startsExpr:P}),_this:v("this",{startsExpr:P}),_super:v("super",{startsExpr:P}),_class:v("class",{startsExpr:P}),_extends:v("extends",{beforeExpr:w}),_export:v("export"),_import:v("import",{startsExpr:P}),_null:v("null",{startsExpr:P}),_true:v("true",{startsExpr:P}),_false:v("false",{startsExpr:P}),_typeof:v("typeof",{beforeExpr:w,prefix:J,startsExpr:P}),_void:v("void",{beforeExpr:w,prefix:J,startsExpr:P}),_delete:v("delete",{beforeExpr:w,prefix:J,startsExpr:P}),_do:v("do",{isLoop:we,beforeExpr:w}),_for:v("for",{isLoop:we}),_while:v("while",{isLoop:we}),_as:I("as",{startsExpr:P}),_assert:I("assert",{startsExpr:P}),_async:I("async",{startsExpr:P}),_await:I("await",{startsExpr:P}),_defer:I("defer",{startsExpr:P}),_from:I("from",{startsExpr:P}),_get:I("get",{startsExpr:P}),_let:I("let",{startsExpr:P}),_meta:I("meta",{startsExpr:P}),_of:I("of",{startsExpr:P}),_sent:I("sent",{startsExpr:P}),_set:I("set",{startsExpr:P}),_source:I("source",{startsExpr:P}),_static:I("static",{startsExpr:P}),_using:I("using",{startsExpr:P}),_yield:I("yield",{startsExpr:P}),_asserts:I("asserts",{startsExpr:P}),_checks:I("checks",{startsExpr:P}),_exports:I("exports",{startsExpr:P}),_global:I("global",{startsExpr:P}),_implements:I("implements",{startsExpr:P}),_intrinsic:I("intrinsic",{startsExpr:P}),_infer:I("infer",{startsExpr:P}),_is:I("is",{startsExpr:P}),_mixins:I("mixins",{startsExpr:P}),_proto:I("proto",{startsExpr:P}),_require:I("require",{startsExpr:P}),_satisfies:I("satisfies",{startsExpr:P}),_keyof:I("keyof",{startsExpr:P}),_readonly:I("readonly",{startsExpr:P}),_unique:I("unique",{startsExpr:P}),_abstract:I("abstract",{startsExpr:P}),_declare:I("declare",{startsExpr:P}),_enum:I("enum",{startsExpr:P}),_module:I("module",{startsExpr:P}),_namespace:I("namespace",{startsExpr:P}),_interface:I("interface",{startsExpr:P}),_type:I("type",{startsExpr:P}),_opaque:I("opaque",{startsExpr:P}),name:b("name",{startsExpr:P}),placeholder:b("%%",{startsExpr:!0}),string:b("string",{startsExpr:P}),num:b("num",{startsExpr:P}),bigint:b("bigint",{startsExpr:P}),decimal:b("decimal",{startsExpr:P}),regexp:b("regexp",{startsExpr:P}),privateName:b("#name",{startsExpr:P}),eof:b("eof"),jsxName:b("jsxName"),jsxText:b("jsxText",{beforeExpr:!0}),jsxTagStart:b("jsxTagStart",{startsExpr:!0}),jsxTagEnd:b("jsxTagEnd")};function D(t){return t>=93&&t<=133}function ds(t){return t<=92}function U(t){return t>=58&&t<=133}function it(t){return t>=58&&t<=137}function ms(t){return ke[t]}function Le(t){return De[t]}function fs(t){return t>=29&&t<=33}function at(t){return t>=129&&t<=131}function ys(t){return t>=90&&t<=92}function Be(t){return t>=58&&t<=92}function xs(t){return t>=39&&t<=59}function Ps(t){return t===34}function As(t){return Fe[t]}function gs(t){return t>=121&&t<=123}function Ts(t){return t>=124&&t<=130}function W(t){return Ne[t]}function ye(t){return ve[t]}function bs(t){return t===57}function xe(t){return t>=24&&t<=25}function V(t){return z[t]}z[8].updateContext=t=>{t.pop()},z[5].updateContext=z[7].updateContext=z[23].updateContext=t=>{t.push(k.brace)},z[22].updateContext=t=>{t[t.length-1]===k.template?t.pop():t.push(k.template)},z[143].updateContext=t=>{t.push(k.j_expr,k.j_oTag)};var Me="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢎࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೝೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲊᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꟍꟐꟑꟓꟕ-Ƛꟲ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",nt="·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࢗ-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ-ᫎᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‌‍‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・",Es=new RegExp("["+Me+"]"),Cs=new RegExp("["+Me+nt+"]");Me=nt=null;var ot=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,2,60,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,42,9,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,496,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,16,621,2467,541,1507,4938,6,4191],Ss=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,80,3,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,343,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,726,6,110,6,6,9,4759,9,787719,239];function Oe(t,e){let s=65536;for(let r=0,i=e.length;rt)return!1;if(s+=e[r+1],s>=t)return!0}return!1}function q(t){return t<65?t===36:t<=90?!0:t<97?t===95:t<=122?!0:t<=65535?t>=170&&Es.test(String.fromCharCode(t)):Oe(t,ot)}function te(t){return t<48?t===36:t<58?!0:t<65?!1:t<=90?!0:t<97?t===95:t<=122?!0:t<=65535?t>=170&&Cs.test(String.fromCharCode(t)):Oe(t,ot)||Oe(t,Ss)}var Re={keyword:["break","case","catch","continue","debugger","default","do","else","finally","for","function","if","return","switch","throw","try","var","const","while","with","new","this","super","class","extends","export","import","null","true","false","in","instanceof","typeof","void","delete"],strict:["implements","interface","let","package","private","protected","public","static","yield"],strictBind:["eval","arguments"]},ws=new Set(Re.keyword),Is=new Set(Re.strict),Ns=new Set(Re.strictBind);function lt(t,e){return e&&t==="await"||t==="enum"}function ht(t,e){return lt(t,e)||Is.has(t)}function pt(t){return Ns.has(t)}function ut(t,e){return ht(t,e)||pt(t)}function vs(t){return ws.has(t)}function ks(t,e,s){return t===64&&e===64&&q(s)}var Ds=new Set(["break","case","catch","continue","debugger","default","do","else","finally","for","function","if","return","switch","throw","try","var","const","while","with","new","this","super","class","extends","export","import","null","true","false","in","instanceof","typeof","void","delete","implements","interface","let","package","private","protected","public","static","yield","eval","arguments","enum","await"]);function Fs(t){return Ds.has(t)}var je=class{constructor(t){this.flags=0,this.names=new Map,this.firstLexicalName="",this.flags=t}},Ue=class{constructor(t,e){this.parser=void 0,this.scopeStack=[],this.inModule=void 0,this.undefinedExports=new Map,this.parser=t,this.inModule=e}get inTopLevel(){return(this.currentScope().flags&1)>0}get inFunction(){return(this.currentVarScopeFlags()&2)>0}get allowSuper(){return(this.currentThisScopeFlags()&16)>0}get allowDirectSuper(){return(this.currentThisScopeFlags()&32)>0}get inClass(){return(this.currentThisScopeFlags()&64)>0}get inClassAndNotInNonArrowFunction(){let t=this.currentThisScopeFlags();return(t&64)>0&&(t&2)===0}get inStaticBlock(){for(let t=this.scopeStack.length-1;;t--){let{flags:e}=this.scopeStack[t];if(e&128)return!0;if(e&451)return!1}}get inNonArrowFunction(){return(this.currentThisScopeFlags()&2)>0}get treatFunctionsAsVar(){return this.treatFunctionsAsVarInScope(this.currentScope())}createScope(t){return new je(t)}enter(t){this.scopeStack.push(this.createScope(t))}exit(){return this.scopeStack.pop().flags}treatFunctionsAsVarInScope(t){return!!(t.flags&130||!this.parser.inModule&&t.flags&1)}declareName(t,e,s){let r=this.currentScope();if(e&8||e&16){this.checkRedeclarationInScope(r,t,e,s);let i=r.names.get(t)||0;e&16?i=i|4:(r.firstLexicalName||(r.firstLexicalName=t),i=i|2),r.names.set(t,i),e&8&&this.maybeExportDefined(r,t)}else if(e&4)for(let i=this.scopeStack.length-1;i>=0&&(r=this.scopeStack[i],this.checkRedeclarationInScope(r,t,e,s),r.names.set(t,(r.names.get(t)||0)|1),this.maybeExportDefined(r,t),!(r.flags&387));--i);this.parser.inModule&&r.flags&1&&this.undefinedExports.delete(t)}maybeExportDefined(t,e){this.parser.inModule&&t.flags&1&&this.undefinedExports.delete(e)}checkRedeclarationInScope(t,e,s,r){this.isRedeclaredInScope(t,e,s)&&this.parser.raise(u.VarRedeclaration,r,{identifierName:e})}isRedeclaredInScope(t,e,s){if(!(s&1))return!1;if(s&8)return t.names.has(e);let r=t.names.get(e);return s&16?(r&2)>0||!this.treatFunctionsAsVarInScope(t)&&(r&1)>0:(r&2)>0&&!(t.flags&8&&t.firstLexicalName===e)||!this.treatFunctionsAsVarInScope(t)&&(r&4)>0}checkLocalExport(t){let{name:e}=t;this.scopeStack[0].names.has(e)||this.undefinedExports.set(e,t.loc.start)}currentScope(){return this.scopeStack[this.scopeStack.length-1]}currentVarScopeFlags(){for(let t=this.scopeStack.length-1;;t--){let{flags:e}=this.scopeStack[t];if(e&387)return e}}currentThisScopeFlags(){for(let t=this.scopeStack.length-1;;t--){let{flags:e}=this.scopeStack[t];if(e&451&&!(e&4))return e}}},Ls=class extends je{constructor(...t){super(...t),this.declareFunctions=new Set}},Bs=class extends Ue{createScope(t){return new Ls(t)}declareName(t,e,s){let r=this.currentScope();if(e&2048){this.checkRedeclarationInScope(r,t,e,s),this.maybeExportDefined(r,t),r.declareFunctions.add(t);return}super.declareName(t,e,s)}isRedeclaredInScope(t,e,s){if(super.isRedeclaredInScope(t,e,s))return!0;if(s&2048&&!t.declareFunctions.has(e)){let r=t.names.get(e);return(r&4)>0||(r&2)>0}return!1}checkLocalExport(t){this.scopeStack[0].declareFunctions.has(t.name)||super.checkLocalExport(t)}},Ms=class{constructor(){this.sawUnambiguousESM=!1,this.ambiguousScriptDifferentAst=!1}sourceToOffsetPos(t){return t+this.startIndex}offsetToSourcePos(t){return t-this.startIndex}hasPlugin(t){if(typeof t=="string")return this.plugins.has(t);{let[e,s]=t;if(!this.hasPlugin(e))return!1;let r=this.plugins.get(e);for(let i of Object.keys(s))if((r==null?void 0:r[i])!==s[i])return!1;return!0}}getPluginOption(t,e){var s;return(s=this.plugins.get(t))==null?void 0:s[e]}};function ct(t,e){t.trailingComments===void 0?t.trailingComments=e:t.trailingComments.unshift(...e)}function Os(t,e){t.leadingComments===void 0?t.leadingComments=e:t.leadingComments.unshift(...e)}function pe(t,e){t.innerComments===void 0?t.innerComments=e:t.innerComments.unshift(...e)}function Q(t,e,s){let r=null,i=e.length;for(;r===null&&i>0;)r=e[--i];r===null||r.start>s.start?pe(t,s.comments):ct(r,s.comments)}var Rs=class extends Ms{addComment(t){this.filename&&(t.loc.filename=this.filename);let{commentsLen:e}=this.state;this.comments.length!==e&&(this.comments.length=e),this.comments.push(t),this.state.commentsLen++}processComment(t){let{commentStack:e}=this.state,s=e.length;if(s===0)return;let r=s-1,i=e[r];i.start===t.end&&(i.leadingNode=t,r--);let{start:a}=t;for(;r>=0;r--){let n=e[r],o=n.end;if(o>a)n.containingNode=t,this.finalizeComment(n),e.splice(r,1);else{o===a&&(n.trailingNode=t);break}}}finalizeComment(t){let{comments:e}=t;if(t.leadingNode!==null||t.trailingNode!==null)t.leadingNode!==null&&ct(t.leadingNode,e),t.trailingNode!==null&&Os(t.trailingNode,e);else{let{containingNode:s,start:r}=t;if(this.input.charCodeAt(this.offsetToSourcePos(r)-1)===44)switch(s.type){case"ObjectExpression":case"ObjectPattern":case"RecordExpression":Q(s,s.properties,t);break;case"CallExpression":case"OptionalCallExpression":Q(s,s.arguments,t);break;case"FunctionDeclaration":case"FunctionExpression":case"ArrowFunctionExpression":case"ObjectMethod":case"ClassMethod":case"ClassPrivateMethod":Q(s,s.params,t);break;case"ArrayExpression":case"ArrayPattern":case"TupleExpression":Q(s,s.elements,t);break;case"ExportNamedDeclaration":case"ImportDeclaration":Q(s,s.specifiers,t);break;case"TSEnumDeclaration":Q(s,s.members,t);break;case"TSEnumBody":Q(s,s.members,t);break;default:pe(s,e)}else pe(s,e)}}finalizeRemainingComments(){let{commentStack:t}=this.state;for(let e=t.length-1;e>=0;e--)this.finalizeComment(t[e]);this.state.commentStack=[]}resetPreviousNodeTrailingComments(t){let{commentStack:e}=this.state,{length:s}=e;if(s===0)return;let r=e[s-1];r.leadingNode===t&&(r.leadingNode=null)}resetPreviousIdentifierLeadingComments(t){let{commentStack:e}=this.state,{length:s}=e;s!==0&&(e[s-1].trailingNode===t?e[s-1].trailingNode=null:s>=2&&e[s-2].trailingNode===t&&(e[s-2].trailingNode=null))}takeSurroundingComments(t,e,s){let{commentStack:r}=this.state,i=r.length;if(i===0)return;let a=i-1;for(;a>=0;a--){let n=r[a],o=n.end;if(n.start===s)n.leadingNode=t;else if(o===e)n.trailingNode=t;else if(o0}set strict(e){e?this.flags|=1:this.flags&=-2}init({strictMode:e,sourceType:s,startIndex:r,startLine:i,startColumn:a}){this.strict=e===!1?!1:e===!0?!0:s==="module",this.startIndex=r,this.curLine=i,this.lineStart=-a,this.startLoc=this.endLoc=new m(i,a,r)}get maybeInArrowParameters(){return(this.flags&2)>0}set maybeInArrowParameters(e){e?this.flags|=2:this.flags&=-3}get inType(){return(this.flags&4)>0}set inType(e){e?this.flags|=4:this.flags&=-5}get noAnonFunctionType(){return(this.flags&8)>0}set noAnonFunctionType(e){e?this.flags|=8:this.flags&=-9}get hasFlowComment(){return(this.flags&16)>0}set hasFlowComment(e){e?this.flags|=16:this.flags&=-17}get isAmbientContext(){return(this.flags&32)>0}set isAmbientContext(e){e?this.flags|=32:this.flags&=-33}get inAbstractClass(){return(this.flags&64)>0}set inAbstractClass(e){e?this.flags|=64:this.flags&=-65}get inDisallowConditionalTypesContext(){return(this.flags&128)>0}set inDisallowConditionalTypesContext(e){e?this.flags|=128:this.flags&=-129}get soloAwait(){return(this.flags&256)>0}set soloAwait(e){e?this.flags|=256:this.flags&=-257}get inFSharpPipelineDirectBody(){return(this.flags&512)>0}set inFSharpPipelineDirectBody(e){e?this.flags|=512:this.flags&=-513}get canStartJSXElement(){return(this.flags&1024)>0}set canStartJSXElement(e){e?this.flags|=1024:this.flags&=-1025}get containsEsc(){return(this.flags&2048)>0}set containsEsc(e){e?this.flags|=2048:this.flags&=-2049}get hasTopLevelAwait(){return(this.flags&4096)>0}set hasTopLevelAwait(e){e?this.flags|=4096:this.flags&=-4097}curPosition(){return new m(this.curLine,this.pos-this.lineStart,this.pos+this.startIndex)}clone(){let e=new $t;return e.flags=this.flags,e.startIndex=this.startIndex,e.curLine=this.curLine,e.lineStart=this.lineStart,e.startLoc=this.startLoc,e.endLoc=this.endLoc,e.errors=this.errors.slice(),e.potentialArrowAt=this.potentialArrowAt,e.noArrowAt=this.noArrowAt.slice(),e.noArrowParamsConversionAt=this.noArrowParamsConversionAt.slice(),e.topicContext=this.topicContext,e.labels=this.labels.slice(),e.commentsLen=this.commentsLen,e.commentStack=this.commentStack.slice(),e.pos=this.pos,e.type=this.type,e.value=this.value,e.start=this.start,e.end=this.end,e.lastTokEndLoc=this.lastTokEndLoc,e.lastTokStartLoc=this.lastTokStartLoc,e.context=this.context.slice(),e.firstInvalidTemplateEscapePos=this.firstInvalidTemplateEscapePos,e.strictErrors=this.strictErrors,e.tokensLength=this.tokensLength,e}},Hs=function(t){return t>=48&&t<=57},mt={decBinOct:new Set([46,66,69,79,95,98,101,111]),hex:new Set([46,88,95,120])},Ae={bin:t=>t===48||t===49,oct:t=>t>=48&&t<=55,dec:t=>t>=48&&t<=57,hex:t=>t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102};function ft(t,e,s,r,i,a){let n=s,o=r,h=i,l="",d=null,y=s,{length:A}=e;for(;;){if(s>=A){a.unterminated(n,o,h),l+=e.slice(y,s);break}let T=e.charCodeAt(s);if(zs(t,T,e,s)){l+=e.slice(y,s);break}if(T===92){l+=e.slice(y,s);let N=Vs(e,s,r,i,t==="template",a);N.ch===null&&!d?d={pos:s,lineStart:r,curLine:i}:l+=N.ch,{pos:s,lineStart:r,curLine:i}=N,y=s}else T===8232||T===8233?(++s,++i,r=s):T===10||T===13?t==="template"?(l+=e.slice(y,s)+` `,++s,T===13&&e.charCodeAt(s)===10&&++s,++i,y=r=s):a.unterminated(n,o,h):++s}return{pos:s,str:l,firstInvalidLoc:d,lineStart:r,curLine:i,containsInvalid:!!d}}function zs(t,e,s,r){return t==="template"?e===96||e===36&&s.charCodeAt(r+1)===123:e===(t==="double"?34:39)}function Vs(t,e,s,r,i,a){let n=!i;e++;let o=l=>({pos:e,ch:l,lineStart:s,curLine:r}),h=t.charCodeAt(e++);switch(h){case 110:return o(` `);case 114:return o("\r");case 120:{let l;return{code:l,pos:e}=ze(t,e,s,r,2,!1,n,a),o(l===null?null:String.fromCharCode(l))}case 117:{let l;return{code:l,pos:e}=xt(t,e,s,r,n,a),o(l===null?null:String.fromCodePoint(l))}case 116:return o(" ");case 98:return o("\b");case 118:return o("\v");case 102:return o("\f");case 13:t.charCodeAt(e)===10&&++e;case 10:s=e,++r;case 8232:case 8233:return o("");case 56:case 57:if(i)return o(null);a.strictNumericEscape(e-1,s,r);default:if(h>=48&&h<=55){let l=e-1,d=/^[0-7]+/.exec(t.slice(l,e+2))[0],y=parseInt(d,8);y>255&&(d=d.slice(0,-1),y=parseInt(d,8)),e+=d.length-1;let A=t.charCodeAt(e);if(d!=="0"||A===56||A===57){if(i)return o(null);a.strictNumericEscape(l,s,r)}return o(String.fromCharCode(y))}return o(String.fromCharCode(h))}}function ze(t,e,s,r,i,a,n,o){let h=e,l;return{n:l,pos:e}=yt(t,e,s,r,16,i,a,!1,o,!n),l===null&&(n?o.invalidEscapeSequence(h,s,r):e=h-1),{code:l,pos:e}}function yt(t,e,s,r,i,a,n,o,h,l){let d=e,y=i===16?mt.hex:mt.decBinOct,A=i===16?Ae.hex:i===10?Ae.dec:i===8?Ae.oct:Ae.bin,T=!1,N=0;for(let L=0,F=a??1/0;L=97?j=B-97+10:B>=65?j=B-65+10:Hs(B)?j=B-48:j=1/0,j>=i){if(j<=9&&l)return{n:null,pos:e};if(j<=9&&h.invalidDigit(e,s,r,i))j=0;else if(n)j=0,T=!0;else break}++e,N=N*i+j}return e===d||a!=null&&e-d!==a||T?{n:null,pos:e}:{n:N,pos:e}}function xt(t,e,s,r,i,a){let n=t.charCodeAt(e),o;if(n===123){if(++e,{code:o,pos:e}=ze(t,e,s,r,t.indexOf("}",e)-e,!0,i,a),++e,o!==null&&o>1114111)if(i)a.invalidCodePoint(e,s,r);else return{code:null,pos:e}}else({code:o,pos:e}=ze(t,e,s,r,4,!1,i,a));return{code:o,pos:e}}function ue(t,e,s){return new m(s,t-e,t)}var qs=new Set([103,109,115,105,121,117,100,118]),X=class{constructor(t){let e=t.startIndex||0;this.type=t.type,this.value=t.value,this.start=e+t.start,this.end=e+t.end,this.loc=new x(t.startLoc,t.endLoc)}},$s=class extends Rs{constructor(t,e){super(),this.isLookahead=void 0,this.tokens=[],this.errorHandlers_readInt={invalidDigit:(s,r,i,a)=>this.optionFlags&1024?(this.raise(u.InvalidDigit,ue(s,r,i),{radix:a}),!0):!1,numericSeparatorInEscapeSequence:this.errorBuilder(u.NumericSeparatorInEscapeSequence),unexpectedNumericSeparator:this.errorBuilder(u.UnexpectedNumericSeparator)},this.errorHandlers_readCodePoint=Object.assign({},this.errorHandlers_readInt,{invalidEscapeSequence:this.errorBuilder(u.InvalidEscapeSequence),invalidCodePoint:this.errorBuilder(u.InvalidCodePoint)}),this.errorHandlers_readStringContents_string=Object.assign({},this.errorHandlers_readCodePoint,{strictNumericEscape:(s,r,i)=>{this.recordStrictModeErrors(u.StrictNumericEscape,ue(s,r,i))},unterminated:(s,r,i)=>{throw this.raise(u.UnterminatedString,ue(s-1,r,i))}}),this.errorHandlers_readStringContents_template=Object.assign({},this.errorHandlers_readCodePoint,{strictNumericEscape:this.errorBuilder(u.StrictNumericEscape),unterminated:(s,r,i)=>{throw this.raise(u.UnterminatedTemplate,ue(s,r,i))}}),this.state=new _s,this.state.init(t),this.input=e,this.length=e.length,this.comments=[],this.isLookahead=!1}pushToken(t){this.tokens.length=this.state.tokensLength,this.tokens.push(t),++this.state.tokensLength}next(){this.checkKeywordEscapes(),this.optionFlags&128&&this.pushToken(new X(this.state)),this.state.lastTokEndLoc=this.state.endLoc,this.state.lastTokStartLoc=this.state.startLoc,this.nextToken()}eat(t){return this.match(t)?(this.next(),!0):!1}match(t){return this.state.type===t}createLookaheadState(t){return{pos:t.pos,value:null,type:t.type,start:t.start,end:t.end,context:[this.curContext()],inType:t.inType,startLoc:t.startLoc,lastTokEndLoc:t.lastTokEndLoc,curLine:t.curLine,lineStart:t.lineStart,curPosition:t.curPosition}}lookahead(){let t=this.state;this.state=this.createLookaheadState(t),this.isLookahead=!0,this.nextToken(),this.isLookahead=!1;let e=this.state;return this.state=t,e}nextTokenStart(){return this.nextTokenStartSince(this.state.pos)}nextTokenStartSince(t){return _e.lastIndex=t,_e.test(this.input)?_e.lastIndex:t}lookaheadCharCode(){return this.input.charCodeAt(this.nextTokenStart())}nextTokenInLineStart(){return this.nextTokenInLineStartSince(this.state.pos)}nextTokenInLineStartSince(t){return He.lastIndex=t,He.test(this.input)?He.lastIndex:t}lookaheadInLineCharCode(){return this.input.charCodeAt(this.nextTokenInLineStart())}codePointAtPos(t){let e=this.input.charCodeAt(t);if((e&64512)===55296&&++tthis.raise(e,s)),this.state.strictErrors.clear())}curContext(){return this.state.context[this.state.context.length-1]}nextToken(){if(this.skipSpace(),this.state.start=this.state.pos,this.isLookahead||(this.state.startLoc=this.state.curPosition()),this.state.pos>=this.length){this.finishToken(140);return}this.getTokenFromCode(this.codePointAtPos(this.state.pos))}skipBlockComment(t){let e;this.isLookahead||(e=this.state.curPosition());let s=this.state.pos,r=this.input.indexOf(t,s+2);if(r===-1)throw this.raise(u.UnterminatedComment,this.state.curPosition());for(this.state.pos=r+t.length,Pe.lastIndex=s+2;Pe.test(this.input)&&Pe.lastIndex<=r;)++this.state.curLine,this.state.lineStart=Pe.lastIndex;if(this.isLookahead)return;let i={type:"CommentBlock",value:this.input.slice(s+2,r),start:this.sourceToOffsetPos(s),end:this.sourceToOffsetPos(r+t.length),loc:new x(e,this.state.curPosition())};return this.optionFlags&128&&this.pushToken(i),i}skipLineComment(t){let e=this.state.pos,s;this.isLookahead||(s=this.state.curPosition());let r=this.input.charCodeAt(this.state.pos+=t);if(this.state.post)){let i=this.skipLineComment(3);i!==void 0&&(this.addComment(i),e==null||e.push(i))}else break e}else if(s===60&&!this.inModule&&this.optionFlags&4096){let r=this.state.pos;if(this.input.charCodeAt(r+1)===33&&this.input.charCodeAt(r+2)===45&&this.input.charCodeAt(r+3)===45){let i=this.skipLineComment(4);i!==void 0&&(this.addComment(i),e==null||e.push(i))}else break e}else break e}}if((e==null?void 0:e.length)>0){let s=this.state.pos,r={start:this.sourceToOffsetPos(t),end:this.sourceToOffsetPos(s),comments:e,leadingNode:null,trailingNode:null,containingNode:null};this.state.commentStack.push(r)}}finishToken(t,e){this.state.end=this.state.pos,this.state.endLoc=this.state.curPosition();let s=this.state.type;this.state.type=t,this.state.value=e,this.isLookahead||this.updateContext(s)}replaceToken(t){this.state.type=t,this.updateContext()}readToken_numberSign(){if(this.state.pos===0&&this.readToken_interpreter())return;let t=this.state.pos+1,e=this.codePointAtPos(t);if(e>=48&&e<=57)throw this.raise(u.UnexpectedDigitAfterHash,this.state.curPosition());if(e===123||e===91&&this.hasPlugin("recordAndTuple")){if(this.expectPlugin("recordAndTuple"),this.getPluginOption("recordAndTuple","syntaxType")==="bar")throw this.raise(e===123?u.RecordExpressionHashIncorrectStartSyntaxType:u.TupleExpressionHashIncorrectStartSyntaxType,this.state.curPosition());this.state.pos+=2,e===123?this.finishToken(7):this.finishToken(1)}else q(e)?(++this.state.pos,this.finishToken(139,this.readWord1(e))):e===92?(++this.state.pos,this.finishToken(139,this.readWord1())):this.finishOp(27,1)}readToken_dot(){let t=this.input.charCodeAt(this.state.pos+1);if(t>=48&&t<=57){this.readNumber(!0);return}t===46&&this.input.charCodeAt(this.state.pos+2)===46?(this.state.pos+=3,this.finishToken(21)):(++this.state.pos,this.finishToken(16))}readToken_slash(){this.input.charCodeAt(this.state.pos+1)===61?this.finishOp(31,2):this.finishOp(56,1)}readToken_interpreter(){if(this.state.pos!==0||this.length<2)return!1;let t=this.input.charCodeAt(this.state.pos+1);if(t!==33)return!1;let e=this.state.pos;for(this.state.pos+=1;!se(t)&&++this.state.pos=48&&e<=57)?(this.state.pos+=2,this.finishToken(18)):(++this.state.pos,this.finishToken(17))}getTokenFromCode(t){switch(t){case 46:this.readToken_dot();return;case 40:++this.state.pos,this.finishToken(10);return;case 41:++this.state.pos,this.finishToken(11);return;case 59:++this.state.pos,this.finishToken(13);return;case 44:++this.state.pos,this.finishToken(12);return;case 91:if(this.hasPlugin("recordAndTuple")&&this.input.charCodeAt(this.state.pos+1)===124){if(this.getPluginOption("recordAndTuple","syntaxType")!=="bar")throw this.raise(u.TupleExpressionBarIncorrectStartSyntaxType,this.state.curPosition());this.state.pos+=2,this.finishToken(2)}else++this.state.pos,this.finishToken(0);return;case 93:++this.state.pos,this.finishToken(3);return;case 123:if(this.hasPlugin("recordAndTuple")&&this.input.charCodeAt(this.state.pos+1)===124){if(this.getPluginOption("recordAndTuple","syntaxType")!=="bar")throw this.raise(u.RecordExpressionBarIncorrectStartSyntaxType,this.state.curPosition());this.state.pos+=2,this.finishToken(6)}else++this.state.pos,this.finishToken(5);return;case 125:++this.state.pos,this.finishToken(8);return;case 58:this.hasPlugin("functionBind")&&this.input.charCodeAt(this.state.pos+1)===58?this.finishOp(15,2):(++this.state.pos,this.finishToken(14));return;case 63:this.readToken_question();return;case 96:this.readTemplateToken();return;case 48:{let e=this.input.charCodeAt(this.state.pos+1);if(e===120||e===88){this.readRadixNumber(16);return}if(e===111||e===79){this.readRadixNumber(8);return}if(e===98||e===66){this.readRadixNumber(2);return}}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:this.readNumber(!1);return;case 34:case 39:this.readString(t);return;case 47:this.readToken_slash();return;case 37:case 42:this.readToken_mult_modulo(t);return;case 124:case 38:this.readToken_pipe_amp(t);return;case 94:this.readToken_caret();return;case 43:case 45:this.readToken_plus_min(t);return;case 60:this.readToken_lt();return;case 62:this.readToken_gt();return;case 61:case 33:this.readToken_eq_excl(t);return;case 126:this.finishOp(36,1);return;case 64:this.readToken_atSign();return;case 35:this.readToken_numberSign();return;case 92:this.readWord();return;default:if(q(t)){this.readWord(t);return}}throw this.raise(u.InvalidOrUnexpectedToken,this.state.curPosition(),{unexpected:String.fromCodePoint(t)})}finishOp(t,e){let s=this.input.slice(this.state.pos,this.state.pos+e);this.state.pos+=e,this.finishToken(t,s)}readRegexp(){let t=this.state.startLoc,e=this.state.start+1,s,r,{pos:i}=this.state;for(;;++i){if(i>=this.length)throw this.raise(u.UnterminatedRegExp,f(t,1));let h=this.input.charCodeAt(i);if(se(h))throw this.raise(u.UnterminatedRegExp,f(t,1));if(s)s=!1;else{if(h===91)r=!0;else if(h===93&&r)r=!1;else if(h===47&&!r)break;s=h===92}}let a=this.input.slice(e,i);++i;let n="",o=()=>f(t,i+2-e);for(;i=2&&this.input.charCodeAt(e)===48;if(o){let A=this.input.slice(e,this.state.pos);if(this.recordStrictModeErrors(u.StrictOctalLiteral,s),!this.state.strict){let T=A.indexOf("_");T>0&&this.raise(u.ZeroDigitNumericSeparator,f(s,T))}n=o&&!/[89]/.test(A)}let h=this.input.charCodeAt(this.state.pos);if(h===46&&!n&&(++this.state.pos,this.readInt(10),r=!0,h=this.input.charCodeAt(this.state.pos)),(h===69||h===101)&&!n&&(h=this.input.charCodeAt(++this.state.pos),(h===43||h===45)&&++this.state.pos,this.readInt(10)===null&&this.raise(u.InvalidOrMissingExponent,s),r=!0,a=!0,h=this.input.charCodeAt(this.state.pos)),h===110&&((r||o)&&this.raise(u.InvalidBigIntLiteral,s),++this.state.pos,i=!0),h===109){this.expectPlugin("decimal",this.state.curPosition()),(a||o)&&this.raise(u.InvalidDecimal,s),++this.state.pos;var l=!0}if(q(this.codePointAtPos(this.state.pos)))throw this.raise(u.NumberIdentifier,this.state.curPosition());let d=this.input.slice(e,this.state.pos).replace(/[_mn]/g,"");if(i){this.finishToken(136,d);return}if(l){this.finishToken(137,d);return}let y=n?parseInt(d,8):parseFloat(d);this.finishToken(135,y)}readCodePoint(t){let{code:e,pos:s}=xt(this.input,this.state.pos,this.state.lineStart,this.state.curLine,t,this.errorHandlers_readCodePoint);return this.state.pos=s,e}readString(t){let{str:e,pos:s,curLine:r,lineStart:i}=ft(t===34?"double":"single",this.input,this.state.pos+1,this.state.lineStart,this.state.curLine,this.errorHandlers_readStringContents_string);this.state.pos=s+1,this.state.lineStart=i,this.state.curLine=r,this.finishToken(134,e)}readTemplateContinuation(){this.match(8)||this.unexpected(null,8),this.state.pos--,this.readTemplateToken()}readTemplateToken(){let t=this.input[this.state.pos],{str:e,firstInvalidLoc:s,pos:r,curLine:i,lineStart:a}=ft("template",this.input,this.state.pos+1,this.state.lineStart,this.state.curLine,this.errorHandlers_readStringContents_template);this.state.pos=r+1,this.state.lineStart=a,this.state.curLine=i,s&&(this.state.firstInvalidTemplateEscapePos=new m(s.curLine,s.pos-s.lineStart,this.sourceToOffsetPos(s.pos))),this.input.codePointAt(r)===96?this.finishToken(24,s?null:t+e+"`"):(this.state.pos++,this.finishToken(25,s?null:t+e+"${"))}recordStrictModeErrors(t,e){let s=e.index;this.state.strict&&!this.state.strictErrors.has(s)?this.raise(t,e):this.state.strictErrors.set(s,[t,e])}readWord1(t){this.state.containsEsc=!1;let e="",s=this.state.pos,r=this.state.pos;for(t!==void 0&&(this.state.pos+=t<=65535?1:2);this.state.pos=0;n--){let o=a[n];if(o.loc.index===i)return a[n]=t(r,s);if(o.loc.indexthis.hasPlugin(e)))throw this.raise(u.MissingOneOfPlugins,this.state.startLoc,{missingPlugin:t})}errorBuilder(t){return(e,s,r)=>{this.raise(t,ue(e,s,r))}}},Ks=class{constructor(){this.privateNames=new Set,this.loneAccessors=new Map,this.undefinedPrivateNames=new Map}},Js=class{constructor(t){this.parser=void 0,this.stack=[],this.undefinedPrivateNames=new Map,this.parser=t}current(){return this.stack[this.stack.length-1]}enter(){this.stack.push(new Ks)}exit(){let t=this.stack.pop(),e=this.current();for(let[s,r]of Array.from(t.undefinedPrivateNames))e?e.undefinedPrivateNames.has(s)||e.undefinedPrivateNames.set(s,r):this.parser.raise(u.InvalidPrivateFieldResolution,r,{identifierName:s})}declarePrivateName(t,e,s){let{privateNames:r,loneAccessors:i,undefinedPrivateNames:a}=this.current(),n=r.has(t);if(e&3){let o=n&&i.get(t);if(o){let h=o&4,l=e&4,d=o&3,y=e&3;n=d===y||h!==l,n||i.delete(t)}else n||i.set(t,e)}n&&this.parser.raise(u.PrivateNameRedeclaration,s,{identifierName:t}),r.add(t),a.delete(t)}usePrivateName(t,e){let s;for(s of this.stack)if(s.privateNames.has(t))return;s?s.undefinedPrivateNames.set(t,e):this.parser.raise(u.InvalidPrivateFieldResolution,e,{identifierName:t})}},ge=class{constructor(t=0){this.type=t}canBeArrowParameterDeclaration(){return this.type===2||this.type===1}isCertainlyParameterDeclaration(){return this.type===3}},Pt=class extends ge{constructor(t){super(t),this.declarationErrors=new Map}recordDeclarationError(t,e){let s=e.index;this.declarationErrors.set(s,[t,e])}clearDeclarationError(t){this.declarationErrors.delete(t)}iterateErrors(t){this.declarationErrors.forEach(t)}},Ws=class{constructor(t){this.parser=void 0,this.stack=[new ge],this.parser=t}enter(t){this.stack.push(t)}exit(){this.stack.pop()}recordParameterInitializerError(t,e){let s=e.loc.start,{stack:r}=this,i=r.length-1,a=r[i];for(;!a.isCertainlyParameterDeclaration();){if(a.canBeArrowParameterDeclaration())a.recordDeclarationError(t,s);else return;a=r[--i]}this.parser.raise(t,s)}recordArrowParameterBindingError(t,e){let{stack:s}=this,r=s[s.length-1],i=e.loc.start;if(r.isCertainlyParameterDeclaration())this.parser.raise(t,i);else if(r.canBeArrowParameterDeclaration())r.recordDeclarationError(t,i);else return}recordAsyncArrowParametersError(t){let{stack:e}=this,s=e.length-1,r=e[s];for(;r.canBeArrowParameterDeclaration();)r.type===2&&r.recordDeclarationError(u.AwaitBindingIdentifier,t),r=e[--s]}validateAsPattern(){let{stack:t}=this,e=t[t.length-1];e.canBeArrowParameterDeclaration()&&e.iterateErrors(([s,r])=>{this.parser.raise(s,r);let i=t.length-2,a=t[i];for(;a.canBeArrowParameterDeclaration();)a.clearDeclarationError(r.index),a=t[--i]})}};function Xs(){return new ge(3)}function Gs(){return new Pt(1)}function Ys(){return new Pt(2)}function At(){return new ge}var Qs=class{constructor(){this.stacks=[]}enter(t){this.stacks.push(t)}exit(){this.stacks.pop()}currentFlags(){return this.stacks[this.stacks.length-1]}get hasAwait(){return(this.currentFlags()&2)>0}get hasYield(){return(this.currentFlags()&1)>0}get hasReturn(){return(this.currentFlags()&4)>0}get hasIn(){return(this.currentFlags()&8)>0}};function Te(t,e){return(t?2:0)|(e?1:0)}var Zs=class extends $s{addExtra(t,e,s,r=!0){if(!t)return;let{extra:i}=t;i==null&&(i={},t.extra=i),r?i[e]=s:Object.defineProperty(i,e,{enumerable:r,value:s})}isContextual(t){return this.state.type===t&&!this.state.containsEsc}isUnparsedContextual(t,e){let s=t+e.length;if(this.input.slice(t,s)===e){let r=this.input.charCodeAt(s);return!(te(r)||(r&64512)===55296)}return!1}isLookaheadContextual(t){let e=this.nextTokenStart();return this.isUnparsedContextual(e,t)}eatContextual(t){return this.isContextual(t)?(this.next(),!0):!1}expectContextual(t,e){if(!this.eatContextual(t)){if(e!=null)throw this.raise(e,this.state.startLoc);this.unexpected(null,t)}}canInsertSemicolon(){return this.match(140)||this.match(8)||this.hasPrecedingLineBreak()}hasPrecedingLineBreak(){return dt(this.input,this.offsetToSourcePos(this.state.lastTokEndLoc.index),this.state.start)}hasFollowingLineBreak(){return dt(this.input,this.state.end,this.nextTokenStart())}isLineTerminator(){return this.eat(13)||this.canInsertSemicolon()}semicolon(t=!0){(t?this.isLineTerminator():this.eat(13))||this.raise(u.MissingSemicolon,this.state.lastTokEndLoc)}expect(t,e){this.eat(t)||this.unexpected(e,t)}tryParse(t,e=this.state.clone()){let s={node:null};try{let r=t((i=null)=>{throw s.node=i,s});if(this.state.errors.length>e.errors.length){let i=this.state;return this.state=e,this.state.tokensLength=i.tokensLength,{node:r,error:i.errors[e.errors.length],thrown:!1,aborted:!1,failState:i}}return{node:r,error:null,thrown:!1,aborted:!1,failState:null}}catch(r){let i=this.state;if(this.state=e,r instanceof SyntaxError)return{node:null,error:r,thrown:!0,aborted:!1,failState:i};if(r===s)return{node:s.node,error:null,thrown:!1,aborted:!0,failState:i};throw r}}checkExpressionErrors(t,e){if(!t)return!1;let{shorthandAssignLoc:s,doubleProtoLoc:r,privateKeyLoc:i,optionalParametersLoc:a}=t,n=!!s||!!r||!!a||!!i;if(!e)return n;s!=null&&this.raise(u.InvalidCoverInitializedName,s),r!=null&&this.raise(u.DuplicateProto,r),i!=null&&this.raise(u.UnexpectedPrivateField,i),a!=null&&this.unexpected(a)}isLiteralPropertyName(){return it(this.state.type)}isPrivateName(t){return t.type==="PrivateName"}getPrivateNameSV(t){return t.id.name}hasPropertyAsPrivateName(t){return(t.type==="MemberExpression"||t.type==="OptionalMemberExpression")&&this.isPrivateName(t.property)}isObjectProperty(t){return t.type==="ObjectProperty"}isObjectMethod(t){return t.type==="ObjectMethod"}initializeScopes(t=this.options.sourceType==="module"){let e=this.state.labels;this.state.labels=[];let s=this.exportedIdentifiers;this.exportedIdentifiers=new Set;let r=this.inModule;this.inModule=t;let i=this.scope,a=this.getScopeHandler();this.scope=new a(this,t);let n=this.prodParam;this.prodParam=new Qs;let o=this.classScope;this.classScope=new Js(this);let h=this.expressionScope;return this.expressionScope=new Ws(this),()=>{this.state.labels=e,this.exportedIdentifiers=s,this.inModule=r,this.scope=i,this.prodParam=n,this.classScope=o,this.expressionScope=h}}enterInitialScopes(){let t=0;this.inModule&&(t|=2),this.scope.enter(1),this.prodParam.enter(t)}checkDestructuringPrivate(t){let{privateKeyLoc:e}=t;e!==null&&this.expectPlugin("destructuringPrivate",e)}},be=class{constructor(){this.shorthandAssignLoc=null,this.doubleProtoLoc=null,this.privateKeyLoc=null,this.optionalParametersLoc=null}},Ee=class{constructor(t,e,s){this.type="",this.start=e,this.end=0,this.loc=new x(s),(t==null?void 0:t.optionFlags)&64&&(this.range=[e,0]),t!=null&&t.filename&&(this.loc.filename=t.filename)}},Ve=Ee.prototype;Ve.__clone=function(){let t=new Ee(void 0,this.start,this.loc.start),e=Object.keys(this);for(let s=0,r=e.length;s`Cannot overwrite reserved type ${t}.`,DeclareClassElement:"The `declare` modifier can only appear on class fields.",DeclareClassFieldInitializer:"Initializers are not allowed in fields with the `declare` modifier.",DuplicateDeclareModuleExports:"Duplicate `declare module.exports` statement.",EnumBooleanMemberNotInitialized:({memberName:t,enumName:e})=>`Boolean enum members need to be initialized. Use either \`${t} = true,\` or \`${t} = false,\` in enum \`${e}\`.`,EnumDuplicateMemberName:({memberName:t,enumName:e})=>`Enum member names need to be unique, but the name \`${t}\` has already been used before in enum \`${e}\`.`,EnumInconsistentMemberValues:({enumName:t})=>`Enum \`${t}\` has inconsistent member initializers. Either use no initializers, or consistently use literals (either booleans, numbers, or strings) for all member initializers.`,EnumInvalidExplicitType:({invalidEnumType:t,enumName:e})=>`Enum type \`${t}\` is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${e}\`.`,EnumInvalidExplicitTypeUnknownSupplied:({enumName:t})=>`Supplied enum type is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${t}\`.`,EnumInvalidMemberInitializerPrimaryType:({enumName:t,memberName:e,explicitType:s})=>`Enum \`${t}\` has type \`${s}\`, so the initializer of \`${e}\` needs to be a ${s} literal.`,EnumInvalidMemberInitializerSymbolType:({enumName:t,memberName:e})=>`Symbol enum members cannot be initialized. Use \`${e},\` in enum \`${t}\`.`,EnumInvalidMemberInitializerUnknownType:({enumName:t,memberName:e})=>`The enum member initializer for \`${e}\` needs to be a literal (either a boolean, number, or string) in enum \`${t}\`.`,EnumInvalidMemberName:({enumName:t,memberName:e,suggestion:s})=>`Enum member names cannot start with lowercase 'a' through 'z'. Instead of using \`${e}\`, consider using \`${s}\`, in enum \`${t}\`.`,EnumNumberMemberNotInitialized:({enumName:t,memberName:e})=>`Number enum members need to be initialized, e.g. \`${e} = 1\` in enum \`${t}\`.`,EnumStringMemberInconsistentlyInitialized:({enumName:t})=>`String enum members need to consistently either all use initializers, or use no initializers, in enum \`${t}\`.`,GetterMayNotHaveThisParam:"A getter cannot have a `this` parameter.",ImportReflectionHasImportType:"An `import module` declaration can not use `type` or `typeof` keyword.",ImportTypeShorthandOnlyInPureImport:"The `type` and `typeof` keywords on named imports can only be used on regular `import` statements. It cannot be used with `import type` or `import typeof` statements.",InexactInsideExact:"Explicit inexact syntax cannot appear inside an explicit exact object type.",InexactInsideNonObject:"Explicit inexact syntax cannot appear in class or interface definitions.",InexactVariance:"Explicit inexact syntax cannot have variance.",InvalidNonTypeImportInDeclareModule:"Imports within a `declare module` body must always be `import type` or `import typeof`.",MissingTypeParamDefault:"Type parameter declaration needs a default, since a preceding type parameter declaration has a default.",NestedDeclareModule:"`declare module` cannot be used inside another `declare module`.",NestedFlowComment:"Cannot have a flow comment inside another flow comment.",PatternIsOptional:Object.assign({message:"A binding pattern parameter cannot be optional in an implementation signature."},{reasonCode:"OptionalBindingPattern"}),SetterMayNotHaveThisParam:"A setter cannot have a `this` parameter.",SpreadVariance:"Spread properties cannot have variance.",ThisParamAnnotationRequired:"A type annotation is required for the `this` parameter.",ThisParamBannedInConstructor:"Constructors cannot have a `this` parameter; constructors don't bind `this` like other functions.",ThisParamMayNotBeOptional:"The `this` parameter cannot be optional.",ThisParamMustBeFirst:"The `this` parameter must be the first function parameter.",ThisParamNoDefault:"The `this` parameter may not have a default value.",TypeBeforeInitializer:"Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.",TypeCastInPattern:"The type cast expression is expected to be wrapped with parenthesis.",UnexpectedExplicitInexactInObject:"Explicit inexact syntax must appear at the end of an inexact object.",UnexpectedReservedType:({reservedType:t})=>`Unexpected reserved type ${t}.`,UnexpectedReservedUnderscore:"`_` is only allowed as a type argument to call or new.",UnexpectedSpaceBetweenModuloChecks:"Spaces between `%` and `checks` are not allowed here.",UnexpectedSpreadType:"Spread operator cannot appear in class or interface definitions.",UnexpectedSubtractionOperand:'Unexpected token, expected "number" or "bigint".',UnexpectedTokenAfterTypeParameter:"Expected an arrow function after this type parameter declaration.",UnexpectedTypeParameterBeforeAsyncArrowFunction:"Type parameters must come after the async keyword, e.g. instead of ` async () => {}`, use `async () => {}`.",UnsupportedDeclareExportKind:({unsupportedExportKind:t,suggestion:e})=>`\`declare export ${t}\` is not supported. Use \`${e}\` instead.`,UnsupportedStatementInDeclareModule:"Only declares and type imports are allowed inside declare module.",UnterminatedFlowComment:"Unterminated flow-comment."});function ir(t){return t.type==="DeclareExportAllDeclaration"||t.type==="DeclareExportDeclaration"&&(!t.declaration||t.declaration.type!=="TypeAlias"&&t.declaration.type!=="InterfaceDeclaration")}function gt(t){return t.importKind==="type"||t.importKind==="typeof"}var ar={const:"declare export var",let:"declare export var",type:"export type",interface:"export interface"};function nr(t,e){let s=[],r=[];for(let i=0;iclass extends t{constructor(...e){super(...e),this.flowPragma=void 0}getScopeHandler(){return Bs}shouldParseTypes(){return this.getPluginOption("flow","all")||this.flowPragma==="flow"}finishToken(e,s){e!==134&&e!==13&&e!==28&&this.flowPragma===void 0&&(this.flowPragma=null),super.finishToken(e,s)}addComment(e){if(this.flowPragma===void 0){let s=or.exec(e.value);if(s)if(s[1]==="flow")this.flowPragma="flow";else if(s[1]==="noflow")this.flowPragma="noflow";else throw new Error("Unexpected flow pragma")}super.addComment(e)}flowParseTypeInitialiser(e){let s=this.state.inType;this.state.inType=!0,this.expect(e||14);let r=this.flowParseType();return this.state.inType=s,r}flowParsePredicate(){let e=this.startNode(),s=this.state.startLoc;return this.next(),this.expectContextual(110),this.state.lastTokStartLoc.index>s.index+1&&this.raise(E.UnexpectedSpaceBetweenModuloChecks,s),this.eat(10)?(e.value=super.parseExpression(),this.expect(11),this.finishNode(e,"DeclaredPredicate")):this.finishNode(e,"InferredPredicate")}flowParseTypeAndPredicateInitialiser(){let e=this.state.inType;this.state.inType=!0,this.expect(14);let s=null,r=null;return this.match(54)?(this.state.inType=e,r=this.flowParsePredicate()):(s=this.flowParseType(),this.state.inType=e,this.match(54)&&(r=this.flowParsePredicate())),[s,r]}flowParseDeclareClass(e){return this.next(),this.flowParseInterfaceish(e,!0),this.finishNode(e,"DeclareClass")}flowParseDeclareFunction(e){this.next();let s=e.id=this.parseIdentifier(),r=this.startNode(),i=this.startNode();this.match(47)?r.typeParameters=this.flowParseTypeParameterDeclaration():r.typeParameters=null,this.expect(10);let a=this.flowParseFunctionTypeParams();return r.params=a.params,r.rest=a.rest,r.this=a._this,this.expect(11),[r.returnType,e.predicate]=this.flowParseTypeAndPredicateInitialiser(),i.typeAnnotation=this.finishNode(r,"FunctionTypeAnnotation"),s.typeAnnotation=this.finishNode(i,"TypeAnnotation"),this.resetEndLocation(s),this.semicolon(),this.scope.declareName(e.id.name,2048,e.id.loc.start),this.finishNode(e,"DeclareFunction")}flowParseDeclare(e,s){if(this.match(80))return this.flowParseDeclareClass(e);if(this.match(68))return this.flowParseDeclareFunction(e);if(this.match(74))return this.flowParseDeclareVariable(e);if(this.eatContextual(127))return this.match(16)?this.flowParseDeclareModuleExports(e):(s&&this.raise(E.NestedDeclareModule,this.state.lastTokStartLoc),this.flowParseDeclareModule(e));if(this.isContextual(130))return this.flowParseDeclareTypeAlias(e);if(this.isContextual(131))return this.flowParseDeclareOpaqueType(e);if(this.isContextual(129))return this.flowParseDeclareInterface(e);if(this.match(82))return this.flowParseDeclareExportDeclaration(e,s);this.unexpected()}flowParseDeclareVariable(e){return this.next(),e.id=this.flowParseTypeAnnotatableIdentifier(!0),this.scope.declareName(e.id.name,5,e.id.loc.start),this.semicolon(),this.finishNode(e,"DeclareVariable")}flowParseDeclareModule(e){this.scope.enter(0),this.match(134)?e.id=super.parseExprAtom():e.id=this.parseIdentifier();let s=e.body=this.startNode(),r=s.body=[];for(this.expect(5);!this.match(8);){let n=this.startNode();this.match(83)?(this.next(),!this.isContextual(130)&&!this.match(87)&&this.raise(E.InvalidNonTypeImportInDeclareModule,this.state.lastTokStartLoc),super.parseImport(n)):(this.expectContextual(125,E.UnsupportedStatementInDeclareModule),n=this.flowParseDeclare(n,!0)),r.push(n)}this.scope.exit(),this.expect(8),this.finishNode(s,"BlockStatement");let i=null,a=!1;return r.forEach(n=>{ir(n)?(i==="CommonJS"&&this.raise(E.AmbiguousDeclareModuleKind,n),i="ES"):n.type==="DeclareModuleExports"&&(a&&this.raise(E.DuplicateDeclareModuleExports,n),i==="ES"&&this.raise(E.AmbiguousDeclareModuleKind,n),i="CommonJS",a=!0)}),e.kind=i||"CommonJS",this.finishNode(e,"DeclareModule")}flowParseDeclareExportDeclaration(e,s){if(this.expect(82),this.eat(65))return this.match(68)||this.match(80)?e.declaration=this.flowParseDeclare(this.startNode()):(e.declaration=this.flowParseType(),this.semicolon()),e.default=!0,this.finishNode(e,"DeclareExportDeclaration");if(this.match(75)||this.isLet()||(this.isContextual(130)||this.isContextual(129))&&!s){let r=this.state.value;throw this.raise(E.UnsupportedDeclareExportKind,this.state.startLoc,{unsupportedExportKind:r,suggestion:ar[r]})}if(this.match(74)||this.match(68)||this.match(80)||this.isContextual(131))return e.declaration=this.flowParseDeclare(this.startNode()),e.default=!1,this.finishNode(e,"DeclareExportDeclaration");if(this.match(55)||this.match(5)||this.isContextual(129)||this.isContextual(130)||this.isContextual(131))return e=this.parseExport(e,null),e.type==="ExportNamedDeclaration"&&(e.type="ExportDeclaration",e.default=!1,delete e.exportKind),e.type="Declare"+e.type,e;this.unexpected()}flowParseDeclareModuleExports(e){return this.next(),this.expectContextual(111),e.typeAnnotation=this.flowParseTypeAnnotation(),this.semicolon(),this.finishNode(e,"DeclareModuleExports")}flowParseDeclareTypeAlias(e){this.next();let s=this.flowParseTypeAlias(e);return s.type="DeclareTypeAlias",s}flowParseDeclareOpaqueType(e){this.next();let s=this.flowParseOpaqueType(e,!0);return s.type="DeclareOpaqueType",s}flowParseDeclareInterface(e){return this.next(),this.flowParseInterfaceish(e,!1),this.finishNode(e,"DeclareInterface")}flowParseInterfaceish(e,s){if(e.id=this.flowParseRestrictedIdentifier(!s,!0),this.scope.declareName(e.id.name,s?17:8201,e.id.loc.start),this.match(47)?e.typeParameters=this.flowParseTypeParameterDeclaration():e.typeParameters=null,e.extends=[],this.eat(81))do e.extends.push(this.flowParseInterfaceExtends());while(!s&&this.eat(12));if(s){if(e.implements=[],e.mixins=[],this.eatContextual(117))do e.mixins.push(this.flowParseInterfaceExtends());while(this.eat(12));if(this.eatContextual(113))do e.implements.push(this.flowParseInterfaceExtends());while(this.eat(12))}e.body=this.flowParseObjectType({allowStatic:s,allowExact:!1,allowSpread:!1,allowProto:s,allowInexact:!1})}flowParseInterfaceExtends(){let e=this.startNode();return e.id=this.flowParseQualifiedTypeIdentifier(),this.match(47)?e.typeParameters=this.flowParseTypeParameterInstantiation():e.typeParameters=null,this.finishNode(e,"InterfaceExtends")}flowParseInterface(e){return this.flowParseInterfaceish(e,!1),this.finishNode(e,"InterfaceDeclaration")}checkNotUnderscore(e){e==="_"&&this.raise(E.UnexpectedReservedUnderscore,this.state.startLoc)}checkReservedType(e,s,r){rr.has(e)&&this.raise(r?E.AssignReservedType:E.UnexpectedReservedType,s,{reservedType:e})}flowParseRestrictedIdentifier(e,s){return this.checkReservedType(this.state.value,this.state.startLoc,s),this.parseIdentifier(e)}flowParseTypeAlias(e){return e.id=this.flowParseRestrictedIdentifier(!1,!0),this.scope.declareName(e.id.name,8201,e.id.loc.start),this.match(47)?e.typeParameters=this.flowParseTypeParameterDeclaration():e.typeParameters=null,e.right=this.flowParseTypeInitialiser(29),this.semicolon(),this.finishNode(e,"TypeAlias")}flowParseOpaqueType(e,s){return this.expectContextual(130),e.id=this.flowParseRestrictedIdentifier(!0,!0),this.scope.declareName(e.id.name,8201,e.id.loc.start),this.match(47)?e.typeParameters=this.flowParseTypeParameterDeclaration():e.typeParameters=null,e.supertype=null,this.match(14)&&(e.supertype=this.flowParseTypeInitialiser(14)),e.impltype=null,s||(e.impltype=this.flowParseTypeInitialiser(29)),this.semicolon(),this.finishNode(e,"OpaqueType")}flowParseTypeParameter(e=!1){let s=this.state.startLoc,r=this.startNode(),i=this.flowParseVariance(),a=this.flowParseTypeAnnotatableIdentifier();return r.name=a.name,r.variance=i,r.bound=a.typeAnnotation,this.match(29)?(this.eat(29),r.default=this.flowParseType()):e&&this.raise(E.MissingTypeParamDefault,s),this.finishNode(r,"TypeParameter")}flowParseTypeParameterDeclaration(){let e=this.state.inType,s=this.startNode();s.params=[],this.state.inType=!0,this.match(47)||this.match(143)?this.next():this.unexpected();let r=!1;do{let i=this.flowParseTypeParameter(r);s.params.push(i),i.default&&(r=!0),this.match(48)||this.expect(12)}while(!this.match(48));return this.expect(48),this.state.inType=e,this.finishNode(s,"TypeParameterDeclaration")}flowInTopLevelContext(e){if(this.curContext()!==k.brace){let s=this.state.context;this.state.context=[s[0]];try{return e()}finally{this.state.context=s}}else return e()}flowParseTypeParameterInstantiationInExpression(){if(this.reScan_lt()===47)return this.flowParseTypeParameterInstantiation()}flowParseTypeParameterInstantiation(){let e=this.startNode(),s=this.state.inType;return this.state.inType=!0,e.params=[],this.flowInTopLevelContext(()=>{this.expect(47);let r=this.state.noAnonFunctionType;for(this.state.noAnonFunctionType=!1;!this.match(48);)e.params.push(this.flowParseType()),this.match(48)||this.expect(12);this.state.noAnonFunctionType=r}),this.state.inType=s,!this.state.inType&&this.curContext()===k.brace&&this.reScan_lt_gt(),this.expect(48),this.finishNode(e,"TypeParameterInstantiation")}flowParseTypeParameterInstantiationCallOrNew(){if(this.reScan_lt()!==47)return;let e=this.startNode(),s=this.state.inType;for(e.params=[],this.state.inType=!0,this.expect(47);!this.match(48);)e.params.push(this.flowParseTypeOrImplicitInstantiation()),this.match(48)||this.expect(12);return this.expect(48),this.state.inType=s,this.finishNode(e,"TypeParameterInstantiation")}flowParseInterfaceType(){let e=this.startNode();if(this.expectContextual(129),e.extends=[],this.eat(81))do e.extends.push(this.flowParseInterfaceExtends());while(this.eat(12));return e.body=this.flowParseObjectType({allowStatic:!1,allowExact:!1,allowSpread:!1,allowProto:!1,allowInexact:!1}),this.finishNode(e,"InterfaceTypeAnnotation")}flowParseObjectPropertyKey(){return this.match(135)||this.match(134)?super.parseExprAtom():this.parseIdentifier(!0)}flowParseObjectTypeIndexer(e,s,r){return e.static=s,this.lookahead().type===14?(e.id=this.flowParseObjectPropertyKey(),e.key=this.flowParseTypeInitialiser()):(e.id=null,e.key=this.flowParseType()),this.expect(3),e.value=this.flowParseTypeInitialiser(),e.variance=r,this.finishNode(e,"ObjectTypeIndexer")}flowParseObjectTypeInternalSlot(e,s){return e.static=s,e.id=this.flowParseObjectPropertyKey(),this.expect(3),this.expect(3),this.match(47)||this.match(10)?(e.method=!0,e.optional=!1,e.value=this.flowParseObjectTypeMethodish(this.startNodeAt(e.loc.start))):(e.method=!1,this.eat(17)&&(e.optional=!0),e.value=this.flowParseTypeInitialiser()),this.finishNode(e,"ObjectTypeInternalSlot")}flowParseObjectTypeMethodish(e){for(e.params=[],e.rest=null,e.typeParameters=null,e.this=null,this.match(47)&&(e.typeParameters=this.flowParseTypeParameterDeclaration()),this.expect(10),this.match(78)&&(e.this=this.flowParseFunctionTypeParam(!0),e.this.name=null,this.match(11)||this.expect(12));!this.match(11)&&!this.match(21);)e.params.push(this.flowParseFunctionTypeParam(!1)),this.match(11)||this.expect(12);return this.eat(21)&&(e.rest=this.flowParseFunctionTypeParam(!1)),this.expect(11),e.returnType=this.flowParseTypeInitialiser(),this.finishNode(e,"FunctionTypeAnnotation")}flowParseObjectTypeCallProperty(e,s){let r=this.startNode();return e.static=s,e.value=this.flowParseObjectTypeMethodish(r),this.finishNode(e,"ObjectTypeCallProperty")}flowParseObjectType({allowStatic:e,allowExact:s,allowSpread:r,allowProto:i,allowInexact:a}){let n=this.state.inType;this.state.inType=!0;let o=this.startNode();o.callProperties=[],o.properties=[],o.indexers=[],o.internalSlots=[];let h,l,d=!1;for(s&&this.match(6)?(this.expect(6),h=9,l=!0):(this.expect(5),h=8,l=!1),o.exact=l;!this.match(h);){let A=!1,T=null,N=null,L=this.startNode();if(i&&this.isContextual(118)){let B=this.lookahead();B.type!==14&&B.type!==17&&(this.next(),T=this.state.startLoc,e=!1)}if(e&&this.isContextual(106)){let B=this.lookahead();B.type!==14&&B.type!==17&&(this.next(),A=!0)}let F=this.flowParseVariance();if(this.eat(0))T!=null&&this.unexpected(T),this.eat(0)?(F&&this.unexpected(F.loc.start),o.internalSlots.push(this.flowParseObjectTypeInternalSlot(L,A))):o.indexers.push(this.flowParseObjectTypeIndexer(L,A,F));else if(this.match(10)||this.match(47))T!=null&&this.unexpected(T),F&&this.unexpected(F.loc.start),o.callProperties.push(this.flowParseObjectTypeCallProperty(L,A));else{let B="init";if(this.isContextual(99)||this.isContextual(104)){let Ke=this.lookahead();it(Ke.type)&&(B=this.state.value,this.next())}let j=this.flowParseObjectTypeProperty(L,A,T,F,B,r,a??!l);j===null?(d=!0,N=this.state.lastTokStartLoc):o.properties.push(j)}this.flowObjectTypeSemicolon(),N&&!this.match(8)&&!this.match(9)&&this.raise(E.UnexpectedExplicitInexactInObject,N)}this.expect(h),r&&(o.inexact=d);let y=this.finishNode(o,"ObjectTypeAnnotation");return this.state.inType=n,y}flowParseObjectTypeProperty(e,s,r,i,a,n,o){if(this.eat(21))return this.match(12)||this.match(13)||this.match(8)||this.match(9)?(n?o||this.raise(E.InexactInsideExact,this.state.lastTokStartLoc):this.raise(E.InexactInsideNonObject,this.state.lastTokStartLoc),i&&this.raise(E.InexactVariance,i),null):(n||this.raise(E.UnexpectedSpreadType,this.state.lastTokStartLoc),r!=null&&this.unexpected(r),i&&this.raise(E.SpreadVariance,i),e.argument=this.flowParseType(),this.finishNode(e,"ObjectTypeSpreadProperty"));{e.key=this.flowParseObjectPropertyKey(),e.static=s,e.proto=r!=null,e.kind=a;let h=!1;return this.match(47)||this.match(10)?(e.method=!0,r!=null&&this.unexpected(r),i&&this.unexpected(i.loc.start),e.value=this.flowParseObjectTypeMethodish(this.startNodeAt(e.loc.start)),(a==="get"||a==="set")&&this.flowCheckGetterSetterParams(e),!n&&e.key.name==="constructor"&&e.value.this&&this.raise(E.ThisParamBannedInConstructor,e.value.this)):(a!=="init"&&this.unexpected(),e.method=!1,this.eat(17)&&(h=!0),e.value=this.flowParseTypeInitialiser(),e.variance=i),e.optional=h,this.finishNode(e,"ObjectTypeProperty")}}flowCheckGetterSetterParams(e){let s=e.kind==="get"?0:1,r=e.value.params.length+(e.value.rest?1:0);e.value.this&&this.raise(e.kind==="get"?E.GetterMayNotHaveThisParam:E.SetterMayNotHaveThisParam,e.value.this),r!==s&&this.raise(e.kind==="get"?u.BadGetterArity:u.BadSetterArity,e),e.kind==="set"&&e.value.rest&&this.raise(u.BadSetterRestParameter,e)}flowObjectTypeSemicolon(){!this.eat(13)&&!this.eat(12)&&!this.match(8)&&!this.match(9)&&this.unexpected()}flowParseQualifiedTypeIdentifier(e,s){e!=null||(e=this.state.startLoc);let r=s||this.flowParseRestrictedIdentifier(!0);for(;this.eat(16);){let i=this.startNodeAt(e);i.qualification=r,i.id=this.flowParseRestrictedIdentifier(!0),r=this.finishNode(i,"QualifiedTypeIdentifier")}return r}flowParseGenericType(e,s){let r=this.startNodeAt(e);return r.typeParameters=null,r.id=this.flowParseQualifiedTypeIdentifier(e,s),this.match(47)&&(r.typeParameters=this.flowParseTypeParameterInstantiation()),this.finishNode(r,"GenericTypeAnnotation")}flowParseTypeofType(){let e=this.startNode();return this.expect(87),e.argument=this.flowParsePrimaryType(),this.finishNode(e,"TypeofTypeAnnotation")}flowParseTupleType(){let e=this.startNode();for(e.types=[],this.expect(0);this.state.possuper.parseFunctionBody(e,!0,r));return}super.parseFunctionBody(e,!1,r)}parseFunctionBodyAndFinish(e,s,r=!1){if(this.match(14)){let i=this.startNode();[i.typeAnnotation,e.predicate]=this.flowParseTypeAndPredicateInitialiser(),e.returnType=i.typeAnnotation?this.finishNode(i,"TypeAnnotation"):null}return super.parseFunctionBodyAndFinish(e,s,r)}parseStatementLike(e){if(this.state.strict&&this.isContextual(129)){let r=this.lookahead();if(U(r.type)){let i=this.startNode();return this.next(),this.flowParseInterface(i)}}else if(this.isContextual(126)){let r=this.startNode();return this.next(),this.flowParseEnumDeclaration(r)}let s=super.parseStatementLike(e);return this.flowPragma===void 0&&!this.isValidDirective(s)&&(this.flowPragma=null),s}parseExpressionStatement(e,s,r){if(s.type==="Identifier"){if(s.name==="declare"){if(this.match(80)||D(this.state.type)||this.match(68)||this.match(74)||this.match(82))return this.flowParseDeclare(e)}else if(D(this.state.type)){if(s.name==="interface")return this.flowParseInterface(e);if(s.name==="type")return this.flowParseTypeAlias(e);if(s.name==="opaque")return this.flowParseOpaqueType(e,!1)}}return super.parseExpressionStatement(e,s,r)}shouldParseExportDeclaration(){let{type:e}=this.state;return e===126||at(e)?!this.state.containsEsc:super.shouldParseExportDeclaration()}isExportDefaultSpecifier(){let{type:e}=this.state;return e===126||at(e)?this.state.containsEsc:super.isExportDefaultSpecifier()}parseExportDefaultExpression(){if(this.isContextual(126)){let e=this.startNode();return this.next(),this.flowParseEnumDeclaration(e)}return super.parseExportDefaultExpression()}parseConditional(e,s,r){if(!this.match(17))return e;if(this.state.maybeInArrowParameters){let y=this.lookaheadCharCode();if(y===44||y===61||y===58||y===41)return this.setOptionalParametersError(r),e}this.expect(17);let i=this.state.clone(),a=this.state.noArrowAt,n=this.startNodeAt(s),{consequent:o,failed:h}=this.tryParseConditionalConsequent(),[l,d]=this.getArrowLikeExpressions(o);if(h||d.length>0){let y=[...a];if(d.length>0){this.state=i,this.state.noArrowAt=y;for(let A=0;A1&&this.raise(E.AmbiguousConditionalArrow,i.startLoc),h&&l.length===1&&(this.state=i,y.push(l[0].start),this.state.noArrowAt=y,{consequent:o,failed:h}=this.tryParseConditionalConsequent())}return this.getArrowLikeExpressions(o,!0),this.state.noArrowAt=a,this.expect(14),n.test=e,n.consequent=o,n.alternate=this.forwardNoArrowParamsConversionAt(n,()=>this.parseMaybeAssign(void 0,void 0)),this.finishNode(n,"ConditionalExpression")}tryParseConditionalConsequent(){this.state.noArrowParamsConversionAt.push(this.state.start);let e=this.parseMaybeAssignAllowIn(),s=!this.match(14);return this.state.noArrowParamsConversionAt.pop(),{consequent:e,failed:s}}getArrowLikeExpressions(e,s){let r=[e],i=[];for(;r.length!==0;){let a=r.pop();a.type==="ArrowFunctionExpression"&&a.body.type!=="BlockStatement"?(a.typeParameters||!a.returnType?this.finishArrowValidation(a):i.push(a),r.push(a.body)):a.type==="ConditionalExpression"&&(r.push(a.consequent),r.push(a.alternate))}return s?(i.forEach(a=>this.finishArrowValidation(a)),[i,[]]):nr(i,a=>a.params.every(n=>this.isAssignable(n,!0)))}finishArrowValidation(e){var s;this.toAssignableList(e.params,(s=e.extra)==null?void 0:s.trailingCommaLoc,!1),this.scope.enter(6),super.checkParams(e,!1,!0),this.scope.exit()}forwardNoArrowParamsConversionAt(e,s){let r;return this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(e.start))?(this.state.noArrowParamsConversionAt.push(this.state.start),r=s(),this.state.noArrowParamsConversionAt.pop()):r=s(),r}parseParenItem(e,s){let r=super.parseParenItem(e,s);if(this.eat(17)&&(r.optional=!0,this.resetEndLocation(e)),this.match(14)){let i=this.startNodeAt(s);return i.expression=r,i.typeAnnotation=this.flowParseTypeAnnotation(),this.finishNode(i,"TypeCastExpression")}return r}assertModuleNodeAllowed(e){e.type==="ImportDeclaration"&&(e.importKind==="type"||e.importKind==="typeof")||e.type==="ExportNamedDeclaration"&&e.exportKind==="type"||e.type==="ExportAllDeclaration"&&e.exportKind==="type"||super.assertModuleNodeAllowed(e)}parseExportDeclaration(e){if(this.isContextual(130)){e.exportKind="type";let s=this.startNode();return this.next(),this.match(5)?(e.specifiers=this.parseExportSpecifiers(!0),super.parseExportFrom(e),null):this.flowParseTypeAlias(s)}else if(this.isContextual(131)){e.exportKind="type";let s=this.startNode();return this.next(),this.flowParseOpaqueType(s,!1)}else if(this.isContextual(129)){e.exportKind="type";let s=this.startNode();return this.next(),this.flowParseInterface(s)}else if(this.isContextual(126)){e.exportKind="value";let s=this.startNode();return this.next(),this.flowParseEnumDeclaration(s)}else return super.parseExportDeclaration(e)}eatExportStar(e){return super.eatExportStar(e)?!0:this.isContextual(130)&&this.lookahead().type===55?(e.exportKind="type",this.next(),this.next(),!0):!1}maybeParseExportNamespaceSpecifier(e){let{startLoc:s}=this.state,r=super.maybeParseExportNamespaceSpecifier(e);return r&&e.exportKind==="type"&&this.unexpected(s),r}parseClassId(e,s,r){super.parseClassId(e,s,r),this.match(47)&&(e.typeParameters=this.flowParseTypeParameterDeclaration())}parseClassMember(e,s,r){let{startLoc:i}=this.state;if(this.isContextual(125)){if(super.parseClassMemberFromModifier(e,s))return;s.declare=!0}super.parseClassMember(e,s,r),s.declare&&(s.type!=="ClassProperty"&&s.type!=="ClassPrivateProperty"&&s.type!=="PropertyDefinition"?this.raise(E.DeclareClassElement,i):s.value&&this.raise(E.DeclareClassFieldInitializer,s.value))}isIterator(e){return e==="iterator"||e==="asyncIterator"}readIterator(){let e=super.readWord1(),s="@@"+e;(!this.isIterator(e)||!this.state.inType)&&this.raise(u.InvalidIdentifier,this.state.curPosition(),{identifierName:s}),this.finishToken(132,s)}getTokenFromCode(e){let s=this.input.charCodeAt(this.state.pos+1);e===123&&s===124?this.finishOp(6,2):this.state.inType&&(e===62||e===60)?this.finishOp(e===62?48:47,1):this.state.inType&&e===63?s===46?this.finishOp(18,2):this.finishOp(17,1):ks(e,s,this.input.charCodeAt(this.state.pos+2))?(this.state.pos+=2,this.readIterator()):super.getTokenFromCode(e)}isAssignable(e,s){return e.type==="TypeCastExpression"?this.isAssignable(e.expression,s):super.isAssignable(e,s)}toAssignable(e,s=!1){!s&&e.type==="AssignmentExpression"&&e.left.type==="TypeCastExpression"&&(e.left=this.typeCastToParameter(e.left)),super.toAssignable(e,s)}toAssignableList(e,s,r){for(let i=0;i1||!s)&&this.raise(E.TypeCastInPattern,a.typeAnnotation)}return e}parseArrayLike(e,s,r,i){let a=super.parseArrayLike(e,s,r,i);return s&&!this.state.maybeInArrowParameters&&this.toReferencedList(a.elements),a}isValidLVal(e,s,r){return e==="TypeCastExpression"||super.isValidLVal(e,s,r)}parseClassProperty(e){return this.match(14)&&(e.typeAnnotation=this.flowParseTypeAnnotation()),super.parseClassProperty(e)}parseClassPrivateProperty(e){return this.match(14)&&(e.typeAnnotation=this.flowParseTypeAnnotation()),super.parseClassPrivateProperty(e)}isClassMethod(){return this.match(47)||super.isClassMethod()}isClassProperty(){return this.match(14)||super.isClassProperty()}isNonstaticConstructor(e){return!this.match(14)&&super.isNonstaticConstructor(e)}pushClassMethod(e,s,r,i,a,n){if(s.variance&&this.unexpected(s.variance.loc.start),delete s.variance,this.match(47)&&(s.typeParameters=this.flowParseTypeParameterDeclaration()),super.pushClassMethod(e,s,r,i,a,n),s.params&&a){let o=s.params;o.length>0&&this.isThisParam(o[0])&&this.raise(E.ThisParamBannedInConstructor,s)}else if(s.type==="MethodDefinition"&&a&&s.value.params){let o=s.value.params;o.length>0&&this.isThisParam(o[0])&&this.raise(E.ThisParamBannedInConstructor,s)}}pushClassPrivateMethod(e,s,r,i){s.variance&&this.unexpected(s.variance.loc.start),delete s.variance,this.match(47)&&(s.typeParameters=this.flowParseTypeParameterDeclaration()),super.pushClassPrivateMethod(e,s,r,i)}parseClassSuper(e){if(super.parseClassSuper(e),e.superClass&&(this.match(47)||this.match(51))&&(e.superTypeParameters=this.flowParseTypeParameterInstantiationInExpression()),this.isContextual(113)){this.next();let s=e.implements=[];do{let r=this.startNode();r.id=this.flowParseRestrictedIdentifier(!0),this.match(47)?r.typeParameters=this.flowParseTypeParameterInstantiation():r.typeParameters=null,s.push(this.finishNode(r,"ClassImplements"))}while(this.eat(12))}}checkGetterSetterParams(e){super.checkGetterSetterParams(e);let s=this.getObjectOrClassMethodParams(e);if(s.length>0){let r=s[0];this.isThisParam(r)&&e.kind==="get"?this.raise(E.GetterMayNotHaveThisParam,r):this.isThisParam(r)&&this.raise(E.SetterMayNotHaveThisParam,r)}}parsePropertyNamePrefixOperator(e){e.variance=this.flowParseVariance()}parseObjPropValue(e,s,r,i,a,n,o){e.variance&&this.unexpected(e.variance.loc.start),delete e.variance;let h;this.match(47)&&!n&&(h=this.flowParseTypeParameterDeclaration(),this.match(10)||this.unexpected());let l=super.parseObjPropValue(e,s,r,i,a,n,o);return h&&((l.value||l).typeParameters=h),l}parseFunctionParamType(e){return this.eat(17)&&(e.type!=="Identifier"&&this.raise(E.PatternIsOptional,e),this.isThisParam(e)&&this.raise(E.ThisParamMayNotBeOptional,e),e.optional=!0),this.match(14)?e.typeAnnotation=this.flowParseTypeAnnotation():this.isThisParam(e)&&this.raise(E.ThisParamAnnotationRequired,e),this.match(29)&&this.isThisParam(e)&&this.raise(E.ThisParamNoDefault,e),this.resetEndLocation(e),e}parseMaybeDefault(e,s){let r=super.parseMaybeDefault(e,s);return r.type==="AssignmentPattern"&&r.typeAnnotation&&r.right.startsuper.parseMaybeAssign(e,s),i),!a.error)return a.node;let{context:h}=this.state,l=h[h.length-1];(l===k.j_oTag||l===k.j_expr)&&h.pop()}if((r=a)!=null&&r.error||this.match(47)){var n,o;i=i||this.state.clone();let h,l=this.tryParse(y=>{var A;h=this.flowParseTypeParameterDeclaration();let T=this.forwardNoArrowParamsConversionAt(h,()=>{let L=super.parseMaybeAssign(e,s);return this.resetStartLocationFromNode(L,h),L});(A=T.extra)!=null&&A.parenthesized&&y();let N=this.maybeUnwrapTypeCastExpression(T);return N.type!=="ArrowFunctionExpression"&&y(),N.typeParameters=h,this.resetStartLocationFromNode(N,h),T},i),d=null;if(l.node&&this.maybeUnwrapTypeCastExpression(l.node).type==="ArrowFunctionExpression"){if(!l.error&&!l.aborted)return l.node.async&&this.raise(E.UnexpectedTypeParameterBeforeAsyncArrowFunction,h),l.node;d=l.node}if((n=a)!=null&&n.node)return this.state=a.failState,a.node;if(d)return this.state=l.failState,d;throw(o=a)!=null&&o.thrown?a.error:l.thrown?l.error:this.raise(E.UnexpectedTokenAfterTypeParameter,h)}return super.parseMaybeAssign(e,s)}parseArrow(e){if(this.match(14)){let s=this.tryParse(()=>{let r=this.state.noAnonFunctionType;this.state.noAnonFunctionType=!0;let i=this.startNode();return[i.typeAnnotation,e.predicate]=this.flowParseTypeAndPredicateInitialiser(),this.state.noAnonFunctionType=r,this.canInsertSemicolon()&&this.unexpected(),this.match(19)||this.unexpected(),i});if(s.thrown)return null;s.error&&(this.state=s.failState),e.returnType=s.node.typeAnnotation?this.finishNode(s.node,"TypeAnnotation"):null}return super.parseArrow(e)}shouldParseArrow(e){return this.match(14)||super.shouldParseArrow(e)}setArrowFunctionParameters(e,s){this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(e.start))?e.params=s:super.setArrowFunctionParameters(e,s)}checkParams(e,s,r,i=!0){if(!(r&&this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(e.start)))){for(let a=0;a0&&this.raise(E.ThisParamMustBeFirst,e.params[a]);super.checkParams(e,s,r,i)}}parseParenAndDistinguishExpression(e){return super.parseParenAndDistinguishExpression(e&&!this.state.noArrowAt.includes(this.sourceToOffsetPos(this.state.start)))}parseSubscripts(e,s,r){if(e.type==="Identifier"&&e.name==="async"&&this.state.noArrowAt.includes(s.index)){this.next();let i=this.startNodeAt(s);i.callee=e,i.arguments=super.parseCallExpressionArguments(11),e=this.finishNode(i,"CallExpression")}else if(e.type==="Identifier"&&e.name==="async"&&this.match(47)){let i=this.state.clone(),a=this.tryParse(o=>this.parseAsyncArrowWithTypeParameters(s)||o(),i);if(!a.error&&!a.aborted)return a.node;let n=this.tryParse(()=>super.parseSubscripts(e,s,r),i);if(n.node&&!n.error)return n.node;if(a.node)return this.state=a.failState,a.node;if(n.node)return this.state=n.failState,n.node;throw a.error||n.error}return super.parseSubscripts(e,s,r)}parseSubscript(e,s,r,i){if(this.match(18)&&this.isLookaheadToken_lt()){if(i.optionalChainMember=!0,r)return i.stop=!0,e;this.next();let a=this.startNodeAt(s);return a.callee=e,a.typeArguments=this.flowParseTypeParameterInstantiationInExpression(),this.expect(10),a.arguments=this.parseCallExpressionArguments(11),a.optional=!0,this.finishCallExpression(a,!0)}else if(!r&&this.shouldParseTypes()&&(this.match(47)||this.match(51))){let a=this.startNodeAt(s);a.callee=e;let n=this.tryParse(()=>(a.typeArguments=this.flowParseTypeParameterInstantiationCallOrNew(),this.expect(10),a.arguments=super.parseCallExpressionArguments(11),i.optionalChainMember&&(a.optional=!1),this.finishCallExpression(a,i.optionalChainMember)));if(n.node)return n.error&&(this.state=n.failState),n.node}return super.parseSubscript(e,s,r,i)}parseNewCallee(e){super.parseNewCallee(e);let s=null;this.shouldParseTypes()&&this.match(47)&&(s=this.tryParse(()=>this.flowParseTypeParameterInstantiationCallOrNew()).node),e.typeArguments=s}parseAsyncArrowWithTypeParameters(e){let s=this.startNodeAt(e);if(this.parseFunctionParams(s,!1),!!this.parseArrow(s))return super.parseArrowExpression(s,void 0,!0)}readToken_mult_modulo(e){let s=this.input.charCodeAt(this.state.pos+1);if(e===42&&s===47&&this.state.hasFlowComment){this.state.hasFlowComment=!1,this.state.pos+=2,this.nextToken();return}super.readToken_mult_modulo(e)}readToken_pipe_amp(e){let s=this.input.charCodeAt(this.state.pos+1);if(e===124&&s===125){this.finishOp(9,2);return}super.readToken_pipe_amp(e)}parseTopLevel(e,s){let r=super.parseTopLevel(e,s);return this.state.hasFlowComment&&this.raise(E.UnterminatedFlowComment,this.state.curPosition()),r}skipBlockComment(){if(this.hasPlugin("flowComments")&&this.skipFlowComment()){if(this.state.hasFlowComment)throw this.raise(E.NestedFlowComment,this.state.startLoc);this.hasFlowCommentCompletion();let e=this.skipFlowComment();e&&(this.state.pos+=e,this.state.hasFlowComment=!0);return}return super.skipBlockComment(this.state.hasFlowComment?"*-/":"*/")}skipFlowComment(){let{pos:e}=this.state,s=2;for(;[32,9].includes(this.input.charCodeAt(e+s));)s++;let r=this.input.charCodeAt(s+e),i=this.input.charCodeAt(s+e+1);return r===58&&i===58?s+2:this.input.slice(s+e,s+e+12)==="flow-include"?s+12:r===58&&i!==58?s:!1}hasFlowCommentCompletion(){if(this.input.indexOf("*/",this.state.pos)===-1)throw this.raise(u.UnterminatedComment,this.state.curPosition())}flowEnumErrorBooleanMemberNotInitialized(e,{enumName:s,memberName:r}){this.raise(E.EnumBooleanMemberNotInitialized,e,{memberName:r,enumName:s})}flowEnumErrorInvalidMemberInitializer(e,s){return this.raise(s.explicitType?s.explicitType==="symbol"?E.EnumInvalidMemberInitializerSymbolType:E.EnumInvalidMemberInitializerPrimaryType:E.EnumInvalidMemberInitializerUnknownType,e,s)}flowEnumErrorNumberMemberNotInitialized(e,s){this.raise(E.EnumNumberMemberNotInitialized,e,s)}flowEnumErrorStringMemberInconsistentlyInitialized(e,s){this.raise(E.EnumStringMemberInconsistentlyInitialized,e,s)}flowEnumMemberInit(){let e=this.state.startLoc,s=()=>this.match(12)||this.match(8);switch(this.state.type){case 135:{let r=this.parseNumericLiteral(this.state.value);return s()?{type:"number",loc:r.loc.start,value:r}:{type:"invalid",loc:e}}case 134:{let r=this.parseStringLiteral(this.state.value);return s()?{type:"string",loc:r.loc.start,value:r}:{type:"invalid",loc:e}}case 85:case 86:{let r=this.parseBooleanLiteral(this.match(85));return s()?{type:"boolean",loc:r.loc.start,value:r}:{type:"invalid",loc:e}}default:return{type:"invalid",loc:e}}}flowEnumMemberRaw(){let e=this.state.startLoc,s=this.parseIdentifier(!0),r=this.eat(29)?this.flowEnumMemberInit():{type:"none",loc:e};return{id:s,init:r}}flowEnumCheckExplicitTypeMismatch(e,s,r){let{explicitType:i}=s;i!==null&&i!==r&&this.flowEnumErrorInvalidMemberInitializer(e,s)}flowEnumMembers({enumName:e,explicitType:s}){let r=new Set,i={booleanMembers:[],numberMembers:[],stringMembers:[],defaultedMembers:[]},a=!1;for(;!this.match(8);){if(this.eat(21)){a=!0;break}let n=this.startNode(),{id:o,init:h}=this.flowEnumMemberRaw(),l=o.name;if(l==="")continue;/^[a-z]/.test(l)&&this.raise(E.EnumInvalidMemberName,o,{memberName:l,suggestion:l[0].toUpperCase()+l.slice(1),enumName:e}),r.has(l)&&this.raise(E.EnumDuplicateMemberName,o,{memberName:l,enumName:e}),r.add(l);let d={enumName:e,explicitType:s,memberName:l};switch(n.id=o,h.type){case"boolean":{this.flowEnumCheckExplicitTypeMismatch(h.loc,d,"boolean"),n.init=h.value,i.booleanMembers.push(this.finishNode(n,"EnumBooleanMember"));break}case"number":{this.flowEnumCheckExplicitTypeMismatch(h.loc,d,"number"),n.init=h.value,i.numberMembers.push(this.finishNode(n,"EnumNumberMember"));break}case"string":{this.flowEnumCheckExplicitTypeMismatch(h.loc,d,"string"),n.init=h.value,i.stringMembers.push(this.finishNode(n,"EnumStringMember"));break}case"invalid":throw this.flowEnumErrorInvalidMemberInitializer(h.loc,d);case"none":switch(s){case"boolean":this.flowEnumErrorBooleanMemberNotInitialized(h.loc,d);break;case"number":this.flowEnumErrorNumberMemberNotInitialized(h.loc,d);break;default:i.defaultedMembers.push(this.finishNode(n,"EnumDefaultedMember"))}}this.match(8)||this.expect(12)}return{members:i,hasUnknownMembers:a}}flowEnumStringMembers(e,s,{enumName:r}){if(e.length===0)return s;if(s.length===0)return e;if(s.length>e.length){for(let i of e)this.flowEnumErrorStringMemberInconsistentlyInitialized(i,{enumName:r});return s}else{for(let i of s)this.flowEnumErrorStringMemberInconsistentlyInitialized(i,{enumName:r});return e}}flowEnumParseExplicitType({enumName:e}){if(!this.eatContextual(102))return null;if(!D(this.state.type))throw this.raise(E.EnumInvalidExplicitTypeUnknownSupplied,this.state.startLoc,{enumName:e});let{value:s}=this.state;return this.next(),s!=="boolean"&&s!=="number"&&s!=="string"&&s!=="symbol"&&this.raise(E.EnumInvalidExplicitType,this.state.startLoc,{enumName:e,invalidEnumType:s}),s}flowEnumBody(e,s){let r=s.name,i=s.loc.start,a=this.flowEnumParseExplicitType({enumName:r});this.expect(5);let{members:n,hasUnknownMembers:o}=this.flowEnumMembers({enumName:r,explicitType:a});switch(e.hasUnknownMembers=o,a){case"boolean":return e.explicitType=!0,e.members=n.booleanMembers,this.expect(8),this.finishNode(e,"EnumBooleanBody");case"number":return e.explicitType=!0,e.members=n.numberMembers,this.expect(8),this.finishNode(e,"EnumNumberBody");case"string":return e.explicitType=!0,e.members=this.flowEnumStringMembers(n.stringMembers,n.defaultedMembers,{enumName:r}),this.expect(8),this.finishNode(e,"EnumStringBody");case"symbol":return e.members=n.defaultedMembers,this.expect(8),this.finishNode(e,"EnumSymbolBody");default:{let h=()=>(e.members=[],this.expect(8),this.finishNode(e,"EnumStringBody"));e.explicitType=!1;let l=n.booleanMembers.length,d=n.numberMembers.length,y=n.stringMembers.length,A=n.defaultedMembers.length;if(!l&&!d&&!y&&!A)return h();if(!l&&!d)return e.members=this.flowEnumStringMembers(n.stringMembers,n.defaultedMembers,{enumName:r}),this.expect(8),this.finishNode(e,"EnumStringBody");if(!d&&!y&&l>=A){for(let T of n.defaultedMembers)this.flowEnumErrorBooleanMemberNotInitialized(T.loc.start,{enumName:r,memberName:T.id.name});return e.members=n.booleanMembers,this.expect(8),this.finishNode(e,"EnumBooleanBody")}else if(!l&&!y&&d>=A){for(let T of n.defaultedMembers)this.flowEnumErrorNumberMemberNotInitialized(T.loc.start,{enumName:r,memberName:T.id.name});return e.members=n.numberMembers,this.expect(8),this.finishNode(e,"EnumNumberBody")}else return this.raise(E.EnumInconsistentMemberValues,i,{enumName:r}),h()}}}flowParseEnumDeclaration(e){let s=this.parseIdentifier();return e.id=s,e.body=this.flowEnumBody(this.startNode(),s),this.finishNode(e,"EnumDeclaration")}jsxParseOpeningElementAfterName(e){return this.shouldParseTypes()&&(this.match(47)||this.match(51))&&(e.typeArguments=this.flowParseTypeParameterInstantiationInExpression()),super.jsxParseOpeningElementAfterName(e)}isLookaheadToken_lt(){let e=this.nextTokenStart();if(this.input.charCodeAt(e)===60){let s=this.input.charCodeAt(e+1);return s!==60&&s!==61}return!1}reScan_lt_gt(){let{type:e}=this.state;e===47?(this.state.pos-=1,this.readToken_lt()):e===48&&(this.state.pos-=1,this.readToken_gt())}reScan_lt(){let{type:e}=this.state;return e===51?(this.state.pos-=2,this.finishOp(47,1),47):e}maybeUnwrapTypeCastExpression(e){return e.type==="TypeCastExpression"?e.expression:e}},Z=H`jsx`({AttributeIsEmpty:"JSX attributes must only be assigned a non-empty expression.",MissingClosingTagElement:({openingTagName:t})=>`Expected corresponding JSX closing tag for <${t}>.`,MissingClosingTagFragment:"Expected corresponding JSX closing tag for <>.",UnexpectedSequenceExpression:"Sequence expressions cannot be directly nested inside JSX. Did you mean to wrap it in parentheses (...)?",UnexpectedToken:({unexpected:t,HTMLEntity:e})=>`Unexpected token \`${t}\`. Did you mean \`${e}\` or \`{'${t}'}\`?`,UnsupportedJsxValue:"JSX value should be either an expression or a quoted JSX text.",UnterminatedJsxContent:"Unterminated JSX contents.",UnwrappedAdjacentJSXElements:"Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...?"});function G(t){return t?t.type==="JSXOpeningFragment"||t.type==="JSXClosingFragment":!1}function re(t){if(t.type==="JSXIdentifier")return t.name;if(t.type==="JSXNamespacedName")return t.namespace.name+":"+t.name.name;if(t.type==="JSXMemberExpression")return re(t.object)+"."+re(t.property);throw new Error("Node had unexpected type: "+t.type)}var hr=t=>class extends t{jsxReadToken(){let e="",s=this.state.pos;for(;;){if(this.state.pos>=this.length)throw this.raise(Z.UnterminatedJsxContent,this.state.startLoc);let r=this.input.charCodeAt(this.state.pos);switch(r){case 60:case 123:if(this.state.pos===this.state.start){r===60&&this.state.canStartJSXElement?(++this.state.pos,this.finishToken(143)):super.getTokenFromCode(r);return}e+=this.input.slice(s,this.state.pos),this.finishToken(142,e);return;case 38:e+=this.input.slice(s,this.state.pos),e+=this.jsxReadEntity(),s=this.state.pos;break;case 62:case 125:default:se(r)?(e+=this.input.slice(s,this.state.pos),e+=this.jsxReadNewLine(!0),s=this.state.pos):++this.state.pos}}}jsxReadNewLine(e){let s=this.input.charCodeAt(this.state.pos),r;return++this.state.pos,s===13&&this.input.charCodeAt(this.state.pos)===10?(++this.state.pos,r=e?` `:`\r `):r=String.fromCharCode(s),++this.state.curLine,this.state.lineStart=this.state.pos,r}jsxReadString(e){let s="",r=++this.state.pos;for(;;){if(this.state.pos>=this.length)throw this.raise(u.UnterminatedString,this.state.startLoc);let i=this.input.charCodeAt(this.state.pos);if(i===e)break;i===38?(s+=this.input.slice(r,this.state.pos),s+=this.jsxReadEntity(),r=this.state.pos):se(i)?(s+=this.input.slice(r,this.state.pos),s+=this.jsxReadNewLine(!1),r=this.state.pos):++this.state.pos}s+=this.input.slice(r,this.state.pos++),this.finishToken(134,s)}jsxReadEntity(){let e=++this.state.pos;if(this.codePointAtPos(this.state.pos)===35){++this.state.pos;let s=10;this.codePointAtPos(this.state.pos)===120&&(s=16,++this.state.pos);let r=this.readInt(s,void 0,!1,"bail");if(r!==null&&this.codePointAtPos(this.state.pos)===59)return++this.state.pos,String.fromCodePoint(r)}else{let s=0,r=!1;for(;s++<10&&this.state.pos1){for(let r=0;r0){if(s&256){let i=!!(s&512),a=(r&4)>0;return i!==a}return!0}return s&128&&(r&8)>0?t.names.get(e)&2?!!(s&1):!1:s&2&&(r&1)>0?!0:super.isRedeclaredInScope(t,e,s)}checkLocalExport(t){let{name:e}=t;if(this.hasImport(e))return;let s=this.scopeStack.length;for(let r=s-1;r>=0;r--){let i=this.scopeStack[r].tsNames.get(e);if((i&1)>0||(i&16)>0)return}super.checkLocalExport(t)}},Tt=t=>t.type==="ParenthesizedExpression"?Tt(t.expression):t,cr=class extends sr{toAssignable(t,e=!1){var s,r;let i;switch((t.type==="ParenthesizedExpression"||(s=t.extra)!=null&&s.parenthesized)&&(i=Tt(t),e?i.type==="Identifier"?this.expressionScope.recordArrowParameterBindingError(u.InvalidParenthesizedAssignment,t):i.type!=="MemberExpression"&&!this.isOptionalMemberExpression(i)&&this.raise(u.InvalidParenthesizedAssignment,t):this.raise(u.InvalidParenthesizedAssignment,t)),t.type){case"Identifier":case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":t.type="ObjectPattern";for(let n=0,o=t.properties.length,h=o-1;nr.type!=="ObjectMethod"&&(i===s||r.type!=="SpreadElement")&&this.isAssignable(r))}case"ObjectProperty":return this.isAssignable(t.value);case"SpreadElement":return this.isAssignable(t.argument);case"ArrayExpression":return t.elements.every(s=>s===null||this.isAssignable(s));case"AssignmentExpression":return t.operator==="=";case"ParenthesizedExpression":return this.isAssignable(t.expression);case"MemberExpression":case"OptionalMemberExpression":return!e;default:return!1}}toReferencedList(t,e){return t}toReferencedListDeep(t,e){this.toReferencedList(t,e);for(let s of t)(s==null?void 0:s.type)==="ArrayExpression"&&this.toReferencedListDeep(s.elements)}parseSpread(t){let e=this.startNode();return this.next(),e.argument=this.parseMaybeAssignAllowIn(t,void 0),this.finishNode(e,"SpreadElement")}parseRestBinding(){let t=this.startNode();return this.next(),t.argument=this.parseBindingAtom(),this.finishNode(t,"RestElement")}parseBindingAtom(){switch(this.state.type){case 0:{let t=this.startNode();return this.next(),t.elements=this.parseBindingList(3,93,1),this.finishNode(t,"ArrayPattern")}case 5:return this.parseObjectLike(8,!0)}return this.parseIdentifier()}parseBindingList(t,e,s){let r=s&1,i=[],a=!0;for(;!this.eat(t);)if(a?a=!1:this.expect(12),r&&this.match(12))i.push(null);else{if(this.eat(t))break;if(this.match(21)){let n=this.parseRestBinding();if((this.hasPlugin("flow")||s&2)&&(n=this.parseFunctionParamType(n)),i.push(n),!this.checkCommaAfterRest(e)){this.expect(t);break}}else{let n=[];for(this.match(26)&&this.hasPlugin("decorators")&&this.raise(u.UnsupportedParameterDecorator,this.state.startLoc);this.match(26);)n.push(this.parseDecorator());i.push(this.parseAssignableListItem(s,n))}}return i}parseBindingRestProperty(t){return this.next(),t.argument=this.parseIdentifier(),this.checkCommaAfterRest(125),this.finishNode(t,"RestElement")}parseBindingProperty(){let{type:t,startLoc:e}=this.state;if(t===21)return this.parseBindingRestProperty(this.startNode());let s=this.startNode();return t===139?(this.expectPlugin("destructuringPrivate",e),this.classScope.usePrivateName(this.state.value,e),s.key=this.parsePrivateName()):this.parsePropertyName(s),s.method=!1,this.parseObjPropValue(s,e,!1,!1,!0,!1)}parseAssignableListItem(t,e){let s=this.parseMaybeDefault();(this.hasPlugin("flow")||t&2)&&this.parseFunctionParamType(s);let r=this.parseMaybeDefault(s.loc.start,s);return e.length&&(s.decorators=e),r}parseFunctionParamType(t){return t}parseMaybeDefault(t,e){var s;if(t!=null||(t=this.state.startLoc),e=(s=e)!=null?s:this.parseBindingAtom(),!this.eat(29))return e;let r=this.startNodeAt(t);return r.left=e,r.right=this.parseMaybeAssignAllowIn(),this.finishNode(r,"AssignmentPattern")}isValidLVal(t,e,s){switch(t){case"AssignmentPattern":return"left";case"RestElement":return"argument";case"ObjectProperty":return"value";case"ParenthesizedExpression":return"expression";case"ArrayPattern":return"elements";case"ObjectPattern":return"properties"}return!1}isOptionalMemberExpression(t){return t.type==="OptionalMemberExpression"}checkLVal(t,e,s=64,r=!1,i=!1,a=!1){var n;let o=t.type;if(this.isObjectMethod(t))return;let h=this.isOptionalMemberExpression(t);if(h||o==="MemberExpression"){h&&(this.expectPlugin("optionalChainingAssign",t.loc.start),e.type!=="AssignmentExpression"&&this.raise(u.InvalidLhsOptionalChaining,t,{ancestor:e})),s!==64&&this.raise(u.InvalidPropertyBindingPattern,t);return}if(o==="Identifier"){this.checkIdentifier(t,s,i);let{name:N}=t;r&&(r.has(N)?this.raise(u.ParamDupe,t):r.add(N));return}let l=this.isValidLVal(o,!(a||(n=t.extra)!=null&&n.parenthesized)&&e.type==="AssignmentExpression",s);if(l===!0)return;if(l===!1){let N=s===64?u.InvalidLhs:u.InvalidLhsBinding;this.raise(N,t,{ancestor:e});return}let d,y;typeof l=="string"?(d=l,y=o==="ParenthesizedExpression"):[d,y]=l;let A=o==="ArrayPattern"||o==="ObjectPattern"?{type:o}:e,T=t[d];if(Array.isArray(T))for(let N of T)N&&this.checkLVal(N,A,s,r,i,y);else T&&this.checkLVal(T,A,s,r,i,y)}checkIdentifier(t,e,s=!1){this.state.strict&&(s?ut(t.name,this.inModule):pt(t.name))&&(e===64?this.raise(u.StrictEvalArguments,t,{referenceName:t.name}):this.raise(u.StrictEvalArgumentsBinding,t,{bindingName:t.name})),e&8192&&t.name==="let"&&this.raise(u.LetInLexicalBinding,t),e&64||this.declareNameFromIdentifier(t,e)}declareNameFromIdentifier(t,e){this.scope.declareName(t.name,e,t.loc.start)}checkToRestConversion(t,e){switch(t.type){case"ParenthesizedExpression":this.checkToRestConversion(t.expression,e);break;case"Identifier":case"MemberExpression":break;case"ArrayExpression":case"ObjectExpression":if(e)break;default:this.raise(u.InvalidRestAssignmentPattern,t)}}checkCommaAfterRest(t){return this.match(12)?(this.raise(this.lookaheadCharCode()===t?u.RestTrailingComma:u.ElementAfterRest,this.state.startLoc),!0):!1}};function dr(t){if(t==null)throw new Error(`Unexpected ${t} value.`);return t}function bt(t){if(!t)throw new Error("Assert fail")}var g=H`typescript`({AbstractMethodHasImplementation:({methodName:t})=>`Method '${t}' cannot have an implementation because it is marked abstract.`,AbstractPropertyHasInitializer:({propertyName:t})=>`Property '${t}' cannot have an initializer because it is marked abstract.`,AccessorCannotBeOptional:"An 'accessor' property cannot be declared optional.",AccessorCannotDeclareThisParameter:"'get' and 'set' accessors cannot declare 'this' parameters.",AccessorCannotHaveTypeParameters:"An accessor cannot have type parameters.",ClassMethodHasDeclare:"Class methods cannot have the 'declare' modifier.",ClassMethodHasReadonly:"Class methods cannot have the 'readonly' modifier.",ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference:"A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference.",ConstructorHasTypeParameters:"Type parameters cannot appear on a constructor declaration.",DeclareAccessor:({kind:t})=>`'declare' is not allowed in ${t}ters.`,DeclareClassFieldHasInitializer:"Initializers are not allowed in ambient contexts.",DeclareFunctionHasImplementation:"An implementation cannot be declared in ambient contexts.",DuplicateAccessibilityModifier:({modifier:t})=>"Accessibility modifier already seen.",DuplicateModifier:({modifier:t})=>`Duplicate modifier: '${t}'.`,EmptyHeritageClauseType:({token:t})=>`'${t}' list cannot be empty.`,EmptyTypeArguments:"Type argument list cannot be empty.",EmptyTypeParameters:"Type parameter list cannot be empty.",ExpectedAmbientAfterExportDeclare:"'export declare' must be followed by an ambient declaration.",ImportAliasHasImportType:"An import alias can not use 'import type'.",ImportReflectionHasImportType:"An `import module` declaration can not use `type` modifier",IncompatibleModifiers:({modifiers:t})=>`'${t[0]}' modifier cannot be used with '${t[1]}' modifier.`,IndexSignatureHasAbstract:"Index signatures cannot have the 'abstract' modifier.",IndexSignatureHasAccessibility:({modifier:t})=>`Index signatures cannot have an accessibility modifier ('${t}').`,IndexSignatureHasDeclare:"Index signatures cannot have the 'declare' modifier.",IndexSignatureHasOverride:"'override' modifier cannot appear on an index signature.",IndexSignatureHasStatic:"Index signatures cannot have the 'static' modifier.",InitializerNotAllowedInAmbientContext:"Initializers are not allowed in ambient contexts.",InvalidModifierOnTypeMember:({modifier:t})=>`'${t}' modifier cannot appear on a type member.`,InvalidModifierOnTypeParameter:({modifier:t})=>`'${t}' modifier cannot appear on a type parameter.`,InvalidModifierOnTypeParameterPositions:({modifier:t})=>`'${t}' modifier can only appear on a type parameter of a class, interface or type alias.`,InvalidModifiersOrder:({orderedModifiers:t})=>`'${t[0]}' modifier must precede '${t[1]}' modifier.`,InvalidPropertyAccessAfterInstantiationExpression:"Invalid property access after an instantiation expression. You can either wrap the instantiation expression in parentheses, or delete the type arguments.",InvalidTupleMemberLabel:"Tuple members must be labeled with a simple identifier.",MissingInterfaceName:"'interface' declarations must be followed by an identifier.",NonAbstractClassHasAbstractMethod:"Abstract methods can only appear within an abstract class.",NonClassMethodPropertyHasAbstractModifer:"'abstract' modifier can only appear on a class, method, or property declaration.",OptionalTypeBeforeRequired:"A required element cannot follow an optional element.",OverrideNotInSubClass:"This member cannot have an 'override' modifier because its containing class does not extend another class.",PatternIsOptional:"A binding pattern parameter cannot be optional in an implementation signature.",PrivateElementHasAbstract:"Private elements cannot have the 'abstract' modifier.",PrivateElementHasAccessibility:({modifier:t})=>`Private elements cannot have an accessibility modifier ('${t}').`,ReadonlyForMethodSignature:"'readonly' modifier can only appear on a property declaration or index signature.",ReservedArrowTypeParam:"This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma, as in `() => ...`.",ReservedTypeAssertion:"This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead.",SetAccessorCannotHaveOptionalParameter:"A 'set' accessor cannot have an optional parameter.",SetAccessorCannotHaveRestParameter:"A 'set' accessor cannot have rest parameter.",SetAccessorCannotHaveReturnType:"A 'set' accessor cannot have a return type annotation.",SingleTypeParameterWithoutTrailingComma:({typeParameterName:t})=>`Single type parameter ${t} should have a trailing comma. Example usage: <${t},>.`,StaticBlockCannotHaveModifier:"Static class blocks cannot have any modifier.",TupleOptionalAfterType:"A labeled tuple optional element must be declared using a question mark after the name and before the colon (`name?: type`), rather than after the type (`name: type?`).",TypeAnnotationAfterAssign:"Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.",TypeImportCannotSpecifyDefaultAndNamed:"A type-only import can specify a default import or named bindings, but not both.",TypeModifierIsUsedInTypeExports:"The 'type' modifier cannot be used on a named export when 'export type' is used on its export statement.",TypeModifierIsUsedInTypeImports:"The 'type' modifier cannot be used on a named import when 'import type' is used on its import statement.",UnexpectedParameterModifier:"A parameter property is only allowed in a constructor implementation.",UnexpectedReadonly:"'readonly' type modifier is only permitted on array and tuple literal types.",UnexpectedTypeAnnotation:"Did not expect a type annotation here.",UnexpectedTypeCastInParameter:"Unexpected type cast in parameter position.",UnsupportedImportTypeArgument:"Argument in a type import must be a string literal.",UnsupportedParameterPropertyKind:"A parameter property may not be declared using a binding pattern.",UnsupportedSignatureParameterKind:({type:t})=>`Name in a signature must be an Identifier, ObjectPattern or ArrayPattern, instead got ${t}.`});function mr(t){switch(t){case"any":return"TSAnyKeyword";case"boolean":return"TSBooleanKeyword";case"bigint":return"TSBigIntKeyword";case"never":return"TSNeverKeyword";case"number":return"TSNumberKeyword";case"object":return"TSObjectKeyword";case"string":return"TSStringKeyword";case"symbol":return"TSSymbolKeyword";case"undefined":return"TSUndefinedKeyword";case"unknown":return"TSUnknownKeyword";default:return}}function Et(t){return t==="private"||t==="public"||t==="protected"}function fr(t){return t==="in"||t==="out"}var yr=t=>class extends t{constructor(...e){super(...e),this.tsParseInOutModifiers=this.tsParseModifiers.bind(this,{allowedModifiers:["in","out"],disallowedModifiers:["const","public","private","protected","readonly","declare","abstract","override"],errorTemplate:g.InvalidModifierOnTypeParameter}),this.tsParseConstModifier=this.tsParseModifiers.bind(this,{allowedModifiers:["const"],disallowedModifiers:["in","out"],errorTemplate:g.InvalidModifierOnTypeParameterPositions}),this.tsParseInOutConstModifiers=this.tsParseModifiers.bind(this,{allowedModifiers:["in","out","const"],disallowedModifiers:["public","private","protected","readonly","declare","abstract","override"],errorTemplate:g.InvalidModifierOnTypeParameter})}getScopeHandler(){return ur}tsIsIdentifier(){return D(this.state.type)}tsTokenCanFollowModifier(){return this.match(0)||this.match(5)||this.match(55)||this.match(21)||this.match(139)||this.isLiteralPropertyName()}tsNextTokenOnSameLineAndCanFollowModifier(){return this.next(),this.hasPrecedingLineBreak()?!1:this.tsTokenCanFollowModifier()}tsNextTokenCanFollowModifier(){return this.match(106)?(this.next(),this.tsTokenCanFollowModifier()):this.tsNextTokenOnSameLineAndCanFollowModifier()}tsParseModifier(e,s){if(!D(this.state.type)&&this.state.type!==58&&this.state.type!==75)return;let r=this.state.value;if(e.includes(r)){if(s&&this.tsIsStartOfStaticBlocks())return;if(this.tsTryParse(this.tsNextTokenCanFollowModifier.bind(this)))return r}}tsParseModifiers({allowedModifiers:e,disallowedModifiers:s,stopOnStartOfClassStaticBlock:r,errorTemplate:i=g.InvalidModifierOnTypeMember},a){let n=(h,l,d,y)=>{l===d&&a[y]&&this.raise(g.InvalidModifiersOrder,h,{orderedModifiers:[d,y]})},o=(h,l,d,y)=>{(a[d]&&l===y||a[y]&&l===d)&&this.raise(g.IncompatibleModifiers,h,{modifiers:[d,y]})};for(;;){let{startLoc:h}=this.state,l=this.tsParseModifier(e.concat(s??[]),r);if(!l)break;Et(l)?a.accessibility?this.raise(g.DuplicateAccessibilityModifier,h,{modifier:l}):(n(h,l,l,"override"),n(h,l,l,"static"),n(h,l,l,"readonly"),a.accessibility=l):fr(l)?(a[l]&&this.raise(g.DuplicateModifier,h,{modifier:l}),a[l]=!0,n(h,l,"in","out")):(hasOwnProperty.call(a,l)?this.raise(g.DuplicateModifier,h,{modifier:l}):(n(h,l,"static","readonly"),n(h,l,"static","override"),n(h,l,"override","readonly"),n(h,l,"abstract","override"),o(h,l,"declare","override"),o(h,l,"static","abstract")),a[l]=!0),s!=null&&s.includes(l)&&this.raise(i,h,{modifier:l})}}tsIsListTerminator(e){switch(e){case"EnumMembers":case"TypeMembers":return this.match(8);case"HeritageClauseElement":return this.match(5);case"TupleElementTypes":return this.match(3);case"TypeParametersOrArguments":return this.match(48)}}tsParseList(e,s){let r=[];for(;!this.tsIsListTerminator(e);)r.push(s());return r}tsParseDelimitedList(e,s,r){return dr(this.tsParseDelimitedListWorker(e,s,!0,r))}tsParseDelimitedListWorker(e,s,r,i){let a=[],n=-1;for(;!this.tsIsListTerminator(e);){n=-1;let o=s();if(o==null)return;if(a.push(o),this.eat(12)){n=this.state.lastTokStartLoc.index;continue}if(this.tsIsListTerminator(e))break;r&&this.expect(12);return}return i&&(i.value=n),a}tsParseBracketedList(e,s,r,i,a){i||(r?this.expect(0):this.expect(47));let n=this.tsParseDelimitedList(e,s,a);return r?this.expect(3):this.expect(48),n}tsParseImportType(){let e=this.startNode();return this.expect(83),this.expect(10),this.match(134)?e.argument=this.parseStringLiteral(this.state.value):(this.raise(g.UnsupportedImportTypeArgument,this.state.startLoc),e.argument=super.parseExprAtom()),this.eat(12)&&!this.match(11)?(e.options=super.parseMaybeAssignAllowIn(),this.eat(12)):e.options=null,this.expect(11),this.eat(16)&&(e.qualifier=this.tsParseEntityName(3)),this.match(47)&&(e.typeParameters=this.tsParseTypeArguments()),this.finishNode(e,"TSImportType")}tsParseEntityName(e){let s;if(e&1&&this.match(78))if(e&2)s=this.parseIdentifier(!0);else{let r=this.startNode();this.next(),s=this.finishNode(r,"ThisExpression")}else s=this.parseIdentifier(!!(e&1));for(;this.eat(16);){let r=this.startNodeAtNode(s);r.left=s,r.right=this.parseIdentifier(!!(e&1)),s=this.finishNode(r,"TSQualifiedName")}return s}tsParseTypeReference(){let e=this.startNode();return e.typeName=this.tsParseEntityName(1),!this.hasPrecedingLineBreak()&&this.match(47)&&(e.typeParameters=this.tsParseTypeArguments()),this.finishNode(e,"TSTypeReference")}tsParseThisTypePredicate(e){this.next();let s=this.startNodeAtNode(e);return s.parameterName=e,s.typeAnnotation=this.tsParseTypeAnnotation(!1),s.asserts=!1,this.finishNode(s,"TSTypePredicate")}tsParseThisTypeNode(){let e=this.startNode();return this.next(),this.finishNode(e,"TSThisType")}tsParseTypeQuery(){let e=this.startNode();return this.expect(87),this.match(83)?e.exprName=this.tsParseImportType():e.exprName=this.tsParseEntityName(3),!this.hasPrecedingLineBreak()&&this.match(47)&&(e.typeParameters=this.tsParseTypeArguments()),this.finishNode(e,"TSTypeQuery")}tsParseTypeParameter(e){let s=this.startNode();return e(s),s.name=this.tsParseTypeParameterName(),s.constraint=this.tsEatThenParseType(81),s.default=this.tsEatThenParseType(29),this.finishNode(s,"TSTypeParameter")}tsTryParseTypeParameters(e){if(this.match(47))return this.tsParseTypeParameters(e)}tsParseTypeParameters(e){let s=this.startNode();this.match(47)||this.match(143)?this.next():this.unexpected();let r={value:-1};return s.params=this.tsParseBracketedList("TypeParametersOrArguments",this.tsParseTypeParameter.bind(this,e),!1,!0,r),s.params.length===0&&this.raise(g.EmptyTypeParameters,s),r.value!==-1&&this.addExtra(s,"trailingComma",r.value),this.finishNode(s,"TSTypeParameterDeclaration")}tsFillSignature(e,s){let r=e===19,i="parameters",a="typeAnnotation";s.typeParameters=this.tsTryParseTypeParameters(this.tsParseConstModifier),this.expect(10),s[i]=this.tsParseBindingListForSignature(),r?s[a]=this.tsParseTypeOrTypePredicateAnnotation(e):this.match(e)&&(s[a]=this.tsParseTypeOrTypePredicateAnnotation(e))}tsParseBindingListForSignature(){let e=super.parseBindingList(11,41,2);for(let s of e){let{type:r}=s;(r==="AssignmentPattern"||r==="TSParameterProperty")&&this.raise(g.UnsupportedSignatureParameterKind,s,{type:r})}return e}tsParseTypeMemberSemicolon(){!this.eat(12)&&!this.isLineTerminator()&&this.expect(13)}tsParseSignatureMember(e,s){return this.tsFillSignature(14,s),this.tsParseTypeMemberSemicolon(),this.finishNode(s,e)}tsIsUnambiguouslyIndexSignature(){return this.next(),D(this.state.type)?(this.next(),this.match(14)):!1}tsTryParseIndexSignature(e){if(!(this.match(0)&&this.tsLookAhead(this.tsIsUnambiguouslyIndexSignature.bind(this))))return;this.expect(0);let s=this.parseIdentifier();s.typeAnnotation=this.tsParseTypeAnnotation(),this.resetEndLocation(s),this.expect(3),e.parameters=[s];let r=this.tsTryParseTypeAnnotation();return r&&(e.typeAnnotation=r),this.tsParseTypeMemberSemicolon(),this.finishNode(e,"TSIndexSignature")}tsParsePropertyOrMethodSignature(e,s){this.eat(17)&&(e.optional=!0);let r=e;if(this.match(10)||this.match(47)){s&&this.raise(g.ReadonlyForMethodSignature,e);let i=r;i.kind&&this.match(47)&&this.raise(g.AccessorCannotHaveTypeParameters,this.state.curPosition()),this.tsFillSignature(14,i),this.tsParseTypeMemberSemicolon();let a="parameters",n="typeAnnotation";if(i.kind==="get")i[a].length>0&&(this.raise(u.BadGetterArity,this.state.curPosition()),this.isThisParam(i[a][0])&&this.raise(g.AccessorCannotDeclareThisParameter,this.state.curPosition()));else if(i.kind==="set"){if(i[a].length!==1)this.raise(u.BadSetterArity,this.state.curPosition());else{let o=i[a][0];this.isThisParam(o)&&this.raise(g.AccessorCannotDeclareThisParameter,this.state.curPosition()),o.type==="Identifier"&&o.optional&&this.raise(g.SetAccessorCannotHaveOptionalParameter,this.state.curPosition()),o.type==="RestElement"&&this.raise(g.SetAccessorCannotHaveRestParameter,this.state.curPosition())}i[n]&&this.raise(g.SetAccessorCannotHaveReturnType,i[n])}else i.kind="method";return this.finishNode(i,"TSMethodSignature")}else{let i=r;s&&(i.readonly=!0);let a=this.tsTryParseTypeAnnotation();return a&&(i.typeAnnotation=a),this.tsParseTypeMemberSemicolon(),this.finishNode(i,"TSPropertySignature")}}tsParseTypeMember(){let e=this.startNode();if(this.match(10)||this.match(47))return this.tsParseSignatureMember("TSCallSignatureDeclaration",e);if(this.match(77)){let r=this.startNode();return this.next(),this.match(10)||this.match(47)?this.tsParseSignatureMember("TSConstructSignatureDeclaration",e):(e.key=this.createIdentifier(r,"new"),this.tsParsePropertyOrMethodSignature(e,!1))}return this.tsParseModifiers({allowedModifiers:["readonly"],disallowedModifiers:["declare","abstract","private","protected","public","static","override"]},e),this.tsTryParseIndexSignature(e)||(super.parsePropertyName(e),!e.computed&&e.key.type==="Identifier"&&(e.key.name==="get"||e.key.name==="set")&&this.tsTokenCanFollowModifier()&&(e.kind=e.key.name,super.parsePropertyName(e)),this.tsParsePropertyOrMethodSignature(e,!!e.readonly))}tsParseTypeLiteral(){let e=this.startNode();return e.members=this.tsParseObjectTypeMembers(),this.finishNode(e,"TSTypeLiteral")}tsParseObjectTypeMembers(){this.expect(5);let e=this.tsParseList("TypeMembers",this.tsParseTypeMember.bind(this));return this.expect(8),e}tsIsStartOfMappedType(){return this.next(),this.eat(53)?this.isContextual(122):(this.isContextual(122)&&this.next(),!this.match(0)||(this.next(),!this.tsIsIdentifier())?!1:(this.next(),this.match(58)))}tsParseMappedType(){let e=this.startNode();this.expect(5),this.match(53)?(e.readonly=this.state.value,this.next(),this.expectContextual(122)):this.eatContextual(122)&&(e.readonly=!0),this.expect(0);{let s=this.startNode();s.name=this.tsParseTypeParameterName(),s.constraint=this.tsExpectThenParseType(58),e.typeParameter=this.finishNode(s,"TSTypeParameter")}return e.nameType=this.eatContextual(93)?this.tsParseType():null,this.expect(3),this.match(53)?(e.optional=this.state.value,this.next(),this.expect(17)):this.eat(17)&&(e.optional=!0),e.typeAnnotation=this.tsTryParseType(),this.semicolon(),this.expect(8),this.finishNode(e,"TSMappedType")}tsParseTupleType(){let e=this.startNode();e.elementTypes=this.tsParseBracketedList("TupleElementTypes",this.tsParseTupleElementType.bind(this),!0,!1);let s=!1;return e.elementTypes.forEach(r=>{let{type:i}=r;s&&i!=="TSRestType"&&i!=="TSOptionalType"&&!(i==="TSNamedTupleMember"&&r.optional)&&this.raise(g.OptionalTypeBeforeRequired,r),s||(s=i==="TSNamedTupleMember"&&r.optional||i==="TSOptionalType")}),this.finishNode(e,"TSTupleType")}tsParseTupleElementType(){let e=this.state.startLoc,s=this.eat(21),{startLoc:r}=this.state,i,a,n,o,h=U(this.state.type)?this.lookaheadCharCode():null;if(h===58)i=!0,n=!1,a=this.parseIdentifier(!0),this.expect(14),o=this.tsParseType();else if(h===63){n=!0;let l=this.state.value,d=this.tsParseNonArrayType();this.lookaheadCharCode()===58?(i=!0,a=this.createIdentifier(this.startNodeAt(r),l),this.expect(17),this.expect(14),o=this.tsParseType()):(i=!1,o=d,this.expect(17))}else o=this.tsParseType(),n=this.eat(17),i=this.eat(14);if(i){let l;a?(l=this.startNodeAt(r),l.optional=n,l.label=a,l.elementType=o,this.eat(17)&&(l.optional=!0,this.raise(g.TupleOptionalAfterType,this.state.lastTokStartLoc))):(l=this.startNodeAt(r),l.optional=n,this.raise(g.InvalidTupleMemberLabel,o),l.label=o,l.elementType=this.tsParseType()),o=this.finishNode(l,"TSNamedTupleMember")}else if(n){let l=this.startNodeAt(r);l.typeAnnotation=o,o=this.finishNode(l,"TSOptionalType")}if(s){let l=this.startNodeAt(e);l.typeAnnotation=o,o=this.finishNode(l,"TSRestType")}return o}tsParseParenthesizedType(){let e=this.startNode();return this.expect(10),e.typeAnnotation=this.tsParseType(),this.expect(11),this.finishNode(e,"TSParenthesizedType")}tsParseFunctionOrConstructorType(e,s){let r=this.startNode();return e==="TSConstructorType"&&(r.abstract=!!s,s&&this.next(),this.next()),this.tsInAllowConditionalTypesContext(()=>this.tsFillSignature(19,r)),this.finishNode(r,e)}tsParseLiteralTypeNode(){let e=this.startNode();switch(this.state.type){case 135:case 136:case 134:case 85:case 86:e.literal=super.parseExprAtom();break;default:this.unexpected()}return this.finishNode(e,"TSLiteralType")}tsParseTemplateLiteralType(){{let e=this.startNode();return e.literal=super.parseTemplate(!1),this.finishNode(e,"TSLiteralType")}}parseTemplateSubstitution(){return this.state.inType?this.tsParseType():super.parseTemplateSubstitution()}tsParseThisTypeOrThisTypePredicate(){let e=this.tsParseThisTypeNode();return this.isContextual(116)&&!this.hasPrecedingLineBreak()?this.tsParseThisTypePredicate(e):e}tsParseNonArrayType(){switch(this.state.type){case 134:case 135:case 136:case 85:case 86:return this.tsParseLiteralTypeNode();case 53:if(this.state.value==="-"){let e=this.startNode(),s=this.lookahead();return s.type!==135&&s.type!==136&&this.unexpected(),e.literal=this.parseMaybeUnary(),this.finishNode(e,"TSLiteralType")}break;case 78:return this.tsParseThisTypeOrThisTypePredicate();case 87:return this.tsParseTypeQuery();case 83:return this.tsParseImportType();case 5:return this.tsLookAhead(this.tsIsStartOfMappedType.bind(this))?this.tsParseMappedType():this.tsParseTypeLiteral();case 0:return this.tsParseTupleType();case 10:return this.tsParseParenthesizedType();case 25:case 24:return this.tsParseTemplateLiteralType();default:{let{type:e}=this.state;if(D(e)||e===88||e===84){let s=e===88?"TSVoidKeyword":e===84?"TSNullKeyword":mr(this.state.value);if(s!==void 0&&this.lookaheadCharCode()!==46){let r=this.startNode();return this.next(),this.finishNode(r,s)}return this.tsParseTypeReference()}}}this.unexpected()}tsParseArrayTypeOrHigher(){let{startLoc:e}=this.state,s=this.tsParseNonArrayType();for(;!this.hasPrecedingLineBreak()&&this.eat(0);)if(this.match(3)){let r=this.startNodeAt(e);r.elementType=s,this.expect(3),s=this.finishNode(r,"TSArrayType")}else{let r=this.startNodeAt(e);r.objectType=s,r.indexType=this.tsParseType(),this.expect(3),s=this.finishNode(r,"TSIndexedAccessType")}return s}tsParseTypeOperator(){let e=this.startNode(),s=this.state.value;return this.next(),e.operator=s,e.typeAnnotation=this.tsParseTypeOperatorOrHigher(),s==="readonly"&&this.tsCheckTypeAnnotationForReadOnly(e),this.finishNode(e,"TSTypeOperator")}tsCheckTypeAnnotationForReadOnly(e){switch(e.typeAnnotation.type){case"TSTupleType":case"TSArrayType":return;default:this.raise(g.UnexpectedReadonly,e)}}tsParseInferType(){let e=this.startNode();this.expectContextual(115);let s=this.startNode();return s.name=this.tsParseTypeParameterName(),s.constraint=this.tsTryParse(()=>this.tsParseConstraintForInferType()),e.typeParameter=this.finishNode(s,"TSTypeParameter"),this.finishNode(e,"TSInferType")}tsParseConstraintForInferType(){if(this.eat(81)){let e=this.tsInDisallowConditionalTypesContext(()=>this.tsParseType());if(this.state.inDisallowConditionalTypesContext||!this.match(17))return e}}tsParseTypeOperatorOrHigher(){return gs(this.state.type)&&!this.state.containsEsc?this.tsParseTypeOperator():this.isContextual(115)?this.tsParseInferType():this.tsInAllowConditionalTypesContext(()=>this.tsParseArrayTypeOrHigher())}tsParseUnionOrIntersectionType(e,s,r){let i=this.startNode(),a=this.eat(r),n=[];do n.push(s());while(this.eat(r));return n.length===1&&!a?n[0]:(i.types=n,this.finishNode(i,e))}tsParseIntersectionTypeOrHigher(){return this.tsParseUnionOrIntersectionType("TSIntersectionType",this.tsParseTypeOperatorOrHigher.bind(this),45)}tsParseUnionTypeOrHigher(){return this.tsParseUnionOrIntersectionType("TSUnionType",this.tsParseIntersectionTypeOrHigher.bind(this),43)}tsIsStartOfFunctionType(){return this.match(47)?!0:this.match(10)&&this.tsLookAhead(this.tsIsUnambiguouslyStartOfFunctionType.bind(this))}tsSkipParameterStart(){if(D(this.state.type)||this.match(78))return this.next(),!0;if(this.match(5)){let{errors:e}=this.state,s=e.length;try{return this.parseObjectLike(8,!0),e.length===s}catch{return!1}}if(this.match(0)){this.next();let{errors:e}=this.state,s=e.length;try{return super.parseBindingList(3,93,1),e.length===s}catch{return!1}}return!1}tsIsUnambiguouslyStartOfFunctionType(){return this.next(),!!(this.match(11)||this.match(21)||this.tsSkipParameterStart()&&(this.match(14)||this.match(12)||this.match(17)||this.match(29)||this.match(11)&&(this.next(),this.match(19))))}tsParseTypeOrTypePredicateAnnotation(e){return this.tsInType(()=>{let s=this.startNode();this.expect(e);let r=this.startNode(),i=!!this.tsTryParse(this.tsParseTypePredicateAsserts.bind(this));if(i&&this.match(78)){let o=this.tsParseThisTypeOrThisTypePredicate();return o.type==="TSThisType"?(r.parameterName=o,r.asserts=!0,r.typeAnnotation=null,o=this.finishNode(r,"TSTypePredicate")):(this.resetStartLocationFromNode(o,r),o.asserts=!0),s.typeAnnotation=o,this.finishNode(s,"TSTypeAnnotation")}let a=this.tsIsIdentifier()&&this.tsTryParse(this.tsParseTypePredicatePrefix.bind(this));if(!a)return i?(r.parameterName=this.parseIdentifier(),r.asserts=i,r.typeAnnotation=null,s.typeAnnotation=this.finishNode(r,"TSTypePredicate"),this.finishNode(s,"TSTypeAnnotation")):this.tsParseTypeAnnotation(!1,s);let n=this.tsParseTypeAnnotation(!1);return r.parameterName=a,r.typeAnnotation=n,r.asserts=i,s.typeAnnotation=this.finishNode(r,"TSTypePredicate"),this.finishNode(s,"TSTypeAnnotation")})}tsTryParseTypeOrTypePredicateAnnotation(){if(this.match(14))return this.tsParseTypeOrTypePredicateAnnotation(14)}tsTryParseTypeAnnotation(){if(this.match(14))return this.tsParseTypeAnnotation()}tsTryParseType(){return this.tsEatThenParseType(14)}tsParseTypePredicatePrefix(){let e=this.parseIdentifier();if(this.isContextual(116)&&!this.hasPrecedingLineBreak())return this.next(),e}tsParseTypePredicateAsserts(){if(this.state.type!==109)return!1;let e=this.state.containsEsc;return this.next(),!D(this.state.type)&&!this.match(78)?!1:(e&&this.raise(u.InvalidEscapedReservedWord,this.state.lastTokStartLoc,{reservedWord:"asserts"}),!0)}tsParseTypeAnnotation(e=!0,s=this.startNode()){return this.tsInType(()=>{e&&this.expect(14),s.typeAnnotation=this.tsParseType()}),this.finishNode(s,"TSTypeAnnotation")}tsParseType(){bt(this.state.inType);let e=this.tsParseNonConditionalType();if(this.state.inDisallowConditionalTypesContext||this.hasPrecedingLineBreak()||!this.eat(81))return e;let s=this.startNodeAtNode(e);return s.checkType=e,s.extendsType=this.tsInDisallowConditionalTypesContext(()=>this.tsParseNonConditionalType()),this.expect(17),s.trueType=this.tsInAllowConditionalTypesContext(()=>this.tsParseType()),this.expect(14),s.falseType=this.tsInAllowConditionalTypesContext(()=>this.tsParseType()),this.finishNode(s,"TSConditionalType")}isAbstractConstructorSignature(){return this.isContextual(124)&&this.lookahead().type===77}tsParseNonConditionalType(){return this.tsIsStartOfFunctionType()?this.tsParseFunctionOrConstructorType("TSFunctionType"):this.match(77)?this.tsParseFunctionOrConstructorType("TSConstructorType"):this.isAbstractConstructorSignature()?this.tsParseFunctionOrConstructorType("TSConstructorType",!0):this.tsParseUnionTypeOrHigher()}tsParseTypeAssertion(){this.getPluginOption("typescript","disallowAmbiguousJSXLike")&&this.raise(g.ReservedTypeAssertion,this.state.startLoc);let e=this.startNode();return e.typeAnnotation=this.tsInType(()=>(this.next(),this.match(75)?this.tsParseTypeReference():this.tsParseType())),this.expect(48),e.expression=this.parseMaybeUnary(),this.finishNode(e,"TSTypeAssertion")}tsParseHeritageClause(e){let s=this.state.startLoc,r=this.tsParseDelimitedList("HeritageClauseElement",()=>{let i=this.startNode();return i.expression=this.tsParseEntityName(3),this.match(47)&&(i.typeParameters=this.tsParseTypeArguments()),this.finishNode(i,"TSExpressionWithTypeArguments")});return r.length||this.raise(g.EmptyHeritageClauseType,s,{token:e}),r}tsParseInterfaceDeclaration(e,s={}){if(this.hasFollowingLineBreak())return null;this.expectContextual(129),s.declare&&(e.declare=!0),D(this.state.type)?(e.id=this.parseIdentifier(),this.checkIdentifier(e.id,130)):(e.id=null,this.raise(g.MissingInterfaceName,this.state.startLoc)),e.typeParameters=this.tsTryParseTypeParameters(this.tsParseInOutConstModifiers),this.eat(81)&&(e.extends=this.tsParseHeritageClause("extends"));let r=this.startNode();return r.body=this.tsInType(this.tsParseObjectTypeMembers.bind(this)),e.body=this.finishNode(r,"TSInterfaceBody"),this.finishNode(e,"TSInterfaceDeclaration")}tsParseTypeAliasDeclaration(e){return e.id=this.parseIdentifier(),this.checkIdentifier(e.id,2),e.typeAnnotation=this.tsInType(()=>{if(e.typeParameters=this.tsTryParseTypeParameters(this.tsParseInOutModifiers),this.expect(29),this.isContextual(114)&&this.lookahead().type!==16){let s=this.startNode();return this.next(),this.finishNode(s,"TSIntrinsicKeyword")}return this.tsParseType()}),this.semicolon(),this.finishNode(e,"TSTypeAliasDeclaration")}tsInTopLevelContext(e){if(this.curContext()!==k.brace){let s=this.state.context;this.state.context=[s[0]];try{return e()}finally{this.state.context=s}}else return e()}tsInType(e){let s=this.state.inType;this.state.inType=!0;try{return e()}finally{this.state.inType=s}}tsInDisallowConditionalTypesContext(e){let s=this.state.inDisallowConditionalTypesContext;this.state.inDisallowConditionalTypesContext=!0;try{return e()}finally{this.state.inDisallowConditionalTypesContext=s}}tsInAllowConditionalTypesContext(e){let s=this.state.inDisallowConditionalTypesContext;this.state.inDisallowConditionalTypesContext=!1;try{return e()}finally{this.state.inDisallowConditionalTypesContext=s}}tsEatThenParseType(e){if(this.match(e))return this.tsNextThenParseType()}tsExpectThenParseType(e){return this.tsInType(()=>(this.expect(e),this.tsParseType()))}tsNextThenParseType(){return this.tsInType(()=>(this.next(),this.tsParseType()))}tsParseEnumMember(){let e=this.startNode();return e.id=this.match(134)?super.parseStringLiteral(this.state.value):this.parseIdentifier(!0),this.eat(29)&&(e.initializer=super.parseMaybeAssignAllowIn()),this.finishNode(e,"TSEnumMember")}tsParseEnumDeclaration(e,s={}){return s.const&&(e.const=!0),s.declare&&(e.declare=!0),this.expectContextual(126),e.id=this.parseIdentifier(),this.checkIdentifier(e.id,e.const?8971:8459),this.expect(5),e.members=this.tsParseDelimitedList("EnumMembers",this.tsParseEnumMember.bind(this)),this.expect(8),this.finishNode(e,"TSEnumDeclaration")}tsParseEnumBody(){let e=this.startNode();return this.expect(5),e.members=this.tsParseDelimitedList("EnumMembers",this.tsParseEnumMember.bind(this)),this.expect(8),this.finishNode(e,"TSEnumBody")}tsParseModuleBlock(){let e=this.startNode();return this.scope.enter(0),this.expect(5),super.parseBlockOrModuleBlockBody(e.body=[],void 0,!0,8),this.scope.exit(),this.finishNode(e,"TSModuleBlock")}tsParseModuleOrNamespaceDeclaration(e,s=!1){if(e.id=this.parseIdentifier(),s||this.checkIdentifier(e.id,1024),this.eat(16)){let r=this.startNode();this.tsParseModuleOrNamespaceDeclaration(r,!0),e.body=r}else this.scope.enter(256),this.prodParam.enter(0),e.body=this.tsParseModuleBlock(),this.prodParam.exit(),this.scope.exit();return this.finishNode(e,"TSModuleDeclaration")}tsParseAmbientExternalModuleDeclaration(e){return this.isContextual(112)?(e.kind="global",e.global=!0,e.id=this.parseIdentifier()):this.match(134)?(e.kind="module",e.id=super.parseStringLiteral(this.state.value)):this.unexpected(),this.match(5)?(this.scope.enter(256),this.prodParam.enter(0),e.body=this.tsParseModuleBlock(),this.prodParam.exit(),this.scope.exit()):this.semicolon(),this.finishNode(e,"TSModuleDeclaration")}tsParseImportEqualsDeclaration(e,s,r){e.isExport=r||!1,e.id=s||this.parseIdentifier(),this.checkIdentifier(e.id,4096),this.expect(29);let i=this.tsParseModuleReference();return e.importKind==="type"&&i.type!=="TSExternalModuleReference"&&this.raise(g.ImportAliasHasImportType,i),e.moduleReference=i,this.semicolon(),this.finishNode(e,"TSImportEqualsDeclaration")}tsIsExternalModuleReference(){return this.isContextual(119)&&this.lookaheadCharCode()===40}tsParseModuleReference(){return this.tsIsExternalModuleReference()?this.tsParseExternalModuleReference():this.tsParseEntityName(0)}tsParseExternalModuleReference(){let e=this.startNode();return this.expectContextual(119),this.expect(10),this.match(134)||this.unexpected(),e.expression=super.parseExprAtom(),this.expect(11),this.sawUnambiguousESM=!0,this.finishNode(e,"TSExternalModuleReference")}tsLookAhead(e){let s=this.state.clone(),r=e();return this.state=s,r}tsTryParseAndCatch(e){let s=this.tryParse(r=>e()||r());if(!(s.aborted||!s.node))return s.error&&(this.state=s.failState),s.node}tsTryParse(e){let s=this.state.clone(),r=e();if(r!==void 0&&r!==!1)return r;this.state=s}tsTryParseDeclare(e){if(this.isLineTerminator())return;let s=this.state.type,r;return this.isContextual(100)&&(s=74,r="let"),this.tsInAmbientContext(()=>{switch(s){case 68:return e.declare=!0,super.parseFunctionStatement(e,!1,!1);case 80:return e.declare=!0,this.parseClass(e,!0,!1);case 126:return this.tsParseEnumDeclaration(e,{declare:!0});case 112:return this.tsParseAmbientExternalModuleDeclaration(e);case 75:case 74:return!this.match(75)||!this.isLookaheadContextual("enum")?(e.declare=!0,this.parseVarStatement(e,r||this.state.value,!0)):(this.expect(75),this.tsParseEnumDeclaration(e,{const:!0,declare:!0}));case 129:{let i=this.tsParseInterfaceDeclaration(e,{declare:!0});if(i)return i}default:if(D(s))return this.tsParseDeclaration(e,this.state.value,!0,null)}})}tsTryParseExportDeclaration(){return this.tsParseDeclaration(this.startNode(),this.state.value,!0,null)}tsParseExpressionStatement(e,s,r){switch(s.name){case"declare":{let i=this.tsTryParseDeclare(e);return i&&(i.declare=!0),i}case"global":if(this.match(5)){this.scope.enter(256),this.prodParam.enter(0);let i=e;return i.kind="global",e.global=!0,i.id=s,i.body=this.tsParseModuleBlock(),this.scope.exit(),this.prodParam.exit(),this.finishNode(i,"TSModuleDeclaration")}break;default:return this.tsParseDeclaration(e,s.name,!1,r)}}tsParseDeclaration(e,s,r,i){switch(s){case"abstract":if(this.tsCheckLineTerminator(r)&&(this.match(80)||D(this.state.type)))return this.tsParseAbstractDeclaration(e,i);break;case"module":if(this.tsCheckLineTerminator(r)){if(this.match(134))return this.tsParseAmbientExternalModuleDeclaration(e);if(D(this.state.type))return e.kind="module",this.tsParseModuleOrNamespaceDeclaration(e)}break;case"namespace":if(this.tsCheckLineTerminator(r)&&D(this.state.type))return e.kind="namespace",this.tsParseModuleOrNamespaceDeclaration(e);break;case"type":if(this.tsCheckLineTerminator(r)&&D(this.state.type))return this.tsParseTypeAliasDeclaration(e);break}}tsCheckLineTerminator(e){return e?this.hasFollowingLineBreak()?!1:(this.next(),!0):!this.isLineTerminator()}tsTryParseGenericAsyncArrowFunction(e){if(!this.match(47))return;let s=this.state.maybeInArrowParameters;this.state.maybeInArrowParameters=!0;let r=this.tsTryParseAndCatch(()=>{let i=this.startNodeAt(e);return i.typeParameters=this.tsParseTypeParameters(this.tsParseConstModifier),super.parseFunctionParams(i),i.returnType=this.tsTryParseTypeOrTypePredicateAnnotation(),this.expect(19),i});if(this.state.maybeInArrowParameters=s,!!r)return super.parseArrowExpression(r,null,!0)}tsParseTypeArgumentsInExpression(){if(this.reScan_lt()===47)return this.tsParseTypeArguments()}tsParseTypeArguments(){let e=this.startNode();return e.params=this.tsInType(()=>this.tsInTopLevelContext(()=>(this.expect(47),this.tsParseDelimitedList("TypeParametersOrArguments",this.tsParseType.bind(this))))),e.params.length===0?this.raise(g.EmptyTypeArguments,e):!this.state.inType&&this.curContext()===k.brace&&this.reScan_lt_gt(),this.expect(48),this.finishNode(e,"TSTypeParameterInstantiation")}tsIsDeclarationStart(){return Ts(this.state.type)}isExportDefaultSpecifier(){return this.tsIsDeclarationStart()?!1:super.isExportDefaultSpecifier()}parseAssignableListItem(e,s){let r=this.state.startLoc,i={};this.tsParseModifiers({allowedModifiers:["public","private","protected","override","readonly"]},i);let a=i.accessibility,n=i.override,o=i.readonly;!(e&4)&&(a||o||n)&&this.raise(g.UnexpectedParameterModifier,r);let h=this.parseMaybeDefault();e&2&&this.parseFunctionParamType(h);let l=this.parseMaybeDefault(h.loc.start,h);if(a||o||n){let d=this.startNodeAt(r);return s.length&&(d.decorators=s),a&&(d.accessibility=a),o&&(d.readonly=o),n&&(d.override=n),l.type!=="Identifier"&&l.type!=="AssignmentPattern"&&this.raise(g.UnsupportedParameterPropertyKind,d),d.parameter=l,this.finishNode(d,"TSParameterProperty")}return s.length&&(h.decorators=s),l}isSimpleParameter(e){return e.type==="TSParameterProperty"&&super.isSimpleParameter(e.parameter)||super.isSimpleParameter(e)}tsDisallowOptionalPattern(e){for(let s of e.params)s.type!=="Identifier"&&s.optional&&!this.state.isAmbientContext&&this.raise(g.PatternIsOptional,s)}setArrowFunctionParameters(e,s,r){super.setArrowFunctionParameters(e,s,r),this.tsDisallowOptionalPattern(e)}parseFunctionBodyAndFinish(e,s,r=!1){this.match(14)&&(e.returnType=this.tsParseTypeOrTypePredicateAnnotation(14));let i=s==="FunctionDeclaration"?"TSDeclareFunction":s==="ClassMethod"||s==="ClassPrivateMethod"?"TSDeclareMethod":void 0;return i&&!this.match(5)&&this.isLineTerminator()?this.finishNode(e,i):i==="TSDeclareFunction"&&this.state.isAmbientContext&&(this.raise(g.DeclareFunctionHasImplementation,e),e.declare)?super.parseFunctionBodyAndFinish(e,i,r):(this.tsDisallowOptionalPattern(e),super.parseFunctionBodyAndFinish(e,s,r))}registerFunctionStatementId(e){!e.body&&e.id?this.checkIdentifier(e.id,1024):super.registerFunctionStatementId(e)}tsCheckForInvalidTypeCasts(e){e.forEach(s=>{(s==null?void 0:s.type)==="TSTypeCastExpression"&&this.raise(g.UnexpectedTypeAnnotation,s.typeAnnotation)})}toReferencedList(e,s){return this.tsCheckForInvalidTypeCasts(e),e}parseArrayLike(e,s,r,i){let a=super.parseArrayLike(e,s,r,i);return a.type==="ArrayExpression"&&this.tsCheckForInvalidTypeCasts(a.elements),a}parseSubscript(e,s,r,i){if(!this.hasPrecedingLineBreak()&&this.match(35)){this.state.canStartJSXElement=!1,this.next();let n=this.startNodeAt(s);return n.expression=e,this.finishNode(n,"TSNonNullExpression")}let a=!1;if(this.match(18)&&this.lookaheadCharCode()===60){if(r)return i.stop=!0,e;i.optionalChainMember=a=!0,this.next()}if(this.match(47)||this.match(51)){let n,o=this.tsTryParseAndCatch(()=>{if(!r&&this.atPossibleAsyncArrow(e)){let y=this.tsTryParseGenericAsyncArrowFunction(s);if(y)return y}let h=this.tsParseTypeArgumentsInExpression();if(!h)return;if(a&&!this.match(10)){n=this.state.curPosition();return}if(xe(this.state.type)){let y=super.parseTaggedTemplateExpression(e,s,i);return y.typeParameters=h,y}if(!r&&this.eat(10)){let y=this.startNodeAt(s);return y.callee=e,y.arguments=this.parseCallExpressionArguments(11),this.tsCheckForInvalidTypeCasts(y.arguments),y.typeParameters=h,i.optionalChainMember&&(y.optional=a),this.finishCallExpression(y,i.optionalChainMember)}let l=this.state.type;if(l===48||l===52||l!==10&&Le(l)&&!this.hasPrecedingLineBreak())return;let d=this.startNodeAt(s);return d.expression=e,d.typeParameters=h,this.finishNode(d,"TSInstantiationExpression")});if(n&&this.unexpected(n,10),o)return o.type==="TSInstantiationExpression"&&(this.match(16)||this.match(18)&&this.lookaheadCharCode()!==40)&&this.raise(g.InvalidPropertyAccessAfterInstantiationExpression,this.state.startLoc),o}return super.parseSubscript(e,s,r,i)}parseNewCallee(e){var s;super.parseNewCallee(e);let{callee:r}=e;r.type==="TSInstantiationExpression"&&!((s=r.extra)!=null&&s.parenthesized)&&(e.typeParameters=r.typeParameters,e.callee=r.expression)}parseExprOp(e,s,r){let i;if(ye(58)>r&&!this.hasPrecedingLineBreak()&&(this.isContextual(93)||(i=this.isContextual(120)))){let a=this.startNodeAt(s);return a.expression=e,a.typeAnnotation=this.tsInType(()=>(this.next(),this.match(75)?(i&&this.raise(u.UnexpectedKeyword,this.state.startLoc,{keyword:"const"}),this.tsParseTypeReference()):this.tsParseType())),this.finishNode(a,i?"TSSatisfiesExpression":"TSAsExpression"),this.reScan_lt_gt(),this.parseExprOp(a,s,r)}return super.parseExprOp(e,s,r)}checkReservedWord(e,s,r,i){this.state.isAmbientContext||super.checkReservedWord(e,s,r,i)}checkImportReflection(e){super.checkImportReflection(e),e.module&&e.importKind!=="value"&&this.raise(g.ImportReflectionHasImportType,e.specifiers[0].loc.start)}checkDuplicateExports(){}isPotentialImportPhase(e){if(super.isPotentialImportPhase(e))return!0;if(this.isContextual(130)){let s=this.lookaheadCharCode();return e?s===123||s===42:s!==61}return!e&&this.isContextual(87)}applyImportPhase(e,s,r,i){super.applyImportPhase(e,s,r,i),s?e.exportKind=r==="type"?"type":"value":e.importKind=r==="type"||r==="typeof"?r:"value"}parseImport(e){if(this.match(134))return e.importKind="value",super.parseImport(e);let s;if(D(this.state.type)&&this.lookaheadCharCode()===61)return e.importKind="value",this.tsParseImportEqualsDeclaration(e);if(this.isContextual(130)){let r=this.parseMaybeImportPhase(e,!1);if(this.lookaheadCharCode()===61)return this.tsParseImportEqualsDeclaration(e,r);s=super.parseImportSpecifiersAndAfter(e,r)}else s=super.parseImport(e);return s.importKind==="type"&&s.specifiers.length>1&&s.specifiers[0].type==="ImportDefaultSpecifier"&&this.raise(g.TypeImportCannotSpecifyDefaultAndNamed,s),s}parseExport(e,s){if(this.match(83)){let r=e;this.next();let i=null;return this.isContextual(130)&&this.isPotentialImportPhase(!1)?i=this.parseMaybeImportPhase(r,!1):r.importKind="value",this.tsParseImportEqualsDeclaration(r,i,!0)}else if(this.eat(29)){let r=e;return r.expression=super.parseExpression(),this.semicolon(),this.sawUnambiguousESM=!0,this.finishNode(r,"TSExportAssignment")}else if(this.eatContextual(93)){let r=e;return this.expectContextual(128),r.id=this.parseIdentifier(),this.semicolon(),this.finishNode(r,"TSNamespaceExportDeclaration")}else return super.parseExport(e,s)}isAbstractClass(){return this.isContextual(124)&&this.lookahead().type===80}parseExportDefaultExpression(){if(this.isAbstractClass()){let e=this.startNode();return this.next(),e.abstract=!0,this.parseClass(e,!0,!0)}if(this.match(129)){let e=this.tsParseInterfaceDeclaration(this.startNode());if(e)return e}return super.parseExportDefaultExpression()}parseVarStatement(e,s,r=!1){let{isAmbientContext:i}=this.state,a=super.parseVarStatement(e,s,r||i);if(!i)return a;for(let{id:n,init:o}of a.declarations)o&&(s!=="const"||n.typeAnnotation?this.raise(g.InitializerNotAllowedInAmbientContext,o):Pr(o,this.hasPlugin("estree"))||this.raise(g.ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference,o));return a}parseStatementContent(e,s){if(this.match(75)&&this.isLookaheadContextual("enum")){let r=this.startNode();return this.expect(75),this.tsParseEnumDeclaration(r,{const:!0})}if(this.isContextual(126))return this.tsParseEnumDeclaration(this.startNode());if(this.isContextual(129)){let r=this.tsParseInterfaceDeclaration(this.startNode());if(r)return r}return super.parseStatementContent(e,s)}parseAccessModifier(){return this.tsParseModifier(["public","protected","private"])}tsHasSomeModifiers(e,s){return s.some(r=>Et(r)?e.accessibility===r:!!e[r])}tsIsStartOfStaticBlocks(){return this.isContextual(106)&&this.lookaheadCharCode()===123}parseClassMember(e,s,r){let i=["declare","private","public","protected","override","abstract","readonly","static"];this.tsParseModifiers({allowedModifiers:i,disallowedModifiers:["in","out"],stopOnStartOfClassStaticBlock:!0,errorTemplate:g.InvalidModifierOnTypeParameterPositions},s);let a=()=>{this.tsIsStartOfStaticBlocks()?(this.next(),this.next(),this.tsHasSomeModifiers(s,i)&&this.raise(g.StaticBlockCannotHaveModifier,this.state.curPosition()),super.parseClassStaticBlock(e,s)):this.parseClassMemberWithIsStatic(e,s,r,!!s.static)};s.declare?this.tsInAmbientContext(a):a()}parseClassMemberWithIsStatic(e,s,r,i){let a=this.tsTryParseIndexSignature(s);if(a){e.body.push(a),s.abstract&&this.raise(g.IndexSignatureHasAbstract,s),s.accessibility&&this.raise(g.IndexSignatureHasAccessibility,s,{modifier:s.accessibility}),s.declare&&this.raise(g.IndexSignatureHasDeclare,s),s.override&&this.raise(g.IndexSignatureHasOverride,s);return}!this.state.inAbstractClass&&s.abstract&&this.raise(g.NonAbstractClassHasAbstractMethod,s),s.override&&(r.hadSuperClass||this.raise(g.OverrideNotInSubClass,s)),super.parseClassMemberWithIsStatic(e,s,r,i)}parsePostMemberNameModifiers(e){this.eat(17)&&(e.optional=!0),e.readonly&&this.match(10)&&this.raise(g.ClassMethodHasReadonly,e),e.declare&&this.match(10)&&this.raise(g.ClassMethodHasDeclare,e)}parseExpressionStatement(e,s,r){return(s.type==="Identifier"?this.tsParseExpressionStatement(e,s,r):void 0)||super.parseExpressionStatement(e,s,r)}shouldParseExportDeclaration(){return this.tsIsDeclarationStart()?!0:super.shouldParseExportDeclaration()}parseConditional(e,s,r){if(!this.state.maybeInArrowParameters||!this.match(17))return super.parseConditional(e,s,r);let i=this.tryParse(()=>super.parseConditional(e,s));return i.node?(i.error&&(this.state=i.failState),i.node):(i.error&&super.setOptionalParametersError(r,i.error),e)}parseParenItem(e,s){let r=super.parseParenItem(e,s);if(this.eat(17)&&(r.optional=!0,this.resetEndLocation(e)),this.match(14)){let i=this.startNodeAt(s);return i.expression=e,i.typeAnnotation=this.tsParseTypeAnnotation(),this.finishNode(i,"TSTypeCastExpression")}return e}parseExportDeclaration(e){if(!this.state.isAmbientContext&&this.isContextual(125))return this.tsInAmbientContext(()=>this.parseExportDeclaration(e));let s=this.state.startLoc,r=this.eatContextual(125);if(r&&(this.isContextual(125)||!this.shouldParseExportDeclaration()))throw this.raise(g.ExpectedAmbientAfterExportDeclare,this.state.startLoc);let i=D(this.state.type)&&this.tsTryParseExportDeclaration()||super.parseExportDeclaration(e);return i?((i.type==="TSInterfaceDeclaration"||i.type==="TSTypeAliasDeclaration"||r)&&(e.exportKind="type"),r&&i.type!=="TSImportEqualsDeclaration"&&(this.resetStartLocation(i,s),i.declare=!0),i):null}parseClassId(e,s,r,i){if((!s||r)&&this.isContextual(113))return;super.parseClassId(e,s,r,e.declare?1024:8331);let a=this.tsTryParseTypeParameters(this.tsParseInOutConstModifiers);a&&(e.typeParameters=a)}parseClassPropertyAnnotation(e){e.optional||(this.eat(35)?e.definite=!0:this.eat(17)&&(e.optional=!0));let s=this.tsTryParseTypeAnnotation();s&&(e.typeAnnotation=s)}parseClassProperty(e){if(this.parseClassPropertyAnnotation(e),this.state.isAmbientContext&&!(e.readonly&&!e.typeAnnotation)&&this.match(29)&&this.raise(g.DeclareClassFieldHasInitializer,this.state.startLoc),e.abstract&&this.match(29)){let{key:s}=e;this.raise(g.AbstractPropertyHasInitializer,this.state.startLoc,{propertyName:s.type==="Identifier"&&!e.computed?s.name:`[${this.input.slice(this.offsetToSourcePos(s.start),this.offsetToSourcePos(s.end))}]`})}return super.parseClassProperty(e)}parseClassPrivateProperty(e){return e.abstract&&this.raise(g.PrivateElementHasAbstract,e),e.accessibility&&this.raise(g.PrivateElementHasAccessibility,e,{modifier:e.accessibility}),this.parseClassPropertyAnnotation(e),super.parseClassPrivateProperty(e)}parseClassAccessorProperty(e){return this.parseClassPropertyAnnotation(e),e.optional&&this.raise(g.AccessorCannotBeOptional,e),super.parseClassAccessorProperty(e)}pushClassMethod(e,s,r,i,a,n){let o=this.tsTryParseTypeParameters(this.tsParseConstModifier);o&&a&&this.raise(g.ConstructorHasTypeParameters,o);let{declare:h=!1,kind:l}=s;h&&(l==="get"||l==="set")&&this.raise(g.DeclareAccessor,s,{kind:l}),o&&(s.typeParameters=o),super.pushClassMethod(e,s,r,i,a,n)}pushClassPrivateMethod(e,s,r,i){let a=this.tsTryParseTypeParameters(this.tsParseConstModifier);a&&(s.typeParameters=a),super.pushClassPrivateMethod(e,s,r,i)}declareClassPrivateMethodInScope(e,s){e.type!=="TSDeclareMethod"&&(e.type==="MethodDefinition"&&!hasOwnProperty.call(e.value,"body")||super.declareClassPrivateMethodInScope(e,s))}parseClassSuper(e){super.parseClassSuper(e),e.superClass&&(this.match(47)||this.match(51))&&(e.superTypeParameters=this.tsParseTypeArgumentsInExpression()),this.eatContextual(113)&&(e.implements=this.tsParseHeritageClause("implements"))}parseObjPropValue(e,s,r,i,a,n,o){let h=this.tsTryParseTypeParameters(this.tsParseConstModifier);return h&&(e.typeParameters=h),super.parseObjPropValue(e,s,r,i,a,n,o)}parseFunctionParams(e,s){let r=this.tsTryParseTypeParameters(this.tsParseConstModifier);r&&(e.typeParameters=r),super.parseFunctionParams(e,s)}parseVarId(e,s){super.parseVarId(e,s),e.id.type==="Identifier"&&!this.hasPrecedingLineBreak()&&this.eat(35)&&(e.definite=!0);let r=this.tsTryParseTypeAnnotation();r&&(e.id.typeAnnotation=r,this.resetEndLocation(e.id))}parseAsyncArrowFromCallExpression(e,s){return this.match(14)&&(e.returnType=this.tsParseTypeAnnotation()),super.parseAsyncArrowFromCallExpression(e,s)}parseMaybeAssign(e,s){var r,i,a,n,o;let h,l,d;if(this.hasPlugin("jsx")&&(this.match(143)||this.match(47))){if(h=this.state.clone(),l=this.tryParse(()=>super.parseMaybeAssign(e,s),h),!l.error)return l.node;let{context:T}=this.state,N=T[T.length-1];(N===k.j_oTag||N===k.j_expr)&&T.pop()}if(!((r=l)!=null&&r.error)&&!this.match(47))return super.parseMaybeAssign(e,s);(!h||h===this.state)&&(h=this.state.clone());let y,A=this.tryParse(T=>{var N,L;y=this.tsParseTypeParameters(this.tsParseConstModifier);let F=super.parseMaybeAssign(e,s);return(F.type!=="ArrowFunctionExpression"||(N=F.extra)!=null&&N.parenthesized)&&T(),((L=y)==null?void 0:L.params.length)!==0&&this.resetStartLocationFromNode(F,y),F.typeParameters=y,F},h);if(!A.error&&!A.aborted)return y&&this.reportReservedArrowTypeParam(y),A.node;if(!l&&(bt(!this.hasPlugin("jsx")),d=this.tryParse(()=>super.parseMaybeAssign(e,s),h),!d.error))return d.node;if((i=l)!=null&&i.node)return this.state=l.failState,l.node;if(A.node)return this.state=A.failState,y&&this.reportReservedArrowTypeParam(y),A.node;if((a=d)!=null&&a.node)return this.state=d.failState,d.node;throw((n=l)==null?void 0:n.error)||A.error||((o=d)==null?void 0:o.error)}reportReservedArrowTypeParam(e){var s;e.params.length===1&&!e.params[0].constraint&&!((s=e.extra)!=null&&s.trailingComma)&&this.getPluginOption("typescript","disallowAmbiguousJSXLike")&&this.raise(g.ReservedArrowTypeParam,e)}parseMaybeUnary(e,s){return!this.hasPlugin("jsx")&&this.match(47)?this.tsParseTypeAssertion():super.parseMaybeUnary(e,s)}parseArrow(e){if(this.match(14)){let s=this.tryParse(r=>{let i=this.tsParseTypeOrTypePredicateAnnotation(14);return(this.canInsertSemicolon()||!this.match(19))&&r(),i});if(s.aborted)return;s.thrown||(s.error&&(this.state=s.failState),e.returnType=s.node)}return super.parseArrow(e)}parseFunctionParamType(e){this.eat(17)&&(e.optional=!0);let s=this.tsTryParseTypeAnnotation();return s&&(e.typeAnnotation=s),this.resetEndLocation(e),e}isAssignable(e,s){switch(e.type){case"TSTypeCastExpression":return this.isAssignable(e.expression,s);case"TSParameterProperty":return!0;default:return super.isAssignable(e,s)}}toAssignable(e,s=!1){switch(e.type){case"ParenthesizedExpression":this.toAssignableParenthesizedExpression(e,s);break;case"TSAsExpression":case"TSSatisfiesExpression":case"TSNonNullExpression":case"TSTypeAssertion":s?this.expressionScope.recordArrowParameterBindingError(g.UnexpectedTypeCastInParameter,e):this.raise(g.UnexpectedTypeCastInParameter,e),this.toAssignable(e.expression,s);break;case"AssignmentExpression":!s&&e.left.type==="TSTypeCastExpression"&&(e.left=this.typeCastToParameter(e.left));default:super.toAssignable(e,s)}}toAssignableParenthesizedExpression(e,s){switch(e.expression.type){case"TSAsExpression":case"TSSatisfiesExpression":case"TSNonNullExpression":case"TSTypeAssertion":case"ParenthesizedExpression":this.toAssignable(e.expression,s);break;default:super.toAssignable(e,s)}}checkToRestConversion(e,s){switch(e.type){case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":case"TSNonNullExpression":this.checkToRestConversion(e.expression,!1);break;default:super.checkToRestConversion(e,s)}}isValidLVal(e,s,r){switch(e){case"TSTypeCastExpression":return!0;case"TSParameterProperty":return"parameter";case"TSNonNullExpression":case"TSInstantiationExpression":return"expression";case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":return(r!==64||!s)&&["expression",!0];default:return super.isValidLVal(e,s,r)}}parseBindingAtom(){return this.state.type===78?this.parseIdentifier(!0):super.parseBindingAtom()}parseMaybeDecoratorArguments(e,s){if(this.match(47)||this.match(51)){let r=this.tsParseTypeArgumentsInExpression();if(this.match(10)){let i=super.parseMaybeDecoratorArguments(e,s);return i.typeParameters=r,i}this.unexpected(null,10)}return super.parseMaybeDecoratorArguments(e,s)}checkCommaAfterRest(e){return this.state.isAmbientContext&&this.match(12)&&this.lookaheadCharCode()===e?(this.next(),!1):super.checkCommaAfterRest(e)}isClassMethod(){return this.match(47)||super.isClassMethod()}isClassProperty(){return this.match(35)||this.match(14)||super.isClassProperty()}parseMaybeDefault(e,s){let r=super.parseMaybeDefault(e,s);return r.type==="AssignmentPattern"&&r.typeAnnotation&&r.right.startthis.isAssignable(s,!0)):super.shouldParseArrow(e)}shouldParseAsyncArrow(){return this.match(14)||super.shouldParseAsyncArrow()}canHaveLeadingDecorator(){return super.canHaveLeadingDecorator()||this.isAbstractClass()}jsxParseOpeningElementAfterName(e){if(this.match(47)||this.match(51)){let s=this.tsTryParseAndCatch(()=>this.tsParseTypeArgumentsInExpression());s&&(e.typeParameters=s)}return super.jsxParseOpeningElementAfterName(e)}getGetterSetterExpectedParamCount(e){let s=super.getGetterSetterExpectedParamCount(e),r=this.getObjectOrClassMethodParams(e)[0];return r&&this.isThisParam(r)?s+1:s}parseCatchClauseParam(){let e=super.parseCatchClauseParam(),s=this.tsTryParseTypeAnnotation();return s&&(e.typeAnnotation=s,this.resetEndLocation(e)),e}tsInAmbientContext(e){let{isAmbientContext:s,strict:r}=this.state;this.state.isAmbientContext=!0,this.state.strict=!1;try{return e()}finally{this.state.isAmbientContext=s,this.state.strict=r}}parseClass(e,s,r){let i=this.state.inAbstractClass;this.state.inAbstractClass=!!e.abstract;try{return super.parseClass(e,s,r)}finally{this.state.inAbstractClass=i}}tsParseAbstractDeclaration(e,s){if(this.match(80))return e.abstract=!0,this.maybeTakeDecorators(s,this.parseClass(e,!0,!1));if(this.isContextual(129)){if(!this.hasFollowingLineBreak())return e.abstract=!0,this.raise(g.NonClassMethodPropertyHasAbstractModifer,e),this.tsParseInterfaceDeclaration(e)}else this.unexpected(null,80)}parseMethod(e,s,r,i,a,n,o){let h=super.parseMethod(e,s,r,i,a,n,o);if(h.abstract&&(this.hasPlugin("estree")?h.value:h).body){let{key:l}=h;this.raise(g.AbstractMethodHasImplementation,h,{methodName:l.type==="Identifier"&&!h.computed?l.name:`[${this.input.slice(this.offsetToSourcePos(l.start),this.offsetToSourcePos(l.end))}]`})}return h}tsParseTypeParameterName(){return this.parseIdentifier().name}shouldParseAsAmbientContext(){return!!this.getPluginOption("typescript","dts")}parse(){return this.shouldParseAsAmbientContext()&&(this.state.isAmbientContext=!0),super.parse()}getExpression(){return this.shouldParseAsAmbientContext()&&(this.state.isAmbientContext=!0),super.getExpression()}parseExportSpecifier(e,s,r,i){return!s&&i?(this.parseTypeOnlyImportExportSpecifier(e,!1,r),this.finishNode(e,"ExportSpecifier")):(e.exportKind="value",super.parseExportSpecifier(e,s,r,i))}parseImportSpecifier(e,s,r,i,a){return!s&&i?(this.parseTypeOnlyImportExportSpecifier(e,!0,r),this.finishNode(e,"ImportSpecifier")):(e.importKind="value",super.parseImportSpecifier(e,s,r,i,r?4098:4096))}parseTypeOnlyImportExportSpecifier(e,s,r){let i=s?"imported":"local",a=s?"local":"exported",n=e[i],o,h=!1,l=!0,d=n.loc.start;if(this.isContextual(93)){let A=this.parseIdentifier();if(this.isContextual(93)){let T=this.parseIdentifier();U(this.state.type)?(h=!0,n=A,o=s?this.parseIdentifier():this.parseModuleExportName(),l=!1):(o=T,l=!1)}else U(this.state.type)?(l=!1,o=s?this.parseIdentifier():this.parseModuleExportName()):(h=!0,n=A)}else U(this.state.type)&&(h=!0,s?(n=this.parseIdentifier(!0),this.isContextual(93)||this.checkReservedWord(n.name,n.loc.start,!0,!0)):n=this.parseModuleExportName());h&&r&&this.raise(s?g.TypeModifierIsUsedInTypeImports:g.TypeModifierIsUsedInTypeExports,d),e[i]=n,e[a]=o;let y=s?"importKind":"exportKind";e[y]=h?"type":"value",l&&this.eatContextual(93)&&(e[a]=s?this.parseIdentifier():this.parseModuleExportName()),e[a]||(e[a]=$(e[i])),s&&this.checkIdentifier(e[a],h?4098:4096)}};function xr(t){if(t.type!=="MemberExpression")return!1;let{computed:e,property:s}=t;return e&&s.type!=="StringLiteral"&&(s.type!=="TemplateLiteral"||s.expressions.length>0)?!1:St(t.object)}function Pr(t,e){var s;let{type:r}=t;if((s=t.extra)!=null&&s.parenthesized)return!1;if(e){if(r==="Literal"){let{value:i}=t;if(typeof i=="string"||typeof i=="boolean")return!0}}else if(r==="StringLiteral"||r==="BooleanLiteral")return!0;return!!(Ct(t,e)||Ar(t,e)||r==="TemplateLiteral"&&t.expressions.length===0||xr(t))}function Ct(t,e){return e?t.type==="Literal"&&(typeof t.value=="number"||"bigint"in t):t.type==="NumericLiteral"||t.type==="BigIntLiteral"}function Ar(t,e){if(t.type==="UnaryExpression"){let{operator:s,argument:r}=t;if(s==="-"&&Ct(r,e))return!0}return!1}function St(t){return t.type==="Identifier"?!0:t.type!=="MemberExpression"||t.computed?!1:St(t.object)}var wt=H`placeholders`({ClassNameIsRequired:"A class name is required.",UnexpectedSpace:"Unexpected space in placeholder."}),gr=t=>class extends t{parsePlaceholder(e){if(this.match(133)){let s=this.startNode();return this.next(),this.assertNoSpace(),s.name=super.parseIdentifier(!0),this.assertNoSpace(),this.expect(133),this.finishPlaceholder(s,e)}}finishPlaceholder(e,s){let r=e;return(!r.expectedNode||!r.type)&&(r=this.finishNode(r,"Placeholder")),r.expectedNode=s,r}getTokenFromCode(e){e===37&&this.input.charCodeAt(this.state.pos+1)===37?this.finishOp(133,2):super.getTokenFromCode(e)}parseExprAtom(e){return this.parsePlaceholder("Expression")||super.parseExprAtom(e)}parseIdentifier(e){return this.parsePlaceholder("Identifier")||super.parseIdentifier(e)}checkReservedWord(e,s,r,i){e!==void 0&&super.checkReservedWord(e,s,r,i)}parseBindingAtom(){return this.parsePlaceholder("Pattern")||super.parseBindingAtom()}isValidLVal(e,s,r){return e==="Placeholder"||super.isValidLVal(e,s,r)}toAssignable(e,s){e&&e.type==="Placeholder"&&e.expectedNode==="Expression"?e.expectedNode="Pattern":super.toAssignable(e,s)}chStartsBindingIdentifier(e,s){return!!(super.chStartsBindingIdentifier(e,s)||this.lookahead().type===133)}verifyBreakContinue(e,s){e.label&&e.label.type==="Placeholder"||super.verifyBreakContinue(e,s)}parseExpressionStatement(e,s){var r;if(s.type!=="Placeholder"||(r=s.extra)!=null&&r.parenthesized)return super.parseExpressionStatement(e,s);if(this.match(14)){let a=e;return a.label=this.finishPlaceholder(s,"Identifier"),this.next(),a.body=super.parseStatementOrSloppyAnnexBFunctionDeclaration(),this.finishNode(a,"LabeledStatement")}this.semicolon();let i=e;return i.name=s.name,this.finishPlaceholder(i,"Statement")}parseBlock(e,s,r){return this.parsePlaceholder("BlockStatement")||super.parseBlock(e,s,r)}parseFunctionId(e){return this.parsePlaceholder("Identifier")||super.parseFunctionId(e)}parseClass(e,s,r){let i=s?"ClassDeclaration":"ClassExpression";this.next();let a=this.state.strict,n=this.parsePlaceholder("Identifier");if(n)if(this.match(81)||this.match(133)||this.match(5))e.id=n;else{if(r||!s)return e.id=null,e.body=this.finishPlaceholder(n,"ClassBody"),this.finishNode(e,i);throw this.raise(wt.ClassNameIsRequired,this.state.startLoc)}else this.parseClassId(e,s,r);return super.parseClassSuper(e),e.body=this.parsePlaceholder("ClassBody")||super.parseClassBody(!!e.superClass,a),this.finishNode(e,i)}parseExport(e,s){let r=this.parsePlaceholder("Identifier");if(!r)return super.parseExport(e,s);let i=e;if(!this.isContextual(98)&&!this.match(12))return i.specifiers=[],i.source=null,i.declaration=this.finishPlaceholder(r,"Declaration"),this.finishNode(i,"ExportNamedDeclaration");this.expectPlugin("exportDefaultFrom");let a=this.startNode();return a.exported=r,i.specifiers=[this.finishNode(a,"ExportDefaultSpecifier")],super.parseExport(i,s)}isExportDefaultSpecifier(){if(this.match(65)){let e=this.nextTokenStart();if(this.isUnparsedContextual(e,"from")&&this.input.startsWith(W(133),this.nextTokenStartSince(e+4)))return!0}return super.isExportDefaultSpecifier()}maybeParseExportDefaultSpecifier(e,s){var r;return(r=e.specifiers)!=null&&r.length?!0:super.maybeParseExportDefaultSpecifier(e,s)}checkExport(e){let{specifiers:s}=e;s!=null&&s.length&&(e.specifiers=s.filter(r=>r.exported.type==="Placeholder")),super.checkExport(e),e.specifiers=s}parseImport(e){let s=this.parsePlaceholder("Identifier");if(!s)return super.parseImport(e);if(e.specifiers=[],!this.isContextual(98)&&!this.match(12))return e.source=this.finishPlaceholder(s,"StringLiteral"),this.semicolon(),this.finishNode(e,"ImportDeclaration");let r=this.startNodeAtNode(s);return r.local=s,e.specifiers.push(this.finishNode(r,"ImportDefaultSpecifier")),this.eat(12)&&(this.maybeParseStarImportSpecifier(e)||this.parseNamedImportSpecifiers(e)),this.expectContextual(98),e.source=this.parseImportSource(),this.semicolon(),this.finishNode(e,"ImportDeclaration")}parseImportSource(){return this.parsePlaceholder("StringLiteral")||super.parseImportSource()}assertNoSpace(){this.state.start>this.offsetToSourcePos(this.state.lastTokEndLoc.index)&&this.raise(wt.UnexpectedSpace,this.state.lastTokEndLoc)}},Tr=t=>class extends t{parseV8Intrinsic(){if(this.match(54)){let e=this.state.startLoc,s=this.startNode();if(this.next(),D(this.state.type)){let r=this.parseIdentifierName(),i=this.createIdentifier(s,r);if(i.type="V8IntrinsicIdentifier",this.match(10))return i}this.unexpected(e)}}parseExprAtom(e){return this.parseV8Intrinsic()||super.parseExprAtom(e)}},It=["minimal","fsharp","hack","smart"],Nt=["^^","@@","^","%","#"];function br(t){if(t.has("decorators")){if(t.has("decorators-legacy"))throw new Error("Cannot use the decorators and decorators-legacy plugin together");let s=t.get("decorators").decoratorsBeforeExport;if(s!=null&&typeof s!="boolean")throw new Error("'decoratorsBeforeExport' must be a boolean, if specified.");let r=t.get("decorators").allowCallParenthesized;if(r!=null&&typeof r!="boolean")throw new Error("'allowCallParenthesized' must be a boolean.")}if(t.has("flow")&&t.has("typescript"))throw new Error("Cannot combine flow and typescript plugins.");if(t.has("placeholders")&&t.has("v8intrinsic"))throw new Error("Cannot combine placeholders and v8intrinsic plugins.");if(t.has("pipelineOperator")){var e;let s=t.get("pipelineOperator").proposal;if(!It.includes(s)){let i=It.map(a=>`"${a}"`).join(", ");throw new Error(`"pipelineOperator" requires "proposal" option whose value must be one of: ${i}.`)}let r=((e=t.get("recordAndTuple"))==null?void 0:e.syntaxType)==="hash";if(s==="hack"){if(t.has("placeholders"))throw new Error("Cannot combine placeholders plugin and Hack-style pipes.");if(t.has("v8intrinsic"))throw new Error("Cannot combine v8intrinsic plugin and Hack-style pipes.");let i=t.get("pipelineOperator").topicToken;if(!Nt.includes(i)){let a=Nt.map(n=>`"${n}"`).join(", ");throw new Error(`"pipelineOperator" in "proposal": "hack" mode also requires a "topicToken" option whose value must be one of: ${a}.`)}if(i==="#"&&r)throw new Error(`Plugin conflict between \`["pipelineOperator", { proposal: "hack", topicToken: "#" }]\` and \`${JSON.stringify(["recordAndTuple",t.get("recordAndTuple")])}\`.`)}else if(s==="smart"&&r)throw new Error(`Plugin conflict between \`["pipelineOperator", { proposal: "smart" }]\` and \`${JSON.stringify(["recordAndTuple",t.get("recordAndTuple")])}\`.`)}if(t.has("moduleAttributes")){if(t.has("deprecatedImportAssert")||t.has("importAssertions"))throw new Error("Cannot combine importAssertions, deprecatedImportAssert and moduleAttributes plugins.");if(t.get("moduleAttributes").version!=="may-2020")throw new Error("The 'moduleAttributes' plugin requires a 'version' option, representing the last proposal update. Currently, the only supported value is 'may-2020'.")}if(t.has("importAssertions")&&t.has("deprecatedImportAssert"))throw new Error("Cannot combine importAssertions and deprecatedImportAssert plugins.");if(!t.has("deprecatedImportAssert")&&t.has("importAttributes")&&t.get("importAttributes").deprecatedAssertSyntax&&t.set("deprecatedImportAssert",{}),t.has("recordAndTuple")){let s=t.get("recordAndTuple").syntaxType;if(s!=null){let r=["hash","bar"];if(!r.includes(s))throw new Error("The 'syntaxType' option of the 'recordAndTuple' plugin must be one of: "+r.map(i=>`'${i}'`).join(", "))}}if(t.has("asyncDoExpressions")&&!t.has("doExpressions")){let s=new Error("'asyncDoExpressions' requires 'doExpressions', please add 'doExpressions' to parser plugins.");throw s.missingPlugins="doExpressions",s}if(t.has("optionalChainingAssign")&&t.get("optionalChainingAssign").version!=="2023-07")throw new Error("The 'optionalChainingAssign' plugin requires a 'version' option, representing the last proposal update. Currently, the only supported value is '2023-07'.")}var vt={estree:ps,jsx:hr,flow:lr,typescript:yr,v8intrinsic:Tr,placeholders:gr},Er=Object.keys(vt),Cr=class extends cr{checkProto(t,e,s,r){if(t.type==="SpreadElement"||this.isObjectMethod(t)||t.computed||t.shorthand)return;let i=t.key;if((i.type==="Identifier"?i.name:i.value)==="__proto__"){if(e){this.raise(u.RecordNoProto,i);return}s.used&&(r?r.doubleProtoLoc===null&&(r.doubleProtoLoc=i.loc.start):this.raise(u.DuplicateProto,i)),s.used=!0}}shouldExitDescending(t,e){return t.type==="ArrowFunctionExpression"&&this.offsetToSourcePos(t.start)===e}getExpression(){this.enterInitialScopes(),this.nextToken();let t=this.parseExpression();return this.match(140)||this.unexpected(),this.finalizeRemainingComments(),t.comments=this.comments,t.errors=this.state.errors,this.optionFlags&128&&(t.tokens=this.tokens),t}parseExpression(t,e){return t?this.disallowInAnd(()=>this.parseExpressionBase(e)):this.allowInAnd(()=>this.parseExpressionBase(e))}parseExpressionBase(t){let e=this.state.startLoc,s=this.parseMaybeAssign(t);if(this.match(12)){let r=this.startNodeAt(e);for(r.expressions=[s];this.eat(12);)r.expressions.push(this.parseMaybeAssign(t));return this.toReferencedList(r.expressions),this.finishNode(r,"SequenceExpression")}return s}parseMaybeAssignDisallowIn(t,e){return this.disallowInAnd(()=>this.parseMaybeAssign(t,e))}parseMaybeAssignAllowIn(t,e){return this.allowInAnd(()=>this.parseMaybeAssign(t,e))}setOptionalParametersError(t,e){var s;t.optionalParametersLoc=(s=e==null?void 0:e.loc)!=null?s:this.state.startLoc}parseMaybeAssign(t,e){let s=this.state.startLoc;if(this.isContextual(108)&&this.prodParam.hasYield){let n=this.parseYield();return e&&(n=e.call(this,n,s)),n}let r;t?r=!1:(t=new be,r=!0);let{type:i}=this.state;(i===10||D(i))&&(this.state.potentialArrowAt=this.state.start);let a=this.parseMaybeConditional(t);if(e&&(a=e.call(this,a,s)),fs(this.state.type)){let n=this.startNodeAt(s),o=this.state.value;if(n.operator=o,this.match(29)){this.toAssignable(a,!0),n.left=a;let h=s.index;t.doubleProtoLoc!=null&&t.doubleProtoLoc.index>=h&&(t.doubleProtoLoc=null),t.shorthandAssignLoc!=null&&t.shorthandAssignLoc.index>=h&&(t.shorthandAssignLoc=null),t.privateKeyLoc!=null&&t.privateKeyLoc.index>=h&&(this.checkDestructuringPrivate(t),t.privateKeyLoc=null)}else n.left=a;return this.next(),n.right=this.parseMaybeAssign(),this.checkLVal(a,this.finishNode(n,"AssignmentExpression")),n}else r&&this.checkExpressionErrors(t,!0);return a}parseMaybeConditional(t){let e=this.state.startLoc,s=this.state.potentialArrowAt,r=this.parseExprOps(t);return this.shouldExitDescending(r,s)?r:this.parseConditional(r,e,t)}parseConditional(t,e,s){if(this.eat(17)){let r=this.startNodeAt(e);return r.test=t,r.consequent=this.parseMaybeAssignAllowIn(),this.expect(14),r.alternate=this.parseMaybeAssign(),this.finishNode(r,"ConditionalExpression")}return t}parseMaybeUnaryOrPrivate(t){return this.match(139)?this.parsePrivateName():this.parseMaybeUnary(t)}parseExprOps(t){let e=this.state.startLoc,s=this.state.potentialArrowAt,r=this.parseMaybeUnaryOrPrivate(t);return this.shouldExitDescending(r,s)?r:this.parseExprOp(r,e,-1)}parseExprOp(t,e,s){if(this.isPrivateName(t)){let i=this.getPrivateNameSV(t);(s>=ye(58)||!this.prodParam.hasIn||!this.match(58))&&this.raise(u.PrivateInExpectedIn,t,{identifierName:i}),this.classScope.usePrivateName(i,t.loc.start)}let r=this.state.type;if(xs(r)&&(this.prodParam.hasIn||!this.match(58))){let i=ye(r);if(i>s){if(r===39){if(this.expectPlugin("pipelineOperator"),this.state.inFSharpPipelineDirectBody)return t;this.checkPipelineAtInfixOperator(t,e)}let a=this.startNodeAt(e);a.left=t,a.operator=this.state.value;let n=r===41||r===42,o=r===40;if(o&&(i=ye(42)),this.next(),r===39&&this.hasPlugin(["pipelineOperator",{proposal:"minimal"}])&&this.state.type===96&&this.prodParam.hasAwait)throw this.raise(u.UnexpectedAwaitAfterPipelineBody,this.state.startLoc);a.right=this.parseExprOpRightExpr(r,i);let h=this.finishNode(a,n||o?"LogicalExpression":"BinaryExpression"),l=this.state.type;if(o&&(l===41||l===42)||n&&l===40)throw this.raise(u.MixingCoalesceWithLogical,this.state.startLoc);return this.parseExprOp(h,e,s)}}return t}parseExprOpRightExpr(t,e){let s=this.state.startLoc;switch(t){case 39:switch(this.getPluginOption("pipelineOperator","proposal")){case"hack":return this.withTopicBindingContext(()=>this.parseHackPipeBody());case"fsharp":return this.withSoloAwaitPermittingContext(()=>this.parseFSharpPipelineBody(e))}if(this.getPluginOption("pipelineOperator","proposal")==="smart")return this.withTopicBindingContext(()=>{if(this.prodParam.hasYield&&this.isContextual(108))throw this.raise(u.PipeBodyIsTighter,this.state.startLoc);return this.parseSmartPipelineBodyInStyle(this.parseExprOpBaseRightExpr(t,e),s)});default:return this.parseExprOpBaseRightExpr(t,e)}}parseExprOpBaseRightExpr(t,e){let s=this.state.startLoc;return this.parseExprOp(this.parseMaybeUnaryOrPrivate(),s,bs(t)?e-1:e)}parseHackPipeBody(){var t;let{startLoc:e}=this.state,s=this.parseMaybeAssign();return rs.has(s.type)&&!((t=s.extra)!=null&&t.parenthesized)&&this.raise(u.PipeUnparenthesizedBody,e,{type:s.type}),this.topicReferenceWasUsedInCurrentContext()||this.raise(u.PipeTopicUnused,e),s}checkExponentialAfterUnary(t){this.match(57)&&this.raise(u.UnexpectedTokenUnaryExponentiation,t.argument)}parseMaybeUnary(t,e){let s=this.state.startLoc,r=this.isContextual(96);if(r&&this.recordAwaitIfAllowed()){this.next();let o=this.parseAwait(s);return e||this.checkExponentialAfterUnary(o),o}let i=this.match(34),a=this.startNode();if(As(this.state.type)){a.operator=this.state.value,a.prefix=!0,this.match(72)&&this.expectPlugin("throwExpressions");let o=this.match(89);if(this.next(),a.argument=this.parseMaybeUnary(null,!0),this.checkExpressionErrors(t,!0),this.state.strict&&o){let h=a.argument;h.type==="Identifier"?this.raise(u.StrictDelete,a):this.hasPropertyAsPrivateName(h)&&this.raise(u.DeletePrivateField,a)}if(!i)return e||this.checkExponentialAfterUnary(a),this.finishNode(a,"UnaryExpression")}let n=this.parseUpdate(a,i,t);if(r){let{type:o}=this.state;if((this.hasPlugin("v8intrinsic")?Le(o):Le(o)&&!this.match(54))&&!this.isAmbiguousAwait())return this.raiseOverwrite(u.AwaitNotInAsyncContext,s),this.parseAwait(s)}return n}parseUpdate(t,e,s){if(e){let a=t;return this.checkLVal(a.argument,this.finishNode(a,"UpdateExpression")),t}let r=this.state.startLoc,i=this.parseExprSubscripts(s);if(this.checkExpressionErrors(s,!1))return i;for(;Ps(this.state.type)&&!this.canInsertSemicolon();){let a=this.startNodeAt(r);a.operator=this.state.value,a.prefix=!1,a.argument=i,this.next(),this.checkLVal(i,i=this.finishNode(a,"UpdateExpression"))}return i}parseExprSubscripts(t){let e=this.state.startLoc,s=this.state.potentialArrowAt,r=this.parseExprAtom(t);return this.shouldExitDescending(r,s)?r:this.parseSubscripts(r,e)}parseSubscripts(t,e,s){let r={optionalChainMember:!1,maybeAsyncArrow:this.atPossibleAsyncArrow(t),stop:!1};do t=this.parseSubscript(t,e,s,r),r.maybeAsyncArrow=!1;while(!r.stop);return t}parseSubscript(t,e,s,r){let{type:i}=this.state;if(!s&&i===15)return this.parseBind(t,e,s,r);if(xe(i))return this.parseTaggedTemplateExpression(t,e,r);let a=!1;if(i===18){if(s&&(this.raise(u.OptionalChainingNoNew,this.state.startLoc),this.lookaheadCharCode()===40))return r.stop=!0,t;r.optionalChainMember=a=!0,this.next()}if(!s&&this.match(10))return this.parseCoverCallAndAsyncArrowHead(t,e,r,a);{let n=this.eat(0);return n||a||this.eat(16)?this.parseMember(t,e,r,n,a):(r.stop=!0,t)}}parseMember(t,e,s,r,i){let a=this.startNodeAt(e);return a.object=t,a.computed=r,r?(a.property=this.parseExpression(),this.expect(3)):this.match(139)?(t.type==="Super"&&this.raise(u.SuperPrivateField,e),this.classScope.usePrivateName(this.state.value,this.state.startLoc),a.property=this.parsePrivateName()):a.property=this.parseIdentifier(!0),s.optionalChainMember?(a.optional=i,this.finishNode(a,"OptionalMemberExpression")):this.finishNode(a,"MemberExpression")}parseBind(t,e,s,r){let i=this.startNodeAt(e);return i.object=t,this.next(),i.callee=this.parseNoCallExpr(),r.stop=!0,this.parseSubscripts(this.finishNode(i,"BindExpression"),e,s)}parseCoverCallAndAsyncArrowHead(t,e,s,r){let i=this.state.maybeInArrowParameters,a=null;this.state.maybeInArrowParameters=!0,this.next();let n=this.startNodeAt(e);n.callee=t;let{maybeAsyncArrow:o,optionalChainMember:h}=s;o&&(this.expressionScope.enter(Ys()),a=new be),h&&(n.optional=r),r?n.arguments=this.parseCallExpressionArguments(11):n.arguments=this.parseCallExpressionArguments(11,t.type!=="Super",n,a);let l=this.finishCallExpression(n,h);return o&&this.shouldParseAsyncArrow()&&!r?(s.stop=!0,this.checkDestructuringPrivate(a),this.expressionScope.validateAsPattern(),this.expressionScope.exit(),l=this.parseAsyncArrowFromCallExpression(this.startNodeAt(e),l)):(o&&(this.checkExpressionErrors(a,!0),this.expressionScope.exit()),this.toReferencedArguments(l)),this.state.maybeInArrowParameters=i,l}toReferencedArguments(t,e){this.toReferencedListDeep(t.arguments,e)}parseTaggedTemplateExpression(t,e,s){let r=this.startNodeAt(e);return r.tag=t,r.quasi=this.parseTemplate(!0),s.optionalChainMember&&this.raise(u.OptionalChainingNoTemplate,e),this.finishNode(r,"TaggedTemplateExpression")}atPossibleAsyncArrow(t){return t.type==="Identifier"&&t.name==="async"&&this.state.lastTokEndLoc.index===t.end&&!this.canInsertSemicolon()&&t.end-t.start===5&&this.offsetToSourcePos(t.start)===this.state.potentialArrowAt}finishCallExpression(t,e){if(t.callee.type==="Import")if(t.arguments.length===0||t.arguments.length>2)this.raise(u.ImportCallArity,t);else for(let s of t.arguments)s.type==="SpreadElement"&&this.raise(u.ImportCallSpreadArgument,s);return this.finishNode(t,e?"OptionalCallExpression":"CallExpression")}parseCallExpressionArguments(t,e,s,r){let i=[],a=!0,n=this.state.inFSharpPipelineDirectBody;for(this.state.inFSharpPipelineDirectBody=!1;!this.eat(t);){if(a)a=!1;else if(this.expect(12),this.match(t)){s&&this.addTrailingCommaExtraToNode(s),this.next();break}i.push(this.parseExprListItem(!1,r,e))}return this.state.inFSharpPipelineDirectBody=n,i}shouldParseAsyncArrow(){return this.match(19)&&!this.canInsertSemicolon()}parseAsyncArrowFromCallExpression(t,e){var s;return this.resetPreviousNodeTrailingComments(e),this.expect(19),this.parseArrowExpression(t,e.arguments,!0,(s=e.extra)==null?void 0:s.trailingCommaLoc),e.innerComments&&pe(t,e.innerComments),e.callee.trailingComments&&pe(t,e.callee.trailingComments),t}parseNoCallExpr(){let t=this.state.startLoc;return this.parseSubscripts(this.parseExprAtom(),t,!0)}parseExprAtom(t){let e,s=null,{type:r}=this.state;switch(r){case 79:return this.parseSuper();case 83:return e=this.startNode(),this.next(),this.match(16)?this.parseImportMetaProperty(e):this.match(10)?this.optionFlags&256?this.parseImportCall(e):this.finishNode(e,"Import"):(this.raise(u.UnsupportedImport,this.state.lastTokStartLoc),this.finishNode(e,"Import"));case 78:return e=this.startNode(),this.next(),this.finishNode(e,"ThisExpression");case 90:return this.parseDo(this.startNode(),!1);case 56:case 31:return this.readRegexp(),this.parseRegExpLiteral(this.state.value);case 135:return this.parseNumericLiteral(this.state.value);case 136:return this.parseBigIntLiteral(this.state.value);case 134:return this.parseStringLiteral(this.state.value);case 84:return this.parseNullLiteral();case 85:return this.parseBooleanLiteral(!0);case 86:return this.parseBooleanLiteral(!1);case 10:{let i=this.state.potentialArrowAt===this.state.start;return this.parseParenAndDistinguishExpression(i)}case 2:case 1:return this.parseArrayLike(this.state.type===2?4:3,!1,!0);case 0:return this.parseArrayLike(3,!0,!1,t);case 6:case 7:return this.parseObjectLike(this.state.type===6?9:8,!1,!0);case 5:return this.parseObjectLike(8,!1,!1,t);case 68:return this.parseFunctionOrFunctionSent();case 26:s=this.parseDecorators();case 80:return this.parseClass(this.maybeTakeDecorators(s,this.startNode()),!1);case 77:return this.parseNewOrNewTarget();case 25:case 24:return this.parseTemplate(!1);case 15:{e=this.startNode(),this.next(),e.object=null;let i=e.callee=this.parseNoCallExpr();if(i.type==="MemberExpression")return this.finishNode(e,"BindExpression");throw this.raise(u.UnsupportedBind,i)}case 139:return this.raise(u.PrivateInExpectedIn,this.state.startLoc,{identifierName:this.state.value}),this.parsePrivateName();case 33:return this.parseTopicReferenceThenEqualsSign(54,"%");case 32:return this.parseTopicReferenceThenEqualsSign(44,"^");case 37:case 38:return this.parseTopicReference("hack");case 44:case 54:case 27:{let i=this.getPluginOption("pipelineOperator","proposal");if(i)return this.parseTopicReference(i);this.unexpected();break}case 47:{let i=this.input.codePointAt(this.nextTokenStart());q(i)||i===62?this.expectOnePlugin(["jsx","flow","typescript"]):this.unexpected();break}default:if(r===137)return this.parseDecimalLiteral(this.state.value);if(D(r)){if(this.isContextual(127)&&this.lookaheadInLineCharCode()===123)return this.parseModuleExpression();let i=this.state.potentialArrowAt===this.state.start,a=this.state.containsEsc,n=this.parseIdentifier();if(!a&&n.name==="async"&&!this.canInsertSemicolon()){let{type:o}=this.state;if(o===68)return this.resetPreviousNodeTrailingComments(n),this.next(),this.parseAsyncFunctionExpression(this.startNodeAtNode(n));if(D(o))return this.lookaheadCharCode()===61?this.parseAsyncArrowUnaryFunction(this.startNodeAtNode(n)):n;if(o===90)return this.resetPreviousNodeTrailingComments(n),this.parseDo(this.startNodeAtNode(n),!0)}return i&&this.match(19)&&!this.canInsertSemicolon()?(this.next(),this.parseArrowExpression(this.startNodeAtNode(n),[n],!1)):n}else this.unexpected()}}parseTopicReferenceThenEqualsSign(t,e){let s=this.getPluginOption("pipelineOperator","proposal");if(s)return this.state.type=t,this.state.value=e,this.state.pos--,this.state.end--,this.state.endLoc=f(this.state.endLoc,-1),this.parseTopicReference(s);this.unexpected()}parseTopicReference(t){let e=this.startNode(),s=this.state.startLoc,r=this.state.type;return this.next(),this.finishTopicReference(e,s,t,r)}finishTopicReference(t,e,s,r){if(this.testTopicReferenceConfiguration(s,e,r))return s==="hack"?(this.topicReferenceIsAllowedInCurrentContext()||this.raise(u.PipeTopicUnbound,e),this.registerTopicReference(),this.finishNode(t,"TopicReference")):(this.topicReferenceIsAllowedInCurrentContext()||this.raise(u.PrimaryTopicNotAllowed,e),this.registerTopicReference(),this.finishNode(t,"PipelinePrimaryTopicReference"));throw this.raise(u.PipeTopicUnconfiguredToken,e,{token:W(r)})}testTopicReferenceConfiguration(t,e,s){switch(t){case"hack":return this.hasPlugin(["pipelineOperator",{topicToken:W(s)}]);case"smart":return s===27;default:throw this.raise(u.PipeTopicRequiresHackPipes,e)}}parseAsyncArrowUnaryFunction(t){this.prodParam.enter(Te(!0,this.prodParam.hasYield));let e=[this.parseIdentifier()];return this.prodParam.exit(),this.hasPrecedingLineBreak()&&this.raise(u.LineTerminatorBeforeArrow,this.state.curPosition()),this.expect(19),this.parseArrowExpression(t,e,!0)}parseDo(t,e){this.expectPlugin("doExpressions"),e&&this.expectPlugin("asyncDoExpressions"),t.async=e,this.next();let s=this.state.labels;return this.state.labels=[],e?(this.prodParam.enter(2),t.body=this.parseBlock(),this.prodParam.exit()):t.body=this.parseBlock(),this.state.labels=s,this.finishNode(t,"DoExpression")}parseSuper(){let t=this.startNode();return this.next(),this.match(10)&&!this.scope.allowDirectSuper&&!(this.optionFlags&16)?this.raise(u.SuperNotAllowed,t):!this.scope.allowSuper&&!(this.optionFlags&16)&&this.raise(u.UnexpectedSuper,t),!this.match(10)&&!this.match(0)&&!this.match(16)&&this.raise(u.UnsupportedSuper,t),this.finishNode(t,"Super")}parsePrivateName(){let t=this.startNode(),e=this.startNodeAt(f(this.state.startLoc,1)),s=this.state.value;return this.next(),t.id=this.createIdentifier(e,s),this.finishNode(t,"PrivateName")}parseFunctionOrFunctionSent(){let t=this.startNode();if(this.next(),this.prodParam.hasYield&&this.match(16)){let e=this.createIdentifier(this.startNodeAtNode(t),"function");return this.next(),this.match(103)?this.expectPlugin("functionSent"):this.hasPlugin("functionSent")||this.unexpected(),this.parseMetaProperty(t,e,"sent")}return this.parseFunction(t)}parseMetaProperty(t,e,s){t.meta=e;let r=this.state.containsEsc;return t.property=this.parseIdentifier(!0),(t.property.name!==s||r)&&this.raise(u.UnsupportedMetaProperty,t.property,{target:e.name,onlyValidPropertyName:s}),this.finishNode(t,"MetaProperty")}parseImportMetaProperty(t){let e=this.createIdentifier(this.startNodeAtNode(t),"import");if(this.next(),this.isContextual(101))this.inModule||this.raise(u.ImportMetaOutsideModule,e),this.sawUnambiguousESM=!0;else if(this.isContextual(105)||this.isContextual(97)){let s=this.isContextual(105);if(this.expectPlugin(s?"sourcePhaseImports":"deferredImportEvaluation"),!(this.optionFlags&256))throw this.raise(u.DynamicImportPhaseRequiresImportExpressions,this.state.startLoc,{phase:this.state.value});return this.next(),t.phase=s?"source":"defer",this.parseImportCall(t)}return this.parseMetaProperty(t,e,"meta")}parseLiteralAtNode(t,e,s){return this.addExtra(s,"rawValue",t),this.addExtra(s,"raw",this.input.slice(this.offsetToSourcePos(s.start),this.state.end)),s.value=t,this.next(),this.finishNode(s,e)}parseLiteral(t,e){let s=this.startNode();return this.parseLiteralAtNode(t,e,s)}parseStringLiteral(t){return this.parseLiteral(t,"StringLiteral")}parseNumericLiteral(t){return this.parseLiteral(t,"NumericLiteral")}parseBigIntLiteral(t){return this.parseLiteral(t,"BigIntLiteral")}parseDecimalLiteral(t){return this.parseLiteral(t,"DecimalLiteral")}parseRegExpLiteral(t){let e=this.startNode();return this.addExtra(e,"raw",this.input.slice(this.offsetToSourcePos(e.start),this.state.end)),e.pattern=t.pattern,e.flags=t.flags,this.next(),this.finishNode(e,"RegExpLiteral")}parseBooleanLiteral(t){let e=this.startNode();return e.value=t,this.next(),this.finishNode(e,"BooleanLiteral")}parseNullLiteral(){let t=this.startNode();return this.next(),this.finishNode(t,"NullLiteral")}parseParenAndDistinguishExpression(t){let e=this.state.startLoc,s;this.next(),this.expressionScope.enter(Gs());let r=this.state.maybeInArrowParameters,i=this.state.inFSharpPipelineDirectBody;this.state.maybeInArrowParameters=!0,this.state.inFSharpPipelineDirectBody=!1;let a=this.state.startLoc,n=[],o=new be,h=!0,l,d;for(;!this.match(11);){if(h)h=!1;else if(this.expect(12,o.optionalParametersLoc===null?null:o.optionalParametersLoc),this.match(11)){d=this.state.startLoc;break}if(this.match(21)){let T=this.state.startLoc;if(l=this.state.startLoc,n.push(this.parseParenItem(this.parseRestBinding(),T)),!this.checkCommaAfterRest(41))break}else n.push(this.parseMaybeAssignAllowIn(o,this.parseParenItem))}let y=this.state.lastTokEndLoc;this.expect(11),this.state.maybeInArrowParameters=r,this.state.inFSharpPipelineDirectBody=i;let A=this.startNodeAt(e);return t&&this.shouldParseArrow(n)&&(A=this.parseArrow(A))?(this.checkDestructuringPrivate(o),this.expressionScope.validateAsPattern(),this.expressionScope.exit(),this.parseArrowExpression(A,n,!1),A):(this.expressionScope.exit(),n.length||this.unexpected(this.state.lastTokStartLoc),d&&this.unexpected(d),l&&this.unexpected(l),this.checkExpressionErrors(o,!0),this.toReferencedListDeep(n,!0),n.length>1?(s=this.startNodeAt(a),s.expressions=n,this.finishNode(s,"SequenceExpression"),this.resetEndLocation(s,y)):s=n[0],this.wrapParenthesis(e,s))}wrapParenthesis(t,e){if(!(this.optionFlags&512))return this.addExtra(e,"parenthesized",!0),this.addExtra(e,"parenStart",t.index),this.takeSurroundingComments(e,t.index,this.state.lastTokEndLoc.index),e;let s=this.startNodeAt(t);return s.expression=e,this.finishNode(s,"ParenthesizedExpression")}shouldParseArrow(t){return!this.canInsertSemicolon()}parseArrow(t){if(this.eat(19))return t}parseParenItem(t,e){return t}parseNewOrNewTarget(){let t=this.startNode();if(this.next(),this.match(16)){let e=this.createIdentifier(this.startNodeAtNode(t),"new");this.next();let s=this.parseMetaProperty(t,e,"target");return!this.scope.inNonArrowFunction&&!this.scope.inClass&&!(this.optionFlags&4)&&this.raise(u.UnexpectedNewTarget,s),s}return this.parseNew(t)}parseNew(t){if(this.parseNewCallee(t),this.eat(10)){let e=this.parseExprList(11);this.toReferencedList(e),t.arguments=e}else t.arguments=[];return this.finishNode(t,"NewExpression")}parseNewCallee(t){let e=this.match(83),s=this.parseNoCallExpr();t.callee=s,e&&(s.type==="Import"||s.type==="ImportExpression")&&this.raise(u.ImportCallNotNewExpression,s)}parseTemplateElement(t){let{start:e,startLoc:s,end:r,value:i}=this.state,a=e+1,n=this.startNodeAt(f(s,1));i===null&&(t||this.raise(u.InvalidEscapeSequenceTemplate,f(this.state.firstInvalidTemplateEscapePos,1)));let o=this.match(24),h=o?-1:-2,l=r+h;n.value={raw:this.input.slice(a,l).replace(/\r\n?/g,` `),cooked:i===null?null:i.slice(1,h)},n.tail=o,this.next();let d=this.finishNode(n,"TemplateElement");return this.resetEndLocation(d,f(this.state.lastTokEndLoc,h)),d}parseTemplate(t){let e=this.startNode(),s=this.parseTemplateElement(t),r=[s],i=[];for(;!s.tail;)i.push(this.parseTemplateSubstitution()),this.readTemplateContinuation(),r.push(s=this.parseTemplateElement(t));return e.expressions=i,e.quasis=r,this.finishNode(e,"TemplateLiteral")}parseTemplateSubstitution(){return this.parseExpression()}parseObjectLike(t,e,s,r){s&&this.expectPlugin("recordAndTuple");let i=this.state.inFSharpPipelineDirectBody;this.state.inFSharpPipelineDirectBody=!1;let a=Object.create(null),n=!0,o=this.startNode();for(o.properties=[],this.next();!this.match(t);){if(n)n=!1;else if(this.expect(12),this.match(t)){this.addTrailingCommaExtraToNode(o);break}let l;e?l=this.parseBindingProperty():(l=this.parsePropertyDefinition(r),this.checkProto(l,s,a,r)),s&&!this.isObjectProperty(l)&&l.type!=="SpreadElement"&&this.raise(u.InvalidRecordProperty,l),l.shorthand&&this.addExtra(l,"shorthand",!0),o.properties.push(l)}this.next(),this.state.inFSharpPipelineDirectBody=i;let h="ObjectExpression";return e?h="ObjectPattern":s&&(h="RecordExpression"),this.finishNode(o,h)}addTrailingCommaExtraToNode(t){this.addExtra(t,"trailingComma",this.state.lastTokStartLoc.index),this.addExtra(t,"trailingCommaLoc",this.state.lastTokStartLoc,!1)}maybeAsyncOrAccessorProp(t){return!t.computed&&t.key.type==="Identifier"&&(this.isLiteralPropertyName()||this.match(0)||this.match(55))}parsePropertyDefinition(t){let e=[];if(this.match(26))for(this.hasPlugin("decorators")&&this.raise(u.UnsupportedPropertyDecorator,this.state.startLoc);this.match(26);)e.push(this.parseDecorator());let s=this.startNode(),r=!1,i=!1,a;if(this.match(21))return e.length&&this.unexpected(),this.parseSpread();e.length&&(s.decorators=e,e=[]),s.method=!1,t&&(a=this.state.startLoc);let n=this.eat(55);this.parsePropertyNamePrefixOperator(s);let o=this.state.containsEsc;if(this.parsePropertyName(s,t),!n&&!o&&this.maybeAsyncOrAccessorProp(s)){let{key:h}=s,l=h.name;l==="async"&&!this.hasPrecedingLineBreak()&&(r=!0,this.resetPreviousNodeTrailingComments(h),n=this.eat(55),this.parsePropertyName(s)),(l==="get"||l==="set")&&(i=!0,this.resetPreviousNodeTrailingComments(h),s.kind=l,this.match(55)&&(n=!0,this.raise(u.AccessorIsGenerator,this.state.curPosition(),{kind:l}),this.next()),this.parsePropertyName(s))}return this.parseObjPropValue(s,a,n,r,!1,i,t)}getGetterSetterExpectedParamCount(t){return t.kind==="get"?0:1}getObjectOrClassMethodParams(t){return t.params}checkGetterSetterParams(t){var e;let s=this.getGetterSetterExpectedParamCount(t),r=this.getObjectOrClassMethodParams(t);r.length!==s&&this.raise(t.kind==="get"?u.BadGetterArity:u.BadSetterArity,t),t.kind==="set"&&((e=r[r.length-1])==null?void 0:e.type)==="RestElement"&&this.raise(u.BadSetterRestParameter,t)}parseObjectMethod(t,e,s,r,i){if(i){let a=this.parseMethod(t,e,!1,!1,!1,"ObjectMethod");return this.checkGetterSetterParams(a),a}if(s||e||this.match(10))return r&&this.unexpected(),t.kind="method",t.method=!0,this.parseMethod(t,e,s,!1,!1,"ObjectMethod")}parseObjectProperty(t,e,s,r){if(t.shorthand=!1,this.eat(14))return t.value=s?this.parseMaybeDefault(this.state.startLoc):this.parseMaybeAssignAllowIn(r),this.finishNode(t,"ObjectProperty");if(!t.computed&&t.key.type==="Identifier"){if(this.checkReservedWord(t.key.name,t.key.loc.start,!0,!1),s)t.value=this.parseMaybeDefault(e,$(t.key));else if(this.match(29)){let i=this.state.startLoc;r!=null?r.shorthandAssignLoc===null&&(r.shorthandAssignLoc=i):this.raise(u.InvalidCoverInitializedName,i),t.value=this.parseMaybeDefault(e,$(t.key))}else t.value=$(t.key);return t.shorthand=!0,this.finishNode(t,"ObjectProperty")}}parseObjPropValue(t,e,s,r,i,a,n){let o=this.parseObjectMethod(t,s,r,i,a)||this.parseObjectProperty(t,e,i,n);return o||this.unexpected(),o}parsePropertyName(t,e){if(this.eat(0))t.computed=!0,t.key=this.parseMaybeAssignAllowIn(),this.expect(3);else{let{type:s,value:r}=this.state,i;if(U(s))i=this.parseIdentifier(!0);else switch(s){case 135:i=this.parseNumericLiteral(r);break;case 134:i=this.parseStringLiteral(r);break;case 136:i=this.parseBigIntLiteral(r);break;case 139:{let a=this.state.startLoc;e!=null?e.privateKeyLoc===null&&(e.privateKeyLoc=a):this.raise(u.UnexpectedPrivateField,a),i=this.parsePrivateName();break}default:if(s===137){i=this.parseDecimalLiteral(r);break}this.unexpected()}t.key=i,s!==139&&(t.computed=!1)}}initFunction(t,e){t.id=null,t.generator=!1,t.async=e}parseMethod(t,e,s,r,i,a,n=!1){this.initFunction(t,s),t.generator=e,this.scope.enter(18|(n?64:0)|(i?32:0)),this.prodParam.enter(Te(s,t.generator)),this.parseFunctionParams(t,r);let o=this.parseFunctionBodyAndFinish(t,a,!0);return this.prodParam.exit(),this.scope.exit(),o}parseArrayLike(t,e,s,r){s&&this.expectPlugin("recordAndTuple");let i=this.state.inFSharpPipelineDirectBody;this.state.inFSharpPipelineDirectBody=!1;let a=this.startNode();return this.next(),a.elements=this.parseExprList(t,!s,r,a),this.state.inFSharpPipelineDirectBody=i,this.finishNode(a,s?"TupleExpression":"ArrayExpression")}parseArrowExpression(t,e,s,r){this.scope.enter(6);let i=Te(s,!1);!this.match(5)&&this.prodParam.hasIn&&(i|=8),this.prodParam.enter(i),this.initFunction(t,s);let a=this.state.maybeInArrowParameters;return e&&(this.state.maybeInArrowParameters=!0,this.setArrowFunctionParameters(t,e,r)),this.state.maybeInArrowParameters=!1,this.parseFunctionBody(t,!0),this.prodParam.exit(),this.scope.exit(),this.state.maybeInArrowParameters=a,this.finishNode(t,"ArrowFunctionExpression")}setArrowFunctionParameters(t,e,s){this.toAssignableList(e,s,!1),t.params=e}parseFunctionBodyAndFinish(t,e,s=!1){return this.parseFunctionBody(t,!1,s),this.finishNode(t,e)}parseFunctionBody(t,e,s=!1){let r=e&&!this.match(5);if(this.expressionScope.enter(At()),r)t.body=this.parseMaybeAssign(),this.checkParams(t,!1,e,!1);else{let i=this.state.strict,a=this.state.labels;this.state.labels=[],this.prodParam.enter(this.prodParam.currentFlags()|4),t.body=this.parseBlock(!0,!1,n=>{let o=!this.isSimpleParamList(t.params);n&&o&&this.raise(u.IllegalLanguageModeDirective,(t.kind==="method"||t.kind==="constructor")&&t.key?t.key.loc.end:t);let h=!i&&this.state.strict;this.checkParams(t,!this.state.strict&&!e&&!s&&!o,e,h),this.state.strict&&t.id&&this.checkIdentifier(t.id,65,h)}),this.prodParam.exit(),this.state.labels=a}this.expressionScope.exit()}isSimpleParameter(t){return t.type==="Identifier"}isSimpleParamList(t){for(let e=0,s=t.length;e10||!Fs(t))){if(s&&vs(t)){this.raise(u.UnexpectedKeyword,e,{keyword:t});return}if((this.state.strict?r?ut:ht:lt)(t,this.inModule)){this.raise(u.UnexpectedReservedWord,e,{reservedWord:t});return}else if(t==="yield"){if(this.prodParam.hasYield){this.raise(u.YieldBindingIdentifier,e);return}}else if(t==="await"){if(this.prodParam.hasAwait){this.raise(u.AwaitBindingIdentifier,e);return}if(this.scope.inStaticBlock){this.raise(u.AwaitBindingIdentifierInStaticBlock,e);return}this.expressionScope.recordAsyncArrowParametersError(e)}else if(t==="arguments"&&this.scope.inClassAndNotInNonArrowFunction){this.raise(u.ArgumentsInClass,e);return}}}recordAwaitIfAllowed(){let t=this.prodParam.hasAwait||this.optionFlags&1&&!this.scope.inFunction;return t&&!this.scope.inFunction&&(this.state.hasTopLevelAwait=!0),t}parseAwait(t){let e=this.startNodeAt(t);return this.expressionScope.recordParameterInitializerError(u.AwaitExpressionFormalParameter,e),this.eat(55)&&this.raise(u.ObsoleteAwaitStar,e),!this.scope.inFunction&&!(this.optionFlags&1)&&(this.isAmbiguousAwait()?this.ambiguousScriptDifferentAst=!0:this.sawUnambiguousESM=!0),this.state.soloAwait||(e.argument=this.parseMaybeUnary(null,!0)),this.finishNode(e,"AwaitExpression")}isAmbiguousAwait(){if(this.hasPrecedingLineBreak())return!0;let{type:t}=this.state;return t===53||t===10||t===0||xe(t)||t===102&&!this.state.containsEsc||t===138||t===56||this.hasPlugin("v8intrinsic")&&t===54}parseYield(){let t=this.startNode();this.expressionScope.recordParameterInitializerError(u.YieldInParameter,t),this.next();let e=!1,s=null;if(!this.hasPrecedingLineBreak())switch(e=this.eat(55),this.state.type){case 13:case 140:case 8:case 11:case 3:case 9:case 14:case 12:if(!e)break;default:s=this.parseMaybeAssign()}return t.delegate=e,t.argument=s,this.finishNode(t,"YieldExpression")}parseImportCall(t){if(this.next(),t.source=this.parseMaybeAssignAllowIn(),t.options=null,this.eat(12)&&!this.match(11)&&(t.options=this.parseMaybeAssignAllowIn(),this.eat(12)&&!this.match(11))){do this.parseMaybeAssignAllowIn();while(this.eat(12)&&!this.match(11));this.raise(u.ImportCallArity,t)}return this.expect(11),this.finishNode(t,"ImportExpression")}checkPipelineAtInfixOperator(t,e){this.hasPlugin(["pipelineOperator",{proposal:"smart"}])&&t.type==="SequenceExpression"&&this.raise(u.PipelineHeadSequenceExpression,e)}parseSmartPipelineBodyInStyle(t,e){if(this.isSimpleReference(t)){let s=this.startNodeAt(e);return s.callee=t,this.finishNode(s,"PipelineBareFunction")}else{let s=this.startNodeAt(e);return this.checkSmartPipeTopicBodyEarlyErrors(e),s.expression=t,this.finishNode(s,"PipelineTopicExpression")}}isSimpleReference(t){switch(t.type){case"MemberExpression":return!t.computed&&this.isSimpleReference(t.object);case"Identifier":return!0;default:return!1}}checkSmartPipeTopicBodyEarlyErrors(t){if(this.match(19))throw this.raise(u.PipelineBodyNoArrow,this.state.startLoc);this.topicReferenceWasUsedInCurrentContext()||this.raise(u.PipelineTopicUnused,t)}withTopicBindingContext(t){let e=this.state.topicContext;this.state.topicContext={maxNumOfResolvableTopics:1,maxTopicIndex:null};try{return t()}finally{this.state.topicContext=e}}withSmartMixTopicForbiddingContext(t){if(this.hasPlugin(["pipelineOperator",{proposal:"smart"}])){let e=this.state.topicContext;this.state.topicContext={maxNumOfResolvableTopics:0,maxTopicIndex:null};try{return t()}finally{this.state.topicContext=e}}else return t()}withSoloAwaitPermittingContext(t){let e=this.state.soloAwait;this.state.soloAwait=!0;try{return t()}finally{this.state.soloAwait=e}}allowInAnd(t){let e=this.prodParam.currentFlags();if(8&~e){this.prodParam.enter(e|8);try{return t()}finally{this.prodParam.exit()}}return t()}disallowInAnd(t){let e=this.prodParam.currentFlags();if(8&e){this.prodParam.enter(e&-9);try{return t()}finally{this.prodParam.exit()}}return t()}registerTopicReference(){this.state.topicContext.maxTopicIndex=0}topicReferenceIsAllowedInCurrentContext(){return this.state.topicContext.maxNumOfResolvableTopics>=1}topicReferenceWasUsedInCurrentContext(){return this.state.topicContext.maxTopicIndex!=null&&this.state.topicContext.maxTopicIndex>=0}parseFSharpPipelineBody(t){let e=this.state.startLoc;this.state.potentialArrowAt=this.state.start;let s=this.state.inFSharpPipelineDirectBody;this.state.inFSharpPipelineDirectBody=!0;let r=this.parseExprOp(this.parseMaybeUnaryOrPrivate(),e,t);return this.state.inFSharpPipelineDirectBody=s,r}parseModuleExpression(){this.expectPlugin("moduleBlocks");let t=this.startNode();this.next(),this.match(5)||this.unexpected(null,5);let e=this.startNodeAt(this.state.endLoc);this.next();let s=this.initializeScopes(!0);this.enterInitialScopes();try{t.body=this.parseProgram(e,8,"module")}finally{s()}return this.finishNode(t,"ModuleExpression")}parsePropertyNamePrefixOperator(t){}},qe={kind:1},Sr={kind:2},wr=/[\uD800-\uDFFF]/u,$e=/in(?:stanceof)?/y;function Ir(t,e,s){for(let r=0;r0)for(let[i,a]of Array.from(this.scope.undefinedExports))this.raise(u.ModuleExportUndefined,a,{localName:i});this.addExtra(t,"topLevelAwait",this.state.hasTopLevelAwait)}let r;return e===140?r=this.finishNode(t,"Program"):r=this.finishNodeAt(t,"Program",f(this.state.startLoc,-1)),r}stmtToDirective(t){let e=t;e.type="Directive",e.value=e.expression,delete e.expression;let s=e.value,r=s.value,i=this.input.slice(this.offsetToSourcePos(s.start),this.offsetToSourcePos(s.end)),a=s.value=i.slice(1,-1);return this.addExtra(s,"raw",i),this.addExtra(s,"rawValue",a),this.addExtra(s,"expressionValue",r),s.type="DirectiveLiteral",e}parseInterpreterDirective(){if(!this.match(28))return null;let t=this.startNode();return t.value=this.state.value,this.next(),this.finishNode(t,"InterpreterDirective")}isLet(){return this.isContextual(100)?this.hasFollowingBindingAtom():!1}chStartsBindingIdentifier(t,e){if(q(t)){if($e.lastIndex=e,$e.test(this.input)){let s=this.codePointAtPos($e.lastIndex);if(!te(s)&&s!==92)return!1}return!0}else return t===92}chStartsBindingPattern(t){return t===91||t===123}hasFollowingBindingAtom(){let t=this.nextTokenStart(),e=this.codePointAtPos(t);return this.chStartsBindingPattern(e)||this.chStartsBindingIdentifier(e,t)}hasInLineFollowingBindingIdentifierOrBrace(){let t=this.nextTokenInLineStart(),e=this.codePointAtPos(t);return e===123||this.chStartsBindingIdentifier(e,t)}startsUsingForOf(){let{type:t,containsEsc:e}=this.lookahead();if(t===102&&!e)return!1;if(D(t)&&!this.hasFollowingLineBreak())return this.expectPlugin("explicitResourceManagement"),!0}startsAwaitUsing(){let t=this.nextTokenInLineStart();if(this.isUnparsedContextual(t,"using")){t=this.nextTokenInLineStartSince(t+5);let e=this.codePointAtPos(t);if(this.chStartsBindingIdentifier(e,t))return this.expectPlugin("explicitResourceManagement"),!0}return!1}parseModuleItem(){return this.parseStatementLike(15)}parseStatementListItem(){return this.parseStatementLike(6|(!this.options.annexB||this.state.strict?0:8))}parseStatementOrSloppyAnnexBFunctionDeclaration(t=!1){let e=0;return this.options.annexB&&!this.state.strict&&(e|=4,t&&(e|=8)),this.parseStatementLike(e)}parseStatement(){return this.parseStatementLike(0)}parseStatementLike(t){let e=null;return this.match(26)&&(e=this.parseDecorators(!0)),this.parseStatementContent(t,e)}parseStatementContent(t,e){let s=this.state.type,r=this.startNode(),i=!!(t&2),a=!!(t&4),n=t&1;switch(s){case 60:return this.parseBreakContinueStatement(r,!0);case 63:return this.parseBreakContinueStatement(r,!1);case 64:return this.parseDebuggerStatement(r);case 90:return this.parseDoWhileStatement(r);case 91:return this.parseForStatement(r);case 68:if(this.lookaheadCharCode()===46)break;return a||this.raise(this.state.strict?u.StrictFunction:this.options.annexB?u.SloppyFunctionAnnexB:u.SloppyFunction,this.state.startLoc),this.parseFunctionStatement(r,!1,!i&&a);case 80:return i||this.unexpected(),this.parseClass(this.maybeTakeDecorators(e,r),!0);case 69:return this.parseIfStatement(r);case 70:return this.parseReturnStatement(r);case 71:return this.parseSwitchStatement(r);case 72:return this.parseThrowStatement(r);case 73:return this.parseTryStatement(r);case 96:if(!this.state.containsEsc&&this.startsAwaitUsing())return this.recordAwaitIfAllowed()?i||this.raise(u.UnexpectedLexicalDeclaration,r):this.raise(u.AwaitUsingNotInAsyncContext,r),this.next(),this.parseVarStatement(r,"await using");break;case 107:if(this.state.containsEsc||!this.hasInLineFollowingBindingIdentifierOrBrace())break;return this.expectPlugin("explicitResourceManagement"),!this.scope.inModule&&this.scope.inTopLevel?this.raise(u.UnexpectedUsingDeclaration,this.state.startLoc):i||this.raise(u.UnexpectedLexicalDeclaration,this.state.startLoc),this.parseVarStatement(r,"using");case 100:{if(this.state.containsEsc)break;let l=this.nextTokenStart(),d=this.codePointAtPos(l);if(d!==91&&(!i&&this.hasFollowingLineBreak()||!this.chStartsBindingIdentifier(d,l)&&d!==123))break}case 75:i||this.raise(u.UnexpectedLexicalDeclaration,this.state.startLoc);case 74:{let l=this.state.value;return this.parseVarStatement(r,l)}case 92:return this.parseWhileStatement(r);case 76:return this.parseWithStatement(r);case 5:return this.parseBlock();case 13:return this.parseEmptyStatement(r);case 83:{let l=this.lookaheadCharCode();if(l===40||l===46)break}case 82:{!(this.optionFlags&8)&&!n&&this.raise(u.UnexpectedImportExport,this.state.startLoc),this.next();let l;return s===83?(l=this.parseImport(r),l.type==="ImportDeclaration"&&(!l.importKind||l.importKind==="value")&&(this.sawUnambiguousESM=!0)):(l=this.parseExport(r,e),(l.type==="ExportNamedDeclaration"&&(!l.exportKind||l.exportKind==="value")||l.type==="ExportAllDeclaration"&&(!l.exportKind||l.exportKind==="value")||l.type==="ExportDefaultDeclaration")&&(this.sawUnambiguousESM=!0)),this.assertModuleNodeAllowed(l),l}default:if(this.isAsyncFunction())return i||this.raise(u.AsyncFunctionInSingleStatementContext,this.state.startLoc),this.next(),this.parseFunctionStatement(r,!0,!i&&a)}let o=this.state.value,h=this.parseExpression();return D(s)&&h.type==="Identifier"&&this.eat(14)?this.parseLabeledStatement(r,o,h,t):this.parseExpressionStatement(r,h,e)}assertModuleNodeAllowed(t){!(this.optionFlags&8)&&!this.inModule&&this.raise(u.ImportOutsideModule,t)}decoratorsEnabledBeforeExport(){return this.hasPlugin("decorators-legacy")?!0:this.hasPlugin("decorators")&&this.getPluginOption("decorators","decoratorsBeforeExport")!==!1}maybeTakeDecorators(t,e,s){if(t){var r;(r=e.decorators)!=null&&r.length?(typeof this.getPluginOption("decorators","decoratorsBeforeExport")!="boolean"&&this.raise(u.DecoratorsBeforeAfterExport,e.decorators[0]),e.decorators.unshift(...t)):e.decorators=t,this.resetStartLocationFromNode(e,t[0]),s&&this.resetStartLocationFromNode(s,e)}return e}canHaveLeadingDecorator(){return this.match(80)}parseDecorators(t){let e=[];do e.push(this.parseDecorator());while(this.match(26));if(this.match(82))t||this.unexpected(),this.decoratorsEnabledBeforeExport()||this.raise(u.DecoratorExportClass,this.state.startLoc);else if(!this.canHaveLeadingDecorator())throw this.raise(u.UnexpectedLeadingDecorator,this.state.startLoc);return e}parseDecorator(){this.expectOnePlugin(["decorators","decorators-legacy"]);let t=this.startNode();if(this.next(),this.hasPlugin("decorators")){let e=this.state.startLoc,s;if(this.match(10)){let r=this.state.startLoc;this.next(),s=this.parseExpression(),this.expect(11),s=this.wrapParenthesis(r,s);let i=this.state.startLoc;t.expression=this.parseMaybeDecoratorArguments(s,r),this.getPluginOption("decorators","allowCallParenthesized")===!1&&t.expression!==s&&this.raise(u.DecoratorArgumentsOutsideParentheses,i)}else{for(s=this.parseIdentifier(!1);this.eat(16);){let r=this.startNodeAt(e);r.object=s,this.match(139)?(this.classScope.usePrivateName(this.state.value,this.state.startLoc),r.property=this.parsePrivateName()):r.property=this.parseIdentifier(!0),r.computed=!1,s=this.finishNode(r,"MemberExpression")}t.expression=this.parseMaybeDecoratorArguments(s,e)}}else t.expression=this.parseExprSubscripts();return this.finishNode(t,"Decorator")}parseMaybeDecoratorArguments(t,e){if(this.eat(10)){let s=this.startNodeAt(e);return s.callee=t,s.arguments=this.parseCallExpressionArguments(11),this.toReferencedList(s.arguments),this.finishNode(s,"CallExpression")}return t}parseBreakContinueStatement(t,e){return this.next(),this.isLineTerminator()?t.label=null:(t.label=this.parseIdentifier(),this.semicolon()),this.verifyBreakContinue(t,e),this.finishNode(t,e?"BreakStatement":"ContinueStatement")}verifyBreakContinue(t,e){let s;for(s=0;sthis.parseStatement()),this.state.labels.pop(),this.expect(92),t.test=this.parseHeaderExpression(),this.eat(13),this.finishNode(t,"DoWhileStatement")}parseForStatement(t){this.next(),this.state.labels.push(qe);let e=null;if(this.isContextual(96)&&this.recordAwaitIfAllowed()&&(e=this.state.startLoc,this.next()),this.scope.enter(0),this.expect(10),this.match(13))return e!==null&&this.unexpected(e),this.parseFor(t,null);let s=this.isContextual(100);{let o=this.isContextual(96)&&this.startsAwaitUsing(),h=o||this.isContextual(107)&&this.startsUsingForOf(),l=s&&this.hasFollowingBindingAtom()||h;if(this.match(74)||this.match(75)||l){let d=this.startNode(),y;o?(y="await using",this.recordAwaitIfAllowed()||this.raise(u.AwaitUsingNotInAsyncContext,this.state.startLoc),this.next()):y=this.state.value,this.next(),this.parseVar(d,!0,y);let A=this.finishNode(d,"VariableDeclaration"),T=this.match(58);return T&&h&&this.raise(u.ForInUsing,A),(T||this.isContextual(102))&&A.declarations.length===1?this.parseForIn(t,A,e):(e!==null&&this.unexpected(e),this.parseFor(t,A))}}let r=this.isContextual(95),i=new be,a=this.parseExpression(!0,i),n=this.isContextual(102);if(n&&(s&&this.raise(u.ForOfLet,a),e===null&&r&&a.type==="Identifier"&&this.raise(u.ForOfAsync,a)),n||this.match(58)){this.checkDestructuringPrivate(i),this.toAssignable(a,!0);let o=n?"ForOfStatement":"ForInStatement";return this.checkLVal(a,{type:o}),this.parseForIn(t,a,e)}else this.checkExpressionErrors(i,!0);return e!==null&&this.unexpected(e),this.parseFor(t,a)}parseFunctionStatement(t,e,s){return this.next(),this.parseFunction(t,1|(s?2:0)|(e?8:0))}parseIfStatement(t){return this.next(),t.test=this.parseHeaderExpression(),t.consequent=this.parseStatementOrSloppyAnnexBFunctionDeclaration(),t.alternate=this.eat(66)?this.parseStatementOrSloppyAnnexBFunctionDeclaration():null,this.finishNode(t,"IfStatement")}parseReturnStatement(t){return!this.prodParam.hasReturn&&!(this.optionFlags&2)&&this.raise(u.IllegalReturn,this.state.startLoc),this.next(),this.isLineTerminator()?t.argument=null:(t.argument=this.parseExpression(),this.semicolon()),this.finishNode(t,"ReturnStatement")}parseSwitchStatement(t){this.next(),t.discriminant=this.parseHeaderExpression();let e=t.cases=[];this.expect(5),this.state.labels.push(Sr),this.scope.enter(0);let s;for(let r;!this.match(8);)if(this.match(61)||this.match(65)){let i=this.match(61);s&&this.finishNode(s,"SwitchCase"),e.push(s=this.startNode()),s.consequent=[],this.next(),i?s.test=this.parseExpression():(r&&this.raise(u.MultipleDefaultsInSwitch,this.state.lastTokStartLoc),r=!0,s.test=null),this.expect(14)}else s?s.consequent.push(this.parseStatementListItem()):this.unexpected();return this.scope.exit(),s&&this.finishNode(s,"SwitchCase"),this.next(),this.state.labels.pop(),this.finishNode(t,"SwitchStatement")}parseThrowStatement(t){return this.next(),this.hasPrecedingLineBreak()&&this.raise(u.NewlineAfterThrow,this.state.lastTokEndLoc),t.argument=this.parseExpression(),this.semicolon(),this.finishNode(t,"ThrowStatement")}parseCatchClauseParam(){let t=this.parseBindingAtom();return this.scope.enter(this.options.annexB&&t.type==="Identifier"?8:0),this.checkLVal(t,{type:"CatchClause"},9),t}parseTryStatement(t){if(this.next(),t.block=this.parseBlock(),t.handler=null,this.match(62)){let e=this.startNode();this.next(),this.match(10)?(this.expect(10),e.param=this.parseCatchClauseParam(),this.expect(11)):(e.param=null,this.scope.enter(0)),e.body=this.withSmartMixTopicForbiddingContext(()=>this.parseBlock(!1,!1)),this.scope.exit(),t.handler=this.finishNode(e,"CatchClause")}return t.finalizer=this.eat(67)?this.parseBlock():null,!t.handler&&!t.finalizer&&this.raise(u.NoCatchOrFinally,t),this.finishNode(t,"TryStatement")}parseVarStatement(t,e,s=!1){return this.next(),this.parseVar(t,!1,e,s),this.semicolon(),this.finishNode(t,"VariableDeclaration")}parseWhileStatement(t){return this.next(),t.test=this.parseHeaderExpression(),this.state.labels.push(qe),t.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.state.labels.pop(),this.finishNode(t,"WhileStatement")}parseWithStatement(t){return this.state.strict&&this.raise(u.StrictWith,this.state.startLoc),this.next(),t.object=this.parseHeaderExpression(),t.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.finishNode(t,"WithStatement")}parseEmptyStatement(t){return this.next(),this.finishNode(t,"EmptyStatement")}parseLabeledStatement(t,e,s,r){for(let a of this.state.labels)a.name===e&&this.raise(u.LabelRedeclaration,s,{labelName:e});let i=ys(this.state.type)?1:this.match(71)?2:null;for(let a=this.state.labels.length-1;a>=0;a--){let n=this.state.labels[a];if(n.statementStart===t.start)n.statementStart=this.sourceToOffsetPos(this.state.start),n.kind=i;else break}return this.state.labels.push({name:e,kind:i,statementStart:this.sourceToOffsetPos(this.state.start)}),t.body=r&8?this.parseStatementOrSloppyAnnexBFunctionDeclaration(!0):this.parseStatement(),this.state.labels.pop(),t.label=s,this.finishNode(t,"LabeledStatement")}parseExpressionStatement(t,e,s){return t.expression=e,this.semicolon(),this.finishNode(t,"ExpressionStatement")}parseBlock(t=!1,e=!0,s){let r=this.startNode();return t&&this.state.strictErrors.clear(),this.expect(5),e&&this.scope.enter(0),this.parseBlockBody(r,t,!1,8,s),e&&this.scope.exit(),this.finishNode(r,"BlockStatement")}isValidDirective(t){return t.type==="ExpressionStatement"&&t.expression.type==="StringLiteral"&&!t.expression.extra.parenthesized}parseBlockBody(t,e,s,r,i){let a=t.body=[],n=t.directives=[];this.parseBlockOrModuleBlockBody(a,e?n:void 0,s,r,i)}parseBlockOrModuleBlockBody(t,e,s,r,i){let a=this.state.strict,n=!1,o=!1;for(;!this.match(r);){let h=s?this.parseModuleItem():this.parseStatementListItem();if(e&&!o){if(this.isValidDirective(h)){let l=this.stmtToDirective(h);e.push(l),!n&&l.value.value==="use strict"&&(n=!0,this.setStrict(!0));continue}o=!0,this.state.strictErrors.clear()}t.push(h)}i==null||i.call(this,n),a||this.setStrict(!1),this.next()}parseFor(t,e){return t.init=e,this.semicolon(!1),t.test=this.match(13)?null:this.parseExpression(),this.semicolon(!1),t.update=this.match(11)?null:this.parseExpression(),this.expect(11),t.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.scope.exit(),this.state.labels.pop(),this.finishNode(t,"ForStatement")}parseForIn(t,e,s){let r=this.match(58);return this.next(),r?s!==null&&this.unexpected(s):t.await=s!==null,e.type==="VariableDeclaration"&&e.declarations[0].init!=null&&(!r||!this.options.annexB||this.state.strict||e.kind!=="var"||e.declarations[0].id.type!=="Identifier")&&this.raise(u.ForInOfLoopInitializer,e,{type:r?"ForInStatement":"ForOfStatement"}),e.type==="AssignmentPattern"&&this.raise(u.InvalidLhs,e,{ancestor:{type:"ForStatement"}}),t.left=e,t.right=r?this.parseExpression():this.parseMaybeAssignAllowIn(),this.expect(11),t.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.scope.exit(),this.state.labels.pop(),this.finishNode(t,r?"ForInStatement":"ForOfStatement")}parseVar(t,e,s,r=!1){let i=t.declarations=[];for(t.kind=s;;){let a=this.startNode();if(this.parseVarId(a,s),a.init=this.eat(29)?e?this.parseMaybeAssignDisallowIn():this.parseMaybeAssignAllowIn():null,a.init===null&&!r&&(a.id.type!=="Identifier"&&!(e&&(this.match(58)||this.isContextual(102)))?this.raise(u.DeclarationMissingInitializer,this.state.lastTokEndLoc,{kind:"destructuring"}):(s==="const"||s==="using"||s==="await using")&&!(this.match(58)||this.isContextual(102))&&this.raise(u.DeclarationMissingInitializer,this.state.lastTokEndLoc,{kind:s})),i.push(this.finishNode(a,"VariableDeclarator")),!this.eat(12))break}return t}parseVarId(t,e){let s=this.parseBindingAtom();(e==="using"||e==="await using")&&(s.type==="ArrayPattern"||s.type==="ObjectPattern")&&this.raise(u.UsingDeclarationHasBindingPattern,s.loc.start),this.checkLVal(s,{type:"VariableDeclarator"},e==="var"?5:8201),t.id=s}parseAsyncFunctionExpression(t){return this.parseFunction(t,8)}parseFunction(t,e=0){let s=e&2,r=!!(e&1),i=r&&!(e&4),a=!!(e&8);this.initFunction(t,a),this.match(55)&&(s&&this.raise(u.GeneratorInSingleStatementContext,this.state.startLoc),this.next(),t.generator=!0),r&&(t.id=this.parseFunctionId(i));let n=this.state.maybeInArrowParameters;return this.state.maybeInArrowParameters=!1,this.scope.enter(2),this.prodParam.enter(Te(a,t.generator)),r||(t.id=this.parseFunctionId()),this.parseFunctionParams(t,!1),this.withSmartMixTopicForbiddingContext(()=>{this.parseFunctionBodyAndFinish(t,r?"FunctionDeclaration":"FunctionExpression")}),this.prodParam.exit(),this.scope.exit(),r&&!s&&this.registerFunctionStatementId(t),this.state.maybeInArrowParameters=n,t}parseFunctionId(t){return t||D(this.state.type)?this.parseIdentifier():null}parseFunctionParams(t,e){this.expect(10),this.expressionScope.enter(Xs()),t.params=this.parseBindingList(11,41,2|(e?4:0)),this.expressionScope.exit()}registerFunctionStatementId(t){t.id&&this.scope.declareName(t.id.name,!this.options.annexB||this.state.strict||t.generator||t.async?this.scope.treatFunctionsAsVar?5:8201:17,t.id.loc.start)}parseClass(t,e,s){this.next();let r=this.state.strict;return this.state.strict=!0,this.parseClassId(t,e,s),this.parseClassSuper(t),t.body=this.parseClassBody(!!t.superClass,r),this.finishNode(t,e?"ClassDeclaration":"ClassExpression")}isClassProperty(){return this.match(29)||this.match(13)||this.match(8)}isClassMethod(){return this.match(10)}nameIsConstructor(t){return t.type==="Identifier"&&t.name==="constructor"||t.type==="StringLiteral"&&t.value==="constructor"}isNonstaticConstructor(t){return!t.computed&&!t.static&&this.nameIsConstructor(t.key)}parseClassBody(t,e){this.classScope.enter();let s={hadConstructor:!1,hadSuperClass:t},r=[],i=this.startNode();if(i.body=[],this.expect(5),this.withSmartMixTopicForbiddingContext(()=>{for(;!this.match(8);){if(this.eat(13)){if(r.length>0)throw this.raise(u.DecoratorSemicolon,this.state.lastTokEndLoc);continue}if(this.match(26)){r.push(this.parseDecorator());continue}let a=this.startNode();r.length&&(a.decorators=r,this.resetStartLocationFromNode(a,r[0]),r=[]),this.parseClassMember(i,a,s),a.kind==="constructor"&&a.decorators&&a.decorators.length>0&&this.raise(u.DecoratorConstructor,a)}}),this.state.strict=e,this.next(),r.length)throw this.raise(u.TrailingDecorator,this.state.startLoc);return this.classScope.exit(),this.finishNode(i,"ClassBody")}parseClassMemberFromModifier(t,e){let s=this.parseIdentifier(!0);if(this.isClassMethod()){let r=e;return r.kind="method",r.computed=!1,r.key=s,r.static=!1,this.pushClassMethod(t,r,!1,!1,!1,!1),!0}else if(this.isClassProperty()){let r=e;return r.computed=!1,r.key=s,r.static=!1,t.body.push(this.parseClassProperty(r)),!0}return this.resetPreviousNodeTrailingComments(s),!1}parseClassMember(t,e,s){let r=this.isContextual(106);if(r){if(this.parseClassMemberFromModifier(t,e))return;if(this.eat(5)){this.parseClassStaticBlock(t,e);return}}this.parseClassMemberWithIsStatic(t,e,s,r)}parseClassMemberWithIsStatic(t,e,s,r){let i=e,a=e,n=e,o=e,h=e,l=i,d=i;if(e.static=r,this.parsePropertyNamePrefixOperator(e),this.eat(55)){l.kind="method";let F=this.match(139);if(this.parseClassElementName(l),F){this.pushClassPrivateMethod(t,a,!0,!1);return}this.isNonstaticConstructor(i)&&this.raise(u.ConstructorIsGenerator,i.key),this.pushClassMethod(t,i,!0,!1,!1,!1);return}let y=!this.state.containsEsc&&D(this.state.type),A=this.parseClassElementName(e),T=y?A.name:null,N=this.isPrivateName(A),L=this.state.startLoc;if(this.parsePostMemberNameModifiers(d),this.isClassMethod()){if(l.kind="method",N){this.pushClassPrivateMethod(t,a,!1,!1);return}let F=this.isNonstaticConstructor(i),B=!1;F&&(i.kind="constructor",s.hadConstructor&&!this.hasPlugin("typescript")&&this.raise(u.DuplicateConstructor,A),F&&this.hasPlugin("typescript")&&e.override&&this.raise(u.OverrideOnConstructor,A),s.hadConstructor=!0,B=s.hadSuperClass),this.pushClassMethod(t,i,!1,!1,F,B)}else if(this.isClassProperty())N?this.pushClassPrivateProperty(t,o):this.pushClassProperty(t,n);else if(T==="async"&&!this.isLineTerminator()){this.resetPreviousNodeTrailingComments(A);let F=this.eat(55);d.optional&&this.unexpected(L),l.kind="method";let B=this.match(139);this.parseClassElementName(l),this.parsePostMemberNameModifiers(d),B?this.pushClassPrivateMethod(t,a,F,!0):(this.isNonstaticConstructor(i)&&this.raise(u.ConstructorIsAsync,i.key),this.pushClassMethod(t,i,F,!0,!1,!1))}else if((T==="get"||T==="set")&&!(this.match(55)&&this.isLineTerminator())){this.resetPreviousNodeTrailingComments(A),l.kind=T;let F=this.match(139);this.parseClassElementName(i),F?this.pushClassPrivateMethod(t,a,!1,!1):(this.isNonstaticConstructor(i)&&this.raise(u.ConstructorIsAccessor,i.key),this.pushClassMethod(t,i,!1,!1,!1,!1)),this.checkGetterSetterParams(i)}else if(T==="accessor"&&!this.isLineTerminator()){this.expectPlugin("decoratorAutoAccessors"),this.resetPreviousNodeTrailingComments(A);let F=this.match(139);this.parseClassElementName(n),this.pushClassAccessorProperty(t,h,F)}else this.isLineTerminator()?N?this.pushClassPrivateProperty(t,o):this.pushClassProperty(t,n):this.unexpected()}parseClassElementName(t){let{type:e,value:s}=this.state;if((e===132||e===134)&&t.static&&s==="prototype"&&this.raise(u.StaticPrototype,this.state.startLoc),e===139){s==="constructor"&&this.raise(u.ConstructorClassPrivateField,this.state.startLoc);let r=this.parsePrivateName();return t.key=r,r}return this.parsePropertyName(t),t.key}parseClassStaticBlock(t,e){var s;this.scope.enter(208);let r=this.state.labels;this.state.labels=[],this.prodParam.enter(0);let i=e.body=[];this.parseBlockOrModuleBlockBody(i,void 0,!1,8),this.prodParam.exit(),this.scope.exit(),this.state.labels=r,t.body.push(this.finishNode(e,"StaticBlock")),(s=e.decorators)!=null&&s.length&&this.raise(u.DecoratorStaticBlock,e)}pushClassProperty(t,e){!e.computed&&this.nameIsConstructor(e.key)&&this.raise(u.ConstructorClassField,e.key),t.body.push(this.parseClassProperty(e))}pushClassPrivateProperty(t,e){let s=this.parseClassPrivateProperty(e);t.body.push(s),this.classScope.declarePrivateName(this.getPrivateNameSV(s.key),0,s.key.loc.start)}pushClassAccessorProperty(t,e,s){!s&&!e.computed&&this.nameIsConstructor(e.key)&&this.raise(u.ConstructorClassField,e.key);let r=this.parseClassAccessorProperty(e);t.body.push(r),s&&this.classScope.declarePrivateName(this.getPrivateNameSV(r.key),0,r.key.loc.start)}pushClassMethod(t,e,s,r,i,a){t.body.push(this.parseMethod(e,s,r,i,a,"ClassMethod",!0))}pushClassPrivateMethod(t,e,s,r){let i=this.parseMethod(e,s,r,!1,!1,"ClassPrivateMethod",!0);t.body.push(i);let a=i.kind==="get"?i.static?6:2:i.kind==="set"?i.static?5:1:0;this.declareClassPrivateMethodInScope(i,a)}declareClassPrivateMethodInScope(t,e){this.classScope.declarePrivateName(this.getPrivateNameSV(t.key),e,t.key.loc.start)}parsePostMemberNameModifiers(t){}parseClassPrivateProperty(t){return this.parseInitializer(t),this.semicolon(),this.finishNode(t,"ClassPrivateProperty")}parseClassProperty(t){return this.parseInitializer(t),this.semicolon(),this.finishNode(t,"ClassProperty")}parseClassAccessorProperty(t){return this.parseInitializer(t),this.semicolon(),this.finishNode(t,"ClassAccessorProperty")}parseInitializer(t){this.scope.enter(80),this.expressionScope.enter(At()),this.prodParam.enter(0),t.value=this.eat(29)?this.parseMaybeAssignAllowIn():null,this.expressionScope.exit(),this.prodParam.exit(),this.scope.exit()}parseClassId(t,e,s,r=8331){if(D(this.state.type))t.id=this.parseIdentifier(),e&&this.declareNameFromIdentifier(t.id,r);else if(s||!e)t.id=null;else throw this.raise(u.MissingClassName,this.state.startLoc)}parseClassSuper(t){t.superClass=this.eat(81)?this.parseExprSubscripts():null}parseExport(t,e){let s=this.parseMaybeImportPhase(t,!0),r=this.maybeParseExportDefaultSpecifier(t,s),i=!r||this.eat(12),a=i&&this.eatExportStar(t),n=a&&this.maybeParseExportNamespaceSpecifier(t),o=i&&(!n||this.eat(12)),h=r||a;if(a&&!n){if(r&&this.unexpected(),e)throw this.raise(u.UnsupportedDecoratorExport,t);return this.parseExportFrom(t,!0),this.finishNode(t,"ExportAllDeclaration")}let l=this.maybeParseExportNamedSpecifiers(t);r&&i&&!a&&!l&&this.unexpected(null,5),n&&o&&this.unexpected(null,98);let d;if(h||l){if(d=!1,e)throw this.raise(u.UnsupportedDecoratorExport,t);this.parseExportFrom(t,h)}else d=this.maybeParseExportDeclaration(t);if(h||l||d){var y;let A=t;if(this.checkExport(A,!0,!1,!!A.source),((y=A.declaration)==null?void 0:y.type)==="ClassDeclaration")this.maybeTakeDecorators(e,A.declaration,A);else if(e)throw this.raise(u.UnsupportedDecoratorExport,t);return this.finishNode(A,"ExportNamedDeclaration")}if(this.eat(65)){let A=t,T=this.parseExportDefaultExpression();if(A.declaration=T,T.type==="ClassDeclaration")this.maybeTakeDecorators(e,T,A);else if(e)throw this.raise(u.UnsupportedDecoratorExport,t);return this.checkExport(A,!0,!0),this.finishNode(A,"ExportDefaultDeclaration")}this.unexpected(null,5)}eatExportStar(t){return this.eat(55)}maybeParseExportDefaultSpecifier(t,e){if(e||this.isExportDefaultSpecifier()){this.expectPlugin("exportDefaultFrom",e==null?void 0:e.loc.start);let s=e||this.parseIdentifier(!0),r=this.startNodeAtNode(s);return r.exported=s,t.specifiers=[this.finishNode(r,"ExportDefaultSpecifier")],!0}return!1}maybeParseExportNamespaceSpecifier(t){if(this.isContextual(93)){var e;(e=t).specifiers!=null||(e.specifiers=[]);let s=this.startNodeAt(this.state.lastTokStartLoc);return this.next(),s.exported=this.parseModuleExportName(),t.specifiers.push(this.finishNode(s,"ExportNamespaceSpecifier")),!0}return!1}maybeParseExportNamedSpecifiers(t){if(this.match(5)){let e=t;e.specifiers||(e.specifiers=[]);let s=e.exportKind==="type";return e.specifiers.push(...this.parseExportSpecifiers(s)),e.source=null,e.declaration=null,this.hasPlugin("importAssertions")&&(e.assertions=[]),!0}return!1}maybeParseExportDeclaration(t){return this.shouldParseExportDeclaration()?(t.specifiers=[],t.source=null,this.hasPlugin("importAssertions")&&(t.assertions=[]),t.declaration=this.parseExportDeclaration(t),!0):!1}isAsyncFunction(){if(!this.isContextual(95))return!1;let t=this.nextTokenInLineStart();return this.isUnparsedContextual(t,"function")}parseExportDefaultExpression(){let t=this.startNode();if(this.match(68))return this.next(),this.parseFunction(t,5);if(this.isAsyncFunction())return this.next(),this.next(),this.parseFunction(t,13);if(this.match(80))return this.parseClass(t,!0,!0);if(this.match(26))return this.hasPlugin("decorators")&&this.getPluginOption("decorators","decoratorsBeforeExport")===!0&&this.raise(u.DecoratorBeforeExport,this.state.startLoc),this.parseClass(this.maybeTakeDecorators(this.parseDecorators(!1),this.startNode()),!0,!0);if(this.match(75)||this.match(74)||this.isLet())throw this.raise(u.UnsupportedDefaultExport,this.state.startLoc);let e=this.parseMaybeAssignAllowIn();return this.semicolon(),e}parseExportDeclaration(t){return this.match(80)?this.parseClass(this.startNode(),!0,!1):this.parseStatementListItem()}isExportDefaultSpecifier(){let{type:t}=this.state;if(D(t)){if(t===95&&!this.state.containsEsc||t===100)return!1;if((t===130||t===129)&&!this.state.containsEsc){let{type:r}=this.lookahead();if(D(r)&&r!==98||r===5)return this.expectOnePlugin(["flow","typescript"]),!1}}else if(!this.match(65))return!1;let e=this.nextTokenStart(),s=this.isUnparsedContextual(e,"from");if(this.input.charCodeAt(e)===44||D(this.state.type)&&s)return!0;if(this.match(65)&&s){let r=this.input.charCodeAt(this.nextTokenStartSince(e+4));return r===34||r===39}return!1}parseExportFrom(t,e){this.eatContextual(98)?(t.source=this.parseImportSource(),this.checkExport(t),this.maybeParseImportAttributes(t),this.checkJSONModuleImport(t)):e&&this.unexpected(),this.semicolon()}shouldParseExportDeclaration(){let{type:t}=this.state;return t===26&&(this.expectOnePlugin(["decorators","decorators-legacy"]),this.hasPlugin("decorators"))?(this.getPluginOption("decorators","decoratorsBeforeExport")===!0&&this.raise(u.DecoratorBeforeExport,this.state.startLoc),!0):this.isContextual(107)?(this.raise(u.UsingDeclarationExport,this.state.startLoc),!0):this.isContextual(96)&&this.startsAwaitUsing()?(this.raise(u.UsingDeclarationExport,this.state.startLoc),!0):t===74||t===75||t===68||t===80||this.isLet()||this.isAsyncFunction()}checkExport(t,e,s,r){if(e){var i;if(s){if(this.checkDuplicateExports(t,"default"),this.hasPlugin("exportDefaultFrom")){var a;let n=t.declaration;n.type==="Identifier"&&n.name==="from"&&n.end-n.start===4&&!((a=n.extra)!=null&&a.parenthesized)&&this.raise(u.ExportDefaultFromAsIdentifier,n)}}else if((i=t.specifiers)!=null&&i.length)for(let n of t.specifiers){let{exported:o}=n,h=o.type==="Identifier"?o.name:o.value;if(this.checkDuplicateExports(n,h),!r&&n.local){let{local:l}=n;l.type!=="Identifier"?this.raise(u.ExportBindingIsString,n,{localName:l.value,exportName:h}):(this.checkReservedWord(l.name,l.loc.start,!0,!1),this.scope.checkLocalExport(l))}}else if(t.declaration){let n=t.declaration;if(n.type==="FunctionDeclaration"||n.type==="ClassDeclaration"){let{id:o}=n;if(!o)throw new Error("Assertion failure");this.checkDuplicateExports(t,o.name)}else if(n.type==="VariableDeclaration")for(let o of n.declarations)this.checkDeclaration(o.id)}}}checkDeclaration(t){if(t.type==="Identifier")this.checkDuplicateExports(t,t.name);else if(t.type==="ObjectPattern")for(let e of t.properties)this.checkDeclaration(e);else if(t.type==="ArrayPattern")for(let e of t.elements)e&&this.checkDeclaration(e);else t.type==="ObjectProperty"?this.checkDeclaration(t.value):t.type==="RestElement"?this.checkDeclaration(t.argument):t.type==="AssignmentPattern"&&this.checkDeclaration(t.left)}checkDuplicateExports(t,e){this.exportedIdentifiers.has(e)&&(e==="default"?this.raise(u.DuplicateDefaultExport,t):this.raise(u.DuplicateExport,t,{exportName:e})),this.exportedIdentifiers.add(e)}parseExportSpecifiers(t){let e=[],s=!0;for(this.expect(5);!this.eat(8);){if(s)s=!1;else if(this.expect(12),this.eat(8))break;let r=this.isContextual(130),i=this.match(134),a=this.startNode();a.local=this.parseModuleExportName(),e.push(this.parseExportSpecifier(a,i,t,r))}return e}parseExportSpecifier(t,e,s,r){return this.eatContextual(93)?t.exported=this.parseModuleExportName():e?t.exported=tr(t.local):t.exported||(t.exported=$(t.local)),this.finishNode(t,"ExportSpecifier")}parseModuleExportName(){if(this.match(134)){let t=this.parseStringLiteral(this.state.value),e=wr.exec(t.value);return e&&this.raise(u.ModuleExportNameHasLoneSurrogate,t,{surrogateCharCode:e[0].charCodeAt(0)}),t}return this.parseIdentifier(!0)}isJSONModuleImport(t){return t.assertions!=null?t.assertions.some(({key:e,value:s})=>s.value==="json"&&(e.type==="Identifier"?e.name==="type":e.value==="type")):!1}checkImportReflection(t){let{specifiers:e}=t,s=e.length===1?e[0].type:null;if(t.phase==="source")s!=="ImportDefaultSpecifier"&&this.raise(u.SourcePhaseImportRequiresDefault,e[0].loc.start);else if(t.phase==="defer")s!=="ImportNamespaceSpecifier"&&this.raise(u.DeferImportRequiresNamespace,e[0].loc.start);else if(t.module){var r;s!=="ImportDefaultSpecifier"&&this.raise(u.ImportReflectionNotBinding,e[0].loc.start),((r=t.assertions)==null?void 0:r.length)>0&&this.raise(u.ImportReflectionHasAssertion,e[0].loc.start)}}checkJSONModuleImport(t){if(this.isJSONModuleImport(t)&&t.type!=="ExportAllDeclaration"){let{specifiers:e}=t;if(e!=null){let s=e.find(r=>{let i;if(r.type==="ExportSpecifier"?i=r.local:r.type==="ImportSpecifier"&&(i=r.imported),i!==void 0)return i.type==="Identifier"?i.name!=="default":i.value!=="default"});s!==void 0&&this.raise(u.ImportJSONBindingNotDefault,s.loc.start)}}}isPotentialImportPhase(t){return t?!1:this.isContextual(105)||this.isContextual(97)||this.isContextual(127)}applyImportPhase(t,e,s,r){e||(s==="module"?(this.expectPlugin("importReflection",r),t.module=!0):this.hasPlugin("importReflection")&&(t.module=!1),s==="source"?(this.expectPlugin("sourcePhaseImports",r),t.phase="source"):s==="defer"?(this.expectPlugin("deferredImportEvaluation",r),t.phase="defer"):this.hasPlugin("sourcePhaseImports")&&(t.phase=null))}parseMaybeImportPhase(t,e){if(!this.isPotentialImportPhase(e))return this.applyImportPhase(t,e,null),null;let s=this.parseIdentifier(!0),{type:r}=this.state;return(U(r)?r!==98||this.lookaheadCharCode()===102:r!==12)?(this.resetPreviousIdentifierLeadingComments(s),this.applyImportPhase(t,e,s.name,s.loc.start),null):(this.applyImportPhase(t,e,null),s)}isPrecedingIdImportPhase(t){let{type:e}=this.state;return D(e)?e!==98||this.lookaheadCharCode()===102:e!==12}parseImport(t){return this.match(134)?this.parseImportSourceAndAttributes(t):this.parseImportSpecifiersAndAfter(t,this.parseMaybeImportPhase(t,!1))}parseImportSpecifiersAndAfter(t,e){t.specifiers=[];let s=!this.maybeParseDefaultImportSpecifier(t,e)||this.eat(12),r=s&&this.maybeParseStarImportSpecifier(t);return s&&!r&&this.parseNamedImportSpecifiers(t),this.expectContextual(98),this.parseImportSourceAndAttributes(t)}parseImportSourceAndAttributes(t){return t.specifiers!=null||(t.specifiers=[]),t.source=this.parseImportSource(),this.maybeParseImportAttributes(t),this.checkImportReflection(t),this.checkJSONModuleImport(t),this.semicolon(),this.finishNode(t,"ImportDeclaration")}parseImportSource(){return this.match(134)||this.unexpected(),this.parseExprAtom()}parseImportSpecifierLocal(t,e,s){e.local=this.parseIdentifier(),t.specifiers.push(this.finishImportSpecifier(e,s))}finishImportSpecifier(t,e,s=8201){return this.checkLVal(t.local,{type:e},s),this.finishNode(t,e)}parseImportAttributes(){this.expect(5);let t=[],e=new Set;do{if(this.match(8))break;let s=this.startNode(),r=this.state.value;if(e.has(r)&&this.raise(u.ModuleAttributesWithDuplicateKeys,this.state.startLoc,{key:r}),e.add(r),this.match(134)?s.key=this.parseStringLiteral(r):s.key=this.parseIdentifier(!0),this.expect(14),!this.match(134))throw this.raise(u.ModuleAttributeInvalidValue,this.state.startLoc);s.value=this.parseStringLiteral(this.state.value),t.push(this.finishNode(s,"ImportAttribute"))}while(this.eat(12));return this.expect(8),t}parseModuleAttributes(){let t=[],e=new Set;do{let s=this.startNode();if(s.key=this.parseIdentifier(!0),s.key.name!=="type"&&this.raise(u.ModuleAttributeDifferentFromType,s.key),e.has(s.key.name)&&this.raise(u.ModuleAttributesWithDuplicateKeys,s.key,{key:s.key.name}),e.add(s.key.name),this.expect(14),!this.match(134))throw this.raise(u.ModuleAttributeInvalidValue,this.state.startLoc);s.value=this.parseStringLiteral(this.state.value),t.push(this.finishNode(s,"ImportAttribute"))}while(this.eat(12));return t}maybeParseImportAttributes(t){let e;var s=!1;if(this.match(76)){if(this.hasPrecedingLineBreak()&&this.lookaheadCharCode()===40)return;this.next(),this.hasPlugin("moduleAttributes")?e=this.parseModuleAttributes():e=this.parseImportAttributes(),s=!0}else this.isContextual(94)&&!this.hasPrecedingLineBreak()?(!this.hasPlugin("deprecatedImportAssert")&&!this.hasPlugin("importAssertions")&&this.raise(u.ImportAttributesUseAssert,this.state.startLoc),this.hasPlugin("importAssertions")||this.addExtra(t,"deprecatedAssertSyntax",!0),this.next(),e=this.parseImportAttributes()):e=[];!s&&this.hasPlugin("importAssertions")?t.assertions=e:t.attributes=e}maybeParseDefaultImportSpecifier(t,e){if(e){let s=this.startNodeAtNode(e);return s.local=e,t.specifiers.push(this.finishImportSpecifier(s,"ImportDefaultSpecifier")),!0}else if(U(this.state.type))return this.parseImportSpecifierLocal(t,this.startNode(),"ImportDefaultSpecifier"),!0;return!1}maybeParseStarImportSpecifier(t){if(this.match(55)){let e=this.startNode();return this.next(),this.expectContextual(93),this.parseImportSpecifierLocal(t,e,"ImportNamespaceSpecifier"),!0}return!1}parseNamedImportSpecifiers(t){let e=!0;for(this.expect(5);!this.eat(8);){if(e)e=!1;else{if(this.eat(14))throw this.raise(u.DestructureNamedImport,this.state.startLoc);if(this.expect(12),this.eat(8))break}let s=this.startNode(),r=this.match(134),i=this.isContextual(130);s.imported=this.parseModuleExportName();let a=this.parseImportSpecifier(s,r,t.importKind==="type"||t.importKind==="typeof",i,void 0);t.specifiers.push(a)}}parseImportSpecifier(t,e,s,r,i){if(this.eatContextual(93))t.local=this.parseIdentifier();else{let{imported:a}=t;if(e)throw this.raise(u.ImportBindingIsString,t,{importName:a.value});this.checkReservedWord(a.name,t.loc.start,!0,!0),t.local||(t.local=$(a))}return this.finishImportSpecifier(t,"ImportSpecifier",i)}isThisParam(t){return t.type==="Identifier"&&t.name==="this"}},kt=class extends Nr{constructor(t,e,s){t=ls(t),super(t,e),this.options=t,this.initializeScopes(),this.plugins=s,this.filename=t.sourceFilename,this.startIndex=t.startIndex;let r=0;t.allowAwaitOutsideFunction&&(r|=1),t.allowReturnOutsideFunction&&(r|=2),t.allowImportExportEverywhere&&(r|=8),t.allowSuperOutsideMethod&&(r|=16),t.allowUndeclaredExports&&(r|=32),t.allowNewTargetOutsideFunction&&(r|=4),t.ranges&&(r|=64),t.tokens&&(r|=128),t.createImportExpressions&&(r|=256),t.createParenthesizedExpressions&&(r|=512),t.errorRecovery&&(r|=1024),t.attachComment&&(r|=2048),t.annexB&&(r|=4096),this.optionFlags=r}getScopeHandler(){return Ue}parse(){this.enterInitialScopes();let t=this.startNode(),e=this.startNode();return this.nextToken(),t.errors=null,this.parseTopLevel(t,e),t.errors=this.state.errors,t.comments.length=this.state.commentsLen,t}};function vr(t,e){var s;if(((s=e)==null?void 0:s.sourceType)==="unambiguous"){e=Object.assign({},e);try{e.sourceType="module";let r=ce(e,t),i=r.parse();if(r.sawUnambiguousESM)return i;if(r.ambiguousScriptDifferentAst)try{return e.sourceType="script",ce(e,t).parse()}catch{}else i.program.sourceType="script";return i}catch(r){try{return e.sourceType="script",ce(e,t).parse()}catch{}throw r}}else return ce(e,t).parse()}function kr(t,e){let s=ce(e,t);return s.options.strictMode&&(s.state.strict=!0),s.getExpression()}function Dr(t){let e={};for(let s of Object.keys(t))e[s]=V(t[s]);return e}var Fr=Dr(cs);function ce(t,e){let s=kt,r=new Map;if(t!=null&&t.plugins){for(let i of t.plugins){let a,n;typeof i=="string"?a=i:[a,n]=i,r.has(a)||r.set(a,n||{})}br(r),s=Lr(r)}return new s(t,e,r)}var Dt=new Map;function Lr(t){let e=[];for(let i of Er)t.has(i)&&e.push(i);let s=e.join("|"),r=Dt.get(s);if(!r){r=kt;for(let i of e)r=vt[i](r);Dt.set(s,r)}return r}p.parse=vr,p.parseExpression=kr,p.tokTypes=Fr}),Kt={};_r(Kt,{parsers:()=>Ji});var Ft=Vt(qt());function Jt(p){return(c,m,x)=>{let f=!!(x!=null&&x.backwards);if(m===!1)return!1;let{length:C}=c,S=m;for(;S>=0&&S{if(!(p&&c==null))return Array.isArray(c)||typeof c=="string"?c[m<0?c.length+m:m]:c.at(m)},Lt=ti;function si(p){return Array.isArray(p)&&p.length>0}var et=si;function _(p){var c,m,x;let f=((c=p.range)==null?void 0:c[0])??p.start,C=(x=((m=p.declaration)==null?void 0:m.decorators)??p.decorators)==null?void 0:x[0];return C?Math.min(_(C),f):f}function ee(p){var c;return((c=p.range)==null?void 0:c[1])??p.end}function ri(p){let c=new Set(p);return m=>c.has(m==null?void 0:m.type)}var ii=ri,ai=ii(["Block","CommentBlock","MultiLine"]),Ge=ai;function ni(p){let c=`*${p.value}*`.split(` `);return c.length>1&&c.every(m=>m.trimStart()[0]==="*")}var Bt=ni;function oi(p){return Ge(p)&&p.value[0]==="*"&&/@(?:type|satisfies)\b/u.test(p.value)}var li=oi,de=null;function fe(p){if(de!==null&&typeof de.property){let c=de;return de=fe.prototype=null,c}return de=fe.prototype=p??Object.create(null),new fe}var hi=10;for(let p=0;p<=hi;p++)fe();function pi(p){return fe(p)}function ui(p,c="type"){pi(p);function m(x){let f=x[c],C=p[f];if(!Array.isArray(C))throw Object.assign(new Error(`Missing visitor keys for '${f}'.`),{node:x});return C}return m}var ci=ui,di={ArrayExpression:["elements"],AssignmentExpression:["left","right"],BinaryExpression:["left","right"],InterpreterDirective:[],Directive:["value"],DirectiveLiteral:[],BlockStatement:["directives","body"],BreakStatement:["label"],CallExpression:["callee","arguments","typeParameters","typeArguments"],CatchClause:["param","body"],ConditionalExpression:["test","consequent","alternate"],ContinueStatement:["label"],DebuggerStatement:[],DoWhileStatement:["body","test"],EmptyStatement:[],ExpressionStatement:["expression"],File:["program"],ForInStatement:["left","right","body"],ForStatement:["init","test","update","body"],FunctionDeclaration:["id","typeParameters","params","predicate","returnType","body"],FunctionExpression:["id","typeParameters","params","returnType","body"],Identifier:["typeAnnotation","decorators"],IfStatement:["test","consequent","alternate"],LabeledStatement:["label","body"],StringLiteral:[],NumericLiteral:[],NullLiteral:[],BooleanLiteral:[],RegExpLiteral:[],LogicalExpression:["left","right"],MemberExpression:["object","property"],NewExpression:["callee","arguments","typeParameters","typeArguments"],Program:["directives","body"],ObjectExpression:["properties"],ObjectMethod:["decorators","key","typeParameters","params","returnType","body"],ObjectProperty:["key","value","decorators"],RestElement:["argument","typeAnnotation","decorators"],ReturnStatement:["argument"],SequenceExpression:["expressions"],ParenthesizedExpression:["expression"],SwitchCase:["test","consequent"],SwitchStatement:["discriminant","cases"],ThisExpression:[],ThrowStatement:["argument"],TryStatement:["block","handler","finalizer"],UnaryExpression:["argument"],UpdateExpression:["argument"],VariableDeclaration:["declarations"],VariableDeclarator:["id","init"],WhileStatement:["test","body"],WithStatement:["object","body"],AssignmentPattern:["left","right","decorators","typeAnnotation"],ArrayPattern:["elements","typeAnnotation","decorators"],ArrowFunctionExpression:["typeParameters","params","predicate","returnType","body"],ClassBody:["body"],ClassExpression:["decorators","id","typeParameters","superClass","superTypeParameters","mixins","implements","body","superTypeArguments"],ClassDeclaration:["decorators","id","typeParameters","superClass","superTypeParameters","mixins","implements","body","superTypeArguments"],ExportAllDeclaration:["source","attributes","exported"],ExportDefaultDeclaration:["declaration"],ExportNamedDeclaration:["declaration","specifiers","source","attributes"],ExportSpecifier:["local","exported"],ForOfStatement:["left","right","body"],ImportDeclaration:["specifiers","source","attributes"],ImportDefaultSpecifier:["local"],ImportNamespaceSpecifier:["local"],ImportSpecifier:["imported","local"],ImportExpression:["source","options"],MetaProperty:["meta","property"],ClassMethod:["decorators","key","typeParameters","params","returnType","body"],ObjectPattern:["properties","typeAnnotation","decorators"],SpreadElement:["argument"],Super:[],TaggedTemplateExpression:["tag","typeParameters","quasi","typeArguments"],TemplateElement:[],TemplateLiteral:["quasis","expressions"],YieldExpression:["argument"],AwaitExpression:["argument"],BigIntLiteral:[],ExportNamespaceSpecifier:["exported"],OptionalMemberExpression:["object","property"],OptionalCallExpression:["callee","arguments","typeParameters","typeArguments"],ClassProperty:["decorators","variance","key","typeAnnotation","value"],ClassAccessorProperty:["decorators","key","typeAnnotation","value"],ClassPrivateProperty:["decorators","variance","key","typeAnnotation","value"],ClassPrivateMethod:["decorators","key","typeParameters","params","returnType","body"],PrivateName:["id"],StaticBlock:["body"],AnyTypeAnnotation:[],ArrayTypeAnnotation:["elementType"],BooleanTypeAnnotation:[],BooleanLiteralTypeAnnotation:[],NullLiteralTypeAnnotation:[],ClassImplements:["id","typeParameters"],DeclareClass:["id","typeParameters","extends","mixins","implements","body"],DeclareFunction:["id","predicate"],DeclareInterface:["id","typeParameters","extends","body"],DeclareModule:["id","body"],DeclareModuleExports:["typeAnnotation"],DeclareTypeAlias:["id","typeParameters","right"],DeclareOpaqueType:["id","typeParameters","supertype"],DeclareVariable:["id"],DeclareExportDeclaration:["declaration","specifiers","source","attributes"],DeclareExportAllDeclaration:["source","attributes"],DeclaredPredicate:["value"],ExistsTypeAnnotation:[],FunctionTypeAnnotation:["typeParameters","this","params","rest","returnType"],FunctionTypeParam:["name","typeAnnotation"],GenericTypeAnnotation:["id","typeParameters"],InferredPredicate:[],InterfaceExtends:["id","typeParameters"],InterfaceDeclaration:["id","typeParameters","extends","body"],InterfaceTypeAnnotation:["extends","body"],IntersectionTypeAnnotation:["types"],MixedTypeAnnotation:[],EmptyTypeAnnotation:[],NullableTypeAnnotation:["typeAnnotation"],NumberLiteralTypeAnnotation:[],NumberTypeAnnotation:[],ObjectTypeAnnotation:["properties","indexers","callProperties","internalSlots"],ObjectTypeInternalSlot:["id","value"],ObjectTypeCallProperty:["value"],ObjectTypeIndexer:["variance","id","key","value"],ObjectTypeProperty:["key","value","variance"],ObjectTypeSpreadProperty:["argument"],OpaqueType:["id","typeParameters","supertype","impltype"],QualifiedTypeIdentifier:["qualification","id"],StringLiteralTypeAnnotation:[],StringTypeAnnotation:[],SymbolTypeAnnotation:[],ThisTypeAnnotation:[],TupleTypeAnnotation:["types","elementTypes"],TypeofTypeAnnotation:["argument","typeArguments"],TypeAlias:["id","typeParameters","right"],TypeAnnotation:["typeAnnotation"],TypeCastExpression:["expression","typeAnnotation"],TypeParameter:["bound","default","variance"],TypeParameterDeclaration:["params"],TypeParameterInstantiation:["params"],UnionTypeAnnotation:["types"],Variance:[],VoidTypeAnnotation:[],EnumDeclaration:["id","body"],EnumBooleanBody:["members"],EnumNumberBody:["members"],EnumStringBody:["members"],EnumSymbolBody:["members"],EnumBooleanMember:["id","init"],EnumNumberMember:["id","init"],EnumStringMember:["id","init"],EnumDefaultedMember:["id"],IndexedAccessType:["objectType","indexType"],OptionalIndexedAccessType:["objectType","indexType"],JSXAttribute:["name","value"],JSXClosingElement:["name"],JSXElement:["openingElement","children","closingElement"],JSXEmptyExpression:[],JSXExpressionContainer:["expression"],JSXSpreadChild:["expression"],JSXIdentifier:[],JSXMemberExpression:["object","property"],JSXNamespacedName:["namespace","name"],JSXOpeningElement:["name","typeParameters","typeArguments","attributes"],JSXSpreadAttribute:["argument"],JSXText:[],JSXFragment:["openingFragment","children","closingFragment"],JSXOpeningFragment:[],JSXClosingFragment:[],Noop:[],Placeholder:[],V8IntrinsicIdentifier:[],ArgumentPlaceholder:[],BindExpression:["object","callee"],ImportAttribute:["key","value"],Decorator:["expression"],DoExpression:["body"],ExportDefaultSpecifier:["exported"],RecordExpression:["properties"],TupleExpression:["elements"],ModuleExpression:["body"],TopicReference:[],PipelineTopicExpression:["expression"],PipelineBareFunction:["callee"],PipelinePrimaryTopicReference:[],TSParameterProperty:["parameter","decorators"],TSDeclareFunction:["id","typeParameters","params","returnType","body"],TSDeclareMethod:["decorators","key","typeParameters","params","returnType"],TSQualifiedName:["left","right"],TSCallSignatureDeclaration:["typeParameters","parameters","typeAnnotation","params","returnType"],TSConstructSignatureDeclaration:["typeParameters","parameters","typeAnnotation","params","returnType"],TSPropertySignature:["key","typeAnnotation"],TSMethodSignature:["key","typeParameters","parameters","typeAnnotation","params","returnType"],TSIndexSignature:["parameters","typeAnnotation"],TSAnyKeyword:[],TSBooleanKeyword:[],TSBigIntKeyword:[],TSIntrinsicKeyword:[],TSNeverKeyword:[],TSNullKeyword:[],TSNumberKeyword:[],TSObjectKeyword:[],TSStringKeyword:[],TSSymbolKeyword:[],TSUndefinedKeyword:[],TSUnknownKeyword:[],TSVoidKeyword:[],TSThisType:[],TSFunctionType:["typeParameters","parameters","typeAnnotation","params","returnType"],TSConstructorType:["typeParameters","parameters","typeAnnotation","params","returnType"],TSTypeReference:["typeName","typeParameters","typeArguments"],TSTypePredicate:["parameterName","typeAnnotation"],TSTypeQuery:["exprName","typeParameters","typeArguments"],TSTypeLiteral:["members"],TSArrayType:["elementType"],TSTupleType:["elementTypes"],TSOptionalType:["typeAnnotation"],TSRestType:["typeAnnotation"],TSNamedTupleMember:["label","elementType"],TSUnionType:["types"],TSIntersectionType:["types"],TSConditionalType:["checkType","extendsType","trueType","falseType"],TSInferType:["typeParameter"],TSParenthesizedType:["typeAnnotation"],TSTypeOperator:["typeAnnotation"],TSIndexedAccessType:["objectType","indexType"],TSMappedType:["typeParameter","nameType","typeAnnotation"],TSTemplateLiteralType:["quasis","types"],TSLiteralType:["literal"],TSExpressionWithTypeArguments:["expression","typeParameters"],TSInterfaceDeclaration:["id","typeParameters","extends","body"],TSInterfaceBody:["body"],TSTypeAliasDeclaration:["id","typeParameters","typeAnnotation"],TSInstantiationExpression:["expression","typeParameters","typeArguments"],TSAsExpression:["expression","typeAnnotation"],TSSatisfiesExpression:["expression","typeAnnotation"],TSTypeAssertion:["typeAnnotation","expression"],TSEnumBody:["members"],TSEnumDeclaration:["id","members"],TSEnumMember:["id","initializer"],TSModuleDeclaration:["id","body"],TSModuleBlock:["body"],TSImportType:["argument","options","qualifier","typeParameters","typeArguments"],TSImportEqualsDeclaration:["id","moduleReference"],TSExternalModuleReference:["expression"],TSNonNullExpression:["expression"],TSExportAssignment:["expression"],TSNamespaceExportDeclaration:["id"],TSTypeAnnotation:["typeAnnotation"],TSTypeParameterInstantiation:["params"],TSTypeParameterDeclaration:["params"],TSTypeParameter:["constraint","default","name"],ChainExpression:["expression"],ExperimentalRestProperty:["argument"],ExperimentalSpreadProperty:["argument"],Literal:[],MethodDefinition:["decorators","key","value"],PrivateIdentifier:[],Property:["key","value"],PropertyDefinition:["decorators","key","typeAnnotation","value","variance"],AccessorProperty:["decorators","key","typeAnnotation","value"],TSAbstractAccessorProperty:["decorators","key","typeAnnotation"],TSAbstractKeyword:[],TSAbstractMethodDefinition:["key","value"],TSAbstractPropertyDefinition:["decorators","key","typeAnnotation"],TSAsyncKeyword:[],TSClassImplements:["expression","typeArguments","typeParameters"],TSDeclareKeyword:[],TSEmptyBodyFunctionExpression:["id","typeParameters","params","returnType"],TSExportKeyword:[],TSInterfaceHeritage:["expression","typeArguments","typeParameters"],TSPrivateKeyword:[],TSProtectedKeyword:[],TSPublicKeyword:[],TSReadonlyKeyword:[],TSStaticKeyword:[],AsConstExpression:["expression"],AsExpression:["expression","typeAnnotation"],BigIntLiteralTypeAnnotation:[],BigIntTypeAnnotation:[],ComponentDeclaration:["id","params","body","typeParameters","rendersType"],ComponentParameter:["name","local"],ComponentTypeAnnotation:["params","rest","typeParameters","rendersType"],ComponentTypeParameter:["name","typeAnnotation"],ConditionalTypeAnnotation:["checkType","extendsType","trueType","falseType"],DeclareComponent:["id","params","rest","typeParameters","rendersType"],DeclareEnum:["id","body"],DeclareHook:["id"],DeclareNamespace:["id","body"],EnumBigIntBody:["members"],EnumBigIntMember:["id","init"],HookDeclaration:["id","params","body","typeParameters","returnType"],HookTypeAnnotation:["params","returnType","rest","typeParameters"],InferTypeAnnotation:["typeParameter"],KeyofTypeAnnotation:["argument"],ObjectTypeMappedTypeProperty:["keyTparam","propType","sourceType","variance"],QualifiedTypeofIdentifier:["qualification","id"],TupleTypeLabeledElement:["label","elementType","variance"],TupleTypeSpreadElement:["label","typeAnnotation"],TypeOperator:["typeAnnotation"],TypePredicate:["parameterName","typeAnnotation","asserts"],NGRoot:["node"],NGPipeExpression:["left","right","arguments"],NGChainedExpression:["expressions"],NGEmptyExpression:[],NGMicrosyntax:["body"],NGMicrosyntaxKey:[],NGMicrosyntaxExpression:["expression","alias"],NGMicrosyntaxKeyedExpression:["key","expression"],NGMicrosyntaxLet:["key","value"],NGMicrosyntaxAs:["key","alias"],JsExpressionRoot:["node"],JsonRoot:["node"],TSJSDocAllType:[],TSJSDocUnknownType:[],TSJSDocNullableType:["typeAnnotation"],TSJSDocNonNullableType:["typeAnnotation"],NeverTypeAnnotation:[],UndefinedTypeAnnotation:[],UnknownTypeAnnotation:[],SatisfiesExpression:["expression","typeAnnotation"]},mi=ci(di),fi=mi;function Ye(p,c){if(!(p!==null&&typeof p=="object"))return p;if(Array.isArray(p)){for(let x=0;x{var S;(S=C.leadingComments)!=null&&S.some(li)&&f.add(_(C))}),p=We(p,C=>{if(C.type==="ParenthesizedExpression"){let{expression:S}=C;if(S.type==="TypeCastExpression")return S.range=[...C.range],S;let M=_(C);if(!f.has(M))return S.extra={...S.extra,parenthesized:!0},S}})}if(p=We(p,f=>{switch(f.type){case"LogicalExpression":if(Xt(f))return Qe(f);break;case"VariableDeclaration":{let C=Lt(!1,f.declarations,-1);C!=null&&C.init&&x[ee(C)]!==";"&&(f.range=[_(f),ee(C)]);break}case"TSParenthesizedType":return f.typeAnnotation;case"TSTypeParameter":if(typeof f.name=="string"){let C=_(f);f.name={type:"Identifier",name:f.name,range:[C,C+f.name.length]}}break;case"TopicReference":p.extra={...p.extra,__isUsingHackPipeline:!0};break;case"TSUnionType":case"TSIntersectionType":if(f.types.length===1)return f.types[0];break}}),et(p.comments)){let f=Lt(!1,p.comments,-1);for(let C=p.comments.length-2;C>=0;C--){let S=p.comments[C];ee(S)===_(f)&&Ge(S)&&Ge(f)&&Bt(S)&&Bt(f)&&(p.comments.splice(C+1,1),S.value+="*//*"+f.value,S.range=[_(S),ee(f)]),f=S}}return p.type==="Program"&&(p.range=[0,x.length]),p}function Xt(p){return p.type==="LogicalExpression"&&p.right.type==="LogicalExpression"&&p.operator===p.right.operator}function Qe(p){return Xt(p)?Qe({type:"LogicalExpression",operator:p.operator,left:Qe({type:"LogicalExpression",operator:p.operator,left:p.left,right:p.right.left,range:[_(p.left),ee(p.right.left)]}),right:p.right.right,range:[_(p),ee(p)]}):p}var xi=yi;function Pi(p,c){let m=new SyntaxError(p+" ("+c.loc.start.line+":"+c.loc.start.column+")");return Object.assign(m,c)}var Gt=Pi;function Ai(p){let{message:c,loc:{line:m,column:x},reasonCode:f}=p,C=p;(f==="MissingPlugin"||f==="MissingOneOfPlugins")&&(c="Unexpected token.",C=void 0);let S=` (${m}:${x})`;return c.endsWith(S)&&(c=c.slice(0,-S.length)),Gt(c,{loc:{start:{line:m,column:x+1}},cause:C})}var Yt=Ai,gi=(p,c,m,x)=>{if(!(p&&c==null))return c.replaceAll?c.replaceAll(m,x):m.global?c.replace(m,x):c.split(m).join(x)},Ce=gi,Ti=/\*\/$/,bi=/^\/\*\*?/,Ei=/^\s*(\/\*\*?(.|\r?\n)*?\*\/)/,Ci=/(^|\s+)\/\/([^\n\r]*)/g,Mt=/^(\r?\n)+/,Si=/(?:^|\r?\n) *(@[^\n\r]*?) *\r?\n *(?![^\n\r@]*\/\/[^]*)([^\s@][^\n\r@]+?) *\r?\n/g,Ot=/(?:^|\r?\n) *@(\S+) *([^\n\r]*)/g,wi=/(\r?\n|^) *\* ?/g,Ii=[];function Ni(p){let c=p.match(Ei);return c?c[0].trimStart():""}function vi(p){let c=` `;p=Ce(!1,p.replace(bi,"").replace(Ti,""),wi,"$1");let m="";for(;m!==p;)m=p,p=Ce(!1,p,Si,`${c}$1 $2${c}`);p=p.replace(Mt,"").trimEnd();let x=Object.create(null),f=Ce(!1,p,Ot,"").replace(Mt,"").trimEnd(),C;for(;C=Ot.exec(p);){let S=Ce(!1,C[2],Ci,"");if(typeof x[C[1]]=="string"||Array.isArray(x[C[1]])){let M=x[C[1]];x[C[1]]=[...Ii,...Array.isArray(M)?M:[M],S]}else x[C[1]]=S}return{comments:f,pragmas:x}}function ki(p){let c=Wt(p);c&&(p=p.slice(c.length+1));let m=Ni(p),{pragmas:x,comments:f}=vi(m);return{shebang:c,text:p,pragmas:x,comments:f}}function Di(p){let{pragmas:c}=ki(p);return Object.prototype.hasOwnProperty.call(c,"prettier")||Object.prototype.hasOwnProperty.call(c,"format")}function Fi(p){return p=typeof p=="function"?{parse:p}:p,{astFormat:"estree",hasPragma:Di,locStart:_,locEnd:ee,...p}}var me=Fi;function Li(p){let{filepath:c}=p;if(c){if(c=c.toLowerCase(),c.endsWith(".cjs")||c.endsWith(".cts"))return"script";if(c.endsWith(".mjs")||c.endsWith(".mts"))return"module"}}var Bi=Li;function Mi(p,c){let{type:m="JsExpressionRoot",rootMarker:x,text:f}=c,{tokens:C,comments:S}=p;return delete p.tokens,delete p.comments,{tokens:C,comments:S,type:m,node:p,range:[0,f.length],rootMarker:x}}var Qt=Mi,ae=p=>me(_i(p)),Oi={sourceType:"module",allowImportExportEverywhere:!0,allowReturnOutsideFunction:!0,allowNewTargetOutsideFunction:!0,allowSuperOutsideMethod:!0,allowUndeclaredExports:!0,errorRecovery:!0,createParenthesizedExpressions:!0,createImportExpressions:!0,plugins:["doExpressions","exportDefaultFrom","functionBind","functionSent","throwExpressions","partialApplication","decorators","moduleBlocks","asyncDoExpressions","destructuringPrivate","decoratorAutoAccessors","explicitResourceManagement","sourcePhaseImports","deferredImportEvaluation",["optionalChainingAssign",{version:"2023-07"}],"recordAndTuple"],tokens:!0,ranges:!0},Rt="v8intrinsic",jt=[["pipelineOperator",{proposal:"hack",topicToken:"%"}],["pipelineOperator",{proposal:"fsharp"}]],K=(p,c=Oi)=>({...c,plugins:[...c.plugins,...p]}),Ri=/@(?:no)?flow\b/u;function ji(p,c){var m;if((m=c.filepath)!=null&&m.endsWith(".js.flow"))return!0;let x=Wt(p);x&&(p=p.slice(x.length));let f=Yr(p,0);return f!==!1&&(p=p.slice(0,f)),Ri.test(p)}function Ui(p,c,m){let x=p(c,m),f=x.errors.find(C=>!Hi.has(C.reasonCode));if(f)throw f;return x}function _i({isExpression:p=!1,optionsCombinations:c}){return(m,x={})=>{if((x.parser==="babel"||x.parser==="__babel_estree")&&ji(m,x))return x.parser="babel-flow",es.parse(m,x);let f=c;(x.__babelSourceType??Bi(x))==="script"&&(f=f.map(R=>({...R,sourceType:"script"})));let C=/%[A-Z]/u.test(m);m.includes("|>")?f=(C?[...jt,Rt]:jt).flatMap(R=>f.map(Se=>K([R],Se))):C&&(f=f.map(R=>K([Rt],R)));let S=p?Ft.parseExpression:Ft.parse,M;try{M=Zr(f.map(R=>()=>Ui(S,m,R)))}catch({errors:[R]}){throw Yt(R)}return p&&(M=Qt(M,{text:m,rootMarker:x.rootMarker})),xi(M,{parser:"babel",text:m})}}var Hi=new Set(["StrictNumericEscape","StrictWith","StrictOctalLiteral","StrictDelete","StrictEvalArguments","StrictEvalArgumentsBinding","StrictFunction","ForInOfLoopInitializer","EmptyTypeArguments","EmptyTypeParameters","ConstructorHasTypeParameters","UnsupportedParameterPropertyKind","DecoratorExportClass","ParamDupe","InvalidDecimal","RestTrailingComma","UnsupportedParameterDecorator","UnterminatedJsxContent","UnexpectedReservedWord","ModuleAttributesWithDuplicateKeys","LineTerminatorBeforeArrow","InvalidEscapeSequenceTemplate","NonAbstractClassHasAbstractMethod","OptionalTypeBeforeRequired","PatternIsOptional","OptionalBindingPattern","DeclareClassFieldHasInitializer","TypeImportCannotSpecifyDefaultAndNamed","ConstructorClassField","VarRedeclaration","InvalidPrivateFieldResolution","DuplicateExport","ImportAttributesUseAssert"]),Zt=[K(["jsx"])],Ut=ae({optionsCombinations:Zt}),_t=ae({optionsCombinations:[K(["jsx","typescript"]),K(["typescript"])]}),Ht=ae({isExpression:!0,optionsCombinations:[K(["jsx"])]}),zt=ae({isExpression:!0,optionsCombinations:[K(["typescript"])]}),es=ae({optionsCombinations:[K(["jsx",["flow",{all:!0}],"flowComments"])]}),zi=ae({optionsCombinations:Zt.map(p=>K(["estree"],p))}),Vi={babel:Ut,"babel-flow":es,"babel-ts":_t,__js_expression:Ht,__ts_expression:zt,__vue_expression:Ht,__vue_ts_expression:zt,__vue_event_binding:Ut,__vue_ts_event_binding:_t,__babel_estree:zi},qi=Vt(qt());function ts(p={}){let{allowComments:c=!0}=p;return function(m){let x;try{x=(0,qi.parseExpression)(m,{tokens:!0,ranges:!0,attachComment:!1})}catch(f){throw Yt(f)}if(!c&&et(x.comments))throw Y(x.comments[0],"Comment");return ie(x),Qt(x,{type:"JsonRoot",text:m})}}function Y(p,c){let[m,x]=[p.loc.start,p.loc.end].map(({line:f,column:C})=>({line:f,column:C+1}));return Gt(`${c} is not allowed in JSON.`,{loc:{start:m,end:x}})}function ie(p){switch(p.type){case"ArrayExpression":for(let c of p.elements)c!==null&&ie(c);return;case"ObjectExpression":for(let c of p.properties)ie(c);return;case"ObjectProperty":if(p.computed)throw Y(p.key,"Computed key");if(p.shorthand)throw Y(p.key,"Shorthand property");p.key.type!=="Identifier"&&ie(p.key),ie(p.value);return;case"UnaryExpression":{let{operator:c,argument:m}=p;if(c!=="+"&&c!=="-")throw Y(p,`Operator '${p.operator}'`);if(m.type==="NumericLiteral"||m.type==="Identifier"&&(m.name==="Infinity"||m.name==="NaN"))return;throw Y(m,`Operator '${c}' before '${m.type}'`)}case"Identifier":if(p.name!=="Infinity"&&p.name!=="NaN"&&p.name!=="undefined")throw Y(p,`Identifier '${p.name}'`);return;case"TemplateLiteral":if(et(p.expressions))throw Y(p.expressions[0],"'TemplateLiteral' with expression");for(let c of p.quasis)ie(c);return;case"NullLiteral":case"BooleanLiteral":case"NumericLiteral":case"StringLiteral":case"TemplateElement":return;default:throw Y(p,`'${p.type}'`)}}var Xe=ts(),$i={json:me({parse:Xe,hasPragma(){return!0}}),json5:me(Xe),jsonc:me(Xe),"json-stringify":me({parse:ts({allowComments:!1}),astFormat:"estree-json"})},Ki=$i,Ji={...Vi,...Ki},Wi=Kt;export{Wi as default,Ji as parsers}; ================================================ FILE: backend/openui/dist/assets/css-D1nB4Vcj.js ================================================ /*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.49.0(383fdf3fc0e1e1a024068b8d0fd4f3dcbae74d04) * Released under the MIT license * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt *-----------------------------------------------------------------------------*/var e={wordPattern:/(#?-?\d*\.\d\w*%?)|((::|[@#.!:])?[\w-?]+%?)|::|[@#.!:]/g,comments:{blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}",notIn:["string","comment"]},{open:"[",close:"]",notIn:["string","comment"]},{open:"(",close:")",notIn:["string","comment"]},{open:'"',close:'"',notIn:["string","comment"]},{open:"'",close:"'",notIn:["string","comment"]}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],folding:{markers:{start:new RegExp("^\\s*\\/\\*\\s*#region\\b\\s*(.*?)\\s*\\*\\/"),end:new RegExp("^\\s*\\/\\*\\s*#endregion\\b.*\\*\\/")}}},t={defaultToken:"",tokenPostfix:".css",ws:`[ \r\f]*`,identifier:"-?-?([a-zA-Z]|(\\\\(([0-9a-fA-F]{1,6}\\s?)|[^[0-9a-fA-F])))([\\w\\-]|(\\\\(([0-9a-fA-F]{1,6}\\s?)|[^[0-9a-fA-F])))*",brackets:[{open:"{",close:"}",token:"delimiter.bracket"},{open:"[",close:"]",token:"delimiter.bracket"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"<",close:">",token:"delimiter.angle"}],tokenizer:{root:[{include:"@selector"}],selector:[{include:"@comments"},{include:"@import"},{include:"@strings"},["[@](keyframes|-webkit-keyframes|-moz-keyframes|-o-keyframes)",{token:"keyword",next:"@keyframedeclaration"}],["[@](page|content|font-face|-moz-document)",{token:"keyword"}],["[@](charset|namespace)",{token:"keyword",next:"@declarationbody"}],["(url-prefix)(\\()",["attribute.value",{token:"delimiter.parenthesis",next:"@urldeclaration"}]],["(url)(\\()",["attribute.value",{token:"delimiter.parenthesis",next:"@urldeclaration"}]],{include:"@selectorname"},["[\\*]","tag"],["[>\\+,]","delimiter"],["\\[",{token:"delimiter.bracket",next:"@selectorattribute"}],["{",{token:"delimiter.bracket",next:"@selectorbody"}]],selectorbody:[{include:"@comments"},["[*_]?@identifier@ws:(?=(\\s|\\d|[^{;}]*[;}]))","attribute.name","@rulevalue"],["}",{token:"delimiter.bracket",next:"@pop"}]],selectorname:[["(\\.|#(?=[^{])|%|(@identifier)|:)+","tag"]],selectorattribute:[{include:"@term"},["]",{token:"delimiter.bracket",next:"@pop"}]],term:[{include:"@comments"},["(url-prefix)(\\()",["attribute.value",{token:"delimiter.parenthesis",next:"@urldeclaration"}]],["(url)(\\()",["attribute.value",{token:"delimiter.parenthesis",next:"@urldeclaration"}]],{include:"@functioninvocation"},{include:"@numbers"},{include:"@name"},{include:"@strings"},["([<>=\\+\\-\\*\\/\\^\\|\\~,])","delimiter"],[",","delimiter"]],rulevalue:[{include:"@comments"},{include:"@strings"},{include:"@term"},["!important","keyword"],[";","delimiter","@pop"],["(?=})",{token:"",next:"@pop"}]],warndebug:[["[@](warn|debug)",{token:"keyword",next:"@declarationbody"}]],import:[["[@](import)",{token:"keyword",next:"@declarationbody"}]],urldeclaration:[{include:"@strings"},[`[^)\r ]+`,"string"],["\\)",{token:"delimiter.parenthesis",next:"@pop"}]],parenthizedterm:[{include:"@term"},["\\)",{token:"delimiter.parenthesis",next:"@pop"}]],declarationbody:[{include:"@term"},[";","delimiter","@pop"],["(?=})",{token:"",next:"@pop"}]],comments:[["\\/\\*","comment","@comment"],["\\/\\/+.*","comment"]],comment:[["\\*\\/","comment","@pop"],[/[^*/]+/,"comment"],[/./,"comment"]],name:[["@identifier","attribute.value"]],numbers:[["-?(\\d*\\.)?\\d+([eE][\\-+]?\\d+)?",{token:"attribute.value.number",next:"@units"}],["#[0-9a-fA-F_]+(?!\\w)","attribute.value.hex"]],units:[["(em|ex|ch|rem|fr|vmin|vmax|vw|vh|vm|cm|mm|in|px|pt|pc|deg|grad|rad|turn|s|ms|Hz|kHz|%)?","attribute.value.unit","@pop"]],keyframedeclaration:[["@identifier","attribute.value"],["{",{token:"delimiter.bracket",switchTo:"@keyframebody"}]],keyframebody:[{include:"@term"},["{",{token:"delimiter.bracket",next:"@selectorbody"}],["}",{token:"delimiter.bracket",next:"@pop"}]],functioninvocation:[["@identifier\\(",{token:"attribute.value",next:"@functionarguments"}]],functionarguments:[["\\$@identifier@ws:","attribute.name"],["[,]","delimiter"],{include:"@term"},["\\)",{token:"attribute.value",next:"@pop"}]],strings:[['~?"',{token:"string",next:"@stringenddoublequote"}],["~?'",{token:"string",next:"@stringendquote"}]],stringenddoublequote:[["\\\\.","string"],['"',{token:"string",next:"@pop"}],[/[^\\"]+/,"string"],[".","string"]],stringendquote:[["\\\\.","string"],["'",{token:"string",next:"@pop"}],[/[^\\']+/,"string"],[".","string"]]}};export{e as conf,t as language}; ================================================ FILE: backend/openui/dist/assets/cssMode-CMP9zKWk.js ================================================ import{m as Le}from"./CodeEditor-B9qhAAku.js";import"./index-B7PjGjI7.js";import"./index-DnTpCebm.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.49.0(383fdf3fc0e1e1a024068b8d0fd4f3dcbae74d04) * Released under the MIT license * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt *-----------------------------------------------------------------------------*/var je=Object.defineProperty,Ne=Object.getOwnPropertyDescriptor,We=Object.getOwnPropertyNames,Oe=Object.prototype.hasOwnProperty,Ue=(e,n,i,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let t of We(n))!Oe.call(e,t)&&t!==i&&je(e,t,{get:()=>n[t],enumerable:!(r=Ne(n,t))||r.enumerable});return e},Ve=(e,n,i)=>(Ue(e,n,"default"),i),c={};Ve(c,Le);var He=2*60*1e3,ze=class{constructor(e){this._defaults=e,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>He&&this._stopWorker()}_getClient(){return this._lastUsedTime=Date.now(),this._client||(this._worker=c.editor.createWebWorker({moduleId:"vs/language/css/cssWorker",label:this._defaults.languageId,createData:{options:this._defaults.options,languageId:this._defaults.languageId}}),this._client=this._worker.getProxy()),this._client}getLanguageServiceWorker(...e){let n;return this._getClient().then(i=>{n=i}).then(i=>{if(this._worker)return this._worker.withSyncedResources(e)}).then(i=>n)}},J;(function(e){e.MIN_VALUE=-2147483648,e.MAX_VALUE=2147483647})(J||(J={}));var W;(function(e){e.MIN_VALUE=0,e.MAX_VALUE=2147483647})(W||(W={}));var k;(function(e){function n(r,t){return r===Number.MAX_VALUE&&(r=W.MAX_VALUE),t===Number.MAX_VALUE&&(t=W.MAX_VALUE),{line:r,character:t}}e.create=n;function i(r){var t=r;return s.objectLiteral(t)&&s.uinteger(t.line)&&s.uinteger(t.character)}e.is=i})(k||(k={}));var p;(function(e){function n(r,t,a,o){if(s.uinteger(r)&&s.uinteger(t)&&s.uinteger(a)&&s.uinteger(o))return{start:k.create(r,t),end:k.create(a,o)};if(k.is(r)&&k.is(t))return{start:r,end:t};throw new Error("Range#create called with invalid arguments["+r+", "+t+", "+a+", "+o+"]")}e.create=n;function i(r){var t=r;return s.objectLiteral(t)&&k.is(t.start)&&k.is(t.end)}e.is=i})(p||(p={}));var z;(function(e){function n(r,t){return{uri:r,range:t}}e.create=n;function i(r){var t=r;return s.defined(t)&&p.is(t.range)&&(s.string(t.uri)||s.undefined(t.uri))}e.is=i})(z||(z={}));var Y;(function(e){function n(r,t,a,o){return{targetUri:r,targetRange:t,targetSelectionRange:a,originSelectionRange:o}}e.create=n;function i(r){var t=r;return s.defined(t)&&p.is(t.targetRange)&&s.string(t.targetUri)&&(p.is(t.targetSelectionRange)||s.undefined(t.targetSelectionRange))&&(p.is(t.originSelectionRange)||s.undefined(t.originSelectionRange))}e.is=i})(Y||(Y={}));var X;(function(e){function n(r,t,a,o){return{red:r,green:t,blue:a,alpha:o}}e.create=n;function i(r){var t=r;return s.numberRange(t.red,0,1)&&s.numberRange(t.green,0,1)&&s.numberRange(t.blue,0,1)&&s.numberRange(t.alpha,0,1)}e.is=i})(X||(X={}));var Z;(function(e){function n(r,t){return{range:r,color:t}}e.create=n;function i(r){var t=r;return p.is(t.range)&&X.is(t.color)}e.is=i})(Z||(Z={}));var K;(function(e){function n(r,t,a){return{label:r,textEdit:t,additionalTextEdits:a}}e.create=n;function i(r){var t=r;return s.string(t.label)&&(s.undefined(t.textEdit)||x.is(t))&&(s.undefined(t.additionalTextEdits)||s.typedArray(t.additionalTextEdits,x.is))}e.is=i})(K||(K={}));var R;(function(e){e.Comment="comment",e.Imports="imports",e.Region="region"})(R||(R={}));var ee;(function(e){function n(r,t,a,o,u){var g={startLine:r,endLine:t};return s.defined(a)&&(g.startCharacter=a),s.defined(o)&&(g.endCharacter=o),s.defined(u)&&(g.kind=u),g}e.create=n;function i(r){var t=r;return s.uinteger(t.startLine)&&s.uinteger(t.startLine)&&(s.undefined(t.startCharacter)||s.uinteger(t.startCharacter))&&(s.undefined(t.endCharacter)||s.uinteger(t.endCharacter))&&(s.undefined(t.kind)||s.string(t.kind))}e.is=i})(ee||(ee={}));var B;(function(e){function n(r,t){return{location:r,message:t}}e.create=n;function i(r){var t=r;return s.defined(t)&&z.is(t.location)&&s.string(t.message)}e.is=i})(B||(B={}));var y;(function(e){e.Error=1,e.Warning=2,e.Information=3,e.Hint=4})(y||(y={}));var te;(function(e){e.Unnecessary=1,e.Deprecated=2})(te||(te={}));var re;(function(e){function n(i){var r=i;return r!=null&&s.string(r.href)}e.is=n})(re||(re={}));var O;(function(e){function n(r,t,a,o,u,g){var d={range:r,message:t};return s.defined(a)&&(d.severity=a),s.defined(o)&&(d.code=o),s.defined(u)&&(d.source=u),s.defined(g)&&(d.relatedInformation=g),d}e.create=n;function i(r){var t,a=r;return s.defined(a)&&p.is(a.range)&&s.string(a.message)&&(s.number(a.severity)||s.undefined(a.severity))&&(s.integer(a.code)||s.string(a.code)||s.undefined(a.code))&&(s.undefined(a.codeDescription)||s.string((t=a.codeDescription)===null||t===void 0?void 0:t.href))&&(s.string(a.source)||s.undefined(a.source))&&(s.undefined(a.relatedInformation)||s.typedArray(a.relatedInformation,B.is))}e.is=i})(O||(O={}));var D;(function(e){function n(r,t){for(var a=[],o=2;o0&&(u.arguments=a),u}e.create=n;function i(r){var t=r;return s.defined(t)&&s.string(t.title)&&s.string(t.command)}e.is=i})(D||(D={}));var x;(function(e){function n(a,o){return{range:a,newText:o}}e.replace=n;function i(a,o){return{range:{start:a,end:a},newText:o}}e.insert=i;function r(a){return{range:a,newText:""}}e.del=r;function t(a){var o=a;return s.objectLiteral(o)&&s.string(o.newText)&&p.is(o.range)}e.is=t})(x||(x={}));var I;(function(e){function n(r,t,a){var o={label:r};return t!==void 0&&(o.needsConfirmation=t),a!==void 0&&(o.description=a),o}e.create=n;function i(r){var t=r;return t!==void 0&&s.objectLiteral(t)&&s.string(t.label)&&(s.boolean(t.needsConfirmation)||t.needsConfirmation===void 0)&&(s.string(t.description)||t.description===void 0)}e.is=i})(I||(I={}));var m;(function(e){function n(i){var r=i;return typeof r=="string"}e.is=n})(m||(m={}));var b;(function(e){function n(a,o,u){return{range:a,newText:o,annotationId:u}}e.replace=n;function i(a,o,u){return{range:{start:a,end:a},newText:o,annotationId:u}}e.insert=i;function r(a,o){return{range:a,newText:"",annotationId:o}}e.del=r;function t(a){var o=a;return x.is(o)&&(I.is(o.annotationId)||m.is(o.annotationId))}e.is=t})(b||(b={}));var U;(function(e){function n(r,t){return{textDocument:r,edits:t}}e.create=n;function i(r){var t=r;return s.defined(t)&&V.is(t.textDocument)&&Array.isArray(t.edits)}e.is=i})(U||(U={}));var M;(function(e){function n(r,t,a){var o={kind:"create",uri:r};return t!==void 0&&(t.overwrite!==void 0||t.ignoreIfExists!==void 0)&&(o.options=t),a!==void 0&&(o.annotationId=a),o}e.create=n;function i(r){var t=r;return t&&t.kind==="create"&&s.string(t.uri)&&(t.options===void 0||(t.options.overwrite===void 0||s.boolean(t.options.overwrite))&&(t.options.ignoreIfExists===void 0||s.boolean(t.options.ignoreIfExists)))&&(t.annotationId===void 0||m.is(t.annotationId))}e.is=i})(M||(M={}));var S;(function(e){function n(r,t,a,o){var u={kind:"rename",oldUri:r,newUri:t};return a!==void 0&&(a.overwrite!==void 0||a.ignoreIfExists!==void 0)&&(u.options=a),o!==void 0&&(u.annotationId=o),u}e.create=n;function i(r){var t=r;return t&&t.kind==="rename"&&s.string(t.oldUri)&&s.string(t.newUri)&&(t.options===void 0||(t.options.overwrite===void 0||s.boolean(t.options.overwrite))&&(t.options.ignoreIfExists===void 0||s.boolean(t.options.ignoreIfExists)))&&(t.annotationId===void 0||m.is(t.annotationId))}e.is=i})(S||(S={}));var T;(function(e){function n(r,t,a){var o={kind:"delete",uri:r};return t!==void 0&&(t.recursive!==void 0||t.ignoreIfNotExists!==void 0)&&(o.options=t),a!==void 0&&(o.annotationId=a),o}e.create=n;function i(r){var t=r;return t&&t.kind==="delete"&&s.string(t.uri)&&(t.options===void 0||(t.options.recursive===void 0||s.boolean(t.options.recursive))&&(t.options.ignoreIfNotExists===void 0||s.boolean(t.options.ignoreIfNotExists)))&&(t.annotationId===void 0||m.is(t.annotationId))}e.is=i})(T||(T={}));var $;(function(e){function n(i){var r=i;return r&&(r.changes!==void 0||r.documentChanges!==void 0)&&(r.documentChanges===void 0||r.documentChanges.every(function(t){return s.string(t.kind)?M.is(t)||S.is(t)||T.is(t):U.is(t)}))}e.is=n})($||($={}));var N=function(){function e(n,i){this.edits=n,this.changeAnnotations=i}return e.prototype.insert=function(n,i,r){var t,a;if(r===void 0?t=x.insert(n,i):m.is(r)?(a=r,t=b.insert(n,i,r)):(this.assertChangeAnnotations(this.changeAnnotations),a=this.changeAnnotations.manage(r),t=b.insert(n,i,a)),this.edits.push(t),a!==void 0)return a},e.prototype.replace=function(n,i,r){var t,a;if(r===void 0?t=x.replace(n,i):m.is(r)?(a=r,t=b.replace(n,i,r)):(this.assertChangeAnnotations(this.changeAnnotations),a=this.changeAnnotations.manage(r),t=b.replace(n,i,a)),this.edits.push(t),a!==void 0)return a},e.prototype.delete=function(n,i){var r,t;if(i===void 0?r=x.del(n):m.is(i)?(t=i,r=b.del(n,i)):(this.assertChangeAnnotations(this.changeAnnotations),t=this.changeAnnotations.manage(i),r=b.del(n,t)),this.edits.push(r),t!==void 0)return t},e.prototype.add=function(n){this.edits.push(n)},e.prototype.all=function(){return this.edits},e.prototype.clear=function(){this.edits.splice(0,this.edits.length)},e.prototype.assertChangeAnnotations=function(n){if(n===void 0)throw new Error("Text edit change is not configured to manage change annotations.")},e}(),ne=function(){function e(n){this._annotations=n===void 0?Object.create(null):n,this._counter=0,this._size=0}return e.prototype.all=function(){return this._annotations},Object.defineProperty(e.prototype,"size",{get:function(){return this._size},enumerable:!1,configurable:!0}),e.prototype.manage=function(n,i){var r;if(m.is(n)?r=n:(r=this.nextId(),i=n),this._annotations[r]!==void 0)throw new Error("Id "+r+" is already in use.");if(i===void 0)throw new Error("No annotation provided for id "+r);return this._annotations[r]=i,this._size++,r},e.prototype.nextId=function(){return this._counter++,this._counter.toString()},e}();(function(){function e(n){var i=this;this._textEditChanges=Object.create(null),n!==void 0?(this._workspaceEdit=n,n.documentChanges?(this._changeAnnotations=new ne(n.changeAnnotations),n.changeAnnotations=this._changeAnnotations.all(),n.documentChanges.forEach(function(r){if(U.is(r)){var t=new N(r.edits,i._changeAnnotations);i._textEditChanges[r.textDocument.uri]=t}})):n.changes&&Object.keys(n.changes).forEach(function(r){var t=new N(n.changes[r]);i._textEditChanges[r]=t})):this._workspaceEdit={}}return Object.defineProperty(e.prototype,"edit",{get:function(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit},enumerable:!1,configurable:!0}),e.prototype.getTextEditChange=function(n){if(V.is(n)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var i={uri:n.uri,version:n.version},r=this._textEditChanges[i.uri];if(!r){var t=[],a={textDocument:i,edits:t};this._workspaceEdit.documentChanges.push(a),r=new N(t,this._changeAnnotations),this._textEditChanges[i.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.");var r=this._textEditChanges[n];if(!r){var t=[];this._workspaceEdit.changes[n]=t,r=new N(t),this._textEditChanges[n]=r}return r}},e.prototype.initDocumentChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new ne,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())},e.prototype.initChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))},e.prototype.createFile=function(n,i,r){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var t;I.is(i)||m.is(i)?t=i:r=i;var a,o;if(t===void 0?a=M.create(n,r):(o=m.is(t)?t:this._changeAnnotations.manage(t),a=M.create(n,r,o)),this._workspaceEdit.documentChanges.push(a),o!==void 0)return o},e.prototype.renameFile=function(n,i,r,t){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var a;I.is(r)||m.is(r)?a=r:t=r;var o,u;if(a===void 0?o=S.create(n,i,t):(u=m.is(a)?a:this._changeAnnotations.manage(a),o=S.create(n,i,t,u)),this._workspaceEdit.documentChanges.push(o),u!==void 0)return u},e.prototype.deleteFile=function(n,i,r){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var t;I.is(i)||m.is(i)?t=i:r=i;var a,o;if(t===void 0?a=T.create(n,r):(o=m.is(t)?t:this._changeAnnotations.manage(t),a=T.create(n,r,o)),this._workspaceEdit.documentChanges.push(a),o!==void 0)return o},e})();var ie;(function(e){function n(r){return{uri:r}}e.create=n;function i(r){var t=r;return s.defined(t)&&s.string(t.uri)}e.is=i})(ie||(ie={}));var ae;(function(e){function n(r,t){return{uri:r,version:t}}e.create=n;function i(r){var t=r;return s.defined(t)&&s.string(t.uri)&&s.integer(t.version)}e.is=i})(ae||(ae={}));var V;(function(e){function n(r,t){return{uri:r,version:t}}e.create=n;function i(r){var t=r;return s.defined(t)&&s.string(t.uri)&&(t.version===null||s.integer(t.version))}e.is=i})(V||(V={}));var oe;(function(e){function n(r,t,a,o){return{uri:r,languageId:t,version:a,text:o}}e.create=n;function i(r){var t=r;return s.defined(t)&&s.string(t.uri)&&s.string(t.languageId)&&s.integer(t.version)&&s.string(t.text)}e.is=i})(oe||(oe={}));var F;(function(e){e.PlainText="plaintext",e.Markdown="markdown"})(F||(F={}));(function(e){function n(i){var r=i;return r===e.PlainText||r===e.Markdown}e.is=n})(F||(F={}));var q;(function(e){function n(i){var r=i;return s.objectLiteral(i)&&F.is(r.kind)&&s.string(r.value)}e.is=n})(q||(q={}));var l;(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})(l||(l={}));var Q;(function(e){e.PlainText=1,e.Snippet=2})(Q||(Q={}));var se;(function(e){e.Deprecated=1})(se||(se={}));var ue;(function(e){function n(r,t,a){return{newText:r,insert:t,replace:a}}e.create=n;function i(r){var t=r;return t&&s.string(t.newText)&&p.is(t.insert)&&p.is(t.replace)}e.is=i})(ue||(ue={}));var ce;(function(e){e.asIs=1,e.adjustIndentation=2})(ce||(ce={}));var de;(function(e){function n(i){return{label:i}}e.create=n})(de||(de={}));var fe;(function(e){function n(i,r){return{items:i||[],isIncomplete:!!r}}e.create=n})(fe||(fe={}));var H;(function(e){function n(r){return r.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}e.fromPlainText=n;function i(r){var t=r;return s.string(t)||s.objectLiteral(t)&&s.string(t.language)&&s.string(t.value)}e.is=i})(H||(H={}));var ge;(function(e){function n(i){var r=i;return!!r&&s.objectLiteral(r)&&(q.is(r.contents)||H.is(r.contents)||s.typedArray(r.contents,H.is))&&(i.range===void 0||p.is(i.range))}e.is=n})(ge||(ge={}));var le;(function(e){function n(i,r){return r?{label:i,documentation:r}:{label:i}}e.create=n})(le||(le={}));var he;(function(e){function n(i,r){for(var t=[],a=2;a=0;v--){var w=g[v],E=a.offsetAt(w.range.start),f=a.offsetAt(w.range.end);if(f<=d)u=u.substring(0,E)+w.newText+u.substring(f,u.length);else throw new Error("Overlapping edit");d=E}return u}e.applyEdits=r;function t(a,o){if(a.length<=1)return a;var u=a.length/2|0,g=a.slice(0,u),d=a.slice(u);t(g,o),t(d,o);for(var v=0,w=0,E=0;v0&&n.push(i.length),this._lineOffsets=n}return this._lineOffsets},e.prototype.positionAt=function(n){n=Math.max(Math.min(n,this._content.length),0);var i=this.getLineOffsets(),r=0,t=i.length;if(t===0)return k.create(0,n);for(;rn?t=a:r=a+1}var o=r-1;return k.create(o,n-i[o])},e.prototype.offsetAt=function(n){var i=this.getLineOffsets();if(n.line>=i.length)return this._content.length;if(n.line<0)return 0;var r=i[n.line],t=n.line+1"u"}e.undefined=r;function t(f){return f===!0||f===!1}e.boolean=t;function a(f){return n.call(f)==="[object String]"}e.string=a;function o(f){return n.call(f)==="[object Number]"}e.number=o;function u(f,A,j){return n.call(f)==="[object Number]"&&A<=f&&f<=j}e.numberRange=u;function g(f){return n.call(f)==="[object Number]"&&-2147483648<=f&&f<=2147483647}e.integer=g;function d(f){return n.call(f)==="[object Number]"&&0<=f&&f<=2147483647}e.uinteger=d;function v(f){return n.call(f)==="[object Function]"}e.func=v;function w(f){return f!==null&&typeof f=="object"}e.objectLiteral=w;function E(f,A){return Array.isArray(f)&&f.every(A)}e.typedArray=E})(s||(s={}));var Be=class{constructor(e,n,i){this._languageId=e,this._worker=n,this._disposables=[],this._listener=Object.create(null);const r=a=>{let o=a.getLanguageId();if(o!==this._languageId)return;let u;this._listener[a.uri.toString()]=a.onDidChangeContent(()=>{window.clearTimeout(u),u=window.setTimeout(()=>this._doValidate(a.uri,o),500)}),this._doValidate(a.uri,o)},t=a=>{c.editor.setModelMarkers(a,this._languageId,[]);let o=a.uri.toString(),u=this._listener[o];u&&(u.dispose(),delete this._listener[o])};this._disposables.push(c.editor.onDidCreateModel(r)),this._disposables.push(c.editor.onWillDisposeModel(t)),this._disposables.push(c.editor.onDidChangeModelLanguage(a=>{t(a.model),r(a.model)})),this._disposables.push(i(a=>{c.editor.getModels().forEach(o=>{o.getLanguageId()===this._languageId&&(t(o),r(o))})})),this._disposables.push({dispose:()=>{c.editor.getModels().forEach(t);for(let a in this._listener)this._listener[a].dispose()}}),c.editor.getModels().forEach(r)}dispose(){this._disposables.forEach(e=>e&&e.dispose()),this._disposables.length=0}_doValidate(e,n){this._worker(e).then(i=>i.doValidation(e.toString())).then(i=>{const r=i.map(a=>qe(e,a));let t=c.editor.getModel(e);t&&t.getLanguageId()===n&&c.editor.setModelMarkers(t,n,r)}).then(void 0,i=>{console.error(i)})}};function $e(e){switch(e){case y.Error:return c.MarkerSeverity.Error;case y.Warning:return c.MarkerSeverity.Warning;case y.Information:return c.MarkerSeverity.Info;case y.Hint:return c.MarkerSeverity.Hint;default:return c.MarkerSeverity.Info}}function qe(e,n){let i=typeof n.code=="number"?String(n.code):n.code;return{severity:$e(n.severity),startLineNumber:n.range.start.line+1,startColumn:n.range.start.character+1,endLineNumber:n.range.end.line+1,endColumn:n.range.end.character+1,message:n.message,code:i,source:n.source}}var Qe=class{constructor(e,n){this._worker=e,this._triggerCharacters=n}get triggerCharacters(){return this._triggerCharacters}provideCompletionItems(e,n,i,r){const t=e.uri;return this._worker(t).then(a=>a.doComplete(t.toString(),C(n))).then(a=>{if(!a)return;const o=e.getWordUntilPosition(n),u=new c.Range(n.lineNumber,o.startColumn,n.lineNumber,o.endColumn),g=a.items.map(d=>{const v={label:d.label,insertText:d.insertText||d.label,sortText:d.sortText,filterText:d.filterText,documentation:d.documentation,detail:d.detail,command:Ye(d.command),range:u,kind:Je(d.kind)};return d.textEdit&&(Ge(d.textEdit)?v.range={insert:_(d.textEdit.insert),replace:_(d.textEdit.replace)}:v.range=_(d.textEdit.range),v.insertText=d.textEdit.newText),d.additionalTextEdits&&(v.additionalTextEdits=d.additionalTextEdits.map(L)),d.insertTextFormat===Q.Snippet&&(v.insertTextRules=c.languages.CompletionItemInsertTextRule.InsertAsSnippet),v});return{isIncomplete:a.isIncomplete,suggestions:g}})}};function C(e){if(e)return{character:e.column-1,line:e.lineNumber-1}}function Pe(e){if(e)return{start:{line:e.startLineNumber-1,character:e.startColumn-1},end:{line:e.endLineNumber-1,character:e.endColumn-1}}}function _(e){if(e)return new c.Range(e.start.line+1,e.start.character+1,e.end.line+1,e.end.character+1)}function Ge(e){return typeof e.insert<"u"&&typeof e.replace<"u"}function Je(e){const n=c.languages.CompletionItemKind;switch(e){case l.Text:return n.Text;case l.Method:return n.Method;case l.Function:return n.Function;case l.Constructor:return n.Constructor;case l.Field:return n.Field;case l.Variable:return n.Variable;case l.Class:return n.Class;case l.Interface:return n.Interface;case l.Module:return n.Module;case l.Property:return n.Property;case l.Unit:return n.Unit;case l.Value:return n.Value;case l.Enum:return n.Enum;case l.Keyword:return n.Keyword;case l.Snippet:return n.Snippet;case l.Color:return n.Color;case l.File:return n.File;case l.Reference:return n.Reference}return n.Property}function L(e){if(e)return{range:_(e.range),text:e.newText}}function Ye(e){return e&&e.command==="editor.action.triggerSuggest"?{id:e.command,title:e.title,arguments:e.arguments}:void 0}var Ze=class{constructor(e){this._worker=e}provideHover(e,n,i){let r=e.uri;return this._worker(r).then(t=>t.doHover(r.toString(),C(n))).then(t=>{if(t)return{range:_(t.range),contents:et(t.contents)}})}};function Ke(e){return e&&typeof e=="object"&&typeof e.kind=="string"}function Ie(e){return typeof e=="string"?{value:e}:Ke(e)?e.kind==="plaintext"?{value:e.value.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}:{value:e.value}:{value:"```"+e.language+` `+e.value+"\n```\n"}}function et(e){if(e)return Array.isArray(e)?e.map(Ie):[Ie(e)]}var tt=class{constructor(e){this._worker=e}provideDocumentHighlights(e,n,i){const r=e.uri;return this._worker(r).then(t=>t.findDocumentHighlights(r.toString(),C(n))).then(t=>{if(t)return t.map(a=>({range:_(a.range),kind:rt(a.kind)}))})}};function rt(e){switch(e){case P.Read:return c.languages.DocumentHighlightKind.Read;case P.Write:return c.languages.DocumentHighlightKind.Write;case P.Text:return c.languages.DocumentHighlightKind.Text}return c.languages.DocumentHighlightKind.Text}var nt=class{constructor(e){this._worker=e}provideDefinition(e,n,i){const r=e.uri;return this._worker(r).then(t=>t.findDefinition(r.toString(),C(n))).then(t=>{if(t)return[De(t)]})}};function De(e){return{uri:c.Uri.parse(e.uri),range:_(e.range)}}var it=class{constructor(e){this._worker=e}provideReferences(e,n,i,r){const t=e.uri;return this._worker(t).then(a=>a.findReferences(t.toString(),C(n))).then(a=>{if(a)return a.map(De)})}},at=class{constructor(e){this._worker=e}provideRenameEdits(e,n,i,r){const t=e.uri;return this._worker(t).then(a=>a.doRename(t.toString(),C(n),i)).then(a=>ot(a))}};function ot(e){if(!e||!e.changes)return;let n=[];for(let i in e.changes){const r=c.Uri.parse(i);for(let t of e.changes[i])n.push({resource:r,versionId:void 0,textEdit:{range:_(t.range),text:t.newText}})}return{edits:n}}var st=class{constructor(e){this._worker=e}provideDocumentSymbols(e,n){const i=e.uri;return this._worker(i).then(r=>r.findDocumentSymbols(i.toString())).then(r=>{if(r)return r.map(t=>ut(t)?Me(t):{name:t.name,detail:"",containerName:t.containerName,kind:Se(t.kind),range:_(t.location.range),selectionRange:_(t.location.range),tags:[]})})}};function ut(e){return"children"in e}function Me(e){return{name:e.name,detail:e.detail??"",kind:Se(e.kind),range:_(e.range),selectionRange:_(e.selectionRange),tags:e.tags??[],children:(e.children??[]).map(n=>Me(n))}}function Se(e){let n=c.languages.SymbolKind;switch(e){case h.File:return n.File;case h.Module:return n.Module;case h.Namespace:return n.Namespace;case h.Package:return n.Package;case h.Class:return n.Class;case h.Method:return n.Method;case h.Property:return n.Property;case h.Field:return n.Field;case h.Constructor:return n.Constructor;case h.Enum:return n.Enum;case h.Interface:return n.Interface;case h.Function:return n.Function;case h.Variable:return n.Variable;case h.Constant:return n.Constant;case h.String:return n.String;case h.Number:return n.Number;case h.Boolean:return n.Boolean;case h.Array:return n.Array}return n.Function}var _t=class{constructor(e){this._worker=e}provideLinks(e,n){const i=e.uri;return this._worker(i).then(r=>r.findDocumentLinks(i.toString())).then(r=>{if(r)return{links:r.map(t=>({range:_(t.range),url:t.target}))}})}},ct=class{constructor(e){this._worker=e}provideDocumentFormattingEdits(e,n,i){const r=e.uri;return this._worker(r).then(t=>t.format(r.toString(),null,Te(n)).then(a=>{if(!(!a||a.length===0))return a.map(L)}))}},dt=class{constructor(e){this._worker=e,this.canFormatMultipleRanges=!1}provideDocumentRangeFormattingEdits(e,n,i,r){const t=e.uri;return this._worker(t).then(a=>a.format(t.toString(),Pe(n),Te(i)).then(o=>{if(!(!o||o.length===0))return o.map(L)}))}};function Te(e){return{tabSize:e.tabSize,insertSpaces:e.insertSpaces}}var ft=class{constructor(e){this._worker=e}provideDocumentColors(e,n){const i=e.uri;return this._worker(i).then(r=>r.findDocumentColors(i.toString())).then(r=>{if(r)return r.map(t=>({color:t.color,range:_(t.range)}))})}provideColorPresentations(e,n,i){const r=e.uri;return this._worker(r).then(t=>t.getColorPresentations(r.toString(),n.color,Pe(n.range))).then(t=>{if(t)return t.map(a=>{let o={label:a.label};return a.textEdit&&(o.textEdit=L(a.textEdit)),a.additionalTextEdits&&(o.additionalTextEdits=a.additionalTextEdits.map(L)),o})})}},gt=class{constructor(e){this._worker=e}provideFoldingRanges(e,n,i){const r=e.uri;return this._worker(r).then(t=>t.getFoldingRanges(r.toString(),n)).then(t=>{if(t)return t.map(a=>{const o={start:a.startLine+1,end:a.endLine+1};return typeof a.kind<"u"&&(o.kind=lt(a.kind)),o})})}};function lt(e){switch(e){case R.Comment:return c.languages.FoldingRangeKind.Comment;case R.Imports:return c.languages.FoldingRangeKind.Imports;case R.Region:return c.languages.FoldingRangeKind.Region}}var ht=class{constructor(e){this._worker=e}provideSelectionRanges(e,n,i){const r=e.uri;return this._worker(r).then(t=>t.getSelectionRanges(r.toString(),n.map(C))).then(t=>{if(t)return t.map(a=>{const o=[];for(;a;)o.push({range:_(a.range)}),a=a.parent;return o})})}};function wt(e){const n=[],i=[],r=new ze(e);n.push(r);const t=(...o)=>r.getLanguageServiceWorker(...o);function a(){const{languageId:o,modeConfiguration:u}=e;Fe(i),u.completionItems&&i.push(c.languages.registerCompletionItemProvider(o,new Qe(t,["/","-",":"]))),u.hovers&&i.push(c.languages.registerHoverProvider(o,new Ze(t))),u.documentHighlights&&i.push(c.languages.registerDocumentHighlightProvider(o,new tt(t))),u.definitions&&i.push(c.languages.registerDefinitionProvider(o,new nt(t))),u.references&&i.push(c.languages.registerReferenceProvider(o,new it(t))),u.documentSymbols&&i.push(c.languages.registerDocumentSymbolProvider(o,new st(t))),u.rename&&i.push(c.languages.registerRenameProvider(o,new at(t))),u.colors&&i.push(c.languages.registerColorProvider(o,new ft(t))),u.foldingRanges&&i.push(c.languages.registerFoldingRangeProvider(o,new gt(t))),u.diagnostics&&i.push(new Be(o,t,e.onDidChange)),u.selectionRanges&&i.push(c.languages.registerSelectionRangeProvider(o,new ht(t))),u.documentFormattingEdits&&i.push(c.languages.registerDocumentFormattingEditProvider(o,new ct(t))),u.documentRangeFormattingEdits&&i.push(c.languages.registerDocumentRangeFormattingEditProvider(o,new dt(t)))}return a(),n.push(Re(i)),Re(n)}function Re(e){return{dispose:()=>Fe(e)}}function Fe(e){for(;e.length;)e.pop().dispose()}export{Qe as CompletionAdapter,nt as DefinitionAdapter,Be as DiagnosticsAdapter,ft as DocumentColorAdapter,ct as DocumentFormattingEditProvider,tt as DocumentHighlightAdapter,_t as DocumentLinkAdapter,dt as DocumentRangeFormattingEditProvider,st as DocumentSymbolAdapter,gt as FoldingRangeAdapter,Ze as HoverAdapter,it as ReferenceAdapter,at as RenameAdapter,ht as SelectionRangeAdapter,ze as WorkerManager,C as fromPosition,Pe as fromRange,wt as setupMode,_ as toRange,L as toTextEdit}; ================================================ FILE: backend/openui/dist/assets/html-B2LDEzWk.js ================================================ var on=Object.defineProperty;var ln=(e,t,r)=>t in e?on(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var We=(e,t,r)=>ln(e,typeof t!="symbol"?t+"":t,r);var ar=Object.defineProperty,sr=e=>{throw TypeError(e)},cn=(e,t,r)=>t in e?ar(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ir=(e,t)=>{for(var r in t)ar(e,r,{get:t[r],enumerable:!0})},Et=(e,t,r)=>cn(e,typeof t!="symbol"?t+"":t,r),ur=(e,t,r)=>t.has(e)||sr("Cannot "+r),F=(e,t,r)=>(ur(e,t,"read from private field"),r?r.call(e):t.get(e)),or=(e,t,r)=>t.has(e)?sr("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),pn=(e,t,r,n)=>(ur(e,t,"write to private field"),t.set(e,r),r),lr={};ir(lr,{languages:()=>Ks,options:()=>Ys,parsers:()=>Xr,printers:()=>nu});var hn=(e,t,r,n)=>{if(!(e&&t==null))return t.replaceAll?t.replaceAll(r,n):r.global?t.replace(r,n):t.split(r).join(n)},L=hn,cr="string",pr="array",hr="cursor",st="indent",it="align",dr="trim",ut="group",ot="fill",lt="if-break",ct="indent-if-break",mr="line-suffix",gr="line-suffix-boundary",Q="line",fr="label",pt="break-parent",vr=new Set([hr,st,it,dr,ut,ot,lt,ct,mr,gr,Q,fr,pt]),dn=(e,t,r)=>{if(!(e&&t==null))return Array.isArray(t)||typeof t=="string"?t[r<0?t.length+r:r]:t.at(r)},he=dn;function mn(e){if(typeof e=="string")return cr;if(Array.isArray(e))return pr;if(!e)return;let{type:t}=e;if(vr.has(t))return t}var Cr=mn,gn=e=>new Intl.ListFormat("en-US",{type:"disjunction"}).format(e);function fn(e){let t=e===null?"null":typeof e;if(t!=="string"&&t!=="object")return`Unexpected doc '${t}', Expected it to be 'string' or 'object'.`;if(Cr(e))throw new Error("doc is valid.");let r=Object.prototype.toString.call(e);if(r!=="[object Object]")return`Unexpected doc '${r}'.`;let n=gn([...vr].map(a=>`'${a}'`));return`Unexpected doc.type '${e.type}'. Expected it to be ${n}.`}var vn=class extends Error{constructor(t){super(fn(t));We(this,"name","InvalidDocError");this.doc=t}},Cn=vn;function Sr(e,t){if(typeof e=="string")return t(e);let r=new Map;return n(e);function n(s){if(r.has(s))return r.get(s);let i=a(s);return r.set(s,i),i}function a(s){switch(Cr(s)){case pr:return t(s.map(n));case ot:return t({...s,parts:s.parts.map(n)});case lt:return t({...s,breakContents:n(s.breakContents),flatContents:n(s.flatContents)});case ut:{let{expandedStates:i,contents:u}=s;return i?(i=i.map(n),u=i[0]):u=n(u),t({...s,contents:u,expandedStates:i})}case it:case st:case ct:case fr:case mr:return t({...s,contents:n(s.contents)});case cr:case hr:case dr:case gr:case Q:case pt:return t(s);default:throw new Cn(s)}}}function P(e,t=En){return Sr(e,r=>typeof r=="string"?Z(t,r.split(` `)):r)}var Sn=()=>{},yn=Sn;function M(e){return{type:st,contents:e}}function yr(e,t){return{type:it,contents:t,n:e}}function k(e,t={}){return yn(t.expandedStates),{type:ut,id:t.id,contents:e,break:!!t.shouldBreak,expandedStates:t.expandedStates}}function bn(e){return yr(Number.NEGATIVE_INFINITY,e)}function _n(e){return yr({type:"root"},e)}function br(e){return{type:ot,parts:e}}function xe(e,t="",r={}){return{type:lt,breakContents:e,flatContents:t,groupId:r.groupId}}function wn(e,t){return{type:ct,contents:e,groupId:t.groupId,negate:t.negate}}var de={type:pt},An={type:Q,hard:!0},kn={type:Q,hard:!0,literal:!0},_={type:Q},D={type:Q,soft:!0},S=[An,de],En=[kn,de];function Z(e,t){let r=[];for(let n=0;ns?n:r}var Dn=xn;function Tn(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}var N,Bn=class{constructor(e){or(this,N),pn(this,N,new Set(e))}getLeadingWhitespaceCount(e){let t=F(this,N),r=0;for(let n=0;n=0&&t.has(e.charAt(n));n--)r++;return r}getLeadingWhitespace(e){let t=this.getLeadingWhitespaceCount(e);return e.slice(0,t)}getTrailingWhitespace(e){let t=this.getTrailingWhitespaceCount(e);return e.slice(e.length-t)}hasLeadingWhitespace(e){return F(this,N).has(e.charAt(0))}hasTrailingWhitespace(e){return F(this,N).has(he(!1,e,-1))}trimStart(e){let t=this.getLeadingWhitespaceCount(e);return e.slice(t)}trimEnd(e){let t=this.getTrailingWhitespaceCount(e);return e.slice(0,e.length-t)}trim(e){return this.trimEnd(this.trimStart(e))}split(e,t=!1){let r=`[${Tn([...F(this,N)].join(""))}]+`,n=new RegExp(t?`(${r})`:r,"u");return e.split(n)}hasWhitespaceCharacter(e){let t=F(this,N);return Array.prototype.some.call(e,r=>t.has(r))}hasNonWhitespaceCharacter(e){let t=F(this,N);return Array.prototype.some.call(e,r=>!t.has(r))}isWhitespaceOnly(e){let t=F(this,N);return Array.prototype.every.call(e,r=>t.has(r))}};N=new WeakMap;var Ln=Bn,Fn=[" ",` `,"\f","\r"," "],qn=new Ln(Fn),R=qn,Nn=class extends Error{constructor(t,r,n="type"){super(`Unexpected ${r} node ${n}: ${JSON.stringify(t[n])}.`);We(this,"name","UnexpectedNodeError");this.node=t}},In=Nn;function Pn(e){return(e==null?void 0:e.type)==="front-matter"}var Ne=Pn,Hn=new Set(["sourceSpan","startSourceSpan","endSourceSpan","nameSpan","valueSpan","keySpan","tagDefinition","tokens","valueTokens","switchValueSourceSpan","expSourceSpan","valueSourceSpan"]),Mn=new Set(["if","else if","for","switch","case"]);function _r(e,t){var r;if(e.type==="text"||e.type==="comment"||Ne(e)||e.type==="yaml"||e.type==="toml")return null;if(e.type==="attribute"&&delete t.value,e.type==="docType"&&delete t.value,e.type==="angularControlFlowBlock"&&(r=e.parameters)!=null&&r.children)for(let n of t.parameters.children)Mn.has(e.name)?delete n.expression:n.expression=n.expression.trim();e.type==="angularIcuExpression"&&(t.switchValue=e.switchValue.trim()),e.type==="angularLetDeclarationInitializer"&&delete t.value}_r.ignoredProperties=Hn;var Rn=_r;async function Un(e,t){if(e.language==="yaml"){let r=e.value.trim(),n=r?await t(r,{parser:"yaml"}):"";return _n([e.startDelimiter,e.explicitLanguage,S,n,n?S:"",e.endDelimiter])}}var Vn=Un;function Ie(e,t=!0){return[M([D,e]),t?D:""]}function ee(e,t){let r=e.type==="NGRoot"?e.node.type==="NGMicrosyntax"&&e.node.body.length===1&&e.node.body[0].type==="NGMicrosyntaxExpression"?e.node.body[0].expression:e.node:e.type==="JsExpressionRoot"?e.node:e;return r&&(r.type==="ObjectExpression"||r.type==="ArrayExpression"||(t.parser==="__vue_expression"||t.parser==="__vue_ts_expression")&&(r.type==="TemplateLiteral"||r.type==="StringLiteral"))}async function H(e,t,r,n){r={__isInHtmlAttribute:!0,__embeddedInHtml:!0,...r};let a=!0;n&&(r.__onHtmlBindingRoot=(i,u)=>{a=n(i,u)});let s=await t(e,r,t);return a?k(s):Ie(s)}function On(e,t,r,n){let{node:a}=r,s=n.originalText.slice(a.sourceSpan.start.offset,a.sourceSpan.end.offset);return/^\s*$/u.test(s)?"":H(s,e,{parser:"__ng_directive",__isInHtmlAttribute:!1},ee)}var Wn=On,zn=e=>String(e).split(/[/\\]/u).pop();function Dt(e,t){if(!t)return;let r=zn(t).toLowerCase();return e.find(({filenames:n})=>n==null?void 0:n.some(a=>a.toLowerCase()===r))??e.find(({extensions:n})=>n==null?void 0:n.some(a=>r.endsWith(a)))}function $n(e,t){if(t)return e.find(({name:r})=>r.toLowerCase()===t)??e.find(({aliases:r})=>r==null?void 0:r.includes(t))??e.find(({extensions:r})=>r==null?void 0:r.includes(`.${t}`))}function jn(e,t){let r=e.plugins.flatMap(a=>a.languages??[]),n=$n(r,t.language)??Dt(r,t.physicalFile)??Dt(r,t.file)??(t.physicalFile,void 0);return n==null?void 0:n.parsers[0]}var Pe=jn,Gn="inline",Kn={area:"none",base:"none",basefont:"none",datalist:"none",head:"none",link:"none",meta:"none",noembed:"none",noframes:"none",param:"block",rp:"none",script:"block",style:"none",template:"inline",title:"none",html:"block",body:"block",address:"block",blockquote:"block",center:"block",dialog:"block",div:"block",figure:"block",figcaption:"block",footer:"block",form:"block",header:"block",hr:"block",legend:"block",listing:"block",main:"block",p:"block",plaintext:"block",pre:"block",search:"block",xmp:"block",slot:"contents",ruby:"ruby",rt:"ruby-text",article:"block",aside:"block",h1:"block",h2:"block",h3:"block",h4:"block",h5:"block",h6:"block",hgroup:"block",nav:"block",section:"block",dir:"block",dd:"block",dl:"block",dt:"block",menu:"block",ol:"block",ul:"block",li:"list-item",table:"table",caption:"table-caption",colgroup:"table-column-group",col:"table-column",thead:"table-header-group",tbody:"table-row-group",tfoot:"table-footer-group",tr:"table-row",td:"table-cell",th:"table-cell",input:"inline-block",button:"inline-block",fieldset:"block",details:"block",summary:"block",marquee:"inline-block",source:"block",track:"block",meter:"inline-block",progress:"inline-block",object:"inline-block",video:"inline-block",audio:"inline-block",select:"inline-block",option:"block",optgroup:"block"},Xn="normal",Yn={listing:"pre",plaintext:"pre",pre:"pre",xmp:"pre",nobr:"nowrap",table:"initial",textarea:"pre-wrap"};function Jn(e){return e.type==="element"&&!e.hasExplicitNamespace&&!["html","svg"].includes(e.namespace)}var ce=Jn,Qn=e=>L(!1,e,/^[\t\f\r ]*\n/gu,""),wr=e=>Qn(R.trimEnd(e)),Zn=e=>{let t=e,r=R.getLeadingWhitespace(t);r&&(t=t.slice(r.length));let n=R.getTrailingWhitespace(t);return n&&(t=t.slice(0,-n.length)),{leadingWhitespace:r,trailingWhitespace:n,text:t}};function Ar(e,t){return!!(e.type==="ieConditionalComment"&&e.lastChild&&!e.lastChild.isSelfClosing&&!e.lastChild.endSourceSpan||e.type==="ieConditionalComment"&&!e.complete||J(e)&&e.children.some(r=>r.type!=="text"&&r.type!=="interpolation")||dt(e,t)&&!U(e)&&e.type!=="interpolation")}function He(e){return e.type==="attribute"||!e.parent||!e.prev?!1:ea(e.prev)}function ea(e){return e.type==="comment"&&e.value.trim()==="prettier-ignore"}function q(e){return e.type==="text"||e.type==="comment"}function U(e){return e.type==="element"&&(e.fullName==="script"||e.fullName==="style"||e.fullName==="svg:style"||e.fullName==="svg:script"||ce(e)&&(e.name==="script"||e.name==="style"))}function ta(e){return e.children&&!U(e)}function ra(e){return U(e)||e.type==="interpolation"||kr(e)}function kr(e){return Fr(e).startsWith("pre")}function na(e,t){var r,n;let a=s();if(a&&!e.prev&&(n=(r=e.parent)==null?void 0:r.tagDefinition)!=null&&n.ignoreFirstLf)return e.type==="interpolation";return a;function s(){return Ne(e)||e.type==="angularControlFlowBlock"?!1:(e.type==="text"||e.type==="interpolation")&&e.prev&&(e.prev.type==="text"||e.prev.type==="interpolation")?!0:!e.parent||e.parent.cssDisplay==="none"?!1:J(e.parent)?!0:!(!e.prev&&(e.parent.type==="root"||J(e)&&e.parent||U(e.parent)||Me(e.parent,t)||!ha(e.parent.cssDisplay))||e.prev&&!ga(e.prev.cssDisplay))}}function aa(e,t){return Ne(e)||e.type==="angularControlFlowBlock"?!1:(e.type==="text"||e.type==="interpolation")&&e.next&&(e.next.type==="text"||e.next.type==="interpolation")?!0:!e.parent||e.parent.cssDisplay==="none"?!1:J(e.parent)?!0:!(!e.next&&(e.parent.type==="root"||J(e)&&e.parent||U(e.parent)||Me(e.parent,t)||!da(e.parent.cssDisplay))||e.next&&!ma(e.next.cssDisplay))}function sa(e){return fa(e.cssDisplay)&&!U(e)}function ye(e){return Ne(e)||e.next&&e.sourceSpan.end&&e.sourceSpan.end.line+10&&(["body","script","style"].includes(e.name)||e.children.some(t=>oa(t)))||e.firstChild&&e.firstChild===e.lastChild&&e.firstChild.type!=="text"&&Dr(e.firstChild)&&(!e.lastChild.isTrailingSpaceSensitive||Tr(e.lastChild))}function Er(e){return e.type==="element"&&e.children.length>0&&(["html","head","ul","ol","select"].includes(e.name)||e.cssDisplay.startsWith("table")&&e.cssDisplay!=="table-cell")}function ze(e){return Br(e)||e.prev&&ua(e.prev)||xr(e)}function ua(e){return Br(e)||e.type==="element"&&e.fullName==="br"||xr(e)}function xr(e){return Dr(e)&&Tr(e)}function Dr(e){return e.hasLeadingSpaces&&(e.prev?e.prev.sourceSpan.end.linee.sourceSpan.end.line:e.parent.type==="root"||e.parent.endSourceSpan&&e.parent.endSourceSpan.start.line>e.sourceSpan.end.line)}function Br(e){switch(e.type){case"ieConditionalComment":case"comment":case"directive":return!0;case"element":return["script","select"].includes(e.name)}return!1}function ht(e){return e.lastChild?ht(e.lastChild):e}function oa(e){var t;return(t=e.children)==null?void 0:t.some(r=>r.type!=="text")}function Lr(e){if(e)switch(e){case"module":case"text/javascript":case"text/babel":case"application/javascript":return"babel";case"application/x-typescript":return"typescript";case"text/markdown":return"markdown";case"text/html":return"html";case"text/x-handlebars-template":return"glimmer";default:if(e.endsWith("json")||e.endsWith("importmap")||e==="speculationrules")return"json"}}function la(e,t){let{name:r,attrMap:n}=e;if(r!=="script"||Object.prototype.hasOwnProperty.call(n,"src"))return;let{type:a,lang:s}=e.attrMap;return!s&&!a?"babel":Pe(t,{language:s})??Lr(a)}function ca(e,t){if(!dt(e,t))return;let{attrMap:r}=e;if(Object.prototype.hasOwnProperty.call(r,"src"))return;let{type:n,lang:a}=r;return Pe(t,{language:a})??Lr(n)}function pa(e,t){if(e.name!=="style")return;let{lang:r}=e.attrMap;return r?Pe(t,{language:r}):"css"}function Tt(e,t){return la(e,t)??pa(e,t)??ca(e,t)}function me(e){return e==="block"||e==="list-item"||e.startsWith("table")}function ha(e){return!me(e)&&e!=="inline-block"}function da(e){return!me(e)&&e!=="inline-block"}function ma(e){return!me(e)}function ga(e){return!me(e)}function fa(e){return!me(e)&&e!=="inline-block"}function J(e){return Fr(e).startsWith("pre")}function va(e,t){let r=e;for(;r;){if(t(r))return!0;r=r.parent}return!1}function Ca(e,t){var r;if(te(e,t))return"block";if(((r=e.prev)==null?void 0:r.type)==="comment"){let a=e.prev.value.match(/^\s*display:\s*([a-z]+)\s*$/u);if(a)return a[1]}let n=!1;if(e.type==="element"&&e.namespace==="svg")if(va(e,a=>a.fullName==="svg:foreignObject"))n=!0;else return e.name==="svg"?"inline-block":"block";switch(t.htmlWhitespaceSensitivity){case"strict":return"inline";case"ignore":return"block";default:return e.type==="element"&&(!e.namespace||n||ce(e))&&Kn[e.name]||Gn}}function Fr(e){return e.type==="element"&&(!e.namespace||ce(e))&&Yn[e.name]||Xn}function Sa(e){let t=Number.POSITIVE_INFINITY;for(let r of e.split(` `)){if(r.length===0)continue;let n=R.getLeadingWhitespaceCount(r);if(n===0)return 0;r.length!==n&&nr.slice(t)).join(` `)}function Nr(e){return L(!1,L(!1,e,"'","'"),""",'"')}function O(e){return Nr(e.value)}var ya=new Set(["template","style","script"]);function Me(e,t){return te(e,t)&&!ya.has(e.fullName)}function te(e,t){return t.parser==="vue"&&e.type==="element"&&e.parent.type==="root"&&e.fullName.toLowerCase()!=="html"}function dt(e,t){return te(e,t)&&(Me(e,t)||e.attrMap.lang&&e.attrMap.lang!=="html")}function ba(e){let t=e.fullName;return t.charAt(0)==="#"||t==="slot-scope"||t==="v-slot"||t.startsWith("v-slot:")}function _a(e,t){let r=e.parent;if(!te(r,t))return!1;let n=r.fullName,a=e.fullName;return n==="script"&&a==="setup"||n==="style"&&a==="vars"}function Ir(e,t=e.value){return e.parent.isWhitespaceSensitive?e.parent.isIndentationSensitive?P(t):P(qr(wr(t)),S):Z(_,R.split(t))}function Pr(e,t){return te(e,t)&&e.name==="script"}var Hr=/\{\{(.+?)\}\}/su;async function wa(e,t){let r=[];for(let[n,a]of e.split(Hr).entries())if(n%2===0)r.push(P(a));else try{r.push(k(["{{",M([_,await H(a,t,{parser:"__ng_interpolation",__isInHtmlInterpolation:!0})]),_,"}}"]))}catch{r.push("{{",P(a),"}}")}return r}function mt({parser:e}){return(t,r,n)=>H(O(n.node),t,{parser:e},ee)}var Aa=mt({parser:"__ng_action"}),ka=mt({parser:"__ng_binding"}),Ea=mt({parser:"__ng_directive"});function xa(e,t){if(t.parser!=="angular")return;let{node:r}=e,n=r.fullName;if(n.startsWith("(")&&n.endsWith(")")||n.startsWith("on-"))return Aa;if(n.startsWith("[")&&n.endsWith("]")||/^bind(?:on)?-/u.test(n)||/^ng-(?:if|show|hide|class|style)$/u.test(n))return ka;if(n.startsWith("*"))return Ea;let a=O(r);if(/^i18n(?:-.+)?$/u.test(n))return()=>Ie(br(Ir(r,a.trim())),!a.includes("@@"));if(Hr.test(a))return s=>wa(a,s)}var Da=xa;function Ta(e,t){let{node:r}=e,n=O(r);if(r.fullName==="class"&&!t.parentParser&&!n.includes("{{"))return()=>n.trim().split(/\s+/u).join(" ")}var Ba=Ta;function Bt(e){return e===" "||e===` `||e==="\f"||e==="\r"||e===" "}var La=/^[ \t\n\r\u000c]+/,Fa=/^[, \t\n\r\u000c]+/,qa=/^[^ \t\n\r\u000c]+/,Na=/[,]+$/,Lt=/^\d+$/,Ia=/^-?(?:[0-9]+|[0-9]*\.[0-9]+)(?:[eE][+-]?[0-9]+)?$/;function Pa(e){let t=e.length,r,n,a,s,i,u=0,o;function p(m){let C,w=m.exec(e.substring(u));if(w)return[C]=w,u+=C.length,C}let l=[];for(;;){if(p(Fa),u>=t){if(l.length===0)throw new Error("Must contain one or more image candidate strings.");return l}o=u,r=p(qa),n=[],r.slice(-1)===","?(r=r.replace(Na,""),v()):f()}function f(){for(p(La),a="",s="in descriptor";;){if(i=e.charAt(u),s==="in descriptor")if(Bt(i))a&&(n.push(a),a="",s="after descriptor");else if(i===","){u+=1,a&&n.push(a),v();return}else if(i==="(")a+=i,s="in parens";else if(i===""){a&&n.push(a),v();return}else a+=i;else if(s==="in parens")if(i===")")a+=i,s="in descriptor";else if(i===""){n.push(a),v();return}else a+=i;else if(s==="after descriptor"&&!Bt(i))if(i===""){v();return}else s="in descriptor",u-=1;u+=1}}function v(){let m=!1,C,w,E,x,c={},g,A,y,T,G;for(x=0;xUa(O(e.node))}var Mr={width:"w",height:"h",density:"x"},Ra=Object.keys(Mr);function Ua(e){let t=Ha(e),r=Ra.filter(l=>t.some(f=>Object.prototype.hasOwnProperty.call(f,l)));if(r.length>1)throw new Error("Mixed descriptor in srcset is not supported");let[n]=r,a=Mr[n],s=t.map(l=>l.source.value),i=Math.max(...s.map(l=>l.length)),u=t.map(l=>l[n]?String(l[n].value):""),o=u.map(l=>{let f=l.indexOf(".");return f===-1?l.length:f}),p=Math.max(...o);return Ie(Z([",",_],s.map((l,f)=>{let v=[l],m=u[f];if(m){let C=i-l.length+1,w=p-o[f],E=" ".repeat(C+w);v.push(xe(E," "),m+a)}return v})))}var Va=Ma;function Oa(e,t){let{node:r}=e,n=O(e.node).trim();if(r.fullName==="style"&&!t.parentParser&&!n.includes("{{"))return async a=>Ie(await a(n,{parser:"css",__isHTMLStyleAttribute:!0}))}var $e=new WeakMap;function Wa(e,t){let{root:r}=e;return $e.has(r)||$e.set(r,r.children.some(n=>Pr(n,t)&&["ts","typescript"].includes(n.attrMap.lang))),$e.get(r)}var gt=Wa;function za(e,t,r){let{node:n}=r,a=O(n);return H(`type T<${a}> = any`,e,{parser:"babel-ts",__isEmbeddedTypescriptGenericParameters:!0},ee)}function $a(e,t,{parseWithTs:r}){return H(`function _(${e}) {}`,t,{parser:r?"babel-ts":"babel",__isVueBindings:!0})}async function ja(e,t,r,n){let a=O(r.node),{left:s,operator:i,right:u}=Ga(a),o=gt(r,n);return[k(await H(`function _(${s}) {}`,e,{parser:o?"babel-ts":"babel",__isVueForBindingLeft:!0}))," ",i," ",await H(u,e,{parser:o?"__ts_expression":"__js_expression"})]}function Ga(e){let t=/(.*?)\s+(in|of)\s+(.*)/su,r=/,([^,\]}]*)(?:,([^,\]}]*))?$/u,n=/^\(|\)$/gu,a=e.match(t);if(!a)return;let s={};if(s.for=a[3].trim(),!s.for)return;let i=L(!1,a[1].trim(),n,""),u=i.match(r);u?(s.alias=i.replace(r,""),s.iterator1=u[1].trim(),u[2]&&(s.iterator2=u[2].trim())):s.alias=i;let o=[s.alias,s.iterator1,s.iterator2];if(!o.some((p,l)=>!p&&(l===0||o.slice(l+1).some(Boolean))))return{left:o.filter(Boolean).join(","),operator:a[2],right:s.for}}function Ka(e,t){if(t.parser!=="vue")return;let{node:r}=e,n=r.fullName;if(n==="v-for")return ja;if(n==="generic"&&Pr(r.parent,t))return za;let a=O(r),s=gt(e,t);if(ba(r)||_a(r,t))return i=>$a(a,i,{parseWithTs:s});if(n.startsWith("@")||n.startsWith("v-on:"))return i=>Xa(a,i,{parseWithTs:s});if(n.startsWith(":")||n.startsWith(".")||n.startsWith("v-bind:"))return i=>Ya(a,i,{parseWithTs:s});if(n.startsWith("v-"))return i=>Rr(a,i,{parseWithTs:s})}async function Xa(e,t,{parseWithTs:r}){var n;try{return await Rr(e,t,{parseWithTs:r})}catch(a){if(((n=a.cause)==null?void 0:n.code)!=="BABEL_PARSER_SYNTAX_ERROR")throw a}return H(e,t,{parser:r?"__vue_ts_event_binding":"__vue_event_binding"},ee)}function Ya(e,t,{parseWithTs:r}){return H(e,t,{parser:r?"__vue_ts_expression":"__vue_expression"},ee)}function Rr(e,t,{parseWithTs:r}){return H(e,t,{parser:r?"__ts_expression":"__js_expression"},ee)}var Ja=Ka;function Qa(e,t){let{node:r}=e;if(r.value){if(/^PRETTIER_HTML_PLACEHOLDER_\d+_\d+_IN_JS$/u.test(t.originalText.slice(r.valueSpan.start.offset,r.valueSpan.end.offset))||t.parser==="lwc"&&r.value.startsWith("{")&&r.value.endsWith("}"))return[r.rawName,"=",r.value];for(let n of[Va,Oa,Ba,Ja,Da]){let a=n(e,t);if(a)return Za(a)}}}function Za(e){return async(t,r,n,a)=>{let s=await e(t,r,n,a);if(s)return s=Sr(s,i=>typeof i=="string"?L(!1,i,'"',"""):i),[n.node.rawName,'="',k(s),'"']}}var es=Qa,Ur=new Proxy(()=>{},{get:()=>Ur}),Vr=Ur;function ts(e){return Array.isArray(e)&&e.length>0}var ft=ts;function ge(e){return e.sourceSpan.start.offset}function fe(e){return e.sourceSpan.end.offset}function Je(e,t){return[e.isSelfClosing?"":rs(e,t),ue(e,t)]}function rs(e,t){return e.lastChild&&pe(e.lastChild)?"":[ns(e,t),vt(e,t)]}function ue(e,t){return(e.next?$(e.next):Ce(e.parent))?"":[ve(e,t),z(e,t)]}function ns(e,t){return Ce(e)?ve(e.lastChild,t):""}function z(e,t){return pe(e)?vt(e.parent,t):Re(e)?Ct(e.next,t):""}function vt(e,t){if(Vr.ok(!e.isSelfClosing),Or(e,t))return"";switch(e.type){case"ieConditionalComment":return"";case"ieConditionalStartComment":return"]>";case"interpolation":return"}}";case"angularIcuExpression":return"}";case"element":if(e.isSelfClosing)return"/>";default:return">"}}function Or(e,t){return!e.isSelfClosing&&!e.endSourceSpan&&(He(e)||Ar(e.parent,t))}function $(e){return e.prev&&e.prev.type!=="docType"&&e.type!=="angularControlFlowBlock"&&!q(e.prev)&&e.isLeadingSpaceSensitive&&!e.hasLeadingSpaces}function Ce(e){var t;return((t=e.lastChild)==null?void 0:t.isTrailingSpaceSensitive)&&!e.lastChild.hasTrailingSpaces&&!q(ht(e.lastChild))&&!J(e)}function pe(e){return!e.next&&!e.hasTrailingSpaces&&e.isTrailingSpaceSensitive&&q(ht(e))}function Re(e){return e.next&&!q(e.next)&&q(e)&&e.isTrailingSpaceSensitive&&!e.hasTrailingSpaces}function as(e){let t=e.trim().match(/^prettier-ignore-attribute(?:\s+(.+))?$/su);return t?t[1]?t[1].split(/\s+/u):!0:!1}function Ue(e){return!e.prev&&e.isLeadingSpaceSensitive&&!e.hasLeadingSpaces}function ss(e,t,r){var n;let{node:a}=e;if(!ft(a.attrs))return a.isSelfClosing?" ":"";let s=((n=a.prev)==null?void 0:n.type)==="comment"&&as(a.prev.value),i=typeof s=="boolean"?()=>s:Array.isArray(s)?f=>s.includes(f.rawName):()=>!1,u=e.map(({node:f})=>i(f)?P(t.originalText.slice(ge(f),fe(f))):r(),"attrs"),o=a.type==="element"&&a.fullName==="script"&&a.attrs.length===1&&a.attrs[0].fullName==="src"&&a.children.length===0,p=t.singleAttributePerLine&&a.attrs.length>1&&!te(a,t)?S:_,l=[M([o?" ":_,Z(p,u)])];return a.firstChild&&Ue(a.firstChild)||a.isSelfClosing&&Ce(a.parent)||o?l.push(a.isSelfClosing?" ":""):l.push(t.bracketSameLine?a.isSelfClosing?" ":"":a.isSelfClosing?_:D),l}function is(e){return e.firstChild&&Ue(e.firstChild)?"":St(e)}function Qe(e,t,r){let{node:n}=e;return[oe(n,t),ss(e,t,r),n.isSelfClosing?"":is(n)]}function oe(e,t){return e.prev&&Re(e.prev)?"":[j(e,t),Ct(e,t)]}function j(e,t){return Ue(e)?St(e.parent):$(e)?ve(e.prev,t):""}var Ft="<${e.rawName}`;default:return`<${e.rawName}`}}function St(e){switch(Vr.ok(!e.isSelfClosing),e.type){case"ieConditionalComment":return"]>";case"element":if(e.condition)return">";default:return">"}}function us(e,t){if(!e.endSourceSpan)return"";let r=e.startSourceSpan.end.offset;e.firstChild&&Ue(e.firstChild)&&(r-=St(e).length);let n=e.endSourceSpan.start.offset;return e.lastChild&&pe(e.lastChild)?n+=vt(e,t).length:Ce(e)&&(n-=ve(e.lastChild,t).length),t.originalText.slice(r,n)}var Wr=us,os=new Set(["if","else if","for","switch","case"]);function ls(e,t){let{node:r}=e;switch(r.type){case"element":if(U(r)||r.type==="interpolation")return;if(!r.isSelfClosing&&dt(r,t)){let n=Tt(r,t);return n?async(a,s)=>{let i=Wr(r,t),u=/^\s*$/u.test(i),o="";return u||(o=await a(wr(i),{parser:n,__embeddedInHtml:!0}),u=o===""),[j(r,t),k(Qe(e,t,s)),u?"":S,o,u?"":S,Je(r,t),z(r,t)]}:void 0}break;case"text":if(U(r.parent)){let n=Tt(r.parent,t);if(n)return async a=>{let s=n==="markdown"?qr(r.value.replace(/^[^\S\n]*\n/u,"")):r.value,i={parser:n,__embeddedInHtml:!0};if(t.parser==="html"&&n==="babel"){let u="script",{attrMap:o}=r.parent;o&&(o.type==="module"||o.type==="text/babel"&&o["data-type"]==="module")&&(u="module"),i.__babelSourceType=u}return[de,j(r,t),await a(s,i),z(r,t)]}}else if(r.parent.type==="interpolation")return async n=>{let a={__isInHtmlInterpolation:!0,__embeddedInHtml:!0};return t.parser==="angular"?a.parser="__ng_interpolation":t.parser==="vue"?a.parser=gt(e,t)?"__vue_ts_expression":"__vue_expression":a.parser="__js_expression",[M([_,await n(r.value,a)]),r.parent.next&&$(r.parent.next)?" ":_]};break;case"attribute":return es(e,t);case"front-matter":return n=>Vn(r,n);case"angularControlFlowBlockParameters":return os.has(e.parent.name)?Wn:void 0;case"angularLetDeclarationInitializer":return n=>H(r.value,n,{parser:"__ng_binding",__isInHtmlAttribute:!1})}}var cs=ls,ne=null;function le(e){if(ne!==null&&typeof ne.property){let t=ne;return ne=le.prototype=null,t}return ne=le.prototype=e??Object.create(null),new le}var ps=10;for(let e=0;e<=ps;e++)le();function hs(e){return le(e)}function ds(e,t="type"){hs(e);function r(n){let a=n[t],s=e[a];if(!Array.isArray(s))throw Object.assign(new Error(`Missing visitor keys for '${a}'.`),{node:n});return s}return r}var ms=ds,gs={"front-matter":[],root:["children"],element:["attrs","children"],ieConditionalComment:["children"],ieConditionalStartComment:[],ieConditionalEndComment:[],interpolation:["children"],text:["children"],docType:[],comment:[],attribute:[],cdata:[],angularControlFlowBlock:["children","parameters"],angularControlFlowBlockParameters:["children"],angularControlFlowBlockParameter:[],angularLetDeclaration:["init"],angularLetDeclarationInitializer:[],angularIcuExpression:["cases"],angularIcuCase:["expression"]},fs=gs,vs=ms(fs),Cs=vs;function Ss(e){return/^\s*/u.test(e)}function ys(e){return` `+e}var bs=new Map([["if",new Set(["else if","else"])],["else if",new Set(["else if","else"])],["for",new Set(["empty"])],["defer",new Set(["placeholder","error","loading"])],["placeholder",new Set(["placeholder","error","loading"])],["error",new Set(["placeholder","error","loading"])],["loading",new Set(["placeholder","error","loading"])]]);function zr(e){let t=fe(e);return e.type==="element"&&!e.endSourceSpan&&ft(e.children)?Math.max(t,zr(he(!1,e.children,-1))):t}function ae(e,t,r){let n=e.node;if(He(n)){let a=zr(n);return[j(n,t),P(R.trimEnd(t.originalText.slice(ge(n)+(n.prev&&Re(n.prev)?Ct(n).length:0),a-(n.next&&$(n.next)?ve(n,t).length:0)))),z(n,t)]}return r()}function be(e,t){return q(e)&&q(t)?e.isTrailingSpaceSensitive?e.hasTrailingSpaces?ze(t)?S:_:"":ze(t)?S:D:Re(e)&&(He(t)||t.firstChild||t.isSelfClosing||t.type==="element"&&t.attrs.length>0)||e.type==="element"&&e.isSelfClosing&&$(t)?"":!t.isLeadingSpaceSensitive||ze(t)||$(t)&&e.lastChild&&pe(e.lastChild)&&e.lastChild.lastChild&&pe(e.lastChild.lastChild)?S:t.hasLeadingSpaces?_:D}function yt(e,t,r){let{node:n}=e;if(Er(n))return[de,...e.map(s=>{let i=s.node,u=i.prev?be(i.prev,i):"";return[u?[u,ye(i.prev)?S:""]:"",ae(s,t,r)]},"children")];let a=n.children.map(()=>Symbol(""));return e.map((s,i)=>{let u=s.node;if(q(u)){if(u.prev&&q(u.prev)){let C=be(u.prev,u);if(C)return ye(u.prev)?[S,S,ae(s,t,r)]:[C,ae(s,t,r)]}return ae(s,t,r)}let o=[],p=[],l=[],f=[],v=u.prev?be(u.prev,u):"",m=u.next?be(u,u.next):"";return v&&(ye(u.prev)?o.push(S,S):v===S?o.push(S):q(u.prev)?p.push(v):p.push(xe("",D,{groupId:a[i-1]}))),m&&(ye(u)?q(u.next)&&f.push(S,S):m===S?q(u.next)&&f.push(S):l.push(m)),[...o,k([...p,k([ae(s,t,r),...l],{id:a[i]})]),...f]},"children")}function _s(e,t,r){let{node:n}=e,a=[];ws(e)&&a.push("} "),a.push("@",n.name),n.parameters&&a.push(" (",k(r("parameters")),")"),a.push(" {");let s=$r(n);return n.children.length>0?(n.firstChild.hasLeadingSpaces=!0,n.lastChild.hasTrailingSpaces=!0,a.push(M([S,yt(e,t,r)])),s&&a.push(S,"}")):s&&a.push("}"),k(a,{shouldBreak:!0})}function $r(e){var t,r;return!(((t=e.next)==null?void 0:t.type)==="angularControlFlowBlock"&&(r=bs.get(e.name))!=null&&r.has(e.next.name))}function ws(e){let{previous:t}=e;return(t==null?void 0:t.type)==="angularControlFlowBlock"&&!He(t)&&!$r(t)}function As(e,t,r){return[M([D,Z([";",_],e.map(r,"children"))]),D]}function ks(e,t,r){let{node:n}=e;return[oe(n,t),k([n.switchValue.trim(),", ",n.clause,n.cases.length>0?[",",M([_,Z(_,e.map(r,"cases"))])]:"",D]),ue(n,t)]}function Es(e,t,r){let{node:n}=e;return[n.value," {",k([M([D,e.map(({node:a,isLast:s})=>{let i=[r()];return a.type==="text"&&(a.hasLeadingSpaces&&i.unshift(_),a.hasTrailingSpaces&&!s&&i.push(_)),i},"expression")]),D]),"}"]}function xs(e,t,r){let{node:n}=e;if(Ar(n,t))return[j(n,t),k(Qe(e,t,r)),P(Wr(n,t)),...Je(n,t),z(n,t)];let a=n.children.length===1&&(n.firstChild.type==="interpolation"||n.firstChild.type==="angularIcuExpression")&&n.firstChild.isLeadingSpaceSensitive&&!n.firstChild.hasLeadingSpaces&&n.lastChild.isTrailingSpaceSensitive&&!n.lastChild.hasTrailingSpaces,s=Symbol("element-attr-group-id"),i=l=>k([k(Qe(e,t,r),{id:s}),l,Je(n,t)]),u=l=>a?wn(l,{groupId:s}):(U(n)||Me(n,t))&&n.parent.type==="root"&&t.parser==="vue"&&!t.vueIndentScriptAndStyle?l:M(l),o=()=>a?xe(D,"",{groupId:s}):n.firstChild.hasLeadingSpaces&&n.firstChild.isLeadingSpaceSensitive?_:n.firstChild.type==="text"&&n.isWhitespaceSensitive&&n.isIndentationSensitive?bn(D):D,p=()=>(n.next?$(n.next):Ce(n.parent))?n.lastChild.hasTrailingSpaces&&n.lastChild.isTrailingSpaceSensitive?" ":"":a?xe(D,"",{groupId:s}):n.lastChild.hasTrailingSpaces&&n.lastChild.isTrailingSpaceSensitive?_:(n.lastChild.type==="comment"||n.lastChild.type==="text"&&n.isWhitespaceSensitive&&n.isIndentationSensitive)&&new RegExp(`\\n[\\t ]{${t.tabWidth*(e.ancestors.length-1)}}$`,"u").test(n.lastChild.value)?"":D;return n.children.length===0?i(n.hasDanglingSpaces&&n.isDanglingSpaceSensitive?_:""):i([ia(n)?de:"",u([o(),yt(e,t,r)]),p()])}function De(e){return e>=9&&e<=32||e==160}function bt(e){return 48<=e&&e<=57}function Te(e){return e>=97&&e<=122||e>=65&&e<=90}function Ds(e){return e>=97&&e<=102||e>=65&&e<=70||bt(e)}function _t(e){return e===10||e===13}function qt(e){return 48<=e&&e<=55}function je(e){return e===39||e===34||e===96}var Ts=/-+([a-z0-9])/g;function Bs(e){return e.replace(Ts,(...t)=>t[1].toUpperCase())}var Ze=class jr{constructor(t,r,n,a){this.file=t,this.offset=r,this.line=n,this.col=a}toString(){return this.offset!=null?`${this.file.url}@${this.line}:${this.col}`:this.file.url}moveBy(t){let r=this.file.content,n=r.length,a=this.offset,s=this.line,i=this.col;for(;a>0&&t<0;)if(a--,t++,r.charCodeAt(a)==10){s--;let u=r.substring(0,a-1).lastIndexOf(` `);i=u>0?a-u:a}else i--;for(;a0;){let u=r.charCodeAt(a);a++,t--,u==10?(s++,i=0):i++}return new jr(this.file,a,s,i)}getContext(t,r){let n=this.file.content,a=this.offset;if(a!=null){a>n.length-1&&(a=n.length-1);let s=a,i=0,u=0;for(;i0&&(a--,i++,!(n[a]==` `&&++u==r)););for(i=0,u=0;i]${e.after}")`:this.msg}toString(){let e=this.span.details?`, ${this.span.details}`:"";return`${this.contextualMessage()}: ${this.span.start}${e}`}},Ls=[qs,Ns,Ps,Ms,Rs,Os,Us,Vs,Ws,Hs];function Fs(e,t){for(let r of Ls)r(e,t);return e}function qs(e){e.walk(t=>{if(t.type==="element"&&t.tagDefinition.ignoreFirstLf&&t.children.length>0&&t.children[0].type==="text"&&t.children[0].value[0]===` `){let r=t.children[0];r.value.length===1?t.removeChild(r):r.value=r.value.slice(1)}})}function Ns(e){let t=r=>{var n,a;return r.type==="element"&&((n=r.prev)==null?void 0:n.type)==="ieConditionalStartComment"&&r.prev.sourceSpan.end.offset===r.startSourceSpan.start.offset&&((a=r.firstChild)==null?void 0:a.type)==="ieConditionalEndComment"&&r.firstChild.sourceSpan.start.offset===r.startSourceSpan.end.offset};e.walk(r=>{if(r.children)for(let n=0;n{if(n.children)for(let a=0;at.type==="cdata",t=>``)}function Hs(e){let t=r=>{var n,a;return r.type==="element"&&r.attrs.length===0&&r.children.length===1&&r.firstChild.type==="text"&&!R.hasWhitespaceCharacter(r.children[0].value)&&!r.firstChild.hasLeadingSpaces&&!r.firstChild.hasTrailingSpaces&&r.isLeadingSpaceSensitive&&!r.hasLeadingSpaces&&r.isTrailingSpaceSensitive&&!r.hasTrailingSpaces&&((n=r.prev)==null?void 0:n.type)==="text"&&((a=r.next)==null?void 0:a.type)==="text"};e.walk(r=>{if(r.children)for(let n=0;n`+a.firstChild.value+``+i.value,s.sourceSpan=new d(s.sourceSpan.start,i.sourceSpan.end),s.isTrailingSpaceSensitive=i.isTrailingSpaceSensitive,s.hasTrailingSpaces=i.hasTrailingSpaces,r.removeChild(a),n--,r.removeChild(i)}})}function Ms(e,t){if(t.parser==="html")return;let r=/\{\{(.+?)\}\}/su;e.walk(n=>{if(ta(n))for(let a of n.children){if(a.type!=="text")continue;let s=a.sourceSpan.start,i=null,u=a.value.split(r);for(let o=0;o0&&n.insertChildBefore(a,{type:"text",value:p,sourceSpan:new d(s,i)});continue}i=s.moveBy(p.length+4),n.insertChildBefore(a,{type:"interpolation",sourceSpan:new d(s,i),children:p.length===0?[]:[{type:"text",value:p,sourceSpan:new d(s.moveBy(2),i.moveBy(-2))}]})}n.removeChild(a)}})}function Rs(e){e.walk(t=>{let r=t.$children;if(!r)return;if(r.length===0||r.length===1&&r[0].type==="text"&&R.trim(r[0].value).length===0){t.hasDanglingSpaces=r.length>0,t.$children=[];return}let n=ra(t),a=kr(t);if(!n)for(let s=0;s{t.isSelfClosing=!t.children||t.type==="element"&&(t.tagDefinition.isVoid||t.endSourceSpan&&t.startSourceSpan.start===t.endSourceSpan.start&&t.startSourceSpan.end===t.endSourceSpan.end)})}function Vs(e,t){e.walk(r=>{r.type==="element"&&(r.hasHtmComponentClosingTag=r.endSourceSpan&&/^<\s*\/\s*\/\s*>$/u.test(t.originalText.slice(r.endSourceSpan.start.offset,r.endSourceSpan.end.offset)))})}function Os(e,t){e.walk(r=>{r.cssDisplay=Ca(r,t)})}function Ws(e,t){e.walk(r=>{let{children:n}=r;if(n){if(n.length===0){r.isDanglingSpaceSensitive=sa(r);return}for(let a of n)a.isLeadingSpaceSensitive=na(a,t),a.isTrailingSpaceSensitive=aa(a,t);for(let a=0;a of opening tags on the last line instead of on a new line."},singleAttributePerLine:{category:"Common",type:"boolean",default:!1,description:"Enforce single attribute per line in HTML, Vue and JSX."}},It="HTML",Xs={bracketSameLine:Nt.bracketSameLine,htmlWhitespaceSensitivity:{category:It,type:"choice",default:"css",description:"How to handle whitespaces in HTML.",choices:[{value:"css",description:"Respect the default value of CSS display property."},{value:"strict",description:"Whitespaces are considered sensitive."},{value:"ignore",description:"Whitespaces are considered insensitive."}]},singleAttributePerLine:Nt.singleAttributePerLine,vueIndentScriptAndStyle:{category:It,type:"boolean",default:!1,description:"Indent script and style tags in Vue files."}},Ys=Xs,Xr={};ir(Xr,{angular:()=>eu,html:()=>Zi,lwc:()=>ru,vue:()=>tu});var Pt;(function(e){e[e.Emulated=0]="Emulated",e[e.None=2]="None",e[e.ShadowDom=3]="ShadowDom"})(Pt||(Pt={}));var Ht;(function(e){e[e.OnPush=0]="OnPush",e[e.Default=1]="Default"})(Ht||(Ht={}));var Mt;(function(e){e[e.None=0]="None",e[e.SignalBased=1]="SignalBased",e[e.HasDecoratorInputTransform=2]="HasDecoratorInputTransform"})(Mt||(Mt={}));var Rt={name:"custom-elements"},Ut={name:"no-errors-schema"},W;(function(e){e[e.NONE=0]="NONE",e[e.HTML=1]="HTML",e[e.STYLE=2]="STYLE",e[e.SCRIPT=3]="SCRIPT",e[e.URL=4]="URL",e[e.RESOURCE_URL=5]="RESOURCE_URL"})(W||(W={}));var Vt;(function(e){e[e.Error=0]="Error",e[e.Warning=1]="Warning",e[e.Ignore=2]="Ignore"})(Vt||(Vt={}));var I;(function(e){e[e.RAW_TEXT=0]="RAW_TEXT",e[e.ESCAPABLE_RAW_TEXT=1]="ESCAPABLE_RAW_TEXT",e[e.PARSABLE_DATA=2]="PARSABLE_DATA"})(I||(I={}));function Ve(e,t=!0){if(e[0]!=":")return[null,e];let r=e.indexOf(":",1);if(r===-1){if(t)throw new Error(`Unsupported format "${e}" expecting ":namespace:name"`);return[null,e]}return[e.slice(1,r),e.slice(r+1)]}function Ot(e){return Ve(e)[1]==="ng-container"}function Wt(e){return Ve(e)[1]==="ng-content"}function ke(e){return e===null?null:Ve(e)[0]}function Le(e,t){return e?`:${e}:${t}`:t}var Ee;function zt(){return Ee||(Ee={},_e(W.HTML,["iframe|srcdoc","*|innerHTML","*|outerHTML"]),_e(W.STYLE,["*|style"]),_e(W.URL,["*|formAction","area|href","area|ping","audio|src","a|href","a|ping","blockquote|cite","body|background","del|cite","form|action","img|src","input|src","ins|cite","q|cite","source|src","track|src","video|poster","video|src"]),_e(W.RESOURCE_URL,["applet|code","applet|codebase","base|href","embed|src","frame|src","head|profile","html|manifest","iframe|src","link|href","media|src","object|codebase","object|data","script|src"])),Ee}function _e(e,t){for(let r of t)Ee[r.toLowerCase()]=e}var Js=class{},Qs="boolean",Zs="number",ei="string",ti="object",ri=["[Element]|textContent,%ariaAtomic,%ariaAutoComplete,%ariaBusy,%ariaChecked,%ariaColCount,%ariaColIndex,%ariaColSpan,%ariaCurrent,%ariaDescription,%ariaDisabled,%ariaExpanded,%ariaHasPopup,%ariaHidden,%ariaKeyShortcuts,%ariaLabel,%ariaLevel,%ariaLive,%ariaModal,%ariaMultiLine,%ariaMultiSelectable,%ariaOrientation,%ariaPlaceholder,%ariaPosInSet,%ariaPressed,%ariaReadOnly,%ariaRelevant,%ariaRequired,%ariaRoleDescription,%ariaRowCount,%ariaRowIndex,%ariaRowSpan,%ariaSelected,%ariaSetSize,%ariaSort,%ariaValueMax,%ariaValueMin,%ariaValueNow,%ariaValueText,%classList,className,elementTiming,id,innerHTML,*beforecopy,*beforecut,*beforepaste,*fullscreenchange,*fullscreenerror,*search,*webkitfullscreenchange,*webkitfullscreenerror,outerHTML,%part,#scrollLeft,#scrollTop,slot,*message,*mozfullscreenchange,*mozfullscreenerror,*mozpointerlockchange,*mozpointerlockerror,*webglcontextcreationerror,*webglcontextlost,*webglcontextrestored","[HTMLElement]^[Element]|accessKey,autocapitalize,!autofocus,contentEditable,dir,!draggable,enterKeyHint,!hidden,!inert,innerText,inputMode,lang,nonce,*abort,*animationend,*animationiteration,*animationstart,*auxclick,*beforexrselect,*blur,*cancel,*canplay,*canplaythrough,*change,*click,*close,*contextmenu,*copy,*cuechange,*cut,*dblclick,*drag,*dragend,*dragenter,*dragleave,*dragover,*dragstart,*drop,*durationchange,*emptied,*ended,*error,*focus,*formdata,*gotpointercapture,*input,*invalid,*keydown,*keypress,*keyup,*load,*loadeddata,*loadedmetadata,*loadstart,*lostpointercapture,*mousedown,*mouseenter,*mouseleave,*mousemove,*mouseout,*mouseover,*mouseup,*mousewheel,*paste,*pause,*play,*playing,*pointercancel,*pointerdown,*pointerenter,*pointerleave,*pointermove,*pointerout,*pointerover,*pointerrawupdate,*pointerup,*progress,*ratechange,*reset,*resize,*scroll,*securitypolicyviolation,*seeked,*seeking,*select,*selectionchange,*selectstart,*slotchange,*stalled,*submit,*suspend,*timeupdate,*toggle,*transitioncancel,*transitionend,*transitionrun,*transitionstart,*volumechange,*waiting,*webkitanimationend,*webkitanimationiteration,*webkitanimationstart,*webkittransitionend,*wheel,outerText,!spellcheck,%style,#tabIndex,title,!translate,virtualKeyboardPolicy","abbr,address,article,aside,b,bdi,bdo,cite,content,code,dd,dfn,dt,em,figcaption,figure,footer,header,hgroup,i,kbd,main,mark,nav,noscript,rb,rp,rt,rtc,ruby,s,samp,section,small,strong,sub,sup,u,var,wbr^[HTMLElement]|accessKey,autocapitalize,!autofocus,contentEditable,dir,!draggable,enterKeyHint,!hidden,innerText,inputMode,lang,nonce,*abort,*animationend,*animationiteration,*animationstart,*auxclick,*beforexrselect,*blur,*cancel,*canplay,*canplaythrough,*change,*click,*close,*contextmenu,*copy,*cuechange,*cut,*dblclick,*drag,*dragend,*dragenter,*dragleave,*dragover,*dragstart,*drop,*durationchange,*emptied,*ended,*error,*focus,*formdata,*gotpointercapture,*input,*invalid,*keydown,*keypress,*keyup,*load,*loadeddata,*loadedmetadata,*loadstart,*lostpointercapture,*mousedown,*mouseenter,*mouseleave,*mousemove,*mouseout,*mouseover,*mouseup,*mousewheel,*paste,*pause,*play,*playing,*pointercancel,*pointerdown,*pointerenter,*pointerleave,*pointermove,*pointerout,*pointerover,*pointerrawupdate,*pointerup,*progress,*ratechange,*reset,*resize,*scroll,*securitypolicyviolation,*seeked,*seeking,*select,*selectionchange,*selectstart,*slotchange,*stalled,*submit,*suspend,*timeupdate,*toggle,*transitioncancel,*transitionend,*transitionrun,*transitionstart,*volumechange,*waiting,*webkitanimationend,*webkitanimationiteration,*webkitanimationstart,*webkittransitionend,*wheel,outerText,!spellcheck,%style,#tabIndex,title,!translate,virtualKeyboardPolicy","media^[HTMLElement]|!autoplay,!controls,%controlsList,%crossOrigin,#currentTime,!defaultMuted,#defaultPlaybackRate,!disableRemotePlayback,!loop,!muted,*encrypted,*waitingforkey,#playbackRate,preload,!preservesPitch,src,%srcObject,#volume",":svg:^[HTMLElement]|!autofocus,nonce,*abort,*animationend,*animationiteration,*animationstart,*auxclick,*beforexrselect,*blur,*cancel,*canplay,*canplaythrough,*change,*click,*close,*contextmenu,*copy,*cuechange,*cut,*dblclick,*drag,*dragend,*dragenter,*dragleave,*dragover,*dragstart,*drop,*durationchange,*emptied,*ended,*error,*focus,*formdata,*gotpointercapture,*input,*invalid,*keydown,*keypress,*keyup,*load,*loadeddata,*loadedmetadata,*loadstart,*lostpointercapture,*mousedown,*mouseenter,*mouseleave,*mousemove,*mouseout,*mouseover,*mouseup,*mousewheel,*paste,*pause,*play,*playing,*pointercancel,*pointerdown,*pointerenter,*pointerleave,*pointermove,*pointerout,*pointerover,*pointerrawupdate,*pointerup,*progress,*ratechange,*reset,*resize,*scroll,*securitypolicyviolation,*seeked,*seeking,*select,*selectionchange,*selectstart,*slotchange,*stalled,*submit,*suspend,*timeupdate,*toggle,*transitioncancel,*transitionend,*transitionrun,*transitionstart,*volumechange,*waiting,*webkitanimationend,*webkitanimationiteration,*webkitanimationstart,*webkittransitionend,*wheel,%style,#tabIndex",":svg:graphics^:svg:|",":svg:animation^:svg:|*begin,*end,*repeat",":svg:geometry^:svg:|",":svg:componentTransferFunction^:svg:|",":svg:gradient^:svg:|",":svg:textContent^:svg:graphics|",":svg:textPositioning^:svg:textContent|","a^[HTMLElement]|charset,coords,download,hash,host,hostname,href,hreflang,name,password,pathname,ping,port,protocol,referrerPolicy,rel,%relList,rev,search,shape,target,text,type,username","area^[HTMLElement]|alt,coords,download,hash,host,hostname,href,!noHref,password,pathname,ping,port,protocol,referrerPolicy,rel,%relList,search,shape,target,username","audio^media|","br^[HTMLElement]|clear","base^[HTMLElement]|href,target","body^[HTMLElement]|aLink,background,bgColor,link,*afterprint,*beforeprint,*beforeunload,*blur,*error,*focus,*hashchange,*languagechange,*load,*message,*messageerror,*offline,*online,*pagehide,*pageshow,*popstate,*rejectionhandled,*resize,*scroll,*storage,*unhandledrejection,*unload,text,vLink","button^[HTMLElement]|!disabled,formAction,formEnctype,formMethod,!formNoValidate,formTarget,name,type,value","canvas^[HTMLElement]|#height,#width","content^[HTMLElement]|select","dl^[HTMLElement]|!compact","data^[HTMLElement]|value","datalist^[HTMLElement]|","details^[HTMLElement]|!open","dialog^[HTMLElement]|!open,returnValue","dir^[HTMLElement]|!compact","div^[HTMLElement]|align","embed^[HTMLElement]|align,height,name,src,type,width","fieldset^[HTMLElement]|!disabled,name","font^[HTMLElement]|color,face,size","form^[HTMLElement]|acceptCharset,action,autocomplete,encoding,enctype,method,name,!noValidate,target","frame^[HTMLElement]|frameBorder,longDesc,marginHeight,marginWidth,name,!noResize,scrolling,src","frameset^[HTMLElement]|cols,*afterprint,*beforeprint,*beforeunload,*blur,*error,*focus,*hashchange,*languagechange,*load,*message,*messageerror,*offline,*online,*pagehide,*pageshow,*popstate,*rejectionhandled,*resize,*scroll,*storage,*unhandledrejection,*unload,rows","hr^[HTMLElement]|align,color,!noShade,size,width","head^[HTMLElement]|","h1,h2,h3,h4,h5,h6^[HTMLElement]|align","html^[HTMLElement]|version","iframe^[HTMLElement]|align,allow,!allowFullscreen,!allowPaymentRequest,csp,frameBorder,height,loading,longDesc,marginHeight,marginWidth,name,referrerPolicy,%sandbox,scrolling,src,srcdoc,width","img^[HTMLElement]|align,alt,border,%crossOrigin,decoding,#height,#hspace,!isMap,loading,longDesc,lowsrc,name,referrerPolicy,sizes,src,srcset,useMap,#vspace,#width","input^[HTMLElement]|accept,align,alt,autocomplete,!checked,!defaultChecked,defaultValue,dirName,!disabled,%files,formAction,formEnctype,formMethod,!formNoValidate,formTarget,#height,!incremental,!indeterminate,max,#maxLength,min,#minLength,!multiple,name,pattern,placeholder,!readOnly,!required,selectionDirection,#selectionEnd,#selectionStart,#size,src,step,type,useMap,value,%valueAsDate,#valueAsNumber,#width","li^[HTMLElement]|type,#value","label^[HTMLElement]|htmlFor","legend^[HTMLElement]|align","link^[HTMLElement]|as,charset,%crossOrigin,!disabled,href,hreflang,imageSizes,imageSrcset,integrity,media,referrerPolicy,rel,%relList,rev,%sizes,target,type","map^[HTMLElement]|name","marquee^[HTMLElement]|behavior,bgColor,direction,height,#hspace,#loop,#scrollAmount,#scrollDelay,!trueSpeed,#vspace,width","menu^[HTMLElement]|!compact","meta^[HTMLElement]|content,httpEquiv,media,name,scheme","meter^[HTMLElement]|#high,#low,#max,#min,#optimum,#value","ins,del^[HTMLElement]|cite,dateTime","ol^[HTMLElement]|!compact,!reversed,#start,type","object^[HTMLElement]|align,archive,border,code,codeBase,codeType,data,!declare,height,#hspace,name,standby,type,useMap,#vspace,width","optgroup^[HTMLElement]|!disabled,label","option^[HTMLElement]|!defaultSelected,!disabled,label,!selected,text,value","output^[HTMLElement]|defaultValue,%htmlFor,name,value","p^[HTMLElement]|align","param^[HTMLElement]|name,type,value,valueType","picture^[HTMLElement]|","pre^[HTMLElement]|#width","progress^[HTMLElement]|#max,#value","q,blockquote,cite^[HTMLElement]|","script^[HTMLElement]|!async,charset,%crossOrigin,!defer,event,htmlFor,integrity,!noModule,%referrerPolicy,src,text,type","select^[HTMLElement]|autocomplete,!disabled,#length,!multiple,name,!required,#selectedIndex,#size,value","slot^[HTMLElement]|name","source^[HTMLElement]|#height,media,sizes,src,srcset,type,#width","span^[HTMLElement]|","style^[HTMLElement]|!disabled,media,type","caption^[HTMLElement]|align","th,td^[HTMLElement]|abbr,align,axis,bgColor,ch,chOff,#colSpan,headers,height,!noWrap,#rowSpan,scope,vAlign,width","col,colgroup^[HTMLElement]|align,ch,chOff,#span,vAlign,width","table^[HTMLElement]|align,bgColor,border,%caption,cellPadding,cellSpacing,frame,rules,summary,%tFoot,%tHead,width","tr^[HTMLElement]|align,bgColor,ch,chOff,vAlign","tfoot,thead,tbody^[HTMLElement]|align,ch,chOff,vAlign","template^[HTMLElement]|","textarea^[HTMLElement]|autocomplete,#cols,defaultValue,dirName,!disabled,#maxLength,#minLength,name,placeholder,!readOnly,!required,#rows,selectionDirection,#selectionEnd,#selectionStart,value,wrap","time^[HTMLElement]|dateTime","title^[HTMLElement]|text","track^[HTMLElement]|!default,kind,label,src,srclang","ul^[HTMLElement]|!compact,type","unknown^[HTMLElement]|","video^media|!disablePictureInPicture,#height,*enterpictureinpicture,*leavepictureinpicture,!playsInline,poster,#width",":svg:a^:svg:graphics|",":svg:animate^:svg:animation|",":svg:animateMotion^:svg:animation|",":svg:animateTransform^:svg:animation|",":svg:circle^:svg:geometry|",":svg:clipPath^:svg:graphics|",":svg:defs^:svg:graphics|",":svg:desc^:svg:|",":svg:discard^:svg:|",":svg:ellipse^:svg:geometry|",":svg:feBlend^:svg:|",":svg:feColorMatrix^:svg:|",":svg:feComponentTransfer^:svg:|",":svg:feComposite^:svg:|",":svg:feConvolveMatrix^:svg:|",":svg:feDiffuseLighting^:svg:|",":svg:feDisplacementMap^:svg:|",":svg:feDistantLight^:svg:|",":svg:feDropShadow^:svg:|",":svg:feFlood^:svg:|",":svg:feFuncA^:svg:componentTransferFunction|",":svg:feFuncB^:svg:componentTransferFunction|",":svg:feFuncG^:svg:componentTransferFunction|",":svg:feFuncR^:svg:componentTransferFunction|",":svg:feGaussianBlur^:svg:|",":svg:feImage^:svg:|",":svg:feMerge^:svg:|",":svg:feMergeNode^:svg:|",":svg:feMorphology^:svg:|",":svg:feOffset^:svg:|",":svg:fePointLight^:svg:|",":svg:feSpecularLighting^:svg:|",":svg:feSpotLight^:svg:|",":svg:feTile^:svg:|",":svg:feTurbulence^:svg:|",":svg:filter^:svg:|",":svg:foreignObject^:svg:graphics|",":svg:g^:svg:graphics|",":svg:image^:svg:graphics|decoding",":svg:line^:svg:geometry|",":svg:linearGradient^:svg:gradient|",":svg:mpath^:svg:|",":svg:marker^:svg:|",":svg:mask^:svg:|",":svg:metadata^:svg:|",":svg:path^:svg:geometry|",":svg:pattern^:svg:|",":svg:polygon^:svg:geometry|",":svg:polyline^:svg:geometry|",":svg:radialGradient^:svg:gradient|",":svg:rect^:svg:geometry|",":svg:svg^:svg:graphics|#currentScale,#zoomAndPan",":svg:script^:svg:|type",":svg:set^:svg:animation|",":svg:stop^:svg:|",":svg:style^:svg:|!disabled,media,title,type",":svg:switch^:svg:graphics|",":svg:symbol^:svg:|",":svg:tspan^:svg:textPositioning|",":svg:text^:svg:textPositioning|",":svg:textPath^:svg:textContent|",":svg:title^:svg:|",":svg:use^:svg:graphics|",":svg:view^:svg:|#zoomAndPan","data^[HTMLElement]|value","keygen^[HTMLElement]|!autofocus,challenge,!disabled,form,keytype,name","menuitem^[HTMLElement]|type,label,icon,!disabled,!checked,radiogroup,!default","summary^[HTMLElement]|","time^[HTMLElement]|dateTime",":svg:cursor^:svg:|",":math:^[HTMLElement]|!autofocus,nonce,*abort,*animationend,*animationiteration,*animationstart,*auxclick,*beforeinput,*beforematch,*beforetoggle,*beforexrselect,*blur,*cancel,*canplay,*canplaythrough,*change,*click,*close,*contentvisibilityautostatechange,*contextlost,*contextmenu,*contextrestored,*copy,*cuechange,*cut,*dblclick,*drag,*dragend,*dragenter,*dragleave,*dragover,*dragstart,*drop,*durationchange,*emptied,*ended,*error,*focus,*formdata,*gotpointercapture,*input,*invalid,*keydown,*keypress,*keyup,*load,*loadeddata,*loadedmetadata,*loadstart,*lostpointercapture,*mousedown,*mouseenter,*mouseleave,*mousemove,*mouseout,*mouseover,*mouseup,*mousewheel,*paste,*pause,*play,*playing,*pointercancel,*pointerdown,*pointerenter,*pointerleave,*pointermove,*pointerout,*pointerover,*pointerrawupdate,*pointerup,*progress,*ratechange,*reset,*resize,*scroll,*scrollend,*securitypolicyviolation,*seeked,*seeking,*select,*selectionchange,*selectstart,*slotchange,*stalled,*submit,*suspend,*timeupdate,*toggle,*transitioncancel,*transitionend,*transitionrun,*transitionstart,*volumechange,*waiting,*webkitanimationend,*webkitanimationiteration,*webkitanimationstart,*webkittransitionend,*wheel,%style,#tabIndex",":math:math^:math:|",":math:maction^:math:|",":math:menclose^:math:|",":math:merror^:math:|",":math:mfenced^:math:|",":math:mfrac^:math:|",":math:mi^:math:|",":math:mmultiscripts^:math:|",":math:mn^:math:|",":math:mo^:math:|",":math:mover^:math:|",":math:mpadded^:math:|",":math:mphantom^:math:|",":math:mroot^:math:|",":math:mrow^:math:|",":math:ms^:math:|",":math:mspace^:math:|",":math:msqrt^:math:|",":math:mstyle^:math:|",":math:msub^:math:|",":math:msubsup^:math:|",":math:msup^:math:|",":math:mtable^:math:|",":math:mtd^:math:|",":math:mtext^:math:|",":math:mtr^:math:|",":math:munder^:math:|",":math:munderover^:math:|",":math:semantics^:math:|"],Yr=new Map(Object.entries({class:"className",for:"htmlFor",formaction:"formAction",innerHtml:"innerHTML",readonly:"readOnly",tabindex:"tabIndex"})),ni=Array.from(Yr).reduce((e,[t,r])=>(e.set(t,r),e),new Map),ai=class extends Js{constructor(){super(),this._schema=new Map,this._eventSchema=new Map,ri.forEach(e=>{let t=new Map,r=new Set,[n,a]=e.split("|"),s=a.split(","),[i,u]=n.split("^");i.split(",").forEach(p=>{this._schema.set(p.toLowerCase(),t),this._eventSchema.set(p.toLowerCase(),r)});let o=u&&this._schema.get(u.toLowerCase());if(o){for(let[p,l]of o)t.set(p,l);for(let p of this._eventSchema.get(u.toLowerCase()))r.add(p)}s.forEach(p=>{if(p.length>0)switch(p[0]){case"*":r.add(p.substring(1));break;case"!":t.set(p.substring(1),Qs);break;case"#":t.set(p.substring(1),Zs);break;case"%":t.set(p.substring(1),ti);break;default:t.set(p,ei)}})})}hasProperty(e,t,r){if(r.some(n=>n.name===Ut.name))return!0;if(e.indexOf("-")>-1){if(Ot(e)||Wt(e))return!1;if(r.some(n=>n.name===Rt.name))return!0}return(this._schema.get(e.toLowerCase())||this._schema.get("unknown")).has(t)}hasElement(e,t){return t.some(r=>r.name===Ut.name)||e.indexOf("-")>-1&&(Ot(e)||Wt(e)||t.some(r=>r.name===Rt.name))?!0:this._schema.has(e.toLowerCase())}securityContext(e,t,r){r&&(t=this.getMappedPropName(t)),e=e.toLowerCase(),t=t.toLowerCase();let n=zt()[e+"|"+t];return n||(n=zt()["*|"+t],n||W.NONE)}getMappedPropName(e){return Yr.get(e)??e}getDefaultComponentElementName(){return"ng-component"}validateProperty(e){return e.toLowerCase().startsWith("on")?{error:!0,msg:`Binding to event property '${e}' is disallowed for security reasons, please use (${e.slice(2)})=... If '${e}' is a directive input, make sure the directive is imported by the current module.`}:{error:!1}}validateAttribute(e){return e.toLowerCase().startsWith("on")?{error:!0,msg:`Binding to event attribute '${e}' is disallowed for security reasons, please use (${e.slice(2)})=...`}:{error:!1}}allKnownElementNames(){return Array.from(this._schema.keys())}allKnownAttributesOfElement(e){let t=this._schema.get(e.toLowerCase())||this._schema.get("unknown");return Array.from(t.keys()).map(r=>ni.get(r)??r)}allKnownEventsOfElement(e){return Array.from(this._eventSchema.get(e.toLowerCase())??[])}normalizeAnimationStyleProperty(e){return Bs(e)}normalizeAnimationStyleValue(e,t,r){let n="",a=r.toString().trim(),s=null;if(si(e)&&r!==0&&r!=="0")if(typeof r=="number")n="px";else{let i=r.match(/^[+-]?[\d\.]+([a-z]*)$/);i&&i[1].length==0&&(s=`Please provide a CSS unit value for ${t}:${r}`)}return{error:s,value:a+n}}};function si(e){switch(e){case"width":case"height":case"minWidth":case"minHeight":case"maxWidth":case"maxHeight":case"left":case"top":case"bottom":case"right":case"fontSize":case"outlineWidth":case"outlineOffset":case"paddingTop":case"paddingLeft":case"paddingBottom":case"paddingRight":case"marginTop":case"marginLeft":case"marginBottom":case"marginRight":case"borderRadius":case"borderWidth":case"borderTopWidth":case"borderLeftWidth":case"borderRightWidth":case"borderBottomWidth":case"textIndent":return!0;default:return!1}}var h=class{constructor({closedByChildren:e,implicitNamespacePrefix:t,contentType:r=I.PARSABLE_DATA,closedByParent:n=!1,isVoid:a=!1,ignoreFirstLf:s=!1,preventNamespaceInheritance:i=!1,canSelfClose:u=!1}={}){this.closedByChildren={},this.closedByParent=!1,e&&e.length>0&&e.forEach(o=>this.closedByChildren[o]=!0),this.isVoid=a,this.closedByParent=n||a,this.implicitNamespacePrefix=t||null,this.contentType=r,this.ignoreFirstLf=s,this.preventNamespaceInheritance=i,this.canSelfClose=u??a}isClosedByChild(e){return this.isVoid||e.toLowerCase()in this.closedByChildren}getContentType(e){return typeof this.contentType=="object"?(e===void 0?void 0:this.contentType[e])??this.contentType.default:this.contentType}},$t,se;function et(e){return se||($t=new h({canSelfClose:!0}),se=Object.assign(Object.create(null),{base:new h({isVoid:!0}),meta:new h({isVoid:!0}),area:new h({isVoid:!0}),embed:new h({isVoid:!0}),link:new h({isVoid:!0}),img:new h({isVoid:!0}),input:new h({isVoid:!0}),param:new h({isVoid:!0}),hr:new h({isVoid:!0}),br:new h({isVoid:!0}),source:new h({isVoid:!0}),track:new h({isVoid:!0}),wbr:new h({isVoid:!0}),p:new h({closedByChildren:["address","article","aside","blockquote","div","dl","fieldset","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","main","nav","ol","p","pre","section","table","ul"],closedByParent:!0}),thead:new h({closedByChildren:["tbody","tfoot"]}),tbody:new h({closedByChildren:["tbody","tfoot"],closedByParent:!0}),tfoot:new h({closedByChildren:["tbody"],closedByParent:!0}),tr:new h({closedByChildren:["tr"],closedByParent:!0}),td:new h({closedByChildren:["td","th"],closedByParent:!0}),th:new h({closedByChildren:["td","th"],closedByParent:!0}),col:new h({isVoid:!0}),svg:new h({implicitNamespacePrefix:"svg"}),foreignObject:new h({implicitNamespacePrefix:"svg",preventNamespaceInheritance:!0}),math:new h({implicitNamespacePrefix:"math"}),li:new h({closedByChildren:["li"],closedByParent:!0}),dt:new h({closedByChildren:["dt","dd"]}),dd:new h({closedByChildren:["dt","dd"],closedByParent:!0}),rb:new h({closedByChildren:["rb","rt","rtc","rp"],closedByParent:!0}),rt:new h({closedByChildren:["rb","rt","rtc","rp"],closedByParent:!0}),rtc:new h({closedByChildren:["rb","rtc","rp"],closedByParent:!0}),rp:new h({closedByChildren:["rb","rt","rtc","rp"],closedByParent:!0}),optgroup:new h({closedByChildren:["optgroup"],closedByParent:!0}),option:new h({closedByChildren:["option","optgroup"],closedByParent:!0}),pre:new h({ignoreFirstLf:!0}),listing:new h({ignoreFirstLf:!0}),style:new h({contentType:I.RAW_TEXT}),script:new h({contentType:I.RAW_TEXT}),title:new h({contentType:{default:I.ESCAPABLE_RAW_TEXT,svg:I.PARSABLE_DATA}}),textarea:new h({contentType:I.ESCAPABLE_RAW_TEXT,ignoreFirstLf:!0})}),new ai().allKnownElementNames().forEach(t=>{!se[t]&&ke(t)===null&&(se[t]=new h({canSelfClose:!1}))})),se[e]??$t}var re=class{constructor(e,t){this.sourceSpan=e,this.i18n=t}},ii=class extends re{constructor(e,t,r,n){super(t,n),this.value=e,this.tokens=r,this.type="text"}visit(e,t){return e.visitText(this,t)}},ui=class extends re{constructor(e,t,r,n){super(t,n),this.value=e,this.tokens=r,this.type="cdata"}visit(e,t){return e.visitCdata(this,t)}},oi=class extends re{constructor(e,t,r,n,a,s){super(n,s),this.switchValue=e,this.type=t,this.cases=r,this.switchValueSourceSpan=a}visit(e,t){return e.visitExpansion(this,t)}},li=class{constructor(e,t,r,n,a){this.value=e,this.expression=t,this.sourceSpan=r,this.valueSourceSpan=n,this.expSourceSpan=a,this.type="expansionCase"}visit(e,t){return e.visitExpansionCase(this,t)}},ci=class extends re{constructor(e,t,r,n,a,s,i){super(r,i),this.name=e,this.value=t,this.keySpan=n,this.valueSpan=a,this.valueTokens=s,this.type="attribute"}visit(e,t){return e.visitAttribute(this,t)}get nameSpan(){return this.keySpan}},V=class extends re{constructor(e,t,r,n,a,s=null,i=null,u){super(n,u),this.name=e,this.attrs=t,this.children=r,this.startSourceSpan=a,this.endSourceSpan=s,this.nameSpan=i,this.type="element"}visit(e,t){return e.visitElement(this,t)}},pi=class{constructor(e,t){this.value=e,this.sourceSpan=t,this.type="comment"}visit(e,t){return e.visitComment(this,t)}},hi=class{constructor(e,t){this.value=e,this.sourceSpan=t,this.type="docType"}visit(e,t){return e.visitDocType(this,t)}},K=class extends re{constructor(e,t,r,n,a,s,i=null,u){super(n,u),this.name=e,this.parameters=t,this.children=r,this.nameSpan=a,this.startSourceSpan=s,this.endSourceSpan=i,this.type="block"}visit(e,t){return e.visitBlock(this,t)}},jt=class{constructor(e,t){this.expression=e,this.sourceSpan=t,this.type="blockParameter",this.startSourceSpan=null,this.endSourceSpan=null}visit(e,t){return e.visitBlockParameter(this,t)}},Gt=class{constructor(e,t,r,n,a){this.name=e,this.value=t,this.sourceSpan=r,this.nameSpan=n,this.valueSpan=a,this.type="letDeclaration",this.startSourceSpan=null,this.endSourceSpan=null}visit(e,t){return e.visitLetDeclaration(this,t)}};function Jr(e,t,r=null){let n=[],a=e.visit?s=>e.visit(s,r)||s.visit(e,r):s=>s.visit(e,r);return t.forEach(s=>{let i=a(s);i&&n.push(i)}),n}var di=class{constructor(){}visitElement(e,t){this.visitChildren(t,r=>{r(e.attrs),r(e.children)})}visitAttribute(e,t){}visitText(e,t){}visitCdata(e,t){}visitComment(e,t){}visitDocType(e,t){}visitExpansion(e,t){return this.visitChildren(t,r=>{r(e.cases)})}visitExpansionCase(e,t){}visitBlock(e,t){this.visitChildren(t,r=>{r(e.parameters),r(e.children)})}visitBlockParameter(e,t){}visitLetDeclaration(e,t){}visitChildren(e,t){let r=[],n=this;function a(s){s&&r.push(Jr(n,s,e))}return t(a),Array.prototype.concat.apply([],r)}},Fe={AElig:"Æ",AMP:"&",amp:"&",Aacute:"Á",Abreve:"Ă",Acirc:"Â",Acy:"А",Afr:"𝔄",Agrave:"À",Alpha:"Α",Amacr:"Ā",And:"⩓",Aogon:"Ą",Aopf:"𝔸",ApplyFunction:"⁡",af:"⁡",Aring:"Å",angst:"Å",Ascr:"𝒜",Assign:"≔",colone:"≔",coloneq:"≔",Atilde:"Ã",Auml:"Ä",Backslash:"∖",setminus:"∖",setmn:"∖",smallsetminus:"∖",ssetmn:"∖",Barv:"⫧",Barwed:"⌆",doublebarwedge:"⌆",Bcy:"Б",Because:"∵",becaus:"∵",because:"∵",Bernoullis:"ℬ",Bscr:"ℬ",bernou:"ℬ",Beta:"Β",Bfr:"𝔅",Bopf:"𝔹",Breve:"˘",breve:"˘",Bumpeq:"≎",HumpDownHump:"≎",bump:"≎",CHcy:"Ч",COPY:"©",copy:"©",Cacute:"Ć",Cap:"⋒",CapitalDifferentialD:"ⅅ",DD:"ⅅ",Cayleys:"ℭ",Cfr:"ℭ",Ccaron:"Č",Ccedil:"Ç",Ccirc:"Ĉ",Cconint:"∰",Cdot:"Ċ",Cedilla:"¸",cedil:"¸",CenterDot:"·",centerdot:"·",middot:"·",Chi:"Χ",CircleDot:"⊙",odot:"⊙",CircleMinus:"⊖",ominus:"⊖",CirclePlus:"⊕",oplus:"⊕",CircleTimes:"⊗",otimes:"⊗",ClockwiseContourIntegral:"∲",cwconint:"∲",CloseCurlyDoubleQuote:"”",rdquo:"”",rdquor:"”",CloseCurlyQuote:"’",rsquo:"’",rsquor:"’",Colon:"∷",Proportion:"∷",Colone:"⩴",Congruent:"≡",equiv:"≡",Conint:"∯",DoubleContourIntegral:"∯",ContourIntegral:"∮",conint:"∮",oint:"∮",Copf:"ℂ",complexes:"ℂ",Coproduct:"∐",coprod:"∐",CounterClockwiseContourIntegral:"∳",awconint:"∳",Cross:"⨯",Cscr:"𝒞",Cup:"⋓",CupCap:"≍",asympeq:"≍",DDotrahd:"⤑",DJcy:"Ђ",DScy:"Ѕ",DZcy:"Џ",Dagger:"‡",ddagger:"‡",Darr:"↡",Dashv:"⫤",DoubleLeftTee:"⫤",Dcaron:"Ď",Dcy:"Д",Del:"∇",nabla:"∇",Delta:"Δ",Dfr:"𝔇",DiacriticalAcute:"´",acute:"´",DiacriticalDot:"˙",dot:"˙",DiacriticalDoubleAcute:"˝",dblac:"˝",DiacriticalGrave:"`",grave:"`",DiacriticalTilde:"˜",tilde:"˜",Diamond:"⋄",diam:"⋄",diamond:"⋄",DifferentialD:"ⅆ",dd:"ⅆ",Dopf:"𝔻",Dot:"¨",DoubleDot:"¨",die:"¨",uml:"¨",DotDot:"⃜",DotEqual:"≐",doteq:"≐",esdot:"≐",DoubleDownArrow:"⇓",Downarrow:"⇓",dArr:"⇓",DoubleLeftArrow:"⇐",Leftarrow:"⇐",lArr:"⇐",DoubleLeftRightArrow:"⇔",Leftrightarrow:"⇔",hArr:"⇔",iff:"⇔",DoubleLongLeftArrow:"⟸",Longleftarrow:"⟸",xlArr:"⟸",DoubleLongLeftRightArrow:"⟺",Longleftrightarrow:"⟺",xhArr:"⟺",DoubleLongRightArrow:"⟹",Longrightarrow:"⟹",xrArr:"⟹",DoubleRightArrow:"⇒",Implies:"⇒",Rightarrow:"⇒",rArr:"⇒",DoubleRightTee:"⊨",vDash:"⊨",DoubleUpArrow:"⇑",Uparrow:"⇑",uArr:"⇑",DoubleUpDownArrow:"⇕",Updownarrow:"⇕",vArr:"⇕",DoubleVerticalBar:"∥",par:"∥",parallel:"∥",shortparallel:"∥",spar:"∥",DownArrow:"↓",ShortDownArrow:"↓",darr:"↓",downarrow:"↓",DownArrowBar:"⤓",DownArrowUpArrow:"⇵",duarr:"⇵",DownBreve:"̑",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVector:"↽",leftharpoondown:"↽",lhard:"↽",DownLeftVectorBar:"⥖",DownRightTeeVector:"⥟",DownRightVector:"⇁",rhard:"⇁",rightharpoondown:"⇁",DownRightVectorBar:"⥗",DownTee:"⊤",top:"⊤",DownTeeArrow:"↧",mapstodown:"↧",Dscr:"𝒟",Dstrok:"Đ",ENG:"Ŋ",ETH:"Ð",Eacute:"É",Ecaron:"Ě",Ecirc:"Ê",Ecy:"Э",Edot:"Ė",Efr:"𝔈",Egrave:"È",Element:"∈",in:"∈",isin:"∈",isinv:"∈",Emacr:"Ē",EmptySmallSquare:"◻",EmptyVerySmallSquare:"▫",Eogon:"Ę",Eopf:"𝔼",Epsilon:"Ε",Equal:"⩵",EqualTilde:"≂",eqsim:"≂",esim:"≂",Equilibrium:"⇌",rightleftharpoons:"⇌",rlhar:"⇌",Escr:"ℰ",expectation:"ℰ",Esim:"⩳",Eta:"Η",Euml:"Ë",Exists:"∃",exist:"∃",ExponentialE:"ⅇ",ee:"ⅇ",exponentiale:"ⅇ",Fcy:"Ф",Ffr:"𝔉",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",blacksquare:"▪",squarf:"▪",squf:"▪",Fopf:"𝔽",ForAll:"∀",forall:"∀",Fouriertrf:"ℱ",Fscr:"ℱ",GJcy:"Ѓ",GT:">",gt:">",Gamma:"Γ",Gammad:"Ϝ",Gbreve:"Ğ",Gcedil:"Ģ",Gcirc:"Ĝ",Gcy:"Г",Gdot:"Ġ",Gfr:"𝔊",Gg:"⋙",ggg:"⋙",Gopf:"𝔾",GreaterEqual:"≥",ge:"≥",geq:"≥",GreaterEqualLess:"⋛",gel:"⋛",gtreqless:"⋛",GreaterFullEqual:"≧",gE:"≧",geqq:"≧",GreaterGreater:"⪢",GreaterLess:"≷",gl:"≷",gtrless:"≷",GreaterSlantEqual:"⩾",geqslant:"⩾",ges:"⩾",GreaterTilde:"≳",gsim:"≳",gtrsim:"≳",Gscr:"𝒢",Gt:"≫",NestedGreaterGreater:"≫",gg:"≫",HARDcy:"Ъ",Hacek:"ˇ",caron:"ˇ",Hat:"^",Hcirc:"Ĥ",Hfr:"ℌ",Poincareplane:"ℌ",HilbertSpace:"ℋ",Hscr:"ℋ",hamilt:"ℋ",Hopf:"ℍ",quaternions:"ℍ",HorizontalLine:"─",boxh:"─",Hstrok:"Ħ",HumpEqual:"≏",bumpe:"≏",bumpeq:"≏",IEcy:"Е",IJlig:"IJ",IOcy:"Ё",Iacute:"Í",Icirc:"Î",Icy:"И",Idot:"İ",Ifr:"ℑ",Im:"ℑ",image:"ℑ",imagpart:"ℑ",Igrave:"Ì",Imacr:"Ī",ImaginaryI:"ⅈ",ii:"ⅈ",Int:"∬",Integral:"∫",int:"∫",Intersection:"⋂",bigcap:"⋂",xcap:"⋂",InvisibleComma:"⁣",ic:"⁣",InvisibleTimes:"⁢",it:"⁢",Iogon:"Į",Iopf:"𝕀",Iota:"Ι",Iscr:"ℐ",imagline:"ℐ",Itilde:"Ĩ",Iukcy:"І",Iuml:"Ï",Jcirc:"Ĵ",Jcy:"Й",Jfr:"𝔍",Jopf:"𝕁",Jscr:"𝒥",Jsercy:"Ј",Jukcy:"Є",KHcy:"Х",KJcy:"Ќ",Kappa:"Κ",Kcedil:"Ķ",Kcy:"К",Kfr:"𝔎",Kopf:"𝕂",Kscr:"𝒦",LJcy:"Љ",LT:"<",lt:"<",Lacute:"Ĺ",Lambda:"Λ",Lang:"⟪",Laplacetrf:"ℒ",Lscr:"ℒ",lagran:"ℒ",Larr:"↞",twoheadleftarrow:"↞",Lcaron:"Ľ",Lcedil:"Ļ",Lcy:"Л",LeftAngleBracket:"⟨",lang:"⟨",langle:"⟨",LeftArrow:"←",ShortLeftArrow:"←",larr:"←",leftarrow:"←",slarr:"←",LeftArrowBar:"⇤",larrb:"⇤",LeftArrowRightArrow:"⇆",leftrightarrows:"⇆",lrarr:"⇆",LeftCeiling:"⌈",lceil:"⌈",LeftDoubleBracket:"⟦",lobrk:"⟦",LeftDownTeeVector:"⥡",LeftDownVector:"⇃",dharl:"⇃",downharpoonleft:"⇃",LeftDownVectorBar:"⥙",LeftFloor:"⌊",lfloor:"⌊",LeftRightArrow:"↔",harr:"↔",leftrightarrow:"↔",LeftRightVector:"⥎",LeftTee:"⊣",dashv:"⊣",LeftTeeArrow:"↤",mapstoleft:"↤",LeftTeeVector:"⥚",LeftTriangle:"⊲",vartriangleleft:"⊲",vltri:"⊲",LeftTriangleBar:"⧏",LeftTriangleEqual:"⊴",ltrie:"⊴",trianglelefteq:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVector:"↿",uharl:"↿",upharpoonleft:"↿",LeftUpVectorBar:"⥘",LeftVector:"↼",leftharpoonup:"↼",lharu:"↼",LeftVectorBar:"⥒",LessEqualGreater:"⋚",leg:"⋚",lesseqgtr:"⋚",LessFullEqual:"≦",lE:"≦",leqq:"≦",LessGreater:"≶",lessgtr:"≶",lg:"≶",LessLess:"⪡",LessSlantEqual:"⩽",leqslant:"⩽",les:"⩽",LessTilde:"≲",lesssim:"≲",lsim:"≲",Lfr:"𝔏",Ll:"⋘",Lleftarrow:"⇚",lAarr:"⇚",Lmidot:"Ŀ",LongLeftArrow:"⟵",longleftarrow:"⟵",xlarr:"⟵",LongLeftRightArrow:"⟷",longleftrightarrow:"⟷",xharr:"⟷",LongRightArrow:"⟶",longrightarrow:"⟶",xrarr:"⟶",Lopf:"𝕃",LowerLeftArrow:"↙",swarr:"↙",swarrow:"↙",LowerRightArrow:"↘",searr:"↘",searrow:"↘",Lsh:"↰",lsh:"↰",Lstrok:"Ł",Lt:"≪",NestedLessLess:"≪",ll:"≪",Map:"⤅",Mcy:"М",MediumSpace:" ",Mellintrf:"ℳ",Mscr:"ℳ",phmmat:"ℳ",Mfr:"𝔐",MinusPlus:"∓",mnplus:"∓",mp:"∓",Mopf:"𝕄",Mu:"Μ",NJcy:"Њ",Nacute:"Ń",Ncaron:"Ň",Ncedil:"Ņ",Ncy:"Н",NegativeMediumSpace:"​",NegativeThickSpace:"​",NegativeThinSpace:"​",NegativeVeryThinSpace:"​",ZeroWidthSpace:"​",NewLine:` `,Nfr:"𝔑",NoBreak:"⁠",NonBreakingSpace:" ",nbsp:" ",Nopf:"ℕ",naturals:"ℕ",Not:"⫬",NotCongruent:"≢",nequiv:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",npar:"∦",nparallel:"∦",nshortparallel:"∦",nspar:"∦",NotElement:"∉",notin:"∉",notinva:"∉",NotEqual:"≠",ne:"≠",NotEqualTilde:"≂̸",nesim:"≂̸",NotExists:"∄",nexist:"∄",nexists:"∄",NotGreater:"≯",ngt:"≯",ngtr:"≯",NotGreaterEqual:"≱",nge:"≱",ngeq:"≱",NotGreaterFullEqual:"≧̸",ngE:"≧̸",ngeqq:"≧̸",NotGreaterGreater:"≫̸",nGtv:"≫̸",NotGreaterLess:"≹",ntgl:"≹",NotGreaterSlantEqual:"⩾̸",ngeqslant:"⩾̸",nges:"⩾̸",NotGreaterTilde:"≵",ngsim:"≵",NotHumpDownHump:"≎̸",nbump:"≎̸",NotHumpEqual:"≏̸",nbumpe:"≏̸",NotLeftTriangle:"⋪",nltri:"⋪",ntriangleleft:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",nltrie:"⋬",ntrianglelefteq:"⋬",NotLess:"≮",nless:"≮",nlt:"≮",NotLessEqual:"≰",nle:"≰",nleq:"≰",NotLessGreater:"≸",ntlg:"≸",NotLessLess:"≪̸",nLtv:"≪̸",NotLessSlantEqual:"⩽̸",nleqslant:"⩽̸",nles:"⩽̸",NotLessTilde:"≴",nlsim:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",NotPrecedes:"⊀",npr:"⊀",nprec:"⊀",NotPrecedesEqual:"⪯̸",npre:"⪯̸",npreceq:"⪯̸",NotPrecedesSlantEqual:"⋠",nprcue:"⋠",NotReverseElement:"∌",notni:"∌",notniva:"∌",NotRightTriangle:"⋫",nrtri:"⋫",ntriangleright:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",nrtrie:"⋭",ntrianglerighteq:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",nsqsube:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",nsqsupe:"⋣",NotSubset:"⊂⃒",nsubset:"⊂⃒",vnsub:"⊂⃒",NotSubsetEqual:"⊈",nsube:"⊈",nsubseteq:"⊈",NotSucceeds:"⊁",nsc:"⊁",nsucc:"⊁",NotSucceedsEqual:"⪰̸",nsce:"⪰̸",nsucceq:"⪰̸",NotSucceedsSlantEqual:"⋡",nsccue:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",nsupset:"⊃⃒",vnsup:"⊃⃒",NotSupersetEqual:"⊉",nsupe:"⊉",nsupseteq:"⊉",NotTilde:"≁",nsim:"≁",NotTildeEqual:"≄",nsime:"≄",nsimeq:"≄",NotTildeFullEqual:"≇",ncong:"≇",NotTildeTilde:"≉",nap:"≉",napprox:"≉",NotVerticalBar:"∤",nmid:"∤",nshortmid:"∤",nsmid:"∤",Nscr:"𝒩",Ntilde:"Ñ",Nu:"Ν",OElig:"Œ",Oacute:"Ó",Ocirc:"Ô",Ocy:"О",Odblac:"Ő",Ofr:"𝔒",Ograve:"Ò",Omacr:"Ō",Omega:"Ω",ohm:"Ω",Omicron:"Ο",Oopf:"𝕆",OpenCurlyDoubleQuote:"“",ldquo:"“",OpenCurlyQuote:"‘",lsquo:"‘",Or:"⩔",Oscr:"𝒪",Oslash:"Ø",Otilde:"Õ",Otimes:"⨷",Ouml:"Ö",OverBar:"‾",oline:"‾",OverBrace:"⏞",OverBracket:"⎴",tbrk:"⎴",OverParenthesis:"⏜",PartialD:"∂",part:"∂",Pcy:"П",Pfr:"𝔓",Phi:"Φ",Pi:"Π",PlusMinus:"±",plusmn:"±",pm:"±",Popf:"ℙ",primes:"ℙ",Pr:"⪻",Precedes:"≺",pr:"≺",prec:"≺",PrecedesEqual:"⪯",pre:"⪯",preceq:"⪯",PrecedesSlantEqual:"≼",prcue:"≼",preccurlyeq:"≼",PrecedesTilde:"≾",precsim:"≾",prsim:"≾",Prime:"″",Product:"∏",prod:"∏",Proportional:"∝",prop:"∝",propto:"∝",varpropto:"∝",vprop:"∝",Pscr:"𝒫",Psi:"Ψ",QUOT:'"',quot:'"',Qfr:"𝔔",Qopf:"ℚ",rationals:"ℚ",Qscr:"𝒬",RBarr:"⤐",drbkarow:"⤐",REG:"®",circledR:"®",reg:"®",Racute:"Ŕ",Rang:"⟫",Rarr:"↠",twoheadrightarrow:"↠",Rarrtl:"⤖",Rcaron:"Ř",Rcedil:"Ŗ",Rcy:"Р",Re:"ℜ",Rfr:"ℜ",real:"ℜ",realpart:"ℜ",ReverseElement:"∋",SuchThat:"∋",ni:"∋",niv:"∋",ReverseEquilibrium:"⇋",leftrightharpoons:"⇋",lrhar:"⇋",ReverseUpEquilibrium:"⥯",duhar:"⥯",Rho:"Ρ",RightAngleBracket:"⟩",rang:"⟩",rangle:"⟩",RightArrow:"→",ShortRightArrow:"→",rarr:"→",rightarrow:"→",srarr:"→",RightArrowBar:"⇥",rarrb:"⇥",RightArrowLeftArrow:"⇄",rightleftarrows:"⇄",rlarr:"⇄",RightCeiling:"⌉",rceil:"⌉",RightDoubleBracket:"⟧",robrk:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",dharr:"⇂",downharpoonright:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",rfloor:"⌋",RightTee:"⊢",vdash:"⊢",RightTeeArrow:"↦",map:"↦",mapsto:"↦",RightTeeVector:"⥛",RightTriangle:"⊳",vartriangleright:"⊳",vrtri:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",rtrie:"⊵",trianglerighteq:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",uharr:"↾",upharpoonright:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",rharu:"⇀",rightharpoonup:"⇀",RightVectorBar:"⥓",Ropf:"ℝ",reals:"ℝ",RoundImplies:"⥰",Rrightarrow:"⇛",rAarr:"⇛",Rscr:"ℛ",realine:"ℛ",Rsh:"↱",rsh:"↱",RuleDelayed:"⧴",SHCHcy:"Щ",SHcy:"Ш",SOFTcy:"Ь",Sacute:"Ś",Sc:"⪼",Scaron:"Š",Scedil:"Ş",Scirc:"Ŝ",Scy:"С",Sfr:"𝔖",ShortUpArrow:"↑",UpArrow:"↑",uarr:"↑",uparrow:"↑",Sigma:"Σ",SmallCircle:"∘",compfn:"∘",Sopf:"𝕊",Sqrt:"√",radic:"√",Square:"□",squ:"□",square:"□",SquareIntersection:"⊓",sqcap:"⊓",SquareSubset:"⊏",sqsub:"⊏",sqsubset:"⊏",SquareSubsetEqual:"⊑",sqsube:"⊑",sqsubseteq:"⊑",SquareSuperset:"⊐",sqsup:"⊐",sqsupset:"⊐",SquareSupersetEqual:"⊒",sqsupe:"⊒",sqsupseteq:"⊒",SquareUnion:"⊔",sqcup:"⊔",Sscr:"𝒮",Star:"⋆",sstarf:"⋆",Sub:"⋐",Subset:"⋐",SubsetEqual:"⊆",sube:"⊆",subseteq:"⊆",Succeeds:"≻",sc:"≻",succ:"≻",SucceedsEqual:"⪰",sce:"⪰",succeq:"⪰",SucceedsSlantEqual:"≽",sccue:"≽",succcurlyeq:"≽",SucceedsTilde:"≿",scsim:"≿",succsim:"≿",Sum:"∑",sum:"∑",Sup:"⋑",Supset:"⋑",Superset:"⊃",sup:"⊃",supset:"⊃",SupersetEqual:"⊇",supe:"⊇",supseteq:"⊇",THORN:"Þ",TRADE:"™",trade:"™",TSHcy:"Ћ",TScy:"Ц",Tab:" ",Tau:"Τ",Tcaron:"Ť",Tcedil:"Ţ",Tcy:"Т",Tfr:"𝔗",Therefore:"∴",there4:"∴",therefore:"∴",Theta:"Θ",ThickSpace:"  ",ThinSpace:" ",thinsp:" ",Tilde:"∼",sim:"∼",thicksim:"∼",thksim:"∼",TildeEqual:"≃",sime:"≃",simeq:"≃",TildeFullEqual:"≅",cong:"≅",TildeTilde:"≈",ap:"≈",approx:"≈",asymp:"≈",thickapprox:"≈",thkap:"≈",Topf:"𝕋",TripleDot:"⃛",tdot:"⃛",Tscr:"𝒯",Tstrok:"Ŧ",Uacute:"Ú",Uarr:"↟",Uarrocir:"⥉",Ubrcy:"Ў",Ubreve:"Ŭ",Ucirc:"Û",Ucy:"У",Udblac:"Ű",Ufr:"𝔘",Ugrave:"Ù",Umacr:"Ū",UnderBar:"_",lowbar:"_",UnderBrace:"⏟",UnderBracket:"⎵",bbrk:"⎵",UnderParenthesis:"⏝",Union:"⋃",bigcup:"⋃",xcup:"⋃",UnionPlus:"⊎",uplus:"⊎",Uogon:"Ų",Uopf:"𝕌",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",udarr:"⇅",UpDownArrow:"↕",updownarrow:"↕",varr:"↕",UpEquilibrium:"⥮",udhar:"⥮",UpTee:"⊥",bot:"⊥",bottom:"⊥",perp:"⊥",UpTeeArrow:"↥",mapstoup:"↥",UpperLeftArrow:"↖",nwarr:"↖",nwarrow:"↖",UpperRightArrow:"↗",nearr:"↗",nearrow:"↗",Upsi:"ϒ",upsih:"ϒ",Upsilon:"Υ",Uring:"Ů",Uscr:"𝒰",Utilde:"Ũ",Uuml:"Ü",VDash:"⊫",Vbar:"⫫",Vcy:"В",Vdash:"⊩",Vdashl:"⫦",Vee:"⋁",bigvee:"⋁",xvee:"⋁",Verbar:"‖",Vert:"‖",VerticalBar:"∣",mid:"∣",shortmid:"∣",smid:"∣",VerticalLine:"|",verbar:"|",vert:"|",VerticalSeparator:"❘",VerticalTilde:"≀",wr:"≀",wreath:"≀",VeryThinSpace:" ",hairsp:" ",Vfr:"𝔙",Vopf:"𝕍",Vscr:"𝒱",Vvdash:"⊪",Wcirc:"Ŵ",Wedge:"⋀",bigwedge:"⋀",xwedge:"⋀",Wfr:"𝔚",Wopf:"𝕎",Wscr:"𝒲",Xfr:"𝔛",Xi:"Ξ",Xopf:"𝕏",Xscr:"𝒳",YAcy:"Я",YIcy:"Ї",YUcy:"Ю",Yacute:"Ý",Ycirc:"Ŷ",Ycy:"Ы",Yfr:"𝔜",Yopf:"𝕐",Yscr:"𝒴",Yuml:"Ÿ",ZHcy:"Ж",Zacute:"Ź",Zcaron:"Ž",Zcy:"З",Zdot:"Ż",Zeta:"Ζ",Zfr:"ℨ",zeetrf:"ℨ",Zopf:"ℤ",integers:"ℤ",Zscr:"𝒵",aacute:"á",abreve:"ă",ac:"∾",mstpos:"∾",acE:"∾̳",acd:"∿",acirc:"â",acy:"а",aelig:"æ",afr:"𝔞",agrave:"à",alefsym:"ℵ",aleph:"ℵ",alpha:"α",amacr:"ā",amalg:"⨿",and:"∧",wedge:"∧",andand:"⩕",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",angle:"∠",ange:"⦤",angmsd:"∡",measuredangle:"∡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angzarr:"⍼",aogon:"ą",aopf:"𝕒",apE:"⩰",apacir:"⩯",ape:"≊",approxeq:"≊",apid:"≋",apos:"'",aring:"å",ascr:"𝒶",ast:"*",midast:"*",atilde:"ã",auml:"ä",awint:"⨑",bNot:"⫭",backcong:"≌",bcong:"≌",backepsilon:"϶",bepsi:"϶",backprime:"‵",bprime:"‵",backsim:"∽",bsim:"∽",backsimeq:"⋍",bsime:"⋍",barvee:"⊽",barwed:"⌅",barwedge:"⌅",bbrktbrk:"⎶",bcy:"б",bdquo:"„",ldquor:"„",bemptyv:"⦰",beta:"β",beth:"ℶ",between:"≬",twixt:"≬",bfr:"𝔟",bigcirc:"◯",xcirc:"◯",bigodot:"⨀",xodot:"⨀",bigoplus:"⨁",xoplus:"⨁",bigotimes:"⨂",xotime:"⨂",bigsqcup:"⨆",xsqcup:"⨆",bigstar:"★",starf:"★",bigtriangledown:"▽",xdtri:"▽",bigtriangleup:"△",xutri:"△",biguplus:"⨄",xuplus:"⨄",bkarow:"⤍",rbarr:"⤍",blacklozenge:"⧫",lozf:"⧫",blacktriangle:"▴",utrif:"▴",blacktriangledown:"▾",dtrif:"▾",blacktriangleleft:"◂",ltrif:"◂",blacktriangleright:"▸",rtrif:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bnot:"⌐",bopf:"𝕓",bowtie:"⋈",boxDL:"╗",boxDR:"╔",boxDl:"╖",boxDr:"╓",boxH:"═",boxHD:"╦",boxHU:"╩",boxHd:"╤",boxHu:"╧",boxUL:"╝",boxUR:"╚",boxUl:"╜",boxUr:"╙",boxV:"║",boxVH:"╬",boxVL:"╣",boxVR:"╠",boxVh:"╫",boxVl:"╢",boxVr:"╟",boxbox:"⧉",boxdL:"╕",boxdR:"╒",boxdl:"┐",boxdr:"┌",boxhD:"╥",boxhU:"╨",boxhd:"┬",boxhu:"┴",boxminus:"⊟",minusb:"⊟",boxplus:"⊞",plusb:"⊞",boxtimes:"⊠",timesb:"⊠",boxuL:"╛",boxuR:"╘",boxul:"┘",boxur:"└",boxv:"│",boxvH:"╪",boxvL:"╡",boxvR:"╞",boxvh:"┼",boxvl:"┤",boxvr:"├",brvbar:"¦",bscr:"𝒷",bsemi:"⁏",bsol:"\\",bsolb:"⧅",bsolhsub:"⟈",bull:"•",bullet:"•",bumpE:"⪮",cacute:"ć",cap:"∩",capand:"⩄",capbrcup:"⩉",capcap:"⩋",capcup:"⩇",capdot:"⩀",caps:"∩︀",caret:"⁁",ccaps:"⩍",ccaron:"č",ccedil:"ç",ccirc:"ĉ",ccups:"⩌",ccupssm:"⩐",cdot:"ċ",cemptyv:"⦲",cent:"¢",cfr:"𝔠",chcy:"ч",check:"✓",checkmark:"✓",chi:"χ",cir:"○",cirE:"⧃",circ:"ˆ",circeq:"≗",cire:"≗",circlearrowleft:"↺",olarr:"↺",circlearrowright:"↻",orarr:"↻",circledS:"Ⓢ",oS:"Ⓢ",circledast:"⊛",oast:"⊛",circledcirc:"⊚",ocir:"⊚",circleddash:"⊝",odash:"⊝",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",clubs:"♣",clubsuit:"♣",colon:":",comma:",",commat:"@",comp:"∁",complement:"∁",congdot:"⩭",copf:"𝕔",copysr:"℗",crarr:"↵",cross:"✗",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",curlyeqprec:"⋞",cuesc:"⋟",curlyeqsucc:"⋟",cularr:"↶",curvearrowleft:"↶",cularrp:"⤽",cup:"∪",cupbrcap:"⩈",cupcap:"⩆",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curvearrowright:"↷",curarrm:"⤼",curlyvee:"⋎",cuvee:"⋎",curlywedge:"⋏",cuwed:"⋏",curren:"¤",cwint:"∱",cylcty:"⌭",dHar:"⥥",dagger:"†",daleth:"ℸ",dash:"‐",hyphen:"‐",dbkarow:"⤏",rBarr:"⤏",dcaron:"ď",dcy:"д",ddarr:"⇊",downdownarrows:"⇊",ddotseq:"⩷",eDDot:"⩷",deg:"°",delta:"δ",demptyv:"⦱",dfisht:"⥿",dfr:"𝔡",diamondsuit:"♦",diams:"♦",digamma:"ϝ",gammad:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",djcy:"ђ",dlcorn:"⌞",llcorner:"⌞",dlcrop:"⌍",dollar:"$",dopf:"𝕕",doteqdot:"≑",eDot:"≑",dotminus:"∸",minusd:"∸",dotplus:"∔",plusdo:"∔",dotsquare:"⊡",sdotb:"⊡",drcorn:"⌟",lrcorner:"⌟",drcrop:"⌌",dscr:"𝒹",dscy:"ѕ",dsol:"⧶",dstrok:"đ",dtdot:"⋱",dtri:"▿",triangledown:"▿",dwangle:"⦦",dzcy:"џ",dzigrarr:"⟿",eacute:"é",easter:"⩮",ecaron:"ě",ecir:"≖",eqcirc:"≖",ecirc:"ê",ecolon:"≕",eqcolon:"≕",ecy:"э",edot:"ė",efDot:"≒",fallingdotseq:"≒",efr:"𝔢",eg:"⪚",egrave:"è",egs:"⪖",eqslantgtr:"⪖",egsdot:"⪘",el:"⪙",elinters:"⏧",ell:"ℓ",els:"⪕",eqslantless:"⪕",elsdot:"⪗",emacr:"ē",empty:"∅",emptyset:"∅",emptyv:"∅",varnothing:"∅",emsp13:" ",emsp14:" ",emsp:" ",eng:"ŋ",ensp:" ",eogon:"ę",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",epsilon:"ε",epsiv:"ϵ",straightepsilon:"ϵ",varepsilon:"ϵ",equals:"=",equest:"≟",questeq:"≟",equivDD:"⩸",eqvparsl:"⧥",erDot:"≓",risingdotseq:"≓",erarr:"⥱",escr:"ℯ",eta:"η",eth:"ð",euml:"ë",euro:"€",excl:"!",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",ffr:"𝔣",filig:"fi",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",fopf:"𝕗",fork:"⋔",pitchfork:"⋔",forkv:"⫙",fpartint:"⨍",frac12:"½",half:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",sfrown:"⌢",fscr:"𝒻",gEl:"⪌",gtreqqless:"⪌",gacute:"ǵ",gamma:"γ",gap:"⪆",gtrapprox:"⪆",gbreve:"ğ",gcirc:"ĝ",gcy:"г",gdot:"ġ",gescc:"⪩",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",gfr:"𝔤",gimel:"ℷ",gjcy:"ѓ",glE:"⪒",gla:"⪥",glj:"⪤",gnE:"≩",gneqq:"≩",gnap:"⪊",gnapprox:"⪊",gne:"⪈",gneq:"⪈",gnsim:"⋧",gopf:"𝕘",gscr:"ℊ",gsime:"⪎",gsiml:"⪐",gtcc:"⪧",gtcir:"⩺",gtdot:"⋗",gtrdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrarr:"⥸",gvertneqq:"≩︀",gvnE:"≩︀",hardcy:"ъ",harrcir:"⥈",harrw:"↭",leftrightsquigarrow:"↭",hbar:"ℏ",hslash:"ℏ",planck:"ℏ",plankv:"ℏ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",mldr:"…",hercon:"⊹",hfr:"𝔥",hksearow:"⤥",searhk:"⤥",hkswarow:"⤦",swarhk:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",larrhk:"↩",hookrightarrow:"↪",rarrhk:"↪",hopf:"𝕙",horbar:"―",hscr:"𝒽",hstrok:"ħ",hybull:"⁃",iacute:"í",icirc:"î",icy:"и",iecy:"е",iexcl:"¡",ifr:"𝔦",igrave:"ì",iiiint:"⨌",qint:"⨌",iiint:"∭",tint:"∭",iinfin:"⧜",iiota:"℩",ijlig:"ij",imacr:"ī",imath:"ı",inodot:"ı",imof:"⊷",imped:"Ƶ",incare:"℅",infin:"∞",infintie:"⧝",intcal:"⊺",intercal:"⊺",intlarhk:"⨗",intprod:"⨼",iprod:"⨼",iocy:"ё",iogon:"į",iopf:"𝕚",iota:"ι",iquest:"¿",iscr:"𝒾",isinE:"⋹",isindot:"⋵",isins:"⋴",isinsv:"⋳",itilde:"ĩ",iukcy:"і",iuml:"ï",jcirc:"ĵ",jcy:"й",jfr:"𝔧",jmath:"ȷ",jopf:"𝕛",jscr:"𝒿",jsercy:"ј",jukcy:"є",kappa:"κ",kappav:"ϰ",varkappa:"ϰ",kcedil:"ķ",kcy:"к",kfr:"𝔨",kgreen:"ĸ",khcy:"х",kjcy:"ќ",kopf:"𝕜",kscr:"𝓀",lAtail:"⤛",lBarr:"⤎",lEg:"⪋",lesseqqgtr:"⪋",lHar:"⥢",lacute:"ĺ",laemptyv:"⦴",lambda:"λ",langd:"⦑",lap:"⪅",lessapprox:"⪅",laquo:"«",larrbfs:"⤟",larrfs:"⤝",larrlp:"↫",looparrowleft:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",leftarrowtail:"↢",lat:"⪫",latail:"⤙",late:"⪭",lates:"⪭︀",lbarr:"⤌",lbbrk:"❲",lbrace:"{",lcub:"{",lbrack:"[",lsqb:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",lcaron:"ľ",lcedil:"ļ",lcy:"л",ldca:"⤶",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",le:"≤",leq:"≤",leftleftarrows:"⇇",llarr:"⇇",leftthreetimes:"⋋",lthree:"⋋",lescc:"⪨",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessdot:"⋖",ltdot:"⋖",lfisht:"⥼",lfr:"𝔩",lgE:"⪑",lharul:"⥪",lhblk:"▄",ljcy:"љ",llhard:"⥫",lltri:"◺",lmidot:"ŀ",lmoust:"⎰",lmoustache:"⎰",lnE:"≨",lneqq:"≨",lnap:"⪉",lnapprox:"⪉",lne:"⪇",lneq:"⪇",lnsim:"⋦",loang:"⟬",loarr:"⇽",longmapsto:"⟼",xmap:"⟼",looparrowright:"↬",rarrlp:"↬",lopar:"⦅",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",loz:"◊",lozenge:"◊",lpar:"(",lparlt:"⦓",lrhard:"⥭",lrm:"‎",lrtri:"⊿",lsaquo:"‹",lscr:"𝓁",lsime:"⪍",lsimg:"⪏",lsquor:"‚",sbquo:"‚",lstrok:"ł",ltcc:"⪦",ltcir:"⩹",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltrPar:"⦖",ltri:"◃",triangleleft:"◃",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",mDDot:"∺",macr:"¯",strns:"¯",male:"♂",malt:"✠",maltese:"✠",marker:"▮",mcomma:"⨩",mcy:"м",mdash:"—",mfr:"𝔪",mho:"℧",micro:"µ",midcir:"⫰",minus:"−",minusdu:"⨪",mlcp:"⫛",models:"⊧",mopf:"𝕞",mscr:"𝓂",mu:"μ",multimap:"⊸",mumap:"⊸",nGg:"⋙̸",nGt:"≫⃒",nLeftarrow:"⇍",nlArr:"⇍",nLeftrightarrow:"⇎",nhArr:"⇎",nLl:"⋘̸",nLt:"≪⃒",nRightarrow:"⇏",nrArr:"⇏",nVDash:"⊯",nVdash:"⊮",nacute:"ń",nang:"∠⃒",napE:"⩰̸",napid:"≋̸",napos:"ʼn",natur:"♮",natural:"♮",ncap:"⩃",ncaron:"ň",ncedil:"ņ",ncongdot:"⩭̸",ncup:"⩂",ncy:"н",ndash:"–",neArr:"⇗",nearhk:"⤤",nedot:"≐̸",nesear:"⤨",toea:"⤨",nfr:"𝔫",nharr:"↮",nleftrightarrow:"↮",nhpar:"⫲",nis:"⋼",nisd:"⋺",njcy:"њ",nlE:"≦̸",nleqq:"≦̸",nlarr:"↚",nleftarrow:"↚",nldr:"‥",nopf:"𝕟",not:"¬",notinE:"⋹̸",notindot:"⋵̸",notinvb:"⋷",notinvc:"⋶",notnivb:"⋾",notnivc:"⋽",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",nrarr:"↛",nrightarrow:"↛",nrarrc:"⤳̸",nrarrw:"↝̸",nscr:"𝓃",nsub:"⊄",nsubE:"⫅̸",nsubseteqq:"⫅̸",nsup:"⊅",nsupE:"⫆̸",nsupseteqq:"⫆̸",ntilde:"ñ",nu:"ν",num:"#",numero:"№",numsp:" ",nvDash:"⊭",nvHarr:"⤄",nvap:"≍⃒",nvdash:"⊬",nvge:"≥⃒",nvgt:">⃒",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwArr:"⇖",nwarhk:"⤣",nwnear:"⤧",oacute:"ó",ocirc:"ô",ocy:"о",odblac:"ő",odiv:"⨸",odsold:"⦼",oelig:"œ",ofcir:"⦿",ofr:"𝔬",ogon:"˛",ograve:"ò",ogt:"⧁",ohbar:"⦵",olcir:"⦾",olcross:"⦻",olt:"⧀",omacr:"ō",omega:"ω",omicron:"ο",omid:"⦶",oopf:"𝕠",opar:"⦷",operp:"⦹",or:"∨",vee:"∨",ord:"⩝",order:"ℴ",orderof:"ℴ",oscr:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oslash:"ø",osol:"⊘",otilde:"õ",otimesas:"⨶",ouml:"ö",ovbar:"⌽",para:"¶",parsim:"⫳",parsl:"⫽",pcy:"п",percnt:"%",period:".",permil:"‰",pertenk:"‱",pfr:"𝔭",phi:"φ",phiv:"ϕ",straightphi:"ϕ",varphi:"ϕ",phone:"☎",pi:"π",piv:"ϖ",varpi:"ϖ",planckh:"ℎ",plus:"+",plusacir:"⨣",pluscir:"⨢",plusdu:"⨥",pluse:"⩲",plussim:"⨦",plustwo:"⨧",pointint:"⨕",popf:"𝕡",pound:"£",prE:"⪳",prap:"⪷",precapprox:"⪷",precnapprox:"⪹",prnap:"⪹",precneqq:"⪵",prnE:"⪵",precnsim:"⋨",prnsim:"⋨",prime:"′",profalar:"⌮",profline:"⌒",profsurf:"⌓",prurel:"⊰",pscr:"𝓅",psi:"ψ",puncsp:" ",qfr:"𝔮",qopf:"𝕢",qprime:"⁗",qscr:"𝓆",quatint:"⨖",quest:"?",rAtail:"⤜",rHar:"⥤",race:"∽̱",racute:"ŕ",raemptyv:"⦳",rangd:"⦒",range:"⦥",raquo:"»",rarrap:"⥵",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrpl:"⥅",rarrsim:"⥴",rarrtl:"↣",rightarrowtail:"↣",rarrw:"↝",rightsquigarrow:"↝",ratail:"⤚",ratio:"∶",rbbrk:"❳",rbrace:"}",rcub:"}",rbrack:"]",rsqb:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",rcaron:"ř",rcedil:"ŗ",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdsh:"↳",rect:"▭",rfisht:"⥽",rfr:"𝔯",rharul:"⥬",rho:"ρ",rhov:"ϱ",varrho:"ϱ",rightrightarrows:"⇉",rrarr:"⇉",rightthreetimes:"⋌",rthree:"⋌",ring:"˚",rlm:"‏",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",ropar:"⦆",ropf:"𝕣",roplus:"⨮",rotimes:"⨵",rpar:")",rpargt:"⦔",rppolint:"⨒",rsaquo:"›",rscr:"𝓇",rtimes:"⋊",rtri:"▹",triangleright:"▹",rtriltri:"⧎",ruluhar:"⥨",rx:"℞",sacute:"ś",scE:"⪴",scap:"⪸",succapprox:"⪸",scaron:"š",scedil:"ş",scirc:"ŝ",scnE:"⪶",succneqq:"⪶",scnap:"⪺",succnapprox:"⪺",scnsim:"⋩",succnsim:"⋩",scpolint:"⨓",scy:"с",sdot:"⋅",sdote:"⩦",seArr:"⇘",sect:"§",semi:";",seswar:"⤩",tosa:"⤩",sext:"✶",sfr:"𝔰",sharp:"♯",shchcy:"щ",shcy:"ш",shy:"­",sigma:"σ",sigmaf:"ς",sigmav:"ς",varsigma:"ς",simdot:"⩪",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",smashp:"⨳",smeparsl:"⧤",smile:"⌣",ssmile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",softcy:"ь",sol:"/",solb:"⧄",solbar:"⌿",sopf:"𝕤",spades:"♠",spadesuit:"♠",sqcaps:"⊓︀",sqcups:"⊔︀",sscr:"𝓈",star:"☆",sub:"⊂",subset:"⊂",subE:"⫅",subseteqq:"⫅",subdot:"⪽",subedot:"⫃",submult:"⫁",subnE:"⫋",subsetneqq:"⫋",subne:"⊊",subsetneq:"⊊",subplus:"⪿",subrarr:"⥹",subsim:"⫇",subsub:"⫕",subsup:"⫓",sung:"♪",sup1:"¹",sup2:"²",sup3:"³",supE:"⫆",supseteqq:"⫆",supdot:"⪾",supdsub:"⫘",supedot:"⫄",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supsetneqq:"⫌",supne:"⊋",supsetneq:"⊋",supplus:"⫀",supsim:"⫈",supsub:"⫔",supsup:"⫖",swArr:"⇙",swnwar:"⤪",szlig:"ß",target:"⌖",tau:"τ",tcaron:"ť",tcedil:"ţ",tcy:"т",telrec:"⌕",tfr:"𝔱",theta:"θ",thetasym:"ϑ",thetav:"ϑ",vartheta:"ϑ",thorn:"þ",times:"×",timesbar:"⨱",timesd:"⨰",topbot:"⌶",topcir:"⫱",topf:"𝕥",topfork:"⫚",tprime:"‴",triangle:"▵",utri:"▵",triangleq:"≜",trie:"≜",tridot:"◬",triminus:"⨺",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",tscr:"𝓉",tscy:"ц",tshcy:"ћ",tstrok:"ŧ",uHar:"⥣",uacute:"ú",ubrcy:"ў",ubreve:"ŭ",ucirc:"û",ucy:"у",udblac:"ű",ufisht:"⥾",ufr:"𝔲",ugrave:"ù",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",umacr:"ū",uogon:"ų",uopf:"𝕦",upsi:"υ",upsilon:"υ",upuparrows:"⇈",uuarr:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",uring:"ů",urtri:"◹",uscr:"𝓊",utdot:"⋰",utilde:"ũ",uuml:"ü",uwangle:"⦧",vBar:"⫨",vBarv:"⫩",vangrt:"⦜",varsubsetneq:"⊊︀",vsubne:"⊊︀",varsubsetneqq:"⫋︀",vsubnE:"⫋︀",varsupsetneq:"⊋︀",vsupne:"⊋︀",varsupsetneqq:"⫌︀",vsupnE:"⫌︀",vcy:"в",veebar:"⊻",veeeq:"≚",vellip:"⋮",vfr:"𝔳",vopf:"𝕧",vscr:"𝓋",vzigzag:"⦚",wcirc:"ŵ",wedbar:"⩟",wedgeq:"≙",weierp:"℘",wp:"℘",wfr:"𝔴",wopf:"𝕨",wscr:"𝓌",xfr:"𝔵",xi:"ξ",xnis:"⋻",xopf:"𝕩",xscr:"𝓍",yacute:"ý",yacy:"я",ycirc:"ŷ",ycy:"ы",yen:"¥",yfr:"𝔶",yicy:"ї",yopf:"𝕪",yscr:"𝓎",yucy:"ю",yuml:"ÿ",zacute:"ź",zcaron:"ž",zcy:"з",zdot:"ż",zeta:"ζ",zfr:"𝔷",zhcy:"ж",zigrarr:"⇝",zopf:"𝕫",zscr:"𝓏",zwj:"‍",zwnj:"‌"},mi="";Fe.ngsp=mi;var gi=[/@/,/^\s*$/,/[<>]/,/^[{}]$/,/&(#|[a-z])/i,/^\/\//];function fi(e,t){if(t!=null&&!(Array.isArray(t)&&t.length==2))throw new Error(`Expected '${e}' to be an array, [start, end].`);if(t!=null){let r=t[0],n=t[1];gi.forEach(a=>{if(a.test(r)||a.test(n))throw new Error(`['${r}', '${n}'] contains unusable interpolation symbol.`)})}}var vi=class Qr{static fromArray(t){return t?(fi("interpolation",t),new Qr(t[0],t[1])):Zr}constructor(t,r){this.start=t,this.end=r}},Zr=new vi("{{","}}"),Ge=class extends Kr{constructor(e,t,r){super(r,e),this.tokenType=t}},Ci=class{constructor(e,t,r){this.tokens=e,this.errors=t,this.nonNormalizedIcuExpressions=r}};function Si(e,t,r,n={}){let a=new _i(new Gr(e,t),r,n);return a.tokenize(),new Ci(Di(a.tokens),a.errors,a.nonNormalizedIcuExpressions)}var yi=/\r\n?/g;function X(e){return`Unexpected character "${e===0?"EOF":String.fromCharCode(e)}"`}function Kt(e){return`Unknown entity "${e}" - use the "&#;" or "&#x;" syntax`}function bi(e,t){return`Unable to parse entity "${t}" - ${e} character reference entities must end with ";"`}var qe;(function(e){e.HEX="hexadecimal",e.DEC="decimal"})(qe||(qe={}));var Ke=class{constructor(e){this.error=e}},_i=class{constructor(e,t,r){this._getTagContentType=t,this._currentTokenStart=null,this._currentTokenType=null,this._expansionCaseStack=[],this._inInterpolation=!1,this._fullNameStack=[],this.tokens=[],this.errors=[],this.nonNormalizedIcuExpressions=[],this._tokenizeIcu=r.tokenizeExpansionForms||!1,this._interpolationConfig=r.interpolationConfig||Zr,this._leadingTriviaCodePoints=r.leadingTriviaChars&&r.leadingTriviaChars.map(a=>a.codePointAt(0)||0),this._canSelfClose=r.canSelfClose||!1,this._allowHtmComponentClosingTags=r.allowHtmComponentClosingTags||!1;let n=r.range||{endPos:e.content.length,startPos:0,startLine:0,startCol:0};this._cursor=r.escapedString?new Ti(e,n):new en(e,n),this._preserveLineEndings=r.preserveLineEndings||!1,this._i18nNormalizeLineEndingsInICUs=r.i18nNormalizeLineEndingsInICUs||!1,this._tokenizeBlocks=r.tokenizeBlocks??!0,this._tokenizeLet=r.tokenizeLet??!0;try{this._cursor.init()}catch(a){this.handleError(a)}}_processCarriageReturns(e){return this._preserveLineEndings?e:e.replace(yi,` `)}tokenize(){for(;this._cursor.peek()!==0;){let e=this._cursor.clone();try{if(this._attemptCharCode(60))if(this._attemptCharCode(33))this._attemptStr("[CDATA[")?this._consumeCdata(e):this._attemptStr("--")?this._consumeComment(e):this._attemptStrCaseInsensitive("doctype")?this._consumeDocType(e):this._consumeBogusComment(e);else if(this._attemptCharCode(47))this._consumeTagClose(e);else{let t=this._cursor.clone();this._attemptCharCode(63)?(this._cursor=t,this._consumeBogusComment(e)):this._consumeTagOpen(e)}else this._tokenizeLet&&this._cursor.peek()===64&&!this._inInterpolation&&this._attemptStr("@let")?this._consumeLetDeclaration(e):this._tokenizeBlocks&&this._attemptCharCode(64)?this._consumeBlockStart(e):this._tokenizeBlocks&&!this._inInterpolation&&!this._isInExpansionCase()&&!this._isInExpansionForm()&&this._attemptCharCode(125)?this._consumeBlockEnd(e):this._tokenizeIcu&&this._tokenizeExpansionForm()||this._consumeWithInterpolation(5,8,()=>this._isTextEnd(),()=>this._isTagStart())}catch(t){this.handleError(t)}}this._beginToken(34),this._endToken([])}_getBlockName(){let e=!1,t=this._cursor.clone();return this._attemptCharCodeUntilFn(r=>De(r)?!e:Jt(r)?(e=!0,!1):!0),this._cursor.getChars(t).trim()}_consumeBlockStart(e){this._beginToken(25,e);let t=this._endToken([this._getBlockName()]);if(this._cursor.peek()===40)if(this._cursor.advance(),this._consumeBlockParameters(),this._attemptCharCodeUntilFn(b),this._attemptCharCode(41))this._attemptCharCodeUntilFn(b);else{t.type=29;return}this._attemptCharCode(123)?(this._beginToken(26),this._endToken([])):t.type=29}_consumeBlockEnd(e){this._beginToken(27,e),this._endToken([])}_consumeBlockParameters(){for(this._attemptCharCodeUntilFn(Qt);this._cursor.peek()!==41&&this._cursor.peek()!==0;){this._beginToken(28);let e=this._cursor.clone(),t=null,r=0;for(;this._cursor.peek()!==59&&this._cursor.peek()!==0||t!==null;){let n=this._cursor.peek();if(n===92)this._cursor.advance();else if(n===t)t=null;else if(t===null&&je(n))t=n;else if(n===40&&t===null)r++;else if(n===41&&t===null){if(r===0)break;r>0&&r--}this._cursor.advance()}this._endToken([this._cursor.getChars(e)]),this._attemptCharCodeUntilFn(Qt)}}_consumeLetDeclaration(e){if(this._beginToken(30,e),De(this._cursor.peek()))this._attemptCharCodeUntilFn(b);else{let r=this._endToken([this._cursor.getChars(e)]);r.type=33;return}let t=this._endToken([this._getLetDeclarationName()]);if(this._attemptCharCodeUntilFn(b),!this._attemptCharCode(61)){t.type=33;return}this._attemptCharCodeUntilFn(r=>b(r)&&!_t(r)),this._consumeLetDeclarationValue(),this._cursor.peek()===59?(this._beginToken(32),this._endToken([]),this._cursor.advance()):(t.type=33,t.sourceSpan=this._cursor.getSpan(e))}_getLetDeclarationName(){let e=this._cursor.clone(),t=!1;return this._attemptCharCodeUntilFn(r=>Te(r)||r===36||r===95||t&&bt(r)?(t=!0,!1):!0),this._cursor.getChars(e).trim()}_consumeLetDeclarationValue(){let e=this._cursor.clone();for(this._beginToken(31,e);this._cursor.peek()!==0;){let t=this._cursor.peek();if(t===59)break;je(t)&&(this._cursor.advance(),this._attemptCharCodeUntilFn(r=>r===92?(this._cursor.advance(),!1):r===t)),this._cursor.advance()}this._endToken([this._cursor.getChars(e)])}_tokenizeExpansionForm(){if(this.isExpansionFormStart())return this._consumeExpansionFormStart(),!0;if(Ei(this._cursor.peek())&&this._isInExpansionForm())return this._consumeExpansionCaseStart(),!0;if(this._cursor.peek()===125){if(this._isInExpansionCase())return this._consumeExpansionCaseEnd(),!0;if(this._isInExpansionForm())return this._consumeExpansionFormEnd(),!0}return!1}_beginToken(e,t=this._cursor.clone()){this._currentTokenStart=t,this._currentTokenType=e}_endToken(e,t){if(this._currentTokenStart===null)throw new Ge("Programming error - attempted to end a token when there was no start to the token",this._currentTokenType,this._cursor.getSpan(t));if(this._currentTokenType===null)throw new Ge("Programming error - attempted to end a token which has no token type",null,this._cursor.getSpan(this._currentTokenStart));let r={type:this._currentTokenType,parts:e,sourceSpan:(t??this._cursor).getSpan(this._currentTokenStart,this._leadingTriviaCodePoints)};return this.tokens.push(r),this._currentTokenStart=null,this._currentTokenType=null,r}_createError(e,t){this._isInExpansionForm()&&(e+=` (Do you have an unescaped "{" in your template? Use "{{ '{' }}") to escape it.)`);let r=new Ge(e,this._currentTokenType,t);return this._currentTokenStart=null,this._currentTokenType=null,new Ke(r)}handleError(e){if(e instanceof wt&&(e=this._createError(e.msg,this._cursor.getSpan(e.cursor))),e instanceof Ke)this.errors.push(e.error);else throw e}_attemptCharCode(e){return this._cursor.peek()===e?(this._cursor.advance(),!0):!1}_attemptCharCodeCaseInsensitive(e){return xi(this._cursor.peek(),e)?(this._cursor.advance(),!0):!1}_requireCharCode(e){let t=this._cursor.clone();if(!this._attemptCharCode(e))throw this._createError(X(this._cursor.peek()),this._cursor.getSpan(t))}_attemptStr(e){let t=e.length;if(this._cursor.charsLeft()this._attemptStr("-->")),this._beginToken(11),this._requireStr("-->"),this._endToken([])}_consumeBogusComment(e){this._beginToken(10,e),this._endToken([]),this._consumeRawText(!1,()=>this._cursor.peek()===62),this._beginToken(11),this._cursor.advance(),this._endToken([])}_consumeCdata(e){this._beginToken(12,e),this._endToken([]),this._consumeRawText(!1,()=>this._attemptStr("]]>")),this._beginToken(13),this._requireStr("]]>"),this._endToken([])}_consumeDocType(e){this._beginToken(18,e),this._endToken([]),this._consumeRawText(!1,()=>this._cursor.peek()===62),this._beginToken(19),this._cursor.advance(),this._endToken([])}_consumePrefixAndName(){let e=this._cursor.clone(),t="";for(;this._cursor.peek()!==58&&!wi(this._cursor.peek());)this._cursor.advance();let r;this._cursor.peek()===58?(t=this._cursor.getChars(e),this._cursor.advance(),r=this._cursor.clone()):r=e,this._requireCharCodeUntilFn(Xt,t===""?0:1);let n=this._cursor.getChars(r);return[t,n]}_consumeTagOpen(e){let t,r,n,a=[];try{if(!Te(this._cursor.peek()))throw this._createError(X(this._cursor.peek()),this._cursor.getSpan(e));for(n=this._consumeTagOpenStart(e),r=n.parts[0],t=n.parts[1],this._attemptCharCodeUntilFn(b);this._cursor.peek()!==47&&this._cursor.peek()!==62&&this._cursor.peek()!==60&&this._cursor.peek()!==0;){let[i,u]=this._consumeAttributeName();if(this._attemptCharCodeUntilFn(b),this._attemptCharCode(61)){this._attemptCharCodeUntilFn(b);let o=this._consumeAttributeValue();a.push({prefix:i,name:u,value:o})}else a.push({prefix:i,name:u});this._attemptCharCodeUntilFn(b)}this._consumeTagOpenEnd()}catch(i){if(i instanceof Ke){n?n.type=4:(this._beginToken(5,e),this._endToken(["<"]));return}throw i}if(this._canSelfClose&&this.tokens[this.tokens.length-1].type===2)return;let s=this._getTagContentType(t,r,this._fullNameStack.length>0,a);this._handleFullNameStackForTagOpen(r,t),s===I.RAW_TEXT?this._consumeRawTextWithTagClose(r,t,!1):s===I.ESCAPABLE_RAW_TEXT&&this._consumeRawTextWithTagClose(r,t,!0)}_consumeRawTextWithTagClose(e,t,r){this._consumeRawText(r,()=>!this._attemptCharCode(60)||!this._attemptCharCode(47)||(this._attemptCharCodeUntilFn(b),!this._attemptStrCaseInsensitive(e?`${e}:${t}`:t))?!1:(this._attemptCharCodeUntilFn(b),this._attemptCharCode(62))),this._beginToken(3),this._requireCharCodeUntilFn(n=>n===62,3),this._cursor.advance(),this._endToken([e,t]),this._handleFullNameStackForTagClose(e,t)}_consumeTagOpenStart(e){this._beginToken(0,e);let t=this._consumePrefixAndName();return this._endToken(t)}_consumeAttributeName(){let e=this._cursor.peek();if(e===39||e===34)throw this._createError(X(e),this._cursor.getSpan());this._beginToken(14);let t=this._consumePrefixAndName();return this._endToken(t),t}_consumeAttributeValue(){let e;if(this._cursor.peek()===39||this._cursor.peek()===34){let t=this._cursor.peek();this._consumeQuote(t);let r=()=>this._cursor.peek()===t;e=this._consumeWithInterpolation(16,17,r,r),this._consumeQuote(t)}else{let t=()=>Xt(this._cursor.peek());e=this._consumeWithInterpolation(16,17,t,t)}return e}_consumeQuote(e){this._beginToken(15),this._requireCharCode(e),this._endToken([String.fromCodePoint(e)])}_consumeTagOpenEnd(){let e=this._attemptCharCode(47)?2:1;this._beginToken(e),this._requireCharCode(62),this._endToken([])}_consumeTagClose(e){if(this._beginToken(3,e),this._attemptCharCodeUntilFn(b),this._allowHtmComponentClosingTags&&this._attemptCharCode(47))this._attemptCharCodeUntilFn(b),this._requireCharCode(62),this._endToken([]);else{let[t,r]=this._consumePrefixAndName();this._attemptCharCodeUntilFn(b),this._requireCharCode(62),this._endToken([t,r]),this._handleFullNameStackForTagClose(t,r)}}_consumeExpansionFormStart(){this._beginToken(20),this._requireCharCode(123),this._endToken([]),this._expansionCaseStack.push(20),this._beginToken(7);let e=this._readUntil(44),t=this._processCarriageReturns(e);if(this._i18nNormalizeLineEndingsInICUs)this._endToken([t]);else{let n=this._endToken([e]);t!==e&&this.nonNormalizedIcuExpressions.push(n)}this._requireCharCode(44),this._attemptCharCodeUntilFn(b),this._beginToken(7);let r=this._readUntil(44);this._endToken([r]),this._requireCharCode(44),this._attemptCharCodeUntilFn(b)}_consumeExpansionCaseStart(){this._beginToken(21);let e=this._readUntil(123).trim();this._endToken([e]),this._attemptCharCodeUntilFn(b),this._beginToken(22),this._requireCharCode(123),this._endToken([]),this._attemptCharCodeUntilFn(b),this._expansionCaseStack.push(22)}_consumeExpansionCaseEnd(){this._beginToken(23),this._requireCharCode(125),this._endToken([]),this._attemptCharCodeUntilFn(b),this._expansionCaseStack.pop()}_consumeExpansionFormEnd(){this._beginToken(24),this._requireCharCode(125),this._endToken([]),this._expansionCaseStack.pop()}_consumeWithInterpolation(e,t,r,n){this._beginToken(e);let a=[];for(;!r();){let i=this._cursor.clone();this._interpolationConfig&&this._attemptStr(this._interpolationConfig.start)?(this._endToken([this._processCarriageReturns(a.join(""))],i),a.length=0,this._consumeInterpolation(t,i,n),this._beginToken(e)):this._cursor.peek()===38?(this._endToken([this._processCarriageReturns(a.join(""))]),a.length=0,this._consumeEntity(e),this._beginToken(e)):a.push(this._readChar())}this._inInterpolation=!1;let s=this._processCarriageReturns(a.join(""));return this._endToken([s]),s}_consumeInterpolation(e,t,r){let n=[];this._beginToken(e,t),n.push(this._interpolationConfig.start);let a=this._cursor.clone(),s=null,i=!1;for(;this._cursor.peek()!==0&&(r===null||!r());){let u=this._cursor.clone();if(this._isTagStart()){this._cursor=u,n.push(this._getProcessedChars(a,u)),this._endToken(n);return}if(s===null)if(this._attemptStr(this._interpolationConfig.end)){n.push(this._getProcessedChars(a,u)),n.push(this._interpolationConfig.end),this._endToken(n);return}else this._attemptStr("//")&&(i=!0);let o=this._cursor.peek();this._cursor.advance(),o===92?this._cursor.advance():o===s?s=null:!i&&s===null&&je(o)&&(s=o)}n.push(this._getProcessedChars(a,this._cursor)),this._endToken(n)}_getProcessedChars(e,t){return this._processCarriageReturns(t.getChars(e))}_isTextEnd(){return!!(this._isTagStart()||this._cursor.peek()===0||this._tokenizeIcu&&!this._inInterpolation&&(this.isExpansionFormStart()||this._cursor.peek()===125&&this._isInExpansionCase())||this._tokenizeBlocks&&!this._inInterpolation&&!this._isInExpansion()&&(this._isBlockStart()||this._cursor.peek()===64||this._cursor.peek()===125))}_isTagStart(){if(this._cursor.peek()===60){let e=this._cursor.clone();e.advance();let t=e.peek();if(97<=t&&t<=122||65<=t&&t<=90||t===47||t===33)return!0}return!1}_isBlockStart(){if(this._tokenizeBlocks&&this._cursor.peek()===64){let e=this._cursor.clone();if(e.advance(),Jt(e.peek()))return!0}return!1}_readUntil(e){let t=this._cursor.clone();return this._attemptUntilChar(e),this._cursor.getChars(t)}_isInExpansion(){return this._isInExpansionCase()||this._isInExpansionForm()}_isInExpansionCase(){return this._expansionCaseStack.length>0&&this._expansionCaseStack[this._expansionCaseStack.length-1]===22}_isInExpansionForm(){return this._expansionCaseStack.length>0&&this._expansionCaseStack[this._expansionCaseStack.length-1]===20}isExpansionFormStart(){if(this._cursor.peek()!==123)return!1;if(this._interpolationConfig){let e=this._cursor.clone(),t=this._attemptStr(this._interpolationConfig.start);return this._cursor=e,!t}return!0}_handleFullNameStackForTagOpen(e,t){let r=Le(e,t);(this._fullNameStack.length===0||this._fullNameStack[this._fullNameStack.length-1]===r)&&this._fullNameStack.push(r)}_handleFullNameStackForTagClose(e,t){let r=Le(e,t);this._fullNameStack.length!==0&&this._fullNameStack[this._fullNameStack.length-1]===r&&this._fullNameStack.pop()}};function b(e){return!De(e)||e===0}function Xt(e){return De(e)||e===62||e===60||e===47||e===39||e===34||e===61||e===0}function wi(e){return(e<97||12257)}function Ai(e){return e===59||e===0||!Ds(e)}function ki(e){return e===59||e===0||!Te(e)}function Ei(e){return e!==125}function xi(e,t){return Yt(e)===Yt(t)}function Yt(e){return e>=97&&e<=122?e-97+65:e}function Jt(e){return Te(e)||bt(e)||e===95}function Qt(e){return e!==59&&b(e)}function Di(e){let t=[],r;for(let n=0;n0&&r.indexOf(t.peek())!==-1;)n===t&&(t=t.clone()),t.advance();let a=this.locationFromCursor(t),s=this.locationFromCursor(this),i=n!==t?this.locationFromCursor(n):a;return new d(a,s,i)}getChars(t){return this.input.substring(t.state.offset,this.state.offset)}charAt(t){return this.input.charCodeAt(t)}advanceState(t){if(t.offset>=this.end)throw this.state=t,new wt('Unexpected character "EOF"',this);let r=this.charAt(t.offset);r===10?(t.line++,t.column=0):_t(r)||t.column++,t.offset++,this.updatePeek(t)}updatePeek(t){t.peek=t.offset>=this.end?0:this.charAt(t.offset)}locationFromCursor(t){return new Ze(t.file,t.state.offset,t.state.line,t.state.column)}},Ti=class rt extends en{constructor(t,r){t instanceof rt?(super(t),this.internalState={...t.internalState}):(super(t,r),this.internalState=this.state)}advance(){this.state=this.internalState,super.advance(),this.processEscapeSequence()}init(){super.init(),this.processEscapeSequence()}clone(){return new rt(this)}getChars(t){let r=t.clone(),n="";for(;r.internalState.offsetthis.internalState.peek;if(t()===92)if(this.internalState={...this.state},this.advanceState(this.internalState),t()===110)this.state.peek=10;else if(t()===114)this.state.peek=13;else if(t()===118)this.state.peek=11;else if(t()===116)this.state.peek=9;else if(t()===98)this.state.peek=8;else if(t()===102)this.state.peek=12;else if(t()===117)if(this.advanceState(this.internalState),t()===123){this.advanceState(this.internalState);let r=this.clone(),n=0;for(;t()!==125;)this.advanceState(this.internalState),n++;this.state.peek=this.decodeHexDigits(r,n)}else{let r=this.clone();this.advanceState(this.internalState),this.advanceState(this.internalState),this.advanceState(this.internalState),this.state.peek=this.decodeHexDigits(r,4)}else if(t()===120){this.advanceState(this.internalState);let r=this.clone();this.advanceState(this.internalState),this.state.peek=this.decodeHexDigits(r,2)}else if(qt(t())){let r="",n=0,a=this.clone();for(;qt(t())&&n<3;)a=this.clone(),r+=String.fromCodePoint(t()),this.advanceState(this.internalState),n++;this.state.peek=parseInt(r,8),this.internalState=a.internalState}else _t(this.internalState.peek)?(this.advanceState(this.internalState),this.state=this.internalState):this.state.peek=this.internalState.peek}decodeHexDigits(t,r){let n=this.input.slice(t.internalState.offset,t.internalState.offset+r),a=parseInt(n,16);if(isNaN(a))throw t.state=t.internalState,new wt("Invalid hexadecimal escape sequence",t);return a}},wt=class{constructor(e,t){this.msg=e,this.cursor=t}},B=class tn extends Kr{static create(t,r,n){return new tn(t,r,n)}constructor(t,r,n){super(r,n),this.elementName=t}},Bi=class{constructor(e,t){this.rootNodes=e,this.errors=t}},Li=class{constructor(e){this.getTagDefinition=e}parse(e,t,r,n=!1,a){let s=m=>(C,...w)=>m(C.toLowerCase(),...w),i=n?this.getTagDefinition:s(this.getTagDefinition),u=m=>i(m).getContentType(),o=n?a:s(a),p=Si(e,t,a?(m,C,w,E)=>{let x=o(m,C,w,E);return x!==void 0?x:u(m)}:u,r),l=r&&r.canSelfClose||!1,f=r&&r.allowHtmComponentClosingTags||!1,v=new Fi(p.tokens,i,l,f,n);return v.build(),new Bi(v.rootNodes,p.errors.concat(v.errors))}},Fi=class rn{constructor(t,r,n,a,s){this.tokens=t,this.getTagDefinition=r,this.canSelfClose=n,this.allowHtmComponentClosingTags=a,this.isTagNameCaseSensitive=s,this._index=-1,this._containerStack=[],this.rootNodes=[],this.errors=[],this._advance()}build(){for(;this._peek.type!==34;)this._peek.type===0||this._peek.type===4?this._consumeStartTag(this._advance()):this._peek.type===3?(this._closeVoidElement(),this._consumeEndTag(this._advance())):this._peek.type===12?(this._closeVoidElement(),this._consumeCdata(this._advance())):this._peek.type===10?(this._closeVoidElement(),this._consumeComment(this._advance())):this._peek.type===5||this._peek.type===7||this._peek.type===6?(this._closeVoidElement(),this._consumeText(this._advance())):this._peek.type===20?this._consumeExpansion(this._advance()):this._peek.type===25?(this._closeVoidElement(),this._consumeBlockOpen(this._advance())):this._peek.type===27?(this._closeVoidElement(),this._consumeBlockClose(this._advance())):this._peek.type===29?(this._closeVoidElement(),this._consumeIncompleteBlock(this._advance())):this._peek.type===30?(this._closeVoidElement(),this._consumeLet(this._advance())):this._peek.type===18?this._consumeDocType(this._advance()):this._peek.type===33?(this._closeVoidElement(),this._consumeIncompleteLet(this._advance())):this._advance();for(let t of this._containerStack)t instanceof K&&this.errors.push(B.create(t.name,t.sourceSpan,`Unclosed block "${t.name}"`))}_advance(){let t=this._peek;return this._index0)return this.errors=this.errors.concat(s.errors),null;let i=new d(t.sourceSpan.start,a.sourceSpan.end,t.sourceSpan.fullStart),u=new d(r.sourceSpan.start,a.sourceSpan.end,r.sourceSpan.fullStart);return new li(t.parts[0],s.rootNodes,i,t.sourceSpan,u)}_collectExpansionExpTokens(t){let r=[],n=[22];for(;;){if((this._peek.type===20||this._peek.type===22)&&n.push(this._peek.type),this._peek.type===23)if(Zt(n,22)){if(n.pop(),n.length===0)return r}else return this.errors.push(B.create(null,t.sourceSpan,"Invalid ICU message. Missing '}'.")),null;if(this._peek.type===24)if(Zt(n,20))n.pop();else return this.errors.push(B.create(null,t.sourceSpan,"Invalid ICU message. Missing '}'.")),null;if(this._peek.type===34)return this.errors.push(B.create(null,t.sourceSpan,"Invalid ICU message. Missing '}'.")),null;r.push(this._advance())}}_getText(t){let r=t.parts[0];if(r.length>0&&r[0]==` `){let n=this._getClosestParentElement();n!=null&&n.children.length==0&&this.getTagDefinition(n.name).ignoreFirstLf&&(r=r.substring(1))}return r}_consumeText(t){let r=[t],n=t.sourceSpan,a=t.parts[0];if(a.length>0&&a[0]===` `){let s=this._getContainer();s!=null&&s.children.length===0&&this.getTagDefinition(s.name).ignoreFirstLf&&(a=a.substring(1),r[0]={type:t.type,sourceSpan:t.sourceSpan,parts:[a]})}for(;this._peek.type===8||this._peek.type===5||this._peek.type===9;)t=this._advance(),r.push(t),t.type===8?a+=t.parts.join("").replace(/&([^;]+);/g,er):t.type===9?a+=t.parts[0]:a+=t.parts.join("");if(a.length>0){let s=t.sourceSpan;this._addToParent(new ii(a,new d(n.start,s.end,n.fullStart,n.details),r))}}_closeVoidElement(){let t=this._getContainer();t instanceof V&&this.getTagDefinition(t.name).isVoid&&this._containerStack.pop()}_consumeStartTag(t){let[r,n]=t.parts,a=[];for(;this._peek.type===14;)a.push(this._consumeAttr(this._advance()));let s=this._getElementFullName(r,n,this._getClosestParentElement()),i=!1;if(this._peek.type===2){this._advance(),i=!0;let m=this.getTagDefinition(s);this.canSelfClose||m.canSelfClose||ke(s)!==null||m.isVoid||this.errors.push(B.create(s,t.sourceSpan,`Only void, custom and foreign elements can be self closed "${t.parts[1]}"`))}else this._peek.type===1&&(this._advance(),i=!1);let u=this._peek.sourceSpan.fullStart,o=new d(t.sourceSpan.start,u,t.sourceSpan.fullStart),p=new d(t.sourceSpan.start,u,t.sourceSpan.fullStart),l=new d(t.sourceSpan.start.moveBy(1),t.sourceSpan.end),f=new V(s,a,[],o,p,void 0,l),v=this._getContainer();this._pushContainer(f,v instanceof V&&this.getTagDefinition(v.name).isClosedByChild(f.name)),i?this._popContainer(s,V,o):t.type===4&&(this._popContainer(s,V,null),this.errors.push(B.create(s,o,`Opening tag "${s}" not terminated.`)))}_pushContainer(t,r){r&&this._containerStack.pop(),this._addToParent(t),this._containerStack.push(t)}_consumeEndTag(t){let r=this.allowHtmComponentClosingTags&&t.parts.length===0?null:this._getElementFullName(t.parts[0],t.parts[1],this._getClosestParentElement());if(r&&this.getTagDefinition(r).isVoid)this.errors.push(B.create(r,t.sourceSpan,`Void elements do not have end tags "${t.parts[1]}"`));else if(!this._popContainer(r,V,t.sourceSpan)){let n=`Unexpected closing tag "${r}". It may happen when the tag has already been closed by another tag. For more info see https://www.w3.org/TR/html5/syntax.html#closing-elements-that-have-implied-end-tags`;this.errors.push(B.create(r,t.sourceSpan,n))}}_popContainer(t,r,n){let a=!1;for(let s=this._containerStack.length-1;s>=0;s--){let i=this._containerStack[s];if(ke(i.name)?i.name===t:(t==null||i.name.toLowerCase()===t.toLowerCase())&&i instanceof r)return i.endSourceSpan=n,i.sourceSpan.end=n!==null?n.end:i.sourceSpan.end,this._containerStack.splice(s,this._containerStack.length-s),!a;(i instanceof K||i instanceof V&&!this.getTagDefinition(i.name).closedByParent)&&(a=!0)}return!1}_consumeAttr(t){let r=Le(t.parts[0],t.parts[1]),n=t.sourceSpan.end,a;this._peek.type===15&&(a=this._advance());let s="",i=[],u,o;if(this._peek.type===16)for(u=this._peek.sourceSpan,o=this._peek.sourceSpan.end;this._peek.type===16||this._peek.type===17||this._peek.type===9;){let l=this._advance();i.push(l),l.type===17?s+=l.parts.join("").replace(/&([^;]+);/g,er):l.type===9?s+=l.parts[0]:s+=l.parts.join(""),o=n=l.sourceSpan.end}this._peek.type===15&&(o=n=this._advance().sourceSpan.end);let p=u&&o&&new d((a==null?void 0:a.sourceSpan.start)??u.start,o,(a==null?void 0:a.sourceSpan.fullStart)??u.fullStart);return new ci(r,s,new d(t.sourceSpan.start,n,t.sourceSpan.fullStart),t.sourceSpan,p,i.length>0?i:void 0,void 0)}_consumeBlockOpen(t){let r=[];for(;this._peek.type===28;){let u=this._advance();r.push(new jt(u.parts[0],u.sourceSpan))}this._peek.type===26&&this._advance();let n=this._peek.sourceSpan.fullStart,a=new d(t.sourceSpan.start,n,t.sourceSpan.fullStart),s=new d(t.sourceSpan.start,n,t.sourceSpan.fullStart),i=new K(t.parts[0],r,[],a,t.sourceSpan,s);this._pushContainer(i,!1)}_consumeBlockClose(t){this._popContainer(null,K,t.sourceSpan)||this.errors.push(B.create(null,t.sourceSpan,'Unexpected closing block. The block may have been closed earlier. If you meant to write the } character, you should use the "}" HTML entity instead.'))}_consumeIncompleteBlock(t){let r=[];for(;this._peek.type===28;){let u=this._advance();r.push(new jt(u.parts[0],u.sourceSpan))}let n=this._peek.sourceSpan.fullStart,a=new d(t.sourceSpan.start,n,t.sourceSpan.fullStart),s=new d(t.sourceSpan.start,n,t.sourceSpan.fullStart),i=new K(t.parts[0],r,[],a,t.sourceSpan,s);this._pushContainer(i,!1),this._popContainer(null,K,null),this.errors.push(B.create(t.parts[0],a,`Incomplete block "${t.parts[0]}". If you meant to write the @ character, you should use the "@" HTML entity instead.`))}_consumeLet(t){let r=t.parts[0],n,a;if(this._peek.type!==31){this.errors.push(B.create(t.parts[0],t.sourceSpan,`Invalid @let declaration "${r}". Declaration must have a value.`));return}else n=this._advance();if(this._peek.type!==32){this.errors.push(B.create(t.parts[0],t.sourceSpan,`Unterminated @let declaration "${r}". Declaration must be terminated with a semicolon.`));return}else a=this._advance();let s=a.sourceSpan.fullStart,i=new d(t.sourceSpan.start,s,t.sourceSpan.fullStart),u=t.sourceSpan.toString().lastIndexOf(r),o=t.sourceSpan.start.moveBy(u),p=new d(o,t.sourceSpan.end),l=new Gt(r,n.parts[0],i,p,n.sourceSpan);this._addToParent(l)}_consumeIncompleteLet(t){let r=t.parts[0]??"",n=r?` "${r}"`:"";if(r.length>0){let a=t.sourceSpan.toString().lastIndexOf(r),s=t.sourceSpan.start.moveBy(a),i=new d(s,t.sourceSpan.end),u=new d(t.sourceSpan.start,t.sourceSpan.start.moveBy(0)),o=new Gt(r,"",t.sourceSpan,i,u);this._addToParent(o)}this.errors.push(B.create(t.parts[0],t.sourceSpan,`Incomplete @let declaration${n}. @let declarations must be written as \`@let = ;\``))}_getContainer(){return this._containerStack.length>0?this._containerStack[this._containerStack.length-1]:null}_getClosestParentElement(){for(let t=this._containerStack.length-1;t>-1;t--)if(this._containerStack[t]instanceof V)return this._containerStack[t];return null}_addToParent(t){let r=this._getContainer();r===null?this.rootNodes.push(t):r.children.push(t)}_getElementFullName(t,r,n){if(t===""&&(t=this.getTagDefinition(r).implicitNamespacePrefix||"",t===""&&n!=null)){let a=Ve(n.name)[1];this.getTagDefinition(a).preventNamespaceInheritance||(t=ke(n.name))}return Le(t,r)}};function Zt(e,t){return e.length>0&&e[e.length-1]===t}function er(e,t){return Fe[t]!==void 0?Fe[t]||e:/^#x[a-f0-9]+$/i.test(t)?String.fromCodePoint(parseInt(t.slice(2),16)):/^#\d+$/.test(t)?String.fromCodePoint(parseInt(t.slice(1),10)):e}var qi=class extends Li{constructor(){super(et)}parse(e,t,r,n=!1,a){return super.parse(e,t,r,n,a)}},Xe=null,Ni=()=>(Xe||(Xe=new qi),Xe);function tr(e,t={}){let{canSelfClose:r=!1,allowHtmComponentClosingTags:n=!1,isTagNameCaseSensitive:a=!1,getTagContentType:s,tokenizeAngularBlocks:i=!1,tokenizeAngularLetDeclaration:u=!1}=t;return Ni().parse(e,"angular-html-parser",{tokenizeExpansionForms:i,interpolationConfig:void 0,canSelfClose:r,allowHtmComponentClosingTags:n,tokenizeBlocks:i,tokenizeLet:u},a,s)}function Ii(e,t){let r=new SyntaxError(e+" ("+t.loc.start.line+":"+t.loc.start.column+")");return Object.assign(r,t)}var Pi=Ii,we=3;function Hi(e){let t=e.slice(0,we);if(t!=="---"&&t!=="+++")return;let r=e.indexOf(` `,we);if(r===-1)return;let n=e.slice(we,r).trim(),a=e.indexOf(` ${t}`,r),s=n;if(s||(s=t==="+++"?"toml":"yaml"),a===-1&&t==="---"&&s==="yaml"&&(a=e.indexOf(` ...`,r)),a===-1)return;let i=a+1+we,u=e.charAt(i+1);if(!/\s?/u.test(u))return;let o=e.slice(0,i);return{type:"front-matter",language:s,explicitLanguage:n,value:e.slice(r+1,a),startDelimiter:t,endDelimiter:o.slice(-3),raw:o}}function Mi(e){let t=Hi(e);if(!t)return{content:e};let{raw:r}=t;return{frontMatter:t,content:L(!1,r,/[^\n]/gu," ")+e.slice(r.length)}}var Ri=Mi,Ae={attrs:!0,children:!0,cases:!0,expression:!0},rr=new Set(["parent"]),Y,nt,at,Ui=class ie{constructor(t={}){or(this,Y),Et(this,"type"),Et(this,"parent");for(let r of new Set([...rr,...Object.keys(t)]))this.setProperty(r,t[r])}setProperty(t,r){if(this[t]!==r){if(t in Ae&&(r=r.map(n=>this.createChild(n))),!rr.has(t)){this[t]=r;return}Object.defineProperty(this,t,{value:r,enumerable:!1,configurable:!0})}}map(t){let r;for(let n in Ae){let a=this[n];if(a){let s=Oi(a,i=>i.map(t));r!==a&&(r||(r=new ie({parent:this.parent})),r.setProperty(n,s))}}if(r)for(let n in this)n in Ae||(r[n]=this[n]);return t(r||this)}walk(t){for(let r in Ae){let n=this[r];if(n)for(let a=0;a[t.fullName,t.value]))}};Y=new WeakSet,nt=function(){return this.type==="angularIcuCase"?"expression":this.type==="angularIcuExpression"?"cases":"children"},at=function(){var e;return((e=this.parent)==null?void 0:e.$children)??[]};var Vi=Ui;function Oi(e,t){let r=e.map(t);return r.some((n,a)=>n!==e[a])?r:e}var Wi=[{regex:/^(\[if([^\]]*)\]>)(.*?){try{return[!0,t(s,u).children]}catch{return[!1,[{type:"text",value:s,sourceSpan:new d(u,o)}]]}})();return{type:"ieConditionalComment",complete:p,children:l,condition:L(!1,a.trim(),/\s+/gu," "),sourceSpan:e.sourceSpan,startSourceSpan:new d(e.sourceSpan.start,u),endSourceSpan:new d(o,e.sourceSpan.end)}}function ji(e,t,r){let[,n]=r;return{type:"ieConditionalStartComment",condition:L(!1,n.trim(),/\s+/gu," "),sourceSpan:e.sourceSpan}}function Gi(e){return{type:"ieConditionalEndComment",sourceSpan:e.sourceSpan}}var Ye=new Map([["*",new Set(["accesskey","autocapitalize","autofocus","class","contenteditable","dir","draggable","enterkeyhint","hidden","id","inert","inputmode","is","itemid","itemprop","itemref","itemscope","itemtype","lang","nonce","popover","slot","spellcheck","style","tabindex","title","translate","writingsuggestions"])],["a",new Set(["charset","coords","download","href","hreflang","name","ping","referrerpolicy","rel","rev","shape","target","type"])],["applet",new Set(["align","alt","archive","code","codebase","height","hspace","name","object","vspace","width"])],["area",new Set(["alt","coords","download","href","hreflang","nohref","ping","referrerpolicy","rel","shape","target","type"])],["audio",new Set(["autoplay","controls","crossorigin","loop","muted","preload","src"])],["base",new Set(["href","target"])],["basefont",new Set(["color","face","size"])],["blockquote",new Set(["cite"])],["body",new Set(["alink","background","bgcolor","link","text","vlink"])],["br",new Set(["clear"])],["button",new Set(["disabled","form","formaction","formenctype","formmethod","formnovalidate","formtarget","name","popovertarget","popovertargetaction","type","value"])],["canvas",new Set(["height","width"])],["caption",new Set(["align"])],["col",new Set(["align","char","charoff","span","valign","width"])],["colgroup",new Set(["align","char","charoff","span","valign","width"])],["data",new Set(["value"])],["del",new Set(["cite","datetime"])],["details",new Set(["name","open"])],["dialog",new Set(["open"])],["dir",new Set(["compact"])],["div",new Set(["align"])],["dl",new Set(["compact"])],["embed",new Set(["height","src","type","width"])],["fieldset",new Set(["disabled","form","name"])],["font",new Set(["color","face","size"])],["form",new Set(["accept","accept-charset","action","autocomplete","enctype","method","name","novalidate","target"])],["frame",new Set(["frameborder","longdesc","marginheight","marginwidth","name","noresize","scrolling","src"])],["frameset",new Set(["cols","rows"])],["h1",new Set(["align"])],["h2",new Set(["align"])],["h3",new Set(["align"])],["h4",new Set(["align"])],["h5",new Set(["align"])],["h6",new Set(["align"])],["head",new Set(["profile"])],["hr",new Set(["align","noshade","size","width"])],["html",new Set(["manifest","version"])],["iframe",new Set(["align","allow","allowfullscreen","allowpaymentrequest","allowusermedia","frameborder","height","loading","longdesc","marginheight","marginwidth","name","referrerpolicy","sandbox","scrolling","src","srcdoc","width"])],["img",new Set(["align","alt","border","crossorigin","decoding","fetchpriority","height","hspace","ismap","loading","longdesc","name","referrerpolicy","sizes","src","srcset","usemap","vspace","width"])],["input",new Set(["accept","align","alt","autocomplete","checked","dirname","disabled","form","formaction","formenctype","formmethod","formnovalidate","formtarget","height","ismap","list","max","maxlength","min","minlength","multiple","name","pattern","placeholder","popovertarget","popovertargetaction","readonly","required","size","src","step","type","usemap","value","width"])],["ins",new Set(["cite","datetime"])],["isindex",new Set(["prompt"])],["label",new Set(["for","form"])],["legend",new Set(["align"])],["li",new Set(["type","value"])],["link",new Set(["as","blocking","charset","color","crossorigin","disabled","fetchpriority","href","hreflang","imagesizes","imagesrcset","integrity","media","referrerpolicy","rel","rev","sizes","target","type"])],["map",new Set(["name"])],["menu",new Set(["compact"])],["meta",new Set(["charset","content","http-equiv","media","name","scheme"])],["meter",new Set(["high","low","max","min","optimum","value"])],["object",new Set(["align","archive","border","classid","codebase","codetype","data","declare","form","height","hspace","name","standby","type","typemustmatch","usemap","vspace","width"])],["ol",new Set(["compact","reversed","start","type"])],["optgroup",new Set(["disabled","label"])],["option",new Set(["disabled","label","selected","value"])],["output",new Set(["for","form","name"])],["p",new Set(["align"])],["param",new Set(["name","type","value","valuetype"])],["pre",new Set(["width"])],["progress",new Set(["max","value"])],["q",new Set(["cite"])],["script",new Set(["async","blocking","charset","crossorigin","defer","fetchpriority","integrity","language","nomodule","referrerpolicy","src","type"])],["select",new Set(["autocomplete","disabled","form","multiple","name","required","size"])],["slot",new Set(["name"])],["source",new Set(["height","media","sizes","src","srcset","type","width"])],["style",new Set(["blocking","media","type"])],["table",new Set(["align","bgcolor","border","cellpadding","cellspacing","frame","rules","summary","width"])],["tbody",new Set(["align","char","charoff","valign"])],["td",new Set(["abbr","align","axis","bgcolor","char","charoff","colspan","headers","height","nowrap","rowspan","scope","valign","width"])],["template",new Set(["shadowrootclonable","shadowrootdelegatesfocus","shadowrootmode"])],["textarea",new Set(["autocomplete","cols","dirname","disabled","form","maxlength","minlength","name","placeholder","readonly","required","rows","wrap"])],["tfoot",new Set(["align","char","charoff","valign"])],["th",new Set(["abbr","align","axis","bgcolor","char","charoff","colspan","headers","height","nowrap","rowspan","scope","valign","width"])],["thead",new Set(["align","char","charoff","valign"])],["time",new Set(["datetime"])],["tr",new Set(["align","bgcolor","char","charoff","valign"])],["track",new Set(["default","kind","label","src","srclang"])],["ul",new Set(["compact","type"])],["video",new Set(["autoplay","controls","crossorigin","height","loop","muted","playsinline","poster","preload","src","width"])]]),Ki=new Set(["a","abbr","acronym","address","applet","area","article","aside","audio","b","base","basefont","bdi","bdo","bgsound","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","command","content","data","datalist","dd","del","details","dfn","dialog","dir","div","dl","dt","element","em","embed","fieldset","figcaption","figure","font","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","image","img","input","ins","isindex","kbd","keygen","label","legend","li","link","listing","main","map","mark","marquee","math","menu","menuitem","meta","meter","multicol","nav","nextid","nobr","noembed","noframes","noscript","object","ol","optgroup","option","output","p","param","picture","plaintext","pre","progress","q","rb","rbc","rp","rt","rtc","ruby","s","samp","script","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","svg","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","tt","u","ul","var","video","wbr","xmp"]);function Xi(e){if(e.type==="block"){if(e.name=L(!1,e.name.toLowerCase(),/\s+/gu," ").trim(),e.type="angularControlFlowBlock",!ft(e.parameters)){delete e.parameters;return}for(let t of e.parameters)t.type="angularControlFlowBlockParameter";e.parameters={type:"angularControlFlowBlockParameters",children:e.parameters,sourceSpan:new d(e.parameters[0].sourceSpan.start,he(!1,e.parameters,-1).sourceSpan.end)}}}function Yi(e){e.type==="letDeclaration"&&(e.type="angularLetDeclaration",e.id=e.name,e.init={type:"angularLetDeclarationInitializer",sourceSpan:new d(e.valueSpan.start,e.valueSpan.end),value:e.value},delete e.name,delete e.value)}function Ji(e){(e.type==="plural"||e.type==="select")&&(e.clause=e.type,e.type="angularIcuExpression"),e.type==="expansionCase"&&(e.type="angularIcuCase")}function nn(e,t,r){let{name:n,canSelfClose:a=!0,normalizeTagName:s=!1,normalizeAttributeName:i=!1,allowHtmComponentClosingTags:u=!1,isTagNameCaseSensitive:o=!1,shouldParseAsRawText:p}=t,{rootNodes:l,errors:f}=tr(e,{canSelfClose:a,allowHtmComponentClosingTags:u,isTagNameCaseSensitive:o,getTagContentType:p?(...c)=>p(...c)?I.RAW_TEXT:void 0:void 0,tokenizeAngularBlocks:n==="angular"?!0:void 0,tokenizeAngularLetDeclaration:n==="angular"?!0:void 0});if(n==="vue"){if(l.some(y=>y.type==="docType"&&y.value==="html"||y.type==="element"&&y.name.toLowerCase()==="html"))return nn(e,sn,r);let c,g=()=>c??(c=tr(e,{canSelfClose:a,allowHtmComponentClosingTags:u,isTagNameCaseSensitive:o})),A=y=>g().rootNodes.find(({startSourceSpan:T})=>T&&T.start.offset===y.startSourceSpan.start.offset)??y;for(let[y,T]of l.entries()){let{endSourceSpan:G,startSourceSpan:un}=T;if(G===null)f=g().errors,l[y]=A(T);else if(Qi(T,r)){let At=g().errors.find(kt=>kt.span.start.offset>un.start.offset&&kt.span.start.offset0&&nr(f[0]);let v=c=>{let g=c.name.startsWith(":")?c.name.slice(1).split(":")[0]:null,A=c.nameSpan.toString(),y=g!==null&&A.startsWith(`${g}:`),T=y?A.slice(g.length+1):A;c.name=T,c.namespace=g,c.hasExplicitNamespace=y},m=c=>{switch(c.type){case"element":v(c);for(let g of c.attrs)v(g),g.valueSpan?(g.value=g.valueSpan.toString(),/["']/u.test(g.value[0])&&(g.value=g.value.slice(1,-1))):g.value=null;break;case"comment":c.value=c.sourceSpan.toString().slice(4,-3);break;case"text":c.value=c.sourceSpan.toString();break}},C=(c,g)=>{let A=c.toLowerCase();return g(A)?A:c},w=c=>{if(c.type==="element"&&(s&&(!c.namespace||c.namespace===c.tagDefinition.implicitNamespacePrefix||ce(c))&&(c.name=C(c.name,g=>Ki.has(g))),i))for(let g of c.attrs)g.namespace||(g.name=C(g.name,A=>Ye.has(c.name)&&(Ye.get("*").has(A)||Ye.get(c.name).has(A))))},E=c=>{c.sourceSpan&&c.endSourceSpan&&(c.sourceSpan=new d(c.sourceSpan.start,c.endSourceSpan.end))},x=c=>{if(c.type==="element"){let g=et(o?c.name:c.name.toLowerCase());!c.namespace||c.namespace===g.implicitNamespacePrefix||ce(c)?c.tagDefinition=g:c.tagDefinition=et("")}};return Jr(new class extends di{visitExpansionCase(c,g){n==="angular"&&this.visitChildren(g,A=>{A(c.expression)})}visit(c){m(c),x(c),w(c),E(c)}},l),l}function Qi(e,t){var r;if(e.type!=="element"||e.name!=="template")return!1;let n=(r=e.attrs.find(a=>a.name==="lang"))==null?void 0:r.value;return!n||Pe(t,{language:n})==="html"}function nr(e){let{msg:t,span:{start:r,end:n}}=e;throw Pi(t,{loc:{start:{line:r.line+1,column:r.col+1},end:{line:n.line+1,column:n.col+1}},cause:e})}function an(e,t,r={},n=!0){let{frontMatter:a,content:s}=n?Ri(e):{frontMatter:null,content:e},i=new Gr(e,r.filepath),u=new Ze(i,0,0,0),o=u.moveBy(e.length),p={type:"root",sourceSpan:new d(u,o),children:nn(s,t,r)};if(a){let v=new Ze(i,0,0,0),m=v.moveBy(a.raw.length);a.sourceSpan=new d(v,m),p.children.unshift(a)}let l=new Vi(p),f=(v,m)=>{let{offset:C}=m,w=L(!1,e.slice(0,C),/[^\n\r]/gu," "),E=an(w+v,t,r,!1);E.sourceSpan=new d(m,he(!1,E.children,-1).sourceSpan.end);let x=E.children[0];return x.length===C?E.children.shift():(x.sourceSpan=new d(x.sourceSpan.start.moveBy(C),x.sourceSpan.end),x.value=x.value.slice(C)),E};return l.walk(v=>{if(v.type==="comment"){let m=zi(v,f);m&&v.parent.replaceChild(v,m)}Xi(v),Yi(v),Ji(v)}),l}function Oe(e){return{parse:(t,r)=>an(t,e,r),hasPragma:Ss,astFormat:"html",locStart:ge,locEnd:fe}}var sn={name:"html",normalizeTagName:!0,normalizeAttributeName:!0,allowHtmComponentClosingTags:!0},Zi=Oe(sn),eu=Oe({name:"angular"}),tu=Oe({name:"vue",isTagNameCaseSensitive:!0,shouldParseAsRawText(e,t,r,n){return e.toLowerCase()!=="html"&&!r&&(e!=="template"||n.some(({name:a,value:s})=>a==="lang"&&s!=="html"&&s!==""&&s!==void 0))}}),ru=Oe({name:"lwc",canSelfClose:!1}),nu={html:Gs},su=lr;export{su as default,Ks as languages,Ys as options,Xr as parsers,nu as printers}; ================================================ FILE: backend/openui/dist/assets/html-B4dTfUY8.js ================================================ import{m as s}from"./CodeEditor-B9qhAAku.js";import"./index-B7PjGjI7.js";import"./index-DnTpCebm.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.49.0(383fdf3fc0e1e1a024068b8d0fd4f3dcbae74d04) * Released under the MIT license * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt *-----------------------------------------------------------------------------*/var p=Object.defineProperty,d=Object.getOwnPropertyDescriptor,m=Object.getOwnPropertyNames,l=Object.prototype.hasOwnProperty,c=(t,e,n,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of m(e))!l.call(t,r)&&r!==n&&p(t,r,{get:()=>e[r],enumerable:!(o=d(e,r))||o.enumerable});return t},u=(t,e,n)=>(c(t,e,"default"),n),i={};u(i,s);var a=["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr"],k={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(`<(?!(?:${a.join("|")}))([_:\\w][_:\\w-.\\d]*)([^/>]*(?!/)>)[^<]*$`,"i"),afterText:/^<\/([_:\w][_:\w-.\d]*)\s*>$/i,action:{indentAction:i.languages.IndentAction.IndentOutdent}},{beforeText:new RegExp(`<(?!(?:${a.join("|")}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`,"i"),action:{indentAction:i.languages.IndentAction.Indent}}],folding:{markers:{start:new RegExp("^\\s*"),end:new RegExp("^\\s*")}}},g={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{k as conf,g as language}; ================================================ FILE: backend/openui/dist/assets/htmlMode-BZEeRbEQ.js ================================================ import{m as $e}from"./CodeEditor-B9qhAAku.js";import"./index-B7PjGjI7.js";import"./index-DnTpCebm.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.49.0(383fdf3fc0e1e1a024068b8d0fd4f3dcbae74d04) * Released under the MIT license * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt *-----------------------------------------------------------------------------*/var qe=Object.defineProperty,Qe=Object.getOwnPropertyDescriptor,Ge=Object.getOwnPropertyNames,Je=Object.prototype.hasOwnProperty,Ye=(e,n,i,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let t of Ge(n))!Je.call(e,t)&&t!==i&&qe(e,t,{get:()=>n[t],enumerable:!(r=Qe(n,t))||r.enumerable});return e},Ze=(e,n,i)=>(Ye(e,n,"default"),i),c={};Ze(c,$e);var Ke=2*60*1e3,Re=class{constructor(e){this._defaults=e,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>Ke&&this._stopWorker()}_getClient(){return this._lastUsedTime=Date.now(),this._client||(this._worker=c.editor.createWebWorker({moduleId:"vs/language/html/htmlWorker",createData:{languageSettings:this._defaults.options,languageId:this._defaults.languageId},label:this._defaults.languageId}),this._client=this._worker.getProxy()),this._client}getLanguageServiceWorker(...e){let n;return this._getClient().then(i=>{n=i}).then(i=>{if(this._worker)return this._worker.withSyncedResources(e)}).then(i=>n)}},J;(function(e){e.MIN_VALUE=-2147483648,e.MAX_VALUE=2147483647})(J||(J={}));var W;(function(e){e.MIN_VALUE=0,e.MAX_VALUE=2147483647})(W||(W={}));var k;(function(e){function n(r,t){return r===Number.MAX_VALUE&&(r=W.MAX_VALUE),t===Number.MAX_VALUE&&(t=W.MAX_VALUE),{line:r,character:t}}e.create=n;function i(r){var t=r;return s.objectLiteral(t)&&s.uinteger(t.line)&&s.uinteger(t.character)}e.is=i})(k||(k={}));var p;(function(e){function n(r,t,a,o){if(s.uinteger(r)&&s.uinteger(t)&&s.uinteger(a)&&s.uinteger(o))return{start:k.create(r,t),end:k.create(a,o)};if(k.is(r)&&k.is(t))return{start:r,end:t};throw new Error("Range#create called with invalid arguments["+r+", "+t+", "+a+", "+o+"]")}e.create=n;function i(r){var t=r;return s.objectLiteral(t)&&k.is(t.start)&&k.is(t.end)}e.is=i})(p||(p={}));var z;(function(e){function n(r,t){return{uri:r,range:t}}e.create=n;function i(r){var t=r;return s.defined(t)&&p.is(t.range)&&(s.string(t.uri)||s.undefined(t.uri))}e.is=i})(z||(z={}));var Y;(function(e){function n(r,t,a,o){return{targetUri:r,targetRange:t,targetSelectionRange:a,originSelectionRange:o}}e.create=n;function i(r){var t=r;return s.defined(t)&&p.is(t.targetRange)&&s.string(t.targetUri)&&(p.is(t.targetSelectionRange)||s.undefined(t.targetSelectionRange))&&(p.is(t.originSelectionRange)||s.undefined(t.originSelectionRange))}e.is=i})(Y||(Y={}));var X;(function(e){function n(r,t,a,o){return{red:r,green:t,blue:a,alpha:o}}e.create=n;function i(r){var t=r;return s.numberRange(t.red,0,1)&&s.numberRange(t.green,0,1)&&s.numberRange(t.blue,0,1)&&s.numberRange(t.alpha,0,1)}e.is=i})(X||(X={}));var Z;(function(e){function n(r,t){return{range:r,color:t}}e.create=n;function i(r){var t=r;return p.is(t.range)&&X.is(t.color)}e.is=i})(Z||(Z={}));var K;(function(e){function n(r,t,a){return{label:r,textEdit:t,additionalTextEdits:a}}e.create=n;function i(r){var t=r;return s.string(t.label)&&(s.undefined(t.textEdit)||x.is(t))&&(s.undefined(t.additionalTextEdits)||s.typedArray(t.additionalTextEdits,x.is))}e.is=i})(K||(K={}));var P;(function(e){e.Comment="comment",e.Imports="imports",e.Region="region"})(P||(P={}));var ee;(function(e){function n(r,t,a,o,u){var f={startLine:r,endLine:t};return s.defined(a)&&(f.startCharacter=a),s.defined(o)&&(f.endCharacter=o),s.defined(u)&&(f.kind=u),f}e.create=n;function i(r){var t=r;return s.uinteger(t.startLine)&&s.uinteger(t.startLine)&&(s.undefined(t.startCharacter)||s.uinteger(t.startCharacter))&&(s.undefined(t.endCharacter)||s.uinteger(t.endCharacter))&&(s.undefined(t.kind)||s.string(t.kind))}e.is=i})(ee||(ee={}));var B;(function(e){function n(r,t){return{location:r,message:t}}e.create=n;function i(r){var t=r;return s.defined(t)&&z.is(t.location)&&s.string(t.message)}e.is=i})(B||(B={}));var I;(function(e){e.Error=1,e.Warning=2,e.Information=3,e.Hint=4})(I||(I={}));var te;(function(e){e.Unnecessary=1,e.Deprecated=2})(te||(te={}));var re;(function(e){function n(i){var r=i;return r!=null&&s.string(r.href)}e.is=n})(re||(re={}));var H;(function(e){function n(r,t,a,o,u,f){var d={range:r,message:t};return s.defined(a)&&(d.severity=a),s.defined(o)&&(d.code=o),s.defined(u)&&(d.source=u),s.defined(f)&&(d.relatedInformation=f),d}e.create=n;function i(r){var t,a=r;return s.defined(a)&&p.is(a.range)&&s.string(a.message)&&(s.number(a.severity)||s.undefined(a.severity))&&(s.integer(a.code)||s.string(a.code)||s.undefined(a.code))&&(s.undefined(a.codeDescription)||s.string((t=a.codeDescription)===null||t===void 0?void 0:t.href))&&(s.string(a.source)||s.undefined(a.source))&&(s.undefined(a.relatedInformation)||s.typedArray(a.relatedInformation,B.is))}e.is=i})(H||(H={}));var D;(function(e){function n(r,t){for(var a=[],o=2;o0&&(u.arguments=a),u}e.create=n;function i(r){var t=r;return s.defined(t)&&s.string(t.title)&&s.string(t.command)}e.is=i})(D||(D={}));var x;(function(e){function n(a,o){return{range:a,newText:o}}e.replace=n;function i(a,o){return{range:{start:a,end:a},newText:o}}e.insert=i;function r(a){return{range:a,newText:""}}e.del=r;function t(a){var o=a;return s.objectLiteral(o)&&s.string(o.newText)&&p.is(o.range)}e.is=t})(x||(x={}));var y;(function(e){function n(r,t,a){var o={label:r};return t!==void 0&&(o.needsConfirmation=t),a!==void 0&&(o.description=a),o}e.create=n;function i(r){var t=r;return t!==void 0&&s.objectLiteral(t)&&s.string(t.label)&&(s.boolean(t.needsConfirmation)||t.needsConfirmation===void 0)&&(s.string(t.description)||t.description===void 0)}e.is=i})(y||(y={}));var m;(function(e){function n(i){var r=i;return typeof r=="string"}e.is=n})(m||(m={}));var b;(function(e){function n(a,o,u){return{range:a,newText:o,annotationId:u}}e.replace=n;function i(a,o,u){return{range:{start:a,end:a},newText:o,annotationId:u}}e.insert=i;function r(a,o){return{range:a,newText:"",annotationId:o}}e.del=r;function t(a){var o=a;return x.is(o)&&(y.is(o.annotationId)||m.is(o.annotationId))}e.is=t})(b||(b={}));var O;(function(e){function n(r,t){return{textDocument:r,edits:t}}e.create=n;function i(r){var t=r;return s.defined(t)&&U.is(t.textDocument)&&Array.isArray(t.edits)}e.is=i})(O||(O={}));var M;(function(e){function n(r,t,a){var o={kind:"create",uri:r};return t!==void 0&&(t.overwrite!==void 0||t.ignoreIfExists!==void 0)&&(o.options=t),a!==void 0&&(o.annotationId=a),o}e.create=n;function i(r){var t=r;return t&&t.kind==="create"&&s.string(t.uri)&&(t.options===void 0||(t.options.overwrite===void 0||s.boolean(t.options.overwrite))&&(t.options.ignoreIfExists===void 0||s.boolean(t.options.ignoreIfExists)))&&(t.annotationId===void 0||m.is(t.annotationId))}e.is=i})(M||(M={}));var S;(function(e){function n(r,t,a,o){var u={kind:"rename",oldUri:r,newUri:t};return a!==void 0&&(a.overwrite!==void 0||a.ignoreIfExists!==void 0)&&(u.options=a),o!==void 0&&(u.annotationId=o),u}e.create=n;function i(r){var t=r;return t&&t.kind==="rename"&&s.string(t.oldUri)&&s.string(t.newUri)&&(t.options===void 0||(t.options.overwrite===void 0||s.boolean(t.options.overwrite))&&(t.options.ignoreIfExists===void 0||s.boolean(t.options.ignoreIfExists)))&&(t.annotationId===void 0||m.is(t.annotationId))}e.is=i})(S||(S={}));var F;(function(e){function n(r,t,a){var o={kind:"delete",uri:r};return t!==void 0&&(t.recursive!==void 0||t.ignoreIfNotExists!==void 0)&&(o.options=t),a!==void 0&&(o.annotationId=a),o}e.create=n;function i(r){var t=r;return t&&t.kind==="delete"&&s.string(t.uri)&&(t.options===void 0||(t.options.recursive===void 0||s.boolean(t.options.recursive))&&(t.options.ignoreIfNotExists===void 0||s.boolean(t.options.ignoreIfNotExists)))&&(t.annotationId===void 0||m.is(t.annotationId))}e.is=i})(F||(F={}));var $;(function(e){function n(i){var r=i;return r&&(r.changes!==void 0||r.documentChanges!==void 0)&&(r.documentChanges===void 0||r.documentChanges.every(function(t){return s.string(t.kind)?M.is(t)||S.is(t)||F.is(t):O.is(t)}))}e.is=n})($||($={}));var N=function(){function e(n,i){this.edits=n,this.changeAnnotations=i}return e.prototype.insert=function(n,i,r){var t,a;if(r===void 0?t=x.insert(n,i):m.is(r)?(a=r,t=b.insert(n,i,r)):(this.assertChangeAnnotations(this.changeAnnotations),a=this.changeAnnotations.manage(r),t=b.insert(n,i,a)),this.edits.push(t),a!==void 0)return a},e.prototype.replace=function(n,i,r){var t,a;if(r===void 0?t=x.replace(n,i):m.is(r)?(a=r,t=b.replace(n,i,r)):(this.assertChangeAnnotations(this.changeAnnotations),a=this.changeAnnotations.manage(r),t=b.replace(n,i,a)),this.edits.push(t),a!==void 0)return a},e.prototype.delete=function(n,i){var r,t;if(i===void 0?r=x.del(n):m.is(i)?(t=i,r=b.del(n,i)):(this.assertChangeAnnotations(this.changeAnnotations),t=this.changeAnnotations.manage(i),r=b.del(n,t)),this.edits.push(r),t!==void 0)return t},e.prototype.add=function(n){this.edits.push(n)},e.prototype.all=function(){return this.edits},e.prototype.clear=function(){this.edits.splice(0,this.edits.length)},e.prototype.assertChangeAnnotations=function(n){if(n===void 0)throw new Error("Text edit change is not configured to manage change annotations.")},e}(),ne=function(){function e(n){this._annotations=n===void 0?Object.create(null):n,this._counter=0,this._size=0}return e.prototype.all=function(){return this._annotations},Object.defineProperty(e.prototype,"size",{get:function(){return this._size},enumerable:!1,configurable:!0}),e.prototype.manage=function(n,i){var r;if(m.is(n)?r=n:(r=this.nextId(),i=n),this._annotations[r]!==void 0)throw new Error("Id "+r+" is already in use.");if(i===void 0)throw new Error("No annotation provided for id "+r);return this._annotations[r]=i,this._size++,r},e.prototype.nextId=function(){return this._counter++,this._counter.toString()},e}();(function(){function e(n){var i=this;this._textEditChanges=Object.create(null),n!==void 0?(this._workspaceEdit=n,n.documentChanges?(this._changeAnnotations=new ne(n.changeAnnotations),n.changeAnnotations=this._changeAnnotations.all(),n.documentChanges.forEach(function(r){if(O.is(r)){var t=new N(r.edits,i._changeAnnotations);i._textEditChanges[r.textDocument.uri]=t}})):n.changes&&Object.keys(n.changes).forEach(function(r){var t=new N(n.changes[r]);i._textEditChanges[r]=t})):this._workspaceEdit={}}return Object.defineProperty(e.prototype,"edit",{get:function(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit},enumerable:!1,configurable:!0}),e.prototype.getTextEditChange=function(n){if(U.is(n)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var i={uri:n.uri,version:n.version},r=this._textEditChanges[i.uri];if(!r){var t=[],a={textDocument:i,edits:t};this._workspaceEdit.documentChanges.push(a),r=new N(t,this._changeAnnotations),this._textEditChanges[i.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.");var r=this._textEditChanges[n];if(!r){var t=[];this._workspaceEdit.changes[n]=t,r=new N(t),this._textEditChanges[n]=r}return r}},e.prototype.initDocumentChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new ne,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())},e.prototype.initChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))},e.prototype.createFile=function(n,i,r){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var t;y.is(i)||m.is(i)?t=i:r=i;var a,o;if(t===void 0?a=M.create(n,r):(o=m.is(t)?t:this._changeAnnotations.manage(t),a=M.create(n,r,o)),this._workspaceEdit.documentChanges.push(a),o!==void 0)return o},e.prototype.renameFile=function(n,i,r,t){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var a;y.is(r)||m.is(r)?a=r:t=r;var o,u;if(a===void 0?o=S.create(n,i,t):(u=m.is(a)?a:this._changeAnnotations.manage(a),o=S.create(n,i,t,u)),this._workspaceEdit.documentChanges.push(o),u!==void 0)return u},e.prototype.deleteFile=function(n,i,r){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var t;y.is(i)||m.is(i)?t=i:r=i;var a,o;if(t===void 0?a=F.create(n,r):(o=m.is(t)?t:this._changeAnnotations.manage(t),a=F.create(n,r,o)),this._workspaceEdit.documentChanges.push(a),o!==void 0)return o},e})();var ie;(function(e){function n(r){return{uri:r}}e.create=n;function i(r){var t=r;return s.defined(t)&&s.string(t.uri)}e.is=i})(ie||(ie={}));var ae;(function(e){function n(r,t){return{uri:r,version:t}}e.create=n;function i(r){var t=r;return s.defined(t)&&s.string(t.uri)&&s.integer(t.version)}e.is=i})(ae||(ae={}));var U;(function(e){function n(r,t){return{uri:r,version:t}}e.create=n;function i(r){var t=r;return s.defined(t)&&s.string(t.uri)&&(t.version===null||s.integer(t.version))}e.is=i})(U||(U={}));var oe;(function(e){function n(r,t,a,o){return{uri:r,languageId:t,version:a,text:o}}e.create=n;function i(r){var t=r;return s.defined(t)&&s.string(t.uri)&&s.string(t.languageId)&&s.integer(t.version)&&s.string(t.text)}e.is=i})(oe||(oe={}));var T;(function(e){e.PlainText="plaintext",e.Markdown="markdown"})(T||(T={}));(function(e){function n(i){var r=i;return r===e.PlainText||r===e.Markdown}e.is=n})(T||(T={}));var q;(function(e){function n(i){var r=i;return s.objectLiteral(i)&&T.is(r.kind)&&s.string(r.value)}e.is=n})(q||(q={}));var l;(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})(l||(l={}));var Q;(function(e){e.PlainText=1,e.Snippet=2})(Q||(Q={}));var se;(function(e){e.Deprecated=1})(se||(se={}));var ue;(function(e){function n(r,t,a){return{newText:r,insert:t,replace:a}}e.create=n;function i(r){var t=r;return t&&s.string(t.newText)&&p.is(t.insert)&&p.is(t.replace)}e.is=i})(ue||(ue={}));var ce;(function(e){e.asIs=1,e.adjustIndentation=2})(ce||(ce={}));var de;(function(e){function n(i){return{label:i}}e.create=n})(de||(de={}));var ge;(function(e){function n(i,r){return{items:i||[],isIncomplete:!!r}}e.create=n})(ge||(ge={}));var V;(function(e){function n(r){return r.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}e.fromPlainText=n;function i(r){var t=r;return s.string(t)||s.objectLiteral(t)&&s.string(t.language)&&s.string(t.value)}e.is=i})(V||(V={}));var fe;(function(e){function n(i){var r=i;return!!r&&s.objectLiteral(r)&&(q.is(r.contents)||V.is(r.contents)||s.typedArray(r.contents,V.is))&&(i.range===void 0||p.is(i.range))}e.is=n})(fe||(fe={}));var le;(function(e){function n(i,r){return r?{label:i,documentation:r}:{label:i}}e.create=n})(le||(le={}));var he;(function(e){function n(i,r){for(var t=[],a=2;a=0;v--){var w=f[v],E=a.offsetAt(w.range.start),g=a.offsetAt(w.range.end);if(g<=d)u=u.substring(0,E)+w.newText+u.substring(g,u.length);else throw new Error("Overlapping edit");d=E}return u}e.applyEdits=r;function t(a,o){if(a.length<=1)return a;var u=a.length/2|0,f=a.slice(0,u),d=a.slice(u);t(f,o),t(d,o);for(var v=0,w=0,E=0;v0&&n.push(i.length),this._lineOffsets=n}return this._lineOffsets},e.prototype.positionAt=function(n){n=Math.max(Math.min(n,this._content.length),0);var i=this.getLineOffsets(),r=0,t=i.length;if(t===0)return k.create(0,n);for(;rn?t=a:r=a+1}var o=r-1;return k.create(o,n-i[o])},e.prototype.offsetAt=function(n){var i=this.getLineOffsets();if(n.line>=i.length)return this._content.length;if(n.line<0)return 0;var r=i[n.line],t=n.line+1"u"}e.undefined=r;function t(g){return g===!0||g===!1}e.boolean=t;function a(g){return n.call(g)==="[object String]"}e.string=a;function o(g){return n.call(g)==="[object Number]"}e.number=o;function u(g,A,j){return n.call(g)==="[object Number]"&&A<=g&&g<=j}e.numberRange=u;function f(g){return n.call(g)==="[object Number]"&&-2147483648<=g&&g<=2147483647}e.integer=f;function d(g){return n.call(g)==="[object Number]"&&0<=g&&g<=2147483647}e.uinteger=d;function v(g){return n.call(g)==="[object Function]"}e.func=v;function w(g){return g!==null&&typeof g=="object"}e.objectLiteral=w;function E(g,A){return Array.isArray(g)&&g.every(A)}e.typedArray=E})(s||(s={}));var pt=class{constructor(e,n,i){this._languageId=e,this._worker=n,this._disposables=[],this._listener=Object.create(null);const r=a=>{let o=a.getLanguageId();if(o!==this._languageId)return;let u;this._listener[a.uri.toString()]=a.onDidChangeContent(()=>{window.clearTimeout(u),u=window.setTimeout(()=>this._doValidate(a.uri,o),500)}),this._doValidate(a.uri,o)},t=a=>{c.editor.setModelMarkers(a,this._languageId,[]);let o=a.uri.toString(),u=this._listener[o];u&&(u.dispose(),delete this._listener[o])};this._disposables.push(c.editor.onDidCreateModel(r)),this._disposables.push(c.editor.onWillDisposeModel(t)),this._disposables.push(c.editor.onDidChangeModelLanguage(a=>{t(a.model),r(a.model)})),this._disposables.push(i(a=>{c.editor.getModels().forEach(o=>{o.getLanguageId()===this._languageId&&(t(o),r(o))})})),this._disposables.push({dispose:()=>{c.editor.getModels().forEach(t);for(let a in this._listener)this._listener[a].dispose()}}),c.editor.getModels().forEach(r)}dispose(){this._disposables.forEach(e=>e&&e.dispose()),this._disposables.length=0}_doValidate(e,n){this._worker(e).then(i=>i.doValidation(e.toString())).then(i=>{const r=i.map(a=>rt(e,a));let t=c.editor.getModel(e);t&&t.getLanguageId()===n&&c.editor.setModelMarkers(t,n,r)}).then(void 0,i=>{console.error(i)})}};function tt(e){switch(e){case I.Error:return c.MarkerSeverity.Error;case I.Warning:return c.MarkerSeverity.Warning;case I.Information:return c.MarkerSeverity.Info;case I.Hint:return c.MarkerSeverity.Hint;default:return c.MarkerSeverity.Info}}function rt(e,n){let i=typeof n.code=="number"?String(n.code):n.code;return{severity:tt(n.severity),startLineNumber:n.range.start.line+1,startColumn:n.range.start.character+1,endLineNumber:n.range.end.line+1,endColumn:n.range.end.character+1,message:n.message,code:i,source:n.source}}var nt=class{constructor(e,n){this._worker=e,this._triggerCharacters=n}get triggerCharacters(){return this._triggerCharacters}provideCompletionItems(e,n,i,r){const t=e.uri;return this._worker(t).then(a=>a.doComplete(t.toString(),C(n))).then(a=>{if(!a)return;const o=e.getWordUntilPosition(n),u=new c.Range(n.lineNumber,o.startColumn,n.lineNumber,o.endColumn),f=a.items.map(d=>{const v={label:d.label,insertText:d.insertText||d.label,sortText:d.sortText,filterText:d.filterText,documentation:d.documentation,detail:d.detail,command:ot(d.command),range:u,kind:at(d.kind)};return d.textEdit&&(it(d.textEdit)?v.range={insert:_(d.textEdit.insert),replace:_(d.textEdit.replace)}:v.range=_(d.textEdit.range),v.insertText=d.textEdit.newText),d.additionalTextEdits&&(v.additionalTextEdits=d.additionalTextEdits.map(L)),d.insertTextFormat===Q.Snippet&&(v.insertTextRules=c.languages.CompletionItemInsertTextRule.InsertAsSnippet),v});return{isIncomplete:a.isIncomplete,suggestions:f}})}};function C(e){if(e)return{character:e.column-1,line:e.lineNumber-1}}function De(e){if(e)return{start:{line:e.startLineNumber-1,character:e.startColumn-1},end:{line:e.endLineNumber-1,character:e.endColumn-1}}}function _(e){if(e)return new c.Range(e.start.line+1,e.start.character+1,e.end.line+1,e.end.character+1)}function it(e){return typeof e.insert<"u"&&typeof e.replace<"u"}function at(e){const n=c.languages.CompletionItemKind;switch(e){case l.Text:return n.Text;case l.Method:return n.Method;case l.Function:return n.Function;case l.Constructor:return n.Constructor;case l.Field:return n.Field;case l.Variable:return n.Variable;case l.Class:return n.Class;case l.Interface:return n.Interface;case l.Module:return n.Module;case l.Property:return n.Property;case l.Unit:return n.Unit;case l.Value:return n.Value;case l.Enum:return n.Enum;case l.Keyword:return n.Keyword;case l.Snippet:return n.Snippet;case l.Color:return n.Color;case l.File:return n.File;case l.Reference:return n.Reference}return n.Property}function L(e){if(e)return{range:_(e.range),text:e.newText}}function ot(e){return e&&e.command==="editor.action.triggerSuggest"?{id:e.command,title:e.title,arguments:e.arguments}:void 0}var Me=class{constructor(e){this._worker=e}provideHover(e,n,i){let r=e.uri;return this._worker(r).then(t=>t.doHover(r.toString(),C(n))).then(t=>{if(t)return{range:_(t.range),contents:ut(t.contents)}})}};function st(e){return e&&typeof e=="object"&&typeof e.kind=="string"}function ye(e){return typeof e=="string"?{value:e}:st(e)?e.kind==="plaintext"?{value:e.value.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}:{value:e.value}:{value:"```"+e.language+` `+e.value+"\n```\n"}}function ut(e){if(e)return Array.isArray(e)?e.map(ye):[ye(e)]}var Se=class{constructor(e){this._worker=e}provideDocumentHighlights(e,n,i){const r=e.uri;return this._worker(r).then(t=>t.findDocumentHighlights(r.toString(),C(n))).then(t=>{if(t)return t.map(a=>({range:_(a.range),kind:ct(a.kind)}))})}};function ct(e){switch(e){case R.Read:return c.languages.DocumentHighlightKind.Read;case R.Write:return c.languages.DocumentHighlightKind.Write;case R.Text:return c.languages.DocumentHighlightKind.Text}return c.languages.DocumentHighlightKind.Text}var mt=class{constructor(e){this._worker=e}provideDefinition(e,n,i){const r=e.uri;return this._worker(r).then(t=>t.findDefinition(r.toString(),C(n))).then(t=>{if(t)return[Fe(t)]})}};function Fe(e){return{uri:c.Uri.parse(e.uri),range:_(e.range)}}var _t=class{constructor(e){this._worker=e}provideReferences(e,n,i,r){const t=e.uri;return this._worker(t).then(a=>a.findReferences(t.toString(),C(n))).then(a=>{if(a)return a.map(Fe)})}},Te=class{constructor(e){this._worker=e}provideRenameEdits(e,n,i,r){const t=e.uri;return this._worker(t).then(a=>a.doRename(t.toString(),C(n),i)).then(a=>dt(a))}};function dt(e){if(!e||!e.changes)return;let n=[];for(let i in e.changes){const r=c.Uri.parse(i);for(let t of e.changes[i])n.push({resource:r,versionId:void 0,textEdit:{range:_(t.range),text:t.newText}})}return{edits:n}}var Le=class{constructor(e){this._worker=e}provideDocumentSymbols(e,n){const i=e.uri;return this._worker(i).then(r=>r.findDocumentSymbols(i.toString())).then(r=>{if(r)return r.map(t=>gt(t)?je(t):{name:t.name,detail:"",containerName:t.containerName,kind:Ne(t.kind),range:_(t.location.range),selectionRange:_(t.location.range),tags:[]})})}};function gt(e){return"children"in e}function je(e){return{name:e.name,detail:e.detail??"",kind:Ne(e.kind),range:_(e.range),selectionRange:_(e.selectionRange),tags:e.tags??[],children:(e.children??[]).map(n=>je(n))}}function Ne(e){let n=c.languages.SymbolKind;switch(e){case h.File:return n.File;case h.Module:return n.Module;case h.Namespace:return n.Namespace;case h.Package:return n.Package;case h.Class:return n.Class;case h.Method:return n.Method;case h.Property:return n.Property;case h.Field:return n.Field;case h.Constructor:return n.Constructor;case h.Enum:return n.Enum;case h.Interface:return n.Interface;case h.Function:return n.Function;case h.Variable:return n.Variable;case h.Constant:return n.Constant;case h.String:return n.String;case h.Number:return n.Number;case h.Boolean:return n.Boolean;case h.Array:return n.Array}return n.Function}var We=class{constructor(e){this._worker=e}provideLinks(e,n){const i=e.uri;return this._worker(i).then(r=>r.findDocumentLinks(i.toString())).then(r=>{if(r)return{links:r.map(t=>({range:_(t.range),url:t.target}))}})}},He=class{constructor(e){this._worker=e}provideDocumentFormattingEdits(e,n,i){const r=e.uri;return this._worker(r).then(t=>t.format(r.toString(),null,Ue(n)).then(a=>{if(!(!a||a.length===0))return a.map(L)}))}},Oe=class{constructor(e){this._worker=e,this.canFormatMultipleRanges=!1}provideDocumentRangeFormattingEdits(e,n,i,r){const t=e.uri;return this._worker(t).then(a=>a.format(t.toString(),De(n),Ue(i)).then(o=>{if(!(!o||o.length===0))return o.map(L)}))}};function Ue(e){return{tabSize:e.tabSize,insertSpaces:e.insertSpaces}}var wt=class{constructor(e){this._worker=e}provideDocumentColors(e,n){const i=e.uri;return this._worker(i).then(r=>r.findDocumentColors(i.toString())).then(r=>{if(r)return r.map(t=>({color:t.color,range:_(t.range)}))})}provideColorPresentations(e,n,i){const r=e.uri;return this._worker(r).then(t=>t.getColorPresentations(r.toString(),n.color,De(n.range))).then(t=>{if(t)return t.map(a=>{let o={label:a.label};return a.textEdit&&(o.textEdit=L(a.textEdit)),a.additionalTextEdits&&(o.additionalTextEdits=a.additionalTextEdits.map(L)),o})})}},Ve=class{constructor(e){this._worker=e}provideFoldingRanges(e,n,i){const r=e.uri;return this._worker(r).then(t=>t.getFoldingRanges(r.toString(),n)).then(t=>{if(t)return t.map(a=>{const o={start:a.startLine+1,end:a.endLine+1};return typeof a.kind<"u"&&(o.kind=ft(a.kind)),o})})}};function ft(e){switch(e){case P.Comment:return c.languages.FoldingRangeKind.Comment;case P.Imports:return c.languages.FoldingRangeKind.Imports;case P.Region:return c.languages.FoldingRangeKind.Region}}var ze=class{constructor(e){this._worker=e}provideSelectionRanges(e,n,i){const r=e.uri;return this._worker(r).then(t=>t.getSelectionRanges(r.toString(),n.map(C))).then(t=>{if(t)return t.map(a=>{const o=[];for(;a;)o.push({range:_(a.range)}),a=a.parent;return o})})}},Xe=class extends nt{constructor(e){super(e,[".",":","<",'"',"=","/"])}};function kt(e){const n=new Re(e),i=(...t)=>n.getLanguageServiceWorker(...t);let r=e.languageId;c.languages.registerCompletionItemProvider(r,new Xe(i)),c.languages.registerHoverProvider(r,new Me(i)),c.languages.registerDocumentHighlightProvider(r,new Se(i)),c.languages.registerLinkProvider(r,new We(i)),c.languages.registerFoldingRangeProvider(r,new Ve(i)),c.languages.registerDocumentSymbolProvider(r,new Le(i)),c.languages.registerSelectionRangeProvider(r,new ze(i)),c.languages.registerRenameProvider(r,new Te(i)),r==="html"&&(c.languages.registerDocumentFormattingEditProvider(r,new He(i)),c.languages.registerDocumentRangeFormattingEditProvider(r,new Oe(i)))}function Et(e){const n=[],i=[],r=new Re(e);n.push(r);const t=(...o)=>r.getLanguageServiceWorker(...o);function a(){const{languageId:o,modeConfiguration:u}=e;Be(i),u.completionItems&&i.push(c.languages.registerCompletionItemProvider(o,new Xe(t))),u.hovers&&i.push(c.languages.registerHoverProvider(o,new Me(t))),u.documentHighlights&&i.push(c.languages.registerDocumentHighlightProvider(o,new Se(t))),u.links&&i.push(c.languages.registerLinkProvider(o,new We(t))),u.documentSymbols&&i.push(c.languages.registerDocumentSymbolProvider(o,new Le(t))),u.rename&&i.push(c.languages.registerRenameProvider(o,new Te(t))),u.foldingRanges&&i.push(c.languages.registerFoldingRangeProvider(o,new Ve(t))),u.selectionRanges&&i.push(c.languages.registerSelectionRangeProvider(o,new ze(t))),u.documentFormattingEdits&&i.push(c.languages.registerDocumentFormattingEditProvider(o,new He(t))),u.documentRangeFormattingEdits&&i.push(c.languages.registerDocumentRangeFormattingEditProvider(o,new Oe(t)))}return a(),n.push(Pe(i)),Pe(n)}function Pe(e){return{dispose:()=>Be(e)}}function Be(e){for(;e.length;)e.pop().dispose()}export{nt as CompletionAdapter,mt as DefinitionAdapter,pt as DiagnosticsAdapter,wt as DocumentColorAdapter,He as DocumentFormattingEditProvider,Se as DocumentHighlightAdapter,We as DocumentLinkAdapter,Oe as DocumentRangeFormattingEditProvider,Le as DocumentSymbolAdapter,Ve as FoldingRangeAdapter,Me as HoverAdapter,_t as ReferenceAdapter,Te as RenameAdapter,ze as SelectionRangeAdapter,Re as WorkerManager,C as fromPosition,De as fromRange,Et as setupMode,kt as setupMode1,_ as toRange,L as toTextEdit}; ================================================ FILE: backend/openui/dist/assets/index-B7PjGjI7.js ================================================ var cE=Object.defineProperty;var ug=e=>{throw TypeError(e)};var fE=(e,t,n)=>t in e?cE(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var ln=(e,t,n)=>fE(e,typeof t!="symbol"?t+"":t,n),pf=(e,t,n)=>t.has(e)||ug("Cannot "+n);var D=(e,t,n)=>(pf(e,t,"read from private field"),n?n.call(e):t.get(e)),Se=(e,t,n)=>t.has(e)?ug("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),ue=(e,t,n,r)=>(pf(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),St=(e,t,n)=>(pf(e,t,"access private method"),n);var bl=(e,t,n,r)=>({set _(i){ue(e,t,i,n)},get _(){return D(e,t,r)}});function $w(e,t){for(var n=0;nr[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();function rp(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var jw={exports:{}},gc={},zw={exports:{}},ge={};/** * @license React * react.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var el=Symbol.for("react.element"),dE=Symbol.for("react.portal"),hE=Symbol.for("react.fragment"),pE=Symbol.for("react.strict_mode"),mE=Symbol.for("react.profiler"),gE=Symbol.for("react.provider"),yE=Symbol.for("react.context"),vE=Symbol.for("react.forward_ref"),wE=Symbol.for("react.suspense"),xE=Symbol.for("react.memo"),SE=Symbol.for("react.lazy"),cg=Symbol.iterator;function bE(e){return e===null||typeof e!="object"?null:(e=cg&&e[cg]||e["@@iterator"],typeof e=="function"?e:null)}var Uw={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Bw=Object.assign,Hw={};function wo(e,t,n){this.props=e,this.context=t,this.refs=Hw,this.updater=n||Uw}wo.prototype.isReactComponent={};wo.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};wo.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Vw(){}Vw.prototype=wo.prototype;function ip(e,t,n){this.props=e,this.context=t,this.refs=Hw,this.updater=n||Uw}var sp=ip.prototype=new Vw;sp.constructor=ip;Bw(sp,wo.prototype);sp.isPureReactComponent=!0;var fg=Array.isArray,Ww=Object.prototype.hasOwnProperty,op={current:null},Qw={key:!0,ref:!0,__self:!0,__source:!0};function Kw(e,t,n){var r,i={},s=null,o=null;if(t!=null)for(r in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(s=""+t.key),t)Ww.call(t,r)&&!Qw.hasOwnProperty(r)&&(i[r]=t[r]);var a=arguments.length-2;if(a===1)i.children=n;else if(1{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},vc=typeof window>"u"||"Deno"in globalThis;function _n(){}function LE(e,t){return typeof e=="function"?e(t):e}function ME(e){return typeof e=="number"&&e>=0&&e!==1/0}function NE(e,t){return Math.max(e+(t||0)-Date.now(),0)}function hg(e,t){return typeof e=="function"?e(t):e}function FE(e,t){return typeof e=="function"?e(t):e}function pg(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:s,queryKey:o,stale:a}=e;if(o){if(r){if(t.queryHash!==lp(o,t.options))return!1}else if(!Ca(t.queryKey,o))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||i&&i!==t.state.fetchStatus||s&&!s(t))}function mg(e,t){const{exact:n,status:r,predicate:i,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(n){if(_a(t.options.mutationKey)!==_a(s))return!1}else if(!Ca(t.options.mutationKey,s))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function lp(e,t){return((t==null?void 0:t.queryKeyHashFn)||_a)(e)}function _a(e){return JSON.stringify(e,(t,n)=>Cd(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function Ca(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Ca(e[n],t[n])):!1}function Xw(e,t){if(e===t)return e;const n=gg(e)&&gg(t);if(n||Cd(e)&&Cd(t)){const r=n?e:Object.keys(e),i=r.length,s=n?t:Object.keys(t),o=s.length,a=n?[]:{};let l=0;for(let u=0;u{setTimeout(t,e)})}function $E(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?Xw(e,t):t}function jE(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function zE(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var up=Symbol();function Yw(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===up?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var Bi,Xr,Xs,Tw,UE=(Tw=class extends yc{constructor(){super();Se(this,Bi);Se(this,Xr);Se(this,Xs);ue(this,Xs,t=>{if(!vc&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){D(this,Xr)||this.setEventListener(D(this,Xs))}onUnsubscribe(){var t;this.hasListeners()||((t=D(this,Xr))==null||t.call(this),ue(this,Xr,void 0))}setEventListener(t){var n;ue(this,Xs,t),(n=D(this,Xr))==null||n.call(this),ue(this,Xr,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){D(this,Bi)!==t&&(ue(this,Bi,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof D(this,Bi)=="boolean"?D(this,Bi):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Bi=new WeakMap,Xr=new WeakMap,Xs=new WeakMap,Tw),Zw=new UE,Ys,Yr,Zs,Ow,BE=(Ow=class extends yc{constructor(){super();Se(this,Ys,!0);Se(this,Yr);Se(this,Zs);ue(this,Zs,t=>{if(!vc&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){D(this,Yr)||this.setEventListener(D(this,Zs))}onUnsubscribe(){var t;this.hasListeners()||((t=D(this,Yr))==null||t.call(this),ue(this,Yr,void 0))}setEventListener(t){var n;ue(this,Zs,t),(n=D(this,Yr))==null||n.call(this),ue(this,Yr,t(this.setOnline.bind(this)))}setOnline(t){D(this,Ys)!==t&&(ue(this,Ys,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return D(this,Ys)}},Ys=new WeakMap,Yr=new WeakMap,Zs=new WeakMap,Ow),ku=new BE;function HE(){let e,t;const n=new Promise((i,s)=>{e=i,t=s});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),e(i)},n.reject=i=>{r({status:"rejected",reason:i}),t(i)},n}function VE(e){return Math.min(1e3*2**e,3e4)}function e0(e){return(e??"online")==="online"?ku.isOnline():!0}var t0=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function gf(e){return e instanceof t0}function n0(e){let t=!1,n=0,r=!1,i;const s=HE(),o=v=>{var x;r||(d(new t0(v)),(x=e.abort)==null||x.call(e))},a=()=>{t=!0},l=()=>{t=!1},u=()=>Zw.isFocused()&&(e.networkMode==="always"||ku.isOnline())&&e.canRun(),f=()=>e0(e.networkMode)&&e.canRun(),c=v=>{var x;r||(r=!0,(x=e.onSuccess)==null||x.call(e,v),i==null||i(),s.resolve(v))},d=v=>{var x;r||(r=!0,(x=e.onError)==null||x.call(e,v),i==null||i(),s.reject(v))},h=()=>new Promise(v=>{var x;i=m=>{(r||u())&&v(m)},(x=e.onPause)==null||x.call(e)}).then(()=>{var v;i=void 0,r||(v=e.onContinue)==null||v.call(e)}),g=()=>{if(r)return;let v;const x=n===0?e.initialPromise:void 0;try{v=x??e.fn()}catch(m){v=Promise.reject(m)}Promise.resolve(v).then(c).catch(m=>{var E;if(r)return;const p=e.retry??(vc?0:3),w=e.retryDelay??VE,S=typeof w=="function"?w(n,m):w,k=p===!0||typeof p=="number"&&nu()?void 0:h()).then(()=>{t?d(m):g()})})};return{promise:s,cancel:o,continue:()=>(i==null||i(),s),cancelRetry:a,continueRetry:l,canStart:f,start:()=>(f()?g():h().then(g),s)}}var WE=e=>setTimeout(e,0);function QE(){let e=[],t=0,n=a=>{a()},r=a=>{a()},i=WE;const s=a=>{t?e.push(a):i(()=>{n(a)})},o=()=>{const a=e;e=[],a.length&&i(()=>{r(()=>{a.forEach(l=>{n(l)})})})};return{batch:a=>{let l;t++;try{l=a()}finally{t--,t||o()}return l},batchCalls:a=>(...l)=>{s(()=>{a(...l)})},schedule:s,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{i=a}}}var It=QE(),Hi,Iw,r0=(Iw=class{constructor(){Se(this,Hi)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),ME(this.gcTime)&&ue(this,Hi,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(vc?1/0:5*60*1e3))}clearGcTimeout(){D(this,Hi)&&(clearTimeout(D(this,Hi)),ue(this,Hi,void 0))}},Hi=new WeakMap,Iw),eo,to,un,Vi,Ct,Ya,Wi,Pn,vr,Lw,KE=(Lw=class extends r0{constructor(t){super();Se(this,Pn);Se(this,eo);Se(this,to);Se(this,un);Se(this,Vi);Se(this,Ct);Se(this,Ya);Se(this,Wi);ue(this,Wi,!1),ue(this,Ya,t.defaultOptions),this.setOptions(t.options),this.observers=[],ue(this,Vi,t.client),ue(this,un,D(this,Vi).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,ue(this,eo,JE(this.options)),this.state=t.state??D(this,eo),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=D(this,Ct))==null?void 0:t.promise}setOptions(t){this.options={...D(this,Ya),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&D(this,un).remove(this)}setData(t,n){const r=$E(this.state.data,t,this.options);return St(this,Pn,vr).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){St(this,Pn,vr).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,i;const n=(r=D(this,Ct))==null?void 0:r.promise;return(i=D(this,Ct))==null||i.cancel(t),n?n.then(_n).catch(_n):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(D(this,eo))}isActive(){return this.observers.some(t=>FE(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===up||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(t=0){return this.state.isInvalidated||this.state.data===void 0||!NE(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=D(this,Ct))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=D(this,Ct))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),D(this,un).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(D(this,Ct)&&(D(this,Wi)?D(this,Ct).cancel({revert:!0}):D(this,Ct).cancelRetry()),this.scheduleGc()),D(this,un).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||St(this,Pn,vr).call(this,{type:"invalidate"})}fetch(t,n){var l,u,f;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(D(this,Ct))return D(this,Ct).continueRetry(),D(this,Ct).promise}if(t&&this.setOptions(t),!this.options.queryFn){const c=this.observers.find(d=>d.options.queryFn);c&&this.setOptions(c.options)}const r=new AbortController,i=c=>{Object.defineProperty(c,"signal",{enumerable:!0,get:()=>(ue(this,Wi,!0),r.signal)})},s=()=>{const c=Yw(this.options,n),d={client:D(this,Vi),queryKey:this.queryKey,meta:this.meta};return i(d),ue(this,Wi,!1),this.options.persister?this.options.persister(c,d,this):c(d)},o={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:D(this,Vi),state:this.state,fetchFn:s};i(o),(l=this.options.behavior)==null||l.onFetch(o,this),ue(this,to,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((u=o.fetchOptions)==null?void 0:u.meta))&&St(this,Pn,vr).call(this,{type:"fetch",meta:(f=o.fetchOptions)==null?void 0:f.meta});const a=c=>{var d,h,g,v;gf(c)&&c.silent||St(this,Pn,vr).call(this,{type:"error",error:c}),gf(c)||((h=(d=D(this,un).config).onError)==null||h.call(d,c,this),(v=(g=D(this,un).config).onSettled)==null||v.call(g,this.state.data,c,this)),this.scheduleGc()};return ue(this,Ct,n0({initialPromise:n==null?void 0:n.initialPromise,fn:o.fetchFn,abort:r.abort.bind(r),onSuccess:c=>{var d,h,g,v;if(c===void 0){a(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(c)}catch(x){a(x);return}(h=(d=D(this,un).config).onSuccess)==null||h.call(d,c,this),(v=(g=D(this,un).config).onSettled)==null||v.call(g,c,this.state.error,this),this.scheduleGc()},onError:a,onFail:(c,d)=>{St(this,Pn,vr).call(this,{type:"failed",failureCount:c,error:d})},onPause:()=>{St(this,Pn,vr).call(this,{type:"pause"})},onContinue:()=>{St(this,Pn,vr).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0})),D(this,Ct).start()}},eo=new WeakMap,to=new WeakMap,un=new WeakMap,Vi=new WeakMap,Ct=new WeakMap,Ya=new WeakMap,Wi=new WeakMap,Pn=new WeakSet,vr=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...qE(r.data,this.options),fetchMeta:t.meta??null};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const i=t.error;return gf(i)&&i.revert&&D(this,to)?{...D(this,to),fetchStatus:"idle"}:{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),It.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),D(this,un).notify({query:this,type:"updated",action:t})})},Lw);function qE(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:e0(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function JE(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Jn,Mw,GE=(Mw=class extends yc{constructor(t={}){super();Se(this,Jn);this.config=t,ue(this,Jn,new Map)}build(t,n,r){const i=n.queryKey,s=n.queryHash??lp(i,n);let o=this.get(s);return o||(o=new KE({client:t,queryKey:i,queryHash:s,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(i)}),this.add(o)),o}add(t){D(this,Jn).has(t.queryHash)||(D(this,Jn).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=D(this,Jn).get(t.queryHash);n&&(t.destroy(),n===t&&D(this,Jn).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){It.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return D(this,Jn).get(t)}getAll(){return[...D(this,Jn).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>pg(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>pg(t,r)):n}notify(t){It.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){It.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){It.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Jn=new WeakMap,Mw),Gn,Tt,Qi,Xn,Wr,Nw,XE=(Nw=class extends r0{constructor(t){super();Se(this,Xn);Se(this,Gn);Se(this,Tt);Se(this,Qi);this.mutationId=t.mutationId,ue(this,Tt,t.mutationCache),ue(this,Gn,[]),this.state=t.state||YE(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){D(this,Gn).includes(t)||(D(this,Gn).push(t),this.clearGcTimeout(),D(this,Tt).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){ue(this,Gn,D(this,Gn).filter(n=>n!==t)),this.scheduleGc(),D(this,Tt).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){D(this,Gn).length||(this.state.status==="pending"?this.scheduleGc():D(this,Tt).remove(this))}continue(){var t;return((t=D(this,Qi))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var s,o,a,l,u,f,c,d,h,g,v,x,m,p,w,S,k,E,y,R;const n=()=>{St(this,Xn,Wr).call(this,{type:"continue"})};ue(this,Qi,n0({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(T,A)=>{St(this,Xn,Wr).call(this,{type:"failed",failureCount:T,error:A})},onPause:()=>{St(this,Xn,Wr).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>D(this,Tt).canRun(this)}));const r=this.state.status==="pending",i=!D(this,Qi).canStart();try{if(r)n();else{St(this,Xn,Wr).call(this,{type:"pending",variables:t,isPaused:i}),await((o=(s=D(this,Tt).config).onMutate)==null?void 0:o.call(s,t,this));const A=await((l=(a=this.options).onMutate)==null?void 0:l.call(a,t));A!==this.state.context&&St(this,Xn,Wr).call(this,{type:"pending",context:A,variables:t,isPaused:i})}const T=await D(this,Qi).start();return await((f=(u=D(this,Tt).config).onSuccess)==null?void 0:f.call(u,T,t,this.state.context,this)),await((d=(c=this.options).onSuccess)==null?void 0:d.call(c,T,t,this.state.context)),await((g=(h=D(this,Tt).config).onSettled)==null?void 0:g.call(h,T,null,this.state.variables,this.state.context,this)),await((x=(v=this.options).onSettled)==null?void 0:x.call(v,T,null,t,this.state.context)),St(this,Xn,Wr).call(this,{type:"success",data:T}),T}catch(T){try{throw await((p=(m=D(this,Tt).config).onError)==null?void 0:p.call(m,T,t,this.state.context,this)),await((S=(w=this.options).onError)==null?void 0:S.call(w,T,t,this.state.context)),await((E=(k=D(this,Tt).config).onSettled)==null?void 0:E.call(k,void 0,T,this.state.variables,this.state.context,this)),await((R=(y=this.options).onSettled)==null?void 0:R.call(y,void 0,T,t,this.state.context)),T}finally{St(this,Xn,Wr).call(this,{type:"error",error:T})}}finally{D(this,Tt).runNext(this)}}},Gn=new WeakMap,Tt=new WeakMap,Qi=new WeakMap,Xn=new WeakSet,Wr=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),It.batch(()=>{D(this,Gn).forEach(r=>{r.onMutationUpdate(t)}),D(this,Tt).notify({mutation:this,type:"updated",action:t})})},Nw);function YE(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Er,Rn,Za,Fw,ZE=(Fw=class extends yc{constructor(t={}){super();Se(this,Er);Se(this,Rn);Se(this,Za);this.config=t,ue(this,Er,new Set),ue(this,Rn,new Map),ue(this,Za,0)}build(t,n,r){const i=new XE({mutationCache:this,mutationId:++bl(this,Za)._,options:t.defaultMutationOptions(n),state:r});return this.add(i),i}add(t){D(this,Er).add(t);const n=_l(t);if(typeof n=="string"){const r=D(this,Rn).get(n);r?r.push(t):D(this,Rn).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(D(this,Er).delete(t)){const n=_l(t);if(typeof n=="string"){const r=D(this,Rn).get(n);if(r)if(r.length>1){const i=r.indexOf(t);i!==-1&&r.splice(i,1)}else r[0]===t&&D(this,Rn).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=_l(t);if(typeof n=="string"){const r=D(this,Rn).get(n),i=r==null?void 0:r.find(s=>s.state.status==="pending");return!i||i===t}else return!0}runNext(t){var r;const n=_l(t);if(typeof n=="string"){const i=(r=D(this,Rn).get(n))==null?void 0:r.find(s=>s!==t&&s.state.isPaused);return(i==null?void 0:i.continue())??Promise.resolve()}else return Promise.resolve()}clear(){It.batch(()=>{D(this,Er).forEach(t=>{this.notify({type:"removed",mutation:t})}),D(this,Er).clear(),D(this,Rn).clear()})}getAll(){return Array.from(D(this,Er))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>mg(n,r))}findAll(t={}){return this.getAll().filter(n=>mg(t,n))}notify(t){It.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return It.batch(()=>Promise.all(t.map(n=>n.continue().catch(_n))))}},Er=new WeakMap,Rn=new WeakMap,Za=new WeakMap,Fw);function _l(e){var t;return(t=e.options.scope)==null?void 0:t.id}function vg(e){return{onFetch:(t,n)=>{var f,c,d,h,g;const r=t.options,i=(d=(c=(f=t.fetchOptions)==null?void 0:f.meta)==null?void 0:c.fetchMore)==null?void 0:d.direction,s=((h=t.state.data)==null?void 0:h.pages)||[],o=((g=t.state.data)==null?void 0:g.pageParams)||[];let a={pages:[],pageParams:[]},l=0;const u=async()=>{let v=!1;const x=w=>{Object.defineProperty(w,"signal",{enumerable:!0,get:()=>(t.signal.aborted?v=!0:t.signal.addEventListener("abort",()=>{v=!0}),t.signal)})},m=Yw(t.options,t.fetchOptions),p=async(w,S,k)=>{if(v)return Promise.reject();if(S==null&&w.pages.length)return Promise.resolve(w);const E={client:t.client,queryKey:t.queryKey,pageParam:S,direction:k?"backward":"forward",meta:t.options.meta};x(E);const y=await m(E),{maxPages:R}=t.options,T=k?zE:jE;return{pages:T(w.pages,y,R),pageParams:T(w.pageParams,S,R)}};if(i&&s.length){const w=i==="backward",S=w?e_:wg,k={pages:s,pageParams:o},E=S(r,k);a=await p(k,E,w)}else{const w=e??s.length;do{const S=l===0?o[0]??r.initialPageParam:wg(r,a);if(l>0&&S==null)break;a=await p(a,S),l++}while(l{var v,x;return(x=(v=t.options).persister)==null?void 0:x.call(v,u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=u}}}function wg(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function e_(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var We,Zr,ei,no,ro,ti,io,so,Dw,t_=(Dw=class{constructor(e={}){Se(this,We);Se(this,Zr);Se(this,ei);Se(this,no);Se(this,ro);Se(this,ti);Se(this,io);Se(this,so);ue(this,We,e.queryCache||new GE),ue(this,Zr,e.mutationCache||new ZE),ue(this,ei,e.defaultOptions||{}),ue(this,no,new Map),ue(this,ro,new Map),ue(this,ti,0)}mount(){bl(this,ti)._++,D(this,ti)===1&&(ue(this,io,Zw.subscribe(async e=>{e&&(await this.resumePausedMutations(),D(this,We).onFocus())})),ue(this,so,ku.subscribe(async e=>{e&&(await this.resumePausedMutations(),D(this,We).onOnline())})))}unmount(){var e,t;bl(this,ti)._--,D(this,ti)===0&&((e=D(this,io))==null||e.call(this),ue(this,io,void 0),(t=D(this,so))==null||t.call(this),ue(this,so,void 0))}isFetching(e){return D(this,We).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return D(this,Zr).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=D(this,We).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=D(this,We).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(hg(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return D(this,We).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),i=D(this,We).get(r.queryHash),s=i==null?void 0:i.state.data,o=LE(t,s);if(o!==void 0)return D(this,We).build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return It.batch(()=>D(this,We).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=D(this,We).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=D(this,We);It.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=D(this,We);return It.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=It.batch(()=>D(this,We).findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(_n).catch(_n)}invalidateQueries(e,t={}){return It.batch(()=>(D(this,We).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=It.batch(()=>D(this,We).findAll(e).filter(i=>!i.isDisabled()).map(i=>{let s=i.fetch(void 0,n);return n.throwOnError||(s=s.catch(_n)),i.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(_n)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=D(this,We).build(this,t);return n.isStaleByTime(hg(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(_n).catch(_n)}fetchInfiniteQuery(e){return e.behavior=vg(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(_n).catch(_n)}ensureInfiniteQueryData(e){return e.behavior=vg(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return ku.isOnline()?D(this,Zr).resumePausedMutations():Promise.resolve()}getQueryCache(){return D(this,We)}getMutationCache(){return D(this,Zr)}getDefaultOptions(){return D(this,ei)}setDefaultOptions(e){ue(this,ei,e)}setQueryDefaults(e,t){D(this,no).set(_a(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...D(this,no).values()],n={};return t.forEach(r=>{Ca(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){D(this,ro).set(_a(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...D(this,ro).values()],n={};return t.forEach(r=>{Ca(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...D(this,ei).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=lp(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===up&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...D(this,ei).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){D(this,We).clear(),D(this,Zr).clear()}},We=new WeakMap,Zr=new WeakMap,ei=new WeakMap,no=new WeakMap,ro=new WeakMap,ti=new WeakMap,io=new WeakMap,so=new WeakMap,Dw),i0=_.createContext(void 0),w2=e=>{const t=_.useContext(i0);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},n_=({client:e,children:t})=>(_.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),Y.jsx(i0.Provider,{value:e,children:t}));const r_="modulepreload",i_=function(e){return"/"+e},xg={},s_=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),a=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));i=Promise.allSettled(n.map(l=>{if(l=i_(l),l in xg)return;xg[l]=!0;const u=l.endsWith(".css"),f=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${f}`))return;const c=document.createElement("link");if(c.rel=u?"stylesheet":r_,u||(c.as="script"),c.crossOrigin="",c.href=l,a&&c.setAttribute("nonce",a),document.head.appendChild(c),u)return new Promise((d,h)=>{c.addEventListener("load",d),c.addEventListener("error",()=>h(new Error(`Unable to preload CSS for ${l}`)))})}))}function s(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return i.then(o=>{for(const a of o||[])a.status==="rejected"&&s(a.reason);return t().catch(s)})};globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(e,t){return this.cache.has(e)?this.cache.get(e):(this.cache.set(e,t),t)}};class s0 extends Ki.Component{constructor(){super(...arguments);ln(this,"state",{error:void 0})}static getDerivedStateFromError(n){return{error:n}}componentDidCatch(n,r){console.error("Encountered ErrorBoundary:",n,r);const{onError:i}=this.props;i==null||i(n)}render(){const{error:n}=this.state;if(n!==void 0){const{renderError:i}=this.props;return i(n)}const{children:r}=this.props;return r}}ln(s0,"defaultProps",{children:void 0,onError:void 0});globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(e,t){return this.cache.has(e)?this.cache.get(e):(this.cache.set(e,t),t)}};function Sg({error:e}){return Y.jsxs("div",{className:"flex min-h-screen flex-col items-center justify-center",children:[Y.jsx("h1",{className:"text-xl","data-testid":"LoadingOrError",children:e?e.message:Y.jsx("div",{role:"status",className:"h-16 w-16 animate-spin rounded-full bg-gradient-to-r from-purple-500 via-pink-500 to-red-500"})}),e?Y.jsx("a",{href:"/",className:"mt-5 text-lg text-blue-500 underline",onClick:t=>{t.preventDefault(),document.location.reload()},children:"Reload"}):void 0]})}function Sr(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function bg(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function o0(...e){return t=>{let n=!1;const r=e.map(i=>{const s=bg(i,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let i=0;i{const{children:o,...a}=s,l=_.useMemo(()=>a,Object.values(a));return Y.jsx(n.Provider,{value:l,children:o})};r.displayName=e+"Provider";function i(s){const o=_.useContext(n);if(o)return o;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[r,i]}function a0(e,t=[]){let n=[];function r(s,o){const a=_.createContext(o),l=n.length;n=[...n,o];const u=c=>{var m;const{scope:d,children:h,...g}=c,v=((m=d==null?void 0:d[e])==null?void 0:m[l])||a,x=_.useMemo(()=>g,Object.values(g));return Y.jsx(v.Provider,{value:x,children:h})};u.displayName=s+"Provider";function f(c,d){var v;const h=((v=d==null?void 0:d[e])==null?void 0:v[l])||a,g=_.useContext(h);if(g)return g;if(o!==void 0)return o;throw new Error(`\`${c}\` must be used within \`${s}\``)}return[u,f]}const i=()=>{const s=n.map(o=>_.createContext(o));return function(a){const l=(a==null?void 0:a[e])||s;return _.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return i.scopeName=e,[r,o_(i,...t)]}function o_(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(s){const o=r.reduce((a,{useScope:l,scopeName:u})=>{const c=l(s)[`__scope${u}`];return{...a,...c}},{});return _.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}var l0={exports:{}},rn={},u0={exports:{}},c0={};/** * @license React * scheduler.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */(function(e){function t(M,U){var b=M.length;M.push(U);e:for(;0>>1,pe=M[Z];if(0>>1;Zi(Le,b))yei(qe,Le)?(M[Z]=qe,M[ye]=b,Z=ye):(M[Z]=Le,M[Ae]=b,Z=Ae);else if(yei(qe,b))M[Z]=qe,M[ye]=b,Z=ye;else break e}}return U}function i(M,U){var b=M.sortIndex-U.sortIndex;return b!==0?b:M.id-U.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();e.unstable_now=function(){return o.now()-a}}var l=[],u=[],f=1,c=null,d=3,h=!1,g=!1,v=!1,x=typeof setTimeout=="function"?setTimeout:null,m=typeof clearTimeout=="function"?clearTimeout:null,p=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(M){for(var U=n(u);U!==null;){if(U.callback===null)r(u);else if(U.startTime<=M)r(u),U.sortIndex=U.expirationTime,t(l,U);else break;U=n(u)}}function S(M){if(v=!1,w(M),!g)if(n(l)!==null)g=!0,G(k);else{var U=n(u);U!==null&&Q(S,U.startTime-M)}}function k(M,U){g=!1,v&&(v=!1,m(R),R=-1),h=!0;var b=d;try{for(w(U),c=n(l);c!==null&&(!(c.expirationTime>U)||M&&!O());){var Z=c.callback;if(typeof Z=="function"){c.callback=null,d=c.priorityLevel;var pe=Z(c.expirationTime<=U);U=e.unstable_now(),typeof pe=="function"?c.callback=pe:c===n(l)&&r(l),w(U)}else r(l);c=n(l)}if(c!==null)var C=!0;else{var Ae=n(u);Ae!==null&&Q(S,Ae.startTime-U),C=!1}return C}finally{c=null,d=b,h=!1}}var E=!1,y=null,R=-1,T=5,A=-1;function O(){return!(e.unstable_now()-AM||125Z?(M.sortIndex=b,t(u,M),n(l)===null&&M===n(u)&&(v?(m(R),R=-1):v=!0,Q(S,b-Z))):(M.sortIndex=pe,t(l,M),g||h||(g=!0,G(k))),M},e.unstable_shouldYield=O,e.unstable_wrapCallback=function(M){var U=d;return function(){var b=d;d=U;try{return M.apply(this,arguments)}finally{d=b}}}})(c0);u0.exports=c0;var a_=u0.exports;/** * @license React * react-dom.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var l_=_,nn=a_;function j(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),kd=Object.prototype.hasOwnProperty,u_=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,Eg={},_g={};function c_(e){return kd.call(_g,e)?!0:kd.call(Eg,e)?!1:u_.test(e)?_g[e]=!0:(Eg[e]=!0,!1)}function f_(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function d_(e,t,n,r){if(t===null||typeof t>"u"||f_(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Nt(e,t,n,r,i,s,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=s,this.removeEmptyString=o}var pt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){pt[e]=new Nt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];pt[t]=new Nt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){pt[e]=new Nt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){pt[e]=new Nt(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){pt[e]=new Nt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){pt[e]=new Nt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){pt[e]=new Nt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){pt[e]=new Nt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){pt[e]=new Nt(e,5,!1,e.toLowerCase(),null,!1,!1)});var cp=/[\-:]([a-z])/g;function fp(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(cp,fp);pt[t]=new Nt(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(cp,fp);pt[t]=new Nt(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(cp,fp);pt[t]=new Nt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){pt[e]=new Nt(e,1,!1,e.toLowerCase(),null,!1,!1)});pt.xlinkHref=new Nt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){pt[e]=new Nt(e,1,!1,e.toLowerCase(),null,!0,!0)});function dp(e,t,n,r){var i=pt.hasOwnProperty(t)?pt[t]:null;(i!==null?i.type!==0:r||!(2a||i[o]!==s[a]){var l=` `+i[o].replace(" at new "," at ");return e.displayName&&l.includes("")&&(l=l.replace("",e.displayName)),l}while(1<=o&&0<=a);break}}}finally{vf=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Xo(e):""}function h_(e){switch(e.tag){case 5:return Xo(e.type);case 16:return Xo("Lazy");case 13:return Xo("Suspense");case 19:return Xo("SuspenseList");case 0:case 2:case 15:return e=wf(e.type,!1),e;case 11:return e=wf(e.type.render,!1),e;case 1:return e=wf(e.type,!0),e;default:return""}}function Td(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Ps:return"Fragment";case ks:return"Portal";case Pd:return"Profiler";case hp:return"StrictMode";case Rd:return"Suspense";case Ad:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case h0:return(e.displayName||"Context")+".Consumer";case d0:return(e._context.displayName||"Context")+".Provider";case pp:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case mp:return t=e.displayName||null,t!==null?t:Td(e.type)||"Memo";case Kr:t=e._payload,e=e._init;try{return Td(e(t))}catch{}}return null}function p_(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Td(t);case 8:return t===hp?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function pi(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function m0(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function m_(e){var t=m0(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,s=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(o){r=""+o,s.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function kl(e){e._valueTracker||(e._valueTracker=m_(e))}function g0(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=m0(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Pu(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Od(e,t){var n=t.checked;return Be({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function kg(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=pi(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function y0(e,t){t=t.checked,t!=null&&dp(e,"checked",t,!1)}function Id(e,t){y0(e,t);var n=pi(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Ld(e,t.type,n):t.hasOwnProperty("defaultValue")&&Ld(e,t.type,pi(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Pg(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Ld(e,t,n){(t!=="number"||Pu(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Yo=Array.isArray;function js(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=Pl.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Pa(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var ca={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},g_=["Webkit","ms","Moz","O"];Object.keys(ca).forEach(function(e){g_.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),ca[t]=ca[e]})});function S0(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||ca.hasOwnProperty(e)&&ca[e]?(""+t).trim():t+"px"}function b0(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=S0(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var y_=Be({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Fd(e,t){if(t){if(y_[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(j(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(j(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(j(61))}if(t.style!=null&&typeof t.style!="object")throw Error(j(62))}}function Dd(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var $d=null;function gp(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var jd=null,zs=null,Us=null;function Tg(e){if(e=rl(e)){if(typeof jd!="function")throw Error(j(280));var t=e.stateNode;t&&(t=Ec(t),jd(e.stateNode,e.type,t))}}function E0(e){zs?Us?Us.push(e):Us=[e]:zs=e}function _0(){if(zs){var e=zs,t=Us;if(Us=zs=null,Tg(e),t)for(e=0;e>>=0,e===0?32:31-(R_(e)/A_|0)|0}var Rl=64,Al=4194304;function Zo(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Ou(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,s=e.pingedLanes,o=n&268435455;if(o!==0){var a=o&~i;a!==0?r=Zo(a):(s&=o,s!==0&&(r=Zo(s)))}else o=n&~i,o!==0?r=Zo(o):s!==0&&(r=Zo(s));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,s=t&-t,i>=s||i===16&&(s&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function tl(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Mn(t),e[t]=n}function L_(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=da),jg=" ",zg=!1;function V0(e,t){switch(e){case"keyup":return aC.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function W0(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Rs=!1;function uC(e,t){switch(e){case"compositionend":return W0(t);case"keypress":return t.which!==32?null:(zg=!0,jg);case"textInput":return e=t.data,e===jg&&zg?null:e;default:return null}}function cC(e,t){if(Rs)return e==="compositionend"||!_p&&V0(e,t)?(e=B0(),ou=Sp=ni=null,Rs=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Vg(n)}}function J0(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?J0(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function G0(){for(var e=window,t=Pu();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Pu(e.document)}return t}function Cp(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function wC(e){var t=G0(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&J0(n.ownerDocument.documentElement,n)){if(r!==null&&Cp(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,s=Math.min(r.start,i);r=r.end===void 0?s:Math.min(r.end,i),!e.extend&&s>r&&(i=r,r=s,s=i),i=Wg(n,s);var o=Wg(n,r);i&&o&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),s>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,As=null,Wd=null,pa=null,Qd=!1;function Qg(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Qd||As==null||As!==Pu(r)||(r=As,"selectionStart"in r&&Cp(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),pa&&La(pa,r)||(pa=r,r=Mu(Wd,"onSelect"),0Is||(e.current=Yd[Is],Yd[Is]=null,Is--)}function Oe(e,t){Is++,Yd[Is]=e.current,e.current=t}var mi={},Pt=bi(mi),Bt=bi(!1),Gi=mi;function ao(e,t){var n=e.type.contextTypes;if(!n)return mi;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in n)i[s]=t[s];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function Ht(e){return e=e.childContextTypes,e!=null}function Fu(){Fe(Bt),Fe(Pt)}function Zg(e,t,n){if(Pt.current!==mi)throw Error(j(168));Oe(Pt,t),Oe(Bt,n)}function sx(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(j(108,p_(e)||"Unknown",i));return Be({},n,r)}function Du(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||mi,Gi=Pt.current,Oe(Pt,e),Oe(Bt,Bt.current),!0}function ey(e,t,n){var r=e.stateNode;if(!r)throw Error(j(169));n?(e=sx(e,t,Gi),r.__reactInternalMemoizedMergedChildContext=e,Fe(Bt),Fe(Pt),Oe(Pt,e)):Fe(Bt),Oe(Bt,n)}var br=null,_c=!1,Lf=!1;function ox(e){br===null?br=[e]:br.push(e)}function OC(e){_c=!0,ox(e)}function Ei(){if(!Lf&&br!==null){Lf=!0;var e=0,t=Pe;try{var n=br;for(Pe=1;e>=o,i-=o,_r=1<<32-Mn(t)+i|n<R?(T=y,y=null):T=y.sibling;var A=d(m,y,w[R],S);if(A===null){y===null&&(y=T);break}e&&y&&A.alternate===null&&t(m,y),p=s(A,p,R),E===null?k=A:E.sibling=A,E=A,y=T}if(R===w.length)return n(m,y),$e&&Ii(m,R),k;if(y===null){for(;RR?(T=y,y=null):T=y.sibling;var O=d(m,y,A.value,S);if(O===null){y===null&&(y=T);break}e&&y&&O.alternate===null&&t(m,y),p=s(O,p,R),E===null?k=O:E.sibling=O,E=O,y=T}if(A.done)return n(m,y),$e&&Ii(m,R),k;if(y===null){for(;!A.done;R++,A=w.next())A=c(m,A.value,S),A!==null&&(p=s(A,p,R),E===null?k=A:E.sibling=A,E=A);return $e&&Ii(m,R),k}for(y=r(m,y);!A.done;R++,A=w.next())A=h(y,m,R,A.value,S),A!==null&&(e&&A.alternate!==null&&y.delete(A.key===null?R:A.key),p=s(A,p,R),E===null?k=A:E.sibling=A,E=A);return e&&y.forEach(function(I){return t(m,I)}),$e&&Ii(m,R),k}function x(m,p,w,S){if(typeof w=="object"&&w!==null&&w.type===Ps&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case Cl:e:{for(var k=w.key,E=p;E!==null;){if(E.key===k){if(k=w.type,k===Ps){if(E.tag===7){n(m,E.sibling),p=i(E,w.props.children),p.return=m,m=p;break e}}else if(E.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===Kr&&ry(k)===E.type){n(m,E.sibling),p=i(E,w.props),p.ref=zo(m,E,w),p.return=m,m=p;break e}n(m,E);break}else t(m,E);E=E.sibling}w.type===Ps?(p=Ji(w.props.children,m.mode,S,w.key),p.return=m,m=p):(S=pu(w.type,w.key,w.props,null,m.mode,S),S.ref=zo(m,p,w),S.return=m,m=S)}return o(m);case ks:e:{for(E=w.key;p!==null;){if(p.key===E)if(p.tag===4&&p.stateNode.containerInfo===w.containerInfo&&p.stateNode.implementation===w.implementation){n(m,p.sibling),p=i(p,w.children||[]),p.return=m,m=p;break e}else{n(m,p);break}else t(m,p);p=p.sibling}p=Uf(w,m.mode,S),p.return=m,m=p}return o(m);case Kr:return E=w._init,x(m,p,E(w._payload),S)}if(Yo(w))return g(m,p,w,S);if(No(w))return v(m,p,w,S);Fl(m,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,p!==null&&p.tag===6?(n(m,p.sibling),p=i(p,w),p.return=m,m=p):(n(m,p),p=zf(w,m.mode,S),p.return=m,m=p),o(m)):n(m,p)}return x}var uo=cx(!0),fx=cx(!1),zu=bi(null),Uu=null,Ns=null,Ap=null;function Tp(){Ap=Ns=Uu=null}function Op(e){var t=zu.current;Fe(zu),e._currentValue=t}function th(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Hs(e,t){Uu=e,Ap=Ns=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Ut=!0),e.firstContext=null)}function gn(e){var t=e._currentValue;if(Ap!==e)if(e={context:e,memoizedValue:t,next:null},Ns===null){if(Uu===null)throw Error(j(308));Ns=e,Uu.dependencies={lanes:0,firstContext:e}}else Ns=Ns.next=e;return t}var $i=null;function Ip(e){$i===null?$i=[e]:$i.push(e)}function dx(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,Ip(t)):(n.next=i.next,i.next=n),t.interleaved=n,Ar(e,r)}function Ar(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var qr=!1;function Lp(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function hx(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function kr(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function ui(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,we&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,Ar(e,n)}return i=r.interleaved,i===null?(t.next=t,Ip(r)):(t.next=i.next,i.next=t),r.interleaved=t,Ar(e,n)}function lu(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,vp(e,n)}}function iy(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};s===null?i=s=o:s=s.next=o,n=n.next}while(n!==null);s===null?i=s=t:s=s.next=t}else i=s=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Bu(e,t,n,r){var i=e.updateQueue;qr=!1;var s=i.firstBaseUpdate,o=i.lastBaseUpdate,a=i.shared.pending;if(a!==null){i.shared.pending=null;var l=a,u=l.next;l.next=null,o===null?s=u:o.next=u,o=l;var f=e.alternate;f!==null&&(f=f.updateQueue,a=f.lastBaseUpdate,a!==o&&(a===null?f.firstBaseUpdate=u:a.next=u,f.lastBaseUpdate=l))}if(s!==null){var c=i.baseState;o=0,f=u=l=null,a=s;do{var d=a.lane,h=a.eventTime;if((r&d)===d){f!==null&&(f=f.next={eventTime:h,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var g=e,v=a;switch(d=t,h=n,v.tag){case 1:if(g=v.payload,typeof g=="function"){c=g.call(h,c,d);break e}c=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=v.payload,d=typeof g=="function"?g.call(h,c,d):g,d==null)break e;c=Be({},c,d);break e;case 2:qr=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,d=i.effects,d===null?i.effects=[a]:d.push(a))}else h={eventTime:h,lane:d,tag:a.tag,payload:a.payload,callback:a.callback,next:null},f===null?(u=f=h,l=c):f=f.next=h,o|=d;if(a=a.next,a===null){if(a=i.shared.pending,a===null)break;d=a,a=d.next,d.next=null,i.lastBaseUpdate=d,i.shared.pending=null}}while(!0);if(f===null&&(l=c),i.baseState=l,i.firstBaseUpdate=u,i.lastBaseUpdate=f,t=i.shared.interleaved,t!==null){i=t;do o|=i.lane,i=i.next;while(i!==t)}else s===null&&(i.shared.lanes=0);Zi|=o,e.lanes=o,e.memoizedState=c}}function sy(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=Nf.transition;Nf.transition={};try{e(!1),t()}finally{Pe=n,Nf.transition=r}}function Tx(){return yn().memoizedState}function NC(e,t,n){var r=fi(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Ox(e))Ix(t,n);else if(n=dx(e,t,n,r),n!==null){var i=Lt();Nn(n,e,r,i),Lx(n,t,r)}}function FC(e,t,n){var r=fi(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ox(e))Ix(t,i);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var o=t.lastRenderedState,a=s(o,n);if(i.hasEagerState=!0,i.eagerState=a,Fn(a,o)){var l=t.interleaved;l===null?(i.next=i,Ip(t)):(i.next=l.next,l.next=i),t.interleaved=i;return}}catch{}finally{}n=dx(e,t,i,r),n!==null&&(i=Lt(),Nn(n,e,r,i),Lx(n,t,r))}}function Ox(e){var t=e.alternate;return e===Ue||t!==null&&t===Ue}function Ix(e,t){ma=Vu=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Lx(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,vp(e,n)}}var Wu={readContext:gn,useCallback:bt,useContext:bt,useEffect:bt,useImperativeHandle:bt,useInsertionEffect:bt,useLayoutEffect:bt,useMemo:bt,useReducer:bt,useRef:bt,useState:bt,useDebugValue:bt,useDeferredValue:bt,useTransition:bt,useMutableSource:bt,useSyncExternalStore:bt,useId:bt,unstable_isNewReconciler:!1},DC={readContext:gn,useCallback:function(e,t){return Wn().memoizedState=[e,t===void 0?null:t],e},useContext:gn,useEffect:ay,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,cu(4194308,4,Cx.bind(null,t,e),n)},useLayoutEffect:function(e,t){return cu(4194308,4,e,t)},useInsertionEffect:function(e,t){return cu(4,2,e,t)},useMemo:function(e,t){var n=Wn();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Wn();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=NC.bind(null,Ue,e),[r.memoizedState,e]},useRef:function(e){var t=Wn();return e={current:e},t.memoizedState=e},useState:oy,useDebugValue:Up,useDeferredValue:function(e){return Wn().memoizedState=e},useTransition:function(){var e=oy(!1),t=e[0];return e=MC.bind(null,e[1]),Wn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Ue,i=Wn();if($e){if(n===void 0)throw Error(j(407));n=n()}else{if(n=t(),lt===null)throw Error(j(349));Yi&30||yx(r,t,n)}i.memoizedState=n;var s={value:n,getSnapshot:t};return i.queue=s,ay(wx.bind(null,r,s,e),[e]),r.flags|=2048,Ua(9,vx.bind(null,r,s,n,t),void 0,null),n},useId:function(){var e=Wn(),t=lt.identifierPrefix;if($e){var n=Cr,r=_r;n=(r&~(1<<32-Mn(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=ja++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=o.createElement(n,{is:r.is}):(e=o.createElement(n),n==="select"&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,n),e[Yn]=t,e[Fa]=r,Hx(e,t,!1,!1),t.stateNode=e;e:{switch(o=Dd(n,r),n){case"dialog":Ne("cancel",e),Ne("close",e),i=r;break;case"iframe":case"object":case"embed":Ne("load",e),i=r;break;case"video":case"audio":for(i=0;iho&&(t.flags|=128,r=!0,Uo(s,!1),t.lanes=4194304)}else{if(!r)if(e=Hu(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Uo(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!$e)return Et(t),null}else 2*Je()-s.renderingStartTime>ho&&n!==1073741824&&(t.flags|=128,r=!0,Uo(s,!1),t.lanes=4194304);s.isBackwards?(o.sibling=t.child,t.child=o):(n=s.last,n!==null?n.sibling=o:t.child=o,s.last=o)}return s.tail!==null?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=Je(),t.sibling=null,n=ze.current,Oe(ze,r?n&1|2:n&1),t):(Et(t),null);case 22:case 23:return Kp(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Gt&1073741824&&(Et(t),t.subtreeFlags&6&&(t.flags|=8192)):Et(t),null;case 24:return null;case 25:return null}throw Error(j(156,t.tag))}function WC(e,t){switch(Pp(t),t.tag){case 1:return Ht(t.type)&&Fu(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return co(),Fe(Bt),Fe(Pt),Fp(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Np(t),null;case 13:if(Fe(ze),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(j(340));lo()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Fe(ze),null;case 4:return co(),null;case 10:return Op(t.type._context),null;case 22:case 23:return Kp(),null;case 24:return null;default:return null}}var $l=!1,kt=!1,QC=typeof WeakSet=="function"?WeakSet:Set,K=null;function Fs(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Qe(e,t,r)}else n.current=null}function ch(e,t,n){try{n()}catch(r){Qe(e,t,r)}}var vy=!1;function KC(e,t){if(Kd=Iu,e=G0(),Cp(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var o=0,a=-1,l=-1,u=0,f=0,c=e,d=null;t:for(;;){for(var h;c!==n||i!==0&&c.nodeType!==3||(a=o+i),c!==s||r!==0&&c.nodeType!==3||(l=o+r),c.nodeType===3&&(o+=c.nodeValue.length),(h=c.firstChild)!==null;)d=c,c=h;for(;;){if(c===e)break t;if(d===n&&++u===i&&(a=o),d===s&&++f===r&&(l=o),(h=c.nextSibling)!==null)break;c=d,d=c.parentNode}c=h}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(qd={focusedElem:e,selectionRange:n},Iu=!1,K=t;K!==null;)if(t=K,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,K=e;else for(;K!==null;){t=K;try{var g=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var v=g.memoizedProps,x=g.memoizedState,m=t.stateNode,p=m.getSnapshotBeforeUpdate(t.elementType===t.type?v:Cn(t.type,v),x);m.__reactInternalSnapshotBeforeUpdate=p}break;case 3:var w=t.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(j(163))}}catch(S){Qe(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,K=e;break}K=t.return}return g=vy,vy=!1,g}function ga(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var s=i.destroy;i.destroy=void 0,s!==void 0&&ch(t,n,s)}i=i.next}while(i!==r)}}function Pc(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function fh(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Qx(e){var t=e.alternate;t!==null&&(e.alternate=null,Qx(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Yn],delete t[Fa],delete t[Xd],delete t[AC],delete t[TC])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Kx(e){return e.tag===5||e.tag===3||e.tag===4}function wy(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Kx(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function dh(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Nu));else if(r!==4&&(e=e.child,e!==null))for(dh(e,t,n),e=e.sibling;e!==null;)dh(e,t,n),e=e.sibling}function hh(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(hh(e,t,n),e=e.sibling;e!==null;)hh(e,t,n),e=e.sibling}var ft=null,An=!1;function $r(e,t,n){for(n=n.child;n!==null;)qx(e,t,n),n=n.sibling}function qx(e,t,n){if(nr&&typeof nr.onCommitFiberUnmount=="function")try{nr.onCommitFiberUnmount(wc,n)}catch{}switch(n.tag){case 5:kt||Fs(n,t);case 6:var r=ft,i=An;ft=null,$r(e,t,n),ft=r,An=i,ft!==null&&(An?(e=ft,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):ft.removeChild(n.stateNode));break;case 18:ft!==null&&(An?(e=ft,n=n.stateNode,e.nodeType===8?If(e.parentNode,n):e.nodeType===1&&If(e,n),Oa(e)):If(ft,n.stateNode));break;case 4:r=ft,i=An,ft=n.stateNode.containerInfo,An=!0,$r(e,t,n),ft=r,An=i;break;case 0:case 11:case 14:case 15:if(!kt&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var s=i,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&ch(n,t,o),i=i.next}while(i!==r)}$r(e,t,n);break;case 1:if(!kt&&(Fs(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){Qe(n,t,a)}$r(e,t,n);break;case 21:$r(e,t,n);break;case 22:n.mode&1?(kt=(r=kt)||n.memoizedState!==null,$r(e,t,n),kt=r):$r(e,t,n);break;default:$r(e,t,n)}}function xy(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new QC),t.forEach(function(r){var i=nk.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function bn(e,t){var n=t.deletions;if(n!==null)for(var r=0;ri&&(i=o),r&=~s}if(r=i,r=Je()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*JC(r/1960))-r,10e?16:e,ri===null)var r=!1;else{if(e=ri,ri=null,qu=0,we&6)throw Error(j(331));var i=we;for(we|=4,K=e.current;K!==null;){var s=K,o=s.child;if(K.flags&16){var a=s.deletions;if(a!==null){for(var l=0;lJe()-Wp?qi(e,0):Vp|=n),Vt(e,t)}function nS(e,t){t===0&&(e.mode&1?(t=Al,Al<<=1,!(Al&130023424)&&(Al=4194304)):t=1);var n=Lt();e=Ar(e,t),e!==null&&(tl(e,t,n),Vt(e,n))}function tk(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),nS(e,n)}function nk(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(j(314))}r!==null&&r.delete(t),nS(e,n)}var rS;rS=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Bt.current)Ut=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Ut=!1,HC(e,t,n);Ut=!!(e.flags&131072)}else Ut=!1,$e&&t.flags&1048576&&ax(t,ju,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;fu(e,t),e=t.pendingProps;var i=ao(t,Pt.current);Hs(t,n),i=$p(null,t,r,e,i,n);var s=jp();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Ht(r)?(s=!0,Du(t)):s=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Lp(t),i.updater=kc,t.stateNode=i,i._reactInternals=t,rh(t,r,e,n),t=oh(null,t,r,!0,s,n)):(t.tag=0,$e&&s&&kp(t),Ot(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(fu(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=ik(r),e=Cn(r,e),i){case 0:t=sh(null,t,r,e,n);break e;case 1:t=my(null,t,r,e,n);break e;case 11:t=hy(null,t,r,e,n);break e;case 14:t=py(null,t,r,Cn(r.type,e),n);break e}throw Error(j(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Cn(r,i),sh(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Cn(r,i),my(e,t,r,i,n);case 3:e:{if(zx(t),e===null)throw Error(j(387));r=t.pendingProps,s=t.memoizedState,i=s.element,hx(e,t),Bu(t,r,null,n);var o=t.memoizedState;if(r=o.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){i=fo(Error(j(423)),t),t=gy(e,t,r,n,i);break e}else if(r!==i){i=fo(Error(j(424)),t),t=gy(e,t,r,n,i);break e}else for(Zt=li(t.stateNode.containerInfo.firstChild),en=t,$e=!0,On=null,n=fx(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(lo(),r===i){t=Tr(e,t,n);break e}Ot(e,t,r,n)}t=t.child}return t;case 5:return px(t),e===null&&eh(t),r=t.type,i=t.pendingProps,s=e!==null?e.memoizedProps:null,o=i.children,Jd(r,i)?o=null:s!==null&&Jd(r,s)&&(t.flags|=32),jx(e,t),Ot(e,t,o,n),t.child;case 6:return e===null&&eh(t),null;case 13:return Ux(e,t,n);case 4:return Mp(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=uo(t,null,r,n):Ot(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Cn(r,i),hy(e,t,r,i,n);case 7:return Ot(e,t,t.pendingProps,n),t.child;case 8:return Ot(e,t,t.pendingProps.children,n),t.child;case 12:return Ot(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,s=t.memoizedProps,o=i.value,Oe(zu,r._currentValue),r._currentValue=o,s!==null)if(Fn(s.value,o)){if(s.children===i.children&&!Bt.current){t=Tr(e,t,n);break e}}else for(s=t.child,s!==null&&(s.return=t);s!==null;){var a=s.dependencies;if(a!==null){o=s.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(s.tag===1){l=kr(-1,n&-n),l.tag=2;var u=s.updateQueue;if(u!==null){u=u.shared;var f=u.pending;f===null?l.next=l:(l.next=f.next,f.next=l),u.pending=l}}s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),th(s.return,n,t),a.lanes|=n;break}l=l.next}}else if(s.tag===10)o=s.type===t.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(j(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),th(o,n,t),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===t){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}Ot(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,Hs(t,n),i=gn(i),r=r(i),t.flags|=1,Ot(e,t,r,n),t.child;case 14:return r=t.type,i=Cn(r,t.pendingProps),i=Cn(r.type,i),py(e,t,r,i,n);case 15:return Dx(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Cn(r,i),fu(e,t),t.tag=1,Ht(r)?(e=!0,Du(t)):e=!1,Hs(t,n),Mx(t,r,i),rh(t,r,i,n),oh(null,t,r,!0,e,n);case 19:return Bx(e,t,n);case 22:return $x(e,t,n)}throw Error(j(156,t.tag))};function iS(e,t){return O0(e,t)}function rk(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function hn(e,t,n,r){return new rk(e,t,n,r)}function Jp(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ik(e){if(typeof e=="function")return Jp(e)?1:0;if(e!=null){if(e=e.$$typeof,e===pp)return 11;if(e===mp)return 14}return 2}function di(e,t){var n=e.alternate;return n===null?(n=hn(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function pu(e,t,n,r,i,s){var o=2;if(r=e,typeof e=="function")Jp(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Ps:return Ji(n.children,i,s,t);case hp:o=8,i|=8;break;case Pd:return e=hn(12,n,t,i|2),e.elementType=Pd,e.lanes=s,e;case Rd:return e=hn(13,n,t,i),e.elementType=Rd,e.lanes=s,e;case Ad:return e=hn(19,n,t,i),e.elementType=Ad,e.lanes=s,e;case p0:return Ac(n,i,s,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case d0:o=10;break e;case h0:o=9;break e;case pp:o=11;break e;case mp:o=14;break e;case Kr:o=16,r=null;break e}throw Error(j(130,e==null?e:typeof e,""))}return t=hn(o,n,t,i),t.elementType=e,t.type=r,t.lanes=s,t}function Ji(e,t,n,r){return e=hn(7,e,r,t),e.lanes=n,e}function Ac(e,t,n,r){return e=hn(22,e,r,t),e.elementType=p0,e.lanes=n,e.stateNode={isHidden:!1},e}function zf(e,t,n){return e=hn(6,e,null,t),e.lanes=n,e}function Uf(e,t,n){return t=hn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function sk(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Sf(0),this.expirationTimes=Sf(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Sf(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Gp(e,t,n,r,i,s,o,a,l){return e=new sk(e,t,n,a,l),t===1?(t=1,s===!0&&(t|=8)):t=0,s=hn(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Lp(s),e}function ok(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(lS)}catch(e){console.error(e)}}lS(),l0.exports=rn;var sl=l0.exports;const fk=rp(sl),dk=$w({__proto__:null,default:fk},[sl]);function uS(e){const t=hk(e),n=_.forwardRef((r,i)=>{const{children:s,...o}=r,a=_.Children.toArray(s),l=a.find(mk);if(l){const u=l.props.children,f=a.map(c=>c===l?_.Children.count(u)>1?_.Children.only(null):_.isValidElement(u)?u.props.children:null:c);return Y.jsx(t,{...o,ref:i,children:_.isValidElement(u)?_.cloneElement(u,void 0,f):null})}return Y.jsx(t,{...o,ref:i,children:s})});return n.displayName=`${e}.Slot`,n}var S2=uS("Slot");function hk(e){const t=_.forwardRef((n,r)=>{const{children:i,...s}=n;if(_.isValidElement(i)){const o=yk(i),a=gk(s,i.props);return i.type!==_.Fragment&&(a.ref=r?o0(r,o):o),_.cloneElement(i,a)}return _.Children.count(i)>1?_.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var cS=Symbol("radix.slottable");function pk(e){const t=({children:n})=>Y.jsx(Y.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=cS,t}function mk(e){return _.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===cS}function gk(e,t){const n={...t};for(const r in t){const i=e[r],s=t[r];/^on[A-Z]/.test(r)?i&&s?n[r]=(...a)=>{s(...a),i(...a)}:i&&(n[r]=i):r==="style"?n[r]={...i,...s}:r==="className"&&(n[r]=[i,s].filter(Boolean).join(" "))}return{...e,...n}}function yk(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var vk=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],os=vk.reduce((e,t)=>{const n=uS(`Primitive.${t}`),r=_.forwardRef((i,s)=>{const{asChild:o,...a}=i,l=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),Y.jsx(l,{...a,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function wk(e,t){e&&sl.flushSync(()=>e.dispatchEvent(t))}function bo(e){const t=_.useRef(e);return _.useEffect(()=>{t.current=e}),_.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function xk(e,t=globalThis==null?void 0:globalThis.document){const n=bo(e);_.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var Sk="DismissableLayer",vh="dismissableLayer.update",bk="dismissableLayer.pointerDownOutside",Ek="dismissableLayer.focusOutside",Ry,fS=_.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),dS=_.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:o,onDismiss:a,...l}=e,u=_.useContext(fS),[f,c]=_.useState(null),d=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,h]=_.useState({}),g=rs(t,y=>c(y)),v=Array.from(u.layers),[x]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),m=v.indexOf(x),p=f?v.indexOf(f):-1,w=u.layersWithOutsidePointerEventsDisabled.size>0,S=p>=m,k=kk(y=>{const R=y.target,T=[...u.branches].some(A=>A.contains(R));!S||T||(i==null||i(y),o==null||o(y),y.defaultPrevented||a==null||a())},d),E=Pk(y=>{const R=y.target;[...u.branches].some(A=>A.contains(R))||(s==null||s(y),o==null||o(y),y.defaultPrevented||a==null||a())},d);return xk(y=>{p===u.layers.size-1&&(r==null||r(y),!y.defaultPrevented&&a&&(y.preventDefault(),a()))},d),_.useEffect(()=>{if(f)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Ry=d.body.style.pointerEvents,d.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),Ay(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(d.body.style.pointerEvents=Ry)}},[f,d,n,u]),_.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),Ay())},[f,u]),_.useEffect(()=>{const y=()=>h({});return document.addEventListener(vh,y),()=>document.removeEventListener(vh,y)},[]),Y.jsx(os.div,{...l,ref:g,style:{pointerEvents:w?S?"auto":"none":void 0,...e.style},onFocusCapture:Sr(e.onFocusCapture,E.onFocusCapture),onBlurCapture:Sr(e.onBlurCapture,E.onBlurCapture),onPointerDownCapture:Sr(e.onPointerDownCapture,k.onPointerDownCapture)})});dS.displayName=Sk;var _k="DismissableLayerBranch",Ck=_.forwardRef((e,t)=>{const n=_.useContext(fS),r=_.useRef(null),i=rs(t,r);return _.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),Y.jsx(os.div,{...e,ref:i})});Ck.displayName=_k;function kk(e,t=globalThis==null?void 0:globalThis.document){const n=bo(e),r=_.useRef(!1),i=_.useRef(()=>{});return _.useEffect(()=>{const s=a=>{if(a.target&&!r.current){let l=function(){hS(bk,n,u,{discrete:!0})};const u={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=l,t.addEventListener("click",i.current,{once:!0})):l()}else t.removeEventListener("click",i.current);r.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",s),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Pk(e,t=globalThis==null?void 0:globalThis.document){const n=bo(e),r=_.useRef(!1);return _.useEffect(()=>{const i=s=>{s.target&&!r.current&&hS(Ek,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Ay(){const e=new CustomEvent(vh);document.dispatchEvent(e)}function hS(e,t,n,{discrete:r}){const i=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?wk(i,s):i.dispatchEvent(s)}var po=globalThis!=null&&globalThis.document?_.useLayoutEffect:()=>{},Rk=Jw[" useId ".trim().toString()]||(()=>{}),Ak=0;function Tk(e){const[t,n]=_.useState(Rk());return po(()=>{n(r=>r??String(Ak++))},[e]),e||(t?`radix-${t}`:"")}const Ok=["top","right","bottom","left"],gi=Math.min,Yt=Math.max,Xu=Math.round,Ul=Math.floor,ir=e=>({x:e,y:e}),Ik={left:"right",right:"left",bottom:"top",top:"bottom"},Lk={start:"end",end:"start"};function wh(e,t,n){return Yt(e,gi(t,n))}function Or(e,t){return typeof e=="function"?e(t):e}function Ir(e){return e.split("-")[0]}function Eo(e){return e.split("-")[1]}function em(e){return e==="x"?"y":"x"}function tm(e){return e==="y"?"height":"width"}function yi(e){return["top","bottom"].includes(Ir(e))?"y":"x"}function nm(e){return em(yi(e))}function Mk(e,t,n){n===void 0&&(n=!1);const r=Eo(e),i=nm(e),s=tm(i);let o=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(o=Yu(o)),[o,Yu(o)]}function Nk(e){const t=Yu(e);return[xh(e),t,xh(t)]}function xh(e){return e.replace(/start|end/g,t=>Lk[t])}function Fk(e,t,n){const r=["left","right"],i=["right","left"],s=["top","bottom"],o=["bottom","top"];switch(e){case"top":case"bottom":return n?t?i:r:t?r:i;case"left":case"right":return t?s:o;default:return[]}}function Dk(e,t,n,r){const i=Eo(e);let s=Fk(Ir(e),n==="start",r);return i&&(s=s.map(o=>o+"-"+i),t&&(s=s.concat(s.map(xh)))),s}function Yu(e){return e.replace(/left|right|bottom|top/g,t=>Ik[t])}function $k(e){return{top:0,right:0,bottom:0,left:0,...e}}function pS(e){return typeof e!="number"?$k(e):{top:e,right:e,bottom:e,left:e}}function Zu(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function Ty(e,t,n){let{reference:r,floating:i}=e;const s=yi(t),o=nm(t),a=tm(o),l=Ir(t),u=s==="y",f=r.x+r.width/2-i.width/2,c=r.y+r.height/2-i.height/2,d=r[a]/2-i[a]/2;let h;switch(l){case"top":h={x:f,y:r.y-i.height};break;case"bottom":h={x:f,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:c};break;case"left":h={x:r.x-i.width,y:c};break;default:h={x:r.x,y:r.y}}switch(Eo(t)){case"start":h[o]-=d*(n&&u?-1:1);break;case"end":h[o]+=d*(n&&u?-1:1);break}return h}const jk=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:s=[],platform:o}=n,a=s.filter(Boolean),l=await(o.isRTL==null?void 0:o.isRTL(t));let u=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:f,y:c}=Ty(u,r,l),d=r,h={},g=0;for(let v=0;v({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:s,platform:o,elements:a,middlewareData:l}=t,{element:u,padding:f=0}=Or(e,t)||{};if(u==null)return{};const c=pS(f),d={x:n,y:r},h=nm(i),g=tm(h),v=await o.getDimensions(u),x=h==="y",m=x?"top":"left",p=x?"bottom":"right",w=x?"clientHeight":"clientWidth",S=s.reference[g]+s.reference[h]-d[h]-s.floating[g],k=d[h]-s.reference[h],E=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u));let y=E?E[w]:0;(!y||!await(o.isElement==null?void 0:o.isElement(E)))&&(y=a.floating[w]||s.floating[g]);const R=S/2-k/2,T=y/2-v[g]/2-1,A=gi(c[m],T),O=gi(c[p],T),I=A,z=y-v[g]-O,B=y/2-v[g]/2+R,V=wh(I,B,z),G=!l.arrow&&Eo(i)!=null&&B!==V&&s.reference[g]/2-(BB<=0)){var O,I;const B=(((O=s.flip)==null?void 0:O.index)||0)+1,V=y[B];if(V)return{data:{index:B,overflows:A},reset:{placement:V}};let G=(I=A.filter(Q=>Q.overflows[0]<=0).sort((Q,M)=>Q.overflows[1]-M.overflows[1])[0])==null?void 0:I.placement;if(!G)switch(h){case"bestFit":{var z;const Q=(z=A.filter(M=>{if(E){const U=yi(M.placement);return U===p||U==="y"}return!0}).map(M=>[M.placement,M.overflows.filter(U=>U>0).reduce((U,b)=>U+b,0)]).sort((M,U)=>M[1]-U[1])[0])==null?void 0:z[0];Q&&(G=Q);break}case"initialPlacement":G=a;break}if(i!==G)return{reset:{placement:G}}}return{}}}};function Oy(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Iy(e){return Ok.some(t=>e[t]>=0)}const Bk=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...i}=Or(e,t);switch(r){case"referenceHidden":{const s=await Ha(t,{...i,elementContext:"reference"}),o=Oy(s,n.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:Iy(o)}}}case"escaped":{const s=await Ha(t,{...i,altBoundary:!0}),o=Oy(s,n.floating);return{data:{escapedOffsets:o,escaped:Iy(o)}}}default:return{}}}}};async function Hk(e,t){const{placement:n,platform:r,elements:i}=e,s=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Ir(n),a=Eo(n),l=yi(n)==="y",u=["left","top"].includes(o)?-1:1,f=s&&l?-1:1,c=Or(t,e);let{mainAxis:d,crossAxis:h,alignmentAxis:g}=typeof c=="number"?{mainAxis:c,crossAxis:0,alignmentAxis:null}:{mainAxis:c.mainAxis||0,crossAxis:c.crossAxis||0,alignmentAxis:c.alignmentAxis};return a&&typeof g=="number"&&(h=a==="end"?g*-1:g),l?{x:h*f,y:d*u}:{x:d*u,y:h*f}}const Vk=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:s,placement:o,middlewareData:a}=t,l=await Hk(t,e);return o===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:s+l.y,data:{...l,placement:o}}}}},Wk=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:s=!0,crossAxis:o=!1,limiter:a={fn:x=>{let{x:m,y:p}=x;return{x:m,y:p}}},...l}=Or(e,t),u={x:n,y:r},f=await Ha(t,l),c=yi(Ir(i)),d=em(c);let h=u[d],g=u[c];if(s){const x=d==="y"?"top":"left",m=d==="y"?"bottom":"right",p=h+f[x],w=h-f[m];h=wh(p,h,w)}if(o){const x=c==="y"?"top":"left",m=c==="y"?"bottom":"right",p=g+f[x],w=g-f[m];g=wh(p,g,w)}const v=a.fn({...t,[d]:h,[c]:g});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[d]:s,[c]:o}}}}}},Qk=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:s,middlewareData:o}=t,{offset:a=0,mainAxis:l=!0,crossAxis:u=!0}=Or(e,t),f={x:n,y:r},c=yi(i),d=em(c);let h=f[d],g=f[c];const v=Or(a,t),x=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(l){const w=d==="y"?"height":"width",S=s.reference[d]-s.floating[w]+x.mainAxis,k=s.reference[d]+s.reference[w]-x.mainAxis;hk&&(h=k)}if(u){var m,p;const w=d==="y"?"width":"height",S=["top","left"].includes(Ir(i)),k=s.reference[c]-s.floating[w]+(S&&((m=o.offset)==null?void 0:m[c])||0)+(S?0:x.crossAxis),E=s.reference[c]+s.reference[w]+(S?0:((p=o.offset)==null?void 0:p[c])||0)-(S?x.crossAxis:0);gE&&(g=E)}return{[d]:h,[c]:g}}}},Kk=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:s,platform:o,elements:a}=t,{apply:l=()=>{},...u}=Or(e,t),f=await Ha(t,u),c=Ir(i),d=Eo(i),h=yi(i)==="y",{width:g,height:v}=s.floating;let x,m;c==="top"||c==="bottom"?(x=c,m=d===(await(o.isRTL==null?void 0:o.isRTL(a.floating))?"start":"end")?"left":"right"):(m=c,x=d==="end"?"top":"bottom");const p=v-f.top-f.bottom,w=g-f.left-f.right,S=gi(v-f[x],p),k=gi(g-f[m],w),E=!t.middlewareData.shift;let y=S,R=k;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(R=w),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(y=p),E&&!d){const A=Yt(f.left,0),O=Yt(f.right,0),I=Yt(f.top,0),z=Yt(f.bottom,0);h?R=g-2*(A!==0||O!==0?A+O:Yt(f.left,f.right)):y=v-2*(I!==0||z!==0?I+z:Yt(f.top,f.bottom))}await l({...t,availableWidth:R,availableHeight:y});const T=await o.getDimensions(a.floating);return g!==T.width||v!==T.height?{reset:{rects:!0}}:{}}}};function Mc(){return typeof window<"u"}function _o(e){return mS(e)?(e.nodeName||"").toLowerCase():"#document"}function tn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function lr(e){var t;return(t=(mS(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function mS(e){return Mc()?e instanceof Node||e instanceof tn(e).Node:!1}function Dn(e){return Mc()?e instanceof Element||e instanceof tn(e).Element:!1}function or(e){return Mc()?e instanceof HTMLElement||e instanceof tn(e).HTMLElement:!1}function Ly(e){return!Mc()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof tn(e).ShadowRoot}function ol(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=$n(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function qk(e){return["table","td","th"].includes(_o(e))}function Nc(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function rm(e){const t=im(),n=Dn(e)?$n(e):e;return["transform","translate","scale","rotate","perspective"].some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function Jk(e){let t=vi(e);for(;or(t)&&!mo(t);){if(rm(t))return t;if(Nc(t))return null;t=vi(t)}return null}function im(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function mo(e){return["html","body","#document"].includes(_o(e))}function $n(e){return tn(e).getComputedStyle(e)}function Fc(e){return Dn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function vi(e){if(_o(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Ly(e)&&e.host||lr(e);return Ly(t)?t.host:t}function gS(e){const t=vi(e);return mo(t)?e.ownerDocument?e.ownerDocument.body:e.body:or(t)&&ol(t)?t:gS(t)}function Va(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=gS(e),s=i===((r=e.ownerDocument)==null?void 0:r.body),o=tn(i);if(s){const a=Sh(o);return t.concat(o,o.visualViewport||[],ol(i)?i:[],a&&n?Va(a):[])}return t.concat(i,Va(i,[],n))}function Sh(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function yS(e){const t=$n(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=or(e),s=i?e.offsetWidth:n,o=i?e.offsetHeight:r,a=Xu(n)!==s||Xu(r)!==o;return a&&(n=s,r=o),{width:n,height:r,$:a}}function sm(e){return Dn(e)?e:e.contextElement}function Ws(e){const t=sm(e);if(!or(t))return ir(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:s}=yS(t);let o=(s?Xu(n.width):n.width)/r,a=(s?Xu(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const Gk=ir(0);function vS(e){const t=tn(e);return!im()||!t.visualViewport?Gk:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Xk(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==tn(e)?!1:t}function ts(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),s=sm(e);let o=ir(1);t&&(r?Dn(r)&&(o=Ws(r)):o=Ws(e));const a=Xk(s,n,r)?vS(s):ir(0);let l=(i.left+a.x)/o.x,u=(i.top+a.y)/o.y,f=i.width/o.x,c=i.height/o.y;if(s){const d=tn(s),h=r&&Dn(r)?tn(r):r;let g=d,v=Sh(g);for(;v&&r&&h!==g;){const x=Ws(v),m=v.getBoundingClientRect(),p=$n(v),w=m.left+(v.clientLeft+parseFloat(p.paddingLeft))*x.x,S=m.top+(v.clientTop+parseFloat(p.paddingTop))*x.y;l*=x.x,u*=x.y,f*=x.x,c*=x.y,l+=w,u+=S,g=tn(v),v=Sh(g)}}return Zu({width:f,height:c,x:l,y:u})}function om(e,t){const n=Fc(e).scrollLeft;return t?t.left+n:ts(lr(e)).left+n}function wS(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),i=r.left+t.scrollLeft-(n?0:om(e,r)),s=r.top+t.scrollTop;return{x:i,y:s}}function Yk(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const s=i==="fixed",o=lr(r),a=t?Nc(t.floating):!1;if(r===o||a&&s)return n;let l={scrollLeft:0,scrollTop:0},u=ir(1);const f=ir(0),c=or(r);if((c||!c&&!s)&&((_o(r)!=="body"||ol(o))&&(l=Fc(r)),or(r))){const h=ts(r);u=Ws(r),f.x=h.x+r.clientLeft,f.y=h.y+r.clientTop}const d=o&&!c&&!s?wS(o,l,!0):ir(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+f.x+d.x,y:n.y*u.y-l.scrollTop*u.y+f.y+d.y}}function Zk(e){return Array.from(e.getClientRects())}function eP(e){const t=lr(e),n=Fc(e),r=e.ownerDocument.body,i=Yt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=Yt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+om(e);const a=-n.scrollTop;return $n(r).direction==="rtl"&&(o+=Yt(t.clientWidth,r.clientWidth)-i),{width:i,height:s,x:o,y:a}}function tP(e,t){const n=tn(e),r=lr(e),i=n.visualViewport;let s=r.clientWidth,o=r.clientHeight,a=0,l=0;if(i){s=i.width,o=i.height;const u=im();(!u||u&&t==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}return{width:s,height:o,x:a,y:l}}function nP(e,t){const n=ts(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,s=or(e)?Ws(e):ir(1),o=e.clientWidth*s.x,a=e.clientHeight*s.y,l=i*s.x,u=r*s.y;return{width:o,height:a,x:l,y:u}}function My(e,t,n){let r;if(t==="viewport")r=tP(e,n);else if(t==="document")r=eP(lr(e));else if(Dn(t))r=nP(t,n);else{const i=vS(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Zu(r)}function xS(e,t){const n=vi(e);return n===t||!Dn(n)||mo(n)?!1:$n(n).position==="fixed"||xS(n,t)}function rP(e,t){const n=t.get(e);if(n)return n;let r=Va(e,[],!1).filter(a=>Dn(a)&&_o(a)!=="body"),i=null;const s=$n(e).position==="fixed";let o=s?vi(e):e;for(;Dn(o)&&!mo(o);){const a=$n(o),l=rm(o);!l&&a.position==="fixed"&&(i=null),(s?!l&&!i:!l&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||ol(o)&&!l&&xS(e,o))?r=r.filter(f=>f!==o):i=a,o=vi(o)}return t.set(e,r),r}function iP(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const o=[...n==="clippingAncestors"?Nc(t)?[]:rP(t,this._c):[].concat(n),r],a=o[0],l=o.reduce((u,f)=>{const c=My(t,f,i);return u.top=Yt(c.top,u.top),u.right=gi(c.right,u.right),u.bottom=gi(c.bottom,u.bottom),u.left=Yt(c.left,u.left),u},My(t,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function sP(e){const{width:t,height:n}=yS(e);return{width:t,height:n}}function oP(e,t,n){const r=or(t),i=lr(t),s=n==="fixed",o=ts(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const l=ir(0);if(r||!r&&!s)if((_o(t)!=="body"||ol(i))&&(a=Fc(t)),r){const d=ts(t,!0,s,t);l.x=d.x+t.clientLeft,l.y=d.y+t.clientTop}else i&&(l.x=om(i));const u=i&&!r&&!s?wS(i,a):ir(0),f=o.left+a.scrollLeft-l.x-u.x,c=o.top+a.scrollTop-l.y-u.y;return{x:f,y:c,width:o.width,height:o.height}}function Bf(e){return $n(e).position==="static"}function Ny(e,t){if(!or(e)||$n(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return lr(e)===n&&(n=n.ownerDocument.body),n}function SS(e,t){const n=tn(e);if(Nc(e))return n;if(!or(e)){let i=vi(e);for(;i&&!mo(i);){if(Dn(i)&&!Bf(i))return i;i=vi(i)}return n}let r=Ny(e,t);for(;r&&qk(r)&&Bf(r);)r=Ny(r,t);return r&&mo(r)&&Bf(r)&&!rm(r)?n:r||Jk(e)||n}const aP=async function(e){const t=this.getOffsetParent||SS,n=this.getDimensions,r=await n(e.floating);return{reference:oP(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function lP(e){return $n(e).direction==="rtl"}const uP={convertOffsetParentRelativeRectToViewportRelativeRect:Yk,getDocumentElement:lr,getClippingRect:iP,getOffsetParent:SS,getElementRects:aP,getClientRects:Zk,getDimensions:sP,getScale:Ws,isElement:Dn,isRTL:lP};function bS(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function cP(e,t){let n=null,r;const i=lr(e);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function o(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),s();const u=e.getBoundingClientRect(),{left:f,top:c,width:d,height:h}=u;if(a||t(),!d||!h)return;const g=Ul(c),v=Ul(i.clientWidth-(f+d)),x=Ul(i.clientHeight-(c+h)),m=Ul(f),w={rootMargin:-g+"px "+-v+"px "+-x+"px "+-m+"px",threshold:Yt(0,gi(1,l))||1};let S=!0;function k(E){const y=E[0].intersectionRatio;if(y!==l){if(!S)return o();y?o(!1,y):r=setTimeout(()=>{o(!1,1e-7)},1e3)}y===1&&!bS(u,e.getBoundingClientRect())&&o(),S=!1}try{n=new IntersectionObserver(k,{...w,root:i.ownerDocument})}catch{n=new IntersectionObserver(k,w)}n.observe(e)}return o(!0),s}function fP(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=sm(e),f=i||s?[...u?Va(u):[],...Va(t)]:[];f.forEach(m=>{i&&m.addEventListener("scroll",n,{passive:!0}),s&&m.addEventListener("resize",n)});const c=u&&a?cP(u,n):null;let d=-1,h=null;o&&(h=new ResizeObserver(m=>{let[p]=m;p&&p.target===u&&h&&(h.unobserve(t),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var w;(w=h)==null||w.observe(t)})),n()}),u&&!l&&h.observe(u),h.observe(t));let g,v=l?ts(e):null;l&&x();function x(){const m=ts(e);v&&!bS(v,m)&&n(),v=m,g=requestAnimationFrame(x)}return n(),()=>{var m;f.forEach(p=>{i&&p.removeEventListener("scroll",n),s&&p.removeEventListener("resize",n)}),c==null||c(),(m=h)==null||m.disconnect(),h=null,l&&cancelAnimationFrame(g)}}const dP=Vk,hP=Wk,pP=Uk,mP=Kk,gP=Bk,Fy=zk,yP=Qk,vP=(e,t,n)=>{const r=new Map,i={platform:uP,...n},s={...i.platform,_c:r};return jk(e,t,{...i,platform:s})};var mu=typeof document<"u"?_.useLayoutEffect:_.useEffect;function ec(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!ec(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const s=i[r];if(!(s==="_owner"&&e.$$typeof)&&!ec(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function ES(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Dy(e,t){const n=ES(e);return Math.round(t*n)/n}function Hf(e){const t=_.useRef(e);return mu(()=>{t.current=e}),t}function wP(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:s,floating:o}={},transform:a=!0,whileElementsMounted:l,open:u}=e,[f,c]=_.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[d,h]=_.useState(r);ec(d,r)||h(r);const[g,v]=_.useState(null),[x,m]=_.useState(null),p=_.useCallback(M=>{M!==E.current&&(E.current=M,v(M))},[]),w=_.useCallback(M=>{M!==y.current&&(y.current=M,m(M))},[]),S=s||g,k=o||x,E=_.useRef(null),y=_.useRef(null),R=_.useRef(f),T=l!=null,A=Hf(l),O=Hf(i),I=Hf(u),z=_.useCallback(()=>{if(!E.current||!y.current)return;const M={placement:t,strategy:n,middleware:d};O.current&&(M.platform=O.current),vP(E.current,y.current,M).then(U=>{const b={...U,isPositioned:I.current!==!1};B.current&&!ec(R.current,b)&&(R.current=b,sl.flushSync(()=>{c(b)}))})},[d,t,n,O,I]);mu(()=>{u===!1&&R.current.isPositioned&&(R.current.isPositioned=!1,c(M=>({...M,isPositioned:!1})))},[u]);const B=_.useRef(!1);mu(()=>(B.current=!0,()=>{B.current=!1}),[]),mu(()=>{if(S&&(E.current=S),k&&(y.current=k),S&&k){if(A.current)return A.current(S,k,z);z()}},[S,k,z,A,T]);const V=_.useMemo(()=>({reference:E,floating:y,setReference:p,setFloating:w}),[p,w]),G=_.useMemo(()=>({reference:S,floating:k}),[S,k]),Q=_.useMemo(()=>{const M={position:n,left:0,top:0};if(!G.floating)return M;const U=Dy(G.floating,f.x),b=Dy(G.floating,f.y);return a?{...M,transform:"translate("+U+"px, "+b+"px)",...ES(G.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:U,top:b}},[n,a,G.floating,f.x,f.y]);return _.useMemo(()=>({...f,update:z,refs:V,elements:G,floatingStyles:Q}),[f,z,V,G,Q])}const xP=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:i}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?Fy({element:r.current,padding:i}).fn(n):{}:r?Fy({element:r,padding:i}).fn(n):{}}}},SP=(e,t)=>({...dP(e),options:[e,t]}),bP=(e,t)=>({...hP(e),options:[e,t]}),EP=(e,t)=>({...yP(e),options:[e,t]}),_P=(e,t)=>({...pP(e),options:[e,t]}),CP=(e,t)=>({...mP(e),options:[e,t]}),kP=(e,t)=>({...gP(e),options:[e,t]}),PP=(e,t)=>({...xP(e),options:[e,t]});var RP="Arrow",_S=_.forwardRef((e,t)=>{const{children:n,width:r=10,height:i=5,...s}=e;return Y.jsx(os.svg,{...s,ref:t,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:Y.jsx("polygon",{points:"0,0 30,0 15,10"})})});_S.displayName=RP;var AP=_S;function TP(e){const[t,n]=_.useState(void 0);return po(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const s=i[0];let o,a;if("borderBoxSize"in s){const l=s.borderBoxSize,u=Array.isArray(l)?l[0]:l;o=u.inlineSize,a=u.blockSize}else o=e.offsetWidth,a=e.offsetHeight;n({width:o,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var am="Popper",[CS,kS]=a0(am),[OP,PS]=CS(am),RS=e=>{const{__scopePopper:t,children:n}=e,[r,i]=_.useState(null);return Y.jsx(OP,{scope:t,anchor:r,onAnchorChange:i,children:n})};RS.displayName=am;var AS="PopperAnchor",TS=_.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,s=PS(AS,n),o=_.useRef(null),a=rs(t,o);return _.useEffect(()=>{s.onAnchorChange((r==null?void 0:r.current)||o.current)}),r?null:Y.jsx(os.div,{...i,ref:a})});TS.displayName=AS;var lm="PopperContent",[IP,LP]=CS(lm),OS=_.forwardRef((e,t)=>{var qe,vt,xn,Sn,dr,Ge;const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:s="center",alignOffset:o=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:f=0,sticky:c="partial",hideWhenDetached:d=!1,updatePositionStrategy:h="optimized",onPlaced:g,...v}=e,x=PS(lm,n),[m,p]=_.useState(null),w=rs(t,Ft=>p(Ft)),[S,k]=_.useState(null),E=TP(S),y=(E==null?void 0:E.width)??0,R=(E==null?void 0:E.height)??0,T=r+(s!=="center"?"-"+s:""),A=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},O=Array.isArray(u)?u:[u],I=O.length>0,z={padding:A,boundary:O.filter(NP),altBoundary:I},{refs:B,floatingStyles:V,placement:G,isPositioned:Q,middlewareData:M}=wP({strategy:"fixed",placement:T,whileElementsMounted:(...Ft)=>fP(...Ft,{animationFrame:h==="always"}),elements:{reference:x.anchor},middleware:[SP({mainAxis:i+R,alignmentAxis:o}),l&&bP({mainAxis:!0,crossAxis:!1,limiter:c==="partial"?EP():void 0,...z}),l&&_P({...z}),CP({...z,apply:({elements:Ft,rects:Ri,availableWidth:us,availableHeight:on})=>{const{width:cs,height:Oo}=Ri.reference,Un=Ft.floating.style;Un.setProperty("--radix-popper-available-width",`${us}px`),Un.setProperty("--radix-popper-available-height",`${on}px`),Un.setProperty("--radix-popper-anchor-width",`${cs}px`),Un.setProperty("--radix-popper-anchor-height",`${Oo}px`)}}),S&&PP({element:S,padding:a}),FP({arrowWidth:y,arrowHeight:R}),d&&kP({strategy:"referenceHidden",...z})]}),[U,b]=MS(G),Z=bo(g);po(()=>{Q&&(Z==null||Z())},[Q,Z]);const pe=(qe=M.arrow)==null?void 0:qe.x,C=(vt=M.arrow)==null?void 0:vt.y,Ae=((xn=M.arrow)==null?void 0:xn.centerOffset)!==0,[Le,ye]=_.useState();return po(()=>{m&&ye(window.getComputedStyle(m).zIndex)},[m]),Y.jsx("div",{ref:B.setFloating,"data-radix-popper-content-wrapper":"",style:{...V,transform:Q?V.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Le,"--radix-popper-transform-origin":[(Sn=M.transformOrigin)==null?void 0:Sn.x,(dr=M.transformOrigin)==null?void 0:dr.y].join(" "),...((Ge=M.hide)==null?void 0:Ge.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:Y.jsx(IP,{scope:n,placedSide:U,onArrowChange:k,arrowX:pe,arrowY:C,shouldHideArrow:Ae,children:Y.jsx(os.div,{"data-side":U,"data-align":b,...v,ref:w,style:{...v.style,animation:Q?void 0:"none"}})})})});OS.displayName=lm;var IS="PopperArrow",MP={top:"bottom",right:"left",bottom:"top",left:"right"},LS=_.forwardRef(function(t,n){const{__scopePopper:r,...i}=t,s=LP(IS,r),o=MP[s.placedSide];return Y.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:Y.jsx(AP,{...i,ref:n,style:{...i.style,display:"block"}})})});LS.displayName=IS;function NP(e){return e!==null}var FP=e=>({name:"transformOrigin",options:e,fn(t){var x,m,p;const{placement:n,rects:r,middlewareData:i}=t,o=((x=i.arrow)==null?void 0:x.centerOffset)!==0,a=o?0:e.arrowWidth,l=o?0:e.arrowHeight,[u,f]=MS(n),c={start:"0%",center:"50%",end:"100%"}[f],d=(((m=i.arrow)==null?void 0:m.x)??0)+a/2,h=(((p=i.arrow)==null?void 0:p.y)??0)+l/2;let g="",v="";return u==="bottom"?(g=o?c:`${d}px`,v=`${-l}px`):u==="top"?(g=o?c:`${d}px`,v=`${r.floating.height+l}px`):u==="right"?(g=`${-l}px`,v=o?c:`${h}px`):u==="left"&&(g=`${r.floating.width+l}px`,v=o?c:`${h}px`),{data:{x:g,y:v}}}});function MS(e){const[t,n="center"]=e.split("-");return[t,n]}var DP=RS,$P=TS,jP=OS,zP=LS;function UP(e,t){return _.useReducer((n,r)=>t[n][r]??n,e)}var NS=e=>{const{present:t,children:n}=e,r=BP(t),i=typeof n=="function"?n({present:r.isPresent}):_.Children.only(n),s=rs(r.ref,HP(i));return typeof n=="function"||r.isPresent?_.cloneElement(i,{ref:s}):null};NS.displayName="Presence";function BP(e){const[t,n]=_.useState(),r=_.useRef({}),i=_.useRef(e),s=_.useRef("none"),o=e?"mounted":"unmounted",[a,l]=UP(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return _.useEffect(()=>{const u=Bl(r.current);s.current=a==="mounted"?u:"none"},[a]),po(()=>{const u=r.current,f=i.current;if(f!==e){const d=s.current,h=Bl(u);e?l("MOUNT"):h==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(f&&d!==h?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,l]),po(()=>{if(t){let u;const f=t.ownerDocument.defaultView??window,c=h=>{const v=Bl(r.current).includes(h.animationName);if(h.target===t&&v&&(l("ANIMATION_END"),!i.current)){const x=t.style.animationFillMode;t.style.animationFillMode="forwards",u=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=x)})}},d=h=>{h.target===t&&(s.current=Bl(r.current))};return t.addEventListener("animationstart",d),t.addEventListener("animationcancel",c),t.addEventListener("animationend",c),()=>{f.clearTimeout(u),t.removeEventListener("animationstart",d),t.removeEventListener("animationcancel",c),t.removeEventListener("animationend",c)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:_.useCallback(u=>{u&&(r.current=getComputedStyle(u)),n(u)},[])}}function Bl(e){return(e==null?void 0:e.animationName)||"none"}function HP(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function VP({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,i]=WP({defaultProp:t,onChange:n}),s=e!==void 0,o=s?e:r,a=bo(n),l=_.useCallback(u=>{if(s){const c=typeof u=="function"?u(e):u;c!==e&&a(c)}else i(u)},[s,e,i,a]);return[o,l]}function WP({defaultProp:e,onChange:t}){const n=_.useState(e),[r]=n,i=_.useRef(r),s=bo(t);return _.useEffect(()=>{i.current!==r&&(s(r),i.current=r)},[r,i,s]),n}var QP="VisuallyHidden",FS=_.forwardRef((e,t)=>Y.jsx(os.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));FS.displayName=QP;var KP=FS,[Dc,b2]=a0("Tooltip",[kS]),$c=kS(),DS="TooltipProvider",qP=700,bh="tooltip.open",[JP,um]=Dc(DS),$S=e=>{const{__scopeTooltip:t,delayDuration:n=qP,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:s}=e,o=_.useRef(!0),a=_.useRef(!1),l=_.useRef(0);return _.useEffect(()=>{const u=l.current;return()=>window.clearTimeout(u)},[]),Y.jsx(JP,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:_.useCallback(()=>{window.clearTimeout(l.current),o.current=!1},[]),onClose:_.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>o.current=!0,r)},[r]),isPointerInTransitRef:a,onPointerInTransitChange:_.useCallback(u=>{a.current=u},[]),disableHoverableContent:i,children:s})};$S.displayName=DS;var jc="Tooltip",[GP,zc]=Dc(jc),jS=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:i=!1,onOpenChange:s,disableHoverableContent:o,delayDuration:a}=e,l=um(jc,e.__scopeTooltip),u=$c(t),[f,c]=_.useState(null),d=Tk(),h=_.useRef(0),g=o??l.disableHoverableContent,v=a??l.delayDuration,x=_.useRef(!1),[m=!1,p]=VP({prop:r,defaultProp:i,onChange:y=>{y?(l.onOpen(),document.dispatchEvent(new CustomEvent(bh))):l.onClose(),s==null||s(y)}}),w=_.useMemo(()=>m?x.current?"delayed-open":"instant-open":"closed",[m]),S=_.useCallback(()=>{window.clearTimeout(h.current),h.current=0,x.current=!1,p(!0)},[p]),k=_.useCallback(()=>{window.clearTimeout(h.current),h.current=0,p(!1)},[p]),E=_.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{x.current=!0,p(!0),h.current=0},v)},[v,p]);return _.useEffect(()=>()=>{h.current&&(window.clearTimeout(h.current),h.current=0)},[]),Y.jsx(DP,{...u,children:Y.jsx(GP,{scope:t,contentId:d,open:m,stateAttribute:w,trigger:f,onTriggerChange:c,onTriggerEnter:_.useCallback(()=>{l.isOpenDelayedRef.current?E():S()},[l.isOpenDelayedRef,E,S]),onTriggerLeave:_.useCallback(()=>{g?k():(window.clearTimeout(h.current),h.current=0)},[k,g]),onOpen:S,onClose:k,disableHoverableContent:g,children:n})})};jS.displayName=jc;var Eh="TooltipTrigger",zS=_.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=zc(Eh,n),s=um(Eh,n),o=$c(n),a=_.useRef(null),l=rs(t,a,i.onTriggerChange),u=_.useRef(!1),f=_.useRef(!1),c=_.useCallback(()=>u.current=!1,[]);return _.useEffect(()=>()=>document.removeEventListener("pointerup",c),[c]),Y.jsx($P,{asChild:!0,...o,children:Y.jsx(os.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:l,onPointerMove:Sr(e.onPointerMove,d=>{d.pointerType!=="touch"&&!f.current&&!s.isPointerInTransitRef.current&&(i.onTriggerEnter(),f.current=!0)}),onPointerLeave:Sr(e.onPointerLeave,()=>{i.onTriggerLeave(),f.current=!1}),onPointerDown:Sr(e.onPointerDown,()=>{i.open&&i.onClose(),u.current=!0,document.addEventListener("pointerup",c,{once:!0})}),onFocus:Sr(e.onFocus,()=>{u.current||i.onOpen()}),onBlur:Sr(e.onBlur,i.onClose),onClick:Sr(e.onClick,i.onClose)})})});zS.displayName=Eh;var XP="TooltipPortal",[E2,YP]=Dc(XP,{forceMount:void 0}),go="TooltipContent",US=_.forwardRef((e,t)=>{const n=YP(go,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...s}=e,o=zc(go,e.__scopeTooltip);return Y.jsx(NS,{present:r||o.open,children:o.disableHoverableContent?Y.jsx(BS,{side:i,...s,ref:t}):Y.jsx(ZP,{side:i,...s,ref:t})})}),ZP=_.forwardRef((e,t)=>{const n=zc(go,e.__scopeTooltip),r=um(go,e.__scopeTooltip),i=_.useRef(null),s=rs(t,i),[o,a]=_.useState(null),{trigger:l,onClose:u}=n,f=i.current,{onPointerInTransitChange:c}=r,d=_.useCallback(()=>{a(null),c(!1)},[c]),h=_.useCallback((g,v)=>{const x=g.currentTarget,m={x:g.clientX,y:g.clientY},p=iR(m,x.getBoundingClientRect()),w=sR(m,p),S=oR(v.getBoundingClientRect()),k=lR([...w,...S]);a(k),c(!0)},[c]);return _.useEffect(()=>()=>d(),[d]),_.useEffect(()=>{if(l&&f){const g=x=>h(x,f),v=x=>h(x,l);return l.addEventListener("pointerleave",g),f.addEventListener("pointerleave",v),()=>{l.removeEventListener("pointerleave",g),f.removeEventListener("pointerleave",v)}}},[l,f,h,d]),_.useEffect(()=>{if(o){const g=v=>{const x=v.target,m={x:v.clientX,y:v.clientY},p=(l==null?void 0:l.contains(x))||(f==null?void 0:f.contains(x)),w=!aR(m,o);p?d():w&&(d(),u())};return document.addEventListener("pointermove",g),()=>document.removeEventListener("pointermove",g)}},[l,f,o,u,d]),Y.jsx(BS,{...e,ref:s})}),[eR,tR]=Dc(jc,{isInside:!1}),nR=pk("TooltipContent"),BS=_.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:s,onPointerDownOutside:o,...a}=e,l=zc(go,n),u=$c(n),{onClose:f}=l;return _.useEffect(()=>(document.addEventListener(bh,f),()=>document.removeEventListener(bh,f)),[f]),_.useEffect(()=>{if(l.trigger){const c=d=>{const h=d.target;h!=null&&h.contains(l.trigger)&&f()};return window.addEventListener("scroll",c,{capture:!0}),()=>window.removeEventListener("scroll",c,{capture:!0})}},[l.trigger,f]),Y.jsx(dS,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:o,onFocusOutside:c=>c.preventDefault(),onDismiss:f,children:Y.jsxs(jP,{"data-state":l.stateAttribute,...u,...a,ref:t,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[Y.jsx(nR,{children:r}),Y.jsx(eR,{scope:n,isInside:!0,children:Y.jsx(KP,{id:l.contentId,role:"tooltip",children:i||r})})]})})});US.displayName=go;var HS="TooltipArrow",rR=_.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=$c(n);return tR(HS,n).isInside?null:Y.jsx(zP,{...i,...r,ref:t})});rR.displayName=HS;function iR(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(n,r,i,s)){case s:return"left";case i:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function sR(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function oR(e){const{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function aR(e,t){const{x:n,y:r}=e;let i=!1;for(let s=0,o=t.length-1;sr!=f>r&&n<(u-a)*(r-l)/(f-l)+a&&(i=!i)}return i}function lR(e){const t=e.slice();return t.sort((n,r)=>n.xr.x?1:n.yr.y?1:0),uR(t)}function uR(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r=2;){const s=t[t.length-1],o=t[t.length-2];if((s.x-o.x)*(i.y-o.y)>=(s.y-o.y)*(i.x-o.x))t.pop();else break}t.push(i)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const i=e[r];for(;n.length>=2;){const s=n[n.length-1],o=n[n.length-2];if((s.x-o.x)*(i.y-o.y)>=(s.y-o.y)*(i.x-o.x))n.pop();else break}n.push(i)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var cR=$S,fR=jS,dR=zS,VS=US;function WS(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t{const t=gR(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{const a=o.split(cm);return a[0]===""&&a.length!==1&&a.shift(),QS(a,t)||mR(o)},getConflictingClassGroupIds:(o,a)=>{const l=n[o]||[];return a&&r[o]?[...l,...r[o]]:l}}},QS=(e,t)=>{var o;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),i=r?QS(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;const s=e.join(cm);return(o=t.validators.find(({validator:a})=>a(s)))==null?void 0:o.classGroupId},$y=/^\[(.+)\]$/,mR=e=>{if($y.test(e)){const t=$y.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},gR=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return vR(Object.entries(e.classGroups),n).forEach(([s,o])=>{_h(o,r,s,t)}),r},_h=(e,t,n,r)=>{e.forEach(i=>{if(typeof i=="string"){const s=i===""?t:jy(t,i);s.classGroupId=n;return}if(typeof i=="function"){if(yR(i)){_h(i(r),t,n,r);return}t.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([s,o])=>{_h(o,jy(t,s),n,r)})})},jy=(e,t)=>{let n=e;return t.split(cm).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},yR=e=>e.isThemeGetter,vR=(e,t)=>t?e.map(([n,r])=>{const i=r.map(s=>typeof s=="string"?t+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([o,a])=>[t+o,a])):s);return[n,i]}):e,wR=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const i=(s,o)=>{n.set(s,o),t++,t>e&&(t=0,r=n,n=new Map)};return{get(s){let o=n.get(s);if(o!==void 0)return o;if((o=r.get(s))!==void 0)return i(s,o),o},set(s,o){n.has(s)?n.set(s,o):i(s,o)}}},KS="!",xR=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,i=t[0],s=t.length,o=a=>{const l=[];let u=0,f=0,c;for(let x=0;xf?c-f:void 0;return{modifiers:l,hasImportantModifier:h,baseClassName:g,maybePostfixModifierPosition:v}};return n?a=>n({className:a,parseClassName:o}):o},SR=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},bR=e=>({cache:wR(e.cacheSize),parseClassName:xR(e),...pR(e)}),ER=/\s+/,_R=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i}=t,s=[],o=e.trim().split(ER);let a="";for(let l=o.length-1;l>=0;l-=1){const u=o[l],{modifiers:f,hasImportantModifier:c,baseClassName:d,maybePostfixModifierPosition:h}=n(u);let g=!!h,v=r(g?d.substring(0,h):d);if(!v){if(!g){a=u+(a.length>0?" "+a:a);continue}if(v=r(d),!v){a=u+(a.length>0?" "+a:a);continue}g=!1}const x=SR(f).join(":"),m=c?x+KS:x,p=m+v;if(s.includes(p))continue;s.push(p);const w=i(v,g);for(let S=0;S0?" "+a:a)}return a};function CR(){let e=0,t,n,r="";for(;e{if(typeof e=="string")return e;let t,n="";for(let r=0;rc(f),e());return n=bR(u),r=n.cache.get,i=n.cache.set,s=a,a(l)}function a(l){const u=r(l);if(u)return u;const f=_R(l,n);return i(l,f),f}return function(){return s(CR.apply(null,arguments))}}const Me=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},JS=/^\[(?:([a-z-]+):)?(.+)\]$/i,PR=/^\d+\/\d+$/,RR=new Set(["px","full","screen"]),AR=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,TR=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,OR=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,IR=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,LR=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,gr=e=>Qs(e)||RR.has(e)||PR.test(e),jr=e=>Co(e,"length",UR),Qs=e=>!!e&&!Number.isNaN(Number(e)),Vf=e=>Co(e,"number",Qs),Ho=e=>!!e&&Number.isInteger(Number(e)),MR=e=>e.endsWith("%")&&Qs(e.slice(0,-1)),de=e=>JS.test(e),zr=e=>AR.test(e),NR=new Set(["length","size","percentage"]),FR=e=>Co(e,NR,GS),DR=e=>Co(e,"position",GS),$R=new Set(["image","url"]),jR=e=>Co(e,$R,HR),zR=e=>Co(e,"",BR),Vo=()=>!0,Co=(e,t,n)=>{const r=JS.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},UR=e=>TR.test(e)&&!OR.test(e),GS=()=>!1,BR=e=>IR.test(e),HR=e=>LR.test(e),VR=()=>{const e=Me("colors"),t=Me("spacing"),n=Me("blur"),r=Me("brightness"),i=Me("borderColor"),s=Me("borderRadius"),o=Me("borderSpacing"),a=Me("borderWidth"),l=Me("contrast"),u=Me("grayscale"),f=Me("hueRotate"),c=Me("invert"),d=Me("gap"),h=Me("gradientColorStops"),g=Me("gradientColorStopPositions"),v=Me("inset"),x=Me("margin"),m=Me("opacity"),p=Me("padding"),w=Me("saturate"),S=Me("scale"),k=Me("sepia"),E=Me("skew"),y=Me("space"),R=Me("translate"),T=()=>["auto","contain","none"],A=()=>["auto","hidden","clip","visible","scroll"],O=()=>["auto",de,t],I=()=>[de,t],z=()=>["",gr,jr],B=()=>["auto",Qs,de],V=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],G=()=>["solid","dashed","dotted","double","none"],Q=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],M=()=>["start","end","center","between","around","evenly","stretch"],U=()=>["","0",de],b=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Z=()=>[Qs,de];return{cacheSize:500,separator:":",theme:{colors:[Vo],spacing:[gr,jr],blur:["none","",zr,de],brightness:Z(),borderColor:[e],borderRadius:["none","","full",zr,de],borderSpacing:I(),borderWidth:z(),contrast:Z(),grayscale:U(),hueRotate:Z(),invert:U(),gap:I(),gradientColorStops:[e],gradientColorStopPositions:[MR,jr],inset:O(),margin:O(),opacity:Z(),padding:I(),saturate:Z(),scale:Z(),sepia:U(),skew:Z(),space:I(),translate:I()},classGroups:{aspect:[{aspect:["auto","square","video",de]}],container:["container"],columns:[{columns:[zr]}],"break-after":[{"break-after":b()}],"break-before":[{"break-before":b()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...V(),de]}],overflow:[{overflow:A()}],"overflow-x":[{"overflow-x":A()}],"overflow-y":[{"overflow-y":A()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[v]}],"inset-x":[{"inset-x":[v]}],"inset-y":[{"inset-y":[v]}],start:[{start:[v]}],end:[{end:[v]}],top:[{top:[v]}],right:[{right:[v]}],bottom:[{bottom:[v]}],left:[{left:[v]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Ho,de]}],basis:[{basis:O()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",de]}],grow:[{grow:U()}],shrink:[{shrink:U()}],order:[{order:["first","last","none",Ho,de]}],"grid-cols":[{"grid-cols":[Vo]}],"col-start-end":[{col:["auto",{span:["full",Ho,de]},de]}],"col-start":[{"col-start":B()}],"col-end":[{"col-end":B()}],"grid-rows":[{"grid-rows":[Vo]}],"row-start-end":[{row:["auto",{span:[Ho,de]},de]}],"row-start":[{"row-start":B()}],"row-end":[{"row-end":B()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",de]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",de]}],gap:[{gap:[d]}],"gap-x":[{"gap-x":[d]}],"gap-y":[{"gap-y":[d]}],"justify-content":[{justify:["normal",...M()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...M(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...M(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[p]}],px:[{px:[p]}],py:[{py:[p]}],ps:[{ps:[p]}],pe:[{pe:[p]}],pt:[{pt:[p]}],pr:[{pr:[p]}],pb:[{pb:[p]}],pl:[{pl:[p]}],m:[{m:[x]}],mx:[{mx:[x]}],my:[{my:[x]}],ms:[{ms:[x]}],me:[{me:[x]}],mt:[{mt:[x]}],mr:[{mr:[x]}],mb:[{mb:[x]}],ml:[{ml:[x]}],"space-x":[{"space-x":[y]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[y]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",de,t]}],"min-w":[{"min-w":[de,t,"min","max","fit"]}],"max-w":[{"max-w":[de,t,"none","full","min","max","fit","prose",{screen:[zr]},zr]}],h:[{h:[de,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[de,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[de,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[de,t,"auto","min","max","fit"]}],"font-size":[{text:["base",zr,jr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Vf]}],"font-family":[{font:[Vo]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",de]}],"line-clamp":[{"line-clamp":["none",Qs,Vf]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",gr,de]}],"list-image":[{"list-image":["none",de]}],"list-style-type":[{list:["none","disc","decimal",de]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[m]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[m]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...G(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",gr,jr]}],"underline-offset":[{"underline-offset":["auto",gr,de]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:I()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",de]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",de]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[m]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...V(),DR]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",FR]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},jR]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[g]}],"gradient-via-pos":[{via:[g]}],"gradient-to-pos":[{to:[g]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[m]}],"border-style":[{border:[...G(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[m]}],"divide-style":[{divide:G()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...G()]}],"outline-offset":[{"outline-offset":[gr,de]}],"outline-w":[{outline:[gr,jr]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:z()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[m]}],"ring-offset-w":[{"ring-offset":[gr,jr]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",zr,zR]}],"shadow-color":[{shadow:[Vo]}],opacity:[{opacity:[m]}],"mix-blend":[{"mix-blend":[...Q(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Q()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",zr,de]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[f]}],invert:[{invert:[c]}],saturate:[{saturate:[w]}],sepia:[{sepia:[k]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[f]}],"backdrop-invert":[{"backdrop-invert":[c]}],"backdrop-opacity":[{"backdrop-opacity":[m]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"backdrop-sepia":[{"backdrop-sepia":[k]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",de]}],duration:[{duration:Z()}],ease:[{ease:["linear","in","out","in-out",de]}],delay:[{delay:Z()}],animate:[{animate:["none","spin","ping","pulse","bounce",de]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[S]}],"scale-x":[{"scale-x":[S]}],"scale-y":[{"scale-y":[S]}],rotate:[{rotate:[Ho,de]}],"translate-x":[{"translate-x":[R]}],"translate-y":[{"translate-y":[R]}],"skew-x":[{"skew-x":[E]}],"skew-y":[{"skew-y":[E]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",de]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",de]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":I()}],"scroll-mx":[{"scroll-mx":I()}],"scroll-my":[{"scroll-my":I()}],"scroll-ms":[{"scroll-ms":I()}],"scroll-me":[{"scroll-me":I()}],"scroll-mt":[{"scroll-mt":I()}],"scroll-mr":[{"scroll-mr":I()}],"scroll-mb":[{"scroll-mb":I()}],"scroll-ml":[{"scroll-ml":I()}],"scroll-p":[{"scroll-p":I()}],"scroll-px":[{"scroll-px":I()}],"scroll-py":[{"scroll-py":I()}],"scroll-ps":[{"scroll-ps":I()}],"scroll-pe":[{"scroll-pe":I()}],"scroll-pt":[{"scroll-pt":I()}],"scroll-pr":[{"scroll-pr":I()}],"scroll-pb":[{"scroll-pb":I()}],"scroll-pl":[{"scroll-pl":I()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",de]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[gr,jr,Vf]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},WR=kR(VR);globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(e,t){return this.cache.has(e)?this.cache.get(e):(this.cache.set(e,t),t)}};function QR(...e){return WR(hR(e))}async function _2(e){const t=new TextEncoder().encode(e),n=await crypto.subtle.digest("SHA-256",t);return[...new Uint8Array(n)].map(s=>s.toString(16).padStart(2,"0")).join("")}function C2(e){let t=e==="html"?".html":".js",n=e==="html"?"text/html":"application/javascript";return e==="streamlit"&&(t=".py",n="text/python"),[t,n]}function k2(e,t,n){const r=new Blob([e],{type:t}),i=URL.createObjectURL(r),s=document.createElement("a");s.href=i,s.download=n,document.body.append(s),s.click(),s.remove(),URL.revokeObjectURL(i)}async function P2(e,t){const n=new Image,r=new Promise((i,s)=>{n.addEventListener("load",()=>{let{width:o,height:a}=n;(o>t||a>t)&&(o>a?(a*=t/o,o=t):(o*=t/a,a=t));const l=document.querySelector("#resizer"),u=l.getContext("2d");l.width=o,l.height=a,u.drawImage(n,0,0,o,a);const f=l.toDataURL("image/jpeg");i({url:f,width:o,height:a,createdAt:new Date})}),n.addEventListener("error",o=>{s(new Error(`Failed to resize image: ${o.message}`))})});return n.src=e,r}const R2=580;globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(e,t){return this.cache.has(e)?this.cache.get(e):(this.cache.set(e,t),t)}};const KR=cR,A2=fR,T2=dR,qR=_.forwardRef(({className:e,sideOffset:t=4,...n},r)=>Y.jsx(VS,{ref:r,sideOffset:t,className:QR("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n}));qR.displayName=VS.displayName;globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(e,t){return this.cache.has(e)?this.cache.get(e):(this.cache.set(e,t),t)}};const JR=500;function O2(e,t=JR){const[n,r]=Ki.useState(e),i=Ki.useRef(null);return Ki.useEffect(()=>{const s=Date.now();if(i.current&&s>=i.current+t)i.current=s,r(e);else{const o=window.setTimeout(()=>{i.current=s,r(e)},t);return()=>window.clearTimeout(o)}return()=>{}},[e,t]),n}function GR(e){const[t,n]=_.useState(()=>matchMedia(e).matches);return _.useLayoutEffect(()=>{const r=matchMedia(e);function i(){n(r.matches)}return r.addEventListener("change",i),()=>{r.removeEventListener("change",i)}},[e]),t}function XR(){const[e,t]=_.useState(()=>window.location.hash),n=_.useCallback(()=>{t(window.location.hash)},[]);_.useEffect(()=>(window.addEventListener("hashchange",n),()=>{window.removeEventListener("hashchange",n)}),[n]);const r=_.useCallback(i=>{i!==e&&(window.location.hash=i)},[e]);return[e,r]}function I2(e){const[t,n]=XR(),r=_.useCallback(s=>s<0?n(""):n(`#v${s}`),[n]),i=_.useMemo(()=>t.includes("#v")?Math.min(Number.parseInt(t.replace("#v",""),10),e.latestVersion):e.latestVersion,[t,e.latestVersion]);return _.useEffect(()=>{i>e.latestVersion&&r(e.latestVersion)},[i,e.latestVersion,r]),[i,r]}/** * @remix-run/router v1.23.0 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function De(){return De=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function yo(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function ZR(){return Math.random().toString(36).substr(2,8)}function Uy(e,t){return{usr:e.state,key:e.key,idx:t}}function Wa(e,t,n,r){return n===void 0&&(n=null),De({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?_i(t):t,{state:n,key:t&&t.key||r||ZR()})}function wi(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function _i(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function eA(e,t,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:s=!1}=r,o=i.history,a=Ye.Pop,l=null,u=f();u==null&&(u=0,o.replaceState(De({},o.state,{idx:u}),""));function f(){return(o.state||{idx:null}).idx}function c(){a=Ye.Pop;let x=f(),m=x==null?null:x-u;u=x,l&&l({action:a,location:v.location,delta:m})}function d(x,m){a=Ye.Push;let p=Wa(v.location,x,m);u=f()+1;let w=Uy(p,u),S=v.createHref(p);try{o.pushState(w,"",S)}catch(k){if(k instanceof DOMException&&k.name==="DataCloneError")throw k;i.location.assign(S)}s&&l&&l({action:a,location:v.location,delta:1})}function h(x,m){a=Ye.Replace;let p=Wa(v.location,x,m);u=f();let w=Uy(p,u),S=v.createHref(p);o.replaceState(w,"",S),s&&l&&l({action:a,location:v.location,delta:0})}function g(x){let m=i.location.origin!=="null"?i.location.origin:i.location.href,p=typeof x=="string"?x:wi(x);return p=p.replace(/ $/,"%20"),ce(m,"No window.location.(origin|href) available to create URL for href: "+p),new URL(p,m)}let v={get action(){return a},get location(){return e(i,o)},listen(x){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener(zy,c),l=x,()=>{i.removeEventListener(zy,c),l=null}},createHref(x){return t(i,x)},createURL:g,encodeLocation(x){let m=g(x);return{pathname:m.pathname,search:m.search,hash:m.hash}},push:d,replace:h,go(x){return o.go(x)}};return v}var ke;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(ke||(ke={}));const tA=new Set(["lazy","caseSensitive","path","id","index","children"]);function nA(e){return e.index===!0}function tc(e,t,n,r){return n===void 0&&(n=[]),r===void 0&&(r={}),e.map((i,s)=>{let o=[...n,String(s)],a=typeof i.id=="string"?i.id:o.join("-");if(ce(i.index!==!0||!i.children,"Cannot specify children on an index route"),ce(!r[a],'Found a route id collision on id "'+a+`". Route id's must be globally unique within Data Router usages`),nA(i)){let l=De({},i,t(i),{id:a});return r[a]=l,l}else{let l=De({},i,t(i),{id:a,children:void 0});return r[a]=l,i.children&&(l.children=tc(i.children,t,o,r)),l}})}function Mi(e,t,n){return n===void 0&&(n="/"),gu(e,t,n,!1)}function gu(e,t,n,r){let i=typeof t=="string"?_i(t):t,s=xi(i.pathname||"/",n);if(s==null)return null;let o=XS(e);iA(o);let a=null;for(let l=0;a==null&&l{let l={relativePath:a===void 0?s.path||"":a,caseSensitive:s.caseSensitive===!0,childrenIndex:o,route:s};l.relativePath.startsWith("/")&&(ce(l.relativePath.startsWith(r),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(r.length));let u=sr([r,l.relativePath]),f=n.concat(l);s.children&&s.children.length>0&&(ce(s.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),XS(s.children,t,f,u)),!(s.path==null&&!s.index)&&t.push({path:u,score:fA(u,s.index),routesMeta:f})};return e.forEach((s,o)=>{var a;if(s.path===""||!((a=s.path)!=null&&a.includes("?")))i(s,o);else for(let l of YS(s.path))i(s,o,l)}),t}function YS(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),s=n.replace(/\?$/,"");if(r.length===0)return i?[s,""]:[s];let o=YS(r.join("/")),a=[];return a.push(...o.map(l=>l===""?s:[s,l].join("/"))),i&&a.push(...o),a.map(l=>e.startsWith("/")&&l===""?"/":l)}function iA(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:dA(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const sA=/^:[\w-]+$/,oA=3,aA=2,lA=1,uA=10,cA=-2,By=e=>e==="*";function fA(e,t){let n=e.split("/"),r=n.length;return n.some(By)&&(r+=cA),t&&(r+=aA),n.filter(i=>!By(i)).reduce((i,s)=>i+(sA.test(s)?oA:s===""?lA:uA),r)}function dA(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function hA(e,t,n){n===void 0&&(n=!1);let{routesMeta:r}=e,i={},s="/",o=[];for(let a=0;a{let{paramName:d,isOptional:h}=f;if(d==="*"){let v=a[c]||"";o=s.slice(0,s.length-v.length).replace(/(.)\/+$/,"$1")}const g=a[c];return h&&!g?u[d]=void 0:u[d]=(g||"").replace(/%2F/g,"/"),u},{}),pathname:s,pathnameBase:o,pattern:e}}function pA(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),yo(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,a,l)=>(r.push({paramName:a,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function mA(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return yo(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function xi(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function gA(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?_i(e):e;return{pathname:n?n.startsWith("/")?n:yA(n,t):t,search:wA(r),hash:xA(i)}}function yA(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function Wf(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function ZS(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Uc(e,t){let n=ZS(e);return t?n.map((r,i)=>i===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function Bc(e,t,n,r){r===void 0&&(r=!1);let i;typeof e=="string"?i=_i(e):(i=De({},e),ce(!i.pathname||!i.pathname.includes("?"),Wf("?","pathname","search",i)),ce(!i.pathname||!i.pathname.includes("#"),Wf("#","pathname","hash",i)),ce(!i.search||!i.search.includes("#"),Wf("#","search","hash",i)));let s=e===""||i.pathname==="",o=s?"/":i.pathname,a;if(o==null)a=n;else{let c=t.length-1;if(!r&&o.startsWith("..")){let d=o.split("/");for(;d[0]==="..";)d.shift(),c-=1;i.pathname=d.join("/")}a=c>=0?t[c]:"/"}let l=gA(i,a),u=o&&o!=="/"&&o.endsWith("/"),f=(s||o===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(u||f)&&(l.pathname+="/"),l}const sr=e=>e.join("/").replace(/\/\/+/g,"/"),vA=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),wA=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,xA=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;class nc{constructor(t,n,r,i){i===void 0&&(i=!1),this.status=t,this.statusText=n||"",this.internal=i,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}}function Qa(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const e1=["post","put","patch","delete"],SA=new Set(e1),bA=["get",...e1],EA=new Set(bA),_A=new Set([301,302,303,307,308]),CA=new Set([307,308]),Qf={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},kA={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Wo={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},fm=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,PA=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),t1="remix-router-transitions";function RA(e){const t=e.window?e.window:typeof window<"u"?window:void 0,n=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u",r=!n;ce(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let i;if(e.mapRouteProperties)i=e.mapRouteProperties;else if(e.detectErrorBoundary){let P=e.detectErrorBoundary;i=L=>({hasErrorBoundary:P(L)})}else i=PA;let s={},o=tc(e.routes,i,void 0,s),a,l=e.basename||"/",u=e.dataStrategy||IA,f=e.patchRoutesOnNavigation,c=De({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,v7_skipActionErrorRevalidation:!1},e.future),d=null,h=new Set,g=null,v=null,x=null,m=e.hydrationData!=null,p=Mi(o,e.history.location,l),w=!1,S=null;if(p==null&&!f){let P=jt(404,{pathname:e.history.location.pathname}),{matches:L,route:N}=ev(o);p=L,S={[N.id]:P}}p&&!e.hydrationData&&vl(p,o,e.history.location.pathname).active&&(p=null);let k;if(p)if(p.some(P=>P.route.lazy))k=!1;else if(!p.some(P=>P.route.loader))k=!0;else if(c.v7_partialHydration){let P=e.hydrationData?e.hydrationData.loaderData:null,L=e.hydrationData?e.hydrationData.errors:null;if(L){let N=p.findIndex($=>L[$.route.id]!==void 0);k=p.slice(0,N+1).every($=>!kh($.route,P,L))}else k=p.every(N=>!kh(N.route,P,L))}else k=e.hydrationData!=null;else if(k=!1,p=[],c.v7_partialHydration){let P=vl(null,o,e.history.location.pathname);P.active&&P.matches&&(w=!0,p=P.matches)}let E,y={historyAction:e.history.action,location:e.history.location,matches:p,initialized:k,navigation:Qf,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||S,fetchers:new Map,blockers:new Map},R=Ye.Pop,T=!1,A,O=!1,I=new Map,z=null,B=!1,V=!1,G=[],Q=new Set,M=new Map,U=0,b=-1,Z=new Map,pe=new Set,C=new Map,Ae=new Map,Le=new Set,ye=new Map,qe=new Map,vt;function xn(){if(d=e.history.listen(P=>{let{action:L,location:N,delta:$}=P;if(vt){vt(),vt=void 0;return}yo(qe.size===0||$!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let W=sg({currentLocation:y.location,nextLocation:N,historyAction:L});if(W&&$!=null){let ne=new Promise(oe=>{vt=oe});e.history.go($*-1),yl(W,{state:"blocked",location:N,proceed(){yl(W,{state:"proceeding",proceed:void 0,reset:void 0,location:N}),ne.then(()=>e.history.go($))},reset(){let oe=new Map(y.blockers);oe.set(W,Wo),Ge({blockers:oe})}});return}return on(L,N)}),n){QA(t,I);let P=()=>KA(t,I);t.addEventListener("pagehide",P),z=()=>t.removeEventListener("pagehide",P)}return y.initialized||on(Ye.Pop,y.location,{initialHydration:!0}),E}function Sn(){d&&d(),z&&z(),h.clear(),A&&A.abort(),y.fetchers.forEach((P,L)=>wt(L)),y.blockers.forEach((P,L)=>an(L))}function dr(P){return h.add(P),()=>h.delete(P)}function Ge(P,L){L===void 0&&(L={}),y=De({},y,P);let N=[],$=[];c.v7_fetcherPersist&&y.fetchers.forEach((W,ne)=>{W.state==="idle"&&(Le.has(ne)?$.push(ne):N.push(ne))}),Le.forEach(W=>{!y.fetchers.has(W)&&!M.has(W)&&$.push(W)}),[...h].forEach(W=>W(y,{deletedFetchers:$,viewTransitionOpts:L.viewTransitionOpts,flushSync:L.flushSync===!0})),c.v7_fetcherPersist?(N.forEach(W=>y.fetchers.delete(W)),$.forEach(W=>wt(W))):$.forEach(W=>Le.delete(W))}function Ft(P,L,N){var $,W;let{flushSync:ne}=N===void 0?{}:N,oe=y.actionData!=null&&y.navigation.formMethod!=null&&Tn(y.navigation.formMethod)&&y.navigation.state==="loading"&&(($=P.state)==null?void 0:$._isRedirect)!==!0,J;L.actionData?Object.keys(L.actionData).length>0?J=L.actionData:J=null:oe?J=y.actionData:J=null;let X=L.loaderData?Yy(y.loaderData,L.loaderData,L.matches||[],L.errors):y.loaderData,q=y.blockers;q.size>0&&(q=new Map(q),q.forEach((ve,ct)=>q.set(ct,Wo)));let ee=T===!0||y.navigation.formMethod!=null&&Tn(y.navigation.formMethod)&&((W=P.state)==null?void 0:W._isRedirect)!==!0;a&&(o=a,a=void 0),B||R===Ye.Pop||(R===Ye.Push?e.history.push(P,P.state):R===Ye.Replace&&e.history.replace(P,P.state));let fe;if(R===Ye.Pop){let ve=I.get(y.location.pathname);ve&&ve.has(P.pathname)?fe={currentLocation:y.location,nextLocation:P}:I.has(P.pathname)&&(fe={currentLocation:P,nextLocation:y.location})}else if(O){let ve=I.get(y.location.pathname);ve?ve.add(P.pathname):(ve=new Set([P.pathname]),I.set(y.location.pathname,ve)),fe={currentLocation:y.location,nextLocation:P}}Ge(De({},L,{actionData:J,loaderData:X,historyAction:R,location:P,initialized:!0,navigation:Qf,revalidation:"idle",restoreScrollPosition:ag(P,L.matches||y.matches),preventScrollReset:ee,blockers:q}),{viewTransitionOpts:fe,flushSync:ne===!0}),R=Ye.Pop,T=!1,O=!1,B=!1,V=!1,G=[]}async function Ri(P,L){if(typeof P=="number"){e.history.go(P);return}let N=Ch(y.location,y.matches,l,c.v7_prependBasename,P,c.v7_relativeSplatPath,L==null?void 0:L.fromRouteId,L==null?void 0:L.relative),{path:$,submission:W,error:ne}=Vy(c.v7_normalizeFormMethod,!1,N,L),oe=y.location,J=Wa(y.location,$,L&&L.state);J=De({},J,e.history.encodeLocation(J));let X=L&&L.replace!=null?L.replace:void 0,q=Ye.Push;X===!0?q=Ye.Replace:X===!1||W!=null&&Tn(W.formMethod)&&W.formAction===y.location.pathname+y.location.search&&(q=Ye.Replace);let ee=L&&"preventScrollReset"in L?L.preventScrollReset===!0:void 0,fe=(L&&L.flushSync)===!0,ve=sg({currentLocation:oe,nextLocation:J,historyAction:q});if(ve){yl(ve,{state:"blocked",location:J,proceed(){yl(ve,{state:"proceeding",proceed:void 0,reset:void 0,location:J}),Ri(P,L)},reset(){let ct=new Map(y.blockers);ct.set(ve,Wo),Ge({blockers:ct})}});return}return await on(q,J,{submission:W,pendingError:ne,preventScrollReset:ee,replace:L&&L.replace,enableViewTransition:L&&L.viewTransition,flushSync:fe})}function us(){if(H(),Ge({revalidation:"loading"}),y.navigation.state!=="submitting"){if(y.navigation.state==="idle"){on(y.historyAction,y.location,{startUninterruptedRevalidation:!0});return}on(R||y.historyAction,y.navigation.location,{overrideNavigation:y.navigation,enableViewTransition:O===!0})}}async function on(P,L,N){A&&A.abort(),A=null,R=P,B=(N&&N.startUninterruptedRevalidation)===!0,oE(y.location,y.matches),T=(N&&N.preventScrollReset)===!0,O=(N&&N.enableViewTransition)===!0;let $=a||o,W=N&&N.overrideNavigation,ne=N!=null&&N.initialHydration&&y.matches&&y.matches.length>0&&!w?y.matches:Mi($,L,l),oe=(N&&N.flushSync)===!0;if(ne&&y.initialized&&!V&&$A(y.location,L)&&!(N&&N.submission&&Tn(N.submission.formMethod))){Ft(L,{matches:ne},{flushSync:oe});return}let J=vl(ne,$,L.pathname);if(J.active&&J.matches&&(ne=J.matches),!ne){let{error:Te,notFoundMatches:be,route:He}=ff(L.pathname);Ft(L,{matches:be,loaderData:{},errors:{[He.id]:Te}},{flushSync:oe});return}A=new AbortController;let X=ms(e.history,L,A.signal,N&&N.submission),q;if(N&&N.pendingError)q=[Ni(ne).route.id,{type:ke.error,error:N.pendingError}];else if(N&&N.submission&&Tn(N.submission.formMethod)){let Te=await cs(X,L,N.submission,ne,J.active,{replace:N.replace,flushSync:oe});if(Te.shortCircuited)return;if(Te.pendingActionResult){let[be,He]=Te.pendingActionResult;if(Xt(He)&&Qa(He.error)&&He.error.status===404){A=null,Ft(L,{matches:Te.matches,loaderData:{},errors:{[be]:He.error}});return}}ne=Te.matches||ne,q=Te.pendingActionResult,W=Kf(L,N.submission),oe=!1,J.active=!1,X=ms(e.history,X.url,X.signal)}let{shortCircuited:ee,matches:fe,loaderData:ve,errors:ct}=await Oo(X,L,ne,J.active,W,N&&N.submission,N&&N.fetcherSubmission,N&&N.replace,N&&N.initialHydration===!0,oe,q);ee||(A=null,Ft(L,De({matches:fe||ne},Zy(q),{loaderData:ve,errors:ct})))}async function cs(P,L,N,$,W,ne){ne===void 0&&(ne={}),H();let oe=VA(L,N);if(Ge({navigation:oe},{flushSync:ne.flushSync===!0}),W){let q=await wl($,L.pathname,P.signal);if(q.type==="aborted")return{shortCircuited:!0};if(q.type==="error"){let ee=Ni(q.partialMatches).route.id;return{matches:q.partialMatches,pendingActionResult:[ee,{type:ke.error,error:q.error}]}}else if(q.matches)$=q.matches;else{let{notFoundMatches:ee,error:fe,route:ve}=ff(L.pathname);return{matches:ee,pendingActionResult:[ve.id,{type:ke.error,error:fe}]}}}let J,X=ta($,L);if(!X.route.action&&!X.route.lazy)J={type:ke.error,error:jt(405,{method:P.method,pathname:L.pathname,routeId:X.route.id})};else if(J=(await Ai("action",y,P,[X],$,null))[X.route.id],P.signal.aborted)return{shortCircuited:!0};if(zi(J)){let q;return ne&&ne.replace!=null?q=ne.replace:q=Jy(J.response.headers.get("Location"),new URL(P.url),l)===y.location.pathname+y.location.search,await hr(P,J,!0,{submission:N,replace:q}),{shortCircuited:!0}}if(ii(J))throw jt(400,{type:"defer-action"});if(Xt(J)){let q=Ni($,X.route.id);return(ne&&ne.replace)!==!0&&(R=Ye.Push),{matches:$,pendingActionResult:[q.route.id,J]}}return{matches:$,pendingActionResult:[X.route.id,J]}}async function Oo(P,L,N,$,W,ne,oe,J,X,q,ee){let fe=W||Kf(L,ne),ve=ne||oe||nv(fe),ct=!B&&(!c.v7_partialHydration||!X);if($){if(ct){let Ve=Un(ee);Ge(De({navigation:fe},Ve!==void 0?{actionData:Ve}:{}),{flushSync:q})}let xe=await wl(N,L.pathname,P.signal);if(xe.type==="aborted")return{shortCircuited:!0};if(xe.type==="error"){let Ve=Ni(xe.partialMatches).route.id;return{matches:xe.partialMatches,loaderData:{},errors:{[Ve]:xe.error}}}else if(xe.matches)N=xe.matches;else{let{error:Ve,notFoundMatches:ds,route:Mo}=ff(L.pathname);return{matches:ds,loaderData:{},errors:{[Mo.id]:Ve}}}}let Te=a||o,[be,He]=Qy(e.history,y,N,ve,L,c.v7_partialHydration&&X===!0,c.v7_skipActionErrorRevalidation,V,G,Q,Le,C,pe,Te,l,ee);if(df(xe=>!(N&&N.some(Ve=>Ve.route.id===xe))||be&&be.some(Ve=>Ve.route.id===xe)),b=++U,be.length===0&&He.length===0){let xe=Fr();return Ft(L,De({matches:N,loaderData:{},errors:ee&&Xt(ee[1])?{[ee[0]]:ee[1].error}:null},Zy(ee),xe?{fetchers:new Map(y.fetchers)}:{}),{flushSync:q}),{shortCircuited:!0}}if(ct){let xe={};if(!$){xe.navigation=fe;let Ve=Un(ee);Ve!==void 0&&(xe.actionData=Ve)}He.length>0&&(xe.fetchers=gl(He)),Ge(xe,{flushSync:q})}He.forEach(xe=>{it(xe.key),xe.controller&&M.set(xe.key,xe.controller)});let fs=()=>He.forEach(xe=>it(xe.key));A&&A.signal.addEventListener("abort",fs);let{loaderResults:Io,fetcherResults:mr}=await F(y,N,be,He,P);if(P.signal.aborted)return{shortCircuited:!0};A&&A.signal.removeEventListener("abort",fs),He.forEach(xe=>M.delete(xe.key));let Bn=Hl(Io);if(Bn)return await hr(P,Bn.result,!0,{replace:J}),{shortCircuited:!0};if(Bn=Hl(mr),Bn)return pe.add(Bn.key),await hr(P,Bn.result,!0,{replace:J}),{shortCircuited:!0};let{loaderData:hf,errors:Lo}=Xy(y,N,Io,ee,He,mr,ye);ye.forEach((xe,Ve)=>{xe.subscribe(ds=>{(ds||xe.done)&&ye.delete(Ve)})}),c.v7_partialHydration&&X&&y.errors&&(Lo=De({},y.errors,Lo));let Ti=Fr(),xl=xt(b),Sl=Ti||xl||He.length>0;return De({matches:N,loaderData:hf,errors:Lo},Sl?{fetchers:new Map(y.fetchers)}:{})}function Un(P){if(P&&!Xt(P[1]))return{[P[0]]:P[1].data};if(y.actionData)return Object.keys(y.actionData).length===0?null:y.actionData}function gl(P){return P.forEach(L=>{let N=y.fetchers.get(L.key),$=Qo(void 0,N?N.data:void 0);y.fetchers.set(L.key,$)}),new Map(y.fetchers)}function lf(P,L,N,$){if(r)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");it(P);let W=($&&$.flushSync)===!0,ne=a||o,oe=Ch(y.location,y.matches,l,c.v7_prependBasename,N,c.v7_relativeSplatPath,L,$==null?void 0:$.relative),J=Mi(ne,oe,l),X=vl(J,ne,oe);if(X.active&&X.matches&&(J=X.matches),!J){ae(P,L,jt(404,{pathname:oe}),{flushSync:W});return}let{path:q,submission:ee,error:fe}=Vy(c.v7_normalizeFormMethod,!0,oe,$);if(fe){ae(P,L,fe,{flushSync:W});return}let ve=ta(J,q),ct=($&&$.preventScrollReset)===!0;if(ee&&Tn(ee.formMethod)){uf(P,L,q,ve,J,X.active,W,ct,ee);return}C.set(P,{routeId:L,path:q}),cf(P,L,q,ve,J,X.active,W,ct,ee)}async function uf(P,L,N,$,W,ne,oe,J,X){H(),C.delete(P);function q(Xe){if(!Xe.route.action&&!Xe.route.lazy){let hs=jt(405,{method:X.formMethod,pathname:N,routeId:L});return ae(P,L,hs,{flushSync:oe}),!0}return!1}if(!ne&&q($))return;let ee=y.fetchers.get(P);re(P,WA(X,ee),{flushSync:oe});let fe=new AbortController,ve=ms(e.history,N,fe.signal,X);if(ne){let Xe=await wl(W,new URL(ve.url).pathname,ve.signal,P);if(Xe.type==="aborted")return;if(Xe.type==="error"){ae(P,L,Xe.error,{flushSync:oe});return}else if(Xe.matches){if(W=Xe.matches,$=ta(W,N),q($))return}else{ae(P,L,jt(404,{pathname:N}),{flushSync:oe});return}}M.set(P,fe);let ct=U,be=(await Ai("action",y,ve,[$],W,P))[$.route.id];if(ve.signal.aborted){M.get(P)===fe&&M.delete(P);return}if(c.v7_fetcherPersist&&Le.has(P)){if(zi(be)||Xt(be)){re(P,Qr(void 0));return}}else{if(zi(be))if(M.delete(P),b>ct){re(P,Qr(void 0));return}else return pe.add(P),re(P,Qo(X)),hr(ve,be,!1,{fetcherSubmission:X,preventScrollReset:J});if(Xt(be)){ae(P,L,be.error);return}}if(ii(be))throw jt(400,{type:"defer-action"});let He=y.navigation.location||y.location,fs=ms(e.history,He,fe.signal),Io=a||o,mr=y.navigation.state!=="idle"?Mi(Io,y.navigation.location,l):y.matches;ce(mr,"Didn't find any matches after fetcher action");let Bn=++U;Z.set(P,Bn);let hf=Qo(X,be.data);y.fetchers.set(P,hf);let[Lo,Ti]=Qy(e.history,y,mr,X,He,!1,c.v7_skipActionErrorRevalidation,V,G,Q,Le,C,pe,Io,l,[$.route.id,be]);Ti.filter(Xe=>Xe.key!==P).forEach(Xe=>{let hs=Xe.key,lg=y.fetchers.get(hs),uE=Qo(void 0,lg?lg.data:void 0);y.fetchers.set(hs,uE),it(hs),Xe.controller&&M.set(hs,Xe.controller)}),Ge({fetchers:new Map(y.fetchers)});let xl=()=>Ti.forEach(Xe=>it(Xe.key));fe.signal.addEventListener("abort",xl);let{loaderResults:Sl,fetcherResults:xe}=await F(y,mr,Lo,Ti,fs);if(fe.signal.aborted)return;fe.signal.removeEventListener("abort",xl),Z.delete(P),M.delete(P),Ti.forEach(Xe=>M.delete(Xe.key));let Ve=Hl(Sl);if(Ve)return hr(fs,Ve.result,!1,{preventScrollReset:J});if(Ve=Hl(xe),Ve)return pe.add(Ve.key),hr(fs,Ve.result,!1,{preventScrollReset:J});let{loaderData:ds,errors:Mo}=Xy(y,mr,Sl,void 0,Ti,xe,ye);if(y.fetchers.has(P)){let Xe=Qr(be.data);y.fetchers.set(P,Xe)}xt(Bn),y.navigation.state==="loading"&&Bn>b?(ce(R,"Expected pending action"),A&&A.abort(),Ft(y.navigation.location,{matches:mr,loaderData:ds,errors:Mo,fetchers:new Map(y.fetchers)})):(Ge({errors:Mo,loaderData:Yy(y.loaderData,ds,mr,Mo),fetchers:new Map(y.fetchers)}),V=!1)}async function cf(P,L,N,$,W,ne,oe,J,X){let q=y.fetchers.get(P);re(P,Qo(X,q?q.data:void 0),{flushSync:oe});let ee=new AbortController,fe=ms(e.history,N,ee.signal);if(ne){let be=await wl(W,new URL(fe.url).pathname,fe.signal,P);if(be.type==="aborted")return;if(be.type==="error"){ae(P,L,be.error,{flushSync:oe});return}else if(be.matches)W=be.matches,$=ta(W,N);else{ae(P,L,jt(404,{pathname:N}),{flushSync:oe});return}}M.set(P,ee);let ve=U,Te=(await Ai("loader",y,fe,[$],W,P))[$.route.id];if(ii(Te)&&(Te=await dm(Te,fe.signal,!0)||Te),M.get(P)===ee&&M.delete(P),!fe.signal.aborted){if(Le.has(P)){re(P,Qr(void 0));return}if(zi(Te))if(b>ve){re(P,Qr(void 0));return}else{pe.add(P),await hr(fe,Te,!1,{preventScrollReset:J});return}if(Xt(Te)){ae(P,L,Te.error);return}ce(!ii(Te),"Unhandled fetcher deferred data"),re(P,Qr(Te.data))}}async function hr(P,L,N,$){let{submission:W,fetcherSubmission:ne,preventScrollReset:oe,replace:J}=$===void 0?{}:$;L.response.headers.has("X-Remix-Revalidate")&&(V=!0);let X=L.response.headers.get("Location");ce(X,"Expected a Location header on the redirect Response"),X=Jy(X,new URL(P.url),l);let q=Wa(y.location,X,{_isRedirect:!0});if(n){let be=!1;if(L.response.headers.has("X-Remix-Reload-Document"))be=!0;else if(fm.test(X)){const He=e.history.createURL(X);be=He.origin!==t.location.origin||xi(He.pathname,l)==null}if(be){J?t.location.replace(X):t.location.assign(X);return}}A=null;let ee=J===!0||L.response.headers.has("X-Remix-Replace")?Ye.Replace:Ye.Push,{formMethod:fe,formAction:ve,formEncType:ct}=y.navigation;!W&&!ne&&fe&&ve&&ct&&(W=nv(y.navigation));let Te=W||ne;if(CA.has(L.response.status)&&Te&&Tn(Te.formMethod))await on(ee,q,{submission:De({},Te,{formAction:X}),preventScrollReset:oe||T,enableViewTransition:N?O:void 0});else{let be=Kf(q,W);await on(ee,q,{overrideNavigation:be,fetcherSubmission:ne,preventScrollReset:oe||T,enableViewTransition:N?O:void 0})}}async function Ai(P,L,N,$,W,ne){let oe,J={};try{oe=await LA(u,P,L,N,$,W,ne,s,i)}catch(X){return $.forEach(q=>{J[q.route.id]={type:ke.error,error:X}}),J}for(let[X,q]of Object.entries(oe))if(jA(q)){let ee=q.result;J[X]={type:ke.redirect,response:FA(ee,N,X,W,l,c.v7_relativeSplatPath)}}else J[X]=await NA(q);return J}async function F(P,L,N,$,W){let ne=P.matches,oe=Ai("loader",P,W,N,L,null),J=Promise.all($.map(async ee=>{if(ee.matches&&ee.match&&ee.controller){let ve=(await Ai("loader",P,ms(e.history,ee.path,ee.controller.signal),[ee.match],ee.matches,ee.key))[ee.match.route.id];return{[ee.key]:ve}}else return Promise.resolve({[ee.key]:{type:ke.error,error:jt(404,{pathname:ee.path})}})})),X=await oe,q=(await J).reduce((ee,fe)=>Object.assign(ee,fe),{});return await Promise.all([BA(L,X,W.signal,ne,P.loaderData),HA(L,q,$)]),{loaderResults:X,fetcherResults:q}}function H(){V=!0,G.push(...df()),C.forEach((P,L)=>{M.has(L)&&Q.add(L),it(L)})}function re(P,L,N){N===void 0&&(N={}),y.fetchers.set(P,L),Ge({fetchers:new Map(y.fetchers)},{flushSync:(N&&N.flushSync)===!0})}function ae(P,L,N,$){$===void 0&&($={});let W=Ni(y.matches,L);wt(P),Ge({errors:{[W.route.id]:N},fetchers:new Map(y.fetchers)},{flushSync:($&&$.flushSync)===!0})}function Ce(P){return Ae.set(P,(Ae.get(P)||0)+1),Le.has(P)&&Le.delete(P),y.fetchers.get(P)||kA}function wt(P){let L=y.fetchers.get(P);M.has(P)&&!(L&&L.state==="loading"&&Z.has(P))&&it(P),C.delete(P),Z.delete(P),pe.delete(P),c.v7_fetcherPersist&&Le.delete(P),Q.delete(P),y.fetchers.delete(P)}function pr(P){let L=(Ae.get(P)||0)-1;L<=0?(Ae.delete(P),Le.add(P),c.v7_fetcherPersist||wt(P)):Ae.set(P,L),Ge({fetchers:new Map(y.fetchers)})}function it(P){let L=M.get(P);L&&(L.abort(),M.delete(P))}function Nr(P){for(let L of P){let N=Ce(L),$=Qr(N.data);y.fetchers.set(L,$)}}function Fr(){let P=[],L=!1;for(let N of pe){let $=y.fetchers.get(N);ce($,"Expected fetcher: "+N),$.state==="loading"&&(pe.delete(N),P.push(N),L=!0)}return Nr(P),L}function xt(P){let L=[];for(let[N,$]of Z)if($0}function Dr(P,L){let N=y.blockers.get(P)||Wo;return qe.get(P)!==L&&qe.set(P,L),N}function an(P){y.blockers.delete(P),qe.delete(P)}function yl(P,L){let N=y.blockers.get(P)||Wo;ce(N.state==="unblocked"&&L.state==="blocked"||N.state==="blocked"&&L.state==="blocked"||N.state==="blocked"&&L.state==="proceeding"||N.state==="blocked"&&L.state==="unblocked"||N.state==="proceeding"&&L.state==="unblocked","Invalid blocker state transition: "+N.state+" -> "+L.state);let $=new Map(y.blockers);$.set(P,L),Ge({blockers:$})}function sg(P){let{currentLocation:L,nextLocation:N,historyAction:$}=P;if(qe.size===0)return;qe.size>1&&yo(!1,"A router only supports one blocker at a time");let W=Array.from(qe.entries()),[ne,oe]=W[W.length-1],J=y.blockers.get(ne);if(!(J&&J.state==="proceeding")&&oe({currentLocation:L,nextLocation:N,historyAction:$}))return ne}function ff(P){let L=jt(404,{pathname:P}),N=a||o,{matches:$,route:W}=ev(N);return df(),{notFoundMatches:$,route:W,error:L}}function df(P){let L=[];return ye.forEach((N,$)=>{(!P||P($))&&(N.cancel(),L.push($),ye.delete($))}),L}function sE(P,L,N){if(g=P,x=L,v=N||null,!m&&y.navigation===Qf){m=!0;let $=ag(y.location,y.matches);$!=null&&Ge({restoreScrollPosition:$})}return()=>{g=null,x=null,v=null}}function og(P,L){return v&&v(P,L.map($=>rA($,y.loaderData)))||P.key}function oE(P,L){if(g&&x){let N=og(P,L);g[N]=x()}}function ag(P,L){if(g){let N=og(P,L),$=g[N];if(typeof $=="number")return $}return null}function vl(P,L,N){if(f)if(P){if(Object.keys(P[0].params).length>0)return{active:!0,matches:gu(L,N,l,!0)}}else return{active:!0,matches:gu(L,N,l,!0)||[]};return{active:!1,matches:null}}async function wl(P,L,N,$){if(!f)return{type:"success",matches:P};let W=P;for(;;){let ne=a==null,oe=a||o,J=s;try{await f({signal:N,path:L,matches:W,fetcherKey:$,patch:(ee,fe)=>{N.aborted||qy(ee,fe,oe,J,i)}})}catch(ee){return{type:"error",error:ee,partialMatches:W}}finally{ne&&!N.aborted&&(o=[...o])}if(N.aborted)return{type:"aborted"};let X=Mi(oe,L,l);if(X)return{type:"success",matches:X};let q=gu(oe,L,l,!0);if(!q||W.length===q.length&&W.every((ee,fe)=>ee.route.id===q[fe].route.id))return{type:"success",matches:null};W=q}}function aE(P){s={},a=tc(P,i,void 0,s)}function lE(P,L){let N=a==null;qy(P,L,a||o,s,i),N&&(o=[...o],Ge({}))}return E={get basename(){return l},get future(){return c},get state(){return y},get routes(){return o},get window(){return t},initialize:xn,subscribe:dr,enableScrollRestoration:sE,navigate:Ri,fetch:lf,revalidate:us,createHref:P=>e.history.createHref(P),encodeLocation:P=>e.history.encodeLocation(P),getFetcher:Ce,deleteFetcher:pr,dispose:Sn,getBlocker:Dr,deleteBlocker:an,patchRoutes:lE,_internalFetchControllers:M,_internalActiveDeferreds:ye,_internalSetRoutes:aE},E}function AA(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function Ch(e,t,n,r,i,s,o,a){let l,u;if(o){l=[];for(let c of t)if(l.push(c),c.route.id===o){u=c;break}}else l=t,u=t[t.length-1];let f=Bc(i||".",Uc(l,s),xi(e.pathname,n)||e.pathname,a==="path");if(i==null&&(f.search=e.search,f.hash=e.hash),(i==null||i===""||i===".")&&u){let c=hm(f.search);if(u.route.index&&!c)f.search=f.search?f.search.replace(/^\?/,"?index&"):"?index";else if(!u.route.index&&c){let d=new URLSearchParams(f.search),h=d.getAll("index");d.delete("index"),h.filter(v=>v).forEach(v=>d.append("index",v));let g=d.toString();f.search=g?"?"+g:""}}return r&&n!=="/"&&(f.pathname=f.pathname==="/"?n:sr([n,f.pathname])),wi(f)}function Vy(e,t,n,r){if(!r||!AA(r))return{path:n};if(r.formMethod&&!UA(r.formMethod))return{path:n,error:jt(405,{method:r.formMethod})};let i=()=>({path:n,error:jt(400,{type:"invalid-body"})}),s=r.formMethod||"get",o=e?s.toUpperCase():s.toLowerCase(),a=i1(n);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!Tn(o))return i();let d=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((h,g)=>{let[v,x]=g;return""+h+v+"="+x+` `},""):String(r.body);return{path:n,submission:{formMethod:o,formAction:a,formEncType:r.formEncType,formData:void 0,json:void 0,text:d}}}else if(r.formEncType==="application/json"){if(!Tn(o))return i();try{let d=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:n,submission:{formMethod:o,formAction:a,formEncType:r.formEncType,formData:void 0,json:d,text:void 0}}}catch{return i()}}}ce(typeof FormData=="function","FormData is not available in this environment");let l,u;if(r.formData)l=Ph(r.formData),u=r.formData;else if(r.body instanceof FormData)l=Ph(r.body),u=r.body;else if(r.body instanceof URLSearchParams)l=r.body,u=Gy(l);else if(r.body==null)l=new URLSearchParams,u=new FormData;else try{l=new URLSearchParams(r.body),u=Gy(l)}catch{return i()}let f={formMethod:o,formAction:a,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:u,json:void 0,text:void 0};if(Tn(f.formMethod))return{path:n,submission:f};let c=_i(n);return t&&c.search&&hm(c.search)&&l.append("index",""),c.search="?"+l,{path:wi(c),submission:f}}function Wy(e,t,n){n===void 0&&(n=!1);let r=e.findIndex(i=>i.route.id===t);return r>=0?e.slice(0,n?r+1:r):e}function Qy(e,t,n,r,i,s,o,a,l,u,f,c,d,h,g,v){let x=v?Xt(v[1])?v[1].error:v[1].data:void 0,m=e.createURL(t.location),p=e.createURL(i),w=n;s&&t.errors?w=Wy(n,Object.keys(t.errors)[0],!0):v&&Xt(v[1])&&(w=Wy(n,v[0]));let S=v?v[1].statusCode:void 0,k=o&&S&&S>=400,E=w.filter((R,T)=>{let{route:A}=R;if(A.lazy)return!0;if(A.loader==null)return!1;if(s)return kh(A,t.loaderData,t.errors);if(TA(t.loaderData,t.matches[T],R)||l.some(z=>z===R.route.id))return!0;let O=t.matches[T],I=R;return Ky(R,De({currentUrl:m,currentParams:O.params,nextUrl:p,nextParams:I.params},r,{actionResult:x,actionStatus:S,defaultShouldRevalidate:k?!1:a||m.pathname+m.search===p.pathname+p.search||m.search!==p.search||n1(O,I)}))}),y=[];return c.forEach((R,T)=>{if(s||!n.some(B=>B.route.id===R.routeId)||f.has(T))return;let A=Mi(h,R.path,g);if(!A){y.push({key:T,routeId:R.routeId,path:R.path,matches:null,match:null,controller:null});return}let O=t.fetchers.get(T),I=ta(A,R.path),z=!1;d.has(T)?z=!1:u.has(T)?(u.delete(T),z=!0):O&&O.state!=="idle"&&O.data===void 0?z=a:z=Ky(I,De({currentUrl:m,currentParams:t.matches[t.matches.length-1].params,nextUrl:p,nextParams:n[n.length-1].params},r,{actionResult:x,actionStatus:S,defaultShouldRevalidate:k?!1:a})),z&&y.push({key:T,routeId:R.routeId,path:R.path,matches:A,match:I,controller:new AbortController})}),[E,y]}function kh(e,t,n){if(e.lazy)return!0;if(!e.loader)return!1;let r=t!=null&&t[e.id]!==void 0,i=n!=null&&n[e.id]!==void 0;return!r&&i?!1:typeof e.loader=="function"&&e.loader.hydrate===!0?!0:!r&&!i}function TA(e,t,n){let r=!t||n.route.id!==t.route.id,i=e[n.route.id]===void 0;return r||i}function n1(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function Ky(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}function qy(e,t,n,r,i){var s;let o;if(e){let u=r[e];ce(u,"No route found to patch children into: routeId = "+e),u.children||(u.children=[]),o=u.children}else o=n;let a=t.filter(u=>!o.some(f=>r1(u,f))),l=tc(a,i,[e||"_","patch",String(((s=o)==null?void 0:s.length)||"0")],r);o.push(...l)}function r1(e,t){return"id"in e&&"id"in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children.every((n,r)=>{var i;return(i=t.children)==null?void 0:i.some(s=>r1(n,s))}):!1}async function OA(e,t,n){if(!e.lazy)return;let r=await e.lazy();if(!e.lazy)return;let i=n[e.id];ce(i,"No route found in manifest");let s={};for(let o in r){let l=i[o]!==void 0&&o!=="hasErrorBoundary";yo(!l,'Route "'+i.id+'" has a static property "'+o+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+o+'" will be ignored.')),!l&&!tA.has(o)&&(s[o]=r[o])}Object.assign(i,s),Object.assign(i,De({},t(i),{lazy:void 0}))}async function IA(e){let{matches:t}=e,n=t.filter(i=>i.shouldLoad);return(await Promise.all(n.map(i=>i.resolve()))).reduce((i,s,o)=>Object.assign(i,{[n[o].route.id]:s}),{})}async function LA(e,t,n,r,i,s,o,a,l,u){let f=s.map(h=>h.route.lazy?OA(h.route,l,a):void 0),c=s.map((h,g)=>{let v=f[g],x=i.some(p=>p.route.id===h.route.id);return De({},h,{shouldLoad:x,resolve:async p=>(p&&r.method==="GET"&&(h.route.lazy||h.route.loader)&&(x=!0),x?MA(t,r,h,v,p,u):Promise.resolve({type:ke.data,result:void 0}))})}),d=await e({matches:c,request:r,params:s[0].params,fetcherKey:o,context:u});try{await Promise.all(f)}catch{}return d}async function MA(e,t,n,r,i,s){let o,a,l=u=>{let f,c=new Promise((g,v)=>f=v);a=()=>f(),t.signal.addEventListener("abort",a);let d=g=>typeof u!="function"?Promise.reject(new Error("You cannot call the handler for a route which defines a boolean "+('"'+e+'" [routeId: '+n.route.id+"]"))):u({request:t,params:n.params,context:s},...g!==void 0?[g]:[]),h=(async()=>{try{return{type:"data",result:await(i?i(v=>d(v)):d())}}catch(g){return{type:"error",result:g}}})();return Promise.race([h,c])};try{let u=n.route[e];if(r)if(u){let f,[c]=await Promise.all([l(u).catch(d=>{f=d}),r]);if(f!==void 0)throw f;o=c}else if(await r,u=n.route[e],u)o=await l(u);else if(e==="action"){let f=new URL(t.url),c=f.pathname+f.search;throw jt(405,{method:t.method,pathname:c,routeId:n.route.id})}else return{type:ke.data,result:void 0};else if(u)o=await l(u);else{let f=new URL(t.url),c=f.pathname+f.search;throw jt(404,{pathname:c})}ce(o.result!==void 0,"You defined "+(e==="action"?"an action":"a loader")+" for route "+('"'+n.route.id+"\" but didn't return anything from your `"+e+"` ")+"function. Please return a value or `null`.")}catch(u){return{type:ke.error,result:u}}finally{a&&t.signal.removeEventListener("abort",a)}return o}async function NA(e){let{result:t,type:n}=e;if(s1(t)){let c;try{let d=t.headers.get("Content-Type");d&&/\bapplication\/json\b/.test(d)?t.body==null?c=null:c=await t.json():c=await t.text()}catch(d){return{type:ke.error,error:d}}return n===ke.error?{type:ke.error,error:new nc(t.status,t.statusText,c),statusCode:t.status,headers:t.headers}:{type:ke.data,data:c,statusCode:t.status,headers:t.headers}}if(n===ke.error){if(tv(t)){var r,i;if(t.data instanceof Error){var s,o;return{type:ke.error,error:t.data,statusCode:(s=t.init)==null?void 0:s.status,headers:(o=t.init)!=null&&o.headers?new Headers(t.init.headers):void 0}}return{type:ke.error,error:new nc(((r=t.init)==null?void 0:r.status)||500,void 0,t.data),statusCode:Qa(t)?t.status:void 0,headers:(i=t.init)!=null&&i.headers?new Headers(t.init.headers):void 0}}return{type:ke.error,error:t,statusCode:Qa(t)?t.status:void 0}}if(zA(t)){var a,l;return{type:ke.deferred,deferredData:t,statusCode:(a=t.init)==null?void 0:a.status,headers:((l=t.init)==null?void 0:l.headers)&&new Headers(t.init.headers)}}if(tv(t)){var u,f;return{type:ke.data,data:t.data,statusCode:(u=t.init)==null?void 0:u.status,headers:(f=t.init)!=null&&f.headers?new Headers(t.init.headers):void 0}}return{type:ke.data,data:t}}function FA(e,t,n,r,i,s){let o=e.headers.get("Location");if(ce(o,"Redirects returned/thrown from loaders/actions must have a Location header"),!fm.test(o)){let a=r.slice(0,r.findIndex(l=>l.route.id===n)+1);o=Ch(new URL(t.url),a,i,!0,o,s),e.headers.set("Location",o)}return e}function Jy(e,t,n){if(fm.test(e)){let r=e,i=r.startsWith("//")?new URL(t.protocol+r):new URL(r),s=xi(i.pathname,n)!=null;if(i.origin===t.origin&&s)return i.pathname+i.search+i.hash}return e}function ms(e,t,n,r){let i=e.createURL(i1(t)).toString(),s={signal:n};if(r&&Tn(r.formMethod)){let{formMethod:o,formEncType:a}=r;s.method=o.toUpperCase(),a==="application/json"?(s.headers=new Headers({"Content-Type":a}),s.body=JSON.stringify(r.json)):a==="text/plain"?s.body=r.text:a==="application/x-www-form-urlencoded"&&r.formData?s.body=Ph(r.formData):s.body=r.formData}return new Request(i,s)}function Ph(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function Gy(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function DA(e,t,n,r,i){let s={},o=null,a,l=!1,u={},f=n&&Xt(n[1])?n[1].error:void 0;return e.forEach(c=>{if(!(c.route.id in t))return;let d=c.route.id,h=t[d];if(ce(!zi(h),"Cannot handle redirect results in processLoaderData"),Xt(h)){let g=h.error;f!==void 0&&(g=f,f=void 0),o=o||{};{let v=Ni(e,d);o[v.route.id]==null&&(o[v.route.id]=g)}s[d]=void 0,l||(l=!0,a=Qa(h.error)?h.error.status:500),h.headers&&(u[d]=h.headers)}else ii(h)?(r.set(d,h.deferredData),s[d]=h.deferredData.data,h.statusCode!=null&&h.statusCode!==200&&!l&&(a=h.statusCode),h.headers&&(u[d]=h.headers)):(s[d]=h.data,h.statusCode&&h.statusCode!==200&&!l&&(a=h.statusCode),h.headers&&(u[d]=h.headers))}),f!==void 0&&n&&(o={[n[0]]:f},s[n[0]]=void 0),{loaderData:s,errors:o,statusCode:a||200,loaderHeaders:u}}function Xy(e,t,n,r,i,s,o){let{loaderData:a,errors:l}=DA(t,n,r,o);return i.forEach(u=>{let{key:f,match:c,controller:d}=u,h=s[f];if(ce(h,"Did not find corresponding fetcher result"),!(d&&d.signal.aborted))if(Xt(h)){let g=Ni(e.matches,c==null?void 0:c.route.id);l&&l[g.route.id]||(l=De({},l,{[g.route.id]:h.error})),e.fetchers.delete(f)}else if(zi(h))ce(!1,"Unhandled fetcher revalidation redirect");else if(ii(h))ce(!1,"Unhandled fetcher deferred data");else{let g=Qr(h.data);e.fetchers.set(f,g)}}),{loaderData:a,errors:l}}function Yy(e,t,n,r){let i=De({},t);for(let s of n){let o=s.route.id;if(t.hasOwnProperty(o)?t[o]!==void 0&&(i[o]=t[o]):e[o]!==void 0&&s.route.loader&&(i[o]=e[o]),r&&r.hasOwnProperty(o))break}return i}function Zy(e){return e?Xt(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Ni(e,t){return(t?e.slice(0,e.findIndex(r=>r.route.id===t)+1):[...e]).reverse().find(r=>r.route.hasErrorBoundary===!0)||e[0]}function ev(e){let t=e.length===1?e[0]:e.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function jt(e,t){let{pathname:n,routeId:r,method:i,type:s,message:o}=t===void 0?{}:t,a="Unknown Server Error",l="Unknown @remix-run/router error";return e===400?(a="Bad Request",i&&n&&r?l="You made a "+i+' request to "'+n+'" but '+('did not provide a `loader` for route "'+r+'", ')+"so there is no way to handle the request.":s==="defer-action"?l="defer() is not supported in actions":s==="invalid-body"&&(l="Unable to encode submission body")):e===403?(a="Forbidden",l='Route "'+r+'" does not match URL "'+n+'"'):e===404?(a="Not Found",l='No route matches URL "'+n+'"'):e===405&&(a="Method Not Allowed",i&&n&&r?l="You made a "+i.toUpperCase()+' request to "'+n+'" but '+('did not provide an `action` for route "'+r+'", ')+"so there is no way to handle the request.":i&&(l='Invalid request method "'+i.toUpperCase()+'"')),new nc(e||500,a,new Error(l),!0)}function Hl(e){let t=Object.entries(e);for(let n=t.length-1;n>=0;n--){let[r,i]=t[n];if(zi(i))return{key:r,result:i}}}function i1(e){let t=typeof e=="string"?_i(e):e;return wi(De({},t,{hash:""}))}function $A(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function jA(e){return s1(e.result)&&_A.has(e.result.status)}function ii(e){return e.type===ke.deferred}function Xt(e){return e.type===ke.error}function zi(e){return(e&&e.type)===ke.redirect}function tv(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function zA(e){let t=e;return t&&typeof t=="object"&&typeof t.data=="object"&&typeof t.subscribe=="function"&&typeof t.cancel=="function"&&typeof t.resolveData=="function"}function s1(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function UA(e){return EA.has(e.toLowerCase())}function Tn(e){return SA.has(e.toLowerCase())}async function BA(e,t,n,r,i){let s=Object.entries(t);for(let o=0;o(d==null?void 0:d.route.id)===a);if(!u)continue;let f=r.find(d=>d.route.id===u.route.id),c=f!=null&&!n1(f,u)&&(i&&i[u.route.id])!==void 0;ii(l)&&c&&await dm(l,n,!1).then(d=>{d&&(t[a]=d)})}}async function HA(e,t,n){for(let r=0;r(u==null?void 0:u.route.id)===s)&&ii(a)&&(ce(o,"Expected an AbortController for revalidating fetcher deferred result"),await dm(a,o.signal,!0).then(u=>{u&&(t[i]=u)}))}}async function dm(e,t,n){if(n===void 0&&(n=!1),!await e.deferredData.resolveData(t)){if(n)try{return{type:ke.data,data:e.deferredData.unwrappedData}}catch(i){return{type:ke.error,error:i}}return{type:ke.data,data:e.deferredData.data}}}function hm(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function ta(e,t){let n=typeof t=="string"?_i(t).search:t.search;if(e[e.length-1].route.index&&hm(n||""))return e[e.length-1];let r=ZS(e);return r[r.length-1]}function nv(e){let{formMethod:t,formAction:n,formEncType:r,text:i,formData:s,json:o}=e;if(!(!t||!n||!r)){if(i!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:i};if(s!=null)return{formMethod:t,formAction:n,formEncType:r,formData:s,json:void 0,text:void 0};if(o!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:o,text:void 0}}}function Kf(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function VA(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function Qo(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function WA(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function Qr(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function QA(e,t){try{let n=e.sessionStorage.getItem(t1);if(n){let r=JSON.parse(n);for(let[i,s]of Object.entries(r||{}))s&&Array.isArray(s)&&t.set(i,new Set(s||[]))}}catch{}}function KA(e,t){if(t.size>0){let n={};for(let[r,i]of t)n[r]=[...i];try{e.sessionStorage.setItem(t1,JSON.stringify(n))}catch(r){yo(!1,"Failed to save applied view transitions in sessionStorage ("+r+").")}}}/** * React Router v6.30.0 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function rc(){return rc=Object.assign?Object.assign.bind():function(e){for(var t=1;t{a.current=!0}),_.useCallback(function(u,f){if(f===void 0&&(f={}),!a.current)return;if(typeof u=="number"){r.go(u);return}let c=Bc(u,JSON.parse(o),s,f.relative==="path");e==null&&t!=="/"&&(c.pathname=c.pathname==="/"?t:sr([t,c.pathname])),(f.replace?r.replace:r.push)(c,f.state,f)},[t,r,o,s,e])}function L2(){let{matches:e}=_.useContext(cr),t=e[e.length-1];return t?t.params:{}}function gm(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=_.useContext(ur),{matches:i}=_.useContext(cr),{pathname:s}=as(),o=JSON.stringify(Uc(i,r.v7_relativeSplatPath));return _.useMemo(()=>Bc(e,JSON.parse(o),s,n==="path"),[e,o,s,n])}function GA(e,t,n,r){ko()||ce(!1);let{navigator:i,static:s}=_.useContext(ur),{matches:o}=_.useContext(cr),a=o[o.length-1],l=a?a.params:{};a&&a.pathname;let u=a?a.pathnameBase:"/";a&&a.route;let f=as(),c;c=f;let d=c.pathname||"/",h=d;if(u!=="/"){let x=u.replace(/^\//,"").split("/");h="/"+d.replace(/^\//,"").split("/").slice(x.length).join("/")}let g=!s&&n&&n.matches&&n.matches.length>0?n.matches:Mi(e,{pathname:h});return tT(g&&g.map(x=>Object.assign({},x,{params:Object.assign({},l,x.params),pathname:sr([u,i.encodeLocation?i.encodeLocation(x.pathname).pathname:x.pathname]),pathnameBase:x.pathnameBase==="/"?u:sr([u,i.encodeLocation?i.encodeLocation(x.pathnameBase).pathname:x.pathnameBase])})),o,n,r)}function XA(){let e=oT(),t=Qa(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return _.createElement(_.Fragment,null,_.createElement("h2",null,"Unexpected Application Error!"),_.createElement("h3",{style:{fontStyle:"italic"}},t),n?_.createElement("pre",{style:i},n):null,null)}const YA=_.createElement(XA,null);class ZA extends _.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?_.createElement(cr.Provider,{value:this.props.routeContext},_.createElement(a1.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function eT(e){let{routeContext:t,match:n,children:r}=e,i=_.useContext(al);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),_.createElement(cr.Provider,{value:t},r)}function tT(e,t,n,r){var i;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var s;if(!n)return null;if(n.errors)e=n.matches;else if((s=r)!=null&&s.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,a=(i=n)==null?void 0:i.errors;if(a!=null){let f=o.findIndex(c=>c.route.id&&(a==null?void 0:a[c.route.id])!==void 0);f>=0||ce(!1),o=o.slice(0,Math.min(o.length,f+1))}let l=!1,u=-1;if(n&&r&&r.v7_partialHydration)for(let f=0;f=0?o=o.slice(0,u+1):o=[o[0]];break}}}return o.reduceRight((f,c,d)=>{let h,g=!1,v=null,x=null;n&&(h=a&&c.route.id?a[c.route.id]:void 0,v=c.route.errorElement||YA,l&&(u<0&&d===0?(lT("route-fallback"),g=!0,x=null):u===d&&(g=!0,x=c.route.hydrateFallbackElement||null)));let m=t.concat(o.slice(0,d+1)),p=()=>{let w;return h?w=v:g?w=x:c.route.Component?w=_.createElement(c.route.Component,null):c.route.element?w=c.route.element:w=f,_.createElement(eT,{match:c,routeContext:{outlet:f,matches:m,isDataRoute:n!=null},children:w})};return n&&(c.route.ErrorBoundary||c.route.errorElement||d===0)?_.createElement(ZA,{location:n.location,revalidation:n.revalidation,component:v,error:h,children:p(),routeContext:{outlet:null,matches:m,isDataRoute:!0}}):p()},null)}var u1=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(u1||{}),c1=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(c1||{});function nT(e){let t=_.useContext(al);return t||ce(!1),t}function rT(e){let t=_.useContext(o1);return t||ce(!1),t}function iT(e){let t=_.useContext(cr);return t||ce(!1),t}function ym(e){let t=iT(),n=t.matches[t.matches.length-1];return n.route.id||ce(!1),n.route.id}function sT(){return ym()}function oT(){var e;let t=_.useContext(a1),n=rT(),r=ym();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function aT(){let{router:e}=nT(u1.UseNavigateStable),t=ym(c1.UseNavigateStable),n=_.useRef(!1);return l1(()=>{n.current=!0}),_.useCallback(function(i,s){s===void 0&&(s={}),n.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,rc({fromRouteId:t},s)))},[e,t])}const rv={};function lT(e,t,n){rv[e]||(rv[e]=!0)}function uT(e,t){e==null||e.v7_startTransition,(e==null?void 0:e.v7_relativeSplatPath)===void 0&&(!t||t.v7_relativeSplatPath),t&&(t.v7_fetcherPersist,t.v7_normalizeFormMethod,t.v7_partialHydration,t.v7_skipActionErrorRevalidation)}function cT(e){let{to:t,replace:n,state:r,relative:i}=e;ko()||ce(!1);let{future:s,static:o}=_.useContext(ur),{matches:a}=_.useContext(cr),{pathname:l}=as(),u=mm(),f=Bc(t,Uc(a,s.v7_relativeSplatPath),l,i==="path"),c=JSON.stringify(f);return _.useEffect(()=>u(JSON.parse(c),{replace:n,state:r,relative:i}),[u,c,i,n,r]),null}function na(e){ce(!1)}function fT(e){let{basename:t="/",children:n=null,location:r,navigationType:i=Ye.Pop,navigator:s,static:o=!1,future:a}=e;ko()&&ce(!1);let l=t.replace(/^\/*/,"/"),u=_.useMemo(()=>({basename:l,navigator:s,static:o,future:rc({v7_relativeSplatPath:!1},a)}),[l,a,s,o]);typeof r=="string"&&(r=_i(r));let{pathname:f="/",search:c="",hash:d="",state:h=null,key:g="default"}=r,v=_.useMemo(()=>{let x=xi(f,l);return x==null?null:{location:{pathname:x,search:c,hash:d,state:h,key:g},navigationType:i}},[l,f,c,d,h,g,i]);return v==null?null:_.createElement(ur.Provider,{value:u},_.createElement(pm.Provider,{children:n,value:v}))}new Promise(()=>{});function Rh(e,t){t===void 0&&(t=[]);let n=[];return _.Children.forEach(e,(r,i)=>{if(!_.isValidElement(r))return;let s=[...t,i];if(r.type===_.Fragment){n.push.apply(n,Rh(r.props.children,s));return}r.type!==na&&ce(!1),!r.props.index||!r.props.children||ce(!1);let o={id:r.props.id||s.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(o.children=Rh(r.props.children,s)),n.push(o)}),n}function dT(e){let t={hasErrorBoundary:e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&Object.assign(t,{element:_.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:_.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:_.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}/** * React Router DOM v6.30.0 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function ns(){return ns=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[i]=e[i]);return n}const yu="get",qf="application/x-www-form-urlencoded";function Hc(e){return e!=null&&typeof e.tagName=="string"}function hT(e){return Hc(e)&&e.tagName.toLowerCase()==="button"}function pT(e){return Hc(e)&&e.tagName.toLowerCase()==="form"}function mT(e){return Hc(e)&&e.tagName.toLowerCase()==="input"}function gT(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function yT(e,t){return e.button===0&&(!t||t==="_self")&&!gT(e)}function Ah(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(i=>[n,i]):[[n,r]])},[]))}function vT(e,t){let n=Ah(e);return t&&t.forEach((r,i)=>{n.has(i)||t.getAll(i).forEach(s=>{n.append(i,s)})}),n}let Vl=null;function wT(){if(Vl===null)try{new FormData(document.createElement("form"),0),Vl=!1}catch{Vl=!0}return Vl}const xT=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Jf(e){return e!=null&&!xT.has(e)?null:e}function ST(e,t){let n,r,i,s,o;if(pT(e)){let a=e.getAttribute("action");r=a?xi(a,t):null,n=e.getAttribute("method")||yu,i=Jf(e.getAttribute("enctype"))||qf,s=new FormData(e)}else if(hT(e)||mT(e)&&(e.type==="submit"||e.type==="image")){let a=e.form;if(a==null)throw new Error('Cannot submit a """ def extract_html(result: str): fm = {} parts = result.split("---") try: if len(parts) > 2: fm = yaml.safe_load(parts[1]) if not isinstance(fm, dict): fm = {"name": fm} md = "---".join(parts[2:]) elif len(parts) == 2: fm = yaml.safe_load(parts[0]) if not isinstance(fm, dict): fm = {"name": fm} md = parts[1] else: md = result except Exception as e: print(f"Error parsing frontmatter: {e}") print(parts) fm["name"] = "Component" fm["emoji"] = "🎉" md = result doc = mistletoe.Document(md) html = "" blocks = 0 for node in doc.children: if isinstance(node, mistletoe.block_token.CodeFence): blocks += 1 if node.language == "js" or node.language == "javascript": html += f"\n" else: html += f"{node.children[0].content}\n" if blocks == 0: html = md fm["html"] = html.strip() return fm async def synth(prompt, model="gpt-3.5-turbo"): print(f"Generating HTML for: {prompt}") completion = await openai.chat.completions.create( messages=[ { "role": "system", "content": SYSTEM_PROMPT, }, { "role": "user", "content": prompt, }, ], max_tokens=2048, temperature=0.5, model=model, ) result = completion.choices[0].message.content parsed = extract_html(result) parsed["prompt"] = prompt return parsed async def main(model="gpt-3.5-turbo"): eval_csv = Path(__file__).parent / "datasets" / "eval.csv" gen_json = Path(__file__).parent / "datasets" / f"{model}.json" screenshot_dir = Path(__file__).parent / "datasets" / model screenshot_dir.mkdir(exist_ok=True) # Regenerate screenshots only for existing generations if gen_json.exists(): with open(gen_json, "r") as f: results = json.load(f) for i, row in enumerate(results): await gen_screenshots(f"prompt-{i}", row["html"], screenshot_dir) row["desktop_img"] = f"./{model}/prompt-{i}.combined.png" row["mobile_img"] = f"./{model}/prompt-{i}.combined.mobile.png" with open(gen_json, "w") as f: f.write(json.dumps(results, indent=4)) return with open(eval_csv, "r") as f: reader = csv.DictReader(f) tasks = [synth(row["prompt"], model) for i, row in enumerate(reader)] results = await asyncio.gather(*tasks) for i, row in enumerate(results): await gen_screenshots(f"prompt-{i}", row["html"], screenshot_dir) row["desktop_img"] = f"./{model}/prompt-{i}.combined.png" row["mobile_img"] = f"./{model}/prompt-{i}.combined.mobile.png" with open(gen_json, "w") as f: f.write(json.dumps(results, indent=4)) if __name__ == "__main__": if len(sys.argv) > 1: model = sys.argv[1] else: model = "gpt-3.5-turbo" if model.startswith("ollama/"): model = model.replace("ollama/", "") openai = AsyncOpenAI(base_url="http://localhost:11434/v1") else: openai = AsyncOpenAI() asyncio.run(main(model)) ================================================ FILE: backend/openui/eval/promptsearch.py ================================================ [File too large to display: 12.0 KB] ================================================ FILE: backend/openui/eval/scrape.py ================================================ [File too large to display: 3.5 KB] ================================================ FILE: backend/openui/eval/screenshots.py ================================================ [File too large to display: 589 B] ================================================ FILE: backend/openui/eval/svg_annotator.html ================================================ [File too large to display: 163.7 KB] ================================================ FILE: backend/openui/eval/synthesize.py ================================================ [File too large to display: 2.7 KB] ================================================ FILE: backend/openui/eval/to_fine_tune.py ================================================ [File too large to display: 6.4 KB] ================================================ FILE: backend/openui/litellm.py ================================================ import yaml import os import tempfile import openai from .logs import logger def generate_config(): models = [] if "GEMINI_API_KEY" in os.environ: models.extend( [ { "model_name": "gemini-1.5-flash", "litellm_params": { "model": "gemini/gemini-1.5-flash-latest", }, }, { "model_name": "gemini-1.5-pro", "litellm_params": { "model": "gemini/gemini-1.5-pro-latest", }, }, ] ) if "ANTHROPIC_API_KEY" in os.environ: models.extend( [ { "model_name": "claude-3-opus", "litellm_params": { "model": "claude-3-opus-20240229", }, }, { "model_name": "claude-3-5-sonnet", "litellm_params": { "model": "claude-3-5-sonnet-20240620", }, }, { "model_name": "claude-3-haiku", "litellm_params": { "model": "claude-3-haiku-20240307", }, }, ] ) if "COHERE_API_KEY" in os.environ: models.extend( [ { "model_name": "command-r-plus", "litellm_params": { "model": "command-r-plus", }, }, { "model_name": "command-r", "litellm_params": { "model": "command-r", }, }, { "model_name": "command-light", "litellm_params": { "model": "command-light", }, }, ] ) if "MISTRAL_API_KEY" in os.environ: models.extend( [ { "model_name": "mistral-small", "litellm_params": { "model": "mistral/mistral-small-latest", }, }, { "model_name": "mistral-medium", "litellm_params": { "model": "mistral/mistral-medium-latest", }, }, { "model_name": "mistral-large", "litellm_params": { "model": "mistral/mistral-large-latest", }, }, ] ) if "OPENAI_COMPATIBLE_ENDPOINT" in os.environ: client = openai.OpenAI( api_key=os.getenv("OPENAI_COMPATIBLE_API_KEY"), base_url=os.getenv("OPENAI_COMPATIBLE_ENDPOINT"), ) try: for model in client.models.list().data: models.append( { "model_name": model.id, "litellm_params": { "model": f"openai/{model.id}", "api_key": os.getenv("OPENAI_COMPATIBLE_API_KEY"), "base_url": os.getenv("OPENAI_COMPATIBLE_ENDPOINT"), }, } ) except Exception as e: logger.exception( f"Error listing models for {os.getenv('OPENAI_COMPATIBLE_ENDPOINT')}: %s", e, ) yaml_structure = {"model_list": models} with tempfile.NamedTemporaryFile( delete=False, mode="w", suffix=".yaml" ) as tmp_file: tmp_file.write(yaml.dump(yaml_structure, sort_keys=False)) tmp_file_path = tmp_file.name return tmp_file_path ================================================ FILE: backend/openui/log_config.yaml ================================================ [File too large to display: 764 B] ================================================ FILE: backend/openui/logo.ascii ================================================ [File too large to display: 1.4 KB] ================================================ FILE: backend/openui/logs.py ================================================ [File too large to display: 898 B] ================================================ FILE: backend/openui/models.py ================================================ [File too large to display: 783 B] ================================================ FILE: backend/openui/ollama.py ================================================ [File too large to display: 3.5 KB] ================================================ FILE: backend/openui/openai.py ================================================ [File too large to display: 719 B] ================================================ FILE: backend/openui/server.py ================================================ [File too large to display: 20.6 KB] ================================================ FILE: backend/openui/session.py ================================================ [File too large to display: 2.2 KB] ================================================ FILE: backend/openui/tui/app.py ================================================ [File too large to display: 2.4 KB] ================================================ FILE: backend/openui/tui/code.py ================================================ [File too large to display: 2.1 KB] ================================================ FILE: backend/openui/tui/code_browser.tcss ================================================ [File too large to display: 353 B] ================================================ FILE: backend/openui/tui/markdown.py ================================================ [File too large to display: 4.1 KB] ================================================ FILE: backend/openui/util/__init__.py ================================================ [File too large to display: 288 B] ================================================ FILE: backend/openui/util/email.py ================================================ [File too large to display: 442 B] ================================================ FILE: backend/openui/util/screenshots.py ================================================ [File too large to display: 4.3 KB] ================================================ FILE: backend/openui/util/storage.py ================================================ [File too large to display: 689 B] ================================================ FILE: backend/pyproject.toml ================================================ [File too large to display: 1.3 KB] ================================================ FILE: backend/tests/test_openui.py ================================================ [File too large to display: 602 B] ================================================ FILE: docker-compose.yaml ================================================ [File too large to display: 524 B] ================================================ FILE: frontend/.cz.json ================================================ [File too large to display: 41 B] ================================================ FILE: frontend/.github/CODEOWNERS ================================================ [File too large to display: 9 B] ================================================ FILE: frontend/.github/renovate.json ================================================ [File too large to display: 103 B] ================================================ FILE: frontend/.github/workflows/codeql-analysis.yml ================================================ [File too large to display: 554 B] ================================================ FILE: frontend/.gitignore ================================================ [File too large to display: 164 B] ================================================ FILE: frontend/.postcssrc.json ================================================ [File too large to display: 63 B] ================================================ FILE: frontend/.prettierrc.json ================================================ [File too large to display: 295 B] ================================================ FILE: frontend/.stylelintrc.json ================================================ [File too large to display: 154 B] ================================================ FILE: frontend/.vscode/extensions.json ================================================ [File too large to display: 191 B] ================================================ FILE: frontend/.vscode/settings.json ================================================ [File too large to display: 894 B] ================================================ FILE: frontend/LICENSE ================================================ [File too large to display: 10.7 KB] ================================================ FILE: frontend/README.md ================================================ [File too large to display: 427 B] ================================================ FILE: frontend/components.json ================================================ [File too large to display: 335 B] ================================================ FILE: frontend/eslint.config.mjs ================================================ [File too large to display: 1.0 KB] ================================================ FILE: frontend/index.html ================================================ [File too large to display: 1.1 KB] ================================================ FILE: frontend/integration_tests/basic.spec.ts ================================================ [File too large to display: 1.7 KB] ================================================ FILE: frontend/integration_tests/util.ts ================================================ [File too large to display: 44 B] ================================================ FILE: frontend/package.json ================================================ [File too large to display: 5.2 KB] ================================================ FILE: frontend/playwright.config.ts ================================================ [File too large to display: 2.3 KB] ================================================ FILE: frontend/public/annotator/index.html ================================================ [File too large to display: 18.1 KB] ================================================ FILE: frontend/public/logo.html ================================================ [File too large to display: 4.1 KB] ================================================ FILE: frontend/public/logo.txt ================================================ [File too large to display: 2.0 KB] ================================================ FILE: frontend/public/robots.txt ================================================ [File too large to display: 22 B] ================================================ FILE: frontend/src/App.tsx ================================================ [File too large to display: 1.6 KB] ================================================ FILE: frontend/src/__tests__/App.tsx ================================================ [File too large to display: 402 B] ================================================ FILE: frontend/src/__tests__/utils.ts ================================================ [File too large to display: 459 B] ================================================ FILE: frontend/src/api/models.ts ================================================ [File too large to display: 505 B] ================================================ FILE: frontend/src/api/openai.ts ================================================ [File too large to display: 6.9 KB] ================================================ FILE: frontend/src/api/openui.ts ================================================ [File too large to display: 5.5 KB] ================================================ FILE: frontend/src/components/Chat.tsx ================================================ [File too large to display: 9.9 KB] ================================================ FILE: frontend/src/components/CodeEditor.tsx ================================================ [File too large to display: 8.2 KB] ================================================ FILE: frontend/src/components/CodeViewer.tsx ================================================ [File too large to display: 6.1 KB] ================================================ FILE: frontend/src/components/CurrentUiContext.tsx ================================================ [File too large to display: 3.3 KB] ================================================ FILE: frontend/src/components/ErrorBoundary.tsx ================================================ [File too large to display: 1.0 KB] ================================================ FILE: frontend/src/components/Examples.tsx ================================================ [File too large to display: 5.0 KB] ================================================ FILE: frontend/src/components/FileUpload.tsx ================================================ [File too large to display: 2.7 KB] ================================================ FILE: frontend/src/components/Head.tsx ================================================ [File too large to display: 208 B] ================================================ FILE: frontend/src/components/History.tsx ================================================ [File too large to display: 3.2 KB] ================================================ FILE: frontend/src/components/HistoryItem.tsx ================================================ [File too large to display: 3.1 KB] ================================================ FILE: frontend/src/components/HtmlAnnotator.tsx ================================================ [File too large to display: 23.0 KB] ================================================ FILE: frontend/src/components/LoadingOrError.tsx ================================================ [File too large to display: 771 B] ================================================ FILE: frontend/src/components/Logo.tsx ================================================ [File too large to display: 2.1 KB] ================================================ FILE: frontend/src/components/NavBar.tsx ================================================ [File too large to display: 6.7 KB] ================================================ FILE: frontend/src/components/Prompt.tsx ================================================ [File too large to display: 17.5 KB] ================================================ FILE: frontend/src/components/Register.tsx ================================================ [File too large to display: 1.8 KB] ================================================ FILE: frontend/src/components/Scaffold.tsx ================================================ [File too large to display: 5.1 KB] ================================================ FILE: frontend/src/components/Screenshot.tsx ================================================ [File too large to display: 661 B] ================================================ FILE: frontend/src/components/Settings.tsx ================================================ [File too large to display: 10.4 KB] ================================================ FILE: frontend/src/components/ShareDialog.tsx ================================================ [File too large to display: 2.4 KB] ================================================ FILE: frontend/src/components/SyntaxHighlighter.tsx ================================================ [File too large to display: 1.0 KB] ================================================ FILE: frontend/src/components/VersionPreview.tsx ================================================ [File too large to display: 4.7 KB] ================================================ FILE: frontend/src/components/Versions.tsx ================================================ [File too large to display: 1.3 KB] ================================================ FILE: frontend/src/components/__tests__/LoadingOrError.tsx ================================================ [File too large to display: 515 B] ================================================ FILE: frontend/src/components/ui/avatar.tsx ================================================ [File too large to display: 1.3 KB] ================================================ FILE: frontend/src/components/ui/button.tsx ================================================ [File too large to display: 1.7 KB] ================================================ FILE: frontend/src/components/ui/checkbox.tsx ================================================ [File too large to display: 1023 B] ================================================ FILE: frontend/src/components/ui/dialog.tsx ================================================ [File too large to display: 3.7 KB] ================================================ FILE: frontend/src/components/ui/dropdown-menu.tsx ================================================ [File too large to display: 6.9 KB] ================================================ FILE: frontend/src/components/ui/hover-card.tsx ================================================ [File too large to display: 1.6 KB] ================================================ FILE: frontend/src/components/ui/input.tsx ================================================ [File too large to display: 823 B] ================================================ FILE: frontend/src/components/ui/label.tsx ================================================ [File too large to display: 695 B] ================================================ FILE: frontend/src/components/ui/popover.tsx ================================================ [File too large to display: 1.6 KB] ================================================ FILE: frontend/src/components/ui/select.tsx ================================================ [File too large to display: 5.3 KB] ================================================ FILE: frontend/src/components/ui/sheet.tsx ================================================ [File too large to display: 4.0 KB] ================================================ FILE: frontend/src/components/ui/slider.tsx ================================================ [File too large to display: 1.0 KB] ================================================ FILE: frontend/src/components/ui/switch.tsx ================================================ [File too large to display: 1.1 KB] ================================================ FILE: frontend/src/components/ui/textarea.tsx ================================================ [File too large to display: 763 B] ================================================ FILE: frontend/src/components/ui/tooltip.tsx ================================================ [File too large to display: 1.2 KB] ================================================ FILE: frontend/src/hooks/index.ts ================================================ [File too large to display: 2.5 KB] ================================================ FILE: frontend/src/index.css ================================================ [File too large to display: 3.7 KB] ================================================ FILE: frontend/src/lib/anysphere.ts ================================================ [File too large to display: 44.7 KB] ================================================ FILE: frontend/src/lib/constants.ts ================================================ [File too large to display: 3.3 KB] ================================================ FILE: frontend/src/lib/events.ts ================================================ [File too large to display: 1.1 KB] ================================================ FILE: frontend/src/lib/html.ts ================================================ [File too large to display: 6.9 KB] ================================================ FILE: frontend/src/lib/i18n.ts ================================================ [File too large to display: 1.1 KB] ================================================ FILE: frontend/src/lib/markdown.ts ================================================ [File too large to display: 4.2 KB] ================================================ FILE: frontend/src/lib/simple.ts ================================================ [File too large to display: 141 B] ================================================ FILE: frontend/src/lib/themes.ts ================================================ [File too large to display: 17.4 KB] ================================================ FILE: frontend/src/lib/utils.ts ================================================ [File too large to display: 2.8 KB] ================================================ FILE: frontend/src/lib/webauthn.ts ================================================ [File too large to display: 3.2 KB] ================================================ FILE: frontend/src/main.tsx ================================================ [File too large to display: 618 B] ================================================ FILE: frontend/src/mocks/handlers.ts ================================================ [File too large to display: 185 B] ================================================ FILE: frontend/src/mocks/server.ts ================================================ [File too large to display: 136 B] ================================================ FILE: frontend/src/pages/AI/index.tsx ================================================ [File too large to display: 2.4 KB] ================================================ FILE: frontend/src/setupTests.ts ================================================ [File too large to display: 2.1 KB] ================================================ FILE: frontend/src/state/atoms/history.ts ================================================ [File too large to display: 13.4 KB] ================================================ FILE: frontend/src/state/atoms/prompts.ts ================================================ [File too large to display: 563 B] ================================================ FILE: frontend/src/state/atoms/ui.ts ================================================ [File too large to display: 1010 B] ================================================ FILE: frontend/src/state/index.ts ================================================ [File too large to display: 1.2 KB] ================================================ FILE: frontend/src/testUtils.tsx ================================================ [File too large to display: 853 B] ================================================ FILE: frontend/tailwind.config.js ================================================ [File too large to display: 2.8 KB] ================================================ FILE: frontend/tsconfig.json ================================================ [File too large to display: 574 B] ================================================ FILE: frontend/tsconfig.node.json ================================================ [File too large to display: 332 B] ================================================ FILE: frontend/vercel.json ================================================ [File too large to display: 71 B] ================================================ FILE: frontend/vite.config.ts ================================================ [File too large to display: 2.5 KB] ================================================ FILE: openui.code-workspace ================================================ [File too large to display: 417 B]