Full Code of leaningtech/webvm for AI

main 3292ad102a27 cached
72 files
402.3 KB
122.2k tokens
1010 symbols
1 requests
Download .txt
Showing preview only (423K chars total). Download the full file or copy to clipboard to get everything.
Repository: leaningtech/webvm
Branch: main
Commit: 3292ad102a27
Files: 72
Total size: 402.3 KB

Directory structure:
gitextract_ehir5wbi/

├── .circleci/
│   └── config.yml
├── .github/
│   └── workflows/
│       └── deploy.yml
├── .gitignore
├── .npmrc
├── LICENSE.txt
├── README.md
├── config_github_terminal.js
├── config_public_alpine.js
├── config_public_terminal.js
├── dockerfiles/
│   ├── .dockerignore
│   ├── debian_large
│   └── debian_mini
├── documents/
│   ├── Welcome.txt
│   └── index.list
├── examples/
│   ├── c/
│   │   ├── Makefile
│   │   ├── env.c
│   │   ├── helloworld.c
│   │   ├── link.c
│   │   ├── openat.c
│   │   └── waitpid.c
│   ├── lua/
│   │   ├── fizzbuzz.lua
│   │   ├── sorting.lua
│   │   └── symmetric_difference.lua
│   ├── nodejs/
│   │   ├── environment.js
│   │   ├── nbody.js
│   │   ├── primes.js
│   │   └── wasm.js
│   ├── python3/
│   │   ├── factorial.py
│   │   ├── fibonacci.py
│   │   └── pi.py
│   └── ruby/
│       ├── helloWorld.rb
│       ├── love.rb
│       └── powOf2.rb
├── login.html
├── nginx.conf
├── package.json
├── postcss.config.js
├── scrollbar.css
├── serviceWorker.js
├── src/
│   ├── app.html
│   ├── lib/
│   │   ├── AnthropicTab.svelte
│   │   ├── BlogPost.svelte
│   │   ├── CpuTab.svelte
│   │   ├── DiscordTab.svelte
│   │   ├── DiskTab.svelte
│   │   ├── GitHubTab.svelte
│   │   ├── Icon.svelte
│   │   ├── InformationTab.svelte
│   │   ├── NetworkingTab.svelte
│   │   ├── PanelButton.svelte
│   │   ├── PostsTab.svelte
│   │   ├── SideBar.svelte
│   │   ├── SmallButton.svelte
│   │   ├── WebVM.svelte
│   │   ├── activities.js
│   │   ├── anthropic.js
│   │   ├── global.css
│   │   ├── messages.js
│   │   ├── network.js
│   │   └── plausible.js
│   └── routes/
│       ├── +layout.server.js
│       ├── +page.js
│       ├── +page.svelte
│       └── alpine/
│           ├── +page.js
│           └── +page.svelte
├── svelte.config.js
├── tailwind.config.js
├── vite.config.js
└── xterm/
    ├── xterm-addon-fit.js
    ├── xterm-addon-web-links.js
    ├── xterm.css
    └── xterm.js

================================================
FILE CONTENTS
================================================

================================================
FILE: .circleci/config.yml
================================================
version: 2.1

jobs:
  deploy:
    docker:
      - image: cimg/node:22.9
    resource_class: medium
    steps:
      - add_ssh_keys:
          fingerprints:
            - "86:3b:c9:a6:d1:b9:a8:dc:0e:00:db:99:8d:19:c4:3e"
      - run:
          name: Add known hosts
          command: |
            mkdir -p ~/.ssh
            echo $GH_HOST >> ~/.ssh/known_hosts
            echo $HAVANA_HOST >> ~/.ssh/known_hosts
      - run:
          name: Install NPM
          command: |
            sudo apt-get update && sudo apt-get install -y rsync npm
      - run:
          name: Clone WebVM
          command: |
            git clone --branch $CIRCLE_BRANCH --single-branch git@github.com:leaningtech/webvm.git
      - run:
          name: Build WebVM
          command: |
            cd webvm/
            npm install
            npm run build
      - run:
          name: Deploy webvm
          command: |
            rsync -avz --chown circleci:runtimes webvm/build/ circleci@havana.leaningtech.com:webvm/

workflows:
  deploy:
    when:
      equal: [ << pipeline.trigger_source >>, "api" ]
    jobs:
      - deploy


================================================
FILE: .github/workflows/deploy.yml
================================================
name: Deploy

# Define when the workflow should run
on:
  # Allow manual triggering of the workflow from the Actions tab
  workflow_dispatch:

  # Allow inputs to be passed when manually triggering the workflow from the Actions tab
    inputs:
      DOCKERFILE_PATH:
        type: string
        description: 'Path to the Dockerfile'
        required: true
        default: 'dockerfiles/debian_mini'

      IMAGE_SIZE:
        type: string
        description: 'Image size, 950M max'
        required: true
        default: '750M'

      DEPLOY_TO_GITHUB_PAGES:
        type: boolean
        description: 'Deploy to Github pages'
        required: true
        default: true

      GITHUB_RELEASE:
        type: boolean
        description: 'Upload GitHub release'
        required: true
        default: false

jobs:

  guard_clause:
      runs-on: ubuntu-latest
  
      env:
        GH_TOKEN: ${{ github.token }} # As required by the GitHub-CLI  

      permissions:
        actions: 'write' # Required in order to terminate the workflow run.
  
      steps:
        - uses: actions/checkout@v4
        # Guard clause that cancels the workflow in case of an invalid DOCKERFILE_PATH and/or incorrectly configured Github Pages. 
        # The main reason for choosing this workaround for aborting the workflow is the fact that it does not display the workflow as successful, which can set false expectations.
        - name: DOCKERFILE_PATH.
          shell: bash
          run: |
            # We check whether the Dockerfile_path is valid. 
            if [ ! -f ${{ github.event.inputs.DOCKERFILE_PATH }} ]; then
                echo "::error title=Invalid Dockerfile path::No file found at ${{ github.event.inputs.DOCKERFILE_PATH }}"
                echo "terminate=true" >> $GITHUB_ENV
            fi

        - name: Github Pages config guard clause
          if: ${{ github.event.inputs.DEPLOY_TO_GITHUB_PAGES == 'true' }}
          run: |
            # We use the Github Rest api to get information regarding pages for the Github Repository and store it into a temporary file named "pages_response".
            set +e
            gh api \
              -H "Accept: application/vnd.github+json" \
              -H "X-GitHub-Api-Version: 2022-11-28" \
              /repos/${{ github.repository_owner }}/$(basename ${{ github.repository }})/pages > pages_response

            # We make sure Github Pages has been enabled for this repository.
            if [ "$?" -ne 0 ]; then
              echo "::error title=Potential pages configuration error.::Please make sure you have enabled Github pages for the ${{ github.repository }} repository. If already enabled then Github pages might be down"
              echo "terminate=true" >> $GITHUB_ENV
            fi
            set -e

            # We make sure the Github pages build & deployment source is set to "workflow" (Github Actions). Instead of a "legacy" (branch).
            if [[ "$(jq --compact-output --raw-output .build_type pages_response)" != "workflow" ]]; then
                echo "Undefined behaviour, Make sure the Github Pages source is correctly configured in the Github Pages settings."
                echo "::error title=Pages configuration error.::Please make sure you have correctly picked \"Github Actions\" as the build and deployment source for the Github Pages."
                echo "terminate=true" >> $GITHUB_ENV
            fi
            rm pages_response

        - name: Terminate run if error occurred.
          run: |
            if [[ $terminate == "true" ]]; then
              gh run cancel ${{ github.run_id }}
              gh run watch ${{ github.run_id }}
            fi

  build:
    needs: guard_clause # Dependency
    runs-on: ubuntu-latest # Image to run the worker on.

    env:
      TAG: "ext2-webvm-base-image" # Tag of docker image.
      IMAGE_SIZE: '${{ github.event.inputs.IMAGE_SIZE }}'
      DEPLOY_DIR: /webvm_deploy/ # Path to directory where we host the final image from.

    permissions: # Permissions to grant the GITHUB_TOKEN.
      contents: write  # Required permission to make a github release.

    steps:
      # Checks-out our repository under $GITHUB_WORKSPACE, so our job can access it
      - uses: actions/checkout@v4

      # Setting the IMAGE_NAME variable in GITHUB_ENV to <Dockerfile name>_<date>_<run_id>.ext2.
      - name: Generate the image_name.
        id: image_name_gen
        run: |
          echo "IMAGE_NAME=$(basename ${{ github.event.inputs.DOCKERFILE_PATH }})_$(date +%Y%m%d)_${{ github.run_id }}.ext2" >> $GITHUB_ENV

      # Create directory to host the image from.
      - run: sudo mkdir -p $DEPLOY_DIR

      # Build the i386 Dockerfile image.
      - run: docker build . --tag $TAG --file ${{ github.event.inputs.DOCKERFILE_PATH }} --platform=i386
      
      # Run the docker image so that we can export the container.
      # Run the Docker container with the Google Public DNS nameservers: 8.8.8.8, 8.8.4.4
      - run: |
          docker run --dns 8.8.8.8 --dns 8.8.4.4 -d $TAG
          echo "CONTAINER_ID=$(sudo docker ps -aq)" >> $GITHUB_ENV

      # We extract the CMD, we first need to figure whether the Dockerfile uses CMD or an Entrypoint.
      - name: Extracting CMD / Entrypoint and args
        shell: bash
        run: |
          cmd=$(sudo docker inspect --format='{{json .Config.Cmd}}' $CONTAINER_ID)
          entrypoint=$(sudo docker inspect --format='{{json .Config.Entrypoint}}' $CONTAINER_ID)
          if [[ $entrypoint != "null" && $cmd != "null" ]]; then
            echo "CMD=$( sudo docker inspect $CONTAINER_ID | jq --compact-output '.[0].Config.Entrypoint' )" >> $GITHUB_ENV
            echo "ARGS=$( sudo docker inspect $CONTAINER_ID | jq --compact-output '.[0].Config.Cmd' )" >> $GITHUB_ENV
          elif [[ $cmd != "null" ]]; then
            echo "CMD=$( sudo docker inspect $CONTAINER_ID | jq --compact-output '.[0].Config.Cmd[:1]' )" >> $GITHUB_ENV
            echo "ARGS=$( sudo docker inspect $CONTAINER_ID | jq --compact-output '.[0].Config.Cmd[1:]' )" >> $GITHUB_ENV
          else
            echo "CMD=$( sudo docker inspect $CONTAINER_ID | jq --compact-output '.[0].Config.Entrypoint[:1]' )" >> $GITHUB_ENV
            echo "ARGS=$( sudo docker inspect $CONTAINER_ID | jq --compact-output '.[0].Config.Entrypoint[1:]' )" >> $GITHUB_ENV
          fi

      # We extract the ENV, CMD/Entrypoint and cwd from the Docker container with docker inspect.
      - name: Extracting env, args and cwd.
        shell: bash
        run: |
          echo "ENV=$( sudo docker inspect $CONTAINER_ID | jq --compact-output  '.[0].Config.Env' )" >> $GITHUB_ENV
          echo "CWD=$( sudo docker inspect $CONTAINER_ID | jq --compact-output '.[0].Config.WorkingDir' )" >> $GITHUB_ENV

      # We create and mount the base ext2 image to extract the Docker container's filesystem its contents into.
      - name: Create ext2 image.
        run: |
         # Preallocate space for the ext2 image
         sudo fallocate -l $IMAGE_SIZE ${IMAGE_NAME}
         # Format to ext2 linux kernel revision 0
         sudo mkfs.ext2 -r 0 ${IMAGE_NAME}
         # Mount the ext2 image to modify it
         sudo mount -o loop -t ext2 ${IMAGE_NAME} /mnt/

      # We opt for 'docker cp --archive' over 'docker save' since our focus is solely on the end product rather than individual layers and metadata.
      # However, it's important to note that despite being specified in the documentation, the '--archive' flag does not currently preserve uid/gid information when copying files from the container to the host machine.
      # Another compelling reason to use 'docker cp' is that it preserves resolv.conf.
      - name: Export and unpack container filesystem contents into mounted ext2 image.
        run: | 
          sudo docker cp -a ${CONTAINER_ID}:/ /mnt/
          sudo umount /mnt/
      # Result is an ext2 image for webvm.

      # The .txt suffix enabled HTTP compression for free
      - name: Generate image split chunks and .meta file
        run: |
          sudo split ${{ env.IMAGE_NAME }} ${{ env.DEPLOY_DIR }}/${{ env.IMAGE_NAME }}.c -a 6 -b 128k -x --additional-suffix=.txt
          sudo bash -c "stat -c%s ${{ env.IMAGE_NAME }} > ${{ env.DEPLOY_DIR }}/${{ env.IMAGE_NAME }}.meta"

      # This step updates the default config_github_terminal.js file by performing the following actions:
      #   1. Replaces all occurrences of IMAGE_URL with the URL to the image.
      #   2. Replace CMD with the Dockerfile entry command.
      #   3. Replace args with the Dockerfile CMD / Entrypoint args.
      #   4. Replace ENV with the container's environment values.
      #   5. Replace CWD with the container's current working directory.
      - name: Adjust config_github_terminal.js
        run: |
          sed -i 's#IMAGE_URL#"${{ env.IMAGE_NAME }}"#g' config_github_terminal.js
          sed -i 's#CMD#${{ env.CMD }}#g' config_github_terminal.js
          sed -i 's#ARGS#${{ env.ARGS }}#g' config_github_terminal.js
          sed -i 's#ENV#${{ env.ENV }}#g' config_github_terminal.js
          sed -i 's#CWD#${{ env.CWD }}#g' config_github_terminal.js

      - name: Build NPM package
        run: |
          npm install
          WEBVM_MODE=github npm run build

      # Move required files for gh-pages deployment to the deployment directory $DEPLOY_DIR.
      - name: Copy build
        run: |
          rm build/alpine.html
          sudo mv build/* $DEPLOY_DIR/

      # We generate index.list files for our httpfs to function properly.
      - name: make index.list
        shell: bash
        run: |
          find $DEPLOY_DIR -type d | while read -r dir;
          do
            index_list="$dir/index.list";
            sudo rm -f "$index_list";
            sudo ls "$dir" | sudo tee "$index_list" > /dev/null;
            sudo chmod +rw "$index_list";     
            sudo echo "created $index_list"; 
          done

      # Create a gh-pages artifact in order to deploy to gh-pages.
      - name: Upload GitHub Pages artifact
        uses: actions/upload-pages-artifact@v3
        with:
          # Path of the directory containing the static assets for our gh pages deployment.
          path: ${{ env.DEPLOY_DIR }} # optional, default is _site/

      - name: github release # To upload our final ext2 image as a github release.
        if: ${{ github.event.inputs.GITHUB_RELEASE == 'true' }}
        uses: softprops/action-gh-release@v2
        with:
          target_commitish: ${{ github.sha }} # Last commit on the GITHUB_REF branch or tag
          tag_name: ext2_image
          fail_on_unmatched_files: 'true' # Fail in case of no matches with the file(s) glob(s).
          files: | # Assets to upload as release.
            ${{ env.IMAGE_NAME }}

  deploy_to_github_pages: # Job that deploys the github-pages artifact to github-pages.
    if: ${{ github.event.inputs.DEPLOY_TO_GITHUB_PAGES == 'true' }}
    needs: build
    environment:
      name: github-pages
      url: ${{ steps.deployment.outputs.page_url }}

    # Grant GITHUB_TOKEN the permissions required to make a Pages deployment
    permissions:
      pages: write      # to deploy to Pages
      id-token: write   # to verify the deployment originates from an appropriate source

    runs-on: ubuntu-latest
    steps:
      # Deployment to github pages
      - name: Deploy GitHub Pages site
        id: deployment
        uses: actions/deploy-pages@v4


================================================
FILE: .gitignore
================================================
/node_modules
/.svelte-kit
pnpm-lock.yaml
build/

================================================
FILE: .npmrc
================================================
engine-strict=true


================================================
FILE: LICENSE.txt
================================================

                                 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 [yyyy] [name of copyright owner]

   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
================================================
# WebVM

[![Discord server](https://img.shields.io/discord/988743885121548329?color=%235865F2&logo=discord&logoColor=%23fff)](https://discord.gg/yWRr2YnD9c)
[![Issues](https://img.shields.io/github/issues/leaningtech/webvm)](https://github.com/leaningtech/webvm/issues)

This repository hosts the source code for [https://webvm.io](https://webvm.io), a Linux virtual machine that runs in your browser.

Try out the new Alpine / Xorg / i3 graphical environment: [https://webvm.io/alpine.html](https://webvm.io/alpine.html)

<img src="/assets/welcome_to_WebVM_alpine_2024.png" width="90%">

WebVM is a server-less virtual environment running fully client-side in HTML5/WebAssembly. It's designed to be Linux ABI-compatible. It runs an unmodified Debian distribution including many native development toolchains.

WebVM is powered by the CheerpX virtualization engine, and enables safe, sandboxed client-side execution of x86 binaries on any browser. CheerpX includes an x86-to-WebAssembly JIT compiler, a virtual block-based file system, and a Linux syscall emulator. 

## Table of Contents

- [Fork, deploy, customize](#fork-deploy-customize)
- [Running WebVM locally with a custom Debian mini disk image](#run-webvm-locally-with-a-custom-debian-mini-disk-image)
- [Example customization: Python3 REPL](#example-customization-python3-repl)
- [How to use Claude AI](#how-to-use-claude-ai)
- [Bugs and Issues](#bugs-and-issues)
- [More links](#more-links)
- [Thanks to...](#thanks-to)
- [Versioning](#versioning)
- [License](#license)

# Enable networking

Modern browsers do not provide APIs to directly use TCP or UDP. WebVM provides networking support by integrating with Tailscale, a VPN network that supports WebSockets as a transport layer.

1.  Open the "Networking" panel from the side-bar
2.  Click "Connect to Tailscale" from the panel
3.  Log in to Tailscale (create an account if you don't have one)
4. Click "Connect" when prompted by Tailscale

WebVM now has access to machines in your own local Tailscale Network!

## The world wide web

If you would like to access the public internet, you will need to set up an Exit Node on one of your _non-WebVM_ tailscale network devices.
See the _"Advertise a device as an exit node"_ section of the [Tailscale Exit Node quickstart guide](https://tailscale.com/kb/1408/quick-guide-exit-nodes?tab=linux) for instructions. (The _“Use an exit node”_ section can be skipped, as WebVM automatically uses an available exit node once one is advertised).

> [!NOTE]
> While we support most network commands there are a few that rely on kernel-level features not available in modern browsers and are therefore not supported, most notably `ping`.You could use `curl` or `wget` for testing instead.

(Depending on your network speed, you may need to wait a few moments for the Tailscale Wasm module to be downloaded.)
Once that is set up:
1. Log in with your Tailscale credentials.
2. Go back to the WebVM tab.
3.  The `Connect to Tailscale` button in the Networking side-panel should be replaced by your IP address.

> [!TIP]
> You can also check your connection status by checking the dot colour on the "connect to tailscale" button (which should now show your tailscale IP). On local network connectivity it will be orange, global will be green.

## Using an authkey

As an alternative to manually logging in, you can add your tailscale auth Key at the end of the webvm URL.

`https://webvm.io/#authKey=<your-key>`

It is recommended to use an ephemeral key.

## Selfhosting your tailscale network

We also support [headscale](https://headscale.net/stable/), a selfhosted open source implementation of the Tailscale control server.

Though as headscale unfortunately doesn't support adding CORS headers. You will have to set up a proxy server to add them. Headscales instructions on doing so can be found [here](https://headscale.net/stable/ref/integration/reverse-proxy/#nginx). 

Once ready, add the following line to your `location /` block in your nginx config file.

``` Nginx
 if ($http_origin = "https://webvm.io") {
            add_header 'Access-Control-Allow-Origin' "$http_origin";
			add_header 'Access-Control-Allow-Credentials' 'true' always;
        }
```


To log in to your headscale network add `#controlUrl=<your-control-url>` to the webVM url.

**Notes:**

- If self hosting, replace "https://webvm.io" with your own url.
- This is equivelant to the tailscale  `--login-server` command line option.
- If used with authkey, don't forget to seperate the URL fragments with a `&` inbetween.


# Fork, deploy, customize

<img src="/assets/fork_deploy_instructions.gif" alt="deploy_instructions_gif" width="90%">

- Fork the repository.
- Enable Github pages in settings.
	- Click on `Settings`.
	- Go to the `Pages` section.
	- Select `Github Actions` as the source.
        - If you are using a custom domain, ensure `Enforce HTTPS` is enabled. 
- Run the workflow.
	- Click on `Actions`.
	- Accept the prompt. This is required only once to enable Actions for your fork.
	- Click on the workflow named `Deploy`.
	- Click `Run workflow` and then once more `Run workflow` in the menu.
- After a few seconds a new `Deploy` workflow will start, click on it to see details.
- After the workflow completes, which takes a few minutes, it will show the URL below the `deploy_to_github_pages` job.

<img src="/assets/result.png" width="70%" >

You can now customize `dockerfiles/debian_mini` to suit your needs, or make a new Dockerfile from scratch. Use the `Path to Dockerfile` workflow parameter to select it.

- If you would like to use our full desktop Alpine image, you can find it's dockerfile [**here**](github.com/leaningtech/alpine-image).

- For more information on creating custom images, see our [Custom disk Image documentation](https://cheerpx.io/docs/guides/custom-images).


# Run WebVM locally with a custom Debian mini disk image

### 1. Clone the WebVM Repository

```sh
git clone https://github.com/leaningtech/webvm.git
cd webvm
```

### 2. Download the Debian mini Ext2 image

Run the following command to download the Debian mini Ext2 image:

```sh
wget "https://github.com/leaningtech/webvm/releases/download/ext2_image/debian_mini_20230519_5022088024.ext2"
```

(*You can also build your own disk image by selecting the **"Upload GitHub release"** workflow option*)

### 3. Update the configuration file

	Edit `config_public_terminal.js` to reference your local disk image:

- Replace: 
	
	`"wss://disks.webvm.io/debian_large_20230522_5044875331.ext2"`
	
	With:
	
	`"/disk-images/debian_mini_20230519_5022088024.ext2"`

	(*Use an absolute or relative URL pointing to the disk image location.*)


- Replace `"cloud"` with the correct disk image type: `"bytes"`

	
### 4. Build WebVM

Run the following commands to install dependencies and build WebVM:

```sh
npm install
npm run build
```

The output will be placed in the `build` directory.

### 5. Configure Nginx

- Create a directory for the disk image:

```sh
mkdir disk-images
mv debian_mini_20230519_5022088024.ext2 disk-images/
```

- Modify your `nginx.conf` file to serve the disk image. Add the following location block:

```nginx
location /disk-images/ {
	root .;
	autoindex on;
}
```

### 6, Start Nginx

Run the following command to start Nginx:

```sh
nginx -p . -c nginx.conf
```

*Nginx will automatically serve the build directory.*

### 7. Access WebVM

Open a browser and visit: `http://127.0.0.1:8081`.

Enjoy your local WebVM!

---



# Example customization: Python3 REPL

The `Deploy` workflow takes into account the `CMD` specified in the Dockerfile. To build a REPL you can simply apply this patch and deploy.

```diff
diff --git a/dockerfiles/debian_mini b/dockerfiles/debian_mini
index 2878332..1f3103a 100644
--- a/dockerfiles/debian_mini
+++ b/dockerfiles/debian_mini
@@ -15,4 +15,4 @@ WORKDIR /home/user/
 # We set env, as this gets extracted by Webvm. This is optional.
 ENV HOME="/home/user" TERM="xterm" USER="user" SHELL="/bin/bash" EDITOR="vim" LANG="en_US.UTF-8" LC_ALL="C"
 RUN echo 'root:password' | chpasswd
-CMD [ "/bin/bash" ]
+CMD [ "/usr/bin/python3" ]
```

# How to use Claude AI

To access Claude AI, you need an API key. Follow these steps to get started:

### 1. Create an account
- Visit [Anthropic Console](https://console.anthropic.com/login) and sign up with your e-mail. You'll receive a sign in link to the Anthropic Console. 

<img src="/assets/anthropic_signup.png" width="90%">

### 2. Get your API key
- Once logged in, navigate to **Get API keys**.
- Purchase the amount of credits you need. After completing the purchase, you'll be able to generate the key through the API console.

<img src="/assets/anthropic_api_payment.png" width="90%">

### 3. Log in with your API key
- Navigate to your WebVM and hover over the robot icon. This will show the Claude AI Integration tab. For added convenience, you can click the pin button in the top right corner to keep the tab in place.
- You'll see a prompt where you can insert your Claude API key.
- Insert your key and press enter.

<img src="/assets/insert_key.png" width="90%">

### 4. Start using Claude AI
- Once your API key is entered, you can begin interacting with Claude AI by asking questions such as:

 __"Solve the CTF challenge at `/home/user/chall1.bin.` Note that the binary reads from stdin."__

<img src="/assets/webvm_claude_ctf.gif" alt="deploy_instructions_gif" width="90%">

**Important:** Your API key is private and should never be shared. We do not have access to your key, which is not only stored locally in your browser.

# Bugs and Issues

Please use [Issues](https://github.com/leaningtech/webvm/issues) to report any bug.
Or come to say hello / share your feedback on [Discord](https://discord.gg/yTNZgySKGa).

# More links

- [WebVM: server-less x86 virtual machines in the browser](https://leaningtech.com/webvm-server-less-x86-virtual-machines-in-the-browser/)
- [WebVM: Linux Virtualization in WebAssembly with Full Networking via Tailscale](https://leaningtech.com/webvm-virtual-machine-with-networking-via-tailscale/)
- [Mini.WebVM: Your own Linux box from Dockerfile, virtualized in the browser via WebAssembly](https://leaningtech.com/mini-webvm-your-linux-box-from-dockerfile-via-wasm/)
- Reference GitHub Pages deployment: [Mini.WebVM](https://mini.webvm.io)
- [Crafting the Impossible: X86 Virtualization in the Browser with WebAssembly](https://www.youtube.com/watch?v=VqrbVycTXmw) Talk at JsNation 2022

# Thanks to... 
This project depends on:
- [CheerpX](https://cheerpx.io/), made by [Leaning Technologies](https://leaningtech.com/) for x86 virtualization and Linux emulation
- xterm.js, [https://xtermjs.org/](https://xtermjs.org/), for providing the Web-based terminal emulator
- [Tailscale](https://tailscale.com/), for the networking component
- [lwIP](https://savannah.nongnu.org/projects/lwip/), for the TCP/IP stack, compiled for the Web via [Cheerp](https://github.com/leaningtech/cheerp-meta/)

# Versioning

WebVM depends on the CheerpX x86-to-WebAssembly virtualization technology, which is included in the project via [NPM](https://www.npmjs.com/package/@leaningtech/cheerpx).

The NPM package is updated on every release.

Every build is immutable, if a specific version works well for you today, it will keep working forever.

# License

WebVM is released under the Apache License, Version 2.0.

You are welcome to use, modify, and redistribute the contents of this repository.

The public CheerpX deployment is provided **as-is** and is **free to use** for technological exploration, testing and use by individuals. Any other use by organizations, including non-profit, academia and the public sector, requires a license. Downloading a CheerpX build for the purpose of hosting it elsewhere is not permitted without a commercial license.

Read more about [CheerpX licensing](https://cheerpx.io/docs/licensing)

If you want to build a product on top of CheerpX/WebVM, please get in touch: sales@leaningtech.com


================================================
FILE: config_github_terminal.js
================================================
// The root filesystem location
export const diskImageUrl = IMAGE_URL;
// The root filesystem backend type
export const diskImageType = "github";
// Print an introduction message about the technology
export const printIntro = true;
// Is a graphical display needed
export const needsDisplay = false;
// Executable full path (Required)
export const cmd = CMD; // Default: "/bin/bash";
// Arguments, as an array (Required)
export const args = ARGS; // Default: ["--login"];
// Optional extra parameters
export const opts = {
	// Environment variables
	env: ENV, // Default: ["HOME=/home/user", "TERM=xterm", "USER=user", "SHELL=/bin/bash", "EDITOR=vim", "LANG=en_US.UTF-8", "LC_ALL=C"],
	// Current working directory
	cwd: CWD, // Default: "/home/user",
	// User id
	uid: 1000,
	// Group id
	gid: 1000
};


================================================
FILE: config_public_alpine.js
================================================
// The root filesystem location
export const diskImageUrl = "wss://disks.webvm.io/alpine_20251007.ext2";
// The root filesystem backend type
export const diskImageType = "cloud";
// Print an introduction message about the technology
export const printIntro = false;
// Is a graphical display needed
export const needsDisplay = true;
// Executable full path (Required)
export const cmd = "/sbin/init";
// Arguments, as an array (Required)
export const args = [];
// Optional extra parameters
export const opts = {
	// User id
	uid: 0,
	// Group id
	gid: 0
};


================================================
FILE: config_public_terminal.js
================================================
// The root filesystem location
export const diskImageUrl = "wss://disks.webvm.io/debian_large_20230522_5044875331_2.ext2";
// The root filesystem backend type
export const diskImageType = "cloud";
// Print an introduction message about the technology
export const printIntro = true;
// Is a graphical display needed
export const needsDisplay = false;
// Executable full path (Required)
export const cmd = "/bin/bash";
// Arguments, as an array (Required)
export const args = ["--login"];
// Optional extra parameters
export const opts = {
	// Environment variables
	env: ["HOME=/home/user", "TERM=xterm", "USER=user", "SHELL=/bin/bash", "EDITOR=vim", "LANG=en_US.UTF-8", "LC_ALL=C"],
	// Current working directory
	cwd: "/home/user",
	// User id
	uid: 1000,
	// Group id
	gid: 1000
};


================================================
FILE: dockerfiles/.dockerignore
================================================
.dockerignore


================================================
FILE: dockerfiles/debian_large
================================================
FROM --platform=i386 i386/debian:bookworm
ARG DEBIAN_FRONTEND=noninteractive

RUN apt-get update && apt-get -y upgrade && \
	apt-get install -y apt-utils beef bsdgames bsdmainutils ca-certificates \
	cowsay cpio cron curl dmidecode dmsetup g++ gcc gdbm-l10n git  \
	hexedit  ifupdown init logrotate lsb-base lshw lua5.4 luajit lynx make \
	nano netbase nodejs openssl procps python3 python3-cryptography \
	python3-jinja2 python3-numpy python3-pandas python3-pip python3-scipy \
	python3-six python3-yaml readline-common rsyslog ruby sensible-utils \
	ssh systemd systemd-sysv tasksel tasksel-data udev vim wget whiptail \
	xxd iptables isc-dhcp-client isc-dhcp-common kmod less netcat-openbsd

# Make a user, then copy over the /example directory
RUN useradd -m user && echo "user:password" | chpasswd
COPY --chown=user:user ./examples /home/user/examples
RUN chmod -R +x  /home/user/examples/lua
RUN echo 'root:password' | chpasswd
CMD [ "/bin/bash" ]


================================================
FILE: dockerfiles/debian_mini
================================================
FROM --platform=i386 i386/debian:bookworm
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get clean && apt-get update && apt-get -y upgrade
RUN apt-get -y install apt-utils gcc \
	python3 vim unzip ruby nodejs \
	fakeroot dbus base whiptail hexedit \
	patch wamerican ucf manpages \
	file luajit make lua5.4 dialog curl \
	less cowsay netcat-openbsd
RUN useradd -m user && echo "user:password" | chpasswd
COPY --chown=user:user ./examples /home/user/examples
RUN chmod -R +x  /home/user/examples/lua
# We set WORKDIR, as this gets extracted by Webvm to be used as the cwd. This is optional.
WORKDIR /home/user/
# We set env, as this gets extracted by Webvm. This is optional.
ENV HOME="/home/user" TERM="xterm" USER="user" SHELL="/bin/bash" EDITOR="vim" LANG="en_US.UTF-8" LC_ALL="C"
RUN echo 'root:password' | chpasswd
CMD [ "/bin/bash" ]


================================================
FILE: documents/Welcome.txt
================================================
Welcome to WebVM: A complete desktop environment running in the browser

WebVM is powered by CheerpX: a x86-to-WebAssembly virtualization engine and Just-in-Time compiler

For more info: https://cheerpx.io


================================================
FILE: documents/index.list
================================================
ArchitectureOverview.png
WebAssemblyTools.pdf
Welcome.txt


================================================
FILE: examples/c/Makefile
================================================
SRCS = $(wildcard *.c)

PROGS = $(patsubst %.c,%,$(SRCS))

all: $(PROGS)

%: %.c
	$(CC) $(CFLAGS) -o $@ $<

clean: 
	rm -f $(PROGS)

.PHONY: all clean


================================================
FILE: examples/c/env.c
================================================
#include <stdio.h>
  
// Most of the C compilers support a third parameter to main which
// store all envorinment variables
int main(int argc, char *argv[], char * envp[])
{
    int i;
    for (i = 0; envp[i] != NULL; i++)
        printf("\n%s", envp[i]);
    getchar();
    return 0;
}


================================================
FILE: examples/c/helloworld.c
================================================
#include <stdio.h>

int main()
{
	printf("Hello, World!\n");
}


================================================
FILE: examples/c/link.c
================================================
#include <unistd.h>

int main()
{
	link("env", "env3");
	return 0;
}


================================================
FILE: examples/c/openat.c
================================================
#include <fcntl.h>
#include <stdio.h>
#include <errno.h>

int main()
{
	int ret = openat(AT_FDCWD, "/dev/tty", 0x88102, 0);
	printf("return value is %d and errno is %d\n", ret, errno);
}



================================================
FILE: examples/c/waitpid.c
================================================
#include <sys/wait.h>
#include <unistd.h>
#include <errno.h>
#include <stdio.h>

int main()
{
	int status;

	pid_t p = getpid();
	// waitpid takes a children's pid, not the current process one
	// if the pid is not a children of the current process, it returns -ECHILD
	pid_t res = waitpid(1001, &status, WNOHANG);

	printf("res is %d, p is %d and errno is %d\n", res, p, errno);

}


================================================
FILE: examples/lua/fizzbuzz.lua
================================================
#!/usr/bin/env luajit
cfizz,cbuzz=0,0
for i=1,20 do
	cfizz=cfizz+1
	cbuzz=cbuzz+1
	io.write(i .. ": ")
	if cfizz~=3 and cbuzz~=5 then
		io.write(i)
	else
		if cfizz==3 then
			io.write("Fizz")
			cfizz=0
		end
		if cbuzz==5 then
			io.write("Buzz")
			cbuzz=0
		end
	end
	io.write("\n")
end


================================================
FILE: examples/lua/sorting.lua
================================================
#!/usr/bin/env luajit
fruits = {"banana","orange","apple","grapes"}

for k,v in ipairs(fruits) do
   print(k,v)
end

table.sort(fruits)
print("sorted table")

for k,v in ipairs(fruits) do
   print(k,v)
end


================================================
FILE: examples/lua/symmetric_difference.lua
================================================
#!/usr/bin/env luajit
A = { ["John"] = true, ["Bob"] = true, ["Mary"] = true, ["Elena"] = true }
B = { ["Jim"] = true, ["Mary"] = true, ["John"] = true, ["Bob"] = true }

A_B = {}
for a in pairs(A) do
    if not B[a] then A_B[a] = true end
end

B_A = {}
for b in pairs(B) do
    if not A[b] then B_A[b] = true end
end

for a_b in pairs(A_B) do
    print( a_b )
end
for b_a in pairs(B_A) do
    print( b_a )
end


================================================
FILE: examples/nodejs/environment.js
================================================
console.log("process.uptime   = ", global.process.uptime());
console.log("process.title    = ", global.process.title);
console.log("process version  = ", global.process.version);
console.log("process.platform = ", global.process.platform);
console.log("process.cwd      = ", global.process.cwd());
console.log("process.uptime   = ", global.process.uptime());


================================================
FILE: examples/nodejs/nbody.js
================================================
const PI = Math.PI;
const SOLAR_MASS = 4 * PI * PI;
const DAYS_PER_YEAR = 365.24;

function Body(x, y, z, vx, vy, vz, mass) {
    this.x = x;
    this.y = y;
    this.z = z;
    this.vx = vx;
    this.vy = vy;
    this.vz = vz;
    this.mass = mass;
}

function Jupiter() {
    return new Body(
        4.84143144246472090e+00,
        -1.16032004402742839e+00,
        -1.03622044471123109e-01,
        1.66007664274403694e-03 * DAYS_PER_YEAR,
        7.69901118419740425e-03 * DAYS_PER_YEAR,
        -6.90460016972063023e-05 * DAYS_PER_YEAR,
        9.54791938424326609e-04 * SOLAR_MASS
    );
}

function Saturn() {
    return new Body(
        8.34336671824457987e+00,
        4.12479856412430479e+00,
        -4.03523417114321381e-01,
        -2.76742510726862411e-03 * DAYS_PER_YEAR,
        4.99852801234917238e-03 * DAYS_PER_YEAR,
        2.30417297573763929e-05 * DAYS_PER_YEAR,
        2.85885980666130812e-04 * SOLAR_MASS
    );
}

function Uranus() {
    return new Body(
        1.28943695621391310e+01,
        -1.51111514016986312e+01,
        -2.23307578892655734e-01,
        2.96460137564761618e-03 * DAYS_PER_YEAR,
        2.37847173959480950e-03 * DAYS_PER_YEAR,
        -2.96589568540237556e-05 * DAYS_PER_YEAR,
        4.36624404335156298e-05 * SOLAR_MASS
    );
}

function Neptune() {
    return new Body(
        1.53796971148509165e+01,
        -2.59193146099879641e+01,
        1.79258772950371181e-01,
        2.68067772490389322e-03 * DAYS_PER_YEAR,
        1.62824170038242295e-03 * DAYS_PER_YEAR,
        -9.51592254519715870e-05 * DAYS_PER_YEAR,
        5.15138902046611451e-05 * SOLAR_MASS
    );
}

function Sun() {
    return new Body(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, SOLAR_MASS);
}

const bodies = Array(Sun(), Jupiter(), Saturn(), Uranus(), Neptune());

function offsetMomentum() {
    let px = 0;
    let py = 0;
    let pz = 0;
    const size = bodies.length;
    for (let i = 0; i < size; i++) {
        const body = bodies[i];
        const mass = body.mass;
        px += body.vx * mass;
        py += body.vy * mass;
        pz += body.vz * mass;
    }

    const body = bodies[0];
    body.vx = -px / SOLAR_MASS;
    body.vy = -py / SOLAR_MASS;
    body.vz = -pz / SOLAR_MASS;
}

function advance(dt) {
    const size = bodies.length;

    for (let i = 0; i < size; i++) {
        const bodyi = bodies[i];
        let vxi = bodyi.vx;
        let vyi = bodyi.vy;
        let vzi = bodyi.vz;
        for (let j = i + 1; j < size; j++) {
            const bodyj = bodies[j];
            const dx = bodyi.x - bodyj.x;
            const dy = bodyi.y - bodyj.y;
            const dz = bodyi.z - bodyj.z;

            const d2 = dx * dx + dy * dy + dz * dz;
            const mag = dt / (d2 * Math.sqrt(d2));

            const massj = bodyj.mass;
            vxi -= dx * massj * mag;
            vyi -= dy * massj * mag;
            vzi -= dz * massj * mag;

            const massi = bodyi.mass;
            bodyj.vx += dx * massi * mag;
            bodyj.vy += dy * massi * mag;
            bodyj.vz += dz * massi * mag;
        }
        bodyi.vx = vxi;
        bodyi.vy = vyi;
        bodyi.vz = vzi;
    }

    for (let i = 0; i < size; i++) {
        const body = bodies[i];
        body.x += dt * body.vx;
        body.y += dt * body.vy;
        body.z += dt * body.vz;
    }
}

function energy() {
    let e = 0;
    const size = bodies.length;

    for (let i = 0; i < size; i++) {
        const bodyi = bodies[i];

        e += 0.5 * bodyi.mass * ( bodyi.vx * bodyi.vx + bodyi.vy * bodyi.vy + bodyi.vz * bodyi.vz );

        for (let j = i + 1; j < size; j++) {
            const bodyj = bodies[j];
            const dx = bodyi.x - bodyj.x;
            const dy = bodyi.y - bodyj.y;
            const dz = bodyi.z - bodyj.z;

            const distance = Math.sqrt(dx * dx + dy * dy + dz * dz);
            e -= (bodyi.mass * bodyj.mass) / distance;
        }
    }
    return e;
}

const n = +50000000;

offsetMomentum();

console.log(energy().toFixed(9));
const start = Date.now();
for (let i = 0; i < n; i++) {
    advance(0.01);
}
const end = Date.now();
console.log(energy().toFixed(9));
console.log("elapsed:",end-start);


================================================
FILE: examples/nodejs/primes.js
================================================
(function () {

function isPrime(p) {
    const upper = Math.sqrt(p);
    for(let i = 2; i <= upper; i++) {
        if (p % i === 0 ) {
            return false;
        }
    }
    return true;
}

// Return n-th prime
function prime(n) {
    if (n < 1) {
        throw Error("n too small: " + n);
    }
    let count = 0;
    let result = 1;
    while(count < n) {
        result++;        
        if (isPrime(result)) {
            count++;
        }
    }
    return result;
}

console.log("your prime is ", prime(100000));

}());


================================================
FILE: examples/nodejs/wasm.js
================================================
(function (){
let bytes = new Uint8Array([
  0x00, 0x61, 0x73, 0x6d, 0x01, 0x00, 0x00, 0x00,
  0x01, 0x07, 0x01, 0x60, 0x02, 0x7f, 0x7f, 0x01,
  0x7f, 0x03, 0x02, 0x01, 0x00, 0x07, 0x07, 0x01,
  0x03, 0x73, 0x75, 0x6d, 0x00, 0x00, 0x0a, 0x0a,
  0x01, 0x08, 0x00, 0x20, 0x00, 0x20, 0x01, 0x6a,
  0x0f, 0x0b
]);

console.log(bytes);
let mod = new WebAssembly.Module(bytes);
let instance = new WebAssembly.Instance(mod, {});
console.log(instance.exports);
return instance.exports.sum(2020, 1);
}());


================================================
FILE: examples/python3/factorial.py
================================================
def factorial():
    f, n = 1, 1
    while True:            # First iteration:
        yield f            # yield 1 to start with and then
        f, n = f * n, n+1  # f will now be 1, and n will be 2, ...

for index, factorial_number in zip(range(51), factorial()):
     print('{i:3}!= {f:65}'.format(i=index, f=factorial_number))



================================================
FILE: examples/python3/fibonacci.py
================================================
def fib():
    a, b = 0, 1
    while True:            # First iteration:
        yield a            # yield 0 to start with and then
        a, b = b, a + b    # a will now be 1, and b will also be 1, (0 + 1)

for index, fibonacci_number in zip(range(100), fib()):
     print('{i:3}: {f:3}'.format(i=index, f=fibonacci_number))



================================================
FILE: examples/python3/pi.py
================================================
from decimal import Decimal, getcontext
getcontext().prec=60
summation = 0
for k in range(50):
	summation = summation + 1/Decimal(16)**k * (
		Decimal(4)/(8*k+1)
		- Decimal(2)/(8*k+4)
		- Decimal(1)/(8*k+5)
		- Decimal(1)/(8*k+6)
		)
	print(summation)



================================================
FILE: examples/ruby/helloWorld.rb
================================================
=begin
# The famous Hello World
# Program is trivial in
# Ruby. Superfluous:
#
# * A "main" method
# * Newline
# * Semicolons
#
# Here is the Code:
=end

puts "Hello World!"



================================================
FILE: examples/ruby/love.rb
================================================
# Output "I love Ruby"
say = "I love Ruby"; puts say

# Output "I *LOVE* RUBY"
say['love'] = "*love*"; puts say.upcase

# Output "I *love* Ruby", 5 times
5.times { puts say }



================================================
FILE: examples/ruby/powOf2.rb
================================================
puts(2 ** 1)
puts(2 ** 2)
puts(2 ** 3)
puts(2 ** 10)
puts(2 ** 100)
puts(2 ** 1000)


================================================
FILE: login.html
================================================
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Tailscale login</title>
</head>
<body>
    Loading network code...
</body>
</html>


================================================
FILE: nginx.conf
================================================
worker_processes  1;

events {
    worker_connections  1024;
}

error_log   nginx_main_error.log info;
pid nginx_user.pid;
daemon off;

http {
    access_log  nginx_access.log;
    error_log   nginx_error.log info;

    types {
        text/html                             html htm shtml;
        text/css                              css;
        application/javascript                js;
        application/wasm                      wasm;
        image/png                             png;
        image/jpeg                            jpg jpeg;
        image/svg+xml                         svg;
    }

    default_type  application/octet-stream;

    sendfile        on;
    
    server {
#	listen       8080 ssl;
	listen       8081;
        server_name  localhost;

	gzip on;
        # Enable compression for .wasm, .js and .txt files (used for the runtime chunks)
	gzip_types      application/javascript application/wasm text/plain

        charset utf-8;

#	ssl_certificate nginx.crt;
#	ssl_certificate_key nginx.key;

        location / {
            root build;
            autoindex on;
            index  index.html index.htm;
            add_header 'Cross-Origin-Opener-Policy' 'same-origin' always;
            add_header 'Cross-Origin-Embedder-Policy' 'require-corp' always;
            add_header 'Cross-Origin-Resource-Policy' 'cross-origin' always;
        }
    }
}


================================================
FILE: package.json
================================================
{
	"name": "webvm",
	"version": "2.0.0",
	"private": true,
	"scripts": {
		"dev": "vite dev",
		"build": "vite build"
	},
	"devDependencies": {
		"@anthropic-ai/sdk": "^0.33.0",
		"@fortawesome/fontawesome-free": "^6.6.0",
		"@leaningtech/cheerpx": "latest",
		"@oddbird/popover-polyfill": "^0.4.4",
		"@sveltejs/adapter-auto": "^3.0.0",
		"@sveltejs/adapter-static": "^3.0.5",
		"@sveltejs/kit": "^2.0.0",
		"@sveltejs/vite-plugin-svelte": "^3.0.0",
		"@xterm/addon-fit": "^0.10.0",
		"@xterm/addon-web-links": "^0.11.0",
		"@xterm/xterm": "^5.5.0",
		"autoprefixer": "^10.4.20",
		"labs": "git@github.com:leaningtech/labs.git",
		"node-html-parser": "^6.1.13",
		"postcss": "^8.4.47",
		"postcss-discard": "^2.0.0",
		"svelte": "^4.2.7",
		"tailwindcss": "^3.4.9",
		"vite": "^5.0.3",
		"vite-plugin-static-copy": "^1.0.6",
		"html2canvas-pro": "^1.5.8"
	},
	"type": "module"
}


================================================
FILE: postcss.config.js
================================================
export default {
	plugins: {
		tailwindcss: {},
		autoprefixer: {},
		'postcss-discard': {rule: function(node, value)
		{
			if(!value.startsWith('.fa-') || !value.endsWith(":before"))
				return false;
			switch(value)
			{
				case '.fa-info-circle:before':
				case '.fa-wifi:before':
				case '.fa-microchip:before':
				case '.fa-compact-disc:before':
				case '.fa-discord:before':
				case '.fa-github:before':
				case '.fa-star:before':
				case '.fa-circle:before':
				case '.fa-trash-can:before':
				case '.fa-book-open:before':
				case '.fa-user:before':
				case '.fa-screwdriver-wrench:before':
				case '.fa-desktop:before':
				case '.fa-mouse-pointer:before':
				case '.fa-hourglass-half:before':
				case '.fa-hand:before':
				case '.fa-brain:before':
				case '.fa-download:before':
				case '.fa-keyboard:before':
				case '.fa-thumbtack:before':
				case '.fa-brands:before':
				case '.fa-solid:before':
				case '.fa-regular:before':
					return false;
			}
			return true;
		}}
	},
}


================================================
FILE: scrollbar.css
================================================
.scrollbar {
  scrollbar-color: #777 #0000;
}

.scrollbar *::-webkit-scrollbar {
  height: 6px;
  width: 6px;
  background-color: #0000;
}

/* Add a thumb */
.scrollbar *::-webkit-scrollbar-thumb {
  border-radius: 3px;
  height: 6px;
  width: 6px;
    background: #777;
}

.scrollbar *::-webkit-scrollbar-thumb:hover {
    background: #555;
}


================================================
FILE: serviceWorker.js
================================================
async function handleFetch(request) {
	// Perform the original fetch request and store the result in order to modify the response.
	try {
		var r = await fetch(request);
	}
	catch (e) {
		console.error(e)
	}
	if (r.status === 0) {
		return r;
	}
	// We add headers to the original response its headers, in order to enable cross-origin-isolation. And make it independent of the server config.
	const newHeaders = new Headers(r.headers);
	// COEP & COOP for cross-origin-isolation.
	newHeaders.set("Cross-Origin-Embedder-Policy", "require-corp");
	newHeaders.set("Cross-Origin-Opener-Policy", "same-origin");
	newHeaders.set("Cross-Origin-Resource-Policy", "cross-origin");
	/**
	 * This workaround is necessary due to a limitation of CheerpOS, which relies on the response URL being set to the resolved URL.
	 * When constructing a new response object, the URL is not set by the Response() constructor and the serviceworker respondwith() method will set the url to event.request.url in case of an empty string.
	 * To address this, we set the location URL to the resolved response URL and set the status code to 301 in the new Response object.
	 * This causes the request to bounce back to the serviceworker from Cheerpos, with the event.request.url now set to the resolved URL, which allows the respondWith method to properly set the response URL in our new response.
	 * https://developer.mozilla.org/en-US/docs/Web/API/FetchEvent/respondWith.
	*/
	if (r.redirected === true)
		newHeaders.set("location", r.url);
	// In case of a redirection, we set the status to 301, and body to null, in order to not transfer too much data needlessly
	const moddedResponse = new Response(r.redirected === true ? null : r.body, {
		headers: newHeaders,
		status: r.redirected === true ? 301 : r.status,
		statusText: r.statusText,
	});
	return moddedResponse;
}

function serviceWorkerInit() {
	// Init the service worker.
	self.addEventListener("install", () => self.skipWaiting());
	self.addEventListener("activate", e => e.waitUntil(self.clients.claim()));
	// Listen for fetch requests and call handleFetch function.
	self.addEventListener("fetch", function (e) {
		try {
			e.respondWith(handleFetch(e.request));
		} catch (err) {
			console.log("Serviceworker NetworkError:" + err);
		}
	});
}

async function doRegister() {
	try {
		const registration = await navigator.serviceWorker.register(window.document.currentScript.src);
		console.log("Service Worker registered", registration.scope);
		// EventListener to make sure that the page gets reloaded when a new serviceworker gets installed.
		// f.e on first access.
		registration.addEventListener("updatefound", () => {
			console.log("Reloading the page to transfer control to the Service Worker.");
			try {
				window.location.reload();
			} catch (err) {
				console.log("Service Worker failed reloading the page. ERROR:" + err);
			};
		});
		// When the registration is active, but it's not controlling the page, we reload the page to have it take control.
		// This f.e occurs when you hard-reload (shift + refresh). https://www.w3.org/TR/service-workers/#navigator-service-worker-controller
		if (registration.active && !navigator.serviceWorker.controller) {
			console.log("Reloading the page to transfer control to the Service Worker.");
			try {
				window.location.reload();
			} catch (err) {
				console.log("Service Worker failed reloading the page. ERROR:" + err);
			};
		}
	}
	catch {
		console.error("Service Worker failed to register:", e)
	}
}

async function serviceWorkerRegister() {
	if (window.crossOriginIsolated) return;
	if (!window.isSecureContext) {
		console.log("Service Worker not registered, a secure context is required.");
		return;
	}
	// Register the service worker and reload the page to transfer control to the serviceworker.
	if ("serviceWorker" in navigator)
		await doRegister();
	else
		console.log("Service worker is not supported in this browser");
}

if (typeof window === 'undefined') // If the script is running in a Service Worker context
	serviceWorkerInit()
else // If the script is running in the browser context
	serviceWorkerRegister();


================================================
FILE: src/app.html
================================================
<!doctype html>
<html lang="en">
	<head>
		<meta charset="utf-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1" />
		<title>WebVM - Linux virtualization in WebAssembly</title>

		<meta name="description" content="Linux virtual machine, running in the browser via HTML5/WebAssembly. Networking and graphics supported.">
		<meta name="keywords" content="WebVM, Virtual Machine, CheerpX, x86 virtualization, WebAssembly, Tailscale, JIT">
		<meta property="og:title" content="WebVM - Linux virtualization in WebAssembly" />
		<meta property="og:type" content="website" />
		<meta property="og:site_name" content="WebVM"/>
		<meta property="og:image" content="https://webvm.io/assets/social_2024.png" />
		<meta name="twitter:card" content="summary_large_image" />
		<meta name="twitter:site" content="@leaningtech" />
		<meta name="twitter:title" content="WebVM - Linux virtualization in WebAssembly" />
		<meta name="twitter:description" content="Linux virtual machine, running in the browser via HTML5/WebAssembly. Networking and graphics supported.">
		<meta name="twitter:image" content="https://webvm.io/assets/social_2024.png" />

		<!-- Apple iOS web clip compatibility tags -->
		<meta name="application-name" content="WebVM" />
		<meta name="apple-mobile-web-app-title" content="WebVM" />
		<meta name="apple-mobile-web-app-capable" content="yes" />
		<meta name="mobile-web-app-capable" content="yes" />
		<meta name="apple-mobile-web-app-status-bar-style" content="black" />
		<link rel="shortcut icon" href="tower.ico">
		<link rel="preconnect" href="https://fonts.googleapis.com">
		<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
		<link rel='stylesheet' href='scrollbar.css'>
		<!-- Serviceworker script that adds the COI headers to the response headers in cases where the server does not support it. -->
		<script src="serviceWorker.js"></script>
		<script data-domain="webvm.io" src="https://plausible.leaningtech.com/js/script.js"></script>
		%sveltekit.head%
	</head>
	<body data-sveltekit-preload-data="hover">
		<div style="display: contents">%sveltekit.body%</div>
	</body>
</html>


================================================
FILE: src/lib/AnthropicTab.svelte
================================================
<script>
	import { apiState, setApiKey, addMessage, clearMessageHistory, forceStop, messageList, currentMessage, enableThinking, getMessageDetails } from '$lib/anthropic.js';
	import { tick } from 'svelte';
	import { get } from 'svelte/store';
	import PanelButton from './PanelButton.svelte';
	import SmallButton from './SmallButton.svelte';
	import { aiActivity } from './activities.js';
	import html2canvas from 'html2canvas-pro';
	export let handleTool;
	let stopRequested = false;
	function handleKeyEnter(e)
	{
		if(e.key != "Enter")
			return;
		var value = e.target.value;
		if(value == "")
			return;
		setApiKey(value);
	}
	function handleMessage(e)
	{
		if(e.key != "Enter")
			return;
		e.preventDefault();
		var textArea = e.target;
		var value = textArea.value;
		if(value == "")
			return;
		textArea.style.height = "unset";
		// Reset the textarea
		currentMessage.set("");
		addMessage(value, handleTool);
	}
	function handleResize(e)
	{
		var textArea = e.target;
		textArea.style.height = textArea.scrollHeight + "px";
	}
	async function scrollToBottom(node)
	{
		await tick();
		node.scrollTop = node.scrollHeight;
		if (!get(aiActivity)) {
			document.getElementById("ai-input").focus();
		}
	}
	function scrollMessage(node, messageList)
	{
		// Make sure the messages are always scrolled to the bottom
		scrollToBottom(node);
		return {
			update(messageList) {
				scrollToBottom(node);
			}
		}
	}
	async function handleStop() {
		stopRequested = true;
		await forceStop();
		stopRequested = false;
	}

	async function handleDownload() {
		const messageListElement = document.getElementById('message-list');
		// Temporarily add padding and background for the list
		messageListElement.classList.add("p-1");
		const canvas = await html2canvas(messageListElement);
		messageListElement.classList.remove("p-1");
		const link = document.createElement('a');
		link.href = canvas.toDataURL('image/png');
		link.download = 'WebVM_Claude.png';
		link.click();
	}

	function toggleThinkingMode() {
		enableThinking.set(!get(enableThinking));
	}
</script>
<h1 class="text-lg font-bold">Claude AI Integration</h1>
<p>WebVM is integrated with Claude by Anthropic AI. You can prompt the AI to control the system.</p>
<p>You need to provide your API key. The key is only saved locally to your browser.</p>
<div class="flex grow flex-col overflow-y-hidden gap-2">
	<p class="flex flex-row gap-2">
		<span class="mr-auto flex items-center">Conversation history</span>
		<SmallButton buttonIcon="fa-solid fa-download" clickHandler={handleDownload} buttonTooltip="Save conversation as image"></SmallButton>
		<SmallButton buttonIcon="fa-solid fa-brain" clickHandler={toggleThinkingMode} buttonTooltip="{$enableThinking ? "Disable" : "Enable"} thinking mode" bgColor={$enableThinking ? "bg-neutral-500" : "bg-neutral-700"}></SmallButton>
		<SmallButton buttonIcon="fa-solid fa-trash-can" clickHandler={clearMessageHistory} buttonTooltip="Clear conversation history"></SmallButton>
	</p>
	<div class="flex grow overflow-y-scroll scrollbar" use:scrollMessage={$messageList}>
		<div class="h-full w-full">
			<div class="w-full min-h-full flex flex-col gap-2 justify-end bg-neutral-600" id="message-list">
				{#each $messageList as msg}
					{@const details = getMessageDetails(msg)}
					{#if details.isToolUse}
						<p class="bg-neutral-700 p-2 rounded-md italic"><i class='fas {details.icon} w-6 mr-2 text-center'></i>{details.messageContent}</p>
					{:else if !details.isToolResult}
						<p class="{msg.role == 'error' ? 'bg-red-900' : 'bg-neutral-700'} p-2 rounded-md whitespace-pre-wrap"><i class='fas {details.icon} w-6 mr-2 text-center'></i>{details.messageContent}</p>
					{/if}
				{/each}
			</div>
		</div>
	</div>
</div>
{#if $apiState == "KEY_REQUIRED"}
	<textarea class="bg-neutral-700 p-2 rounded-md placeholder-gray-400 resize-none shrink-0" placeholder="Insert your Claude API Key" rows="1" on:keydown={handleKeyEnter} on:input={handleResize} id="ai-input"/>
{:else if $aiActivity}
	{#if stopRequested }
		<PanelButton buttonIcon="fa-solid fa-hand" buttonText="Stopping...">
		</PanelButton>
	{:else}
		<PanelButton buttonIcon="fa-solid fa-hand" clickHandler={handleStop} buttonText="Stop">
		</PanelButton>
	{/if}
{:else}
	<textarea class="bg-neutral-700 p-2 rounded-md placeholder-gray-400 resize-none shrink-0" placeholder={handleTool === null ? "Waiting for system initialization..." : "Prompt..."} rows="1" on:keydown={handleMessage} on:input={handleResize} bind:value={$currentMessage} id="ai-input" disabled={handleTool === null}/>
{/if}


================================================
FILE: src/lib/BlogPost.svelte
================================================
<script>
	export let title;
	export let image;
	export let url;
</script>
<a href={url} target="_blank"><div class="bg-neutral-700 hover:bg-neutral-500 p-2 rounded-md">
	<img class="w-full aspect-[40/21]" src={image}>
	<h2 class="text-sm font-bold">{title}</h2>
</div></a>


================================================
FILE: src/lib/CpuTab.svelte
================================================
<script>
	import PanelButton from './PanelButton.svelte';
	import { cpuPercentage } from './activities.js'
</script>

<h1 class="text-lg font-bold">Engine</h1>
<PanelButton buttonImage="assets/cheerpx.svg" clickUrl="https://cheerpx.io/docs" buttonText="Explore CheerpX">
</PanelButton>
<p><span class="font-bold">Virtual CPU: </span>{$cpuPercentage}%</p>
<p>CheerpX is a x86 virtualization engine in WebAssembly</p>
<p>It can securely run unmodified x86 binaries and libraries in the browser</p>
<p>Excited about our technology? <a class="underline" href="https://cheerpx.io/docs/getting-started" target="_blank">Start building</a> your projects using <a class="underline" href="https://cheerpx.io/" target="_blank">CheerpX</a> today!</p>


================================================
FILE: src/lib/DiscordTab.svelte
================================================
<script>
	import PanelButton from './PanelButton.svelte';
	import DiscordPresenceCount from 'labs/packages/astro-theme/components/nav/DiscordPresenceCount.svelte'
</script>

<h1 class="text-lg font-bold">Discord</h1>
<PanelButton buttonImage="assets/discord-mark-blue.svg" clickUrl="https://discord.gg/yTNZgySKGa" buttonText="Join our Discord">
	<i class='fas fa-circle fa-xs ml-auto text-green-500'></i>
	<span class="ml-1"><DiscordPresenceCount /></span>
</PanelButton>
<p>Do you have any question about WebVM or CheerpX?</p>
<p>Join our community, we are happy to help!</p>


================================================
FILE: src/lib/DiskTab.svelte
================================================
<script>
	import PanelButton from './PanelButton.svelte';
	import { createEventDispatcher } from 'svelte';
	import { diskLatency } from './activities.js'
	var dispatch = createEventDispatcher();
	let state = "START";
	function handleReset()
	{
		if(state == "START")
			state = "CONFIRM";
		else if (state == "CONFIRM") {
			state = "RESETTING";
			dispatch('reset');
		}
	}
	function getButtonText(state)
	{
		if(state == "START")
			return "Reset disk";
		else if (state == "RESETTING")
			return "Resetting...";
		else
			return "Reset disk. Confirm?";
	}
	function getBgColor(state)
	{
		if(state == "START")
		{
			// Use default
			return undefined;
		}
		else
		{
			return "bg-red-900";
		}
	}
	function getHoverColor(state)
	{
		if(state == "START")
		{
			// Use default
			return undefined;
		}
		else
		{
			return "hover:bg-red-700";
		}
	}
</script>
<h1 class="text-lg font-bold">Disk</h1>
<PanelButton buttonIcon="fa-solid fa-trash-can" clickHandler={handleReset} buttonText={getButtonText(state)} bgColor={getBgColor(state)} hoverColor={getHoverColor(state)}>
</PanelButton>
{#if state == "CONFIRM"}
	<p><span class="font-bold">Warning: </span>WebVM will reload</p>
{:else if state == "RESETTING"}
	<p><span class="font-bold">Reset in progress: </span>Please wait...</p>
{:else}
	<p><span class="font-bold">Backend latency: </span>{$diskLatency}ms</p>
{/if}
<p>WebVM runs on top of a complete Linux distribution</p>
<p>Filesystems up to 2GB are supported and data is downloaded completely on-demand</p>
<p>The WebVM cloud backend uses WebSockets and it's distributed via a global CDN to minimize download latency</p>


================================================
FILE: src/lib/GitHubTab.svelte
================================================
<script>
	import PanelButton from './PanelButton.svelte';
	import GitHubStarCount from 'labs/packages/astro-theme/components/nav/GitHubStarCount.svelte'
</script>

<h1 class="text-lg font-bold">GitHub</h1>
<PanelButton buttonImage="assets/github-mark-white.svg" clickUrl="https://github.com/leaningtech/webvm" buttonText="GitHub repo">
	<i class='fas fa-star fa-xs ml-auto'></i>
	<span class="ml-1"><GitHubStarCount repo="leaningtech/webvm"/></span>
</PanelButton>
<p>Like WebVM? <a class="underline" href="https://github.com/leaningtech/webvm" target="_blank">Give us a star!</a></p>
<p>WebVM is FOSS, you can fork it to build your own version and begin working on your CheerpX-based project</p>
<p>Found a bug? Please open a <a class="underline" href="https://github.com/leaningtech/webvm/issues" target="_blank">GitHub issue</a></p>


================================================
FILE: src/lib/Icon.svelte
================================================
<script>
	export let icon;
	export let info;
	export let activity;
	import { createEventDispatcher } from 'svelte';

	const dispatch = createEventDispatcher();
	function handleMouseover() {
		dispatch('mouseover', info);
	}
	function handleClick() {
		dispatch('click', { icon, info });
	}
</script>

<div 
	class="p-3 cursor-pointer text-center hover:bg-neutral-600 {$activity ? "text-amber-500 animate-pulse" : "hover:text-gray-100"}"
	style="animation-duration: 0.5s"
	on:mouseenter={handleMouseover}
	on:click={handleClick}
>
	<i class='{icon} fa-xl'></i>
</div>


================================================
FILE: src/lib/InformationTab.svelte
================================================
<h1 class="text-lg font-bold">Information</h1>
<img src="assets/webvm_hero.png" alt="WebVM Logo" class="w-56 h-56 object-contain self-center">
<p>WebVM is a virtual Linux environment running in the browser via WebAssembly</p>
<p>It is based on:</p>
<ul class="list-disc list-inside">
	<li><a class="underline" target="_blank" href="https://cheerpx.io/">CheerpX</a>: x86 JIT in Wasm</li>
	<li><a class="underline" target="_blank" href="https://xtermjs.org/">Xterm.js</a>: interactive terminal</li>
	<li>Local/private <a class="underline" target="_blank" href="https://cheerpx.io/docs/guides/File-System-support">file storage</a></li>
	<li><a class="underline" target="_blank" href="https://cheerpx.io/docs/guides/Networking">Networking</a> via <a class="underline" target="_blank" href="https://tailscale.com/">Tailscale</a></li>
</ul>
<slot></slot>


================================================
FILE: src/lib/NetworkingTab.svelte
================================================
<script>
	import { networkData, startLogin, updateButtonData } from '$lib/network.js'
	import { createEventDispatcher } from 'svelte';
	import PanelButton from './PanelButton.svelte';
	var dispatch = createEventDispatcher();
	var connectionState = networkData.connectionState;
	var exitNode = networkData.exitNode;

	function handleConnect() {
		connectionState.set("DOWNLOADING");
		dispatch('connect');
	}

	let buttonData = null;
	$: buttonData = updateButtonData($connectionState, handleConnect);
</script>
<h1 class="text-lg font-bold">Networking</h1>
<PanelButton buttonImage="assets/tailscale.svg" clickUrl={buttonData.clickUrl} clickHandler={buttonData.clickHandler} rightClickHandler={buttonData.rightClickHandler} buttonTooltip={buttonData.buttonTooltip} buttonText={buttonData.buttonText}>
	{#if $connectionState == "CONNECTED"}
		<i class='fas fa-circle fa-xs ml-auto {$exitNode ? 'text-green-500' : 'text-amber-500'}' title={$exitNode ? 'Ready' : 'No exit node'}></i>
	{/if}
</PanelButton>
<p>WebVM can connect to the Internet via Tailscale</p>
<p>Using Tailscale is required since browser do not support TCP/UDP sockets (yet!)</p>


================================================
FILE: src/lib/PanelButton.svelte
================================================
<script>
	export let clickUrl = null;
	export let clickHandler = null;
	export let rightClickHandler = null;
	export let buttonTooltip = null;
	export let bgColor = "bg-neutral-700";
	export let hoverColor = "hover:bg-neutral-500"
	export let buttonImage = null;
	export let buttonIcon = null;
	export let buttonText;
</script>

<a href={clickUrl} target="_blank" on:click={clickHandler} on:contextmenu={rightClickHandler}><p class="flex flex-row items-center {bgColor} p-2 rounded-md shadow-md shadow-neutral-900 {(clickUrl != null || clickHandler != null) ? `${hoverColor} cursor-pointer` : ""}" title={buttonTooltip}>
{#if buttonImage}
<img src={buttonImage} class="inline w-8 h-8"/>
{:else if buttonIcon}
<i class="w-8 {buttonIcon} text-center" style="font-size: 2em;"></i>
{/if}
<span class="ml-1">{buttonText}</span><slot></slot></p></a>


================================================
FILE: src/lib/PostsTab.svelte
================================================
<script>
	import BlogPost from './BlogPost.svelte';
	import { page } from '$app/stores';
</script>
<h1 class="text-lg font-bold">Blog posts</h1>
<div class="overflow-y-scroll scrollbar flex flex-col gap-2">
{#each $page.data.posts as post}
	<BlogPost
		title={post.title}
		image={post.image}
		url={post.url}
	/>
{/each}
</div>


================================================
FILE: src/lib/SideBar.svelte
================================================
<script>
	import { createEventDispatcher } from 'svelte';
	import Icon from './Icon.svelte';
	import InformationTab from './InformationTab.svelte';
	import NetworkingTab from './NetworkingTab.svelte';
	import CpuTab from './CpuTab.svelte';
	import DiskTab from './DiskTab.svelte';
	import AnthropicTab from './AnthropicTab.svelte';
	import PostsTab from './PostsTab.svelte';
	import DiscordTab from './DiscordTab.svelte';
	import GitHubTab from './GitHubTab.svelte';
	import SmallButton from './SmallButton.svelte';
	import { cpuActivity, diskActivity, aiActivity } from './activities.js';
	const icons = [
		{ icon: 'fas fa-info-circle', info: 'Information', activity: null },
		{ icon: 'fas fa-wifi', info: 'Networking', activity: null },
		{ icon: 'fas fa-microchip', info: 'CPU', activity: cpuActivity },
		{ icon: 'fas fa-compact-disc', info: 'Disk', activity: diskActivity },
		{ icon: 'fas fa-robot', info: 'ClaudeAI', activity: aiActivity },
		null,
		{ icon: 'fas fa-book-open', info: 'Posts', activity: null },
		{ icon: 'fab fa-discord', info: 'Discord', activity: null },
		{ icon: 'fab fa-github', info: 'GitHub', activity: null },
	];
	let dispatch = createEventDispatcher();
	let activeInfo = null; // Tracks currently visible info.
	let hideTimeout = 0; // Timeout for hiding info panel.
	export let sideBarPinned;

	function showInfo(info) {
		clearTimeout(hideTimeout);
		hideTimeout = 0;
		activeInfo = info;
	}
	function hideInfo() {
		// Never remove the sidebar if pinning is enabled
		if(sideBarPinned)
			return;
		// Prevents multiple timers and hides the info panel after 400ms unless interrupted.
		clearTimeout(hideTimeout);
		hideTimeout = setTimeout(() => {
			activeInfo = null;
			hideTimeout = 0;
		}, 400);
	}
	function handleMouseEnterPanel() {
		clearTimeout(hideTimeout);
		hideTimeout = 0;
	}
	// Toggles the info panel for the clicked icon.
	function handleClick(icon) {
		if(sideBarPinned)
			return;
		// Hides the panel if the icon is active. Otherwise, shows the panel with info.
		if (activeInfo === icon.info) {
			activeInfo = null;
		} else {
			activeInfo = icon.info;
		}
	}

	function toggleSidebarPin() {
		sideBarPinned = !sideBarPinned;
		dispatch('sidebarPinChange', sideBarPinned);
	}

	export let handleTool;
</script>

<div class="flex flex-row w-14 h-full bg-neutral-700" >
	<div class="flex flex-col shrink-0 w-14 text-gray-300">
		{#each icons as i}
			{#if i}
				<Icon
					icon={i.icon}
					info={i.info}
					activity={i.activity}
					on:mouseover={(e) => showInfo(e.detail)}
					on:click={() => handleClick(i)}
				/>
			{:else}
				<div class="grow" on:mouseenter={handleMouseEnterPanel}></div>
			{/if}
		{/each}
	</div>
	<div
		class="relative flex flex-col gap-5 shrink-0 w-80 h-full z-10 p-2 bg-neutral-600 text-gray-100 opacity-95"
		class:hidden={!activeInfo}
		on:mouseenter={handleMouseEnterPanel}
		on:mouseleave={hideInfo}
	>
		<div class="absolute right-2 top-2">
			<SmallButton
				buttonIcon="fa-solid fa-thumbtack"
				clickHandler={toggleSidebarPin}
				buttonTooltip={sideBarPinned ? "Unpin Sidebar" : "Pin Sidebar"}
				bgColor={sideBarPinned ? "bg-neutral-500" : "bg-neutral-700"}
			/>
		</div>
		{#if activeInfo === 'Information'}
			<InformationTab>
				<slot></slot>
			</InformationTab>
		{:else if activeInfo === 'Networking'}
			<NetworkingTab on:connect/>
		{:else if activeInfo === 'CPU'}
			<CpuTab/>
		{:else if activeInfo === 'Disk'}
			<DiskTab on:reset/>
		{:else if activeInfo === 'ClaudeAI'}
			<AnthropicTab handleTool={handleTool} />
		{:else if activeInfo === 'Posts'}
			<PostsTab/>
		{:else if activeInfo === 'Discord'}
			<DiscordTab/>
		{:else if activeInfo === 'GitHub'}
			<GitHubTab/>
		{:else}
			<p>TODO: {activeInfo}</p>
		{/if}

		<div class="mt-auto text-sm text-gray-300">
			<div class="pt-1 pb-1">
				<a href="https://cheerpx.io/" target="_blank">
					<span>Powered by CheerpX</span>
					<img src="assets/cheerpx.svg" alt="CheerpX Logo" class="w-6 h-6 inline-block">
				</a>
			</div>
			<hr class="border-t border-solid border-gray-300">
			<div class="pt-1 pb-1">
				<a href="https://leaningtech.com/" target="”_blank”">© 2022-2025 Leaning Technologies</a>
			</div>
		</div>
	</div>
</div>


================================================
FILE: src/lib/SmallButton.svelte
================================================
<script>
	export let clickHandler = null;
	export let buttonTooltip = null;
	export let bgColor = "bg-neutral-700";
	export let hoverColor = "hover:bg-neutral-500"
	export let buttonIcon = null;
</script>

<span class="inline-block h-7 {bgColor} text-sm p-1 rounded-md shadow-md shadow-neutral-900 {(clickHandler != null) ? `${hoverColor} cursor-pointer` : ""}" title={buttonTooltip} on:click={clickHandler}>
<i class="w-5 {buttonIcon} text-center"></i>
</span>


================================================
FILE: src/lib/WebVM.svelte
================================================
<script>
	import { onMount, tick } from 'svelte';
	import { get } from 'svelte/store';
	import Nav from 'labs/packages/global-navbar/src/Nav.svelte';
	import SideBar from '$lib/SideBar.svelte';
	import '$lib/global.css';
	import '@xterm/xterm/css/xterm.css'
	import '@fortawesome/fontawesome-free/css/all.min.css'
	import { networkInterface, startLogin } from '$lib/network.js'
	import { cpuActivity, diskActivity, cpuPercentage, diskLatency } from '$lib/activities.js'
	import { introMessage, errorMessage, unexpectedErrorMessage } from '$lib/messages.js'
	import { displayConfig, handleToolImpl } from '$lib/anthropic.js'
	import { tryPlausible } from '$lib/plausible.js'

	export let configObj = null;
	export let processCallback = null;
	export let cacheId = null;
	export let cpuActivityEvents = [];
	export let diskLatencies = [];
	export let activityEventsInterval = 0;

	var term = null;
	var cx = null;
	var fitAddon = null;
	var cxReadFunc = null;
	var blockCache = null;
	var processCount = 0;
	var curVT = 0;
	var sideBarPinned = false;
	function writeData(buf, vt)
	{
		if(vt != 1)
			return;
		term.write(new Uint8Array(buf));
	}
	function readData(str)
	{
		if(cxReadFunc == null)
			return;
		for(var i=0;i<str.length;i++)
			cxReadFunc(str.charCodeAt(i));
	}
	function printMessage(msg)
	{
		for(var i=0;i<msg.length;i++)
			term.write(msg[i] + "\n");
	}
	function expireEvents(list, curTime, limitTime)
	{
		while(list.length > 1)
		{
			if(list[1].t < limitTime)
			{
				list.shift();
			}
			else
			{
				break;
			}
		}
	}
	function cleanupEvents()
	{
		var curTime = Date.now();
		var limitTime = curTime - 10000;
		expireEvents(cpuActivityEvents, curTime, limitTime);
		computeCpuActivity(curTime, limitTime);
		if(cpuActivityEvents.length == 0)
		{
			clearInterval(activityEventsInterval);
			activityEventsInterval = 0;
		}
	}
	function computeCpuActivity(curTime, limitTime)
	{
		var totalActiveTime = 0;
		var lastActiveTime = limitTime;
		var lastWasActive = false;
		for(var i=0;i<cpuActivityEvents.length;i++)
		{
			var e = cpuActivityEvents[i];
			// NOTE: The first event could be before the limit,
			//       we need at least one event to correctly mark
			//       active time when there is long time under load
			var eTime = e.t;
			if(eTime < limitTime)
				eTime = limitTime;
			if(e.state == "ready")
			{
				// Inactive state, add the time from lastActiveTime
				totalActiveTime += (eTime - lastActiveTime);
				lastWasActive = false;
			}
			else
			{
				// Active state
				lastActiveTime = eTime;
				lastWasActive = true;
			}
		}
		// Add the last interval if needed
		if(lastWasActive)
		{
			totalActiveTime += (curTime - lastActiveTime);
		}
		cpuPercentage.set(Math.ceil((totalActiveTime / 10000) * 100));
	}
	function hddCallback(state)
	{
		diskActivity.set(state != "ready");
	}
	function latencyCallback(latency)
	{
		diskLatencies.push(latency);
		if(diskLatencies.length > 30)
			diskLatencies.shift();
		// Average the latency over at most 30 blocks
		var total = 0;
		for(var i=0;i<diskLatencies.length;i++)
			total += diskLatencies[i];
		var avg = total / diskLatencies.length;
		diskLatency.set(Math.ceil(avg));
	}
	function cpuCallback(state)
	{
		cpuActivity.set(state != "ready");
		var curTime = Date.now();
		var limitTime = curTime - 10000;
		expireEvents(cpuActivityEvents, curTime, limitTime);
		cpuActivityEvents.push({t: curTime, state: state});
		computeCpuActivity(curTime, limitTime);
		// Start an interval timer to cleanup old samples when no further activity is received
		if(activityEventsInterval != 0)
			clearInterval(activityEventsInterval);
		activityEventsInterval = setInterval(cleanupEvents, 2000);
	}
	function computeXTermFontSize()
	{
		return parseInt(getComputedStyle(document.body).fontSize);
	}
	function setScreenSize(display)
	{
		var internalMult = 1.0;
		var displayWidth = display.offsetWidth;
		var displayHeight = display.offsetHeight;
		var minWidth = 1024;
		var minHeight = 768;
		if(displayWidth < minWidth)
			internalMult = minWidth / displayWidth;
		if(displayHeight < minHeight)
			internalMult = Math.max(internalMult, minHeight / displayHeight);
		var internalWidth = Math.floor(displayWidth * internalMult);
		var internalHeight = Math.floor(displayHeight * internalMult);
		cx.setKmsCanvas(display, internalWidth, internalHeight);
		// Compute the size to be used for AI screenshots
		var screenshotMult = 1.0;
		var maxWidth = 1024;
		var maxHeight = 768;
		if(internalWidth > maxWidth)
			screenshotMult = maxWidth / internalWidth;
		if(internalHeight > maxHeight)
			screenshotMult = Math.min(screenshotMult, maxHeight / internalHeight);
		var screenshotWidth = Math.floor(internalWidth * screenshotMult);
		var screenshotHeight = Math.floor(internalHeight * screenshotMult);
		// Track the state of the mouse as requested by the AI, to avoid losing the position due to user movement
		displayConfig.set({width: screenshotWidth, height: screenshotHeight, mouseMult: internalMult * screenshotMult});
	}
	var curInnerWidth = 0;
	var curInnerHeight = 0;
	function handleResize()
	{
		// Avoid spurious resize events caused by the soft keyboard
		if(curInnerWidth == window.innerWidth && curInnerHeight == window.innerHeight)
			return;
		curInnerWidth = window.innerWidth;
		curInnerHeight = window.innerHeight;
		triggerResize();
	}
	function triggerResize()
	{
		term.options.fontSize = computeXTermFontSize();
		fitAddon.fit();
		const display = document.getElementById("display");
		if(display)
			setScreenSize(display);
	}
	async function initTerminal()
	{
		const { Terminal } = await import('@xterm/xterm');
		const { FitAddon } = await import('@xterm/addon-fit');
		const { WebLinksAddon } = await import('@xterm/addon-web-links');
		term = new Terminal({cursorBlink:true, convertEol:true, fontFamily:"monospace", fontWeight: 400, fontWeightBold: 700, fontSize: computeXTermFontSize()});
		fitAddon = new FitAddon();
		term.loadAddon(fitAddon);
		var linkAddon = new WebLinksAddon();
		term.loadAddon(linkAddon);
		const consoleDiv = document.getElementById("console");
		term.open(consoleDiv);
		term.scrollToTop();
		fitAddon.fit();
		window.addEventListener("resize", handleResize);
		term.focus();
		term.onData(readData);
		// Avoid undesired default DnD handling
		function preventDefaults (e) {
			e.preventDefault()
			e.stopPropagation()
		}
		consoleDiv.addEventListener("dragover", preventDefaults, false);
		consoleDiv.addEventListener("dragenter", preventDefaults, false);
		consoleDiv.addEventListener("dragleave", preventDefaults, false);
		consoleDiv.addEventListener("drop", preventDefaults, false);
		curInnerWidth = window.innerWidth;
		curInnerHeight = window.innerHeight;
		if(configObj.printIntro)
			printMessage(introMessage);
		try
		{
			await initCheerpX();
		}
		catch(e)
		{
			printMessage(unexpectedErrorMessage);
			printMessage([e.toString()]);
			return;
		}
	}
	function handleActivateConsole(vt)
	{
		if(curVT == vt)
			return;
		curVT = vt;
		if(vt != 7)
			return;
		// Raise the display to the foreground
		const display = document.getElementById("display");
		display.parentElement.style.zIndex = 5;
		tryPlausible("Display activated");
	}
	function handleProcessCreated()
	{
		processCount++;
		if(processCallback)
			processCallback(processCount);
	}
	async function initCheerpX()
	{
		const CheerpX = await import('@leaningtech/cheerpx');
		var blockDevice = null;
		switch(configObj.diskImageType)
		{
			case "cloud":
				try
				{
					blockDevice = await CheerpX.CloudDevice.create(configObj.diskImageUrl);
				}
				catch(e)
				{
					// Report the failure and try again with plain HTTP
					var wssProtocol = "wss:";
					if(configObj.diskImageUrl.startsWith(wssProtocol))
					{
						// WebSocket protocol failed, try agin using plain HTTP
						tryPlausible("WS Disk failure");
						blockDevice = await CheerpX.CloudDevice.create("https:" + configObj.diskImageUrl.substr(wssProtocol.length));
					}
					else
					{
						// No other recovery option
						throw e;
					}
				}
				break;
			case "bytes":
				blockDevice = await CheerpX.HttpBytesDevice.create(configObj.diskImageUrl);
				break;
			case "github":
				blockDevice = await CheerpX.GitHubDevice.create(configObj.diskImageUrl);
				break;
			default:
				throw new Error("Unrecognized device type");
		}
		blockCache = await CheerpX.IDBDevice.create(cacheId);
		var overlayDevice = await CheerpX.OverlayDevice.create(blockDevice, blockCache);
		var webDevice = await CheerpX.WebDevice.create("");
		var documentsDevice = await CheerpX.WebDevice.create("documents");
		var dataDevice = await CheerpX.DataDevice.create();
		var mountPoints = [
			// The root filesystem, as an Ext2 image
			{type:"ext2", dev:overlayDevice, path:"/"},
			// Access to files on the Web server, relative to the current page
			{type:"dir", dev:webDevice, path:"/web"},
			// Access to read-only data coming from JavaScript
			{type:"dir", dev:dataDevice, path:"/data"},
			// Automatically created device files
			{type:"devs", path:"/dev"},
			// Pseudo-terminals
			{type:"devpts", path:"/dev/pts"},
			// The Linux 'proc' filesystem which provides information about running processes
			{type:"proc", path:"/proc"},
			// The Linux 'sysfs' filesystem which is used to enumerate emulated devices
			{type:"sys", path:"/sys"},
			// Convenient access to sample documents in the user directory
			{type:"dir", dev:documentsDevice, path:"/home/user/documents"}
		];
		try
		{
			cx = await CheerpX.Linux.create({mounts: mountPoints, networkInterface: networkInterface});
		}
		catch(e)
		{
			printMessage(errorMessage);
			printMessage([e.toString()]);
			return;
		}
		cx.registerCallback("cpuActivity", cpuCallback);
		cx.registerCallback("diskActivity", hddCallback);
		cx.registerCallback("diskLatency", latencyCallback);
		cx.registerCallback("processCreated", handleProcessCreated);
		term.scrollToBottom();
		cxReadFunc = cx.setCustomConsole(writeData, term.cols, term.rows);
		const display = document.getElementById("display");
		if(display)
		{
			setScreenSize(display);
			cx.setActivateConsole(handleActivateConsole);
		}
		// Run the command in a loop, in case the user exits
		while (true)
		{
			await cx.run(configObj.cmd, configObj.args, configObj.opts);
		}
	}
	onMount(initTerminal);
	async function handleConnect()
	{
		const w = window.open("login.html", "_blank");
		cx.networkLogin();
		w.location.href = await startLogin();
	}
	async function handleReset()
	{
		// Be robust before initialization
		if(blockCache == null)
			return;
		await blockCache.reset();
		location.reload();
	}
	async function handleTool(tool)
	{
		return await handleToolImpl(tool, term);
	}
	async function handleSidebarPinChange(event)
	{
		sideBarPinned = event.detail;
		// Make sure the pinning state of reflected in the layout
		await tick();
		// Adjust the layout based on the new sidebar state
		triggerResize();
	}
</script>

<main class="relative w-full h-full">
	<Nav />
	<div class="absolute top-10 bottom-0 left-0 right-0">
		<SideBar on:connect={handleConnect} on:reset={handleReset} handleTool={!configObj.needsDisplay || curVT == 7 ? handleTool : null} on:sidebarPinChange={handleSidebarPinChange}>
			<slot></slot>
		</SideBar>
		{#if configObj.needsDisplay}
			<div class="absolute top-0 bottom-0 {sideBarPinned ? 'left-[23.5rem]' : 'left-14'} right-0">
				<canvas class="w-full h-full cursor-none" id="display"></canvas>
			</div>
		{/if}
		<div class="absolute top-0 bottom-0 {sideBarPinned ? 'left-[23.5rem]' : 'left-14'} right-0 p-1 scrollbar" id="console">
		</div>
	</div>
</main>


================================================
FILE: src/lib/activities.js
================================================
import { writable } from 'svelte/store';

export const cpuActivity = writable(false);
export const diskActivity = writable(false);
export const aiActivity = writable(false);
export const cpuPercentage = writable(0);
export const diskLatency = writable(0);


================================================
FILE: src/lib/anthropic.js
================================================
import { get, writable } from 'svelte/store';
import { browser } from '$app/environment'
import { aiActivity } from '$lib/activities.js'
import { tryPlausible } from '$lib/plausible.js';

import Anthropic from '@anthropic-ai/sdk';

var client = null;
var messages = [];
var stopFlag = false;
var lastScreenshot = null;
var screenshotCanvas = null;
var screenshotCtx = null;

export function setApiKey(key)
{
	client = new Anthropic({apiKey: key, dangerouslyAllowBrowser: true});
	// Reset messages
	messages = []
	messageList.set(messages);
	localStorage.setItem("anthropic-api-key", key);
	apiState.set("READY");
	tryPlausible("ClaudeAI Key");
}

function clearApiKey()
{
	localStorage.removeItem("anthropic-api-key");
	apiState.set("KEY_REQUIRED");
}

function addMessageInternal(role, content)
{
	messages.push({role: role, content: content});
	messageList.set(messages);
}

async function sendMessages(handleTool)
{
	aiActivity.set(true);
	try
	{
		var dc = get(displayConfig);
		var tool = dc ? { type: "computer_20250124", name: "computer", display_width_px: dc.width, display_height_px: dc.height, display_number: 1 } : { type: "bash_20250124", name: "bash" }
		const config = {max_tokens: 2048,
									messages: messages,
									system: "You are running on a virtualized machine. Wait some extra time after all operations to compensate for slowdown.",
									model: 'claude-3-7-sonnet-20250219',
									tools: [tool],
									tool_choice: {type: "auto", disable_parallel_tool_use: true},
									betas: ["computer-use-2025-01-24"]
								};
		if(get(enableThinking))
			config.thinking = { type: "enabled", budget_tokens: 1024 };
		const response = await client.beta.messages.create(config);
		if(stopFlag)
		{
			aiActivity.set(false);
			return;
		}
		// Remove all the image payloads, we don't want to send them over and over again
		for(var i=0;i<messages.length;i++)
		{
			var c = messages[i].content;
			if(Array.isArray(c))
			{
				if(c[0].type == "tool_result" && c[0].content && c[0].content[0].type == "image")
					delete c[0].content;
			}
		}
		var content = response.content;
		// Be robust to multiple response
		for(var i=0;i<content.length;i++)
		{
			var c = content[i];
			if(c.type == "text")
			{
				addMessageInternal(response.role, c.text);
			}
			else if(c.type == "tool_use")
			{
				addMessageInternal(response.role, [c]);
				var commandResponse = await handleTool(c.input);
				var responseObj = {type: "tool_result", tool_use_id: c.id };
				if(commandResponse != null)
				{
					if(commandResponse instanceof Error)
					{
						console.warn(`Tool error: ${commandResponse.message}`);
						responseObj.content = commandResponse.message;
						responseObj.is_error = true;
					}
					else
					{
						responseObj.content = commandResponse;
					}
				}
				addMessageInternal("user", [responseObj]);
				if(stopFlag)
				{
					// Maintain state consitency by stopping after adding a valid response
					aiActivity.set(false);
					return;
				}
				sendMessages(handleTool);
			}
			else if(c.type == "thinking")
			{
				addMessageInternal(response.role, [c]);
			}
			else
			{
				console.warn(`Invalid response type: ${c.type}`);
			}
		}
		if(response.stop_reason == "end_turn")
		{
			tryPlausible("ClaudeAI Success");
			aiActivity.set(false);
		}
	}
	catch(e)
	{
		tryPlausible("ClaudeAI Error");
		if(e.status == 401)
		{
			addMessageInternal('error', 'Invalid API key');
			clearApiKey();
		}
		else
		{
			addMessageInternal('error', e.error.error.message);
		}
			
	}
}

export function addMessage(text, handleTool)
{
	addMessageInternal('user', text);
	sendMessages(handleTool);
	tryPlausible("ClaudeAI Use");
}

export function clearMessageHistory() {
	messages.length = 0;
	messageList.set(messages);
}

export function forceStop() {
    stopFlag = true;
    return new Promise((resolve) => {
        const unsubscribe = aiActivity.subscribe((value) => {
            if (!value) {
                unsubscribe();
				stopFlag = false;
                resolve();
            }
        });
    });
}

export function getMessageDetails(msg) {
	const isToolUse = Array.isArray(msg.content) && msg.content[0].type === "tool_use";
	const isToolResult = Array.isArray(msg.content) && msg.content[0].type === "tool_result";
	const isThinking = Array.isArray(msg.content) && msg.content[0].type === "thinking";
	let icon = "";
	let messageContent = "";

	if (isToolUse) {
		let tool = msg.content[0].input;
		if (tool.action === "screenshot") {
			icon = "fa-desktop";
			messageContent = "Screenshot";
		} else if (tool.action === "mouse_move") {
			icon = "fa-mouse-pointer";
			var coords = tool.coordinate;
			messageContent = `Mouse at (${coords[0]}, ${coords[1]})`;
		} else if (tool.action === "left_click") {
			icon = "fa-mouse-pointer";
			var coords = tool.coordinate;
			messageContent = `Left click at (${coords[0]}, ${coords[1]})`;
		} else if (tool.action === "right_click") {
			icon = "fa-mouse-pointer";
			var coords = tool.coordinate;
			messageContent = `Right click at (${coords[0]}, ${coords[1]})`;
		} else if (tool.action === "wait") {
			icon = "fa-hourglass-half";
			messageContent = "Waiting";
		} else if (tool.action === "key") {
			icon = "fa-keyboard";
			messageContent = `Key press: ${tool.text}`;
		} else if (tool.action === "type") {
			icon = "fa-keyboard";
			messageContent = "Type text";
		} else {
			icon = "fa-screwdriver-wrench";
			messageContent = "Use the system";
		}
	} else if (isThinking) {
		icon = "fa-brain";
		messageContent = "Thinking...";
	} else {
		icon = msg.role === "user" ? "fa-user" : "fa-robot";
		messageContent = msg.content;
	}

	return {
		isToolUse,
		isToolResult,
		icon,
		messageContent,
		role: msg.role
	};
}

async function yieldHelper(timeout)
{
	return new Promise(function(f2, r2)
	{
		setTimeout(f2, timeout);
	});
}

async function kmsSendChar(textArea, charStr)
{
	textArea.value = "_" + charStr;
	var ke = new KeyboardEvent("keydown");
	textArea.dispatchEvent(ke);
	var ke = new KeyboardEvent("keyup");
	textArea.dispatchEvent(ke);
	await yieldHelper(0);
}

function getKmsInputElement()
{
	// Find the CheerpX textare, it's attached to the body element
	for(const node of document.body.children)
	{
		if(node.tagName == "TEXTAREA")
			return node;
	}
	return null;
}

export async function handleToolImpl(tool, term)
{
	if(tool.command)
	{
		var sentinel = "# End of AI command";
		var buffer = term.buffer.active;
		// Get the current cursor position
		var marker = term.registerMarker();
		var startLine = marker.line;
		marker.dispose();
		var ret = new Promise(function(f, r)
		{
			var callbackDisposer = term.onWriteParsed(function()
			{
				var curLength = buffer.length;
				// Accumulate the output and see if the sentinel has been printed
				var output = "";
				for(var i=startLine + 1;i<curLength;i++)
				{
					var curLine = buffer.getLine(i).translateToString(true, 0, term.cols);;
					if(curLine.indexOf(sentinel) >= 0)
					{
						// We are done, cleanup and return
						callbackDisposer.dispose();
						return f(output);
					}
					output += curLine + "\n";
				}
			});
		});
		term.input(tool.command);
		term.input("\n");
		term.input(sentinel);
		term.input("\n");
		return ret;
	}
	else if(tool.action)
	{
		// Desktop control
		// TODO: We should have an explicit API to interact with CheerpX display
		switch(tool.action)
		{
			case "screenshot":
			{
				// Insert a 3 seconds delay unconditionally, the reference implementation uses 2
				await yieldHelper(3000);
				var delayCount = 0;
				var display = document.getElementById("display");
				var dc = get(displayConfig);
				if(screenshotCanvas == null)
				{
					screenshotCanvas = document.createElement("canvas");
					screenshotCtx = screenshotCanvas.getContext("2d");
				}
				if(screenshotCanvas.width != dc.width || screenshotCanvas.height != dc.height)
				{
					screenshotCanvas.width = dc.width;
					screenshotCanvas.height = dc.height;
				}
				while(1)
				{
					// Resize the canvas to a Claude compatible size
					screenshotCtx.drawImage(display, 0, 0, display.width, display.height, 0, 0, dc.width, dc.height);
					var dataUrl = screenshotCanvas.toDataURL("image/png");
					if(dataUrl == lastScreenshot)
					{
						// Delay at most 3 times
						if(delayCount < 3)
						{
							// TODO: Defensive message, validate and remove
							console.warn("Identical screenshot, rate limiting");
							delayCount++;
							// Wait some time and retry
							await yieldHelper(5000);
							continue;
						}
					}
					lastScreenshot = dataUrl;
					// Remove prefix from the encoded data
					dataUrl = dataUrl.substring("data:image/png;base64,".length);
					var imageSrc = { type: "base64", media_type: "image/png", data: dataUrl };
					var contentObj = { type: "image", source: imageSrc };
					return [ contentObj ];
				}
			}
			case "mouse_move":
			{
				var coords = tool.coordinate;
				var dc = get(displayConfig);
				var mouseX = coords[0] / dc.mouseMult;
				var mouseY = coords[1] / dc.mouseMult;
				var display = document.getElementById("display");
				var clientRect = display.getBoundingClientRect();
				var me = new MouseEvent('mousemove', { clientX: mouseX + clientRect.left, clientY: mouseY + clientRect.top });
				display.dispatchEvent(me);
				return null;
			}
			case "left_click":
			{
				var coords = tool.coordinate;
				var dc = get(displayConfig);
				var mouseX = coords[0] / dc.mouseMult;
				var mouseY = coords[1] / dc.mouseMult;
				var display = document.getElementById("display");
				var clientRect = display.getBoundingClientRect();
				var me = new MouseEvent('mousedown', { clientX: mouseX + clientRect.left, clientY: mouseY + clientRect.top, button: 0 });
				display.dispatchEvent(me);
				// This delay prevent X11 logic from debouncing the mouseup
				await yieldHelper(60)
				me = new MouseEvent('mouseup', { clientX: mouseX + clientRect.left, clientY: mouseY + clientRect.top, button: 0 });
				display.dispatchEvent(me);
				return null;
			}
			case "right_click":
			{
				var coords = tool.coordinate;
				var dc = get(displayConfig);
				var mouseX = coords[0] / dc.mouseMult;
				var mouseY = coords[1] / dc.mouseMult;
				var display = document.getElementById("display");
				var clientRect = display.getBoundingClientRect();
				var me = new MouseEvent('mousedown', { clientX: mouseX + clientRect.left, clientY: mouseY + clientRect.top, button: 2 });
				display.dispatchEvent(me);
				// This delay prevent X11 logic from debouncing the mouseup
				await yieldHelper(60)
				me = new MouseEvent('mouseup', { clientX: mouseX + clientRect.left, clientY: mouseY + clientRect.top, button: 2 });
				display.dispatchEvent(me);
				return null;
			}
			case "type":
			{
				var str = tool.text;
				return new Promise(async function(f, r)
				{
					var textArea = getKmsInputElement();
					for(var i=0;i<str.length;i++)
					{
						await kmsSendChar(textArea, str[i]);
					}
					f(null);
				});
			}
			case "key":
			{
				var textArea = getKmsInputElement();
				var key = tool.text;
				// Support arbitrary order of modifiers
				var isCtrl = false;
				var isAlt = false;
				var isShift = false;
				while(1)
				{
					if(key.startsWith("shift+"))
					{
						isShift = true;
						key = key.substr("shift+".length);
						var ke = new KeyboardEvent("keydown", {keyCode: 0x10});
						textArea.dispatchEvent(ke);
						await yieldHelper(0);
						continue;
					}
					else if(key.startsWith("ctrl+"))
					{
						isCtrl = true;
						key = key.substr("ctrl+".length);
						var ke = new KeyboardEvent("keydown", {keyCode: 0x11});
						textArea.dispatchEvent(ke);
						await yieldHelper(0);
						continue;
					}
					else if(key.startsWith("alt+"))
					{
						isAlt = true;
						key = key.substr("alt+".length);
						var ke = new KeyboardEvent("keydown", {keyCode: 0x12});
						textArea.dispatchEvent(ke);
						await yieldHelper(0);
						continue;
					}
					break;
				}
				var ret = null;
				// Dispatch single chars directly and parse the rest
				if(key.length == 1)
				{
					await kmsSendChar(textArea, key);
				}
				else
				{
					switch(tool.text)
					{
						case "Return":
							await kmsSendChar(textArea, "\n");
							break;
						case "Escape":
							var ke = new KeyboardEvent("keydown", {keyCode: 0x1b});
							textArea.dispatchEvent(ke);
							await yieldHelper(0);
							ke = new KeyboardEvent("keyup", {keyCode: 0x1b});
							textArea.dispatchEvent(ke);
							await yieldHelper(0);
							break;
						default:
							// TODO: Support more key combinations
							ret = new Error(`Error: Invalid key '${tool.text}'`);
					}
				}
				if(isShift)
				{
					var ke = new KeyboardEvent("keyup", {keyCode: 0x10});
					textArea.dispatchEvent(ke);
					await yieldHelper(0);
				}
				if(isCtrl)
				{
					var ke = new KeyboardEvent("keyup", {keyCode: 0x11});
					textArea.dispatchEvent(ke);
					await yieldHelper(0);
				}
				if(isAlt)
				{
					var ke = new KeyboardEvent("keyup", {keyCode: 0x12});
					textArea.dispatchEvent(ke);
					await yieldHelper(0);
				}
				return ret;
			}
			case "wait":
			{
				// Wait 2x what the machine expects to compensate for virtualization slowdown
				await yieldHelper(tool.duration * 2 * 1000);
				return null;
			}
			default:
			{
				break;
			}
		}
		return new Error("Error: Invalid action");
	}
	else
	{
		// We can get there due to model hallucinations
		return new Error("Error: Invalid tool syntax");
	}
}

function initialize()
{
	var savedApiKey = localStorage.getItem("anthropic-api-key");
	if(savedApiKey)
		setApiKey(savedApiKey);
}

export const apiState = writable("KEY_REQUIRED");
export const messageList = writable(messages);
export const currentMessage = writable("");
export const displayConfig = writable(null);
export const enableThinking = writable(false);

if(browser)
	initialize();


================================================
FILE: src/lib/global.css
================================================
@import url('https://fonts.googleapis.com/css2?family=Archivo:ital,wght@0,100..900;1,100..900&display=swap');

@tailwind base;
@tailwind utilities;

body
{
	font-family: Archivo, sans-serif;
	margin: 0;
	height: 100%;
	overflow: hidden;
	background: black;
}

html
{
	height: 100%;
}

@media (width <= 850px)
{
	html
	{
		font-size: calc(100vw / 55);
	}
}


================================================
FILE: src/lib/messages.js
================================================
const color = "\x1b[1;35m";
const underline = "\x1b[94;4m";
const normal = "\x1b[0m";
export const introMessage = [
  "+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~+",
  "|                                                                             |",
  "| WebVM is a virtual Linux environment running in the browser via WebAssembly.|",
  "|                                                                             |",
  "| WebVM is powered by the CheerpX virtualization engine, which enables safe,  |",
  "| sandboxed execution of x86 binaries, fully client-side.                     |",
  "|                                                                             |",
  "| CheerpX includes an x86-to-WebAssembly JIT compiler, a virtual block-based  |",
  "| file system, and a Linux syscall emulator.                                  |",
  "|                                                                             |",
  "| Try out the new Alpine / Xorg / i3 WebVM: " + underline + "https://webvm.io/alpine.html" + normal + "      |",
  "|                                                                             |",
  "| [News] BrowserPod 1.0: universal in-browser sandbox powered by Wasm:        |",
  "|                                                                             |",
  "| " + underline + "https://labs.leaningtech.com/blog/browserpod-10" + normal + "                             |",
  "|                                                                             |",
  "+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~+",
  "",
  "   Welcome to WebVM. If unsure, try these examples:",
  "",
  "     python3 examples/python3/fibonacci.py ",
  "     gcc -o helloworld examples/c/helloworld.c && ./helloworld",
  "     objdump -d ./helloworld | less -M",
  "     vim examples/c/helloworld.c",
  "     curl --max-time 15 parrot.live  # requires networking",
  "",
];
export const errorMessage = [
  color + "CheerpX could not start" + normal,
  "",
  "Check the DevTools console for more information",
  "",
  "CheerpX is expected to work with recent desktop versions of Chrome, Edge, Firefox and Safari",
  "",
  "Give it a try from a desktop version / another browser!",
  "",
  "CheerpX internal error message is:",
  "",
];
export const unexpectedErrorMessage = [
  color + "WebVM encountered an unexpected error" + normal,
  "",
  "Check the DevTools console for further information",
  "",
  "Please consider reporting a bug!",
  "",
  "CheerpX internal error message is:",
  "",
];


================================================
FILE: src/lib/network.js
================================================
import { writable } from 'svelte/store';
import { browser } from '$app/environment'

let authKey = undefined;
let controlUrl = undefined;
if(browser)
{
	let params = new URLSearchParams("?"+window.location.hash.substr(1));
	authKey = params.get("authKey") || undefined;
	controlUrl = params.get("controlUrl") || undefined;
}
let dashboardUrl = controlUrl ? null : "https://login.tailscale.com/admin/machines";
let resolveLogin = null;
let loginPromise = new Promise((f,r) => {
	resolveLogin = f;
});
let connectionState = writable("DISCONNECTED");
let exitNode = writable(false);

function loginUrlCb(url)
{
	connectionState.set("LOGINREADY");
	resolveLogin(url);
}

function stateUpdateCb(state)
{
	switch(state)
	{
		case 6 /*Running*/:
		{
			connectionState.set("CONNECTED");
			break;
		}
	}
}

function netmapUpdateCb(map)
{
	networkData.currentIp = map.self.addresses[0];
	var exitNodeFound = false;
	for(var i=0; i < map.peers.length;i++)
	{
		if(map.peers[i].exitNode)
		{
			exitNodeFound = true;
			break;
		}
	}
	if(exitNodeFound)
	{
		exitNode.set(true);
	}
}

export async function startLogin()
{
	connectionState.set("LOGINSTARTING");
	const url = await loginPromise;
	networkData.loginUrl = url;
	return url;
}

async function handleCopyIP(event)
{
	// To prevent the default contexmenu from showing up when right-clicking..
	event.preventDefault();
	// Copy the IP to the clipboard.
	try
	{
		await window.navigator.clipboard.writeText(networkData.currentIp)
		connectionState.set("IPCOPIED");
		setTimeout(() => {
			connectionState.set("CONNECTED");
		}, 2000);
	}
	catch(msg)
	{
		console.log("Copy ip to clipboard: Error: " + msg);
	}
}

export function updateButtonData(state, handleConnect) {
	switch(state) {
		case "DISCONNECTED":
			return {
				buttonText: "Connect to Tailscale",
				isClickable: true,
				clickHandler: handleConnect,
				clickUrl: null,
				buttonTooltip: null,
				rightClickHandler: null
			};
		case "DOWNLOADING":
			return {
				buttonText: "Loading IP stack...",
				isClickable: false,
				clickHandler: null,
				clickUrl: null,
				buttonTooltip: null,
				rightClickHandler: null
			};
		case "LOGINSTARTING":
			return {
				buttonText: "Starting Login...",
				isClickable: false,
				clickHandler: null,
				clickUrl: null,
				buttonTooltip: null,
				rightClickHandler: null
			};
		case "LOGINREADY":
			return {
				buttonText: "Login to Tailscale",
				isClickable: true,
				clickHandler: null,
				clickUrl: networkData.loginUrl,
				buttonTooltip: null,
				rightClickHandler: null
			};
		case "CONNECTED":
			return {
				buttonText: `IP: ${networkData.currentIp}`,
				isClickable: true,
				clickHandler: null,
				clickUrl: networkData.dashboardUrl,
				buttonTooltip: "Right-click to copy",
				rightClickHandler: handleCopyIP
			};
		case "IPCOPIED":
			return {
				buttonText: "Copied!",
				isClickable: false,
				clickHandler: null,
				clickUrl: null,
				buttonTooltip: null,
				rightClickHandler: null
			};
		default:
			return {
				buttonText: `Text for state: ${state}`,
				isClickable: false,
				clickHandler: null,
				clickUrl: null,
				buttonTooltip: null,
				rightClickHandler: null
			};
	}
}

export const networkInterface = { authKey: authKey, controlUrl: controlUrl, loginUrlCb: loginUrlCb, stateUpdateCb: stateUpdateCb, netmapUpdateCb: netmapUpdateCb };

export const networkData = { currentIp: null, connectionState: connectionState, exitNode: exitNode, loginUrl: null, dashboardUrl: dashboardUrl }


================================================
FILE: src/lib/plausible.js
================================================
// Some ad-blockers block the plausible script from loading. Check if `plausible`
// is defined before calling it.
export function tryPlausible(msg) {
	if (self.plausible)
		plausible(msg)
}


================================================
FILE: src/routes/+layout.server.js
================================================
import { parse } from 'node-html-parser';
import { read } from '$app/server';

var posts = [
	"https://labs.leaningtech.com/blog/webvm-claude",
	"https://labs.leaningtech.com/blog/cx-10",
	"https://labs.leaningtech.com/blog/webvm-20",
	"https://labs.leaningtech.com/blog/join-the-webvm-hackathon",
	"https://labs.leaningtech.com/blog/mini-webvm-your-linux-box-from-dockerfile-via-wasm",
	"https://labs.leaningtech.com/blog/webvm-virtual-machine-with-networking-via-tailscale",
	"https://labs.leaningtech.com/blog/webvm-server-less-x86-virtual-machines-in-the-browser",
];

async function getPostData(u)
{
	var ret = { title: null, image: null, url: u };
	var response = await fetch(u);
	var str = await response.text();
	var root = parse(str);
	var tags = root.getElementsByTagName("meta");
	for(var i=0;i<tags.length;i++)
	{
		var metaName = tags[i].getAttribute("property");
		var metaContent = tags[i].getAttribute("content");
		switch(metaName)
		{
			case "og:title":
				ret.title = metaContent;
				break;
			case "og:image":
				ret.image = metaContent;
				break;
		}
	}
	return ret;
}

export async function load()
{
	var ret = [];
	for(var i=0;i<posts.length;i++)
	{
		ret.push(await getPostData(posts[i]));
	}
	return { posts: ret };
}


================================================
FILE: src/routes/+page.js
================================================
export const prerender = true;


================================================
FILE: src/routes/+page.svelte
================================================
<script>
import WebVM from '$lib/WebVM.svelte';
import * as configObj from '/config_terminal';
import { tryPlausible } from '$lib/plausible.js';
function handleProcessCreated(processCount)
{
	// Log the first 5 processes, to get an idea of the level of interaction from the public
	if(processCount <= 5)
	{
		tryPlausible(`Process started: ${processCount}`);
	}
}
</script>

<WebVM configObj={configObj} processCallback={handleProcessCreated} cacheId="blocks_terminal">
	<p>Looking for a complete desktop experience? Try the new <a class="underline" href="/alpine.html" target="_blank">Alpine Linux</a> graphical WebVM</p>
</WebVM>


================================================
FILE: src/routes/alpine/+page.js
================================================
export const prerender = true;


================================================
FILE: src/routes/alpine/+page.svelte
================================================
<script>
import WebVM from '$lib/WebVM.svelte';
import * as configObj from '/config_public_alpine';
import { tryPlausible } from '$lib/plausible.js';
function handleProcessCreated(processCount)
{
	// Log only the first process, as a proxy for successful startup
	if(processCount == 1)
	{
		tryPlausible("Alpine init");
	}
}
</script>

<WebVM configObj={configObj} processCallback={handleProcessCreated} cacheId="blocks_alpine">
	<p>Looking for something different? Try the classic <a class="underline" href="/" target="_blank">Debian Linux</a> terminal-based WebVM</p>
</WebVM>


================================================
FILE: svelte.config.js
================================================
import adapter from '@sveltejs/adapter-static';
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';

/** @type {import('@sveltejs/kit').Config} */
const config = {
	kit: {
		adapter: adapter()
	},
	preprocess: vitePreprocess()
};

export default config;


================================================
FILE: tailwind.config.js
================================================
/** @type {import('tailwindcss').Config} */
export default {
  content: ['./src/**/*.{html,js,svelte,ts}'],
  theme: {
    extend: {},
  },
  plugins: [],
}



================================================
FILE: vite.config.js
================================================
import { sveltekit } from '@sveltejs/kit/vite';
import { defineConfig } from 'vite';
import { viteStaticCopy } from 'vite-plugin-static-copy';

export default defineConfig({
	resolve: {
		alias: {
			'/config_terminal': process.env.WEBVM_MODE == "github" ? 'config_github_terminal.js' : 'config_public_terminal.js',
			"@leaningtech/cheerpx": process.env.CX_URL ? process.env.CX_URL : "@leaningtech/cheerpx"
		}
	},
	build: {
		target: "es2022"
	},
	plugins: [
		sveltekit(),
		viteStaticCopy({
			targets: [
				{ src: 'tower.ico', dest: '' },
				{ src: 'scrollbar.css', dest: '' },
				{ src: 'serviceWorker.js', dest: '' },
				{ src: 'login.html', dest: '' },
				{ src: 'assets/', dest: '' },
				{ src: 'documents/', dest: '' }
			]
		})
	]
});


================================================
FILE: xterm/xterm-addon-fit.js
================================================
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.FitAddon=t():e.FitAddon=t()}(self,(()=>(()=>{"use strict";var e={};return(()=>{var t=e;Object.defineProperty(t,"__esModule",{value:!0}),t.FitAddon=void 0,t.FitAddon=class{activate(e){this._terminal=e}dispose(){}fit(){const e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;const t=this._terminal._core;this._terminal.rows===e.rows&&this._terminal.cols===e.cols||(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){if(!this._terminal)return;if(!this._terminal.element||!this._terminal.element.parentElement)return;const e=this._terminal._core,t=e._renderService.dimensions;if(0===t.css.cell.width||0===t.css.cell.height)return;const r=0===this._terminal.options.scrollback?0:e.viewport.scrollBarWidth,i=window.getComputedStyle(this._terminal.element.parentElement),o=parseInt(i.getPropertyValue("height")),s=Math.max(0,parseInt(i.getPropertyValue("width"))),n=window.getComputedStyle(this._terminal.element),l=o-(parseInt(n.getPropertyValue("padding-top"))+parseInt(n.getPropertyValue("padding-bottom"))),a=s-(parseInt(n.getPropertyValue("padding-right"))+parseInt(n.getPropertyValue("padding-left")))-r;return{cols:Math.max(2,Math.floor(a/t.css.cell.width)),rows:Math.max(1,Math.floor(l/t.css.cell.height))}}}})(),e})()));
//# sourceMappingURL=addon-fit.js.map


================================================
FILE: xterm/xterm-addon-web-links.js
================================================
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.WebLinksAddon=t():e.WebLinksAddon=t()}(self,(()=>(()=>{"use strict";var e={6:(e,t)=>{function n(e){try{const t=new URL(e),n=t.password&&t.username?`${t.protocol}//${t.username}:${t.password}@${t.host}`:t.username?`${t.protocol}//${t.username}@${t.host}`:`${t.protocol}//${t.host}`;return e.toLocaleLowerCase().startsWith(n.toLocaleLowerCase())}catch(e){return!1}}Object.defineProperty(t,"__esModule",{value:!0}),t.LinkComputer=t.WebLinkProvider=void 0,t.WebLinkProvider=class{constructor(e,t,n,o={}){this._terminal=e,this._regex=t,this._handler=n,this._options=o}provideLinks(e,t){const n=o.computeLink(e,this._regex,this._terminal,this._handler);t(this._addCallbacks(n))}_addCallbacks(e){return e.map((e=>(e.leave=this._options.leave,e.hover=(t,n)=>{if(this._options.hover){const{range:o}=e;this._options.hover(t,n,o)}},e)))}};class o{static computeLink(e,t,r,i){const s=new RegExp(t.source,(t.flags||"")+"g"),[a,c]=o._getWindowedLineStrings(e-1,r),l=a.join("");let d;const p=[];for(;d=s.exec(l);){const e=d[0];if(!n(e))continue;const[t,s]=o._mapStrIdx(r,c,0,d.index),[a,l]=o._mapStrIdx(r,t,s,e.length);if(-1===t||-1===s||-1===a||-1===l)continue;const h={start:{x:s+1,y:t+1},end:{x:l,y:a+1}};p.push({range:h,text:e,activate:i})}return p}static _getWindowedLineStrings(e,t){let n,o=e,r=e,i=0,s="";const a=[];if(n=t.buffer.active.getLine(e)){const e=n.translateToString(!0);if(n.isWrapped&&" "!==e[0]){for(i=0;(n=t.buffer.active.getLine(--o))&&i<2048&&(s=n.translateToString(!0),i+=s.length,a.push(s),n.isWrapped&&-1===s.indexOf(" ")););a.reverse()}for(a.push(e),i=0;(n=t.buffer.active.getLine(++r))&&n.isWrapped&&i<2048&&(s=n.translateToString(!0),i+=s.length,a.push(s),-1===s.indexOf(" ")););}return[a,o]}static _mapStrIdx(e,t,n,o){const r=e.buffer.active,i=r.getNullCell();let s=n;for(;o;){const e=r.getLine(t);if(!e)return[-1,-1];for(let n=s;n<e.length;++n){e.getCell(n,i);const s=i.getChars();if(i.getWidth()&&(o-=s.length||1,n===e.length-1&&""===s)){const e=r.getLine(t+1);e&&e.isWrapped&&(e.getCell(0,i),2===i.getWidth()&&(o+=1))}if(o<0)return[t,n]}t++,s=0}return[t,s]}}t.LinkComputer=o}},t={};function n(o){var r=t[o];if(void 0!==r)return r.exports;var i=t[o]={exports:{}};return e[o](i,i.exports,n),i.exports}var o={};return(()=>{var e=o;Object.defineProperty(e,"__esModule",{value:!0}),e.WebLinksAddon=void 0;const t=n(6),r=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function i(e,t){const n=window.open();if(n){try{n.opener=null}catch{}n.location.href=t}else console.warn("Opening link blocked as opener could not be cleared")}e.WebLinksAddon=class{constructor(e=i,t={}){this._handler=e,this._options=t}activate(e){this._terminal=e;const n=this._options,o=n.urlRegex||r;this._linkProvider=this._terminal.registerLinkProvider(new t.WebLinkProvider(this._terminal,o,this._handler,n))}dispose(){this._linkProvider?.dispose()}}})(),o})()));
//# sourceMappingURL=addon-web-links.js.map


================================================
FILE: xterm/xterm.css
================================================
/**
 * Copyright (c) 2014 The xterm.js authors. All rights reserved.
 * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
 * https://github.com/chjj/term.js
 * @license MIT
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 *
 * Originally forked from (with the author's permission):
 *   Fabrice Bellard's javascript vt100 for jslinux:
 *   http://bellard.org/jslinux/
 *   Copyright (c) 2011 Fabrice Bellard
 *   The original design remains. The terminal itself
 *   has been extended to include xterm CSI codes, among
 *   other features.
 */

/**
 *  Default styles for xterm.js
 */

.xterm {
    cursor: text;
    position: relative;
    user-select: none;
    -ms-user-select: none;
    -webkit-user-select: none;
}

.xterm.focus,
.xterm:focus {
    outline: none;
}

.xterm .xterm-helpers {
    position: absolute;
    top: 0;
    /**
     * The z-index of the helpers must be higher than the canvases in order for
     * IMEs to appear on top.
     */
    z-index: 5;
}

.xterm .xterm-helper-textarea {
    padding: 0;
    border: 0;
    margin: 0;
    /* Move textarea out of the screen to the far left, so that the cursor is not visible */
    position: absolute;
    opacity: 0;
    left: -9999em;
    top: 0;
    width: 0;
    height: 0;
    z-index: -5;
    /** Prevent wrapping so the IME appears against the textarea at the correct position */
    white-space: nowrap;
    overflow: hidden;
    resize: none;
}

.xterm .composition-view {
    /* TODO: Composition position got messed up somewhere */
    background: #000;
    color: #FFF;
    display: none;
    position: absolute;
    white-space: nowrap;
    z-index: 1;
}

.xterm .composition-view.active {
    display: block;
}

.xterm .xterm-viewport {
    /* On OS X this is required in order for the scroll bar to appear fully opaque */
    background-color: #000;
    overflow-y: scroll;
    cursor: default;
    position: absolute;
    right: 0;
    left: 0;
    top: 0;
    bottom: 0;
}

.xterm .xterm-screen {
    position: relative;
}

.xterm .xterm-screen canvas {
    position: absolute;
    left: 0;
    top: 0;
}

.xterm .xterm-scroll-area {
    visibility: hidden;
}

.xterm-char-measure-element {
    display: inline-block;
    visibility: hidden;
    position: absolute;
    top: 0;
    left: -9999em;
    line-height: normal;
}

.xterm.enable-mouse-events {
    /* When mouse events are enabled (eg. tmux), revert to the standard pointer cursor */
    cursor: default;
}

.xterm.xterm-cursor-pointer,
.xterm .xterm-cursor-pointer {
    cursor: pointer;
}

.xterm.column-select.focus {
    /* Column selection mode */
    cursor: crosshair;
}

.xterm .xterm-accessibility:not(.debug),
.xterm .xterm-message {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    right: 0;
    z-index: 10;
    color: transparent;
    pointer-events: none;
}

.xterm .xterm-accessibility-tree:not(.debug) *::selection {
  color: transparent;
}

.xterm .xterm-accessibility-tree {
  user-select: text;
  white-space: pre;
}

.xterm .live-region {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.xterm-dim {
    /* Dim should not apply to background, so the opacity of the foreground color is applied
     * explicitly in the generated class and reset to 1 here */
    opacity: 1 !important;
}

.xterm-underline-1 { text-decoration: underline; }
.xterm-underline-2 { text-decoration: double underline; }
.xterm-underline-3 { text-decoration: wavy underline; }
.xterm-underline-4 { text-decoration: dotted underline; }
.xterm-underline-5 { text-decoration: dashed underline; }

.xterm-overline {
    text-decoration: overline;
}

.xterm-overline.xterm-underline-1 { text-decoration: overline underline; }
.xterm-overline.xterm-underline-2 { text-decoration: overline double underline; }
.xterm-overline.xterm-underline-3 { text-decoration: overline wavy underline; }
.xterm-overline.xterm-underline-4 { text-decoration: overline dotted underline; }
.xterm-overline.xterm-underline-5 { text-decoration: overline dashed underline; }

.xterm-strikethrough {
    text-decoration: line-through;
}

.xterm-screen .xterm-decoration-container .xterm-decoration {
	z-index: 6;
	position: absolute;
}

.xterm-screen .xterm-decoration-container .xterm-decoration.xterm-decoration-top-layer {
	z-index: 7;
}

.xterm-decoration-overview-ruler {
    z-index: 8;
    position: absolute;
    top: 0;
    right: 0;
    pointer-events: none;
}

.xterm-decoration-top {
    z-index: 2;
    position: relative;
}


================================================
FILE: xterm/xterm.js
================================================
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var i=t();for(var s in i)("object"==typeof exports?exports:e)[s]=i[s]}}(globalThis,(()=>(()=>{"use strict";var e={4567:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.AccessibilityManager=void 0;const n=i(9042),o=i(9924),a=i(844),h=i(4725),c=i(2585),l=i(3656);let d=t.AccessibilityManager=class extends a.Disposable{constructor(e,t,i,s){super(),this._terminal=e,this._coreBrowserService=i,this._renderService=s,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let e=0;e<this._terminal.rows;e++)this._rowElements[e]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[e]);if(this._topBoundaryFocusListener=e=>this._handleBoundaryFocus(e,0),this._bottomBoundaryFocusListener=e=>this._handleBoundaryFocus(e,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new o.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize((e=>this._handleResize(e.rows)))),this.register(this._terminal.onRender((e=>this._refreshRows(e.start,e.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((e=>this._handleChar(e)))),this.register(this._terminal.onLineFeed((()=>this._handleChar("\n")))),this.register(this._terminal.onA11yTab((e=>this._handleTab(e)))),this.register(this._terminal.onKey((e=>this._handleKey(e.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,l.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,a.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(e){for(let t=0;t<e;t++)this._handleChar(" ")}_handleChar(e){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,"\n"===e&&(this._liveRegionLineCount++,21===this._liveRegionLineCount&&(this._liveRegion.textContent+=n.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(e){this._clearLiveRegion(),/\p{Control}/u.test(e)||this._charsToConsume.push(e)}_refreshRows(e,t){this._liveRegionDebouncer.refresh(e,t,this._terminal.rows)}_renderRows(e,t){const i=this._terminal.buffer,s=i.lines.length.toString();for(let r=e;r<=t;r++){const e=i.lines.get(i.ydisp+r),t=[],n=e?.translateToString(!0,void 0,void 0,t)||"",o=(i.ydisp+r+1).toString(),a=this._rowElements[r];a&&(0===n.length?(a.innerText=" ",this._rowColumns.set(a,[0,1])):(a.textContent=n,this._rowColumns.set(a,t)),a.setAttribute("aria-posinset",o),a.setAttribute("aria-setsize",s))}this._announceCharacters()}_announceCharacters(){0!==this._charsToAnnounce.length&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(e,t){const i=e.target,s=this._rowElements[0===t?1:this._rowElements.length-2];if(i.getAttribute("aria-posinset")===(0===t?"1":`${this._terminal.buffer.lines.length}`))return;if(e.relatedTarget!==s)return;let r,n;if(0===t?(r=i,n=this._rowElements.pop(),this._rowContainer.removeChild(n)):(r=this._rowElements.shift(),n=i,this._rowContainer.removeChild(r)),r.removeEventListener("focus",this._topBoundaryFocusListener),n.removeEventListener("focus",this._bottomBoundaryFocusListener),0===t){const e=this._createAccessibilityTreeNode();this._rowElements.unshift(e),this._rowContainer.insertAdjacentElement("afterbegin",e)}else{const e=this._createAccessibilityTreeNode();this._rowElements.push(e),this._rowContainer.appendChild(e)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(0===t?-1:1),this._rowElements[0===t?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}_handleSelectionChange(){if(0===this._rowElements.length)return;const e=document.getSelection();if(!e)return;if(e.isCollapsed)return void(this._rowContainer.contains(e.anchorNode)&&this._terminal.clearSelection());if(!e.anchorNode||!e.focusNode)return void console.error("anchorNode and/or focusNode are null");let t={node:e.anchorNode,offset:e.anchorOffset},i={node:e.focusNode,offset:e.focusOffset};if((t.node.compareDocumentPosition(i.node)&Node.DOCUMENT_POSITION_PRECEDING||t.node===i.node&&t.offset>i.offset)&&([t,i]=[i,t]),t.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(t={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(t.node))return;const s=this._rowElements.slice(-1)[0];if(i.node.compareDocumentPosition(s)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(i={node:s,offset:s.textContent?.length??0}),!this._rowContainer.contains(i.node))return;const r=({node:e,offset:t})=>{const i=e instanceof Text?e.parentNode:e;let s=parseInt(i?.getAttribute("aria-posinset"),10)-1;if(isNaN(s))return console.warn("row is invalid. Race condition?"),null;const r=this._rowColumns.get(i);if(!r)return console.warn("columns is null. Race condition?"),null;let n=t<r.length?r[t]:r.slice(-1)[0]+1;return n>=this._terminal.cols&&(++s,n=0),{row:s,column:n}},n=r(t),o=r(i);if(n&&o){if(n.row>o.row||n.row===o.row&&n.column>=o.column)throw new Error("invalid range");this._terminal.select(n.column,n.row,(o.row-n.row)*this._terminal.cols-n.column+o.column)}}_handleResize(e){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let e=this._rowContainer.children.length;e<this._terminal.rows;e++)this._rowElements[e]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[e]);for(;this._rowElements.length>e;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const e=this._coreBrowserService.mainDocument.createElement("div");return e.setAttribute("role","listitem"),e.tabIndex=-1,this._refreshRowDimensions(e),e}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let e=0;e<this._terminal.rows;e++)this._refreshRowDimensions(this._rowElements[e])}}_refreshRowDimensions(e){e.style.height=`${this._renderService.dimensions.css.cell.height}px`}};t.AccessibilityManager=d=s([r(1,c.IInstantiationService),r(2,h.ICoreBrowserService),r(3,h.IRenderService)],d)},3614:(e,t)=>{function i(e){return e.replace(/\r?\n/g,"\r")}function s(e,t){return t?"[200~"+e+"[201~":e}function r(e,t,r,n){e=s(e=i(e),r.decPrivateModes.bracketedPasteMode&&!0!==n.rawOptions.ignoreBracketedPasteMode),r.triggerDataEvent(e,!0),t.value=""}function n(e,t,i){const s=i.getBoundingClientRect(),r=e.clientX-s.left-10,n=e.clientY-s.top-10;t.style.width="20px",t.style.height="20px",t.style.left=`${r}px`,t.style.top=`${n}px`,t.style.zIndex="1000",t.focus()}Object.defineProperty(t,"__esModule",{value:!0}),t.rightClickHandler=t.moveTextAreaUnderMouseCursor=t.paste=t.handlePasteEvent=t.copyHandler=t.bracketTextForPaste=t.prepareTextForTerminal=void 0,t.prepareTextForTerminal=i,t.bracketTextForPaste=s,t.copyHandler=function(e,t){e.clipboardData&&e.clipboardData.setData("text/plain",t.selectionText),e.preventDefault()},t.handlePasteEvent=function(e,t,i,s){e.stopPropagation(),e.clipboardData&&r(e.clipboardData.getData("text/plain"),t,i,s)},t.paste=r,t.moveTextAreaUnderMouseCursor=n,t.rightClickHandler=function(e,t,i,s,r){n(e,t,i),r&&s.rightClickSelect(e),t.value=s.selectionText,t.select()}},7239:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ColorContrastCache=void 0;const s=i(1505);t.ColorContrastCache=class{constructor(){this._color=new s.TwoKeyMap,this._css=new s.TwoKeyMap}setCss(e,t,i){this._css.set(e,t,i)}getCss(e,t){return this._css.get(e,t)}setColor(e,t,i){this._color.set(e,t,i)}getColor(e,t){return this._color.get(e,t)}clear(){this._color.clear(),this._css.clear()}}},3656:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.addDisposableDomListener=void 0,t.addDisposableDomListener=function(e,t,i,s){e.addEventListener(t,i,s);let r=!1;return{dispose:()=>{r||(r=!0,e.removeEventListener(t,i,s))}}}},3551:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.Linkifier=void 0;const n=i(3656),o=i(8460),a=i(844),h=i(2585),c=i(4725);let l=t.Linkifier=class extends a.Disposable{get currentLink(){return this._currentLink}constructor(e,t,i,s,r){super(),this._element=e,this._mouseService=t,this._renderService=i,this._bufferService=s,this._linkProviderService=r,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new o.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new o.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,a.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,a.toDisposable)((()=>{this._lastMouseEvent=void 0,this._activeProviderReplies?.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,n.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,n.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,n.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,n.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(e){this._lastMouseEvent=e;const t=this._positionFromMouseEvent(e,this._element,this._mouseService);if(!t)return;this._isMouseOut=!1;const i=e.composedPath();for(let e=0;e<i.length;e++){const t=i[e];if(t.classList.contains("xterm"))break;if(t.classList.contains("xterm-hover"))return}this._lastBufferCell&&t.x===this._lastBufferCell.x&&t.y===this._lastBufferCell.y||(this._handleHover(t),this._lastBufferCell=t)}_handleHover(e){if(this._activeLine!==e.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(e,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,e)||(this._clearCurrentLink(),this._askForLink(e,!0))}_askForLink(e,t){this._activeProviderReplies&&t||(this._activeProviderReplies?.forEach((e=>{e?.forEach((e=>{e.link.dispose&&e.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=e.y);let i=!1;for(const[s,r]of this._linkProviderService.linkProviders.entries())if(t){const t=this._activeProviderReplies?.get(s);t&&(i=this._checkLinkProviderResult(s,e,i))}else r.provideLinks(e.y,(t=>{if(this._isMouseOut)return;const r=t?.map((e=>({link:e})));this._activeProviderReplies?.set(s,r),i=this._checkLinkProviderResult(s,e,i),this._activeProviderReplies?.size===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(e.y,this._activeProviderReplies)}))}_removeIntersectingLinks(e,t){const i=new Set;for(let s=0;s<t.size;s++){const r=t.get(s);if(r)for(let t=0;t<r.length;t++){const s=r[t],n=s.link.range.start.y<e?0:s.link.range.start.x,o=s.link.range.end.y>e?this._bufferService.cols:s.link.range.end.x;for(let e=n;e<=o;e++){if(i.has(e)){r.splice(t--,1);break}i.add(e)}}}}_checkLinkProviderResult(e,t,i){if(!this._activeProviderReplies)return i;const s=this._activeProviderReplies.get(e);let r=!1;for(let t=0;t<e;t++)this._activeProviderReplies.has(t)&&!this._activeProviderReplies.get(t)||(r=!0);if(!r&&s){const e=s.find((e=>this._linkAtPosition(e.link,t)));e&&(i=!0,this._handleNewLink(e))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!i)for(let e=0;e<this._activeProviderReplies.size;e++){const s=this._activeProviderReplies.get(e)?.find((e=>this._linkAtPosition(e.link,t)));if(s){i=!0,this._handleNewLink(s);break}}return i}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(e){if(!this._currentLink)return;const t=this._positionFromMouseEvent(e,this._element,this._mouseService);t&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,t)&&this._currentLink.link.activate(e,this._currentLink.link.text)}_clearCurrentLink(e,t){this._currentLink&&this._lastMouseEvent&&(!e||!t||this._currentLink.link.range.start.y>=e&&this._currentLink.link.range.end.y<=t)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,a.disposeArray)(this._linkCacheDisposables))}_handleNewLink(e){if(!this._lastMouseEvent)return;const t=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);t&&this._linkAtPosition(e.link,t)&&(this._currentLink=e,this._currentLink.state={decorations:{underline:void 0===e.link.decorations||e.link.decorations.underline,pointerCursor:void 0===e.link.decorations||e.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,e.link,this._lastMouseEvent),e.link.decorations={},Object.defineProperties(e.link.decorations,{pointerCursor:{get:()=>this._currentLink?.state?.decorations.pointerCursor,set:e=>{this._currentLink?.state&&this._currentLink.state.decorations.pointerCursor!==e&&(this._currentLink.state.decorations.pointerCursor=e,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",e))}},underline:{get:()=>this._currentLink?.state?.decorations.underline,set:t=>{this._currentLink?.state&&this._currentLink?.state?.decorations.underline!==t&&(this._currentLink.state.decorations.underline=t,this._currentLink.state.isHovered&&this._fireUnderlineEvent(e.link,t))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((e=>{if(!this._currentLink)return;const t=0===e.start?0:e.start+1+this._bufferService.buffer.ydisp,i=this._bufferService.buffer.ydisp+1+e.end;if(this._currentLink.link.range.start.y>=t&&this._currentLink.link.range.end.y<=i&&(this._clearCurrentLink(t,i),this._lastMouseEvent)){const e=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);e&&this._askForLink(e,!1)}}))))}_linkHover(e,t,i){this._currentLink?.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!0),this._currentLink.state.decorations.pointerCursor&&e.classList.add("xterm-cursor-pointer")),t.hover&&t.hover(i,t.text)}_fireUnderlineEvent(e,t){const i=e.range,s=this._bufferService.buffer.ydisp,r=this._createLinkUnderlineEvent(i.start.x-1,i.start.y-s-1,i.end.x,i.end.y-s-1,void 0);(t?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(r)}_linkLeave(e,t,i){this._currentLink?.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!1),this._currentLink.state.decorations.pointerCursor&&e.classList.remove("xterm-cursor-pointer")),t.leave&&t.leave(i,t.text)}_linkAtPosition(e,t){const i=e.range.start.y*this._bufferService.cols+e.range.start.x,s=e.range.end.y*this._bufferService.cols+e.range.end.x,r=t.y*this._bufferService.cols+t.x;return i<=r&&r<=s}_positionFromMouseEvent(e,t,i){const s=i.getCoords(e,t,this._bufferService.cols,this._bufferService.rows);if(s)return{x:s[0],y:s[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(e,t,i,s,r){return{x1:e,y1:t,x2:i,y2:s,cols:this._bufferService.cols,fg:r}}};t.Linkifier=l=s([r(1,c.IMouseService),r(2,c.IRenderService),r(3,h.IBufferService),r(4,c.ILinkProviderService)],l)},9042:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.tooMuchOutput=t.promptLabel=void 0,t.promptLabel="Terminal input",t.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.OscLinkProvider=void 0;const n=i(511),o=i(2585);let a=t.OscLinkProvider=class{constructor(e,t,i){this._bufferService=e,this._optionsService=t,this._oscLinkService=i}provideLinks(e,t){const i=this._bufferService.buffer.lines.get(e-1);if(!i)return void t(void 0);const s=[],r=this._optionsService.rawOptions.linkHandler,o=new n.CellData,a=i.getTrimmedLength();let c=-1,l=-1,d=!1;for(let t=0;t<a;t++)if(-1!==l||i.hasContent(t)){if(i.loadCell(t,o),o.hasExtendedAttrs()&&o.extended.urlId){if(-1===l){l=t,c=o.extended.urlId;continue}d=o.extended.urlId!==c}else-1!==l&&(d=!0);if(d||-1!==l&&t===a-1){const i=this._oscLinkService.getLinkData(c)?.uri;if(i){const n={start:{x:l+1,y:e},end:{x:t+(d||t!==a-1?0:1),y:e}};let o=!1;if(!r?.allowNonHttpProtocols)try{const e=new URL(i);["http:","https:"].includes(e.protocol)||(o=!0)}catch(e){o=!0}o||s.push({text:i,range:n,activate:(e,t)=>r?r.activate(e,t,n):h(0,t),hover:(e,t)=>r?.hover?.(e,t,n),leave:(e,t)=>r?.leave?.(e,t,n)})}d=!1,o.hasExtendedAttrs()&&o.extended.urlId?(l=t,c=o.extended.urlId):(l=-1,c=-1)}}t(s)}};function h(e,t){if(confirm(`Do you want to navigate to ${t}?\n\nWARNING: This link could potentially be dangerous`)){const e=window.open();if(e){try{e.opener=null}catch{}e.location.href=t}else console.warn("Opening link blocked as opener could not be cleared")}}t.OscLinkProvider=a=s([r(0,o.IBufferService),r(1,o.IOptionsService),r(2,o.IOscLinkService)],a)},6193:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.RenderDebouncer=void 0,t.RenderDebouncer=class{constructor(e,t){this._renderCallback=e,this._coreBrowserService=t,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(e){return this._refreshCallbacks.push(e),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(e,t,i){this._rowCount=i,e=void 0!==e?e:0,t=void 0!==t?t:this._rowCount-1,this._rowStart=void 0!==this._rowStart?Math.min(this._rowStart,e):e,this._rowEnd=void 0!==this._rowEnd?Math.max(this._rowEnd,t):t,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._animationFrame=void 0,void 0===this._rowStart||void 0===this._rowEnd||void 0===this._rowCount)return void this._runRefreshCallbacks();const e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const e of this._refreshCallbacks)e(0);this._refreshCallbacks=[]}}},3236:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Terminal=void 0;const s=i(3614),r=i(3656),n=i(3551),o=i(9042),a=i(3730),h=i(1680),c=i(3107),l=i(5744),d=i(2950),_=i(1296),u=i(428),f=i(4269),v=i(5114),p=i(8934),g=i(3230),m=i(9312),S=i(4725),C=i(6731),b=i(8055),w=i(8969),y=i(8460),E=i(844),k=i(6114),L=i(8437),D=i(2584),R=i(7399),x=i(5941),A=i(9074),B=i(2585),T=i(5435),M=i(4567),O=i(779);class P extends w.CoreTerminal{get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}constructor(e={}){super(e),this.browser=k,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new E.MutableDisposable),this._onCursorMove=this.register(new y.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new y.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new y.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new y.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new y.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new y.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new y.EventEmitter),this._onBlur=this.register(new y.EventEmitter),this._onA11yCharEmitter=this.register(new y.EventEmitter),this._onA11yTabEmitter=this.register(new y.EventEmitter),this._onWillOpen=this.register(new y.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(A.DecorationService),this._instantiationService.setService(B.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(O.LinkProviderService),this._instantiationService.setService(S.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(a.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((e,t)=>this.refresh(e,t)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((e=>this._reportWindowsOptions(e)))),this.register(this._inputHandler.onColor((e=>this._handleColorEvent(e)))),this.register((0,y.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,y.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,y.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,y.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((e=>this._afterResize(e.cols,e.rows)))),this.register((0,E.toDisposable)((()=>{this._customKeyEventHandler=void 0,this.element?.parentNode?.removeChild(this.element)})))}_handleColorEvent(e){if(this._themeService)for(const t of e){let e,i="";switch(t.index){case 256:e="foreground",i="10";break;case 257:e="background",i="11";break;case 258:e="cursor",i="12";break;default:e="ansi",i="4;"+t.index}switch(t.type){case 0:const s=b.color.toColorRGB("ansi"===e?this._themeService.colors.ansi[t.index]:this._themeService.colors[e]);this.coreService.triggerDataEvent(`${D.C0.ESC}]${i};${(0,x.toRgbString)(s)}${D.C1_ESCAPED.ST}`);break;case 1:if("ansi"===e)this._themeService.modifyColors((e=>e.ansi[t.index]=b.channels.toColor(...t.color)));else{const i=e;this._themeService.modifyColors((e=>e[i]=b.channels.toColor(...t.color)))}break;case 2:this._themeService.restoreColor(t.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(e){e?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(M.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(e){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(D.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){return this.textarea?.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(D.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;const e=this.buffer.ybase+this.buffer.y,t=this.buffer.lines.get(e);if(!t)return;const i=Math.min(this.buffer.x,this.cols-1),s=this._renderService.dimensions.css.cell.height,r=t.getWidth(i),n=this._renderService.dimensions.css.cell.width*r,o=this.buffer.y*this._renderService.dimensions.css.cell.height,a=i*this._renderService.dimensions.css.cell.width;this.textarea.style.left=a+"px",this.textarea.style.top=o+"px",this.textarea.style.width=n+"px",this.textarea.style.height=s+"px",this.textarea.style.lineHeight=s+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,r.addDisposableDomListener)(this.element,"copy",(e=>{this.hasSelection()&&(0,s.copyHandler)(e,this._selectionService)})));const e=e=>(0,s.handlePasteEvent)(e,this.textarea,this.coreService,this.optionsService);this.register((0,r.addDisposableDomListener)(this.textarea,"paste",e)),this.register((0,r.addDisposableDomListener)(this.element,"paste",e)),k.isFirefox?this.register((0,r.addDisposableDomListener)(this.element,"mousedown",(e=>{2===e.button&&(0,s.rightClickHandler)(e,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,r.addDisposableDomListener)(this.element,"contextmenu",(e=>{(0,s.rightClickHandler)(e,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),k.isLinux&&this.register((0,r.addDisposableDomListener)(this.element,"auxclick",(e=>{1===e.button&&(0,s.moveTextAreaUnderMouseCursor)(e,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,r.addDisposableDomListener)(this.textarea,"keyup",(e=>this._keyUp(e)),!0)),this.register((0,r.addDisposableDomListener)(this.textarea,"keydown",(e=>this._keyDown(e)),!0)),this.register((0,r.addDisposableDomListener)(this.textarea,"keypress",(e=>this._keyPress(e)),!0)),this.register((0,r.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,r.addDisposableDomListener)(this.textarea,"compositionupdate",(e=>this._compositionHelper.compositionupdate(e)))),this.register((0,r.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,r.addDisposableDomListener)(this.textarea,"input",(e=>this._inputEvent(e)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(e){if(!e)throw new Error("Terminal requires a parent element.");if(e.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this.element?.ownerDocument.defaultView&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=e.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),e.appendChild(this.element);const t=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),t.appendChild(this._viewportElement),this._viewportScrollArea=this._document.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this.register((0,r.addDisposableDomListener)(this.screenElement,"mousemove",(e=>this.updateCursorStyle(e)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),t.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",o.promptLabel),k.isChromeOS||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._coreBrowserService=this.register(this._instantiationService.createInstance(v.CoreBrowserService,this.textarea,e.ownerDocument.defaultView??window,this._document??"undefined"!=typeof window?window.document:null)),this._instantiationService.setService(S.ICoreBrowserService,this._coreBrowserService),this.register((0,r.addDisposableDomListener)(this.textarea,"focus",(e=>this._handleTextAreaFocus(e)))),this.register((0,r.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(u.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(S.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(C.ThemeService),this._instantiationService.setService(S.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(f.CharacterJoinerService),this._instantiationService.setService(S.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(g.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(S.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((e=>this._onRender.fire(e)))),this.onResize((e=>this._renderService.resize(e.cols,e.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(d.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(p.MouseService),this._instantiationService.setService(S.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(n.Linkifier,this.screenElement)),this.element.appendChild(t);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(h.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((e=>this.scrollLines(e.amount,e.suppressScrollEvent,1))),this.register(this._inputHandler.onRequestSyncScrollBar((()=>this.viewport.syncScrollArea()))),this.register(this.viewport),this.register(this.onCursorMove((()=>{this._renderService.handleCursorMove(),this._syncTextArea()}))),this.register(this.onResize((()=>this._renderService.handleResize(this.cols,this.rows)))),this.register(this.onBlur((()=>this._renderService.handleBlur()))),this.register(this.onFocus((()=>this._renderService.handleFocus()))),this.register(this._renderService.onDimensionsChange((()=>this.viewport.syncScrollArea()))),this._selectionService=this.register(this._instantiationService.createInstance(m.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(S.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((e=>this.scrollLines(e.amount,e.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((e=>this._renderService.handleSelectionChanged(e.start,e.end,e.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((e=>{this.textarea.value=e,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((e=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,r.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(c.BufferDecorationRenderer,this.screenElement)),this.register((0,r.addDisposableDomListener)(this.element,"mousedown",(e=>this._selectionService.handleMouseDown(e)))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(M.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(e=>this._handleScreenReaderModeOptionChange(e)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(l.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(e=>{!this._overviewRulerRenderer&&e&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(l.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(_.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const e=this,t=this.element;function i(t){const i=e._mouseService.getMouseReportCoords(t,e.screenElement);if(!i)return!1;let s,r;switch(t.overrideType||t.type){case"mousemove":r=32,void 0===t.buttons?(s=3,void 0!==t.button&&(s=t.button<3?t.button:3)):s=1&t.buttons?0:4&t.buttons?1:2&t.buttons?2:3;break;case"mouseup":r=0,s=t.button<3?t.button:3;break;case"mousedown":r=1,s=t.button<3?t.button:3;break;case"wheel":if(e._customWheelEventHandler&&!1===e._customWheelEventHandler(t))return!1;if(0===e.viewport.getLinesScrolled(t))return!1;r=t.deltaY<0?0:1,s=4;break;default:return!1}return!(void 0===r||void 0===s||s>4)&&e.coreMouseService.triggerMouseEvent({col:i.col,row:i.row,x:i.x,y:i.y,button:s,action:r,ctrl:t.ctrlKey,alt:t.altKey,shift:t.shiftKey})}const s={mouseup:null,wheel:null,mousedrag:null,mousemove:null},n={mouseup:e=>(i(e),e.buttons||(this._document.removeEventListener("mouseup",s.mouseup),s.mousedrag&&this._document.removeEventListener("mousemove",s.mousedrag)),this.cancel(e)),wheel:e=>(i(e),this.cancel(e,!0)),mousedrag:e=>{e.buttons&&i(e)},mousemove:e=>{e.buttons||i(e)}};this.register(this.coreMouseService.onProtocolChange((e=>{e?("debug"===this.optionsService.rawOptions.logLevel&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(e)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),8&e?s.mousemove||(t.addEventListener("mousemove",n.mousemove),s.mousemove=n.mousemove):(t.removeEventListener("mousemove",s.mousemove),s.mousemove=null),16&e?s.wheel||(t.addEventListener("wheel",n.wheel,{passive:!1}),s.wheel=n.wheel):(t.removeEventListener("wheel",s.wheel),s.wheel=null),2&e?s.mouseup||(s.mouseup=n.mouseup):(this._document.removeEventListener("mouseup",s.mouseup),s.mouseup=null),4&e?s.mousedrag||(s.mousedrag=n.mousedrag):(this._document.removeEventListener("mousemove",s.mousedrag),s.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,r.addDisposableDomListener)(t,"mousedown",(e=>{if(e.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(e))return i(e),s.mouseup&&this._document.addEventListener("mouseup",s.mouseup),s.mousedrag&&this._document.addEventListener("mousemove",s.mousedrag),this.cancel(e)}))),this.register((0,r.addDisposableDomListener)(t,"wheel",(e=>{if(!s.wheel){if(this._customWheelEventHandler&&!1===this._customWheelEventHandler(e))return!1;if(!this.buffer.hasScrollback){const t=this.viewport.getLinesScrolled(e);if(0===t)return;const i=D.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(e.deltaY<0?"A":"B");let s="";for(let e=0;e<Math.abs(t);e++)s+=i;return this.coreService.triggerDataEvent(s,!0),this.cancel(e,!0)}return this.viewport.handleWheel(e)?this.cancel(e):void 0}}),{passive:!1})),this.register((0,r.addDisposableDomListener)(t,"touchstart",(e=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(e),this.cancel(e)}),{passive:!0})),this.register((0,r.addDisposableDomListener)(t,"touchmove",(e=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(e)?void 0:this.cancel(e)}),{passive:!1}))}refresh(e,t){this._renderService?.refreshRows(e,t)}updateCursorStyle(e){this._selectionService?.shouldColumnSelect(e)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(e,t,i=0){1===i?(super.scrollLines(e,t,i),this.refresh(0,this.rows-1)):this.viewport?.scrollLines(e)}paste(e){(0,s.paste)(e,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(e){this._customKeyEventHandler=e}attachCustomWheelEventHandler(e){this._customWheelEventHandler=e}registerLinkProvider(e){return this._linkProviderService.registerLinkProvider(e)}registerCharacterJoiner(e){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const t=this._characterJoinerService.register(e);return this.refresh(0,this.rows-1),t}deregisterCharacterJoiner(e){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(e)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(e){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+e)}registerDecoration(e){return this._decorationService.registerDecoration(e)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(e,t,i){this._selectionService.setSelection(e,t,i)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(this._selectionService&&this._selectionService.hasSelection)return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){this._selectionService?.clearSelection()}selectAll(){this._selectionService?.selectAll()}selectLines(e,t){this._selectionService?.selectLines(e,t)}_keyDown(e){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&!1===this._customKeyEventHandler(e))return!1;const t=this.browser.isMac&&this.options.macOptionIsMeta&&e.altKey;if(!t&&!this._compositionHelper.keydown(e))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;t||"Dead"!==e.key&&"AltGraph"!==e.key||(this._unprocessedDeadKey=!0);const i=(0,R.evaluateKeyboardEvent)(e,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(e),3===i.type||2===i.type){const t=this.rows-1;return this.scrollLines(2===i.type?-t:t),this.cancel(e,!0)}return 1===i.type&&this.selectAll(),!!this._isThirdLevelShift(this.browser,e)||(i.cancel&&this.cancel(e,!0),!i.key||!!(e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&1===e.key.length&&e.key.charCodeAt(0)>=65&&e.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(i.key!==D.C0.ETX&&i.key!==D.C0.CR||(this.textarea.value=""),this._onKey.fire({key:i.key,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(i.key,!0),!this.optionsService.rawOptions.screenReaderMode||e.altKey||e.ctrlKey?this.cancel(e,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(e,t){const i=e.isMac&&!this.options.macOptionIsMeta&&t.altKey&&!t.ctrlKey&&!t.metaKey||e.isWindows&&t.altKey&&t.ctrlKey&&!t.metaKey||e.isWindows&&t.getModifierState("AltGraph");return"keypress"===t.type?i:i&&(!t.keyCode||t.keyCode>47)}_keyUp(e){this._keyDownSeen=!1,this._customKeyEventHandler&&!1===this._customKeyEventHandler(e)||(function(e){return 16===e.keyCode||17===e.keyCode||18===e.keyCode}(e)||this.focus(),this.updateCursorStyle(e),this._keyPressHandled=!1)}_keyPress(e){let t;if(this._keyPressHandled=!1,this._keyDownHandled)return!1;if(this._customKeyEventHandler&&!1===this._customKeyEventHandler(e))return!1;if(this.cancel(e),e.charCode)t=e.charCode;else if(null===e.which||void 0===e.which)t=e.keyCode;else{if(0===e.which||0===e.charCode)return!1;t=e.which}return!(!t||(e.altKey||e.ctrlKey||e.metaKey)&&!this._isThirdLevelShift(this.browser,e)||(t=String.fromCharCode(t),this._onKey.fire({key:t,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(t,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(e){if(e.data&&"insertText"===e.inputType&&(!e.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const t=e.data;return this.coreService.triggerDataEvent(t,!0),this.cancel(e),!0}return!1}resize(e,t){e!==this.cols||t!==this.rows?super.resize(e,t):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(e,t){this._charSizeService?.measure(),this.viewport?.syncScrollArea(!0)}clear(){if(0!==this.buffer.ybase||0!==this.buffer.y){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let e=1;e<this.rows;e++)this.buffer.lines.push(this.buffer.getBlankLine(L.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),this.viewport?.reset(),this.refresh(0,this.rows-1)}}reset(){this.options.rows=this.rows,this.options.cols=this.cols;const e=this._customKeyEventHandler;this._setup(),super.reset(),this._selectionService?.reset(),this._decorationService.reset(),this.viewport?.reset(),this._customKeyEventHandler=e,this.refresh(0,this.rows-1)}clearTextureAtlas(){this._renderService?.clearTextureAtlas()}_reportFocus(){this.element?.classList.contains("focus")?this.coreService.triggerDataEvent(D.C0.ESC+"[I"):this.coreService.triggerDataEvent(D.C0.ESC+"[O")}_reportWindowsOptions(e){if(this._renderService)switch(e){case T.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const e=this._renderService.dimensions.css.canvas.width.toFixed(0),t=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${D.C0.ESC}[4;${t};${e}t`);break;case T.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const i=this._renderService.dimensions.css.cell.width.toFixed(0),s=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${D.C0.ESC}[6;${s};${i}t`)}}cancel(e,t){if(this.options.cancelEvents||t)return e.preventDefault(),e.stopPropagation(),!1}}t.Terminal=P},9924:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TimeBasedDebouncer=void 0,t.TimeBasedDebouncer=class{constructor(e,t=1e3){this._renderCallback=e,this._debounceThresholdMS=t,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(e,t,i){this._rowCount=i,e=void 0!==e?e:0,t=void 0!==t?t:this._rowCount-1,this._rowStart=void 0!==this._rowStart?Math.min(this._rowStart,e):e,this._rowEnd=void 0!==this._rowEnd?Math.max(this._rowEnd,t):t;const s=Date.now();if(s-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=s,this._innerRefresh();else if(!this._additionalRefreshRequested){const e=s-this._lastRefreshMs,t=this._debounceThresholdMS-e;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),t)}}_innerRefresh(){if(void 0===this._rowStart||void 0===this._rowEnd||void 0===this._rowCount)return;const e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t)}}},1680:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.Viewport=void 0;const n=i(3656),o=i(4725),a=i(8460),h=i(844),c=i(2585);let l=t.Viewport=class extends h.Disposable{constructor(e,t,i,s,r,o,h,c){super(),this._viewportElement=e,this._scrollArea=t,this._bufferService=i,this._optionsService=s,this._charSizeService=r,this._renderService=o,this._coreBrowserService=h,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new a.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,n.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((e=>this._activeBuffer=e.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((e=>this._renderDimensions=e))),this._handleThemeChange(c.colors),this.register(c.onChangeColors((e=>this._handleThemeChange(e)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(e){this._viewportElement.style.backgroundColor=e.background.css}reset(){this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._coreBrowserService.window.requestAnimationFrame((()=>this.syncScrollArea()))}_refresh(e){if(e)return this._innerRefresh(),void(null!==this._refreshAnimationFrame&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));null===this._refreshAnimationFrame&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderDimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderDimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const e=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==e&&(this._lastRecordedBufferHeight=e,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const e=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==e&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=e),this._refreshAnimationFrame=null}syncScrollArea(e=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(e);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(e)}_handleScroll(e){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});const t=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:t,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||-1===this._smoothScrollState.origin||-1===this._smoothScrollState.target)return;const e=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(e*(this._smoothScrollState.target-this._smoothScrollState.origin)),e<1?this._coreBrowserService.window.requestAnimationFrame((()=>this._smoothScroll())):this._clearSmoothScrollState()}_smoothScrollPercent(){return this._optionsService.rawOptions.smoothScrollDuration&&this._smoothScrollState.startTime?Math.max(Math.min((Date.now()-this._smoothScrollState.startTime)/this._optionsService.rawOptions.smoothScrollDuration,1),0):1}_clearSmoothScrollState(){this._smoothScrollState.startTime=0,this._smoothScrollState.origin=-1,this._smoothScrollState.target=-1}_bubbleScroll(e,t){const i=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(t<0&&0!==this._viewportElement.scrollTop||t>0&&i<this._lastRecordedBufferHeight)||(e.cancelable&&e.preventDefault(),!1)}handleWheel(e){const t=this._getPixelsScrolled(e);return 0!==t&&(this._optionsService.rawOptions.smoothScrollDuration?(this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,-1===this._smoothScrollState.target?this._smoothScrollState.target=this._viewportElement.scrollTop+t:this._smoothScrollState.target+=t,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=t,this._bubbleScroll(e,t))}scrollLines(e){if(0!==e)if(this._optionsService.rawOptions.smoothScrollDuration){const t=e*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+t,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:e,suppressScrollEvent:!1})}_getPixelsScrolled(e){if(0===e.deltaY||e.shiftKey)return 0;let t=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_LINE?t*=this._currentRowHeight:e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(t*=this._currentRowHeight*this._bufferService.rows),t}getBufferElements(e,t){let i,s="";const r=[],n=t??this._bufferService.buffer.lines.length,o=this._bufferService.buffer.lines;for(let t=e;t<n;t++){const e=o.get(t);if(!e)continue;const n=o.get(t+1)?.isWrapped;if(s+=e.translateToString(!n),!n||t===o.length-1){const e=document.createElement("div");e.textContent=s,r.push(e),s.length>0&&(i=e),s=""}}return{bufferElements:r,cursorElement:i}}getLinesScrolled(e){if(0===e.deltaY||e.shiftKey)return 0;let t=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(t/=this._currentRowHeight+0,this._wheelPartialScroll+=t,t=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(t*=this._bufferService.rows),t}_applyScrollModifier(e,t){const i=this._optionsService.rawOptions.fastScrollModifier;return"alt"===i&&t.altKey||"ctrl"===i&&t.ctrlKey||"shift"===i&&t.shiftKey?e*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:e*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(e){this._lastTouchY=e.touches[0].pageY}handleTouchMove(e){const t=this._lastTouchY-e.touches[0].pageY;return this._lastTouchY=e.touches[0].pageY,0!==t&&(this._viewportElement.scrollTop+=t,this._bubbleScroll(e,t))}};t.Viewport=l=s([r(2,c.IBufferService),r(3,c.IOptionsService),r(4,o.ICharSizeService),r(5,o.IRenderService),r(6,o.ICoreBrowserService),r(7,o.IThemeService)],l)},3107:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.BufferDecorationRenderer=void 0;const n=i(4725),o=i(844),a=i(2585);let h=t.BufferDecorationRenderer=class extends o.Disposable{constructor(e,t,i,s,r){super(),this._screenElement=e,this._bufferService=t,this._coreBrowserService=i,this._decorationService=s,this._renderService=r,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this.register(this._renderService.onRenderedViewportChange((()=>this._doRefreshDecorations()))),this.register(this._renderService.onDimensionsChange((()=>{this._dimensionsChanged=!0,this._queueRefresh()}))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt}))),this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh()))),this.register(this._decorationService.onDecorationRemoved((e=>this._removeDecoration(e)))),this.register((0,o.toDisposable)((()=>{this._container.remove(),this._decorationElements.clear()})))}_queueRefresh(){void 0===this._animationFrame&&(this._animationFrame=this._renderService.addRefreshCallback((()=>{this._doRefreshDecorations(),this._animationFrame=void 0})))}_doRefreshDecorations(){for(const e of this._decorationService.decorations)this._renderDecoration(e);this._dimensionsChanged=!1}_renderDecoration(e){this._refreshStyle(e),this._dimensionsChanged&&this._refreshXPosition(e)}_createElement(e){const t=this._coreBrowserService.mainDocument.createElement("div");t.classList.add("xterm-decoration"),t.classList.toggle("xterm-decoration-top-layer","top"===e?.options?.layer),t.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,t.style.height=(e.options.height||1)*this._renderService.dimensions.css.cell.height+"px",t.style.top=(e.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",t.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const i=e.options.x??0;return i&&i>this._bufferService.cols&&(t.style.display="none"),this._refreshXPosition(e,t),t}_refreshStyle(e){const t=e.marker.line-this._bufferService.buffers.active.ydisp;if(t<0||t>=this._bufferService.rows)e.element&&(e.element.style.display="none",e.onRenderEmitter.fire(e.element));else{let i=this._decorationElements.get(e);i||(i=this._createElement(e),e.element=i,this._decorationElements.set(e,i),this._container.appendChild(i),e.onDispose((()=>{this._decorationElements.delete(e),i.remove()}))),i.style.top=t*this._renderService.dimensions.css.cell.height+"px",i.style.display=this._altBufferIsActive?"none":"block",e.onRenderEmitter.fire(i)}}_refreshXPosition(e,t=e.element){if(!t)return;const i=e.options.x??0;"right"===(e.options.anchor||"left")?t.style.right=i?i*this._renderService.dimensions.css.cell.width+"px":"":t.style.left=i?i*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(e){this._decorationElements.get(e)?.remove(),this._decorationElements.delete(e),e.dispose()}};t.BufferDecorationRenderer=h=s([r(1,a.IBufferService),r(2,n.ICoreBrowserService),r(3,a.IDecorationService),r(4,n.IRenderService)],h)},5871:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ColorZoneStore=void 0,t.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(e){if(e.options.overviewRulerOptions){for(const t of this._zones)if(t.color===e.options.overviewRulerOptions.color&&t.position===e.options.overviewRulerOptions.position){if(this._lineIntersectsZone(t,e.marker.line))return;if(this._lineAdjacentToZone(t,e.marker.line,e.options.overviewRulerOptions.position))return void this._addLineToZone(t,e.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=e.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=e.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=e.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=e.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:e.options.overviewRulerOptions.color,position:e.options.overviewRulerOptions.position,startBufferLine:e.marker.line,endBufferLine:e.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(e){this._linePadding=e}_lineIntersectsZone(e,t){return t>=e.startBufferLine&&t<=e.endBufferLine}_lineAdjacentToZone(e,t,i){return t>=e.startBufferLine-this._linePadding[i||"full"]&&t<=e.endBufferLine+this._linePadding[i||"full"]}_addLineToZone(e,t){e.startBufferLine=Math.min(e.startBufferLine,t),e.endBufferLine=Math.max(e.endBufferLine,t)}}},5744:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.OverviewRulerRenderer=void 0;const n=i(5871),o=i(4725),a=i(844),h=i(2585),c={full:0,left:0,center:0,right:0},l={full:0,left:0,center:0,right:0},d={full:0,left:0,center:0,right:0};let _=t.OverviewRulerRenderer=class extends a.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(e,t,i,s,r,o,h){super(),this._viewportElement=e,this._screenElement=t,this._bufferService=i,this._decorationService=s,this._renderService=r,this._optionsService=o,this._coreBrowserService=h,this._colorZoneStore=new n.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),this._viewportElement.parentElement?.insertBefore(this._canvas,this._viewportElement);const c=this._canvas.getContext("2d");if(!c)throw new Error("Ctx cannot be null");this._ctx=c,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,a.toDisposable)((()=>{this._canvas?.remove()})))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh(void 0,!0)))),this.register(this._decorationService.onDecorationRemoved((()=>this._queueRefresh(void 0,!0))))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"}))),this.register(this._bufferService.onScroll((()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender((()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)}))),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",(()=>this._queueRefresh(!0)))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh(!0)))),this._queueRefresh(!0)}_refreshDrawConstants(){const e=Math.floor(this._canvas.width/3),t=Math.ceil(this._canvas.width/3);l.full=this._canvas.width,l.left=e,l.center=t,l.right=e,this._refreshDrawHeightConstants(),d.full=0,d.left=0,d.center=l.left,d.right=l.left+l.center}_refreshDrawHeightConstants(){c.full=Math.round(2*this._coreBrowserService.dpr);const e=this._canvas.height/this._bufferService.buffer.lines.length,t=Math.round(Math.max(Math.min(e,12),6)*this._coreBrowserService.dpr);c.left=t,c.center=t,c.right=t}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*c.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*c.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*c.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*c.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(const e of this._decorationService.decorations)this._colorZoneStore.addDecoration(e);this._ctx.lineWidth=1;const e=this._colorZoneStore.zones;for(const t of e)"full"!==t.position&&this._renderColorZone(t);for(const t of e)"full"===t.position&&this._renderColorZone(t);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(e){this._ctx.fillStyle=e.color,this._ctx.fillRect(d[e.position||"full"],Math.round((this._canvas.height-1)*(e.startBufferLine/this._bufferService.buffers.active.lines.length)-c[e.position||"full"]/2),l[e.position||"full"],Math.round((this._canvas.height-1)*((e.endBufferLine-e.startBufferLine)/this._bufferService.buffers.active.lines.length)+c[e.position||"full"]))}_queueRefresh(e,t){this._shouldUpdateDimensions=e||this._shouldUpdateDimensions,this._shouldUpdateAnchor=t||this._shouldUpdateAnchor,void 0===this._animationFrame&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};t.OverviewRulerRenderer=_=s([r(2,h.IBufferService),r(3,h.IDecorationService),r(4,o.IRenderService),r(5,h.IOptionsService),r(6,o.ICoreBrowserService)],_)},2950:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CompositionHelper=void 0;const n=i(4725),o=i(2585),a=i(2584);let h=t.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(e,t,i,s,r,n){this._textarea=e,this._compositionView=t,this._bufferService=i,this._optionsService=s,this._coreService=r,this._renderService=n,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(e){this._compositionView.textContent=e.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(e){if(this._isComposing||this._isSendingComposition){if(229===e.keyCode)return!1;if(16===e.keyCode||17===e.keyCode||18===
Download .txt
gitextract_ehir5wbi/

├── .circleci/
│   └── config.yml
├── .github/
│   └── workflows/
│       └── deploy.yml
├── .gitignore
├── .npmrc
├── LICENSE.txt
├── README.md
├── config_github_terminal.js
├── config_public_alpine.js
├── config_public_terminal.js
├── dockerfiles/
│   ├── .dockerignore
│   ├── debian_large
│   └── debian_mini
├── documents/
│   ├── Welcome.txt
│   └── index.list
├── examples/
│   ├── c/
│   │   ├── Makefile
│   │   ├── env.c
│   │   ├── helloworld.c
│   │   ├── link.c
│   │   ├── openat.c
│   │   └── waitpid.c
│   ├── lua/
│   │   ├── fizzbuzz.lua
│   │   ├── sorting.lua
│   │   └── symmetric_difference.lua
│   ├── nodejs/
│   │   ├── environment.js
│   │   ├── nbody.js
│   │   ├── primes.js
│   │   └── wasm.js
│   ├── python3/
│   │   ├── factorial.py
│   │   ├── fibonacci.py
│   │   └── pi.py
│   └── ruby/
│       ├── helloWorld.rb
│       ├── love.rb
│       └── powOf2.rb
├── login.html
├── nginx.conf
├── package.json
├── postcss.config.js
├── scrollbar.css
├── serviceWorker.js
├── src/
│   ├── app.html
│   ├── lib/
│   │   ├── AnthropicTab.svelte
│   │   ├── BlogPost.svelte
│   │   ├── CpuTab.svelte
│   │   ├── DiscordTab.svelte
│   │   ├── DiskTab.svelte
│   │   ├── GitHubTab.svelte
│   │   ├── Icon.svelte
│   │   ├── InformationTab.svelte
│   │   ├── NetworkingTab.svelte
│   │   ├── PanelButton.svelte
│   │   ├── PostsTab.svelte
│   │   ├── SideBar.svelte
│   │   ├── SmallButton.svelte
│   │   ├── WebVM.svelte
│   │   ├── activities.js
│   │   ├── anthropic.js
│   │   ├── global.css
│   │   ├── messages.js
│   │   ├── network.js
│   │   └── plausible.js
│   └── routes/
│       ├── +layout.server.js
│       ├── +page.js
│       ├── +page.svelte
│       └── alpine/
│           ├── +page.js
│           └── +page.svelte
├── svelte.config.js
├── tailwind.config.js
├── vite.config.js
└── xterm/
    ├── xterm-addon-fit.js
    ├── xterm-addon-web-links.js
    ├── xterm.css
    └── xterm.js
Download .txt
Showing preview only (223K chars total). Download the full file or copy to clipboard to get everything.
SYMBOL INDEX (1010 symbols across 17 files)

FILE: examples/c/env.c
  function main (line 5) | int main(int argc, char *argv[], char * envp[])

FILE: examples/c/helloworld.c
  function main (line 3) | int main()

FILE: examples/c/link.c
  function main (line 3) | int main()

FILE: examples/c/openat.c
  function main (line 5) | int main()

FILE: examples/c/waitpid.c
  function main (line 6) | int main()

FILE: examples/nodejs/nbody.js
  constant SOLAR_MASS (line 2) | const SOLAR_MASS = 4 * PI * PI;
  constant DAYS_PER_YEAR (line 3) | const DAYS_PER_YEAR = 365.24;
  function Body (line 5) | function Body(x, y, z, vx, vy, vz, mass) {
  function Jupiter (line 15) | function Jupiter() {
  function Saturn (line 27) | function Saturn() {
  function Uranus (line 39) | function Uranus() {
  function Neptune (line 51) | function Neptune() {
  function Sun (line 63) | function Sun() {
  function offsetMomentum (line 69) | function offsetMomentum() {
  function advance (line 88) | function advance(dt) {
  function energy (line 128) | function energy() {

FILE: examples/nodejs/primes.js
  function isPrime (line 3) | function isPrime(p) {
  function prime (line 14) | function prime(n) {

FILE: examples/python3/factorial.py
  function factorial (line 1) | def factorial():

FILE: examples/python3/fibonacci.py
  function fib (line 1) | def fib():

FILE: serviceWorker.js
  function handleFetch (line 1) | async function handleFetch(request) {
  function serviceWorkerInit (line 36) | function serviceWorkerInit() {
  function doRegister (line 50) | async function doRegister() {
  function serviceWorkerRegister (line 80) | async function serviceWorkerRegister() {

FILE: src/lib/anthropic.js
  function setApiKey (line 15) | function setApiKey(key)
  function clearApiKey (line 26) | function clearApiKey()
  function addMessageInternal (line 32) | function addMessageInternal(role, content)
  function sendMessages (line 38) | async function sendMessages(handleTool)
  function addMessage (line 138) | function addMessage(text, handleTool)
  function clearMessageHistory (line 145) | function clearMessageHistory() {
  function forceStop (line 150) | function forceStop() {
  function getMessageDetails (line 163) | function getMessageDetails(msg) {
  function yieldHelper (line 217) | async function yieldHelper(timeout)
  function kmsSendChar (line 225) | async function kmsSendChar(textArea, charStr)
  function getKmsInputElement (line 235) | function getKmsInputElement()
  function handleToolImpl (line 246) | async function handleToolImpl(tool, term)
  function initialize (line 493) | function initialize()

FILE: src/lib/network.js
  function loginUrlCb (line 20) | function loginUrlCb(url)
  function stateUpdateCb (line 26) | function stateUpdateCb(state)
  function netmapUpdateCb (line 38) | function netmapUpdateCb(map)
  function startLogin (line 56) | async function startLogin()
  function handleCopyIP (line 64) | async function handleCopyIP(event)
  function updateButtonData (line 83) | function updateButtonData(state, handleConnect) {

FILE: src/lib/plausible.js
  function tryPlausible (line 3) | function tryPlausible(msg) {

FILE: src/routes/+layout.server.js
  function getPostData (line 14) | async function getPostData(u)
  function load (line 38) | async function load()

FILE: xterm/xterm-addon-fit.js
  method activate (line 1) | activate(e){this._terminal=e}
  method dispose (line 1) | dispose(){}
  method fit (line 1) | fit(){const e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.c...
  method proposeDimensions (line 1) | proposeDimensions(){if(!this._terminal)return;if(!this._terminal.element...

FILE: xterm/xterm-addon-web-links.js
  function n (line 1) | function n(e){try{const t=new URL(e),n=t.password&&t.username?`${t.proto...
  method constructor (line 1) | constructor(e,t,n,o={}){this._terminal=e,this._regex=t,this._handler=n,t...
  method provideLinks (line 1) | provideLinks(e,t){const n=o.computeLink(e,this._regex,this._terminal,thi...
  method _addCallbacks (line 1) | _addCallbacks(e){return e.map((e=>(e.leave=this._options.leave,e.hover=(...
  class o (line 1) | class o{static computeLink(e,t,r,i){const s=new RegExp(t.source,(t.flags...
    method computeLink (line 1) | static computeLink(e,t,r,i){const s=new RegExp(t.source,(t.flags||"")+...
    method _getWindowedLineStrings (line 1) | static _getWindowedLineStrings(e,t){let n,o=e,r=e,i=0,s="";const a=[];...
    method _mapStrIdx (line 1) | static _mapStrIdx(e,t,n,o){const r=e.buffer.active,i=r.getNullCell();l...
  function n (line 1) | function n(o){var r=t[o];if(void 0!==r)return r.exports;var i=t[o]={expo...
  function i (line 1) | function i(e,t){const n=window.open();if(n){try{n.opener=null}catch{}n.l...
  method constructor (line 1) | constructor(e=i,t={}){this._handler=e,this._options=t}
  method activate (line 1) | activate(e){this._terminal=e;const n=this._options,o=n.urlRegex||r;this....
  method dispose (line 1) | dispose(){this._linkProvider?.dispose()}

FILE: xterm/xterm.js
  method constructor (line 1) | constructor(e,t,i,s){super(),this._terminal=e,this._coreBrowserService=i...
  method _handleTab (line 1) | _handleTab(e){for(let t=0;t<e;t++)this._handleChar(" ")}
  method _handleChar (line 1) | _handleChar(e){this._liveRegionLineCount<21&&(this._charsToConsume.lengt...
  method _clearLiveRegion (line 1) | _clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineC...
  method _handleKey (line 1) | _handleKey(e){this._clearLiveRegion(),/\p{Control}/u.test(e)||this._char...
  method _refreshRows (line 1) | _refreshRows(e,t){this._liveRegionDebouncer.refresh(e,t,this._terminal.r...
  method _renderRows (line 1) | _renderRows(e,t){const i=this._terminal.buffer,s=i.lines.length.toString...
  method _announceCharacters (line 1) | _announceCharacters(){0!==this._charsToAnnounce.length&&(this._liveRegio...
  method _handleBoundaryFocus (line 1) | _handleBoundaryFocus(e,t){const i=e.target,s=this._rowElements[0===t?1:t...
  method _handleSelectionChange (line 1) | _handleSelectionChange(){if(0===this._rowElements.length)return;const e=...
  method _handleResize (line 1) | _handleResize(e){this._rowElements[this._rowElements.length-1].removeEve...
  method _createAccessibilityTreeNode (line 1) | _createAccessibilityTreeNode(){const e=this._coreBrowserService.mainDocu...
  method _refreshRowsDimensions (line 1) | _refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.heig...
  method _refreshRowDimensions (line 1) | _refreshRowDimensions(e){e.style.height=`${this._renderService.dimension...
  function i (line 1) | function i(e){return e.replace(/\r?\n/g,"\r")}
    method constructor (line 1) | constructor(){this.clear()}
    method clear (line 1) | clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportSta...
    method update (line 1) | update(e,t,i,s=!1){if(this.selectionStart=t,this.selectionEnd=i,!t||!i...
    method isCellSelected (line 1) | isCellSelected(e,t,i){return!!this.hasSelection&&(i-=e.buffer.active.v...
    method constructor (line 1) | constructor(){this._data={}}
    method set (line 1) | set(e,t,i){this._data[e]||(this._data[e]={}),this._data[e][t]=i}
    method get (line 1) | get(e,t){return this._data[e]?this._data[e][t]:void 0}
    method clear (line 1) | clear(){this._data={}}
    method constructor (line 1) | constructor(){this.fg=0,this.bg=0,this.extended=new s}
    method toColorRGB (line 1) | static toColorRGB(e){return[e>>>16&255,e>>>8&255,255&e]}
    method fromColorRGB (line 1) | static fromColorRGB(e){return(255&e[0])<<16|(255&e[1])<<8|255&e[2]}
    method clone (line 1) | clone(){const e=new i;return e.fg=this.fg,e.bg=this.bg,e.extended=this...
    method isInverse (line 1) | isInverse(){return 67108864&this.fg}
    method isBold (line 1) | isBold(){return 134217728&this.fg}
    method isUnderline (line 1) | isUnderline(){return this.hasExtendedAttrs()&&0!==this.extended.underl...
    method isBlink (line 1) | isBlink(){return 536870912&this.fg}
    method isInvisible (line 1) | isInvisible(){return 1073741824&this.fg}
    method isItalic (line 1) | isItalic(){return 67108864&this.bg}
    method isDim (line 1) | isDim(){return 134217728&this.bg}
    method isStrikethrough (line 1) | isStrikethrough(){return 2147483648&this.fg}
    method isProtected (line 1) | isProtected(){return 536870912&this.bg}
    method isOverline (line 1) | isOverline(){return 1073741824&this.bg}
    method getFgColorMode (line 1) | getFgColorMode(){return 50331648&this.fg}
    method getBgColorMode (line 1) | getBgColorMode(){return 50331648&this.bg}
    method isFgRGB (line 1) | isFgRGB(){return 50331648==(50331648&this.fg)}
    method isBgRGB (line 1) | isBgRGB(){return 50331648==(50331648&this.bg)}
    method isFgPalette (line 1) | isFgPalette(){return 16777216==(50331648&this.fg)||33554432==(50331648...
    method isBgPalette (line 1) | isBgPalette(){return 16777216==(50331648&this.bg)||33554432==(50331648...
    method isFgDefault (line 1) | isFgDefault(){return 0==(50331648&this.fg)}
    method isBgDefault (line 1) | isBgDefault(){return 0==(50331648&this.bg)}
    method isAttributeDefault (line 1) | isAttributeDefault(){return 0===this.fg&&0===this.bg}
    method getFgColor (line 1) | getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:retu...
    method getBgColor (line 1) | getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:retu...
    method hasExtendedAttrs (line 1) | hasExtendedAttrs(){return 268435456&this.bg}
    method updateExtended (line 1) | updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=...
    method getUnderlineColor (line 1) | getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColo...
    method getUnderlineColorMode (line 1) | getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.under...
    method isUnderlineColorRGB (line 1) | isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underli...
    method isUnderlineColorPalette (line 1) | isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.und...
    method isUnderlineColorDefault (line 1) | isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.und...
    method getUnderlineStyle (line 1) | getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.ex...
    method getUnderlineVariantOffset (line 1) | getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}
  function s (line 1) | function s(e,t){return t?"[200~"+e+"[201~":e}
    method ext (line 1) | get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<...
    method ext (line 1) | set ext(e){this._ext=e}
    method underlineStyle (line 1) | get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}
    method underlineStyle (line 1) | set underlineStyle(e){this._ext&=-469762049,this._ext|=e<<26&469762048}
    method underlineColor (line 1) | get underlineColor(){return 67108863&this._ext}
    method underlineColor (line 1) | set underlineColor(e){this._ext&=-67108864,this._ext|=67108863&e}
    method urlId (line 1) | get urlId(){return this._urlId}
    method urlId (line 1) | set urlId(e){this._urlId=e}
    method underlineVariantOffset (line 1) | get underlineVariantOffset(){const e=(3758096384&this._ext)>>29;return...
    method underlineVariantOffset (line 1) | set underlineVariantOffset(e){this._ext&=536870911,this._ext|=e<<29&37...
    method constructor (line 1) | constructor(e=0,t=0){this._ext=0,this._urlId=0,this._ext=e,this._urlId=t}
    method clone (line 1) | clone(){return new s(this._ext,this._urlId)}
    method isEmpty (line 1) | isEmpty(){return 0===this.underlineStyle&&0===this._urlId}
    method fromArray (line 1) | static fromArray(e){const t=new s;if(!e.length)return t;for(let i=Arra...
    method constructor (line 1) | constructor(e=32,t=32){if(this.maxLength=e,this.maxSubParamsLength=t,t...
    method clone (line 1) | clone(){const e=new s(this.maxLength,this.maxSubParamsLength);return e...
    method toArray (line 1) | toArray(){const e=[];for(let t=0;t<this.length;++t){e.push(this.params...
    method reset (line 1) | reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,th...
    method addParam (line 1) | addParam(e){if(this._digitIsSub=!1,this.length>=this.maxLength)this._r...
    method addSubParam (line 1) | addSubParam(e){if(this._digitIsSub=!0,this.length)if(this._rejectDigit...
    method hasSubParams (line 1) | hasSubParams(e){return(255&this._subParamsIdx[e])-(this._subParamsIdx[...
    method getSubParams (line 1) | getSubParams(e){const t=this._subParamsIdx[e]>>8,i=255&this._subParams...
    method getSubParamsAll (line 1) | getSubParamsAll(){const e={};for(let t=0;t<this.length;++t){const i=th...
    method addDigit (line 1) | addDigit(e){let t;if(this._rejectDigits||!(t=this._digitIsSub?this._su...
  function r (line 1) | function r(e,t,r,n){e=s(e=i(e),r.decPrivateModes.bracketedPasteMode&&!0!...
    method constructor (line 1) | constructor(){super(),this.linkProviders=[],this.register((0,s.toDispo...
    method registerLinkProvider (line 1) | registerLinkProvider(e){return this.linkProviders.push(e),{dispose:()=...
    method constructor (line 1) | constructor(){this._tasks=[],this._i=0}
    method enqueue (line 1) | enqueue(e){this._tasks.push(e),this._start()}
    method flush (line 1) | flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this....
    method clear (line 1) | clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),...
    method _start (line 1) | _start(){this._idleCallback||(this._idleCallback=this._requestCallback...
    method _process (line 1) | _process(e){this._idleCallback=void 0;let t=0,i=0,s=e.timeRemaining(),...
  function n (line 1) | function n(e,t,i){const s=i.getBoundingClientRect(),r=e.clientX-s.left-1...
    method constructor (line 1) | constructor(e){super(),this._maxLength=e,this.onDeleteEmitter=this.reg...
    method maxLength (line 1) | get maxLength(){return this._maxLength}
    method maxLength (line 1) | set maxLength(e){if(this._maxLength===e)return;const t=new Array(e);fo...
    method length (line 1) | get length(){return this._length}
    method length (line 1) | set length(e){if(e>this._length)for(let t=this._length;t<e;t++)this._a...
    method get (line 1) | get(e){return this._array[this._getCyclicIndex(e)]}
    method set (line 1) | set(e,t){this._array[this._getCyclicIndex(e)]=t}
    method push (line 1) | push(e){this._array[this._getCyclicIndex(this._length)]=e,this._length...
    method recycle (line 1) | recycle(){if(this._length!==this._maxLength)throw new Error("Can only ...
    method isFull (line 1) | get isFull(){return this._length===this._maxLength}
    method pop (line 1) | pop(){return this._array[this._getCyclicIndex(this._length---1)]}
    method splice (line 1) | splice(e,t,...i){if(t){for(let i=e;i<this._length-t;i++)this._array[th...
    method trimStart (line 1) | trimStart(e){e>this._length&&(e=this._length),this._startIndex+=e,this...
    method shiftElements (line 1) | shiftElements(e,t,i){if(!(t<=0)){if(e<0||e>=this._length)throw new Err...
    method _getCyclicIndex (line 1) | _getCyclicIndex(e){return(this._startIndex+e)%this._maxLength}
    method _requestCallback (line 1) | _requestCallback(e){return setTimeout((()=>e(this._createDeadline(16))))}
    method _cancelCallback (line 1) | _cancelCallback(e){clearTimeout(e)}
    method _createDeadline (line 1) | _createDeadline(e){const t=Date.now()+e;return{timeRemaining:()=>Math....
    method id (line 1) | get id(){return this._id}
    method constructor (line 1) | constructor(e){this.line=e,this.isDisposed=!1,this._disposables=[],thi...
    method dispose (line 1) | dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDi...
    method register (line 1) | register(e){return this._disposables.push(e),e}
    method constructor (line 1) | constructor(e){super(),this._action=e,this._writeBuffer=[],this._callb...
    method handleUserInput (line 1) | handleUserInput(){this._didUserInput=!0}
    method writeSync (line 1) | writeSync(e,t){if(void 0!==t&&this._syncCalls>t)return void(this._sync...
    method write (line 1) | write(e,t){if(this._pendingData>5e7)throw new Error("write data discar...
    method _innerWrite (line 1) | _innerWrite(e=0,t=!0){const i=e||Date.now();for(;this._writeBuffer.len...
    method constructor (line 1) | constructor(...e){this._entries=new Map;for(const[t,i]of e)this.set(t,i)}
    method set (line 1) | set(e,t){const i=this._entries.get(e);return this._entries.set(e,t),i}
    method forEach (line 1) | forEach(e){for(const[t,i]of this._entries.entries())e(t,i)}
    method has (line 1) | has(e){return this._entries.has(e)}
    method get (line 1) | get(e){return this._entries.get(e)}
    method extractShouldJoin (line 1) | static extractShouldJoin(e){return 0!=(1&e)}
    method extractWidth (line 1) | static extractWidth(e){return e>>1&3}
    method extractCharKind (line 1) | static extractCharKind(e){return e>>3}
    method createPropertyValue (line 1) | static createPropertyValue(e,t,i=!1){return(16777215&e)<<3|(3&t)<<1|(i...
    method constructor (line 1) | constructor(){this._providers=Object.create(null),this._active="",this...
    method dispose (line 1) | dispose(){this._onChange.dispose()}
    method versions (line 1) | get versions(){return Object.keys(this._providers)}
    method activeVersion (line 1) | get activeVersion(){return this._active}
    method activeVersion (line 1) | set activeVersion(e){if(!this._providers[e])throw new Error(`unknown U...
    method register (line 1) | register(e){this._providers[e.version]=e}
    method wcwidth (line 1) | wcwidth(e){return this._activeProvider.wcwidth(e)}
    method getStringCellWidth (line 1) | getStringCellWidth(e){let t=0,i=0;const s=e.length;for(let r=0;r<s;++r...
    method charProperties (line 1) | charProperties(e,t){return this._activeProvider.charProperties(e,t)}
  method constructor (line 1) | constructor(){this._color=new s.TwoKeyMap,this._css=new s.TwoKeyMap}
  method setCss (line 1) | setCss(e,t,i){this._css.set(e,t,i)}
  method getCss (line 1) | getCss(e,t){return this._css.get(e,t)}
  method setColor (line 1) | setColor(e,t,i){this._color.set(e,t,i)}
  method getColor (line 1) | getColor(e,t){return this._color.get(e,t)}
  method clear (line 1) | clear(){this._color.clear(),this._css.clear()}
  method currentLink (line 1) | get currentLink(){return this._currentLink}
  method constructor (line 1) | constructor(e,t,i,s,r){super(),this._element=e,this._mouseService=t,this...
  method _handleMouseMove (line 1) | _handleMouseMove(e){this._lastMouseEvent=e;const t=this._positionFromMou...
  method _handleHover (line 1) | _handleHover(e){if(this._activeLine!==e.y||this._wasResized)return this....
  method _askForLink (line 1) | _askForLink(e,t){this._activeProviderReplies&&t||(this._activeProviderRe...
  method _removeIntersectingLinks (line 1) | _removeIntersectingLinks(e,t){const i=new Set;for(let s=0;s<t.size;s++){...
  method _checkLinkProviderResult (line 1) | _checkLinkProviderResult(e,t,i){if(!this._activeProviderReplies)return i...
  method _handleMouseDown (line 1) | _handleMouseDown(){this._mouseDownLink=this._currentLink}
  method _handleMouseUp (line 1) | _handleMouseUp(e){if(!this._currentLink)return;const t=this._positionFro...
  method _clearCurrentLink (line 1) | _clearCurrentLink(e,t){this._currentLink&&this._lastMouseEvent&&(!e||!t|...
  method _handleNewLink (line 1) | _handleNewLink(e){if(!this._lastMouseEvent)return;const t=this._position...
  method _linkHover (line 1) | _linkHover(e,t,i){this._currentLink?.state&&(this._currentLink.state.isH...
  method _fireUnderlineEvent (line 1) | _fireUnderlineEvent(e,t){const i=e.range,s=this._bufferService.buffer.yd...
  method _linkLeave (line 1) | _linkLeave(e,t,i){this._currentLink?.state&&(this._currentLink.state.isH...
  method _linkAtPosition (line 1) | _linkAtPosition(e,t){const i=e.range.start.y*this._bufferService.cols+e....
  method _positionFromMouseEvent (line 1) | _positionFromMouseEvent(e,t,i){const s=i.getCoords(e,t,this._bufferServi...
  method _createLinkUnderlineEvent (line 1) | _createLinkUnderlineEvent(e,t,i,s,r){return{x1:e,y1:t,x2:i,y2:s,cols:thi...
  method constructor (line 1) | constructor(e,t,i){this._bufferService=e,this._optionsService=t,this._os...
  method provideLinks (line 1) | provideLinks(e,t){const i=this._bufferService.buffer.lines.get(e-1);if(!...
  function h (line 1) | function h(e,t){if(confirm(`Do you want to navigate to ${t}?\n\nWARNING:...
    method constructor (line 1) | constructor(e,t,i=!1){this.isWrapped=i,this._combined={},this._extende...
    method get (line 1) | get(e){const t=this._data[3*e+0],i=2097151&t;return[this._data[3*e+1],...
    method set (line 1) | set(e,t){this._data[3*e+1]=t[n.CHAR_DATA_ATTR_INDEX],t[n.CHAR_DATA_CHA...
    method getWidth (line 1) | getWidth(e){return this._data[3*e+0]>>22}
    method hasWidth (line 1) | hasWidth(e){return 12582912&this._data[3*e+0]}
    method getFg (line 1) | getFg(e){return this._data[3*e+1]}
    method getBg (line 1) | getBg(e){return this._data[3*e+2]}
    method hasContent (line 1) | hasContent(e){return 4194303&this._data[3*e+0]}
    method getCodePoint (line 1) | getCodePoint(e){const t=this._data[3*e+0];return 2097152&t?this._combi...
    method isCombined (line 1) | isCombined(e){return 2097152&this._data[3*e+0]}
    method getString (line 1) | getString(e){const t=this._data[3*e+0];return 2097152&t?this._combined...
    method isProtected (line 1) | isProtected(e){return 536870912&this._data[3*e+2]}
    method loadCell (line 1) | loadCell(e,t){return a=3*e,t.content=this._data[a+0],t.fg=this._data[a...
    method setCell (line 1) | setCell(e,t){2097152&t.content&&(this._combined[e]=t.combinedData),268...
    method setCellFromCodepoint (line 1) | setCellFromCodepoint(e,t,i,s){268435456&s.bg&&(this._extendedAttrs[e]=...
    method addCodepointToCell (line 1) | addCodepointToCell(e,t,i){let s=this._data[3*e+0];2097152&s?this._comb...
    method insertCells (line 1) | insertCells(e,t,i){if((e%=this.length)&&2===this.getWidth(e-1)&&this.s...
    method deleteCells (line 1) | deleteCells(e,t,i){if(e%=this.length,t<this.length-e){const s=new r.Ce...
    method replaceCells (line 1) | replaceCells(e,t,i,s=!1){if(s)for(e&&2===this.getWidth(e-1)&&!this.isP...
    method resize (line 1) | resize(e,t){if(e===this.length)return 4*this._data.length*2<this._data...
    method cleanupMemory (line 1) | cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength)...
    method fill (line 1) | fill(e,t=!1){if(t)for(let t=0;t<this.length;++t)this.isProtected(t)||t...
    method copyFrom (line 1) | copyFrom(e){this.length!==e.length?this._data=new Uint32Array(e._data)...
    method clone (line 1) | clone(){const e=new h(0);e._data=new Uint32Array(this._data),e.length=...
    method getTrimmedLength (line 1) | getTrimmedLength(){for(let e=this.length-1;e>=0;--e)if(4194303&this._d...
    method getNoBgTrimmedLength (line 1) | getNoBgTrimmedLength(){for(let e=this.length-1;e>=0;--e)if(4194303&thi...
    method copyCellsFrom (line 1) | copyCellsFrom(e,t,i,s,r){const n=e._data;if(r)for(let r=s-1;r>=0;r--){...
    method translateToString (line 1) | translateToString(e,t,i,s){t=t??0,i=i??this.length,e&&(i=Math.min(i,th...
  method constructor (line 1) | constructor(e,t){this._renderCallback=e,this._coreBrowserService=t,this....
  method dispose (line 1) | dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelA...
  method addRefreshCallback (line 1) | addRefreshCallback(e){return this._refreshCallbacks.push(e),this._animat...
  method refresh (line 1) | refresh(e,t,i){this._rowCount=i,e=void 0!==e?e:0,t=void 0!==t?t:this._ro...
  method _innerRefresh (line 1) | _innerRefresh(){if(this._animationFrame=void 0,void 0===this._rowStart||...
  method _runRefreshCallbacks (line 1) | _runRefreshCallbacks(){for(const e of this._refreshCallbacks)e(0);this._...
  class P (line 1) | class P extends w.CoreTerminal{get onFocus(){return this._onFocus.event}...
    method onFocus (line 1) | get onFocus(){return this._onFocus.event}
    method onBlur (line 1) | get onBlur(){return this._onBlur.event}
    method onA11yChar (line 1) | get onA11yChar(){return this._onA11yCharEmitter.event}
    method onA11yTab (line 1) | get onA11yTab(){return this._onA11yTabEmitter.event}
    method onWillOpen (line 1) | get onWillOpen(){return this._onWillOpen.event}
    method constructor (line 1) | constructor(e={}){super(e),this.browser=k,this._keyDownHandled=!1,this...
    method _handleColorEvent (line 1) | _handleColorEvent(e){if(this._themeService)for(const t of e){let e,i="...
    method _setup (line 1) | _setup(){super._setup(),this._customKeyEventHandler=void 0}
    method buffer (line 1) | get buffer(){return this.buffers.active}
    method focus (line 1) | focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}
    method _handleScreenReaderModeOptionChange (line 1) | _handleScreenReaderModeOptionChange(e){e?!this._accessibilityManager.v...
    method _handleTextAreaFocus (line 1) | _handleTextAreaFocus(e){this.coreService.decPrivateModes.sendFocus&&th...
    method blur (line 1) | blur(){return this.textarea?.blur()}
    method _handleTextAreaBlur (line 1) | _handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer....
    method _syncTextArea (line 1) | _syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||th...
    method _initGlobal (line 1) | _initGlobal(){this._bindKeys(),this.register((0,r.addDisposableDomList...
    method _bindKeys (line 1) | _bindKeys(){this.register((0,r.addDisposableDomListener)(this.textarea...
    method open (line 1) | open(e){if(!e)throw new Error("Terminal requires a parent element.");i...
    method _createRenderer (line 1) | _createRenderer(){return this._instantiationService.createInstance(_.D...
    method bindMouse (line 1) | bindMouse(){const e=this,t=this.element;function i(t){const i=e._mouse...
    method refresh (line 1) | refresh(e,t){this._renderService?.refreshRows(e,t)}
    method updateCursorStyle (line 1) | updateCursorStyle(e){this._selectionService?.shouldColumnSelect(e)?thi...
    method _showCursor (line 1) | _showCursor(){this.coreService.isCursorInitialized||(this.coreService....
    method scrollLines (line 1) | scrollLines(e,t,i=0){1===i?(super.scrollLines(e,t,i),this.refresh(0,th...
    method paste (line 1) | paste(e){(0,s.paste)(e,this.textarea,this.coreService,this.optionsServ...
    method attachCustomKeyEventHandler (line 1) | attachCustomKeyEventHandler(e){this._customKeyEventHandler=e}
    method attachCustomWheelEventHandler (line 1) | attachCustomWheelEventHandler(e){this._customWheelEventHandler=e}
    method registerLinkProvider (line 1) | registerLinkProvider(e){return this._linkProviderService.registerLinkP...
    method registerCharacterJoiner (line 1) | registerCharacterJoiner(e){if(!this._characterJoinerService)throw new ...
    method deregisterCharacterJoiner (line 1) | deregisterCharacterJoiner(e){if(!this._characterJoinerService)throw ne...
    method markers (line 1) | get markers(){return this.buffer.markers}
    method registerMarker (line 1) | registerMarker(e){return this.buffer.addMarker(this.buffer.ybase+this....
    method registerDecoration (line 1) | registerDecoration(e){return this._decorationService.registerDecoratio...
    method hasSelection (line 1) | hasSelection(){return!!this._selectionService&&this._selectionService....
    method select (line 1) | select(e,t,i){this._selectionService.setSelection(e,t,i)}
    method getSelection (line 1) | getSelection(){return this._selectionService?this._selectionService.se...
    method getSelectionPosition (line 1) | getSelectionPosition(){if(this._selectionService&&this._selectionServi...
    method clearSelection (line 1) | clearSelection(){this._selectionService?.clearSelection()}
    method selectAll (line 1) | selectAll(){this._selectionService?.selectAll()}
    method selectLines (line 1) | selectLines(e,t){this._selectionService?.selectLines(e,t)}
    method _keyDown (line 1) | _keyDown(e){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._cust...
    method _isThirdLevelShift (line 1) | _isThirdLevelShift(e,t){const i=e.isMac&&!this.options.macOptionIsMeta...
    method _keyUp (line 1) | _keyUp(e){this._keyDownSeen=!1,this._customKeyEventHandler&&!1===this....
    method _keyPress (line 1) | _keyPress(e){let t;if(this._keyPressHandled=!1,this._keyDownHandled)re...
    method _inputEvent (line 1) | _inputEvent(e){if(e.data&&"insertText"===e.inputType&&(!e.composed||!t...
    method resize (line 1) | resize(e,t){e!==this.cols||t!==this.rows?super.resize(e,t):this._charS...
    method _afterResize (line 1) | _afterResize(e,t){this._charSizeService?.measure(),this.viewport?.sync...
    method clear (line 1) | clear(){if(0!==this.buffer.ybase||0!==this.buffer.y){this.buffer.clear...
    method reset (line 1) | reset(){this.options.rows=this.rows,this.options.cols=this.cols;const ...
    method clearTextureAtlas (line 1) | clearTextureAtlas(){this._renderService?.clearTextureAtlas()}
    method _reportFocus (line 1) | _reportFocus(){this.element?.classList.contains("focus")?this.coreServ...
    method _reportWindowsOptions (line 1) | _reportWindowsOptions(e){if(this._renderService)switch(e){case T.Windo...
    method cancel (line 1) | cancel(e,t){if(this.options.cancelEvents||t)return e.preventDefault(),...
  method constructor (line 1) | constructor(e,t=1e3){this._renderCallback=e,this._debounceThresholdMS=t,...
  method dispose (line 1) | dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}
  method refresh (line 1) | refresh(e,t,i){this._rowCount=i,e=void 0!==e?e:0,t=void 0!==t?t:this._ro...
  method _innerRefresh (line 1) | _innerRefresh(){if(void 0===this._rowStart||void 0===this._rowEnd||void ...
  method constructor (line 1) | constructor(e,t,i,s,r,o,h,c){super(),this._viewportElement=e,this._scrol...
  method _handleThemeChange (line 1) | _handleThemeChange(e){this._viewportElement.style.backgroundColor=e.back...
  method reset (line 1) | reset(){this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._l...
  method _refresh (line 1) | _refresh(e){if(e)return this._innerRefresh(),void(null!==this._refreshAn...
  method _innerRefresh (line 1) | _innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeigh...
  method syncScrollArea (line 1) | syncScrollArea(e=!1){if(this._lastRecordedBufferLength!==this._bufferSer...
  method _handleScroll (line 1) | _handleScroll(e){if(this._lastScrollTop=this._viewportElement.scrollTop,...
  method _smoothScroll (line 1) | _smoothScroll(){if(this._isDisposed||-1===this._smoothScrollState.origin...
  method _smoothScrollPercent (line 1) | _smoothScrollPercent(){return this._optionsService.rawOptions.smoothScro...
  method _clearSmoothScrollState (line 1) | _clearSmoothScrollState(){this._smoothScrollState.startTime=0,this._smoo...
  method _bubbleScroll (line 1) | _bubbleScroll(e,t){const i=this._viewportElement.scrollTop+this._lastRec...
  method handleWheel (line 1) | handleWheel(e){const t=this._getPixelsScrolled(e);return 0!==t&&(this._o...
  method scrollLines (line 1) | scrollLines(e){if(0!==e)if(this._optionsService.rawOptions.smoothScrollD...
  method _getPixelsScrolled (line 1) | _getPixelsScrolled(e){if(0===e.deltaY||e.shiftKey)return 0;let t=this._a...
  method getBufferElements (line 1) | getBufferElements(e,t){let i,s="";const r=[],n=t??this._bufferService.bu...
  method getLinesScrolled (line 1) | getLinesScrolled(e){if(0===e.deltaY||e.shiftKey)return 0;let t=this._app...
  method _applyScrollModifier (line 1) | _applyScrollModifier(e,t){const i=this._optionsService.rawOptions.fastSc...
  method handleTouchStart (line 1) | handleTouchStart(e){this._lastTouchY=e.touches[0].pageY}
  method handleTouchMove (line 1) | handleTouchMove(e){const t=this._lastTouchY-e.touches[0].pageY;return th...
  method constructor (line 1) | constructor(e,t,i,s,r){super(),this._screenElement=e,this._bufferService...
  method _queueRefresh (line 1) | _queueRefresh(){void 0===this._animationFrame&&(this._animationFrame=thi...
  method _doRefreshDecorations (line 1) | _doRefreshDecorations(){for(const e of this._decorationService.decoratio...
  method _renderDecoration (line 1) | _renderDecoration(e){this._refreshStyle(e),this._dimensionsChanged&&this...
  method _createElement (line 1) | _createElement(e){const t=this._coreBrowserService.mainDocument.createEl...
  method _refreshStyle (line 1) | _refreshStyle(e){const t=e.marker.line-this._bufferService.buffers.activ...
  method _refreshXPosition (line 1) | _refreshXPosition(e,t=e.element){if(!t)return;const i=e.options.x??0;"ri...
  method _removeDecoration (line 1) | _removeDecoration(e){this._decorationElements.get(e)?.remove(),this._dec...
  method constructor (line 1) | constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,thi...
  method zones (line 1) | get zones(){return this._zonePool.length=Math.min(this._zonePool.length,...
  method clear (line 1) | clear(){this._zones.length=0,this._zonePoolIndex=0}
  method addDecoration (line 1) | addDecoration(e){if(e.options.overviewRulerOptions){for(const t of this....
  method setPadding (line 1) | setPadding(e){this._linePadding=e}
  method _lineIntersectsZone (line 1) | _lineIntersectsZone(e,t){return t>=e.startBufferLine&&t<=e.endBufferLine}
  method _lineAdjacentToZone (line 1) | _lineAdjacentToZone(e,t,i){return t>=e.startBufferLine-this._linePadding...
  method _addLineToZone (line 1) | _addLineToZone(e,t){e.startBufferLine=Math.min(e.startBufferLine,t),e.en...
  method _width (line 1) | get _width(){return this._optionsService.options.overviewRulerWidth||0}
  method constructor (line 1) | constructor(e,t,i,s,r,o,h){super(),this._viewportElement=e,this._screenE...
  method _registerDecorationListeners (line 1) | _registerDecorationListeners(){this.register(this._decorationService.onD...
  method _registerBufferChangeListeners (line 1) | _registerBufferChangeListeners(){this.register(this._renderService.onRen...
  method _registerDimensionChangeListeners (line 1) | _registerDimensionChangeListeners(){this.register(this._renderService.on...
  method _refreshDrawConstants (line 1) | _refreshDrawConstants(){const e=Math.floor(this._canvas.width/3),t=Math....
  method _refreshDrawHeightConstants (line 1) | _refreshDrawHeightConstants(){c.full=Math.round(2*this._coreBrowserServi...
  method _refreshColorZonePadding (line 1) | _refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.fl...
  method _refreshCanvasDimensions (line 1) | _refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,t...
  method _refreshDecorations (line 1) | _refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasD...
  method _renderColorZone (line 1) | _renderColorZone(e){this._ctx.fillStyle=e.color,this._ctx.fillRect(d[e.p...
  method _queueRefresh (line 1) | _queueRefresh(e,t){this._shouldUpdateDimensions=e||this._shouldUpdateDim...
  method isComposing (line 1) | get isComposing(){return this._isComposing}
  method constructor (line 1) | constructor(e,t,i,s,r,n){this._textarea=e,this._compositionView=t,this._...
  method compositionstart (line 1) | compositionstart(){this._isComposing=!0,this._compositionPosition.start=...
  method compositionupdate (line 1) | compositionupdate(e){this._compositionView.textContent=e.data,this.updat...
  method compositionend (line 1) | compositionend(){this._finalizeComposition(!0)}
  method keydown (line 1) | keydown(e){if(this._isComposing||this._isSendingComposition){if(229===e....
  method _finalizeComposition (line 1) | _finalizeComposition(e){if(this._compositionView.classList.remove("activ...
  method _handleAnyTextareaChanges (line 1) | _handleAnyTextareaChanges(){const e=this._textarea.value;setTimeout((()=...
  method updateCompositionElements (line 1) | updateCompositionElements(e){if(this._isComposing){if(this._bufferServic...
  function i (line 1) | function i(e,t,i){const s=i.getBoundingClientRect(),r=e.getComputedStyle...
    method constructor (line 1) | constructor(){this.clear()}
    method clear (line 1) | clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportSta...
    method update (line 1) | update(e,t,i,s=!1){if(this.selectionStart=t,this.selectionEnd=i,!t||!i...
    method isCellSelected (line 1) | isCellSelected(e,t,i){return!!this.hasSelection&&(i-=e.buffer.active.v...
    method constructor (line 1) | constructor(){this._data={}}
    method set (line 1) | set(e,t,i){this._data[e]||(this._data[e]={}),this._data[e][t]=i}
    method get (line 1) | get(e,t){return this._data[e]?this._data[e][t]:void 0}
    method clear (line 1) | clear(){this._data={}}
    method constructor (line 1) | constructor(){this.fg=0,this.bg=0,this.extended=new s}
    method toColorRGB (line 1) | static toColorRGB(e){return[e>>>16&255,e>>>8&255,255&e]}
    method fromColorRGB (line 1) | static fromColorRGB(e){return(255&e[0])<<16|(255&e[1])<<8|255&e[2]}
    method clone (line 1) | clone(){const e=new i;return e.fg=this.fg,e.bg=this.bg,e.extended=this...
    method isInverse (line 1) | isInverse(){return 67108864&this.fg}
    method isBold (line 1) | isBold(){return 134217728&this.fg}
    method isUnderline (line 1) | isUnderline(){return this.hasExtendedAttrs()&&0!==this.extended.underl...
    method isBlink (line 1) | isBlink(){return 536870912&this.fg}
    method isInvisible (line 1) | isInvisible(){return 1073741824&this.fg}
    method isItalic (line 1) | isItalic(){return 67108864&this.bg}
    method isDim (line 1) | isDim(){return 134217728&this.bg}
    method isStrikethrough (line 1) | isStrikethrough(){return 2147483648&this.fg}
    method isProtected (line 1) | isProtected(){return 536870912&this.bg}
    method isOverline (line 1) | isOverline(){return 1073741824&this.bg}
    method getFgColorMode (line 1) | getFgColorMode(){return 50331648&this.fg}
    method getBgColorMode (line 1) | getBgColorMode(){return 50331648&this.bg}
    method isFgRGB (line 1) | isFgRGB(){return 50331648==(50331648&this.fg)}
    method isBgRGB (line 1) | isBgRGB(){return 50331648==(50331648&this.bg)}
    method isFgPalette (line 1) | isFgPalette(){return 16777216==(50331648&this.fg)||33554432==(50331648...
    method isBgPalette (line 1) | isBgPalette(){return 16777216==(50331648&this.bg)||33554432==(50331648...
    method isFgDefault (line 1) | isFgDefault(){return 0==(50331648&this.fg)}
    method isBgDefault (line 1) | isBgDefault(){return 0==(50331648&this.bg)}
    method isAttributeDefault (line 1) | isAttributeDefault(){return 0===this.fg&&0===this.bg}
    method getFgColor (line 1) | getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:retu...
    method getBgColor (line 1) | getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:retu...
    method hasExtendedAttrs (line 1) | hasExtendedAttrs(){return 268435456&this.bg}
    method updateExtended (line 1) | updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=...
    method getUnderlineColor (line 1) | getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColo...
    method getUnderlineColorMode (line 1) | getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.under...
    method isUnderlineColorRGB (line 1) | isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underli...
    method isUnderlineColorPalette (line 1) | isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.und...
    method isUnderlineColorDefault (line 1) | isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.und...
    method getUnderlineStyle (line 1) | getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.ex...
    method getUnderlineVariantOffset (line 1) | getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}
  function r (line 1) | function r(e,t,i,s){const r=e-n(e,i),a=t-n(t,i),l=Math.abs(r-a)-function...
    method constructor (line 1) | constructor(){super(),this.linkProviders=[],this.register((0,s.toDispo...
    method registerLinkProvider (line 1) | registerLinkProvider(e){return this.linkProviders.push(e),{dispose:()=...
    method constructor (line 1) | constructor(){this._tasks=[],this._i=0}
    method enqueue (line 1) | enqueue(e){this._tasks.push(e),this._start()}
    method flush (line 1) | flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this....
    method clear (line 1) | clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),...
    method _start (line 1) | _start(){this._idleCallback||(this._idleCallback=this._requestCallback...
    method _process (line 1) | _process(e){this._idleCallback=void 0;let t=0,i=0,s=e.timeRemaining(),...
  function n (line 1) | function n(e,t){let i=0,s=t.buffer.lines.get(e),r=s?.isWrapped;for(;r&&e...
    method constructor (line 1) | constructor(e){super(),this._maxLength=e,this.onDeleteEmitter=this.reg...
    method maxLength (line 1) | get maxLength(){return this._maxLength}
    method maxLength (line 1) | set maxLength(e){if(this._maxLength===e)return;const t=new Array(e);fo...
    method length (line 1) | get length(){return this._length}
    method length (line 1) | set length(e){if(e>this._length)for(let t=this._length;t<e;t++)this._a...
    method get (line 1) | get(e){return this._array[this._getCyclicIndex(e)]}
    method set (line 1) | set(e,t){this._array[this._getCyclicIndex(e)]=t}
    method push (line 1) | push(e){this._array[this._getCyclicIndex(this._length)]=e,this._length...
    method recycle (line 1) | recycle(){if(this._length!==this._maxLength)throw new Error("Can only ...
    method isFull (line 1) | get isFull(){return this._length===this._maxLength}
    method pop (line 1) | pop(){return this._array[this._getCyclicIndex(this._length---1)]}
    method splice (line 1) | splice(e,t,...i){if(t){for(let i=e;i<this._length-t;i++)this._array[th...
    method trimStart (line 1) | trimStart(e){e>this._length&&(e=this._length),this._startIndex+=e,this...
    method shiftElements (line 1) | shiftElements(e,t,i){if(!(t<=0)){if(e<0||e>=this._length)throw new Err...
    method _getCyclicIndex (line 1) | _getCyclicIndex(e){return(this._startIndex+e)%this._maxLength}
    method _requestCallback (line 1) | _requestCallback(e){return setTimeout((()=>e(this._createDeadline(16))))}
    method _cancelCallback (line 1) | _cancelCallback(e){clearTimeout(e)}
    method _createDeadline (line 1) | _createDeadline(e){const t=Date.now()+e;return{timeRemaining:()=>Math....
    method id (line 1) | get id(){return this._id}
    method constructor (line 1) | constructor(e){this.line=e,this.isDisposed=!1,this._disposables=[],thi...
    method dispose (line 1) | dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDi...
    method register (line 1) | register(e){return this._disposables.push(e),e}
    method constructor (line 1) | constructor(e){super(),this._action=e,this._writeBuffer=[],this._callb...
    method handleUserInput (line 1) | handleUserInput(){this._didUserInput=!0}
    method writeSync (line 1) | writeSync(e,t){if(void 0!==t&&this._syncCalls>t)return void(this._sync...
    method write (line 1) | write(e,t){if(this._pendingData>5e7)throw new Error("write data discar...
    method _innerWrite (line 1) | _innerWrite(e=0,t=!0){const i=e||Date.now();for(;this._writeBuffer.len...
    method constructor (line 1) | constructor(...e){this._entries=new Map;for(const[t,i]of e)this.set(t,i)}
    method set (line 1) | set(e,t){const i=this._entries.get(e);return this._entries.set(e,t),i}
    method forEach (line 1) | forEach(e){for(const[t,i]of this._entries.entries())e(t,i)}
    method has (line 1) | has(e){return this._entries.has(e)}
    method get (line 1) | get(e){return this._entries.get(e)}
    method extractShouldJoin (line 1) | static extractShouldJoin(e){return 0!=(1&e)}
    method extractWidth (line 1) | static extractWidth(e){return e>>1&3}
    method extractCharKind (line 1) | static extractCharKind(e){return e>>3}
    method createPropertyValue (line 1) | static createPropertyValue(e,t,i=!1){return(16777215&e)<<3|(3&t)<<1|(i...
    method constructor (line 1) | constructor(){this._providers=Object.create(null),this._active="",this...
    method dispose (line 1) | dispose(){this._onChange.dispose()}
    method versions (line 1) | get versions(){return Object.keys(this._providers)}
    method activeVersion (line 1) | get activeVersion(){return this._active}
    method activeVersion (line 1) | set activeVersion(e){if(!this._providers[e])throw new Error(`unknown U...
    method register (line 1) | register(e){this._providers[e.version]=e}
    method wcwidth (line 1) | wcwidth(e){return this._activeProvider.wcwidth(e)}
    method getStringCellWidth (line 1) | getStringCellWidth(e){let t=0,i=0;const s=e.length;for(let r=0;r<s;++r...
    method charProperties (line 1) | charProperties(e,t){return this._activeProvider.charProperties(e,t)}
  function o (line 1) | function o(e,t){return e>t?"A":"B"}
    method constructor (line 1) | constructor(e,t,i){super(),this._textarea=e,this._window=t,this.mainDo...
    method window (line 1) | get window(){return this._window}
    method window (line 1) | set window(e){this._window!==e&&(this._window=e,this._onWindowChange.f...
    method dpr (line 1) | get dpr(){return this.window.devicePixelRatio}
    method isFocused (line 1) | get isFocused(){return void 0===this._cachedIsFocused&&(this._cachedIs...
    method constructor (line 1) | constructor(e,t){super(),this._optionsService=e,this._bufferService=t,...
    method reset (line 1) | reset(){this._normal=new n.Buffer(!0,this._optionsService,this._buffer...
    method alt (line 1) | get alt(){return this._alt}
    method active (line 1) | get active(){return this._activeBuffer}
    method normal (line 1) | get normal(){return this._normal}
    method activateNormalBuffer (line 1) | activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._norma...
    method activateAltBuffer (line 1) | activateAltBuffer(e){this._activeBuffer!==this._alt&&(this._alt.fillVi...
    method resize (line 1) | resize(e,t){this._normal.resize(e,t),this._alt.resize(e,t),this.setupT...
    method setupTabStops (line 1) | setupTabStops(e){this._normal.setupTabStops(e),this._alt.setupTabStops...
    method constructor (line 1) | constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,t...
    method fromCharData (line 1) | static fromCharData(e){const t=new o;return t.setFromCharData(e),t}
    method isCombined (line 1) | isCombined(){return 2097152&this.content}
    method getWidth (line 1) | getWidth(){return this.content>>22}
    method getChars (line 1) | getChars(){return 2097152&this.content?this.combinedData:2097151&this....
    method getCode (line 1) | getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.c...
    method setFromCharData (line 1) | setFromCharData(e){this.fg=e[r.CHAR_DATA_ATTR_INDEX],this.bg=0;let t=!...
    method getAsCharData (line 1) | getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.ge...
    method constructor (line 1) | constructor(e){super(),this._core=e,this._onBufferChange=this.register...
    method active (line 1) | get active(){if(this._core.buffers.active===this._core.buffers.normal)...
    method normal (line 1) | get normal(){return this._normal.init(this._core.buffers.normal)}
    method alternate (line 1) | get alternate(){return this._alternate.init(this._core.buffers.alt)}
  function a (line 1) | function a(e,t,i,s,r,n){let o=e,a=t,h="";for(;o!==i||a!==s;)o+=r?1:-1,r&...
    method constructor (line 1) | constructor(e){super(),this._parentWindow=e,this._windowResizeListener...
    method setWindow (line 1) | setWindow(e){this._parentWindow=e,this._setWindowResizeListener(),this...
    method _setWindowResizeListener (line 1) | _setWindowResizeListener(){this._windowResizeListener.value=(0,n.addDi...
    method _setDprAndFireIfDiffers (line 1) | _setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._...
    method _updateDpr (line 1) | _updateDpr(){this._outerListener&&(this._resolutionMediaMatchList?.rem...
    method clearListener (line 1) | clearListener(){this._resolutionMediaMatchList&&this._outerListener&&(...
    method constructor (line 1) | constructor(e){this.table=new Uint8Array(e)}
    method setDefault (line 1) | setDefault(e,t){this.table.fill(e<<4|t)}
    method add (line 1) | add(e,t,i,s){this.table[t<<8|e]=i<<4|s}
    method addMany (line 1) | addMany(e,t,i,s){for(let r=0;r<e.length;r++)this.table[t<<8|e[r]]=i<<4|s}
    method constructor (line 1) | constructor(e){super(),this._onOptionChange=this.register(new s.EventE...
    method onSpecificOptionChange (line 1) | onSpecificOptionChange(e,t){return this.onOptionChange((i=>{i===e&&t(t...
    method onMultipleOptionChange (line 1) | onMultipleOptionChange(e,t){return this.onOptionChange((i=>{-1!==e.ind...
    method _setupOptions (line 1) | _setupOptions(){const e=e=>{if(!(e in t.DEFAULT_OPTIONS))throw new Err...
    method _sanitizeAndValidateOption (line 1) | _sanitizeAndValidateOption(e,i){switch(e){case"cursorStyle":if(i||(i=t...
  function h (line 1) | function h(e,t){const i=t?"O":"[";return s.C0.ESC+i+e}
    method constructor (line 1) | constructor(e,t,i=!1){this.isWrapped=i,this._combined={},this._extende...
    method get (line 1) | get(e){const t=this._data[3*e+0],i=2097151&t;return[this._data[3*e+1],...
    method set (line 1) | set(e,t){this._data[3*e+1]=t[n.CHAR_DATA_ATTR_INDEX],t[n.CHAR_DATA_CHA...
    method getWidth (line 1) | getWidth(e){return this._data[3*e+0]>>22}
    method hasWidth (line 1) | hasWidth(e){return 12582912&this._data[3*e+0]}
    method getFg (line 1) | getFg(e){return this._data[3*e+1]}
    method getBg (line 1) | getBg(e){return this._data[3*e+2]}
    method hasContent (line 1) | hasContent(e){return 4194303&this._data[3*e+0]}
    method getCodePoint (line 1) | getCodePoint(e){const t=this._data[3*e+0];return 2097152&t?this._combi...
    method isCombined (line 1) | isCombined(e){return 2097152&this._data[3*e+0]}
    method getString (line 1) | getString(e){const t=this._data[3*e+0];return 2097152&t?this._combined...
    method isProtected (line 1) | isProtected(e){return 536870912&this._data[3*e+2]}
    method loadCell (line 1) | loadCell(e,t){return a=3*e,t.content=this._data[a+0],t.fg=this._data[a...
    method setCell (line 1) | setCell(e,t){2097152&t.content&&(this._combined[e]=t.combinedData),268...
    method setCellFromCodepoint (line 1) | setCellFromCodepoint(e,t,i,s){268435456&s.bg&&(this._extendedAttrs[e]=...
    method addCodepointToCell (line 1) | addCodepointToCell(e,t,i){let s=this._data[3*e+0];2097152&s?this._comb...
    method insertCells (line 1) | insertCells(e,t,i){if((e%=this.length)&&2===this.getWidth(e-1)&&this.s...
    method deleteCells (line 1) | deleteCells(e,t,i){if(e%=this.length,t<this.length-e){const s=new r.Ce...
    method replaceCells (line 1) | replaceCells(e,t,i,s=!1){if(s)for(e&&2===this.getWidth(e-1)&&!this.isP...
    method resize (line 1) | resize(e,t){if(e===this.length)return 4*this._data.length*2<this._data...
    method cleanupMemory (line 1) | cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength)...
    method fill (line 1) | fill(e,t=!1){if(t)for(let t=0;t<this.length;++t)this.isProtected(t)||t...
    method copyFrom (line 1) | copyFrom(e){this.length!==e.length?this._data=new Uint32Array(e._data)...
    method clone (line 1) | clone(){const e=new h(0);e._data=new Uint32Array(this._data),e.length=...
    method getTrimmedLength (line 1) | getTrimmedLength(){for(let e=this.length-1;e>=0;--e)if(4194303&this._d...
    method getNoBgTrimmedLength (line 1) | getNoBgTrimmedLength(){for(let e=this.length-1;e>=0;--e)if(4194303&thi...
    method copyCellsFrom (line 1) | copyCellsFrom(e,t,i,s,r){const n=e._data;if(r)for(let r=s-1;r>=0;r--){...
    method translateToString (line 1) | translateToString(e,t,i,s){t=t??0,i=i??this.length,e&&(i=Math.min(i,th...
  function c (line 1) | function c(e,t){e=Math.floor(e);let i="";for(let s=0;s<e;s++)i+=t;return i}
    method constructor (line 1) | constructor(){super(...arguments),this._result={width:0,height:0}}
    method _validateAndSet (line 1) | _validateAndSet(e,t){void 0!==e&&e>0&&void 0!==t&&t>0&&(this._result.w...
    method constructor (line 1) | constructor(e,t,i){super(),this.content=0,this.combinedData="",this.fg...
    method isCombined (line 1) | isCombined(){return 2097152}
    method getWidth (line 1) | getWidth(){return this._width}
    method getChars (line 1) | getChars(){return this.combinedData}
    method getCode (line 1) | getCode(){return 2097151}
    method setFromCharData (line 1) | setFromCharData(e){throw new Error("not implemented")}
    method getAsCharData (line 1) | getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.ge...
    method constructor (line 1) | constructor(e=t.VT500_TRANSITION_TABLE){super(),this._transitions=e,th...
    method _identifier (line 1) | _identifier(e,t=[64,126]){let i=0;if(e.prefix){if(e.prefix.length>1)th...
    method identToString (line 1) | identToString(e){const t=[];for(;e;)t.push(String.fromCharCode(255&e))...
    method setPrintHandler (line 1) | setPrintHandler(e){this._printHandler=e}
    method clearPrintHandler (line 1) | clearPrintHandler(){this._printHandler=this._printHandlerFb}
    method registerEscHandler (line 1) | registerEscHandler(e,t){const i=this._identifier(e,[48,126]);void 0===...
    method clearEscHandler (line 1) | clearEscHandler(e){this._escHandlers[this._identifier(e,[48,126])]&&de...
    method setEscHandlerFallback (line 1) | setEscHandlerFallback(e){this._escHandlerFb=e}
    method setExecuteHandler (line 1) | setExecuteHandler(e,t){this._executeHandlers[e.charCodeAt(0)]=t}
    method clearExecuteHandler (line 1) | clearExecuteHandler(e){this._executeHandlers[e.charCodeAt(0)]&&delete ...
    method setExecuteHandlerFallback (line 1) | setExecuteHandlerFallback(e){this._executeHandlerFb=e}
    method registerCsiHandler (line 1) | registerCsiHandler(e,t){const i=this._identifier(e);void 0===this._csi...
    method clearCsiHandler (line 1) | clearCsiHandler(e){this._csiHandlers[this._identifier(e)]&&delete this...
    method setCsiHandlerFallback (line 1) | setCsiHandlerFallback(e){this._csiHandlerFb=e}
    method registerDcsHandler (line 1) | registerDcsHandler(e,t){return this._dcsParser.registerHandler(this._i...
    method clearDcsHandler (line 1) | clearDcsHandler(e){this._dcsParser.clearHandler(this._identifier(e))}
    method setDcsHandlerFallback (line 1) | setDcsHandlerFallback(e){this._dcsParser.setHandlerFallback(e)}
    method registerOscHandler (line 1) | registerOscHandler(e,t){return this._oscParser.registerHandler(e,t)}
    method clearOscHandler (line 1) | clearOscHandler(e){this._oscParser.clearHandler(e)}
    method setOscHandlerFallback (line 1) | setOscHandlerFallback(e){this._oscParser.setHandlerFallback(e)}
    method setErrorHandler (line 1) | setErrorHandler(e){this._errorHandler=e}
    method clearErrorHandler (line 1) | clearErrorHandler(){this._errorHandler=this._errorHandlerFb}
    method reset (line 1) | reset(){this.currentState=this.initialState,this._oscParser.reset(),th...
    method _preserveStack (line 1) | _preserveStack(e,t,i,s,r){this._parseStack.state=e,this._parseStack.ha...
    method parse (line 1) | parse(e,t,i){let s,r=0,n=0,o=0;if(this._parseStack.state)if(2===this._...
    method decorations (line 1) | get decorations(){return this._decorations.values()}
    method constructor (line 1) | constructor(){super(),this._decorations=new o.SortedList((e=>e?.marker...
    method registerDecoration (line 1) | registerDecoration(e){if(e.marker.isDisposed)return;const t=new l(e);i...
    method reset (line 1) | reset(){for(const e of this._decorations.values())e.dispose();this._de...
    method getDecorationsAtCell (line 1) | *getDecorationsAtCell(e,t,i){let s=0,r=0;for(const n of this._decorati...
    method forEachDecorationAtCell (line 1) | forEachDecorationAtCell(e,t,i,s){this._decorations.forEachByKey(t,(t=>...
  method constructor (line 1) | constructor(e,t,i,s,r,a,l,d,f,g,m,S,w){super(),this._terminal=e,this._do...
  method _updateDimensions (line 1) | _updateDimensions(){const e=this._coreBrowserService.dpr;this.dimensions...
  method _injectCss (line 1) | _injectCss(e){this._themeStyleElement||(this._themeStyleElement=this._do...
  method _setDefaultSpacing (line 1) | _setDefaultSpacing(){const e=this.dimensions.css.cell.width-this._widthC...
  method handleDevicePixelRatioChange (line 1) | handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache...
  method _refreshRowElements (line 1) | _refreshRowElements(e,t){for(let e=this._rowElements.length;e<=t;e++){co...
  method handleResize (line 1) | handleResize(e,t){this._refreshRowElements(e,t),this._updateDimensions()...
  method handleCharSizeChanged (line 1) | handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(...
  method handleBlur (line 1) | handleBlur(){this._rowContainer.classList.remove(S),this.renderRows(0,th...
  method handleFocus (line 1) | handleFocus(){this._rowContainer.classList.add(S),this.renderRows(this._...
  method handleSelectionChanged (line 1) | handleSelectionChanged(e,t,i){if(this._selectionContainer.replaceChildre...
  method _createSelectionElement (line 1) | _createSelectionElement(e,t,i,s=1){const r=this._document.createElement(...
  method handleCursorMove (line 1) | handleCursorMove(){}
  method _handleOptionsChanged (line 1) | _handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._t...
  method clear (line 1) | clear(){for(const e of this._rowElements)e.replaceChildren()}
  method renderRows (line 1) | renderRows(e,t){const i=this._bufferService.buffer,s=i.ybase+i.y,r=Math....
  method _terminalSelector (line 1) | get _terminalSelector(){return`.${v}${this._terminalClass}`}
  method _handleLinkHover (line 1) | _handleLinkHover(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!0)}
  method _handleLinkLeave (line 1) | _handleLinkLeave(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!1)}
  method _setCellUnderline (line 1) | _setCellUnderline(e,t,i,s,r,n){i<0&&(e=0),s<0&&(t=0);const o=this._buffe...
  method constructor (line 1) | constructor(e,t,i,s,r,n,o){this._document=e,this._characterJoinerService...
  method handleSelectionChanged (line 1) | handleSelectionChanged(e,t,i){this._selectionStart=e,this._selectionEnd=...
  method createRow (line 1) | createRow(e,t,i,s,r,a,h,l,_,f,p){const g=[],m=this._characterJoinerServi...
  method _applyMinimumContrast (line 1) | _applyMinimumContrast(e,t,i,s,r,n){if(1===this._optionsService.rawOption...
  method _getContrastCache (line 1) | _getContrastCache(e){return e.isDim()?this._themeService.colors.halfCont...
  method _addStyle (line 1) | _addStyle(e,t){e.setAttribute("style",`${e.getAttribute("style")||""}${t...
  method _isCellInSelection (line 1) | _isCellInSelection(e,t){const i=this._selectionStart,s=this._selectionEn...
  function v (line 1) | function v(e,t,i){for(;e.length<i;)e=t+e;return e}
  method constructor (line 1) | constructor(e,t){this._flat=new Float32Array(256),this._font="",this._fo...
  method dispose (line 1) | dispose(){this._container.remove(),this._measureElements.length=0,this._...
  method clear (line 1) | clear(){this._flat.fill(-9999),this._holey=new Map}
  method setFont (line 1) | setFont(e,t,i,s){e===this._font&&t===this._fontSize&&i===this._weight&&s...
  method get (line 1) | get(e,t,i){let s=0;if(!t&&!i&&1===e.length&&(s=e.charCodeAt(0))<256){if(...
  method _measure (line 1) | _measure(e,t){const i=this._measureElements[t];return i.textContent=e.re...
  function i (line 1) | function i(e){return 57508<=e&&e<=57558}
    method constructor (line 1) | constructor(){this.clear()}
    method clear (line 1) | clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportSta...
    method update (line 1) | update(e,t,i,s=!1){if(this.selectionStart=t,this.selectionEnd=i,!t||!i...
    method isCellSelected (line 1) | isCellSelected(e,t,i){return!!this.hasSelection&&(i-=e.buffer.active.v...
    method constructor (line 1) | constructor(){this._data={}}
    method set (line 1) | set(e,t,i){this._data[e]||(this._data[e]={}),this._data[e][t]=i}
    method get (line 1) | get(e,t){return this._data[e]?this._data[e][t]:void 0}
    method clear (line 1) | clear(){this._data={}}
    method constructor (line 1) | constructor(){this.fg=0,this.bg=0,this.extended=new s}
    method toColorRGB (line 1) | static toColorRGB(e){return[e>>>16&255,e>>>8&255,255&e]}
    method fromColorRGB (line 1) | static fromColorRGB(e){return(255&e[0])<<16|(255&e[1])<<8|255&e[2]}
    method clone (line 1) | clone(){const e=new i;return e.fg=this.fg,e.bg=this.bg,e.extended=this...
    method isInverse (line 1) | isInverse(){return 67108864&this.fg}
    method isBold (line 1) | isBold(){return 134217728&this.fg}
    method isUnderline (line 1) | isUnderline(){return this.hasExtendedAttrs()&&0!==this.extended.underl...
    method isBlink (line 1) | isBlink(){return 536870912&this.fg}
    method isInvisible (line 1) | isInvisible(){return 1073741824&this.fg}
    method isItalic (line 1) | isItalic(){return 67108864&this.bg}
    method isDim (line 1) | isDim(){return 134217728&this.bg}
    method isStrikethrough (line 1) | isStrikethrough(){return 2147483648&this.fg}
    method isProtected (line 1) | isProtected(){return 536870912&this.bg}
    method isOverline (line 1) | isOverline(){return 1073741824&this.bg}
    method getFgColorMode (line 1) | getFgColorMode(){return 50331648&this.fg}
    method getBgColorMode (line 1) | getBgColorMode(){return 50331648&this.bg}
    method isFgRGB (line 1) | isFgRGB(){return 50331648==(50331648&this.fg)}
    method isBgRGB (line 1) | isBgRGB(){return 50331648==(50331648&this.bg)}
    method isFgPalette (line 1) | isFgPalette(){return 16777216==(50331648&this.fg)||33554432==(50331648...
    method isBgPalette (line 1) | isBgPalette(){return 16777216==(50331648&this.bg)||33554432==(50331648...
    method isFgDefault (line 1) | isFgDefault(){return 0==(50331648&this.fg)}
    method isBgDefault (line 1) | isBgDefault(){return 0==(50331648&this.bg)}
    method isAttributeDefault (line 1) | isAttributeDefault(){return 0===this.fg&&0===this.bg}
    method getFgColor (line 1) | getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:retu...
    method getBgColor (line 1) | getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:retu...
    method hasExtendedAttrs (line 1) | hasExtendedAttrs(){return 268435456&this.bg}
    method updateExtended (line 1) | updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=...
    method getUnderlineColor (line 1) | getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColo...
    method getUnderlineColorMode (line 1) | getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.under...
    method isUnderlineColorRGB (line 1) | isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underli...
    method isUnderlineColorPalette (line 1) | isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.und...
    method isUnderlineColorDefault (line 1) | isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.und...
    method getUnderlineStyle (line 1) | getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.ex...
    method getUnderlineVariantOffset (line 1) | getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}
  function s (line 1) | function s(e){return e>=128512&&e<=128591||e>=127744&&e<=128511||e>=1286...
    method ext (line 1) | get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<...
    method ext (line 1) | set ext(e){this._ext=e}
    method underlineStyle (line 1) | get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}
    method underlineStyle (line 1) | set underlineStyle(e){this._ext&=-469762049,this._ext|=e<<26&469762048}
    method underlineColor (line 1) | get underlineColor(){return 67108863&this._ext}
    method underlineColor (line 1) | set underlineColor(e){this._ext&=-67108864,this._ext|=67108863&e}
    method urlId (line 1) | get urlId(){return this._urlId}
    method urlId (line 1) | set urlId(e){this._urlId=e}
    method underlineVariantOffset (line 1) | get underlineVariantOffset(){const e=(3758096384&this._ext)>>29;return...
    method underlineVariantOffset (line 1) | set underlineVariantOffset(e){this._ext&=536870911,this._ext|=e<<29&37...
    method constructor (line 1) | constructor(e=0,t=0){this._ext=0,this._urlId=0,this._ext=e,this._urlId=t}
    method clone (line 1) | clone(){return new s(this._ext,this._urlId)}
    method isEmpty (line 1) | isEmpty(){return 0===this.underlineStyle&&0===this._urlId}
    method fromArray (line 1) | static fromArray(e){const t=new s;if(!e.length)return t;for(let i=Arra...
    method constructor (line 1) | constructor(e=32,t=32){if(this.maxLength=e,this.maxSubParamsLength=t,t...
    method clone (line 1) | clone(){const e=new s(this.maxLength,this.maxSubParamsLength);return e...
    method toArray (line 1) | toArray(){const e=[];for(let t=0;t<this.length;++t){e.push(this.params...
    method reset (line 1) | reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,th...
    method addParam (line 1) | addParam(e){if(this._digitIsSub=!1,this.length>=this.maxLength)this._r...
    method addSubParam (line 1) | addSubParam(e){if(this._digitIsSub=!0,this.length)if(this._rejectDigit...
    method hasSubParams (line 1) | hasSubParams(e){return(255&this._subParamsIdx[e])-(this._subParamsIdx[...
    method getSubParams (line 1) | getSubParams(e){const t=this._subParamsIdx[e]>>8,i=255&this._subParams...
    method getSubParamsAll (line 1) | getSubParamsAll(){const e={};for(let t=0;t<this.length;++t){const i=th...
    method addDigit (line 1) | addDigit(e){let t;if(this._rejectDigits||!(t=this._digitIsSub?this._su...
  class i (line 1) | class i{constructor(){this.clear()}clear(){this.hasSelection=!1,this.col...
    method constructor (line 1) | constructor(){this.clear()}
    method clear (line 1) | clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportSta...
    method update (line 1) | update(e,t,i,s=!1){if(this.selectionStart=t,this.selectionEnd=i,!t||!i...
    method isCellSelected (line 1) | isCellSelected(e,t,i){return!!this.hasSelection&&(i-=e.buffer.active.v...
    method constructor (line 1) | constructor(){this._data={}}
    method set (line 1) | set(e,t,i){this._data[e]||(this._data[e]={}),this._data[e][t]=i}
    method get (line 1) | get(e,t){return this._data[e]?this._data[e][t]:void 0}
    method clear (line 1) | clear(){this._data={}}
    method constructor (line 1) | constructor(){this.fg=0,this.bg=0,this.extended=new s}
    method toColorRGB (line 1) | static toColorRGB(e){return[e>>>16&255,e>>>8&255,255&e]}
    method fromColorRGB (line 1) | static fromColorRGB(e){return(255&e[0])<<16|(255&e[1])<<8|255&e[2]}
    method clone (line 1) | clone(){const e=new i;return e.fg=this.fg,e.bg=this.bg,e.extended=this...
    method isInverse (line 1) | isInverse(){return 67108864&this.fg}
    method isBold (line 1) | isBold(){return 134217728&this.fg}
    method isUnderline (line 1) | isUnderline(){return this.hasExtendedAttrs()&&0!==this.extended.underl...
    method isBlink (line 1) | isBlink(){return 536870912&this.fg}
    method isInvisible (line 1) | isInvisible(){return 1073741824&this.fg}
    method isItalic (line 1) | isItalic(){return 67108864&this.bg}
    method isDim (line 1) | isDim(){return 134217728&this.bg}
    method isStrikethrough (line 1) | isStrikethrough(){return 2147483648&this.fg}
    method isProtected (line 1) | isProtected(){return 536870912&this.bg}
    method isOverline (line 1) | isOverline(){return 1073741824&this.bg}
    method getFgColorMode (line 1) | getFgColorMode(){return 50331648&this.fg}
    method getBgColorMode (line 1) | getBgColorMode(){return 50331648&this.bg}
    method isFgRGB (line 1) | isFgRGB(){return 50331648==(50331648&this.fg)}
    method isBgRGB (line 1) | isBgRGB(){return 50331648==(50331648&this.bg)}
    method isFgPalette (line 1) | isFgPalette(){return 16777216==(50331648&this.fg)||33554432==(50331648...
    method isBgPalette (line 1) | isBgPalette(){return 16777216==(50331648&this.bg)||33554432==(50331648...
    method isFgDefault (line 1) | isFgDefault(){return 0==(50331648&this.fg)}
    method isBgDefault (line 1) | isBgDefault(){return 0==(50331648&this.bg)}
    method isAttributeDefault (line 1) | isAttributeDefault(){return 0===this.fg&&0===this.bg}
    method getFgColor (line 1) | getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:retu...
    method getBgColor (line 1) | getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:retu...
    method hasExtendedAttrs (line 1) | hasExtendedAttrs(){return 268435456&this.bg}
    method updateExtended (line 1) | updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=...
    method getUnderlineColor (line 1) | getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColo...
    method getUnderlineColorMode (line 1) | getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.under...
    method isUnderlineColorRGB (line 1) | isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underli...
    method isUnderlineColorPalette (line 1) | isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.und...
    method isUnderlineColorDefault (line 1) | isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.und...
    method getUnderlineStyle (line 1) | getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.ex...
    method getUnderlineVariantOffset (line 1) | getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}
  method constructor (line 1) | constructor(e){this._bufferService=e,this.isSelectAllActive=!1,this.sele...
  method clearSelection (line 1) | clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,thi...
  method finalSelectionStart (line 1) | get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selec...
  method finalSelectionEnd (line 1) | get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferSer...
  method areSelectionValuesReversed (line 1) | areSelectionValuesReversed(){const e=this.selectionStart,t=this.selectio...
  method handleTrim (line 1) | handleTrim(e){return this.selectionStart&&(this.selectionStart[1]-=e),th...
  method hasValidSize (line 1) | get hasValidSize(){return this.width>0&&this.height>0}
  method constructor (line 1) | constructor(e,t,i){super(),this._optionsService=i,this.width=0,this.heig...
  method measure (line 1) | measure(){const e=this._measureStrategy.measure();e.width===this.width&&...
  class c (line 1) | class c extends a.Disposable{constructor(){super(...arguments),this._res...
    method constructor (line 1) | constructor(){super(...arguments),this._result={width:0,height:0}}
    method _validateAndSet (line 1) | _validateAndSet(e,t){void 0!==e&&e>0&&void 0!==t&&t>0&&(this._result.w...
    method constructor (line 1) | constructor(e,t,i){super(),this.content=0,this.combinedData="",this.fg...
    method isCombined (line 1) | isCombined(){return 2097152}
    method getWidth (line 1) | getWidth(){return this._width}
    method getChars (line 1) | getChars(){return this.combinedData}
    method getCode (line 1) | getCode(){return 2097151}
    method setFromCharData (line 1) | setFromCharData(e){throw new Error("not implemented")}
    method getAsCharData (line 1) | getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.ge...
    method constructor (line 1) | constructor(e=t.VT500_TRANSITION_TABLE){super(),this._transitions=e,th...
    method _identifier (line 1) | _identifier(e,t=[64,126]){let i=0;if(e.prefix){if(e.prefix.length>1)th...
    method identToString (line 1) | identToString(e){const t=[];for(;e;)t.push(String.fromCharCode(255&e))...
    method setPrintHandler (line 1) | setPrintHandler(e){this._printHandler=e}
    method clearPrintHandler (line 1) | clearPrintHandler(){this._printHandler=this._printHandlerFb}
    method registerEscHandler (line 1) | registerEscHandler(e,t){const i=this._identifier(e,[48,126]);void 0===...
    method clearEscHandler (line 1) | clearEscHandler(e){this._escHandlers[this._identifier(e,[48,126])]&&de...
    method setEscHandlerFallback (line 1) | setEscHandlerFallback(e){this._escHandlerFb=e}
    method setExecuteHandler (line 1) | setExecuteHandler(e,t){this._executeHandlers[e.charCodeAt(0)]=t}
    method clearExecuteHandler (line 1) | clearExecuteHandler(e){this._executeHandlers[e.charCodeAt(0)]&&delete ...
    method setExecuteHandlerFallback (line 1) | setExecuteHandlerFallback(e){this._executeHandlerFb=e}
    method registerCsiHandler (line 1) | registerCsiHandler(e,t){const i=this._identifier(e);void 0===this._csi...
    method clearCsiHandler (line 1) | clearCsiHandler(e){this._csiHandlers[this._identifier(e)]&&delete this...
    method setCsiHandlerFallback (line 1) | setCsiHandlerFallback(e){this._csiHandlerFb=e}
    method registerDcsHandler (line 1) | registerDcsHandler(e,t){return this._dcsParser.registerHandler(this._i...
    method clearDcsHandler (line 1) | clearDcsHandler(e){this._dcsParser.clearHandler(this._identifier(e))}
    method setDcsHandlerFallback (line 1) | setDcsHandlerFallback(e){this._dcsParser.setHandlerFallback(e)}
    method registerOscHandler (line 1) | registerOscHandler(e,t){return this._oscParser.registerHandler(e,t)}
    method clearOscHandler (line 1) | clearOscHandler(e){this._oscParser.clearHandler(e)}
    method setOscHandlerFallback (line 1) | setOscHandlerFallback(e){this._oscParser.setHandlerFallback(e)}
    method setErrorHandler (line 1) | setErrorHandler(e){this._errorHandler=e}
    method clearErrorHandler (line 1) | clearErrorHandler(){this._errorHandler=this._errorHandlerFb}
    method reset (line 1) | reset(){this.currentState=this.initialState,this._oscParser.reset(),th...
    method _preserveStack (line 1) | _preserveStack(e,t,i,s,r){this._parseStack.state=e,this._parseStack.ha...
    method parse (line 1) | parse(e,t,i){let s,r=0,n=0,o=0;if(this._parseStack.state)if(2===this._...
    method decorations (line 1) | get decorations(){return this._decorations.values()}
    method constructor (line 1) | constructor(){super(),this._decorations=new o.SortedList((e=>e?.marker...
    method registerDecoration (line 1) | registerDecoration(e){if(e.marker.isDisposed)return;const t=new l(e);i...
    method reset (line 1) | reset(){for(const e of this._decorations.values())e.dispose();this._de...
    method getDecorationsAtCell (line 1) | *getDecorationsAtCell(e,t,i){let s=0,r=0;for(const n of this._decorati...
    method forEachDecorationAtCell (line 1) | forEachDecorationAtCell(e,t,i,s){this._decorations.forEachByKey(t,(t=>...
  class l (line 1) | class l extends c{constructor(e,t,i){super(),this._document=e,this._pare...
    method constructor (line 1) | constructor(e,t,i){super(),this._document=e,this._parentElement=t,this...
    method measure (line 1) | measure(){return this._measureElement.style.fontFamily=this._optionsSe...
    method isDisposed (line 1) | get isDisposed(){return this._isDisposed}
    method backgroundColorRGB (line 1) | get backgroundColorRGB(){return null===this._cachedBg&&(this.options.b...
    method foregroundColorRGB (line 1) | get foregroundColorRGB(){return null===this._cachedFg&&(this.options.f...
    method constructor (line 1) | constructor(e){super(),this.options=e,this.onRenderEmitter=this.regist...
    method dispose (line 1) | dispose(){this._onDispose.fire(),super.dispose()}
  class d (line 1) | class d extends c{constructor(e){super(),this._optionsService=e,this._ca...
    method constructor (line 1) | constructor(e){super(),this._optionsService=e,this._canvas=new Offscre...
    method measure (line 1) | measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}p...
    method constructor (line 1) | constructor(e){super(),this._core=this.register(new r.Terminal(e)),thi...
    method _checkReadonlyOptions (line 1) | _checkReadonlyOptions(e){if(l.includes(e))throw new Error(`Option "${e...
    method _checkProposedApi (line 1) | _checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProp...
    method onBell (line 1) | get onBell(){return this._core.onBell}
    method onBinary (line 1) | get onBinary(){return this._core.onBinary}
    method onCursorMove (line 1) | get onCursorMove(){return this._core.onCursorMove}
    method onData (line 1) | get onData(){return this._core.onData}
    method onKey (line 1) | get onKey(){return this._core.onKey}
    method onLineFeed (line 1) | get onLineFeed(){return this._core.onLineFeed}
    method onRender (line 1) | get onRender(){return this._core.onRender}
    method onResize (line 1) | get onResize(){return this._core.onResize}
    method onScroll (line 1) | get onScroll(){return this._core.onScroll}
    method onSelectionChange (line 1) | get onSelectionChange(){return this._core.onSelectionChange}
    method onTitleChange (line 1) | get onTitleChange(){return this._core.onTitleChange}
    method onWriteParsed (line 1) | get onWriteParsed(){return this._core.onWriteParsed}
    method element (line 1) | get element(){return this._core.element}
    method parser (line 1) | get parser(){return this._parser||(this._parser=new h.ParserApi(this._...
    method unicode (line 1) | get unicode(){return this._checkProposedApi(),new c.UnicodeApi(this._c...
    method textarea (line 1) | get textarea(){return this._core.textarea}
    method rows (line 1) | get rows(){return this._core.rows}
    method cols (line 1) | get cols(){return this._core.cols}
    method buffer (line 1) | get buffer(){return this._buffer||(this._buffer=this.register(new a.Bu...
    method markers (line 1) | get markers(){return this._checkProposedApi(),this._core.markers}
    method modes (line 1) | get modes(){const e=this._core.coreService.decPrivateModes;let t="none...
    method options (line 1) | get options(){return this._publicOptions}
    method options (line 1) | set options(e){for(const t in e)this._publicOptions[t]=e[t]}
    method blur (line 1) | blur(){this._core.blur()}
    method focus (line 1) | focus(){this._core.focus()}
    method input (line 1) | input(e,t=!0){this._core.input(e,t)}
    method resize (line 1) | resize(e,t){this._verifyIntegers(e,t),this._core.resize(e,t)}
    method open (line 1) | open(e){this._core.open(e)}
    method attachCustomKeyEventHandler (line 1) | attachCustomKeyEventHandler(e){this._core.attachCustomKeyEventHandler(e)}
    method attachCustomWheelEventHandler (line 1) | attachCustomWheelEventHandler(e){this._core.attachCustomWheelEventHand...
    method registerLinkProvider (line 1) | registerLinkProvider(e){return this._core.registerLinkProvider(e)}
    method registerCharacterJoiner (line 1) | registerCharacterJoiner(e){return this._checkProposedApi(),this._core....
    method deregisterCharacterJoiner (line 1) | deregisterCharacterJoiner(e){this._checkProposedApi(),this._core.dereg...
    method registerMarker (line 1) | registerMarker(e=0){return this._verifyIntegers(e),this._core.register...
    method registerDecoration (line 1) | registerDecoration(e){return this._checkProposedApi(),this._verifyPosi...
    method hasSelection (line 1) | hasSelection(){return this._core.hasSelection()}
    method select (line 1) | select(e,t,i){this._verifyIntegers(e,t,i),this._core.select(e,t,i)}
    method getSelection (line 1) | getSelection(){return this._core.getSelection()}
    method getSelectionPosition (line 1) | getSelectionPosition(){return this._core.getSelectionPosition()}
    method clearSelection (line 1) | clearSelection(){this._core.clearSelection()}
    method selectAll (line 1) | selectAll(){this._core.selectAll()}
    method selectLines (line 1) | selectLines(e,t){this._verifyIntegers(e,t),this._core.selectLines(e,t)}
    method dispose (line 1) | dispose(){super.dispose()}
    method scrollLines (line 1) | scrollLines(e){this._verifyIntegers(e),this._core.scrollLines(e)}
    method scrollPages (line 1) | scrollPages(e){this._verifyIntegers(e),this._core.scrollPages(e)}
    method scrollToTop (line 1) | scrollToTop(){this._core.scrollToTop()}
    method scrollToBottom (line 1) | scrollToBottom(){this._core.scrollToBottom()}
    method scrollToLine (line 1) | scrollToLine(e){this._verifyIntegers(e),this._core.scrollToLine(e)}
    method clear (line 1) | clear(){this._core.clear()}
    method write (line 1) | write(e,t){this._core.write(e,t)}
    method writeln (line 1) | writeln(e,t){this._core.write(e),this._core.write("\r\n",t)}
    method paste (line 1) | paste(e){this._core.paste(e)}
    method refresh (line 1) | refresh(e,t){this._verifyIntegers(e,t),this._core.refresh(e,t)}
    method reset (line 1) | reset(){this._core.reset()}
    method clearTextureAtlas (line 1) | clearTextureAtlas(){this._core.clearTextureAtlas()}
    method loadAddon (line 1) | loadAddon(e){this._addonManager.loadAddon(this,e)}
    method strings (line 1) | static get strings(){return t}
    method _verifyIntegers (line 1) | _verifyIntegers(...e){for(const t of e)if(t===1/0||isNaN(t)||t%1!=0)th...
    method _verifyPositiveIntegers (line 1) | _verifyPositiveIntegers(...e){for(const t of e)if(t&&(t===1/0||isNaN(t...
  class c (line 1) | class c extends n.AttributeData{constructor(e,t,i){super(),this.content=...
    method constructor (line 1) | constructor(){super(...arguments),this._result={width:0,height:0}}
    method _validateAndSet (line 1) | _validateAndSet(e,t){void 0!==e&&e>0&&void 0!==t&&t>0&&(this._result.w...
    method constructor (line 1) | constructor(e,t,i){super(),this.content=0,this.combinedData="",this.fg...
    method isCombined (line 1) | isCombined(){return 2097152}
    method getWidth (line 1) | getWidth(){return this._width}
    method getChars (line 1) | getChars(){return this.combinedData}
    method getCode (line 1) | getCode(){return 2097151}
    method setFromCharData (line 1) | setFromCharData(e){throw new Error("not implemented")}
    method getAsCharData (line 1) | getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.ge...
    method constructor (line 1) | constructor(e=t.VT500_TRANSITION_TABLE){super(),this._transitions=e,th...
    method _identifier (line 1) | _identifier(e,t=[64,126]){let i=0;if(e.prefix){if(e.prefix.length>1)th...
    method identToString (line 1) | identToString(e){const t=[];for(;e;)t.push(String.fromCharCode(255&e))...
    method setPrintHandler (line 1) | setPrintHandler(e){this._printHandler=e}
    method clearPrintHandler (line 1) | clearPrintHandler(){this._printHandler=this._printHandlerFb}
    method registerEscHandler (line 1) | registerEscHandler(e,t){const i=this._identifier(e,[48,126]);void 0===...
    method clearEscHandler (line 1) | clearEscHandler(e){this._escHandlers[this._identifier(e,[48,126])]&&de...
    method setEscHandlerFallback (line 1) | setEscHandlerFallback(e){this._escHandlerFb=e}
    method setExecuteHandler (line 1) | setExecuteHandler(e,t){this._executeHandlers[e.charCodeAt(0)]=t}
    method clearExecuteHandler (line 1) | clearExecuteHandler(e){this._executeHandlers[e.charCodeAt(0)]&&delete ...
    method setExecuteHandlerFallback (line 1) | setExecuteHandlerFallback(e){this._executeHandlerFb=e}
    method registerCsiHandler (line 1) | registerCsiHandler(e,t){const i=this._identifier(e);void 0===this._csi...
    method clearCsiHandler (line 1) | clearCsiHandler(e){this._csiHandlers[this._identifier(e)]&&delete this...
    method setCsiHandlerFallback (line 1) | setCsiHandlerFallback(e){this._csiHandlerFb=e}
    method registerDcsHandler (line 1) | registerDcsHandler(e,t){return this._dcsParser.registerHandler(this._i...
    method clearDcsHandler (line 1) | clearDcsHandler(e){this._dcsParser.clearHandler(this._identifier(e))}
    method setDcsHandlerFallback (line 1) | setDcsHandlerFallback(e){this._dcsParser.setHandlerFallback(e)}
    method registerOscHandler (line 1) | registerOscHandler(e,t){return this._oscParser.registerHandler(e,t)}
    method clearOscHandler (line 1) | clearOscHandler(e){this._oscParser.clearHandler(e)}
    method setOscHandlerFallback (line 1) | setOscHandlerFallback(e){this._oscParser.setHandlerFallback(e)}
    method setErrorHandler (line 1) | setErrorHandler(e){this._errorHandler=e}
    method clearErrorHandler (line 1) | clearErrorHandler(){this._errorHandler=this._errorHandlerFb}
    method reset (line 1) | reset(){this.currentState=this.initialState,this._oscParser.reset(),th...
    method _preserveStack (line 1) | _preserveStack(e,t,i,s,r){this._parseStack.state=e,this._parseStack.ha...
    method parse (line 1) | parse(e,t,i){let s,r=0,n=0,o=0;if(this._parseStack.state)if(2===this._...
    method decorations (line 1) | get decorations(){return this._decorations.values()}
    method constructor (line 1) | constructor(){super(),this._decorations=new o.SortedList((e=>e?.marker...
    method registerDecoration (line 1) | registerDecoration(e){if(e.marker.isDisposed)return;const t=new l(e);i...
    method reset (line 1) | reset(){for(const e of this._decorations.values())e.dispose();this._de...
    method getDecorationsAtCell (line 1) | *getDecorationsAtCell(e,t,i){let s=0,r=0;for(const n of this._decorati...
    method forEachDecorationAtCell (line 1) | forEachDecorationAtCell(e,t,i,s){this._decorations.forEachByKey(t,(t=>...
  method constructor (line 1) | constructor(e){this._bufferService=e,this._characterJoiners=[],this._nex...
  method register (line 1) | register(e){const t={id:this._nextCharacterJoinerId++,handler:e};return ...
  method deregister (line 1) | deregister(e){for(let t=0;t<this._characterJoiners.length;t++)if(this._c...
  method getJoinedCharacters (line 1) | getJoinedCharacters(e){if(0===this._characterJoiners.length)return[];con...
  method _getJoinedRanges (line 1) | _getJoinedRanges(t,i,s,r,n){const o=t.substring(i,s);let a=[];try{a=this...
  method _stringRangesToCellRanges (line 1) | _stringRangesToCellRanges(e,t,i){let s=0,r=!1,n=0,a=e[s];if(a){for(let h...
  method _mergeRanges (line 1) | static _mergeRanges(e,t){let i=!1;for(let s=0;s<e.length;s++){const r=e[...
  class o (line 1) | class o extends s.Disposable{constructor(e,t,i){super(),this._textarea=e...
    method constructor (line 1) | constructor(e,t,i){super(),this._textarea=e,this._window=t,this.mainDo...
    method window (line 1) | get window(){return this._window}
    method window (line 1) | set window(e){this._window!==e&&(this._window=e,this._onWindowChange.f...
    method dpr (line 1) | get dpr(){return this.window.devicePixelRatio}
    method isFocused (line 1) | get isFocused(){return void 0===this._cachedIsFocused&&(this._cachedIs...
    method constructor (line 1) | constructor(e,t){super(),this._optionsService=e,this._bufferService=t,...
    method reset (line 1) | reset(){this._normal=new n.Buffer(!0,this._optionsService,this._buffer...
    method alt (line 1) | get alt(){return this._alt}
    method active (line 1) | get active(){return this._activeBuffer}
    method normal (line 1) | get normal(){return this._normal}
    method activateNormalBuffer (line 1) | activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._norma...
    method activateAltBuffer (line 1) | activateAltBuffer(e){this._activeBuffer!==this._alt&&(this._alt.fillVi...
    method resize (line 1) | resize(e,t){this._normal.resize(e,t),this._alt.resize(e,t),this.setupT...
    method setupTabStops (line 1) | setupTabStops(e){this._normal.setupTabStops(e),this._alt.setupTabStops...
    method constructor (line 1) | constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,t...
    method fromCharData (line 1) | static fromCharData(e){const t=new o;return t.setFromCharData(e),t}
    method isCombined (line 1) | isCombined(){return 2097152&this.content}
    method getWidth (line 1) | getWidth(){return this.content>>22}
    method getChars (line 1) | getChars(){return 2097152&this.content?this.combinedData:2097151&this....
    method getCode (line 1) | getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.c...
    method setFromCharData (line 1) | setFromCharData(e){this.fg=e[r.CHAR_DATA_ATTR_INDEX],this.bg=0;let t=!...
    method getAsCharData (line 1) | getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.ge...
    method constructor (line 1) | constructor(e){super(),this._core=e,this._onBufferChange=this.register...
    method active (line 1) | get active(){if(this._core.buffers.active===this._core.buffers.normal)...
    method normal (line 1) | get normal(){return this._normal.init(this._core.buffers.normal)}
    method alternate (line 1) | get alternate(){return this._alternate.init(this._core.buffers.alt)}
  class a (line 1) | class a extends s.Disposable{constructor(e){super(),this._parentWindow=e...
    method constructor (line 1) | constructor(e){super(),this._parentWindow=e,this._windowResizeListener...
    method setWindow (line 1) | setWindow(e){this._parentWindow=e,this._setWindowResizeListener(),this...
    method _setWindowResizeListener (line 1) | _setWindowResizeListener(){this._windowResizeListener.value=(0,n.addDi...
    method _setDprAndFireIfDiffers (line 1) | _setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._...
    method _updateDpr (line 1) | _updateDpr(){this._outerListener&&(this._resolutionMediaMatchList?.rem...
    method clearListener (line 1) | clearListener(){this._resolutionMediaMatchList&&this._outerListener&&(...
    method constructor (line 1) | constructor(e){this.table=new Uint8Array(e)}
    method setDefault (line 1) | setDefault(e,t){this.table.fill(e<<4|t)}
    method add (line 1) | add(e,t,i,s){this.table[t<<8|e]=i<<4|s}
    method addMany (line 1) | addMany(e,t,i,s){for(let r=0;r<e.length;r++)this.table[t<<8|e[r]]=i<<4|s}
    method constructor (line 1) | constructor(e){super(),this._onOptionChange=this.register(new s.EventE...
    method onSpecificOptionChange (line 1) | onSpecificOptionChange(e,t){return this.onOptionChange((i=>{i===e&&t(t...
    method onMultipleOptionChange (line 1) | onMultipleOptionChange(e,t){return this.onOptionChange((i=>{-1!==e.ind...
    method _setupOptions (line 1) | _setupOptions(){const e=e=>{if(!(e in t.DEFAULT_OPTIONS))throw new Err...
    method _sanitizeAndValidateOption (line 1) | _sanitizeAndValidateOption(e,i){switch(e){case"cursorStyle":if(i||(i=t...
  class r (line 1) | class r extends s.Disposable{constructor(){super(),this.linkProviders=[]...
    method constructor (line 1) | constructor(){super(),this.linkProviders=[],this.register((0,s.toDispo...
    method registerLinkProvider (line 1) | registerLinkProvider(e){return this.linkProviders.push(e),{dispose:()=...
    method constructor (line 1) | constructor(){this._tasks=[],this._i=0}
    method enqueue (line 1) | enqueue(e){this._tasks.push(e),this._start()}
    method flush (line 1) | flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this....
    method clear (line 1) | clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),...
    method _start (line 1) | _start(){this._idleCallback||(this._idleCallback=this._requestCallback...
    method _process (line 1) | _process(e){this._idleCallback=void 0;let t=0,i=0,s=e.timeRemaining(),...
  method constructor (line 1) | constructor(e,t){this._renderService=e,this._charSizeService=t}
  method getCoords (line 1) | getCoords(e,t,i,s,r){return(0,o.getCoords)(window,e,t,i,s,this._charSize...
  method getMouseReportCoords (line 1) | getMouseReportCoords(e,t){const i=(0,o.getCoordsRelativeToElement)(windo...
  method dimensions (line 1) | get dimensions(){return this._renderer.value.dimensions}
  method constructor (line 1) | constructor(e,t,i,s,r,o,l,d){super(),this._rowCount=e,this._charSizeServ...
  method _registerIntersectionObserver (line 1) | _registerIntersectionObserver(e,t){if("IntersectionObserver"in e){const ...
  method _handleIntersectionChange (line 1) | _handleIntersectionChange(e){this._isPaused=void 0===e.isIntersecting?0=...
  method refreshRows (line 1) | refreshRows(e,t,i=!1){this._isPaused?this._needsFullRefresh=!0:(i||(this...
  method _renderRows (line 1) | _renderRows(e,t){this._renderer.value&&(e=Math.min(e,this._rowCount-1),t...
  method resize (line 1) | resize(e,t){this._rowCount=t,this._fireOnCanvasResize()}
  method _handleOptionsChanged (line 1) | _handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._...
  method _fireOnCanvasResize (line 1) | _fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimens...
  method hasRenderer (line 1) | hasRenderer(){return!!this._renderer.value}
  method setRenderer (line 1) | setRenderer(e){this._renderer.value=e,this._renderer.value&&(this._rende...
  method addRefreshCallback (line 1) | addRefreshCallback(e){return this._renderDebouncer.addRefreshCallback(e)}
  method _fullRefresh (line 1) | _fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows...
  method clearTextureAtlas (line 1) | clearTextureAtlas(){this._renderer.value&&(this._renderer.value.clearTex...
  method handleDevicePixelRatioChange (line 1) | handleDevicePixelRatioChange(){this._charSizeService.measure(),this._ren...
  method handleResize (line 1) | handleResize(e,t){this._renderer.value&&(this._isPaused?this._pausedResi...
  method handleCharSizeChanged (line 1) | handleCharSizeChanged(){this._renderer.value?.handleCharSizeChanged()}
  method handleBlur (line 1) | handleBlur(){this._renderer.value?.handleBlur()}
  method handleFocus (line 1) | handleFocus(){this._renderer.value?.handleFocus()}
  method handleSelectionChanged (line 1) | handleSelectionChanged(e,t,i){this._selectionState.start=e,this._selecti...
  method handleCursorMove (line 1) | handleCursorMove(){this._renderer.value?.handleCursorMove()}
  method clear (line 1) | clear(){this._renderer.value?.clear()}
  method constructor (line 1) | constructor(e,t,i,s,r,n,o,h,d){super(),this._element=e,this._screenEleme...
  method reset (line 1) | reset(){this.clearSelection()}
  method disable (line 1) | disable(){this.clearSelection(),this._enabled=!1}
  method enable (line 1) | enable(){this._enabled=!0}
  method selectionStart (line 1) | get selectionStart(){return this._model.finalSelectionStart}
  method selectionEnd (line 1) | get selectionEnd(){return this._model.finalSelectionEnd}
  method hasSelection (line 1) | get hasSelection(){const e=this._model.finalSelectionStart,t=this._model...
  method selectionText (line 1) | get selectionText(){const e=this._model.finalSelectionStart,t=this._mode...
  method clearSelection (line 1) | clearSelection(){this._model.clearSelection(),this._removeMouseDownListe...
  method refresh (line 1) | refresh(e){this._refreshAnimationFrame||(this._refreshAnimationFrame=thi...
  method _refresh (line 1) | _refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire...
  method _isClickInSelection (line 1) | _isClickInSelection(e){const t=this._getMouseBufferCoords(e),i=this._mod...
  method isCellInSelection (line 1) | isCellInSelection(e,t){const i=this._model.finalSelectionStart,s=this._m...
  method _areCoordsInSelection (line 1) | _areCoordsInSelection(e,t,i){return e[1]>t[1]&&e[1]<i[1]||t[1]===i[1]&&e...
  method _selectWordAtCursor (line 1) | _selectWordAtCursor(e,t){const i=this._linkifier.currentLink?.link?.rang...
  method selectAll (line 1) | selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSele...
  method selectLines (line 1) | selectLines(e,t){this._model.clearSelection(),e=Math.max(e,0),t=Math.min...
  method _handleTrim (line 1) | _handleTrim(e){this._model.handleTrim(e)&&this.refresh()}
  method _getMouseBufferCoords (line 1) | _getMouseBufferCoords(e){const t=this._mouseService.getCoords(e,this._sc...
  method _getMouseEventScrollAmount (line 1) | _getMouseEventScrollAmount(e){let t=(0,n.getCoordsRelativeToElement)(thi...
  method shouldForceSelection (line 1) | shouldForceSelection(e){return d.isMac?e.altKey&&this._optionsService.ra...
  method handleMouseDown (line 1) | handleMouseDown(e){if(this._mouseDownTimeStamp=e.timeStamp,(2!==e.button...
  method _addMouseDownListeners (line 1) | _addMouseDownListeners(){this._screenElement.ownerDocument&&(this._scree...
  method _removeMouseDownListeners (line 1) | _removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._sc...
  method _handleIncrementalClick (line 1) | _handleIncrementalClick(e){this._model.selectionStart&&(this._model.sele...
  method _handleSingleClick (line 1) | _handleSingleClick(e){if(this._model.selectionStartLength=0,this._model....
  method _handleDoubleClick (line 1) | _handleDoubleClick(e){this._selectWordAtCursor(e,!0)&&(this._activeSelec...
  method _handleTripleClick (line 1) | _handleTripleClick(e){const t=this._getMouseBufferCoords(e);t&&(this._ac...
  method shouldColumnSelect (line 1) | shouldColumnSelect(e){return e.altKey&&!(d.isMac&&this._optionsService.r...
  method _handleMouseMove (line 1) | _handleMouseMove(e){if(e.stopImmediatePropagation(),!this._model.selecti...
  method _dragScroll (line 1) | _dragScroll(){if(this._model.selectionEnd&&this._model.selectionStart&&t...
  method _handleMouseUp (line 1) | _handleMouseUp(e){const t=e.timeStamp-this._mouseDownTimeStamp;if(this._...
  method _fireEventIfSelectionChanged (line 1) | _fireEventIfSelectionChanged(){const e=this._model.finalSelectionStart,t...
  method _fireOnSelectionChange (line 1) | _fireOnSelectionChange(e,t,i){this._oldSelectionStart=e,this._oldSelecti...
  method _handleBufferActivate (line 1) | _handleBufferActivate(e){this.clearSelection(),this._trimListener.dispos...
  method _convertViewportColToCharacterIndex (line 1) | _convertViewportColToCharacterIndex(e,t){let i=t;for(let s=0;t>=s;s++){c...
  method setSelection (line 1) | setSelection(e,t,i){this._model.clearSelection(),this._removeMouseDownLi...
  method rightClickSelect (line 1) | rightClickSelect(e){this._isClickInSelection(e)||(this._selectWordAtCurs...
  method _getWordAt (line 1) | _getWordAt(e,t,i=!0,s=!0){if(e[0]>=this._bufferService.cols)return;const...
  method _selectWordAt (line 1) | _selectWordAt(e,t){const i=this._getWordAt(e,t);if(i){for(;i.start<0;)i....
  method _selectToWordAt (line 1) | _selectToWordAt(e){const t=this._getWordAt(e,!0);if(t){let i=e[1];for(;t...
  method _isCharWordSeparator (line 1) | _isCharWordSeparator(e){return 0!==e.getWidth()&&this._optionsService.ra...
  method _selectLineAt (line 1) | _selectLineAt(e){const t=this._bufferService.buffer.getWrappedRangeForLi...
  method colors (line 1) | get colors(){return this._colors}
  method constructor (line 1) | constructor(e){super(),this._optionsService=e,this._contrastCache=new n....
  method _setTheme (line 1) | _setTheme(e={}){const i=this._colors;if(i.foreground=p(e.foreground,l),i...
  method restoreColor (line 1) | restoreColor(e){this._restoreColor(e),this._onChangeColors.fire(this.col...
  method _restoreColor (line 1) | _restoreColor(e){if(void 0!==e)switch(e){case 256:this._colors.foregroun...
  method modifyColors (line 1) | modifyColors(e){e(this._colors),this._onChangeColors.fire(this.colors)}
  method _updateRestoreColors (line 1) | _updateRestoreColors(){this._restoreColors={foreground:this._colors.fore...
  function p (line 1) | function p(e,t){if(void 0!==e)try{return o.css.toColor(e)}catch{}return t}
  class n (line 1) | class n extends r.Disposable{constructor(e){super(),this._maxLength=e,th...
    method constructor (line 1) | constructor(e){super(),this._maxLength=e,this.onDeleteEmitter=this.reg...
    method maxLength (line 1) | get maxLength(){return this._maxLength}
    method maxLength (line 1) | set maxLength(e){if(this._maxLength===e)return;const t=new Array(e);fo...
    method length (line 1) | get length(){return this._length}
    method length (line 1) | set length(e){if(e>this._length)for(let t=this._length;t<e;t++)this._a...
    method get (line 1) | get(e){return this._array[this._getCyclicIndex(e)]}
    method set (line 1) | set(e,t){this._array[this._getCyclicIndex(e)]=t}
    method push (line 1) | push(e){this._array[this._getCyclicIndex(this._length)]=e,this._length...
    method recycle (line 1) | recycle(){if(this._length!==this._maxLength)throw new Error("Can only ...
    method isFull (line 1) | get isFull(){return this._length===this._maxLength}
    method pop (line 1) | pop(){return this._array[this._getCyclicIndex(this._length---1)]}
    method splice (line 1) | splice(e,t,...i){if(t){for(let i=e;i<this._length-t;i++)this._array[th...
    method trimStart (line 1) | trimStart(e){e>this._length&&(e=this._length),this._startIndex+=e,this...
    method shiftElements (line 1) | shiftElements(e,t,i){if(!(t<=0)){if(e<0||e>=this._length)throw new Err...
    method _getCyclicIndex (line 1) | _getCyclicIndex(e){return(this._startIndex+e)%this._maxLength}
    method _requestCallback (line 1) | _requestCallback(e){return setTimeout((()=>e(this._createDeadline(16))))}
    method _cancelCallback (line 1) | _cancelCallback(e){clearTimeout(e)}
    method _createDeadline (line 1) | _createDeadline(e){const t=Date.now()+e;return{timeRemaining:()=>Math....
    method id (line 1) | get id(){return this._id}
    method constructor (line 1) | constructor(e){this.line=e,this.isDisposed=!1,this._disposables=[],thi...
    method dispose (line 1) | dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDi...
    method register (line 1) | register(e){return this._disposables.push(e),e}
    method constructor (line 1) | constructor(e){super(),this._action=e,this._writeBuffer=[],this._callb...
    method handleUserInput (line 1) | handleUserInput(){this._didUserInput=!0}
    method writeSync (line 1) | writeSync(e,t){if(void 0!==t&&this._syncCalls>t)return void(this._sync...
    method write (line 1) | write(e,t){if(this._pendingData>5e7)throw new Error("write data discar...
    method _innerWrite (line 1) | _innerWrite(e=0,t=!0){const i=e||Date.now();for(;this._writeBuffer.len...
    method constructor (line 1) | constructor(...e){this._entries=new Map;for(const[t,i]of e)this.set(t,i)}
    method set (line 1) | set(e,t){const i=this._entries.get(e);return this._entries.set(e,t),i}
    method forEach (line 1) | forEach(e){for(const[t,i]of this._entries.entries())e(t,i)}
    method has (line 1) | has(e){return this._entries.has(e)}
    method get (line 1) | get(e){return this._entries.get(e)}
    method extractShouldJoin (line 1) | static extractShouldJoin(e){return 0!=(1&e)}
    method extractWidth (line 1) | static extractWidth(e){return e>>1&3}
    method extractCharKind (line 1) | static extractCharKind(e){return e>>3}
    method createPropertyValue (line 1) | static createPropertyValue(e,t,i=!1){return(16777215&e)<<3|(3&t)<<1|(i...
    method constructor (line 1) | constructor(){this._providers=Object.create(null),this._active="",this...
    method dispose (line 1) | dispose(){this._onChange.dispose()}
    method versions (line 1) | get versions(){return Object.keys(this._providers)}
    method activeVersion (line 1) | get activeVersion(){return this._active}
    method activeVersion (line 1) | set activeVersion(e){if(!this._providers[e])throw new Error(`unknown U...
    method register (line 1) | register(e){this._providers[e.version]=e}
    method wcwidth (line 1) | wcwidth(e){return this._activeProvider.wcwidth(e)}
    method getStringCellWidth (line 1) | getStringCellWidth(e){let t=0,i=0;const s=e.length;for(let r=0;r<s;++r...
    method charProperties (line 1) | charProperties(e,t){return this._activeProvider.charProperties(e,t)}
  function d (line 1) | function d(e){const t=e.toString(16);return t.length<2?"0"+t:t}
    method constructor (line 1) | constructor(e){super(),this._optionsService=e,this._canvas=new Offscre...
    method measure (line 1) | measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}p...
    method constructor (line 1) | constructor(e){super(),this._core=this.register(new r.Terminal(e)),thi...
    method _checkReadonlyOptions (line 1) | _checkReadonlyOptions(e){if(l.includes(e))throw new Error(`Option "${e...
    method _checkProposedApi (line 1) | _checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProp...
    method onBell (line 1) | get onBell(){return this._core.onBell}
    method onBinary (line 1) | get onBinary(){return this._core.onBinary}
    method onCursorMove (line 1) | get onCursorMove(){return this._core.onCursorMove}
    method onData (line 1) | get onData(){return this._core.onData}
    method onKey (line 1) | get onKey(){return this._core.onKey}
    method onLineFeed (line 1) | get onLineFeed(){return this._core.onLineFeed}
    method onRender (line 1) | get onRender(){return this._core.onRender}
    method onResize (line 1) | get onResize(){return this._core.onResize}
    method onScroll (line 1) | get onScroll(){return this._core.onScroll}
    method onSelectionChange (line 1) | get onSelectionChange(){return this._core.onSelectionChange}
    method onTitleChange (line 1) | get onTitleChange(){return this._core.onTitleChange}
    method onWriteParsed (line 1) | get onWriteParsed(){return this._core.onWriteParsed}
    method element (line 1) | get element(){return this._core.element}
    method parser (line 1) | get parser(){return this._parser||(this._parser=new h.ParserApi(this._...
    method unicode (line 1) | get unicode(){return this._checkProposedApi(),new c.UnicodeApi(this._c...
    method textarea (line 1) | get textarea(){return this._core.textarea}
    method rows (line 1) | get rows(){return this._core.rows}
    method cols (line 1) | get cols(){return this._core.cols}
    method buffer (line 1) | get buffer(){return this._buffer||(this._buffer=this.register(new a.Bu...
    method markers (line 1) | get markers(){return this._checkProposedApi(),this._core.markers}
    method modes (line 1) | get modes(){const e=this._core.coreService.decPrivateModes;let t="none...
    method options (line 1) | get options(){return this._publicOptions}
    method options (line 1) | set options(e){for(const t in e)this._publicOptions[t]=e[t]}
    method blur (line 1) | blur(){this._core.blur()}
    method focus (line 1) | focus(){this._core.focus()}
    method input (line 1) | input(e,t=!0){this._core.input(e,t)}
    method resize (line 1) | resize(e,t){this._verifyIntegers(e,t),this._core.resize(e,t)}
    method open (line 1) | open(e){this._core.open(e)}
    method attachCustomKeyEventHandler (line 1) | attachCustomKeyEventHandler(e){this._core.attachCustomKeyEventHandler(e)}
    method attachCustomWheelEventHandler (line 1) | attachCustomWheelEventHandler(e){this._core.attachCustomWheelEventHand...
    method registerLinkProvider (line 1) | registerLinkProvider(e){return this._core.registerLinkProvider(e)}
    method registerCharacterJoiner (line 1) | registerCharacterJoiner(e){return this._checkProposedApi(),this._core....
    method deregisterCharacterJoiner (line 1) | deregisterCharacterJoiner(e){this._checkProposedApi(),this._core.dereg...
    method registerMarker (line 1) | registerMarker(e=0){return this._verifyIntegers(e),this._core.register...
    method registerDecoration (line 1) | registerDecoration(e){return this._checkProposedApi(),this._verifyPosi...
    method hasSelection (line 1) | hasSelection(){return this._core.hasSelection()}
    method select (line 1) | select(e,t,i){this._verifyIntegers(e,t,i),this._core.select(e,t,i)}
    method getSelection (line 1) | getSelection(){return this._core.getSelection()}
    method getSelectionPosition (line 1) | getSelectionPosition(){return this._core.getSelectionPosition()}
    method clearSelection (line 1) | clearSelection(){this._core.clearSelection()}
    method selectAll (line 1) | selectAll(){this._core.selectAll()}
    method selectLines (line 1) | selectLines(e,t){this._verifyIntegers(e,t),this._core.selectLines(e,t)}
    method dispose (line 1) | dispose(){super.dispose()}
    method scrollLines (line 1) | scrollLines(e){this._verifyIntegers(e),this._core.scrollLines(e)}
    method scrollPages (line 1) | scrollPages(e){this._verifyIntegers(e),this._core.scrollPages(e)}
    method scrollToTop (line 1) | scrollToTop(){this._core.scrollToTop()}
    method scrollToBottom (line 1) | scrollToBottom(){this._core.scrollToBottom()}
    method scrollToLine (line 1) | scrollToLine(e){this._verifyIntegers(e),this._core.scrollToLine(e)}
    method clear (line 1) | clear(){this._core.clear()}
    method write (line 1) | write(e,t){this._core.write(e,t)}
    method writeln (line 1) | writeln(e,t){this._core.write(e),this._core.write("\r\n",t)}
    method paste (line 1) | paste(e){this._core.paste(e)}
    method refresh (line 1) | refresh(e,t){this._verifyIntegers(e,t),this._core.refresh(e,t)}
    method reset (line 1) | reset(){this._core.reset()}
    method clearTextureAtlas (line 1) | clearTextureAtlas(){this._core.clearTextureAtlas()}
    method loadAddon (line 1) | loadAddon(e){this._addonManager.loadAddon(this,e)}
    method strings (line 1) | static get strings(){return t}
    method _verifyIntegers (line 1) | _verifyIntegers(...e){for(const t of e)if(t===1/0||isNaN(t)||t%1!=0)th...
    method _verifyPositiveIntegers (line 1) | _verifyPositiveIntegers(...e){for(const t of e)if(t&&(t===1/0||isNaN(t...
  function _ (line 1) | function _(e,t){return e<t?(t+.05)/(e+.05):(e+.05)/(t+.05)}
  function t (line 1) | function t(e,t){return n=Math.round(255*t),[i,s,r]=l.toChannels(e.rgba),...
  function t (line 1) | function t(e,t,i){const s=e/255,r=t/255,n=i/255;return.2126*(s<=.03928?s...
  function t (line 1) | function t(e,t,i){const s=e>>24&255,r=e>>16&255,n=e>>8&255;let o=t>>24&2...
  function a (line 1) | function a(e,t,i){const s=e>>24&255,r=e>>16&255,n=e>>8&255;let o=t>>24&2...
    method constructor (line 1) | constructor(e){super(),this._parentWindow=e,this._windowResizeListener...
    method setWindow (line 1) | setWindow(e){this._parentWindow=e,this._setWindowResizeListener(),this...
    method _setWindowResizeListener (line 1) | _setWindowResizeListener(){this._windowResizeListener.value=(0,n.addDi...
    method _setDprAndFireIfDiffers (line 1) | _setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._...
    method _updateDpr (line 1) | _updateDpr(){this._outerListener&&(this._resolutionMediaMatchList?.rem...
    method clearListener (line 1) | clearListener(){this._resolutionMediaMatchList&&this._outerListener&&(...
    method constructor (line 1) | constructor(e){this.table=new Uint8Array(e)}
    method setDefault (line 1) | setDefault(e,t){this.table.fill(e<<4|t)}
    method add (line 1) | add(e,t,i,s){this.table[t<<8|e]=i<<4|s}
    method addMany (line 1) | addMany(e,t,i,s){for(let r=0;r<e.length;r++)this.table[t<<8|e[r]]=i<<4|s}
    method constructor (line 1) | constructor(e){super(),this._onOptionChange=this.register(new s.EventE...
    method onSpecificOptionChange (line 1) | onSpecificOptionChange(e,t){return this.onOptionChange((i=>{i===e&&t(t...
    method onMultipleOptionChange (line 1) | onMultipleOptionChange(e,t){return this.onOptionChange((i=>{-1!==e.ind...
    method _setupOptions (line 1) | _setupOptions(){const e=e=>{if(!(e in t.DEFAULT_OPTIONS))throw new Err...
    method _sanitizeAndValidateOption (line 1) | _sanitizeAndValidateOption(e,i){switch(e){case"cursorStyle":if(i||(i=t...
  class S (line 1) | class S extends s.Disposable{get onScroll(){return this._onScrollApi||(t...
    method onScroll (line 1) | get onScroll(){return this._onScrollApi||(this._onScrollApi=this.regis...
    method cols (line 1) | get cols(){return this._bufferService.cols}
    method rows (line 1) | get rows(){return this._bufferService.rows}
    method buffers (line 1) | get buffers(){return this._bufferService.buffers}
    method options (line 1) | get options(){return this.optionsService.options}
    method options (line 1) | set options(e){for(const t in e)this.optionsService.options[t]=e[t]}
    method constructor (line 1) | constructor(e){super(),this._windowsWrappingHeuristics=this.register(n...
    method write (line 1) | write(e,t){this._writeBuffer.write(e,t)}
    method writeSync (line 1) | writeSync(e,t){this._logService.logLevel<=r.LogLevelEnum.WARN&&!m&&(th...
    method input (line 1) | input(e,t=!0){this.coreService.triggerDataEvent(e,t)}
    method resize (line 1) | resize(e,t){isNaN(e)||isNaN(t)||(e=Math.max(e,a.MINIMUM_COLS),t=Math.m...
    method scroll (line 1) | scroll(e,t=!1){this._bufferService.scroll(e,t)}
    method scrollLines (line 1) | scrollLines(e,t,i){this._bufferService.scrollLines(e,t,i)}
    method scrollPages (line 1) | scrollPages(e){this.scrollLines(e*(this.rows-1))}
    method scrollToTop (line 1) | scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}
    method scrollToBottom (line 1) | scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-thi...
    method scrollToLine (line 1) | scrollToLine(e){const t=e-this._bufferService.buffer.ydisp;0!==t&&this...
    method registerEscHandler (line 1) | registerEscHandler(e,t){return this._inputHandler.registerEscHandler(e...
    method registerDcsHandler (line 1) | registerDcsHandler(e,t){return this._inputHandler.registerDcsHandler(e...
    method registerCsiHandler (line 1) | registerCsiHandler(e,t){return this._inputHandler.registerCsiHandler(e...
    method registerOscHandler (line 1) | registerOscHandler(e,t){return this._inputHandler.registerOscHandler(e...
    method _setup (line 1) | _setup(){this._handleWindowsPtyOptionChange()}
    method reset (line 1) | reset(){this._inputHandler.reset(),this._bufferService.reset(),this._c...
    method _handleWindowsPtyOptionChange (line 1) | _handleWindowsPtyOptionChange(){let e=!1;const t=this.optionsService.r...
    method _enableWindowsWrappingHeuristics (line 1) | _enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics...
  method constructor (line 1) | constructor(){this._listeners=[],this._disposed=!1}
  method event (line 1) | get event(){return this._event||(this._event=e=>(this._listeners.push(e)...
  method fire (line 1) | fire(e,t){const i=[];for(let e=0;e<this._listeners.length;e++)i.push(thi...
  method dispose (line 1) | dispose(){this.clearListeners(),this._disposed=!0}
  method clearListeners (line 1) | clearListeners(){this._listeners&&(this._listeners.length=0)}
  function w (line 1) | function w(e,t){if(e>24)return t.setWinLines||!1;switch(e){case 1:return...
  class k (line 1) | class k extends h.Disposable{getAttrData(){return this._curAttrData}cons...
    method getAttrData (line 1) | getAttrData(){return this._curAttrData}
    method constructor (line 1) | constructor(e,t,i,s,r,h,_,f,v=new a.EscapeSequenceParser){super(),this...
    method _preserveStack (line 1) | _preserveStack(e,t,i,s){this._parseStack.paused=!0,this._parseStack.cu...
    method _logSlowResolvingAsync (line 1) | _logSlowResolvingAsync(e){this._logService.logLevel<=v.LogLevelEnum.WA...
    method _getCurrentLinkId (line 1) | _getCurrentLinkId(){return this._curAttrData.extended.urlId}
    method parse (line 1) | parse(e,t){let i,s=this._activeBuffer.x,r=this._activeBuffer.y,n=0;con...
    method print (line 1) | print(e,t,i){let s,r;const n=this._charsetService.charset,o=this._opti...
    method registerCsiHandler (line 1) | registerCsiHandler(e,t){return"t"!==e.final||e.prefix||e.intermediates...
    method registerDcsHandler (line 1) | registerDcsHandler(e,t){return this._parser.registerDcsHandler(e,new m...
    method registerEscHandler (line 1) | registerEscHandler(e,t){return this._parser.registerEscHandler(e,t)}
    method registerOscHandler (line 1) | registerOscHandler(e,t){return this._parser.registerOscHandler(e,new g...
    method bell (line 1) | bell(){return this._onRequestBell.fire(),!0}
    method lineFeed (line 1) | lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y...
    method carriageReturn (line 1) | carriageReturn(){return this._activeBuffer.x=0,!0}
    method backspace (line 1) | backspace(){if(!this._coreService.decPrivateModes.reverseWraparound)re...
    method tab (line 1) | tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const...
    method shiftOut (line 1) | shiftOut(){return this._charsetService.setgLevel(1),!0}
    method shiftIn (line 1) | shiftIn(){return this._charsetService.setgLevel(0),!0}
    method _restrictCursor (line 1) | _restrictCursor(e=this._bufferService.cols-1){this._activeBuffer.x=Mat...
    method _setCursor (line 1) | _setCursor(e,t){this._dirtyRowTracker.markDirty(this._activeBuffer.y),...
    method _moveCursor (line 1) | _moveCursor(e,t){this._restrictCursor(),this._setCursor(this._activeBu...
    method cursorUp (line 1) | cursorUp(e){const t=this._activeBuffer.y-this._activeBuffer.scrollTop;...
    method cursorDown (line 1) | cursorDown(e){const t=this._activeBuffer.scrollBottom-this._activeBuff...
    method cursorForward (line 1) | cursorForward(e){return this._moveCursor(e.params[0]||1,0),!0}
    method cursorBackward (line 1) | cursorBackward(e){return this._moveCursor(-(e.params[0]||1),0),!0}
    method cursorNextLine (line 1) | cursorNextLine(e){return this.cursorDown(e),this._activeBuffer.x=0,!0}
    method cursorPrecedingLine (line 1) | cursorPrecedingLine(e){return this.cursorUp(e),this._activeBuffer.x=0,!0}
    method cursorCharAbsolute (line 1) | cursorCharAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._...
    method cursorPosition (line 1) | cursorPosition(e){return this._setCursor(e.length>=2?(e.params[1]||1)-...
    method charPosAbsolute (line 1) | charPosAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._act...
    method hPositionRelative (line 1) | hPositionRelative(e){return this._moveCursor(e.params[0]||1,0),!0}
    method linePosAbsolute (line 1) | linePosAbsolute(e){return this._setCursor(this._activeBuffer.x,(e.para...
    method vPositionRelative (line 1) | vPositionRelative(e){return this._moveCursor(0,e.params[0]||1),!0}
    method hVPosition (line 1) | hVPosition(e){return this.cursorPosition(e),!0}
    method tabClear (line 1) | tabClear(e){const t=e.params[0];return 0===t?delete this._activeBuffer...
    method cursorForwardTab (line 1) | cursorForwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)...
    method cursorBackwardTab (line 1) | cursorBackwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols...
    method selectProtected (line 1) | selectProtected(e){const t=e.params[0];return 1===t&&(this._curAttrDat...
    method _eraseInBufferLine (line 1) | _eraseInBufferLine(e,t,i,s=!1,r=!1){const n=this._activeBuffer.lines.g...
    method _resetBufferLine (line 1) | _resetBufferLine(e,t=!1){const i=this._activeBuffer.lines.get(this._ac...
    method eraseInDisplay (line 1) | eraseInDisplay(e,t=!1){let i;switch(this._restrictCursor(this._bufferS...
    method eraseInLine (line 1) | eraseInLine(e,t=!1){switch(this._restrictCursor(this._bufferService.co...
    method insertLines (line 1) | insertLines(e){this._restrictCursor();let t=e.params[0]||1;if(this._ac...
    method deleteLines (line 1) | deleteLines(e){this._restrictCursor();let t=e.params[0]||1;if(this._ac...
    method insertChars (line 1) | insertChars(e){this._restrictCursor();const t=this._activeBuffer.lines...
    method deleteChars (line 1) | deleteChars(e){this._restrictCursor();const t=this._activeBuffer.lines...
    method scrollUp (line 1) | scrollUp(e){let t=e.params[0]||1;for(;t--;)this._activeBuffer.lines.sp...
    method scrollDown (line 1) | scrollDown(e){let t=e.params[0]||1;for(;t--;)this._activeBuffer.lines....
    method scrollLeft (line 1) | scrollLeft(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom|...
    method scrollRight (line 1) | scrollRight(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom...
    method insertColumns (line 1) | insertColumns(e){if(this._activeBuffer.y>this._activeBuffer.scrollBott...
    method deleteColumns (line 1) | deleteColumns(e){if(this._activeBuffer.y>this._activeBuffer.scrollBott...
    method eraseChars (line 1) | eraseChars(e){this._restrictCursor();const t=this._activeBuffer.lines....
    method repeatPrecedingCharacter (line 1) | repeatPrecedingCharacter(e){const t=this._parser.precedingJoinState;if...
    method sendDeviceAttributesPrimary (line 1) | sendDeviceAttributesPrimary(e){return e.params[0]>0||(this._is("xterm"...
    method sendDeviceAttributesSecondary (line 1) | sendDeviceAttributesSecondary(e){return e.params[0]>0||(this._is("xter...
    method _is (line 1) | _is(e){return 0===(this._optionsService.rawOptions.termName+"").indexO...
    method setMode (line 1) | setMode(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 4:this....
    method setModePrivate (line 1) | setModePrivate(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case ...
    method resetMode (line 1) | resetMode(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 4:thi...
    method resetModePrivate (line 1) | resetModePrivate(e){for(let t=0;t<e.length;t++)switch(e.params[t]){cas...
    method requestMode (line 1) | requestMode(e,t){const i=this._coreService.decPrivateModes,{activeProt...
    method _updateAttrColor (line 1) | _updateAttrColor(e,t,i,s,r){return 2===t?(e|=50331648,e&=-16777216,e|=...
    method _extractColor (line 1) | _extractColor(e,t,i){const s=[0,0,-1,0,0,0];let r=0,n=0;do{if(s[n+r]=e...
    method _processUnderline (line 1) | _processUnderline(e,t){t.extended=t.extended.clone(),(!~e||e>5)&&(e=1)...
    method _processSGR0 (line 1) | _processSGR0(e){e.fg=l.DEFAULT_ATTR_DATA.fg,e.bg=l.DEFAULT_ATTR_DATA.b...
    method charAttributes (line 1) | charAttributes(e){if(1===e.length&&0===e.params[0])return this._proces...
    method deviceStatus (line 1) | deviceStatus(e){switch(e.params[0]){case 5:this._coreService.triggerDa...
    method deviceStatusPrivate (line 1) | deviceStatusPrivate(e){if(6===e.params[0]){const e=this._activeBuffer....
    method softReset (line 1) | softReset(e){return this._coreService.isCursorHidden=!1,this._onReques...
    method setCursorStyle (line 1) | setCursorStyle(e){const t=e.params[0]||1;switch(t){case 1:case 2:this....
    method setScrollRegion (line 1) | setScrollRegion(e){const t=e.params[0]||1;let i;return(e.length<2||(i=...
    method windowOptions (line 1) | windowOptions(e){if(!w(e.params[0],this._optionsService.rawOptions.win...
    method saveCursor (line 1) | saveCursor(e){return this._activeBuffer.savedX=this._activeBuffer.x,th...
    method restoreCursor (line 1) | restoreCursor(e){return this._activeBuffer.x=this._activeBuffer.savedX...
    method setTitle (line 1) | setTitle(e){return this._windowTitle=e,this._onTitleChange.fire(e),!0}
    method setIconName (line 1) | setIconName(e){return this._iconName=e,!0}
    method setOrReportIndexedColor (line 1) | setOrReportIndexedColor(e){const t=[],i=e.split(";");for(;i.length>1;)...
    method setHyperlink (line 1) | setHyperlink(e){const t=e.split(";");return!(t.length<2)&&(t[1]?this._...
    method _createHyperlink (line 1) | _createHyperlink(e,t){this._getCurrentLinkId()&&this._finishHyperlink(...
    method _finishHyperlink (line 1) | _finishHyperlink(){return this._curAttrData.extended=this._curAttrData...
    method _setOrReportSpecialColor (line 1) | _setOrReportSpecialColor(e,t){const i=e.split(";");for(let e=0;e<i.len...
    method setOrReportFgColor (line 1) | setOrReportFgColor(e){return this._setOrReportSpecialColor(e,0)}
    method setOrReportBgColor (line 1) | setOrReportBgColor(e){return this._setOrReportSpecialColor(e,1)}
    method setOrReportCursorColor (line 1) | setOrReportCursorColor(e){return this._setOrReportSpecialColor(e,2)}
    method restoreIndexedColor (line 1) | restoreIndexedColor(e){if(!e)return this._onColor.fire([{type:2}]),!0;...
    method restoreFgColor (line 1) | restoreFgColor(e){return this._onColor.fire([{type:2,index:256}]),!0}
    method restoreBgColor (line 1) | restoreBgColor(e){return this._onColor.fire([{type:2,index:257}]),!0}
    method restoreCursorColor (line 1) | restoreCursorColor(e){return this._onColor.fire([{type:2,index:258}]),!0}
    method nextLine (line 1) | nextLine(){return this._activeBuffer.x=0,this.index(),!0}
    method keypadApplicationMode (line 1) | keypadApplicationMode(){return this._logService.debug("Serial port req...
    method keypadNumericMode (line 1) | keypadNumericMode(){return this._logService.debug("Switching back to n...
    method selectDefaultCharset (line 1) | selectDefaultCharset(){return this._charsetService.setgLevel(0),this._...
    method selectCharset (line 1) | selectCharset(e){return 2!==e.length?(this.selectDefaultCharset(),!0):...
    method index (line 1) | index(){return this._restrictCursor(),this._activeBuffer.y++,this._act...
    method tabSet (line 1) | tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}
    method reverseIndex (line 1) | reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._...
    method fullReset (line 1) | fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}
    method reset (line 1) | reset(){this._curAttrData=l.DEFAULT_ATTR_DATA.clone(),this._eraseAttrD...
    method _eraseAttrData (line 1) | _eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this...
    method setgLevel (line 1) | setgLevel(e){return this._charsetService.setgLevel(e),!0}
    method screenAlignmentPattern (line 1) | screenAlignmentPattern(){const e=new u.CellData;e.content=1<<22|"E".ch...
    method requestStatusString (line 1) | requestStatusString(e,t){const i=this._bufferService.buffer,s=this._op...
    method markRangeDirty (line 1) | markRangeDirty(e,t){this._dirtyRowTracker.markRangeDirty(e,t)}
  method constructor (line 1) | constructor(e){this._bufferService=e,this.clearRange()}
  method clearRange (line 1) | clearRange(){this.start=this._bufferService.buffer.y,this.end=this._buff...
  method markDirty (line 1) | markDirty(e){e<this.start?this.start=e:e>this.end&&(this.end=e)}
  method markRangeDirty (line 1) | markRangeDirty(e,t){e>t&&(E=e,e=t,t=E),e<this.start&&(this.start=e),t>th...
  method markAllDirty (line 1) | markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}
  function D (line 1) | function D(e){return 0<=e&&e<256}
  function i (line 1) | function i(e){for(const t of e)t.dispose();e.length=0}
    method constructor (line 1) | constructor(){this.clear()}
    method clear (line 1) | clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportSta...
    method update (line 1) | update(e,t,i,s=!1){if(this.selectionStart=t,this.selectionEnd=i,!t||!i...
    method isCellSelected (line 1) | isCellSelected(e,t,i){return!!this.hasSelection&&(i-=e.buffer.active.v...
    method constructor (line 1) | constructor(){this._data={}}
    method set (line 1) | set(e,t,i){this._data[e]||(this._data[e]={}),this._data[e][t]=i}
    method get (line 1) | get(e,t){return this._data[e]?this._data[e][t]:void 0}
    method clear (line 1) | clear(){this._data={}}
    method constructor (line 1) | constructor(){this.fg=0,this.bg=0,this.extended=new s}
    method toColorRGB (line 1) | static toColorRGB(e){return[e>>>16&255,e>>>8&255,255&e]}
    method fromColorRGB (line 1) | static fromColorRGB(e){return(255&e[0])<<16|(255&e[1])<<8|255&e[2]}
    method clone (line 1) | clone(){const e=new i;return e.fg=this.fg,e.bg=this.bg,e.extended=this...
    method isInverse (line 1) | isInverse(){return 67108864&this.fg}
    method isBold (line 1) | isBold(){return 134217728&this.fg}
    method isUnderline (line 1) | isUnderline(){return this.hasExtendedAttrs()&&0!==this.extended.underl...
    method isBlink (line 1) | isBlink(){return 536870912&this.fg}
    method isInvisible (line 1) | isInvisible(){return 1073741824&this.fg}
    method isItalic (line 1) | isItalic(){return 67108864&this.bg}
    method isDim (line 1) | isDim(){return 134217728&this.bg}
    method isStrikethrough (line 1) | isStrikethrough(){return 2147483648&this.fg}
    method isProtected (line 1) | isProtected(){return 536870912&this.bg}
    method isOverline (line 1) | isOverline(){return 1073741824&this.bg}
    method getFgColorMode (line 1) | getFgColorMode(){return 50331648&this.fg}
    method getBgColorMode (line 1) | getBgColorMode(){return 50331648&this.bg}
    method isFgRGB (line 1) | isFgRGB(){return 50331648==(50331648&this.fg)}
    method isBgRGB (line 1) | isBgRGB(){return 50331648==(50331648&this.bg)}
    method isFgPalette (line 1) | isFgPalette(){return 16777216==(50331648&this.fg)||33554432==(50331648...
    method isBgPalette (line 1) | isBgPalette(){return 16777216==(50331648&this.bg)||33554432==(50331648...
    method isFgDefault (line 1) | isFgDefault(){return 0==(50331648&this.fg)}
    method isBgDefault (line 1) | isBgDefault(){return 0==(50331648&this.bg)}
    method isAttributeDefault (line 1) | isAttributeDefault(){return 0===this.fg&&0===this.bg}
    method getFgColor (line 1) | getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:retu...
    method getBgColor (line 1) | getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:retu...
    method hasExtendedAttrs (line 1) | hasExtendedAttrs(){return 268435456&this.bg}
    method updateExtended (line 1) | updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=...
    method getUnderlineColor (line 1) | getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColo...
    method getUnderlineColorMode (line 1) | getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.under...
    method isUnderlineColorRGB (line 1) | isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underli...
    method isUnderlineColorPalette (line 1) | isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.und...
    method isUnderlineColorDefault (line 1) | isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.und...
    method getUnderlineStyle (line 1) | getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.ex...
    method getUnderlineVariantOffset (line 1) | getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}
  method constructor (line 1) | constructor(){this._disposables=[],this._isDisposed=!1}
  method dispose (line 1) | dispose(){this._isDisposed=!0;for(const e of this._disposables)e.dispose...
  method register (line 1) | register(e){return this._disposables.push(e),e}
  method unregister (line 1) | unregister(e){const t=this._disposables.indexOf(e);-1!==t&&this._disposa...
  method constructor (line 1) | constructor(){this._isDisposed=!1}
  method value (line 1) | get value(){return this._isDisposed?void 0:this._value}
  method value (line 1) | set value(e){this._isDisposed||e===this._value||(this._value?.dispose(),...
  method clear (line 1) | clear(){this.value=void 0}
  method dispose (line 1) | dispose(){this._isDisposed=!0,this._value?.dispose(),this._value=void 0}
  class i (line 1) | class i{constructor(){this._data={}}set(e,t,i){this._data[e]||(this._dat...
    method constructor (line 1) | constructor(){this.clear()}
    method clear (line 1) | clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportSta...
    method update (line 1) | update(e,t,i,s=!1){if(this.selectionStart=t,this.selectionEnd=i,!t||!i...
    method isCellSelected (line 1) | isCellSelected(e,t,i){return!!this.hasSelection&&(i-=e.buffer.active.v...
    method constructor (line 1) | constructor(){this._data={}}
    method set (line 1) | set(e,t,i){this._data[e]||(this._data[e]={}),this._data[e][t]=i}
    method get (line 1) | get(e,t){return this._data[e]?this._data[e][t]:void 0}
    method clear (line 1) | clear(){this._data={}}
    method constructor (line 1) | constructor(){this.fg=0,this.bg=0,this.extended=new s}
    method toColorRGB (line 1) | static toColorRGB(e){return[e>>>16&255,e>>>8&255,255&e]}
    method fromColorRGB (line 1) | static fromColorRGB(e){return(255&e[0])<<16|(255&e[1])<<8|255&e[2]}
    method clone (line 1) | clone(){const e=new i;return e.fg=this.fg,e.bg=this.bg,e.extended=this...
    method isInverse (line 1) | isInverse(){return 67108864&this.fg}
    method isBold (line 1) | isBold(){return 134217728&this.fg}
    method isUnderline (line 1) | isUnderline(){return this.hasExtendedAttrs()&&0!==this.extended.underl...
    method isBlink (line 1) | isBlink(){return 536870912&this.fg}
    method isInvisible (line 1) | isInvisible(){return 1073741824&this.fg}
    method isItalic (line 1) | isItalic(){return 67108864&this.bg}
    method isDim (line 1) | isDim(){return 134217728&this.bg}
    method isStrikethrough (line 1) | isStrikethrough(){return 2147483648&this.fg}
    method isProtected (line 1) | isProtected(){return 536870912&this.bg}
    method isOverline (line 1) | isOverline(){return 1073741824&this.bg}
    method getFgColorMode (line 1) | getFgColorMode(){return 50331648&this.fg}
    method getBgColorMode (line 1) | getBgColorMode(){return 50331648&this.bg}
    method isFgRGB (line 1) | isFgRGB(){return 50331648==(50331648&this.fg)}
    method isBgRGB (line 1) | isBgRGB(){return 50331648==(50331648&this.bg)}
    method isFgPalette (line 1) | isFgPalette(){return 16777216==(50331648&this.fg)||33554432==(50331648...
    method isBgPalette (line 1) | isBgPalette(){return 16777216==(50331648&this.bg)||33554432==(50331648...
    method isFgDefault (line 1) | isFgDefault(){return 0==(50331648&this.fg)}
    method isBgDefault (line 1) | isBgDefault(){return 0==(50331648&this.bg)}
    method isAttributeDefault (line 1) | isAttributeDefault(){return 0===this.fg&&0===this.bg}
    method getFgColor (line 1) | getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:retu...
    method getBgColor (line 1) | getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:retu...
    method hasExtendedAttrs (line 1) | hasExtendedAttrs(){return 268435456&this.bg}
    method updateExtended (line 1) | updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=...
    method getUnderlineColor (line 1) | getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColo...
    method getUnderlineColorMode (line 1) | getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.under...
    method isUnderlineColorRGB (line 1) | isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underli...
    method isUnderlineColorPalette (line 1) | isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.und...
    method isUnderlineColorDefault (line 1) | isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.und...
    method getUnderlineStyle (line 1) | getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.ex...
    method getUnderlineVariantOffset (line 1) | getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}
  method constructor (line 1) | constructor(){this._data=new i}
  method set (line 1) | set(e,t,s,r,n){this._data.get(e,t)||this._data.set(e,t,new i),this._data...
  method get (line 1) | get(e,t,i,s){return this._data.get(e,t)?.get(i,s)}
  method clear (line 1) | clear(){this._data.clear()}
  method constructor (line 1) | constructor(e){this._getKey=e,this._array=[]}
  method clear (line 1) | clear(){this._array.length=0}
  method insert (line 1) | insert(e){0!==this._array.length?(i=this._search(this._getKey(e)),this._...
  method delete (line 1) | delete(e){if(0===this._array.length)return!1;const t=this._getKey(e);if(...
  method getKeyIterator (line 1) | *getKeyIterator(e){if(0!==this._array.length&&(i=this._search(e),!(i<0||...
  method forEachByKey (line 1) | forEachByKey(e,t){if(0!==this._array.length&&(i=this._search(e),!(i<0||i...
  method values (line 1) | values(){return[...this._array].values()}
  method _search (line 1) | _search(e){let t=0,i=this._array.length-1;for(;i>=t;){let s=t+i>>1;const...
  class r (line 1) | class r{constructor(){this._tasks=[],this._i=0}enqueue(e){this._tasks.pu...
    method constructor (line 1) | constructor(){super(),this.linkProviders=[],this.register((0,s.toDispo...
    method registerLinkProvider (line 1) | registerLinkProvider(e){return this.linkProviders.push(e),{dispose:()=...
    method constructor (line 1) | constructor(){this._tasks=[],this._i=0}
    method enqueue (line 1) | enqueue(e){this._tasks.push(e),this._start()}
    method flush (line 1) | flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this....
    method clear (line 1) | clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),...
    method _start (line 1) | _start(){this._idleCallback||(this._idleCallback=this._requestCallback...
    method _process (line 1) | _process(e){this._idleCallback=void 0;let t=0,i=0,s=e.timeRemaining(),...
  class n (line 1) | class n extends r{_requestCallback(e){return setTimeout((()=>e(this._cre...
    method constructor (line 1) | constructor(e){super(),this._maxLength=e,this.onDeleteEmitter=this.reg...
    method maxLength (line 1) | get maxLength(){return this._maxLength}
    method maxLength (line 1) | set maxLength(e){if(this._maxLength===e)return;const t=new Array(e);fo...
    method length (line 1) | get length(){return this._length}
    method length (line 1) | set length(e){if(e>this._length)for(let t=this._length;t<e;t++)this._a...
    method get (line 1) | get(e){return this._array[this._getCyclicIndex(e)]}
    method set (line 1) | set(e,t){this._array[this._getCyclicIndex(e)]=t}
    method push (line 1) | push(e){this._array[this._getCyclicIndex(this._length)]=e,this._length...
    method recycle (line 1) | recycle(){if(this._length!==this._maxLength)throw new Error("Can only ...
    method isFull (line 1) | get isFull(){return this._length===this._maxLength}
    method pop (line 1) | pop(){return this._array[this._getCyclicIndex(this._length---1)]}
    method splice (line 1) | splice(e,t,...i){if(t){for(let i=e;i<this._length-t;i++)this._array[th...
    method trimStart (line 1) | trimStart(e){e>this._length&&(e=this._length),this._startIndex+=e,this...
    method shiftElements (line 1) | shiftElements(e,t,i){if(!(t<=0)){if(e<0||e>=this._length)throw new Err...
    method _getCyclicIndex (line 1) | _getCyclicIndex(e){return(this._startIndex+e)%this._maxLength}
    method _requestCallback (line 1) | _requestCallback(e){return setTimeout((()=>e(this._createDeadline(16))))}
    method _cancelCallback (line 1) | _cancelCallback(e){clearTimeout(e)}
    method _createDeadline (line 1) | _createDeadline(e){const t=Date.now()+e;return{timeRemaining:()=>Math....
    method id (line 1) | get id(){return this._id}
    method constructor (line 1) | constructor(e){this.line=e,this.isDisposed=!1,this._disposables=[],thi...
    method dispose (line 1) | dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDi...
    method register (line 1) | register(e){return this._disposables.push(e),e}
    method constructor (line 1) | constructor(e){super(),this._action=e,this._writeBuffer=[],this._callb...
    method handleUserInput (line 1) | handleUserInput(){this._didUserInput=!0}
    method writeSync (line 1) | writeSync(e,t){if(void 0!==t&&this._syncCalls>t)return void(this._sync...
    method write (line 1) | write(e,t){if(this._pendingData>5e7)throw new Error("write data discar...
    method _innerWrite (line 1) | _innerWrite(e=0,t=!0){const i=e||Date.now();for(;this._writeBuffer.len...
    method constructor (line 1) | constructor(...e){this._entries=new Map;for(const[t,i]of e)this.set(t,i)}
    method set (line 1) | set(e,t){const i=this._entries.get(e);return this._entries.set(e,t),i}
    method forEach (line 1) | forEach(e){for(const[t,i]of this._entries.entries())e(t,i)}
    method has (line 1) | has(e){return this._entries.has(e)}
    method get (line 1) | get(e){return this._entries.get(e)}
    method extractShouldJoin (line 1) | static extractShouldJoin(e){return 0!=(1&e)}
    method extractWidth (line 1) | static extractWidth(e){return e>>1&3}
    method extractCharKind (line 1) | static extractCharKind(e){return e>>3}
    method createPropertyValue (line 1) | static createPropertyValue(e,t,i=!1){return(16777215&e)<<3|(3&t)<<1|(i...
    method constructor (line 1) | constructor(){this._providers=Object.create(null),this._active="",this...
    method dispose (line 1) | dispose(){this._onChange.dispose()}
    method versions (line 1) | get versions(){return Object.keys(this._providers)}
    method activeVersion (line 1) | get activeVersion(){return this._active}
    method activeVersion (line 1) | set activeVersion(e){if(!this._providers[e])throw new Error(`unknown U...
    method register (line 1) | register(e){this._providers[e.version]=e}
    method wcwidth (line 1) | wcwidth(e){return this._activeProvider.wcwidth(e)}
    method getStringCellWidth (line 1) | getStringCellWidth(e){let t=0,i=0;const s=e.length;for(let r=0;r<s;++r...
    method charProperties (line 1) | charProperties(e,t){return this._activeProvider.charProperties(e,t)}
  method _requestCallback (line 1) | _requestCallback(e){return requestIdleCallback(e)}
  method _cancelCallback (line 1) | _cancelCallback(e){cancelIdleCallback(e)}
  method constructor (line 1) | constructor(){this._queue=new t.IdleTaskQueue}
  method set (line 1) | set(e){this._queue.clear(),this._queue.enqueue(e)}
  method flush (line 1) | flush(){this._queue.flush()}
  class i (line 1) | class i{constructor(){this.fg=0,this.bg=0,this.extended=new s}static toC...
    method constructor (line 1) | constructor(){this.clear()}
    method clear (line 1) | clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportSta...
    method update (line 1) | update(e,t,i,s=!1){if(this.selectionStart=t,this.selectionEnd=i,!t||!i...
    method isCellSelected (line 1) | isCellSelected(e,t,i){return!!this.hasSelection&&(i-=e.buffer.active.v...
    method constructor (line 1) | constructor(){this._data={}}
    method set (line 1) | set(e,t,i){this._data[e]||(this._data[e]={}),this._data[e][t]=i}
    method get (line 1) | get(e,t){return this._data[e]?this._data[e][t]:void 0}
    method clear (line 1) | clear(){this._data={}}
    method constructor (line 1) | constructor(){this.fg=0,this.bg=0,this.extended=new s}
    method toColorRGB (line 1) | static toColorRGB(e){return[e>>>16&255,e>>>8&255,255&e]}
    method fromColorRGB (line 1) | static fromColorRGB(e){return(255&e[0])<<16|(255&e[1])<<8|255&e[2]}
    method clone (line 1) | clone(){const e=new i;return e.fg=this.fg,e.bg=this.bg,e.extended=this...
    method isInverse (line 1) | isInverse(){return 67108864&this.fg}
    method isBold (line 1) | isBold(){return 134217728&this.fg}
    method isUnderline (line 1) | isUnderline(){return this.hasExtendedAttrs()&&0!==this.extended.underl...
    method isBlink (line 1) | isBlink(){return 536870912&this.fg}
    method isInvisible (line 1) | isInvisible(){return 1073741824&this.fg}
    method isItalic (line 1) | isItalic(){return 67108864&this.bg}
    method isDim (line 1) | isDim(){return 134217728&this.bg}
    method isStrikethrough (line 1) | isStrikethrough(){return 2147483648&this.fg}
    method isProtected (line 1) | isProtected(){return 536870912&this.bg}
    method isOverline (line 1) | isOverline(){return 1073741824&this.bg}
    method getFgColorMode (line 1) | getFgColorMode(){return 50331648&this.fg}
    method getBgColorMode (line 1) | getBgColorMode(){return 50331648&this.bg}
    method isFgRGB (line 1) | isFgRGB(){return 50331648==(50331648&this.fg)}
    method isBgRGB (line 1) | isBgRGB(){return 50331648==(50331648&this.bg)}
    method isFgPalette (line 1) | isFgPalette(){return 16777216==(50331648&this.fg)||33554432==(50331648...
    method isBgPalette (line 1) | isBgPalette(){return 16777216==(50331648&this.bg)||33554432==(50331648...
    method isFgDefault (line 1) | isFgDefault(){return 0==(50331648&this.fg)}
    method isBgDefault (line 1) | isBgDefault(){return 0==(50331648&this.bg)}
    method isAttributeDefault (line 1) | isAttributeDefault(){return 0===this.fg&&0===this.bg}
    method getFgColor (line 1) | getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:retu...
    method getBgColor (line 1) | getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:retu...
    method hasExtendedAttrs (line 1) | hasExtendedAttrs(){return 268435456&this.bg}
    method updateExtended (line 1) | updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=...
    method getUnderlineColor (line 1) | getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColo...
    method getUnderlineColorMode (line 1) | getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.under...
    method isUnderlineColorRGB (line 1) | isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underli...
    method isUnderlineColorPalette (line 1) | isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.und...
    method isUnderlineColorDefault (line 1) | isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.und...
    method getUnderlineStyle (line 1) | getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.ex...
    method getUnderlineVariantOffset (line 1) | getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}
  class s (line 1) | class s{get ext(){return this._urlId?-469762049&this._ext|this.underline...
    method ext (line 1) | get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<...
    method ext (line 1) | set ext(e){this._ext=e}
    method underlineStyle (line 1) | get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}
    method underlineStyle (line 1) | set underlineStyle(e){this._ext&=-469762049,this._ext|=e<<26&469762048}
    method underlineColor (line 1) | get underlineColor(){return 67108863&this._ext}
    method underlineColor (line 1) | set underlineColor(e){this._ext&=-67108864,this._ext|=67108863&e}
    method urlId (line 1) | get urlId(){return this._urlId}
    method urlId (line 1) | set urlId(e){this._urlId=e}
    method underlineVariantOffset (line 1) | get underlineVariantOffset(){const e=(3758096384&this._ext)>>29;return...
    method underlineVariantOffset (line 1) | set underlineVariantOffset(e){this._ext&=536870911,this._ext|=e<<29&37...
    method constructor (line 1) | constructor(e=0,t=0){this._ext=0,this._urlId=0,this._ext=e,this._urlId=t}
    method clone (line 1) | clone(){return new s(this._ext,this._urlId)}
    method isEmpty (line 1) | isEmpty(){return 0===this.underlineStyle&&0===this._urlId}
    method fromArray (line 1) | static fromArray(e){const t=new s;if(!e.length)return t;for(let i=Arra...
    method constructor (line 1) | constructor(e=32,t=32){if(this.maxLength=e,this.maxSubParamsLength=t,t...
    method clone (line 1) | clone(){const e=new s(this.maxLength,this.maxSubParamsLength);return e...
    method toArray (line 1) | toArray(){const e=[];for(let t=0;t<this.length;++t){e.push(this.params...
    method reset (line 1) | reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,th...
    method addParam (line 1) | addParam(e){if(this._digitIsSub=!1,this.length>=this.maxLength)this._r...
    method addSubParam (line 1) | addSubParam(e){if(this._digitIsSub=!0,this.length)if(this._rejectDigit...
    method hasSubParams (line 1) | hasSubParams(e){return(255&this._subParamsIdx[e])-(this._subParamsIdx[...
    method getSubParams (line 1) | getSubParams(e){const t=this._subParamsIdx[e]>>8,i=255&this._subParams...
    method getSubParamsAll (line 1) | getSubParamsAll(){const e={};for(let t=0;t<this.length;++t){const i=th...
    method addDigit (line 1) | addDigit(e){let t;if(this._rejectDigits||!(t=this._digitIsSub?this._su...
  method constructor (line 1) | constructor(e,t,i){this._hasScrollback=e,this._optionsService=t,this._bu...
  method getNullCell (line 1) | getNullCell(e){return e?(this._nullCell.fg=e.fg,this._nullCell.bg=e.bg,t...
  method getWhitespaceCell (line 1) | getWhitespaceCell(e){return e?(this._whitespaceCell.fg=e.fg,this._whites...
  method getBlankLine (line 1) | getBlankLine(e,t){return new o.BufferLine(this._bufferService.cols,this....
  method hasScrollback (line 1) | get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>thi...
  method isCursorInViewport (line 1) | get isCursorInViewport(){const e=this.ybase+this.y-this.ydisp;return e>=...
  method _getCorrectBufferLength (line 1) | _getCorrectBufferLength(e){if(!this._hasScrollback)return e;const i=e+th...
  method fillViewportRows (line 1) | fillViewportRows(e){if(0===this.lines.length){void 0===e&&(e=o.DEFAULT_A...
  method clear (line 1) | clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new s.Cir...
  method resize (line 1) | resize(e,t){const i=this.getNullCell(o.DEFAULT_ATTR_DATA);let s=0;const ...
  method _batchedMemoryCleanup (line 1) | _batchedMemoryCleanup(){let e=!0;this._memoryCleanupPosition>=this.lines...
  method _isReflowEnabled (line 1) | get _isReflowEnabled(){const e=this._optionsService.rawOptions.windowsPt...
  method _reflow (line 1) | _reflow(e,t){this._cols!==e&&(e>this._cols?this._reflowLarger(e,t):this....
  method _reflowLarger (line 1) | _reflowLarger(e,t){const i=(0,a.reflowLargerGetLinesToRemove)(this.lines...
  method _reflowLargerAdjustViewport (line 1) | _reflowLargerAdjustViewport(e,t,i){const s=this.getNullCell(o.DEFAULT_AT...
  method _reflowSmaller (line 1) | _reflowSmaller(e,t){const i=this.getNullCell(o.DEFAULT_ATTR_DATA),s=[];l...
  method translateBufferLineToString (line 1) | translateBufferLineToString(e,t,i=0,s){const r=this.lines.get(e);return ...
  method getWrappedRangeForLine (line 1) | getWrappedRangeForLine(e){let t=e,i=e;for(;t>0&&this.lines.get(t).isWrap...
  method setupTabStops (line 1) | setupTabStops(e){for(null!=e?this.tabs[e]||(e=this.prevStop(e)):(this.ta...
  method prevStop (line 1) | prevStop(e){for(null==e&&(e=this.x);!this.tabs[--e]&&e>0;);return e>=thi...
  method nextStop (line 1) | nextStop(e){for(null==e&&(e=this.x);!this.tabs[++e]&&e<this._cols;);retu...
  method clearMarkers (line 1) | clearMarkers(e){this._isClearing=!0;for(let t=0;t<this.markers.length;t+...
  method clearAllMarkers (line 1) | clearAllMarkers(){this._isClearing=!0;for(let e=0;e<this.markers.length;...
  method addMarker (line 1) | addMarker(e){const t=new l.Marker(e);return this.markers.push(t),t.regis...
  method _removeMarker (line 1) | _removeMarker(e){this._isClearing||this.markers.splice(this.markers.inde...
  class h (line 1) | class h{constructor(e,t,i=!1){this.isWrapped=i,this._combined={},this._e...
    method constructor (line 1) | constructor(e,t,i=!1){this.isWrapped=i,this._combined={},this._extende...
    method get (line 1) | get(e){const t=this._data[3*e+0],i=2097151&t;return[this._data[3*e+1],...
    method set (line 1) | set(e,t){this._data[3*e+1]=t[n.CHAR_DATA_ATTR_INDEX],t[n.CHAR_DATA_CHA...
    method getWidth (line 1) | getWidth(e){return this._data[3*e+0]>>22}
    method hasWidth (line 1) | hasWidth(e){return 12582912&this._data[3*e+0]}
    method getFg (line 1) | getFg(e){return this._data[3*e+1]}
    method getBg (line 1) | getBg(e){return this._data[3*e+2]}
    method hasContent (line 1) | hasContent(e){return 4194303&this._data[3*e+0]}
    method getCodePoint (line 1) | getCodePoint(e){const t=this._data[3*e+0];return 2097152&t?this._combi...
    method isCombined (line 1) | isCombined(e){return 2097152&this._data[3*e+0]}
    method getString (line 1) | getString(e){const t=this._data[3*e+0];return 2097152&t?this._combined...
    method isProtected (line 1) | isProtected(e){return 536870912&this._data[3*e+2]}
    method loadCell (line 1) | loadCell(e,t){return a=3*e,t.content=this._data[a+0],t.fg=this._data[a...
    method setCell (line 1) | setCell(e,t){2097152&t.content&&(this._combined[e]=t.combinedData),268...
    method setCellFromCodepoint (line 1) | setCellFromCodepoint(e,t,i,s){268435456&s.bg&&(this._extendedAttrs[e]=...
    method addCodepointToCell (line 1) | addCodepointToCell(e,t,i){let s=this._data[3*e+0];2097152&s?this._comb...
    method insertCells (line 1) | insertCells(e,t,i){if((e%=this.length)&&2===this.getWidth(e-1)&&this.s...
    method deleteCells (line 1) | deleteCells(e,t,i){if(e%=this.length,t<this.length-e){const s=new r.Ce...
    method replaceCells (line 1) | replaceCells(e,t,i,s=!1){if(s)for(e&&2===this.getWidth(e-1)&&!this.isP...
    method resize (line 1) | resize(e,t){if(e===this.length)return 4*this._data.length*2<this._data...
    method cleanupMemory (line 1) | cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength)...
    method fill (line 1) | fill(e,t=!1){if(t)for(let t=0;t<this.length;++t)this.isProtected(t)||t...
    method copyFrom (line 1) | copyFrom(e){this.length!==e.length?this._data=new Uint32Array(e._data)...
    method clone (line 1) | clone(){const e=new h(0);e._data=new Uint32Array(this._data),e.length=...
    method getTrimmedLength (line 1) | getTrimmedLength(){for(let e=this.length-1;e>=0;--e)if(4194303&this._d...
    method getNoBgTrimmedLength (line 1) | getNoBgTrimmedLength(){for(let e=this.length-1;e>=0;--e)if(4194303&thi...
    method copyCellsFrom (line 1) | copyCellsFrom(e,t,i,s,r){const n=e._data;if(r)for(let r=s-1;r>=0;r--){...
    method translateToString (line 1) | translateToString(e,t,i,s){t=t??0,i=i??this.length,e&&(i=Math.min(i,th...
  function i (line 1) | function i(e,t,i){if(t===e.length-1)return e[t].getTrimmedLength();const...
    method constructor (line 1) | constructor(){this.clear()}
    method clear (line 1) | clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportSta...
    method update (line 1) | update(e,t,i,s=!1){if(this.selectionStart=t,this.selectionEnd=i,!t||!i...
    method isCellSelected (line 1) | isCellSelected(e,t,i){return!!this.hasSelection&&(i-=e.buffer.active.v...
    method constructor (line 1) | constructor(){this._data={}}
    method set (line 1) | set(e,t,i){this._data[e]||(this._data[e]={}),this._data[e][t]=i}
    method get (line 1) | get(e,t){return this._data[e]?this._data[e][t]:void 0}
    method clear (line 1) | clear(){this._data={}}
    method constructor (line 1) | constructor(){this.fg=0,this.bg=0,this.extended=new s}
    method toColorRGB (line 1) | static toColorRGB(e){return[e>>>16&255,e>>>8&255,255&e]}
    method fromColorRGB (line 1) | static fromColorRGB(e){return(255&e[0])<<16|(255&e[1])<<8|255&e[2]}
    method clone (line 1) | clone(){const e=new i;return e.fg=this.fg,e.bg=this.bg,e.extended=this...
    method isInverse (line 1) | isInverse(){return 67108864&this.fg}
    method isBold (line 1) | isBold(){return 134217728&this.fg}
    method isUnderline (line 1) | isUnderline(){return this.hasExtendedAttrs()&&0!==this.extended.underl...
    method isBlink (line 1) | isBlink(){return 536870912&this.fg}
    method isInvisible (line 1) | isInvisible(){return 1073741824&this.fg}
    method isItalic (line 1) | isItalic(){return 67108864&this.bg}
    method isDim (line 1) | isDim(){return 134217728&this.bg}
    method isStrikethrough (line 1) | isStrikethrough(){return 2147483648&this.fg}
    method isProtected (line 1) | isProtected(){return 536870912&this.bg}
    method isOverline (line 1) | isOverline(){return 1073741824&this.bg}
    method getFgColorMode (line 1) | getFgColorMode(){return 50331648&this.fg}
    method getBgColorMode (line 1) | getBgColorMode(){return 50331648&this.bg}
    method isFgRGB (line 1) | isFgRGB(){return 50331648==(50331648&this.fg)}
    method isBgRGB (line 1) | isBgRGB(){return 50331648==(50331648&this.bg)}
    method isFgPalette (line 1) | isFgPalette(){return 16777216==(50331648&this.fg)||33554432==(50331648...
    method isBgPalette (line 1) | isBgPalette(){return 16777216==(50331648&this.bg)||33554432==(50331648...
    method isFgDefault (line 1) | isFgDefault(){return 0==(50331648&this.fg)}
    method isBgDefault (line 1) | isBgDefault(){return 0==(50331648&this.bg)}
    method isAttributeDefault (line 1) | isAttributeDefault(){return 0===this.fg&&0===this.bg}
    method getFgColor (line 1) | getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:retu...
    method getBgColor (line 1) | getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:retu...
    method hasExtendedAttrs (line 1) | hasExtendedAttrs(){return 268435456&this.bg}
    method updateExtended (line 1) | updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=...
    method getUnderlineColor (line 1) | getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColo...
    method getUnderlineColorMode (line 1) | getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.under...
    method isUnderlineColorRGB (line 1) | isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underli...
    method isUnderlineColorPalette (line 1) | isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.und...
    method isUnderlineColorDefault (line 1) | isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.und...
    method getUnderlineStyle (line 1) | getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.ex...
    method getUnderlineVariantOffset (line 1) | getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}
  class o (line 1) | class o extends r.Disposable{constructor(e,t){super(),this._optionsServi...
    method constructor (line 1) | constructor(e,t,i){super(),this._textarea=e,this._window=t,this.mainDo...
    method window (line 1) | get window(){return this._window}
    method window (line 1) | set window(e){this._window!==e&&(this._window=e,this._onWindowChange.f...
    method dpr (line 1) | get dpr(){return this.window.devicePixelRatio}
    method isFocused (line 1) | get isFocused(){return void 0===this._cachedIsFocused&&(this._cachedIs...
    method constructor (line 1) | constructor(e,t){super(),this._optionsService=e,this._bufferService=t,...
    method reset (line 1) | reset(){this._normal=new n.Buffer(!0,this._optionsService,this._buffer...
    method alt (line 1) | get alt(){return this._alt}
    method active (line 1) | get active(){return this._activeBuffer}
    method normal (line 1) | get normal(){return this._normal}
    method activateNormalBuffer (line 1) | activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._norma...
    method activateAltBuffer (line 1) | activateAltBuffer(e){this._activeBuffer!==this._alt&&(this._alt.fillVi...
    method resize (line 1) | resize(e,t){this._normal.resize(e,t),this._alt.resize(e,t),this.setupT...
    method setupTabStops (line 1) | setupTabStops(e){this._normal.setupTabStops(e),this._alt.setupTabStops...
    method constructor (line 1) | constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,t...
    method fromCharData (line 1) | static fromCharData(e){const t=new o;return t.setFromCharData(e),t}
    method isCombined (line 1) | isCombined(){return 2097152&this.content}
    method getWidth (line 1) | getWidth(){return this.content>>22}
    method getChars (line 1) | getChars(){return 2097152&this.content?this.combinedData:2097151&this....
    method getCode (line 1) | getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.c...
    method setFromCharData (line 1) | setFromCharData(e){this.fg=e[r.CHAR_DATA_ATTR_INDEX],this.bg=0;let t=!...
    method getAsCharData (line 1) | getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.ge...
    method constructor (line 1) | constructor(e){super(),this._core=e,this._onBufferChange=this.register...
    method active (line 1) | get active(){if(this._core.buffers.active===this._core.buffers.normal)...
    method normal (line 1) | get normal(){return this._normal.init(this._core.buffers.normal)}
    method alternate (line 1) | get alternate(){return this._alternate.init(this._core.buffers.alt)}
  class o (line 1) | class o extends n.AttributeData{constructor(){super(...arguments),this.c...
    method constructor (line 1) | constructor(e,t,i){super(),this._textarea=e,this._window=t,this.mainDo...
    method window (line 1) | get window(){return this._window}
    method window (line 1) | set window(e){this._window!==e&&(this._window=e,this._onWindowChange.f...
    method dpr (line 1) | get dpr(){return this.window.devicePixelRatio}
    method isFocused (line 1) | get isFocused(){return void 0===this._cachedIsFocused&&(this._cachedIs...
    method constructor (line 1) | constructor(e,t){super(),this._optionsService=e,this._bufferService=t,...
    method reset (line 1) | reset(){this._normal=new n.Buffer(!0,this._optionsService,this._buffer...
    method alt (line 1) | get alt(){return this._alt}
    method active (line 1) | get active(){return this._activeBuffer}
    method normal (line 1) | get normal(){return this._normal}
    method activateNormalBuffer (line 1) | activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._norma...
    method activateAltBuffer (line 1) | activateAltBuffer(e){this._activeBuffer!==this._alt&&(this._alt.fillVi...
    method resize (line 1) | resize(e,t){this._normal.resize(e,t),this._alt.resize(e,t),this.setupT...
    method setupTabStops (line 1) | setupTabStops(e){this._normal.setupTabStops(e),this._alt.setupTabStops...
    method constructor (line 1) | constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,t...
    method fromCharData (line 1) | static fromCharData(e){const t=new o;return t.setFromCharData(e),t}
    method isCombined (line 1) | isCombined(){return 2097152&this.content}
    method getWidth (line 1) | getWidth(){return this.content>>22}
    method getChars (line 1) | getChars(){return 2097152&this.content?this.combinedData:2097151&this....
    method getCode (line 1) | getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.c...
    method setFromCharData (line 1) | setFromCharData(e){this.fg=e[r.CHAR_DATA_ATTR_INDEX],this.bg=0;let t=!...
    method getAsCharData (line 1) | getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.ge...
    method constructor (line 1) | constructor(e){super(),this._core=e,this._onBufferChange=this.register...
    method active (line 1) | get active(){if(this._core.buffers.active===this._core.buffers.normal)...
    method normal (line 1) | get normal(){return this._normal.init(this._core.buffers.normal)}
    method alternate (line 1) | get alternate(){return this._alternate.init(this._core.buffers.alt)}
  class n (line 1) | class n{get id(){return this._id}constructor(e){this.line=e,this.isDispo...
    method constructor (line 1) | constructor(e){super(),this._maxLength=e,this.onDeleteEmitter=this.reg...
    method maxLength (line 1) | get maxLength(){return this._maxLength}
    method maxLength (line 1) | set maxLength(e){if(this._maxLength===e)return;const t=new Array(e);fo...
    method length (line 1) | get length(){return this._length}
    method length (line 1) | set length(e){if(e>this._length)for(let t=this._length;t<e;t++)this._a...
    method get (line 1) | get(e){return this._array[this._getCyclicIndex(e)]}
    method set (line 1) | set(e,t){this._array[this._getCyclicIndex(e)]=t}
    method push (line 1) | push(e){this._array[this._getCyclicIndex(this._length)]=e,this._length...
    method recycle (line 1) | recycle(){if(this._length!==this._maxLength)throw new Error("Can only ...
    method isFull (line 1) | get isFull(){return this._length===this._maxLength}
    method pop (line 1) | pop(){return this._array[this._getCyclicIndex(this._length---1)]}
    method splice (line 1) | splice(e,t,...i){if(t){for(let i=e;i<this._length-t;i++)this._array[th...
    method trimStart (line 1) | trimStart(e){e>this._length&&(e=this._length),this._startIndex+=e,this...
    method shiftElements (line 1) | shiftElements(e,t,i){if(!(t<=0)){if(e<0||e>=this._length)throw new Err...
    method _getCyclicIndex (line 1) | _getCyclicIndex(e){return(this._startIndex+e)%this._maxLength}
    method _requestCallback (line 1) | _requestCallback(e){return setTimeout((()=>e(this._createDeadline(16))))}
    method _cancelCallback (line 1) | _cancelCallback(e){clearTimeout(e)}
    method _createDeadline (line 1) | _createDeadline(e){const t=Date.now()+e;return{timeRemaining:()=>Math....
    method id (line 1) | get id(){return this._id}
    method constructor (line 1) | constructor(e){this.line=e,this.isDisposed=!1,this._disposables=[],thi...
    method dispose (line 1) | dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDi...
    method register (line 1) | register(e){return this._disposables.push(e),e}
    method constructor (line 1) | constructor(e){super(),this._action=e,this._writeBuffer=[],this._callb...
    method handleUserInput (line 1) | handleUserInput(){this._didUserInput=!0}
    method writeSync (line 1) | writeSync(e,t){if(void 0!==t&&this._syncCalls>t)return void(this._sync...
    method write (line 1) | write(e,t){if(this._pendingData>5e7)throw new Error("write data discar...
    method _innerWrite (line 1) | _innerWrite(e=0,t=!0){const i=e||Date.now();for(;this._writeBuffer.len...
    method constructor (line 1) | constructor(...e){this._entries=new Map;for(const[t,i]of e)this.set(t,i)}
    method set (line 1) | set(e,t){const i=this._entries.get(e);return this._entries.set(e,t),i}
    method forEach (line 1) | forEach(e){for(const[t,i]of this._entries.entries())e(t,i)}
    method has (line 1) | has(e){return this._entries.has(e)}
    method get (line 1) | get(e){return this._entries.get(e)}
    method extractShouldJoin (line 1) | static extractShouldJoin(e){return 0!=(1&e)}
    method extractWidth (line 1) | static extractWidth(e){return e>>1&3}
    method extractCharKind (line 1) | static extractCharKind(e){return e>>3}
    method createPropertyValue (line 1) | static createPropertyValue(e,t,i=!1){return(16777215&e)<<3|(3&t)<<1|(i...
    method constructor (line 1) | constructor(){this._providers=Object.create(null),this._active="",this...
    method dispose (line 1) | dispose(){this._onChange.dispose()}
    method versions (line 1) | get versions(){return Object.keys(this._providers)}
    method activeVersion (line 1) | get activeVersion(){return this._active}
    method activeVersion (line 1) | set activeVersion(e){if(!this._providers[e])throw new Error(`unknown U...
    method register (line 1) | register(e){this._providers[e.version]=e}
    method wcwidth (line 1) | wcwidth(e){return this._activeProvider.wcwidth(e)}
    method getStringCellWidth (line 1) | getStringCellWidth(e){let t=0,i=0;const s=e.length;for(let r=0;r<s;++r...
    method charProperties (line 1) | charProperties(e,t){return this._activeProvider.charProperties(e,t)}
  method constructor (line 1) | constructor(){this._interim=0}
  method clear (line 1) | clear(){this._interim=0}
  method decode (line 1) | decode(e,t){const i=e.length;if(!i)return 0;let s=0,r=0;if(this._interim...
  method constructor (line 1) | constructor(){this.interim=new Uint8Array(3)}
  method clear (line 1) | clear(){this.interim.fill(0)}
  method decode (line 1) | decode(e,t){const i=e.length;if(!i)return 0;let s,r,n,o,a=0,h=0,c=0;if(t...
  method constructor (line 1) | constructor(){if(this.version="6",!o){o=new Uint8Array(65536),o.fill(1),...
  method wcwidth (line 1) | wcwidth(e){return e<32?0:e<127?1:e<65536?o[e]:function(e,t){let i,s=0,r=...
  method charProperties (line 1) | charProperties(e,t){let i=this.wcwidth(e),r=0===i&&0!==t;if(r){const e=s...
  class n (line 1) | class n extends r.Disposable{constructor(e){super(),this._action=e,this....
    method constructor (line 1) | constructor(e){super(),this._maxLength=e,this.onDeleteEmitter=this.reg...
    method maxLength (line 1) | get maxLength(){return this._maxLength}
    method maxLength (line 1) | set maxLength(e){if(this._maxLength===e)return;const t=new Array(e);fo...
    method length (line 1) | get length(){return this._length}
    method length (line 1) | set length(e){if(e>this._length)for(let t=this._length;t<e;t++)this._a...
    method get (line 1) | get(e){return this._array[this._getCyclicIndex(e)]}
    method set (line 1) | set(e,t){this._array[this._getCyclicIndex(e)]=t}
    method push (line 1) | push(e){this._array[this._getCyclicIndex(this._length)]=e,this._length...
    method recycle (line 1) | recycle(){if(this._length!==this._maxLength)throw new Error("Can only ...
    method isFull (line 1) | get isFull(){return this._length===this._maxLength}
    method pop (line 1) | pop(){return this._array[this._getCyclicIndex(this._length---1)]}
    method splice (line 1) | splice(e,t,...i){if(t){for(let i=e;i<this._length-t;i++)this._array[th...
    method trimStart (line 1) | trimStart(e){e>this._length&&(e=this._length),this._startIndex+=e,this...
    method shiftElements (line 1) | shiftElements(e,t,i){if(!(t<=0)){if(e<0||e>=this._length)throw new Err...
    method _getCyclicIndex (line 1) | _getCyclicIndex(e){return(this._startIndex+e)%this._maxLength}
    method _requestCallback (line 1) | _requestCallback(e){return setTimeout((()=>e(this._createDeadline(16))))}
    method _cancelCallback (line 1) | _cancelCallback(e){clearTimeout(e)}
    method _createDeadline (line 1) | _createDeadline(e){const t=Date.now()+e;return{timeRemaining:()=>Math....
    method id (line 1) | get id(){return this._id}
    method constructor (line 1) | constructor(e){this.line=e,this.isDisposed=!1,this._disposables=[],thi...
    method dispose (line 1) | dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDi...
    method register (line 1) | register(e){return this._disposables.push(e),e}
    method constructor (line 1) | constructor(e){super(),this._action=e,this._writeBuffer=[],this._callb...
    method handleUserInput (line 1) | handleUserInput(){this._didUserInput=!0}
    method writeSync (line 1) | writeSync(e,t){if(void 0!==t&&this._syncCalls>t)return void(this._sync...
    method write (line 1) | write(e,t){if(this._pendingData>5e7)throw new Error("write data discar...
    method _innerWrite (line 1) | _innerWrite(e=0,t=!0){const i=e||Date.now();for(;this._writeBuffer.len...
    method constructor (line 1) | constructor(...e){this._entries=new Map;for(const[t,i]of e)this.set(t,i)}
    method set (line 1) | set(e,t){const i=this._entries.get(e);return this._entries.set(e,t),i}
    method forEach (line 1) | forEach(e){for(const[t,i]of this._entries.entries())e(t,i)}
    method has (line 1) | has(e){return this._entries.has(e)}
    method get (line 1) | get(e){return this._entries.get(e)}
    method extractShouldJoin (line 1) | static extractShouldJoin(e){return 0!=(1&e)}
    method extractWidth (line 1) | static extractWidth(e){return e>>1&3}
    method extractCharKind (line 1) | static extractCharKind(e){return e>>3}
    method createPropertyValue (line 1) | static createPropertyValue(e,t,i=!1){return(16777215&e)<<3|(3&t)<<1|(i...
    method constructor (line 1) | constructor(){this._providers=Object.create(null),this._active="",this...
    method dispose (line 1) | dispose(){this._onChange.dispose()}
    method versions (line 1) | get versions(){return Object.keys(this._providers)}
    method activeVersion (line 1) | get activeVersion(){return this._active}
    method activeVersion (line 1) | set activeVersion(e){if(!this._providers[e])throw new Error(`unknown U...
    method register (line 1) | register(e){this._providers[e.version]=e}
    method wcwidth (line 1) | wcwidth(e){return this._activeProvider.wcwidth(e)}
    method getStringCellWidth (line 1) | getStringCellWidth(e){let t=0,i=0;const s=e.length;for(let r=0;r<s;++r...
    method charProperties (line 1) | charProperties(e,t){return this._activeProvider.charProperties(e,t)}
  function r (line 1) | function r(e,t){const i=e.toString(16),s=i.length<2?"0"+i:i;switch(t){ca...
    method constructor (line 1) | constructor(){super(),this.linkProviders=[],this.register((0,s.toDispo...
    method registerLinkProvider (line 1) | registerLinkProvider(e){return this.linkProviders.push(e),{dispose:()=...
    method constructor (line 1) | constructor(){this._tasks=[],this._i=0}
    method enqueue (line 1) | enqueue(e){this._tasks.push(e),this._start()}
    method flush (line 1) | flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this....
    method clear (line 1) | clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),...
    method _start (line 1) | _start(){this._idleCallback||(this._idleCallback=this._requestCallback...
    method _process (line 1) | _process(e){this._idleCallback=void 0;let t=0,i=0,s=e.timeRemaining(),...
  method constructor (line 1) | constructor(){this._handlers=Object.create(null),this._active=o,this._id...
  method dispose (line 1) | dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this...
  method registerHandler (line 1) | registerHandler(e,t){void 0===this._handlers[e]&&(this._handlers[e]=[]);...
  method clearHandler (line 1) | clearHandler(e){this._handlers[e]&&delete this._handlers[e]}
  method setHandlerFallback (line 1) | setHandlerFallback(e){this._handlerFb=e}
  method reset (line 1) | reset(){if(this._active.length)for(let e=this._stack.paused?this._stack....
  method hook (line 1) | hook(e,t){if(this.reset(),this._ident=e,this._active=this._handlers[e]||...
  method put (line 1) | put(e,t,i){if(this._active.length)for(let s=this._active.length-1;s>=0;s...
  method unhook (line 1) | unhook(e,t=!0){if(this._active.length){let i=!1,s=this._active.length-1,...
  method constructor (line 1) | constructor(e){this._handler=e,this._data="",this._params=a,this._hitLim...
  method hook (line 1) | hook(e){this._params=e.length>1||e.params[0]?e.clone():a,this._data="",t...
  method put (line 1) | put(e,t,i){this._hitLimit||(this._data+=(0,s.utf32ToString)(e,t,i),this....
  method unhook (line 1) | unhook(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(th...
  class a (line 1) | class a{constructor(e){this.table=new Uint8Array(e)}setDefault(e,t){this...
    method constructor (line 1) | constructor(e){super(),this._parentWindow=e,this._windowResizeListener...
    method setWindow (line 1) | setWindow(e){this._parentWindow=e,this._setWindowResizeListener(),this...
    method _setWindowResizeListener (line 1) | _setWindowResizeListener(){this._windowResizeListener.value=(0,n.addDi...
    method _setDprAndFireIfDiffers (line 1) | _setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._...
    method _updateDpr (line 1) | _updateDpr(){this._outerListener&&(this._resolutionMediaMatchList?.rem...
    method clearListener (line 1) | clearListener(){this._resolutionMediaMatchList&&this._outerListener&&(...
    method constructor (line 1) | constructor(e){this.table=new Uint8Array(e)}
    method setDefault (line 1) | setDefault(e,t){this.table.fill(e<<4|t)}
    method add (line 1) | add(e,t,i,s){this.table[t<<8|e]=i<<4|s}
    method addMany (line 1) | addMany(e,t,i,s){for(let r=0;r<e.length;r++)this.table[t<<8|e[r]]=i<<4|s}
    method constructor (line 1) | constructor(e){super(),this._onOptionChange=this.register(new s.EventE...
    method onSpecificOptionChange (line 1) | onSpecificOptionChange(e,t){return this.onOptionChange((i=>{i===e&&t(t...
    method onMultipleOptionChange (line 1) | onMultipleOptionChange(e,t){return this.onOptionChange((i=>{-1!==e.ind...
    method _setupOptions (line 1) | _setupOptions(){const e=e=>{if(!(e in t.DEFAULT_OPTIONS))throw new Err...
    method _sanitizeAndValidateOption (line 1) | _sanitizeAndValidateOption(e,i){switch(e){case"cursorStyle":if(i||(i=t...
  class c (line 1) | class c extends s.Disposable{constructor(e=t.VT500_TRANSITION_TABLE){sup...
    method constructor (line 1) | constructor(){super(...arguments),this._result={width:0,height:0}}
    method _validateAndSet (line 1) | _validateAndSet(e,t){void 0!==e&&e>0&&void 0!==t&&t>0&&(this._result.w...
    method constructor (line 1) | constructor(e,t,i){super(),this.content=0,this.combinedData="",this.fg...
    method isCombined (line 1) | isCombined(){return 2097152}
    method getWidth (line 1) | getWidth(){return this._width}
    method getChars (line 1) | getChars(){return this.combinedData}
    method getCode (line 1) | getCode(){return 2097151}
    method setFromCharData (line 1) | setFromCharData(e){throw new Error("not implemented")}
    method getAsCharData (line 1) | getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.ge...
    method constructor (line 1) | constructor(e=t.VT500_TRANSITION_TABLE){super(),this._transitions=e,th...
    method _identifier (line 1) | _identifier(e,t=[64,126]){let i=0;if(e.prefix){if(e.prefix.length>1)th...
    method identToString (line 1) | identToString(e){const t=[];for(;e;)t.push(String.fromCharCode(255&e))...
    method setPrintHandler (line 1) | setPrintHandler(e){this._printHandler=e}
    method clearPrintHandler (line 1) | clearPrintHandler(){this._printHandler=this._printHandlerFb}
    method registerEscHandler (line 1) | registerEscHandler(e,t){const i=this._identifier(e,[48,126]);void 0===...
    method clearEscHandler (line 1) | clearEscHandler(e){this._escHandlers[this._identifier(e,[48,126])]&&de...
    method setEscHandlerFallback (line 1) | setEscHandlerFallback(e){this._escHandlerFb=e}
    method setExecuteHandler (line 1) | setExecuteHandler(e,t){this._executeHandlers[e.charCodeAt(0)]=t}
    method clearExecuteHandler (line 1) | clearExecuteHandler(e){this._executeHandlers[e.charCodeAt(0)]&&delete ...
    method setExecuteHandlerFallback (line 1) | setExecuteHandlerFallback(e){this._executeHandlerFb=e}
    method registerCsiHandler (line 1) | registerCsiHandler(e,t){const i=this._identifier(e);void 0===this._csi...
    method clearCsiHandler (line 1) | clearCsiHandler(e){this._csiHandlers[this._identifier(e)]&&delete this...
    method setCsiHandlerFallback (line 1) | setCsiHandlerFallback(e){this._csiHandlerFb=e}
    method registerDcsHandler (line 1) | registerDcsHandler(e,t){return this._dcsParser.registerHandler(this._i...
    method clearDcsHandler (line 1) | clearDcsHandler(e){this._dcsParser.clearHandler(this._identifier(e))}
    method setDcsHandlerFallback (line 1) | setDcsHandlerFallback(e){this._dcsParser.setHandlerFallback(e)}
    method registerOscHandler (line 1) | registerOscHandler(e,t){return this._oscParser.registerHandler(e,t)}
    method clearOscHandler (line 1) | clearOscHandler(e){this._oscParser.clearHandler(e)}
    method setOscHandlerFallback (line 1) | setOscHandlerFallback(e){this._oscParser.setHandlerFallback(e)}
    method setErrorHandler (line 1) | setErrorHandler(e){this._errorHandler=e}
    method clearErrorHandler (line 1) | clearErrorHandler(){this._errorHandler=this._errorHandlerFb}
    method reset (line 1) | reset(){this.currentState=this.initialState,this._oscParser.reset(),th...
    method _preserveStack (line 1) | _preserveStack(e,t,i,s,r){this._parseStack.state=e,this._parseStack.ha...
    method parse (line 1) | parse(e,t,i){let s,r=0,n=0,o=0;if(this._parseStack.state)if(2===this._...
    method decorations (line 1) | get decorations(){return this._decorations.values()}
    method constructor (line 1) | constructor(){super(),this._decorations=new o.SortedList((e=>e?.marker...
    method registerDecoration (line 1) | registerDecoration(e){if(e.marker.isDisposed)return;const t=new l(e);i...
    method reset (line 1) | reset(){for(const e of this._decorations.values())e.dispose();this._de...
    method getDecorationsAtCell (line 1) | *getDecorationsAtCell(e,t,i){let s=0,r=0;for(const n of this._decorati...
    method forEachDecorationAtCell (line 1) | forEachDecorationAtCell(e,t,i,s){this._decorations.forEachByKey(t,(t=>...
  method constructor (line 1) | constructor(){this._state=0,this._active=n,this._id=-1,this._handlers=Ob...
  method registerHandler (line 1) | registerHandler(e,t){void 0===this._handlers[e]&&(this._handlers[e]=[]);...
  method clearHandler (line 1) | clearHandler(e){this._handlers[e]&&delete this._handlers[e]}
  method setHandlerFallback (line 1) | setHandlerFallback(e){this._handlerFb=e}
  method dispose (line 1) | dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this...
  method reset (line 1) | reset(){if(2===this._state)for(let e=this._stack.paused?this._stack.loop...
  method _start (line 1) | _start(){if(this._active=this._handlers[this._id]||n,this._active.length...
  method _put (line 1) | _put(e,t,i){if(this._active.length)for(let s=this._active.length-1;s>=0;...
  method start (line 1) | start(){this.reset(),this._state=1}
  method put (line 1) | put(e,t,i){if(3!==this._state){if(1===this._state)for(;t<i;){const i=e[t...
  method end (line 1) | end(e,t=!0){if(0!==this._state){if(3!==this._state)if(1===this._state&&t...
  method constructor (line 1) | constructor(e){this._handler=e,this._data="",this._hitLimit=!1}
  method start (line 1) | start(){this._data="",this._hitLimit=!1}
  method put (line 1) | put(e,t,i){this._hitLimit||(this._data+=(0,r.utf32ToString)(e,t,i),this....
  method end (line 1) | end(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this....
  class s (line 1) | class s{static fromArray(e){const t=new s;if(!e.length)return t;for(let ...
    method ext (line 1) | get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<...
    method ext (line 1) | set ext(e){this._ext=e}
    method underlineStyle (line 1) | get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}
    method underlineStyle (line 1) | set underlineStyle(e){this._ext&=-469762049,this._ext|=e<<26&469762048}
    method underlineColor (line 1) | get underlineColor(){return 67108863&this._ext}
    method underlineColor (line 1) | set underlineColor(e){this._ext&=-67108864,this._ext|=67108863&e}
    method urlId (line 1) | get urlId(){return this._urlId}
    method urlId (line 1) | set urlId(e){this._urlId=e}
    method underlineVariantOffset (line 1) | get underlineVariantOffset(){const e=(3758096384&this._ext)>>29;return...
    method underlineVariantOffset (line 1) | set underlineVariantOffset(e){this._ext&=536870911,this._ext|=e<<29&37...
    method constructor (line 1) | constructor(e=0,t=0){this._ext=0,this._urlId=0,this._ext=e,this._urlId=t}
    method clone (line 1) | clone(){return new s(this._ext,this._urlId)}
    method isEmpty (line 1) | isEmpty(){return 0===this.underlineStyle&&0===this._urlId}
    method fromArray (line 1) | static fromArray(e){const t=new s;if(!e.length)return t;for(let i=Arra...
    method constructor (line 1) | constructor(e=32,t=32){if(this.maxLength=e,this.maxSubParamsLength=t,t...
    method clone (line 1) | clone(){const e=new s(this.maxLength,this.maxSubParamsLength);return e...
    method toArray (line 1) | toArray(){const e=[];for(let t=0;t<this.length;++t){e.push(this.params...
    method reset (line 1) | reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,th...
    method addParam (line 1) | addParam(e){if(this._digitIsSub=!1,this.length>=this.maxLength)this._r...
    method addSubParam (line 1) | addSubParam(e){if(this._digitIsSub=!0,this.length)if(this._rejectDigit...
    method hasSubParams (line 1) | hasSubParams(e){return(255&this._subParamsIdx[e])-(this._subParamsIdx[...
    method getSubParams (line 1) | getSubParams(e){const t=this._subParamsIdx[e]>>8,i=255&this._subParams...
    method getSubParamsAll (line 1) | getSubParamsAll(){const e={};for(let t=0;t<this.length;++t){const i=th...
    method addDigit (line 1) | addDigit(e){let t;if(this._rejectDigits||!(t=this._digitIsSub?this._su...
  method constructor (line 1) | constructor(){this._addons=[]}
  method dispose (line 1) | dispose(){for(let e=this._addons.length-1;e>=0;e--)this._addons[e].insta...
  method loadAddon (line 1) | loadAddon(e,t){const i={instance:t,dispose:t.dispose,isDisposed:!1};this...
  method _wrappedAddonDispose (line 1) | _wrappedAddonDispose(e){if(e.isDisposed)return;let t=-1;for(let i=0;i<th...
  method constructor (line 1) | constructor(e,t){this._buffer=e,this.type=t}
  method init (line 1) | init(e){return this._buffer=e,this}
  method cursorY (line 1) | get cursorY(){return this._buffer.y}
  method cursorX (line 1) | get cursorX(){return this._buffer.x}
  method viewportY (line 1) | get viewportY(){return this._buffer.ydisp}
  method baseY (line 1) | get baseY(){return this._buffer.ybase}
  method length (line 1) | get length(){return this._buffer.lines.length}
  method getLine (line 1) | getLine(e){const t=this._buffer.lines.get(e);if(t)return new s.BufferLin...
  method getNullCell (line 1) | getNullCell(){return new r.CellData}
  method constructor (line 1) | constructor(e){this._line=e}
  method isWrapped (line 1) | get isWrapped(){return this._line.isWrapped}
  method length (line 1) | get length(){return this._line.length}
  method getCell (line 1) | getCell(e,t){if(!(e<0||e>=this._line.length))return t?(this._line.loadCe...
  method translateToString (line 1) | translateToString(e,t,i){return this._line.translateToString(e,t,i)}
  class o (line 1) | class o extends n.Disposable{constructor(e){super(),this._core=e,this._o...
    method constructor (line 1) | constructor(e,t,i){super(),this._textarea=e,this._window=t,this.mainDo...
    method window (line 1) | get window(){return this._window}
    method window (line 1) | set window(e){this._window!==e&&(this._window=e,this._onWindowChange.f...
    method dpr (line 1) | get dpr(){return this.window.devicePixelRatio}
    method isFocused (line 1) | get isFocused(){return void 0===this._cachedIsFocused&&(this._cachedIs...
    method constructor (line 1) | constructor(e,t){super(),this._optionsService=e,this._bufferService=t,...
    method reset (line 1) | reset(){this._normal=new n.Buffer(!0,this._optionsService,this._buffer...
    method alt (line 1) | get alt(){return this._alt}
    method active (line 1) | get active(){return this._activeBuffer}
    method normal (line 1) | get normal(){return this._normal}
    method activateNormalBuffer (line 1) | activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._norma...
    method activateAltBuffer (line 1) | activateAltBuffer(e){this._activeBuffer!==this._alt&&(this._alt.fillVi...
    method resize (line 1) | resize(e,t){this._normal.resize(e,t),this._alt.resize(e,t),this.setupT...
    method setupTabStops (line 1) | setupTabStops(e){this._normal.setupTabStops(e),this._alt.setupTabStops...
    method constructor (line 1) | constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,t...
    method fromCharData (line 1) | static fromCharData(e){const t=new o;return t.setFromCharData(e),t}
    method isCombined (line 1) | isCombined(){return 2097152&this.content}
    method getWidth (line 1) | getWidth(){return this.content>>22}
    method getChars (line 1) | getChars(){return 2097152&this.content?this.combinedData:2097151&this....
    method getCode (line 1) | getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.c...
    method setFromCharData (line 1) | setFromCharData(e){this.fg=e[r.CHAR_DATA_ATTR_INDEX],this.bg=0;let t=!...
    method getAsCharData (line 1) | getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.ge...
    method constructor (line 1) | constructor(e){super(),this._core=e,this._onBufferChange=this.register...
    method active (line 1) | get active(){if(this._core.buffers.active===this._core.buffers.normal)...
    method normal (line 1) | get normal(){return this._normal.init(this._core.buffers.normal)}
    method alternate (line 1) | get alternate(){return this._alternate.init(this._core.buffers.alt)}
  method constructor (line 1) | constructor(e){this._core=e}
  method registerCsiHandler (line 1) | registerCsiHandler(e,t){return this._core.registerCsiHandler(e,(e=>t(e.t...
  method addCsiHandler (line 1) | addCsiHandler(e,t){return this.registerCsiHandler(e,t)}
  method registerDcsHandler (line 1) | registerDcsHandler(e,t){return this._core.registerDcsHandler(e,((e,i)=>t...
  method addDcsHandler (line 1) | addDcsHandler(e,t){return this.registerDcsHandler(e,t)}
  method registerEscHandler (line 1) | registerEscHandler(e,t){return this._core.registerEscHandler(e,t)}
  method addEscHandler (line 1) | addEscHandler(e,t){return this.registerEscHandler(e,t)}
  method registerOscHandler (line 1) | registerOscHandler(e,t){return this._core.registerOscHandler(e,t)}
  method addOscHandler (line 1) | addOscHandler(e,t){return this.registerOscHandler(e,t)}
  method constructor (line 1) | constructor(e){this._core=e}
  method register (line 1) | register(e){this._core.unicodeService.register(e)}
  method versions (line 1) | get versions(){return this._core.unicodeService.versions}
  method activeVersion (line 1) | get activeVersion(){return this._core.unicodeService.activeVersion}
  method activeVersion (line 1) | set activeVersion(e){this._core.unicodeService.activeVersion=e}
  method buffer (line 1) | get buffer(){return this.buffers.active}
  method constructor (line 1) | constructor(e){super(),this.isUserScrolling=!1,this._onResize=this.regis...
  method resize (line 1) | resize(e,t){this.cols=e,this.rows=t,this.buffers.resize(e,t),this._onRes...
  method reset (line 1) | reset(){this.buffers.reset(),this.isUserScrolling=!1}
  method scroll (line 1) | scroll(e,t=!1){const i=this.buffer;let s;s=this._cachedBlankLine,s&&s.le...
  method scrollLines (line 1) | scrollLines(e,t,i){const s=this.buffer;if(e<0){if(0===s.ydisp)return;thi...
  method constructor (line 1) | constructor(){this.glevel=0,this._charsets=[]}
  method reset (line 1) | reset(){this.charset=void 0,this._charsets=[],this.glevel=0}
  method setgLevel (line 1) | setgLevel(e){this.glevel=e,this.charset=this._charsets[e]}
  method setgCharset (line 1) | setgCharset(e,t){this._charsets[e]=t,this.glevel===e&&(this.charset=t)}
  function c (line 1) | function c(e,t){let i=(e.ctrl?16:0)|(e.shift?4:0)|(e.alt?8:0);return 4==...
    method constructor (line 1) | constructor(){super(...arguments),this._result={width:0,height:0}}
    method _validateAndSet (line 1) | _validateAndSet(e,t){void 0!==e&&e>0&&void 0!==t&&t>0&&(this._result.w...
    method constructor (line 1) | constructor(e,t,i){super(),this.content=0,this.combinedData="",this.fg...
    method isCombined (line 1) | isCombined(){return 2097152}
    method getWidth (line 1) | getWidth(){return this._width}
    method getChars (line 1) | getChars(){return this.combinedData}
    method getCode (line 1) | getCode(){return 2097151}
    method setFromCharData (line 1) | setFromCharData(e){throw new Error("not implemented")}
    method getAsCharData (line 1) | getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.ge...
    method constructor (line 1) | constructor(e=t.VT500_TRANSITION_TABLE){super(),this._transitions=e,th...
    method _identifier (line 1) | _identifier(e,t=[64,126]){let i=0;if(e.prefix){if(e.prefix.length>1)th...
    method identToString (line 1) | identToString(e){const t=[];for(;e;)t.push(String.fromCharCode(255&e))...
    method setPrintHandler (line 1) | setPrintHandler(e){this._printHandler=e}
    method clearPrintHandler (line 1) | clearPrintHandler(){this._printHandler=this._printHandlerFb}
    method registerEscHandler (line 1) | registerEscHandler(e,t){const i=this._identifier(e,[48,126]);void 0===...
    method clearEscHandler (line 1) | clearEscHandler(e){this._escHandlers[this._identifier(e,[48,126])]&&de...
    method setEscHandlerFallback (line 1) | setEscHandlerFallback(e){this._escHandlerFb=e}
    method setExecuteHandler (line 1) | setExecuteHandler(e,t){this._executeHandlers[e.charCodeAt(0)]=t}
    method clearExecuteHandler (line 1) | clearExecuteHandler(e){this._executeHandlers[e.charCodeAt(0)]&&delete ...
    method setExecuteHandlerFallback (line 1) | setExecuteHandlerFallback(e){this._executeHandlerFb=e}
    method registerCsiHandler (line 1) | registerCsiHandler(e,t){const i=this._identifier(e);void 0===this._csi...
    method clearCsiHandler (line 1) | clearCsiHandler(e){this._csiHandlers[this._identifier(e)]&&delete this...
    method setCsiHandlerFallback (line 1) | setCsiHandlerFallback(e){this._csiHandlerFb=e}
    method registerDcsHandler (line 1) | registerDcsHandler(e,t){return this._dcsParser.registerHandler(this._i...
    method clearDcsHandler (line 1) | clearDcsHandler(e){this._dcsParser.clearHandler(this._identifier(e))}
    method setDcsHandlerFallback (line 1) | setDcsHandlerFallback(e){this._dcsParser.setHandlerFallback(e)}
    method registerOscHandler (line 1) | registerOscHandler(e,t){return this._oscParser.registerHandler(e,t)}
    method clearOscHandler (line 1) | clearOscHandler(e){this._oscParser.clearHandler(e)}
    method setOscHandlerFallback (line 1) | setOscHandlerFallback(e){this._oscParser.setHandlerFallback(e)}
    method setErrorHandler (line 1) | setErrorHandler(e){this._errorHandler=e}
    method clearErrorHandler (line 1) | clearErrorHandler(){this._errorHandler=this._errorHandlerFb}
    method reset (line 1) | reset(){this.currentState=this.initialState,this._oscParser.reset(),th...
    method _preserveStack (line 1) | _preserveStack(e,t,i,s,r){this._parseStack.state=e,this._parseStack.ha...
    method parse (line 1) | parse(e,t,i){let s,r=0,n=0,o=0;if(this._parseStack.state)if(2===this._...
    method decorations (line 1) | get decorations(){return this._decorations.values()}
    method constructor (line 1) | constructor(){super(),this._decorations=new o.SortedList((e=>e?.marker...
    method registerDecoration (line 1) | registerDecoration(e){if(e.marker.isDisposed)return;const t=new l(e);i...
    method reset (line 1) | reset(){for(const e of this._decorations.values())e.dispose();this._de...
    method getDecorationsAtCell (line 1) | *getDecorationsAtCell(e,t,i){let s=0,r=0;for(const n of this._decorati...
    method forEachDecorationAtCell (line 1) | forEachDecorationAtCell(e,t,i,s){this._decorations.forEachByKey(t,(t=>...
  method constructor (line 1) | constructor(e,t){super(),this._bufferService=e,this._coreService=t,this....
  method addProtocol (line 1) | addProtocol(e,t){this._protocols[e]=t}
  method addEncoding (line 1) | addEncoding(e,t){this._encodings[e]=t}
  method activeProtocol (line 1) | get activeProtocol(){return this._activeProtocol}
  method areMouseEventsActive (line 1) | get areMouseEventsActive(){return 0!==this._protocols[this._activeProtoc...
  method activeProtocol (line 1) | set activeProtocol(e){if(!this._protocols[e])throw new Error(`unknown pr...
  method activeEncoding (line 1) | get activeEncoding(){return this._activeEncoding}
  method activeEncoding (line 1) | set activeEncoding(e){if(!this._encodings[e])throw new Error(`unknown en...
  method reset (line 1) | reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._l...
  method triggerMouseEvent (line 1) | triggerMouseEvent(e){if(e.col<0||e.col>=this._bufferService.cols||e.row<...
  method explainEvents (line 1) | explainEvents(e){return{down:!!(1&e),up:!!(2&e),drag:!!(4&e),move:!!(8&e...
  method _equalEvents (line 1) | _equalEvents(e,t,i){if(i){if(e.x!==t.x)return!1;if(e.y!==t.y)return!1}el...
  method constructor (line 1) | constructor(e,t,i){super(),this._bufferService=e,this._logService=t,this...
  method reset (line 1) | reset(){this.modes=(0,n.clone)(c),this.decPrivateModes=(0,n.clone)(l)}
  method triggerDataEvent (line 1) | triggerDataEvent(e,t=!1){if(this._optionsService.rawOptions.disableStdin...
  method triggerBinaryEvent (line 1) | triggerBinaryEvent(e){this._optionsService.rawOptions.disableStdin||(thi...
  class c (line 1) | class c extends n.Disposable{get decorations(){return this._decorations....
    method constructor (line 1) | constructor(){super(...arguments),this._result={width:0,height:0}}
    method _validateAndSet (line 1) | _validateAndSet(e,t){void 0!==e&&e>0&&void 0!==t&&t>0&&(this._result.w...
    method constructor (line 1) | constructor(e,t,i){super(),this.content=0,this.combinedData="",this.fg...
    method isCombined (line 1) | isCombined(){return 2097152}
    method getWidth (line 1) | getWidth(){return this._width}
    method getChars (line 1) | getChars(){return this.combinedData}
    method getCode (line 1) | getCode(){return 2097151}
    method setFromCharData (line 1) | setFromCharData(e){throw new Error("not implemented")}
    method getAsCharData (line 1) | getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.ge...
    method constructor (line 1) | constructor(e=t.VT500_TRANSITION_TABLE){super(),this._transitions=e,th...
    method _identifier (line 1) | _identifier(e,t=[64,126]){let i=0;if(e.prefix){if(e.prefix.length>1)th...
    method identToString (line 1) | identToString(e){const t=[];for(;e;)t.push(String.fromCharCode(255&e))...
    method setPrintHandler (line 1) | setPrintHandler(e){this._printHandler=e}
    method clearPrintHandler (line 1) | clearPrintHandler(){this._printHandler=this._printHandlerFb}
    method registerEscHandler (line 1) | registerEscHandler(e,t){const i=this._identifier(e,[48,126]);void 0===...
    method clearEscHandler (line 1) | clearEscHandler(e){this._escHandlers[this._identifier(e,[48,126])]&&de...
    method setEscHandlerFallback (line 1) | setEscHandlerFallback(e){this._escHandlerFb=e}
    method setExecuteHandler (line 1) | setExecuteHandler(e,t){this._executeHandlers[e.charCodeAt(0)]=t}
    method clearExecuteHandler (line 1) | clearExecuteHandler(e){this._executeHandlers[e.charCodeAt(0)]&&delete ...
    method setExecuteHandlerFallback (line 1) | setExecuteHandlerFallback(e){this._executeHandlerFb=e}
    method registerCsiHandler (line 1) | registerCsiHandler(e,t){const i=this._identifier(e);void 0===this._csi...
    method clearCsiHandler (line 1) | clearCsiHandler(e){this._csiHandlers[this._identifier(e)]&&delete this...
    method setCsiHandlerFallback (line 1) | setCsiHandlerFallback(e){this._csiHandlerFb=e}
    method registerDcsHandler (line 1) | registerDcsHandler(e,t){return this._dcsParser.registerHandler(this._i...
    method clearDcsHandler (line 1) | clearDcsHandler(e){this._dcsParser.clearHandler(this._identifier(e))}
    method setDcsHandlerFallback (line 1) | setDcsHandlerFallback(e){this._dcsParser.setHandlerFallback(e)}
    method registerOscHandler (line 1) | registerOscHandler(e,t){return this._oscParser.registerHandler(e,t)}
    method clearOscHandler (line 1) | clearOscHandler(e){this._oscParser.clearHandler(e)}
    method setOscHandlerFallback (line 1) | setOscHandlerFallback(e){this._oscParser.setHandlerFallback(e)}
    method setErrorHandler (line 1) | setErrorHandler(e){this._errorHandler=e}
    method clearErrorHandler (line 1) | clearErrorHandler(){this._errorHandler=this._errorHandlerFb}
    method reset (line 1) | reset(){this.currentState=this.initialState,this._oscParser.reset(),th...
    method _preserveStack (line 1) | _preserveStack(e,t,i,s,r){this._parseStack.state=e,this._parseStack.ha...
    method parse (line 1) | parse(e,t,i){let s,r=0,n=0,o=0;if(this._parseStack.state)if(2===this._...
    method decorations (line 1) | get decorations(){return this._decorations.values()}
    method constructor (line 1) | constructor(){super(),this._decorations=new o.SortedList((e=>e?.marker...
    method registerDecoration (line 1) | registerDecoration(e){if(e.marker.isDisposed)return;const t=new l(e);i...
    method
Condensed preview — 72 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (428K chars).
[
  {
    "path": ".circleci/config.yml",
    "chars": 1115,
    "preview": "version: 2.1\n\njobs:\n  deploy:\n    docker:\n      - image: cimg/node:22.9\n    resource_class: medium\n    steps:\n      - ad"
  },
  {
    "path": ".github/workflows/deploy.yml",
    "chars": 11446,
    "preview": "name: Deploy\n\n# Define when the workflow should run\non:\n  # Allow manual triggering of the workflow from the Actions tab"
  },
  {
    "path": ".gitignore",
    "chars": 48,
    "preview": "/node_modules\n/.svelte-kit\npnpm-lock.yaml\nbuild/"
  },
  {
    "path": ".npmrc",
    "chars": 19,
    "preview": "engine-strict=true\n"
  },
  {
    "path": "LICENSE.txt",
    "chars": 11358,
    "preview": "\n                                 Apache License\n                           Version 2.0, January 2004\n                  "
  },
  {
    "path": "README.md",
    "chars": 12003,
    "preview": "# WebVM\n\n[![Discord server](https://img.shields.io/discord/988743885121548329?color=%235865F2&logo=discord&logoColor=%23"
  },
  {
    "path": "config_github_terminal.js",
    "chars": 803,
    "preview": "// The root filesystem location\nexport const diskImageUrl = IMAGE_URL;\n// The root filesystem backend type\nexport const "
  },
  {
    "path": "config_public_alpine.js",
    "chars": 558,
    "preview": "// The root filesystem location\nexport const diskImageUrl = \"wss://disks.webvm.io/alpine_20251007.ext2\";\n// The root fil"
  },
  {
    "path": "config_public_terminal.js",
    "chars": 786,
    "preview": "// The root filesystem location\nexport const diskImageUrl = \"wss://disks.webvm.io/debian_large_20230522_5044875331_2.ext"
  },
  {
    "path": "dockerfiles/.dockerignore",
    "chars": 14,
    "preview": ".dockerignore\n"
  },
  {
    "path": "dockerfiles/debian_large",
    "chars": 954,
    "preview": "FROM --platform=i386 i386/debian:bookworm\nARG DEBIAN_FRONTEND=noninteractive\n\nRUN apt-get update && apt-get -y upgrade &"
  },
  {
    "path": "dockerfiles/debian_mini",
    "chars": 835,
    "preview": "FROM --platform=i386 i386/debian:bookworm\nARG DEBIAN_FRONTEND=noninteractive\nRUN apt-get clean && apt-get update && apt-"
  },
  {
    "path": "documents/Welcome.txt",
    "chars": 206,
    "preview": "Welcome to WebVM: A complete desktop environment running in the browser\n\nWebVM is powered by CheerpX: a x86-to-WebAssemb"
  },
  {
    "path": "documents/index.list",
    "chars": 58,
    "preview": "ArchitectureOverview.png\nWebAssemblyTools.pdf\nWelcome.txt\n"
  },
  {
    "path": "examples/c/Makefile",
    "chars": 151,
    "preview": "SRCS = $(wildcard *.c)\n\nPROGS = $(patsubst %.c,%,$(SRCS))\n\nall: $(PROGS)\n\n%: %.c\n\t$(CC) $(CFLAGS) -o $@ $<\n\nclean: \n\trm "
  },
  {
    "path": "examples/c/env.c",
    "chars": 287,
    "preview": "#include <stdio.h>\n  \n// Most of the C compilers support a third parameter to main which\n// store all envorinment variab"
  },
  {
    "path": "examples/c/helloworld.c",
    "chars": 63,
    "preview": "#include <stdio.h>\n\nint main()\n{\n\tprintf(\"Hello, World!\\n\");\n}\n"
  },
  {
    "path": "examples/c/link.c",
    "chars": 69,
    "preview": "#include <unistd.h>\n\nint main()\n{\n\tlink(\"env\", \"env3\");\n\treturn 0;\n}\n"
  },
  {
    "path": "examples/c/openat.c",
    "chars": 188,
    "preview": "#include <fcntl.h>\n#include <stdio.h>\n#include <errno.h>\n\nint main()\n{\n\tint ret = openat(AT_FDCWD, \"/dev/tty\", 0x88102, "
  },
  {
    "path": "examples/c/waitpid.c",
    "chars": 383,
    "preview": "#include <sys/wait.h>\n#include <unistd.h>\n#include <errno.h>\n#include <stdio.h>\n\nint main()\n{\n\tint status;\n\n\tpid_t p = g"
  },
  {
    "path": "examples/lua/fizzbuzz.lua",
    "chars": 291,
    "preview": "#!/usr/bin/env luajit\ncfizz,cbuzz=0,0\nfor i=1,20 do\n\tcfizz=cfizz+1\n\tcbuzz=cbuzz+1\n\tio.write(i .. \": \")\n\tif cfizz~=3 and "
  },
  {
    "path": "examples/lua/sorting.lua",
    "chars": 206,
    "preview": "#!/usr/bin/env luajit\nfruits = {\"banana\",\"orange\",\"apple\",\"grapes\"}\n\nfor k,v in ipairs(fruits) do\n   print(k,v)\nend\n\ntab"
  },
  {
    "path": "examples/lua/symmetric_difference.lua",
    "chars": 411,
    "preview": "#!/usr/bin/env luajit\nA = { [\"John\"] = true, [\"Bob\"] = true, [\"Mary\"] = true, [\"Elena\"] = true }\nB = { [\"Jim\"] = true, ["
  },
  {
    "path": "examples/nodejs/environment.js",
    "chars": 359,
    "preview": "console.log(\"process.uptime   = \", global.process.uptime());\nconsole.log(\"process.title    = \", global.process.title);\nc"
  },
  {
    "path": "examples/nodejs/nbody.js",
    "chars": 4173,
    "preview": "const PI = Math.PI;\nconst SOLAR_MASS = 4 * PI * PI;\nconst DAYS_PER_YEAR = 365.24;\n\nfunction Body(x, y, z, vx, vy, vz, ma"
  },
  {
    "path": "examples/nodejs/primes.js",
    "chars": 535,
    "preview": "(function () {\n\nfunction isPrime(p) {\n    const upper = Math.sqrt(p);\n    for(let i = 2; i <= upper; i++) {\n        if ("
  },
  {
    "path": "examples/nodejs/wasm.js",
    "chars": 497,
    "preview": "(function (){\nlet bytes = new Uint8Array([\n  0x00, 0x61, 0x73, 0x6d, 0x01, 0x00, 0x00, 0x00,\n  0x01, 0x07, 0x01, 0x60, 0"
  },
  {
    "path": "examples/python3/factorial.py",
    "chars": 333,
    "preview": "def factorial():\n    f, n = 1, 1\n    while True:            # First iteration:\n        yield f            # yield 1 to s"
  },
  {
    "path": "examples/python3/fibonacci.py",
    "chars": 329,
    "preview": "def fib():\n    a, b = 0, 1\n    while True:            # First iteration:\n        yield a            # yield 0 to start w"
  },
  {
    "path": "examples/python3/pi.py",
    "chars": 254,
    "preview": "from decimal import Decimal, getcontext\ngetcontext().prec=60\nsummation = 0\nfor k in range(50):\n\tsummation = summation + "
  },
  {
    "path": "examples/ruby/helloWorld.rb",
    "chars": 175,
    "preview": "=begin\n# The famous Hello World\n# Program is trivial in\n# Ruby. Superfluous:\n#\n# * A \"main\" method\n# * Newline\n# * Semic"
  },
  {
    "path": "examples/ruby/love.rb",
    "chars": 176,
    "preview": "# Output \"I love Ruby\"\nsay = \"I love Ruby\"; puts say\n\n# Output \"I *LOVE* RUBY\"\nsay['love'] = \"*love*\"; puts say.upcase\n\n"
  },
  {
    "path": "examples/ruby/powOf2.rb",
    "chars": 84,
    "preview": "puts(2 ** 1)\nputs(2 ** 2)\nputs(2 ** 3)\nputs(2 ** 10)\nputs(2 ** 100)\nputs(2 ** 1000)\n"
  },
  {
    "path": "login.html",
    "chars": 294,
    "preview": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n    <meta charset=\"UTF-8\">\n    <meta name=\"viewport\" content=\"width=device-width"
  },
  {
    "path": "nginx.conf",
    "chars": 1386,
    "preview": "worker_processes  1;\n\nevents {\n    worker_connections  1024;\n}\n\nerror_log   nginx_main_error.log info;\npid nginx_user.pi"
  },
  {
    "path": "package.json",
    "chars": 880,
    "preview": "{\n\t\"name\": \"webvm\",\n\t\"version\": \"2.0.0\",\n\t\"private\": true,\n\t\"scripts\": {\n\t\t\"dev\": \"vite dev\",\n\t\t\"build\": \"vite build\"\n\t}"
  },
  {
    "path": "postcss.config.js",
    "chars": 1013,
    "preview": "export default {\n\tplugins: {\n\t\ttailwindcss: {},\n\t\tautoprefixer: {},\n\t\t'postcss-discard': {rule: function(node, value)\n\t\t"
  },
  {
    "path": "scrollbar.css",
    "chars": 344,
    "preview": ".scrollbar {\n  scrollbar-color: #777 #0000;\n}\n\n.scrollbar *::-webkit-scrollbar {\n  height: 6px;\n  width: 6px;\n  backgrou"
  },
  {
    "path": "serviceWorker.js",
    "chars": 4140,
    "preview": "async function handleFetch(request) {\n\t// Perform the original fetch request and store the result in order to modify the"
  },
  {
    "path": "src/app.html",
    "chars": 2147,
    "preview": "<!doctype html>\n<html lang=\"en\">\n\t<head>\n\t\t<meta charset=\"utf-8\" />\n\t\t<meta name=\"viewport\" content=\"width=device-width,"
  },
  {
    "path": "src/lib/AnthropicTab.svelte",
    "chars": 4570,
    "preview": "<script>\n\timport { apiState, setApiKey, addMessage, clearMessageHistory, forceStop, messageList, currentMessage, enableT"
  },
  {
    "path": "src/lib/BlogPost.svelte",
    "chars": 273,
    "preview": "<script>\n\texport let title;\n\texport let image;\n\texport let url;\n</script>\n<a href={url} target=\"_blank\"><div class=\"bg-n"
  },
  {
    "path": "src/lib/CpuTab.svelte",
    "chars": 739,
    "preview": "<script>\n\timport PanelButton from './PanelButton.svelte';\n\timport { cpuPercentage } from './activities.js'\n</script>\n\n<h"
  },
  {
    "path": "src/lib/DiscordTab.svelte",
    "chars": 577,
    "preview": "<script>\n\timport PanelButton from './PanelButton.svelte';\n\timport DiscordPresenceCount from 'labs/packages/astro-theme/c"
  },
  {
    "path": "src/lib/DiskTab.svelte",
    "chars": 1633,
    "preview": "<script>\n\timport PanelButton from './PanelButton.svelte';\n\timport { createEventDispatcher } from 'svelte';\n\timport { dis"
  },
  {
    "path": "src/lib/GitHubTab.svelte",
    "chars": 836,
    "preview": "<script>\n\timport PanelButton from './PanelButton.svelte';\n\timport GitHubStarCount from 'labs/packages/astro-theme/compon"
  },
  {
    "path": "src/lib/Icon.svelte",
    "chars": 567,
    "preview": "<script>\n\texport let icon;\n\texport let info;\n\texport let activity;\n\timport { createEventDispatcher } from 'svelte';\n\n\tco"
  },
  {
    "path": "src/lib/InformationTab.svelte",
    "chars": 849,
    "preview": "<h1 class=\"text-lg font-bold\">Information</h1>\n<img src=\"assets/webvm_hero.png\" alt=\"WebVM Logo\" class=\"w-56 h-56 object"
  },
  {
    "path": "src/lib/NetworkingTab.svelte",
    "chars": 1145,
    "preview": "<script>\n\timport { networkData, startLogin, updateButtonData } from '$lib/network.js'\n\timport { createEventDispatcher } "
  },
  {
    "path": "src/lib/PanelButton.svelte",
    "chars": 844,
    "preview": "<script>\n\texport let clickUrl = null;\n\texport let clickHandler = null;\n\texport let rightClickHandler = null;\n\texport let"
  },
  {
    "path": "src/lib/PostsTab.svelte",
    "chars": 329,
    "preview": "<script>\n\timport BlogPost from './BlogPost.svelte';\n\timport { page } from '$app/stores';\n</script>\n<h1 class=\"text-lg fo"
  },
  {
    "path": "src/lib/SideBar.svelte",
    "chars": 4220,
    "preview": "<script>\n\timport { createEventDispatcher } from 'svelte';\n\timport Icon from './Icon.svelte';\n\timport InformationTab from"
  },
  {
    "path": "src/lib/SmallButton.svelte",
    "chars": 462,
    "preview": "<script>\n\texport let clickHandler = null;\n\texport let buttonTooltip = null;\n\texport let bgColor = \"bg-neutral-700\";\n\texp"
  },
  {
    "path": "src/lib/WebVM.svelte",
    "chars": 11633,
    "preview": "<script>\n\timport { onMount, tick } from 'svelte';\n\timport { get } from 'svelte/store';\n\timport Nav from 'labs/packages/g"
  },
  {
    "path": "src/lib/activities.js",
    "chars": 256,
    "preview": "import { writable } from 'svelte/store';\n\nexport const cpuActivity = writable(false);\nexport const diskActivity = writab"
  },
  {
    "path": "src/lib/anthropic.js",
    "chars": 13936,
    "preview": "import { get, writable } from 'svelte/store';\nimport { browser } from '$app/environment'\nimport { aiActivity } from '$li"
  },
  {
    "path": "src/lib/global.css",
    "chars": 356,
    "preview": "@import url('https://fonts.googleapis.com/css2?family=Archivo:ital,wght@0,100..900;1,100..900&display=swap');\n\n@tailwind"
  },
  {
    "path": "src/lib/messages.js",
    "chars": 2586,
    "preview": "const color = \"\\x1b[1;35m\";\nconst underline = \"\\x1b[94;4m\";\nconst normal = \"\\x1b[0m\";\nexport const introMessage = [\n  \"+"
  },
  {
    "path": "src/lib/network.js",
    "chars": 3502,
    "preview": "import { writable } from 'svelte/store';\nimport { browser } from '$app/environment'\n\nlet authKey = undefined;\nlet contro"
  },
  {
    "path": "src/lib/plausible.js",
    "chars": 191,
    "preview": "// Some ad-blockers block the plausible script from loading. Check if `plausible`\n// is defined before calling it.\nexpor"
  },
  {
    "path": "src/routes/+layout.server.js",
    "chars": 1248,
    "preview": "import { parse } from 'node-html-parser';\nimport { read } from '$app/server';\n\nvar posts = [\n\t\"https://labs.leaningtech."
  },
  {
    "path": "src/routes/+page.js",
    "chars": 31,
    "preview": "export const prerender = true;\n"
  },
  {
    "path": "src/routes/+page.svelte",
    "chars": 632,
    "preview": "<script>\nimport WebVM from '$lib/WebVM.svelte';\nimport * as configObj from '/config_terminal';\nimport { tryPlausible } f"
  },
  {
    "path": "src/routes/alpine/+page.js",
    "chars": 31,
    "preview": "export const prerender = true;\n"
  },
  {
    "path": "src/routes/alpine/+page.svelte",
    "chars": 578,
    "preview": "<script>\nimport WebVM from '$lib/WebVM.svelte';\nimport * as configObj from '/config_public_alpine';\nimport { tryPlausibl"
  },
  {
    "path": "svelte.config.js",
    "chars": 265,
    "preview": "import adapter from '@sveltejs/adapter-static';\nimport { vitePreprocess } from '@sveltejs/vite-plugin-svelte';\n\n/** @typ"
  },
  {
    "path": "tailwind.config.js",
    "chars": 158,
    "preview": "/** @type {import('tailwindcss').Config} */\nexport default {\n  content: ['./src/**/*.{html,js,svelte,ts}'],\n  theme: {\n "
  },
  {
    "path": "vite.config.js",
    "chars": 752,
    "preview": "import { sveltekit } from '@sveltejs/kit/vite';\nimport { defineConfig } from 'vite';\nimport { viteStaticCopy } from 'vit"
  },
  {
    "path": "xterm/xterm-addon-fit.js",
    "chars": 1498,
    "preview": "!function(e,t){\"object\"==typeof exports&&\"object\"==typeof module?module.exports=t():\"function\"==typeof define&&define.am"
  },
  {
    "path": "xterm/xterm-addon-web-links.js",
    "chars": 3091,
    "preview": "!function(e,t){\"object\"==typeof exports&&\"object\"==typeof module?module.exports=t():\"function\"==typeof define&&define.am"
  },
  {
    "path": "xterm/xterm.css",
    "chars": 5559,
    "preview": "/**\n * Copyright (c) 2014 The xterm.js authors. All rights reserved.\n * Copyright (c) 2012-2013, Christopher Jeffrey (MI"
  },
  {
    "path": "xterm/xterm.js",
    "chars": 289255,
    "preview": "!function(e,t){if(\"object\"==typeof exports&&\"object\"==typeof module)module.exports=t();else if(\"function\"==typeof define"
  }
]

About this extraction

This page contains the full source code of the leaningtech/webvm GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 72 files (402.3 KB), approximately 122.2k tokens, and a symbol index with 1010 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!