[
  {
    "path": ".commitlintrc",
    "content": "{\n  \"extends\": [\n    \"@commitlint/config-conventional\"\n  ],\n  \"rules\": {\n    \"type-enum\": [\n      2,\n      \"always\",\n      [\n        \"build\",\n        \"ci\",\n        \"chore\",\n        \"docs\",\n        \"feat\",\n        \"fix\",\n        \"perf\",\n        \"refactor\",\n        \"revert\",\n        \"style\",\n        \"test\"\n      ]\n    ],\n  }\n}\n"
  },
  {
    "path": ".gitattributes",
    "content": "test/fixtures/markdown-crlf.md eol=crlf\nbuild/** linguist-language=txt"
  },
  {
    "path": ".github/FUNDING.yml",
    "content": "github: antonmedv\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/bug.yml",
    "content": "name: Bug Report\ndescription: File a bug report.\ntitle: '[Bug]: '\nlabels: ['bug']\nassignees:\n  - antongolub\nbody:\n  - type: markdown\n    attributes:\n      value: |\n        Thanks for taking the time to fill out this bug report!\n\n  - type: textarea\n    id: what-happened\n    attributes:\n      label: What happened?\n      placeholder: Tell us what you see.\n      value: 'A bug happened!'\n    validations:\n      required: true\n\n  - type: textarea\n    id: what-expected\n    attributes:\n      label: How it should work?\n      description: Also tell us, what did you expect to happen?\n      value: \"Here's how it should work...\"\n    validations:\n      required: true\n\n  - type: textarea\n    id: steps-to-reproduce\n    attributes:\n      label: How to reproduce the bug?\n      description: Show an example.\n      value: 'Step-by-step instructions to reproduce the behavior. Code snippet, gist or issue-demo repository are helpful'\n    validations:\n      required: true\n\n  - type: input\n    id: version\n    attributes:\n      label: Version\n      description: What zx version are you running?\n      placeholder: e.g. 0.0.0\n    validations:\n      required: true\n\n  - type: dropdown\n    id: os\n    attributes:\n      label: What's OS kind?\n      multiple: true\n      options:\n        - Linux\n        - Mac\n        - Windows\n\n  - type: dropdown\n    id: runtime\n    attributes:\n      label: What JS runtime is used?\n      multiple: true\n      options:\n        - Node.js\n        - Deno\n        - Bun\n        - GraalVM\n\n  - type: input\n    id: runtime-version\n    attributes:\n      label: Runtime Version\n      description: What JS runtime version are you running?\n      placeholder: e.g. 0.0.0\n\n  - type: textarea\n    id: logs\n    attributes:\n      label: Error stack / relevant log output\n      description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks.\n      render: shell\n\n  - type: checkboxes\n    id: terms\n    attributes:\n      label: Code of Conduct\n      description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/google/zx?tab=coc-ov-file).\n      options:\n        - label: I agree to follow this project's Code of Conduct\n          required: true\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/idea.yml",
    "content": "name: Feature Request\ndescription: Idea, feature request or proposal.\ntitle: '[Idea]: '\nlabels: ['feature']\nassignees:\n  - antonmedv\n\nbody:\n  - type: markdown\n    attributes:\n      value: |\n        Thanks for sharing your vision!\n\n  - type: textarea\n    id: idea\n    attributes:\n      label: What's your idea?\n      placeholder: Tell us what you'd like to add or improve.\n      value: 'A new shiny feature!'\n    validations:\n      required: true\n\n  - type: textarea\n    id: why\n    attributes:\n      label: Why is that needed? How it may be useful?\n      placeholder: What problem does it solve?.\n      value: 'It will make something easier because...'\n    validations:\n      required: true\n\n  - type: textarea\n    id: demo\n    attributes:\n      label: Maybe you have a demo or example?\n      value: 'API sketch, code snippet'\n      render: ts\n    validations:\n      required: false\n"
  },
  {
    "path": ".github/PULL_REQUEST_TEMPLATE.md",
    "content": "<!-- It's a good idea to open an issue first for discussion. -->\n\nFixes #issue / suggests an improvement\n\n<!-- Usage demo -->\n```ts\nimport {$} from 'zx'\n\n```\n- [ ] **Setup** Set the latest Node.js LTS version.\n- [ ] **Build**: I’ve run `npm build` before committing and verified the bundle updates correctly.\n- [ ] **Tests**: I’ve `run test` and confirmed all tests succeed. Added tests to cover my changes if needed.\n- [ ] **Docs**: I’ve added or updated relevant documentation as needed.\n- [ ] **Sign** Commits have [verified signatures](https://docs.github.com/en/enterprise-cloud@latest/authentication/managing-commit-signature-verification/about-commit-signature-verification) and follow [conventinal commits spec](https://www.conventionalcommits.org/en/v1.0.0/)\n- [ ] **CoC**: My changes follow [the project’s coding guidelines and Code of Conduct](https://github.com/google/zx?tab=coc-ov-file).  \n- [ ] **Review**: This PR represents original work and is not solely generated by AI tools.\n"
  },
  {
    "path": ".github/SECURITY.md",
    "content": "# Security Policy\n\n## Supported Versions\n| Version | Status             | Comment                                                               |\n|---------|--------------------|-----------------------------------------------------------------------|\n| 8.x     | :white_check_mark: |                                                                       | \n| 7.x     | :warning:          | Bugs, vulnerabilities, compatibility enhancements, performance issues |\n| 6.x     | :warning:          | Critical bugs and vulnerability fixes                                 |\n| < 6.0   | :x:                | **No longer supported**, please consider upgrade options              |\n\n\n## Reporting a Vulnerability\nPlease use https://g.co/vulnz to report security vulnerabilities.\n\nWe use https://g.co/vulnz for our intake and triage. For valid issues we will do coordination and disclosure here on\nGitHub (including using a GitHub Security Advisory when necessary).\n\nThe Google Security Team will process your report within a day, and respond within a week (although it will depend on the severity of your report).\n"
  },
  {
    "path": ".github/codeql/codeql-config.yml",
    "content": "paths:\n  - .github\n  - docs\n  - examples\n  - man\n  - src\n  - scripts\n  - test\n  - test-d\npaths-ignore:\n  - build\n"
  },
  {
    "path": ".github/pages/index.html",
    "content": "Here be dragons\n"
  },
  {
    "path": ".github/workflows/codeql.yml",
    "content": "name: 'CodeQL Advanced'\n\non:\n  push:\n    branches: ['main']\n  pull_request:\n    branches: ['main']\n  schedule:\n    - cron: '28 6 * * 3'\n\npermissions: {}\n\njobs:\n  analyze:\n    name: Analyze (${{ matrix.language }})\n    runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}\n    timeout-minutes: 60\n    permissions:\n      # required for all workflows\n      security-events: write\n\n      # required to fetch internal or private CodeQL packs\n      packages: read\n\n      # only required for workflows in private repositories\n      actions: read\n      contents: read\n\n    strategy:\n      fail-fast: false\n      matrix:\n        include:\n          - language: javascript-typescript\n            build-mode: none\n    steps:\n      - name: Checkout repository\n        uses: actions/checkout@v6\n        with:\n          persist-credentials: false\n\n      - name: Initialize CodeQL\n        uses: github/codeql-action/init@v4\n        with:\n          config-file: ./.github/codeql/codeql-config.yml\n          languages: ${{ matrix.language }}\n          build-mode: ${{ matrix.build-mode }}\n\n      - if: matrix.build-mode == 'manual'\n        shell: bash\n        run: |\n          echo 'If you are using a \"manual\" build mode for one or more of the' \\\n            'languages you are analyzing, replace this with the commands to build' \\\n            'your code, for example:'\n          echo '  make bootstrap'\n          echo '  make release'\n          exit 1\n\n      - name: Perform CodeQL Analysis\n        uses: github/codeql-action/analyze@v4\n        with:\n          category: '/language:${{matrix.language}}'\n"
  },
  {
    "path": ".github/workflows/dev-publish.yml",
    "content": "name: Dev Publish\n\non:\n  workflow_dispatch:\n\npermissions: {}\n\nenv:\n  npm_config_audit: false\n  npm_config_fund: false\n\njobs:\n  build:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v6\n        with:\n          persist-credentials: false\n      - uses: actions/setup-node@v6\n        with:\n          node-version: 24\n          cache: 'npm'\n      - run: npm ci\n      - run: npm test\n        env:\n          FORCE_COLOR: 3\n      - uses: actions/upload-artifact@v6\n        with:\n          name: build-${{ github.run_id }}\n          path: |\n            build\n            jsr.json\n            package.json\n            package-lite.json\n            package-main.json\n          retention-days: 1\n\n  version:\n    runs-on: ubuntu-latest\n    outputs:\n      v: ${{ steps.ref.outputs.ZX_VERSION }}\n      lite: ${{ steps.ref.outputs.ZX_VERSION }}-lite\n      dev: ${{ steps.ref.outputs.ZX_VERSION }}-dev.${{ steps.ref.outputs.SHA_SHORT }}\n      lite-dev: ${{ steps.ref.outputs.ZX_VERSION }}-lite-dev.${{ steps.ref.outputs.SHA_SHORT }}\n    steps:\n      - uses: actions/checkout@v6\n        with:\n          persist-credentials: false\n      - id: ref\n        run: |\n          echo SHA_SHORT=$(git rev-parse --short HEAD) >> $GITHUB_OUTPUT\n          echo ZX_VERSION=$(jq -r '.version' package.json) >> $GITHUB_OUTPUT\n\n  npm-publish:\n    needs: [build, version]\n    runs-on: ubuntu-latest\n    permissions:\n      checks: read\n      statuses: write\n      contents: write\n      packages: write\n      id-token: write\n    env:\n      GOOGLE_NPM_REGISTRY: wombat-dressing-room.appspot.com\n      GOOGLE_NPM_TOKEN: ${{ secrets.AUTH_TOKEN }}\n      GH_NPM_REGISTRY: npm.pkg.github.com\n      GH_NPM_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n      ZX_VERSION: ${{ needs.version.outputs.v }}\n      ZX_DEV_VERSION: ${{ needs.version.outputs.dev }}\n      ZX_LITE_DEV_VERSION: ${{ needs.version.outputs.lite-dev }}\n    steps:\n      - uses: actions/checkout@v6\n        with:\n          persist-credentials: false\n      - uses: actions/setup-node@v6\n        with:\n          node-version: 24\n          cache: 'npm'\n      - name: Configure npmrc\n        run: |\n          echo \"//${{ env.GOOGLE_NPM_REGISTRY }}/:_authToken=$GOOGLE_NPM_TOKEN\" >> .npmrc\n          echo \"//${{ env.GH_NPM_REGISTRY }}/:_authToken=$GH_NPM_TOKEN\" >> .npmrc\n\n      - uses: actions/download-artifact@v7\n        with:\n          name: build-${{ github.run_id }}\n\n      - name: pushing lite snapshot to ${{ env.GOOGLE_NPM_REGISTRY }}\n        run: |\n          mv -f package-lite.json package.json\n          cat <<< $(jq '.version=\"${ZX_LITE_DEV_VERSION}\"' package.json) > package.json\n          npm publish --provenance --access=public --no-git-tag-version --tag dev --registry https://${{ env.GOOGLE_NPM_REGISTRY }}\n\n      - name: pushing to ${{ env.GOOGLE_NPM_REGISTRY }}\n        run: |\n          mv -f package-main.json package.json\n          cat <<< $(jq '.version=\"${ZX_DEV_VERSION}\"' package.json) > package.json\n          npm publish --provenance --access=public --no-git-tag-version --tag dev --registry https://${{ env.GOOGLE_NPM_REGISTRY }}\n\n      - name: pushing to ${{ env.GH_NPM_REGISTRY }}\n        run: |\n          cat <<< $(jq '.name=\"@${{ github.repository }}\"' package.json) > package.json\n          npm publish --no-git-tag-version --access=public --tag dev --registry https://${{ env.GH_NPM_REGISTRY }}\n\n  jsr-publish:\n    needs: [build, version]\n    runs-on: ubuntu-latest\n    permissions:\n      contents: read\n      id-token: write\n    env:\n      ZX_DEV_VERSION: ${{ needs.version.outputs.dev }}\n    steps:\n      - uses: actions/checkout@v6\n        with:\n          persist-credentials: false\n      - uses: actions/setup-node@v6\n        with:\n          node-version: 24\n          cache: 'npm'\n      - uses: actions/download-artifact@v7\n        with:\n          name: build-${{ github.run_id }}\n      - name: pushing to jsr.io\n        run: |\n          cat <<< $(jq '.version=\"${ZX_DEV_VERSION}\"' jsr.json) > jsr.json\n          npx jsr publish --allow-dirty\n\n  # https://docs.github.com/en/actions/use-cases-and-examples/publishing-packages/publishing-docker-images\n  docker-publish:\n    needs: [build, version]\n    runs-on: ubuntu-latest\n    # Sets the permissions granted to the `GITHUB_TOKEN` for the actions in this job.\n    permissions:\n      contents: read\n      packages: write\n      attestations: write\n      id-token: write\n\n    # Defines two custom environment variables for the workflow. These are used for the Container registry domain, and a name for the Docker image that this workflow builds.\n    env:\n      REGISTRY: ghcr.io\n      IMAGE_NAME: ${{ github.repository }}\n      ZX_DEV_VERSION: ${{ needs.version.outputs.dev }}\n    steps:\n      - name: Checkout repository\n        uses: actions/checkout@v6\n        with:\n          persist-credentials: false\n\n      - uses: actions/download-artifact@v7\n        with:\n          name: build-${{ github.run_id }}\n\n      # Uses the `docker/login-action` action to log in to the Container registry using the account and password that will publish the packages. Once published, the packages are scoped to the account defined here.\n      - name: Log in to the Container registry\n        uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0\n        with:\n          registry: ${{ env.REGISTRY }}\n          username: ${{ github.actor }}\n          password: ${{ secrets.GITHUB_TOKEN }}\n      # This step uses [docker/metadata-action](https://github.com/docker/metadata-action#about) to extract tags and labels that will be applied to the specified image. The `id` \"meta\" allows the output of this step to be referenced in a subsequent step. The `images` value provides the base name for the tags and labels.\n      - name: Extract metadata (tags, labels) for Docker\n        id: meta\n        uses: docker/metadata-action@c299e40c65443455700f0fdfc63efafe5b349051 # v5.10.0\n        with:\n          images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}\n          tags: |\n            type=sha\n            type=semver,pattern={{version}},value=v${{ env.ZX_DEV_VERSION }}\n      # This step uses the `docker/build-push-action` action to build the image, based on your repository's `Dockerfile`. If the build succeeds, it pushes the image to GitHub Packages.\n      # It uses the `context` parameter to define the build's context as the set of files located in the specified path. For more information, see [Usage](https://github.com/docker/build-push-action#usage) in the README of the `docker/build-push-action` repository.\n      # It uses the `tags` and `labels` parameters to tag and label the image with the output from the \"meta\" step.\n      - name: Build and push Docker image\n        id: push\n        uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 #v6.18.0\n        with:\n          context: ./\n          file: ./dcr/Dockerfile\n          push: true\n          tags: ${{ steps.meta.outputs.tags }}\n          labels: ${{ steps.meta.outputs.labels }}\n\n      # This step generates an artifact attestation for the image, which is an unforgeable statement about where and how it was built. It increases supply chain security for people who consume the image. For more information, see [Using artifact attestations to establish provenance for builds](/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds).\n      - name: Generate artifact attestation\n        uses: actions/attest-build-provenance@v3\n        with:\n          subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}\n          subject-digest: ${{ steps.push.outputs.digest }}\n          push-to-registry: true\n"
  },
  {
    "path": ".github/workflows/docs.yml",
    "content": "name: Deploy docs\non:\n  workflow_dispatch:\n  release:\n    types: [created]\n\nconcurrency:\n  group: 'pages'\n  cancel-in-progress: false\n\npermissions: {}\n\nenv:\n  npm_config_audit: false\n  npm_config_fund: false\n  npm_config_save: false\n  npm_config_package_lock: false\n\njobs:\n  deploy:\n    permissions:\n      contents: read\n      pages: write\n      id-token: write\n    environment:\n      name: github-pages\n      url: ${{ steps.deployment.outputs.page_url }}\n    runs-on: ubuntu-latest\n    steps:\n      - name: Checkout\n        uses: actions/checkout@v6\n        with:\n          persist-credentials: false\n          ref: main\n\n      - name: Setup Pages\n        uses: actions/configure-pages@v5\n\n      - name: Install deps\n        run: npm ci\n\n      - name: Add additional deps\n        run: npm i @rollup/rollup-linux-x64-gnu@4.46.4\n\n      - name: Build docs\n        run: npm run docs:build\n\n      - name: Upload artifact\n        uses: actions/upload-pages-artifact@v4.0.0\n        with:\n          path: 'docs/build'\n\n      - name: Deploy to GitHub Pages\n        id: deployment\n        uses: actions/deploy-pages@v4\n"
  },
  {
    "path": ".github/workflows/jsr-publish.yml",
    "content": "name: JSR Manual Publish\n\non:\n  workflow_dispatch:\n\npermissions: {}\n\njobs:\n  build:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v6\n        with:\n          persist-credentials: false\n      - uses: actions/setup-node@v6\n        with:\n          node-version: 24\n          cache: 'npm'\n      - run: npm ci\n      - run: npm test\n        env:\n          FORCE_COLOR: 3\n      - uses: actions/upload-artifact@v6\n        with:\n          name: build-${{ github.run_id }}\n          path: |\n            build\n            jsr.json\n          retention-days: 1\n\n  jsr-publish:\n    needs: build\n    runs-on: ubuntu-latest\n    permissions:\n      contents: read\n      id-token: write\n    steps:\n      - uses: actions/checkout@v6\n        with:\n          persist-credentials: false\n      - uses: actions/setup-node@v6\n        with:\n          node-version: 24\n          cache: 'npm'\n      - uses: actions/download-artifact@v7\n        with:\n          name: build-${{ github.run_id }}\n\n      - name: Get zx version info\n        run: |\n          echo SHA_SHORT=$(git rev-parse --short HEAD) >> $GITHUB_ENV\n          echo ZX_VERSION=$(jq -r '.version' jsr.json) >> $GITHUB_ENV\n\n      - name: pushing to jsr.io\n        run: |\n          cat <<< $(jq '.version=\"${ZX_VERSION}-dev.${SHA_SHORT}\"' jsr.json) > jsr.json\n          npx jsr publish --allow-dirty\n"
  },
  {
    "path": ".github/workflows/osv.yml",
    "content": "# This workflow uses actions that are not certified by GitHub.\n# They are provided by a third-party and are governed by\n# separate terms of service, privacy policy, and support\n# documentation.\n\n# A sample workflow which sets up periodic OSV-Scanner scanning for vulnerabilities,\n# in addition to a PR check which fails if new vulnerabilities are introduced.\n#\n# For more examples and options, including how to ignore specific vulnerabilities,\n# see https://google.github.io/osv-scanner/github-action/\n\nname: OSV-Scanner\n\npermissions: {}\n\non:\n  pull_request:\n    branches: ['main']\n  merge_group:\n    branches: ['main']\n  schedule:\n    - cron: '45 6 * * 5'\n  push:\n    branches: ['main']\n\njobs:\n  scan-scheduled:\n    if: ${{ github.event_name == 'push' || github.event_name == 'schedule' }}\n    permissions:\n      security-events: write\n      contents: read\n      actions: read\n    uses: 'google/osv-scanner-action/.github/workflows/osv-scanner-reusable.yml@e92b5d07338d4f0ba0981dffed17c48976ca4730' # v2.2.3\n    with:\n      # Example of specifying custom arguments\n      scan-args: |-\n        -r\n        ./\n  scan-pr:\n    if: ${{ github.event_name == 'pull_request' || github.event_name == 'merge_group' }}\n    permissions:\n      security-events: write\n      contents: read\n      actions: read\n    uses: 'google/osv-scanner-action/.github/workflows/osv-scanner-reusable-pr.yml@e92b5d07338d4f0ba0981dffed17c48976ca4730' # v2.2.3\n    with:\n      # Example of specifying custom arguments\n      scan-args: |-\n        -r\n        ./\n"
  },
  {
    "path": ".github/workflows/publish.yml",
    "content": "name: Publish\n\non:\n  workflow_dispatch:\n  release:\n    types: [created]\n\npermissions: {}\n\nenv:\n  npm_config_audit: false\n  npm_config_fund: false\n\njobs:\n  build:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v6\n        with:\n          persist-credentials: false\n      - uses: actions/setup-node@v6\n        with:\n          node-version: 24\n          cache: 'npm'\n      - name: Compare release tag with package.json\n        if: github.event_name == 'release'\n        run: |\n          RELEASE_VERSION=${GITHUB_REF#refs/tags/}\n          PKG_VERSION=$(node -p \"require('./package.json').version\")\n\n          echo \"Release tag: $RELEASE_VERSION\"\n          echo \"package.json: $PKG_VERSION\"\n\n          [ \"$RELEASE_VERSION\" = \"$PKG_VERSION\" ] || { echo \"❌ Mismatch\"; exit 1; }\n\n      - run: npm ci\n      - run: npm test\n        env:\n          FORCE_COLOR: 3\n      - uses: actions/upload-artifact@v6\n        with:\n          name: build-${{ github.run_id }}\n          path: |\n            build\n            jsr.json\n            package.json\n            package-lite.json\n            package-main.json\n          retention-days: 1\n\n  version:\n    runs-on: ubuntu-latest\n    outputs:\n      v: ${{ steps.ref.outputs.ZX_VERSION }}\n      lite: ${{ steps.ref.outputs.ZX_VERSION }}-lite\n    steps:\n      - uses: actions/checkout@v6\n        with:\n          persist-credentials: false\n      - id: ref\n        run: |\n          echo SHA_SHORT=$(git rev-parse --short HEAD) >> $GITHUB_OUTPUT\n          echo ZX_VERSION=$(jq -r '.version' package.json) >> $GITHUB_OUTPUT\n\n  npm-publish:\n    needs: [build, version]\n    runs-on: ubuntu-latest\n    permissions:\n      checks: read\n      statuses: write\n      contents: write\n      packages: write\n      id-token: write\n    env:\n      GOOGLE_NPM_REGISTRY: wombat-dressing-room.appspot.com\n      GOOGLE_NPM_TOKEN: ${{ secrets.AUTH_TOKEN }}\n      GH_NPM_REGISTRY: npm.pkg.github.com\n      GH_NPM_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n      ZX_VERSION: ${{ needs.version.outputs.v }}\n    steps:\n      - uses: actions/checkout@v6\n        with:\n          persist-credentials: false\n      - uses: actions/setup-node@v6\n        with:\n          node-version: 24\n          cache: 'npm'\n      - name: Configure npmrc\n        run: |\n          echo \"//${{ env.GOOGLE_NPM_REGISTRY }}/:_authToken=$GOOGLE_NPM_TOKEN\" >> .npmrc\n          echo \"//${{ env.GH_NPM_REGISTRY }}/:_authToken=$GH_NPM_TOKEN\" >> .npmrc\n      - uses: actions/download-artifact@v7\n        with:\n          name: build-${{ github.run_id }}\n\n      - name: pushing to ${{ env.GOOGLE_NPM_REGISTRY }}\n        run: |\n          mv -f package-main.json package.json\n          npm publish --provenance --access=public --registry https://${{ env.GOOGLE_NPM_REGISTRY }}\n\n      - name: pushing to ${{ env.GH_NPM_REGISTRY }}\n        run: |\n          cat <<< $(jq '.name=\"@${{ github.repository }}\"' package.json) > package.json\n          npm publish --no-git-tag-version --access=public --registry https://${{ env.GH_NPM_REGISTRY }}\n\n      - name: pushing lite snapshot to ${{ env.GOOGLE_NPM_REGISTRY }}\n        run: |\n          mv -f package-lite.json package.json\n          npm publish --provenance --access=public --no-git-tag-version --tag lite --registry https://${{ env.GOOGLE_NPM_REGISTRY }}\n\n  jsr-publish:\n    needs: build\n    runs-on: ubuntu-latest\n    permissions:\n      contents: read\n      id-token: write\n    steps:\n      - uses: actions/checkout@v6\n        with:\n          persist-credentials: false\n      - uses: actions/setup-node@v6\n        with:\n          node-version: 24\n          cache: 'npm'\n      - uses: actions/download-artifact@v7\n        with:\n          name: build-${{ github.run_id }}\n      - name: pushing to jsr.io\n        run: npx jsr publish --allow-dirty\n\n  docker-publish:\n    needs: [build, version]\n    runs-on: ubuntu-latest\n    # Defines two custom environment variables for the workflow. These are used for the Container registry domain, and a name for the Docker image that this workflow builds.\n    env:\n      REGISTRY: ghcr.io\n      IMAGE_NAME: ${{ github.repository }}\n      ZX_VERSION: ${{ needs.version.outputs.v }}\n\n    permissions:\n      contents: read\n      packages: write\n      attestations: write\n      id-token: write\n    steps:\n      - name: Checkout repository\n        uses: actions/checkout@v6\n        with:\n          persist-credentials: false\n\n      - uses: actions/download-artifact@v7\n        with:\n          name: build-${{ github.run_id }}\n\n      - name: Log in to the Container registry\n        uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0\n        with:\n          registry: ${{ env.REGISTRY }}\n          username: ${{ github.actor }}\n          password: ${{ secrets.GITHUB_TOKEN }}\n      - name: Extract metadata (tags, labels) for Docker\n        id: meta\n        uses: docker/metadata-action@c299e40c65443455700f0fdfc63efafe5b349051 # v5.10.0\n        with:\n          images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}\n          tags: |\n            type=sha\n            type=semver,pattern={{version}},value=v${{ env.ZX_VERSION }}\n      - name: Build and push Docker image\n        id: push\n        uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 #v6.18.0\n        with:\n          context: ./\n          file: ./dcr/Dockerfile\n          push: true\n          tags: ${{ steps.meta.outputs.tags }}\n          labels: ${{ steps.meta.outputs.labels }}\n\n      - name: Generate artifact attestation\n        uses: actions/attest-build-provenance@v3\n        with:\n          subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}\n          subject-digest: ${{ steps.push.outputs.digest }}\n          push-to-registry: true\n"
  },
  {
    "path": ".github/workflows/test.yml",
    "content": "name: Test\n\non:\n  push:\n  pull_request:\n  schedule:\n    - cron: '0 12 */4 * *'\n\npermissions:\n  contents: read\n\nenv:\n  npm_config_audit: false\n  npm_config_fund: false\n  npm_config_save: false\n  npm_config_package_lock: false\n\njobs:\n  build:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v6\n        with:\n          persist-credentials: false\n\n      - name: Use Node.js 24\n        uses: actions/setup-node@v6\n        with:\n          node-version: 24\n          cache: 'npm'\n\n      - run: npm ci\n      - run: |\n          npm run build\n          cd build && ls -l\n      - uses: actions/upload-artifact@v6\n        with:\n          name: build\n          path: |\n            build\n            jsr.json\n            package.json\n            package-lite.json\n            package-main.json\n          retention-days: 1\n\n  checks:\n    needs: build\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v6\n        with:\n          persist-credentials: false\n          fetch-depth: ${{ github.event_name == 'pull_request' && '15' || '1' }} # to ensure we have enough history for commitlint\n\n      - name: Use Node.js 24\n        uses: actions/setup-node@v6\n        with:\n          node-version: 24\n          cache: 'npm'\n\n      - uses: actions/download-artifact@v7\n        with:\n          name: build\n      - run: npm ci\n\n      - name: Format\n        run: npm run fmt:check\n\n      - name: License\n        run: npm run test:license\n\n      - name: Size\n        run: npm run test:size\n\n      - name: Dep audit\n        run: npm run test:audit\n\n      - name: Circular\n        run: npm run test:circular\n\n      - name: Bundles\n        run: npm run test:npm\n        timeout-minutes: 1\n\n      - name: JSR dry-run\n        run: npm run test:jsr\n\n      - name: Conventional Commits\n        if: github.event_name == 'pull_request'\n        env:\n          BASE_SHA: ${{ github.event.pull_request.base.sha }}\n          HEAD_SHA: ${{ github.event.pull_request.head.sha }}\n        run: npx commitlint --from \"$BASE_SHA\" --to \"$HEAD_SHA\" --verbose\n\n  test:\n    needs: build\n    runs-on: ubuntu-latest\n    env:\n      FORCE_COLOR: 3\n\n    steps:\n      - uses: actions/checkout@v6\n        with:\n          persist-credentials: false\n\n      - name: Use Node.js 24\n        uses: actions/setup-node@v6\n        with:\n          node-version: 24\n          cache: 'npm'\n\n      - uses: actions/download-artifact@v7\n        with:\n          name: build\n      - run: npm ci\n\n      - name: Unit tests\n        run: npm run test:coverage\n        timeout-minutes: 1\n\n      - name: Type tests\n        run: npm run test:types\n\n  docker-test:\n    needs: build\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v6\n        with:\n          persist-credentials: false\n\n      - uses: actions/download-artifact@v7\n        with:\n          name: build\n      - run: |\n          npm run build:dcr\n          npm run test:dcr\n\n  smoke-win32-node16:\n    strategy:\n      matrix:\n        os: [windows-2022, windows-2025]\n    name: smoke-${{ matrix.os }}-node16\n    runs-on: ${{ matrix.os }}\n    needs: build\n    steps:\n      - uses: actions/checkout@v6\n        with:\n          persist-credentials: false\n\n      - name: Use Node.js 16\n        uses: actions/setup-node@v6\n        with:\n          node-version: 16\n          cache: 'npm'\n\n      - uses: actions/download-artifact@v7\n        with:\n          name: build\n\n      - run: npm run test:smoke:win32\n        timeout-minutes: 2\n        env:\n          FORCE_COLOR: 3\n\n  smoke-bun:\n    runs-on: ubuntu-latest\n    needs: build\n    steps:\n      - uses: actions/checkout@v6\n        with:\n          persist-credentials: false\n\n      - name: Setup Bun\n        uses: antongolub/action-setup-bun@f0b9f339a7ce9ba1174a58484e4dc9bbd6f7b133 # v1.13.2\n      - uses: actions/download-artifact@v7\n        with:\n          name: build\n      - run: |\n          bun test ./test/smoke/bun.test.js\n          bun ./test/smoke/ts.test.ts\n        timeout-minutes: 1\n        env:\n          FORCE_COLOR: 3\n\n  smoke-deno:\n    runs-on: ubuntu-latest\n    needs: build\n    name: smoke-deno${{ matrix.deno-version }}\n    strategy:\n      matrix:\n        deno-version: [1, 2]\n    steps:\n      - uses: actions/checkout@v6\n        with:\n          persist-credentials: false\n      - name: Setup Deno\n        uses: denoland/setup-deno@909cc5acb0fdd60627fb858598759246509fa755 # v2.0.2\n        with:\n          deno-version: ${{ matrix.deno-version }}\n      - run: deno install npm:types/node npm:types/fs-extra\n      - uses: actions/download-artifact@v7\n        with:\n          name: build\n      - run: deno test --allow-read --allow-sys --allow-env --allow-run ./test/smoke/deno.test.js\n        timeout-minutes: 1\n        env:\n          FORCE_COLOR: 3\n\n  smoke-node:\n    runs-on: ubuntu-latest\n    needs: build\n    name: smoke-node${{ matrix.node-version }}\n    strategy:\n      matrix:\n        node-version: [12, 14, 16, 18, 20, 22, 24, 25-nightly]\n    steps:\n      - uses: actions/checkout@v6\n        with:\n          persist-credentials: false\n      - name: Use Node.js ${{ matrix.node-version }}\n        uses: actions/setup-node@v6\n        with:\n          node-version: ${{ matrix.node-version }}\n          cache: 'npm'\n      - uses: actions/download-artifact@v7\n        with:\n          name: build\n      - name: cjs smoke test\n        run: npm run test:smoke:cjs\n      - name: mjs smoke test\n        run: npm run test:smoke:mjs\n      - name: strip-types\n        if: matrix.node-version >= 22\n        run: npm run test:smoke:strip-types\n\n  smoke-graal:\n    needs: build\n    runs-on: ubuntu-latest\n    name: smoke-graal${{ matrix.version }}\n    strategy:\n      matrix:\n        version: [17, 20]\n    steps:\n      - uses: actions/checkout@v6\n        with:\n          persist-credentials: false\n      - uses: graalvm/setup-graalvm@54b4f5a65c1a84b2fdfdc2078fe43df32819e4b1 # v1.4.4\n        with:\n          java-version: ${{ matrix.version }}\n          distribution: 'graalvm-community'\n          components: 'nodejs'\n          github-token: ${{ secrets.GITHUB_TOKEN }}\n      - uses: actions/download-artifact@v7\n        with:\n          name: build\n      - name: smoke tests\n        run: |\n          which node\n          node -v\n          npm run test:smoke:cjs\n\n  smoke-ts:\n    runs-on: ubuntu-latest\n    needs: build\n    name: smoke-ts${{ matrix.ts }}\n    strategy:\n      matrix:\n        ts: [4, 5, rc, next]\n    steps:\n      - uses: actions/checkout@v6\n        with:\n          persist-credentials: false\n      - name: Use Node.js 24\n        uses: actions/setup-node@v6\n        with:\n          node-version: 24\n          cache: 'npm'\n\n      - name: Install deps\n        run: npm ci\n      - name: Install TypeScript ${{ matrix.ts }}\n        run: npm i --force typescript@${{ matrix.ts }}\n      - name: Override @types/node\n        if: matrix.ts == 4\n        run: npm i --force @types/node@24.2.0\n\n      - uses: actions/download-artifact@v7\n        with:\n          name: build\n      - name: tsc\n        run: npm run test:smoke:tsc\n      - name: tsx\n        run: npm run test:smoke:tsx\n      - name: ts-node\n        run: npm run test:smoke:ts-node\n"
  },
  {
    "path": ".github/workflows/zizmor.yml",
    "content": "name: Zizmor\n\non:\n  push:\n    branches: ['main']\n  pull_request:\n    branches: ['**']\n\npermissions: {}\n\njobs:\n  zizmor:\n    name: zizmor\n    runs-on: ubuntu-latest\n    permissions:\n      contents: read\n      actions: read\n    steps:\n      - name: Checkout repository\n        uses: actions/checkout@v6\n        with:\n          persist-credentials: false\n\n      - name: Install the latest version of uv\n        uses: astral-sh/setup-uv@61cb8a9741eeb8a550a1b8544337180c0fc8476b #v7.2.0\n        with:\n          enable-cache: false\n\n      - name: Run zizmor\n        run: uvx zizmor@1.22.0 .github/workflows -v -p --min-severity=medium\n"
  },
  {
    "path": ".gitignore",
    "content": "node_modules/\ncoverage/\npackage/\nreports/\ndocs/.vitepress/cache/\nyarn.lock\npnpm-lock.yaml\ntemp\ntest/fixtures/ts-project/build/\njsr.json\n.npmrc\npackage-lite.json\npackage-main.json\n"
  },
  {
    "path": ".node_version",
    "content": "24"
  },
  {
    "path": ".nycrc",
    "content": "{\n  \"reporter\": [\"html\", \"text\"],\n  \"lines\": 98,\n  \"branches\": \"90\",\n  \"statements\": \"98\",\n  \"exclude\": [\n    \"build/deno.js\",\n    \"build/vendor-extra.cjs\",\n    \"build/vendor-core.cjs\",\n    \"build/esblib.cjs\",\n    \"test/**\",\n    \"scripts\",\n    \"src/util.ts\",\n    \"src/core.ts\",\n    \"src/index.ts\",\n    \"src/vendor-extra.ts\"\n  ]\n}\n"
  },
  {
    "path": ".prettierignore",
    "content": "node_modules/\nbuild/\ncoverage/\npackage/\nreports/\npackage-lock.json\nyarn.lock\n*.md\n"
  },
  {
    "path": ".size-limit.json",
    "content": "[\n  {\n    \"name\": \"zx-lite\",\n    \"path\": [\n      \"build/3rd-party-licenses\",\n      \"build/core.cjs\",\n      \"build/core.d.ts\",\n      \"build/core.js\",\n      \"build/deno.js\",\n      \"build/error.d.ts\",\n      \"build/esblib.cjs\",\n      \"build/internals.cjs\",\n      \"build/internals.d.ts\",\n      \"build/log.d.ts\",\n      \"build/util.cjs\",\n      \"build/util.d.ts\",\n      \"build/vendor-core.cjs\",\n      \"build/vendor-core.d.ts\",\n      \"README.md\",\n      \"LICENSE\"\n    ],\n    \"limit\": \"128.85 kB\",\n    \"brotli\": false,\n    \"gzip\": false\n  },\n  {\n    \"name\": \"js parts\",\n    \"path\": [\n      \"build/*.cjs\",\n      \"build/cli.js\",\n      \"build/core.js\",\n      \"build/index.js\",\n      \"build/globals.js\",\n      \"build/deno.js\"\n    ],\n    \"limit\": \"850.20 kB\",\n    \"brotli\": false,\n    \"gzip\": false\n  },\n  {\n    \"name\": \"libdefs\",\n    \"path\": \"build/*.d.ts\",\n    \"limit\": \"44.55 kB\",\n    \"brotli\": false,\n    \"gzip\": false\n  },\n  {\n    \"name\": \"vendor\",\n    \"path\": \"build/vendor-*.{cjs,d.ts}\",\n    \"limit\": \"803.10 kB\",\n    \"brotli\": false,\n    \"gzip\": false\n  },\n  {\n    \"name\": \"all\",\n    \"path\": [\n      \"build/3rd-party-licenses\",\n      \"build/*.cjs\",\n      \"build/*.d.ts\",\n      \"build/cli.js\",\n      \"build/core.js\",\n      \"build/index.js\",\n      \"build/globals.js\",\n      \"build/deno.js\",\n      \"man/*\",\n      \"README.md\",\n      \"LICENSE\"\n    ],\n    \"limit\": \"911.85 kB\",\n    \"brotli\": false,\n    \"gzip\": false\n  }\n]\n"
  },
  {
    "path": "LICENSE",
    "content": "\n                                 Apache License\n                           Version 2.0, January 2004\n                        http://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   APPENDIX: How to apply the Apache License to your work.\n\n      To apply the Apache License to your work, attach the following\n      boilerplate notice, with the fields enclosed by brackets \"[]\"\n      replaced with your own identifying information. (Don't include\n      the brackets!)  The text should be enclosed in the appropriate\n      comment syntax for the file format. We also recommend that a\n      file or class name and description of purpose be included on the\n      same \"printed page\" as the copyright notice for easier\n      identification within third-party archives.\n\n   Copyright [yyyy] [name of copyright owner]\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n"
  },
  {
    "path": "README.md",
    "content": "<h1><img src=\"https://google.github.io/zx/img/logo.svg\" alt=\"Zx logo\" height=\"32\" width=\"28\" valign=\"middle\"> zx</h1>\n\n```js\n#!/usr/bin/env zx\n\nawait $`cat package.json | grep name`\n\nconst branch = await $`git branch --show-current`\nawait $`dep deploy --branch=${branch}`\n\nawait Promise.all([\n  $`sleep 1; echo 1`,\n  $`sleep 2; echo 2`,\n  $`sleep 3; echo 3`,\n])\n\nconst name = 'foo bar'\nawait $`mkdir /tmp/${name}`\n```\n\nBash is great, but when it comes to writing more complex scripts,\nmany people prefer a more convenient programming language.\nJavaScript is a perfect choice, but the Node.js standard library\nrequires additional hassle before using. No compromise, take the best of both. The `zx` package provides\nuseful cross-platform wrappers around `child_process`, escapes arguments and\ngives sensible defaults.\n\n## Install\n\n```bash\nnpm install zx\n```\nAll setup options: [zx/setup](https://google.github.io/zx/setup).\nSee also [**zx@lite**](https://google.github.io/zx/lite).\n\n## Usage\n\n* [Documentation at google.github.io/zx/](https://google.github.io/zx/)\n* [Code examples](https://github.com/google/zx/tree/main/examples)\n\n## Compatibility\n* Linux, macOS, or Windows\n* JavaScript Runtime:\n    * Node.js >= 12.17.0\n    * Bun >= 1.0.0\n    * Deno 1.x, 2.x\n    * GraalVM Node.js\n* Some kind of [bash or PowerShell](https://google.github.io/zx/shell)\n* [Both CJS or ESM](https://google.github.io/zx/setup#hybrid) modules in [JS or TS](https://google.github.io/zx/typescript)\n\n\n## See also\n\n- 🔥 [crow.watch](https://crow.watch) — a computing-focused community, link aggregation and discussion, [join](http://crow.watch/join/zx).\n\n## License\n\n[Apache-2.0](LICENSE)\n\nDisclaimer: _This is not an officially supported Google product._\n"
  },
  {
    "path": "build/3rd-party-licenses",
    "content": "THIRD PARTY LICENSES\n\n@nodelib/fs.scandir@2.1.5\n  <unknown>\n  https://github.com/nodelib/nodelib/tree/master/packages/fs/fs.scandir\n  MIT\n\n@nodelib/fs.stat@2.0.5\n  <unknown>\n  https://github.com/nodelib/nodelib/tree/master/packages/fs/fs.stat\n  MIT\n\n@nodelib/fs.walk@1.2.8\n  <unknown>\n  https://github.com/nodelib/nodelib/tree/master/packages/fs/fs.walk\n  MIT\n\n@sindresorhus/merge-streams@4.0.0\n  Sindre Sorhus <sindresorhus@gmail.com>\n  sindresorhus/merge-streams\n  MIT\n\n@webpod/ps@1.0.0\n  <unknown>\n  git://github.com/webpod/ps.git\n  MIT\n\nbraces@3.0.3\n  Jon Schlinkert (https://github.com/jonschlinkert)\n  micromatch/braces\n  MIT\n\nchalk@5.6.2\n  <unknown>\n  chalk/chalk\n  MIT\n\ncreate-require@1.1.1\n  Maël Nison <nison.mael@gmail.com>, Paul Soporan <paul.soporan@gmail.com>, Pooya Parsa <pyapar@gmail.com>\n  nuxt-contrib/create-require\n  MIT\n\nenvapi@0.2.3\n  Anton Golub <antongolub@antongolub.com>\n  git+https://github.com/webpod/envapi.git\n  MIT\n\nfast-glob@3.3.3\n  Denis Malinochkin <undefined>\n  mrmlnc/fast-glob\n  MIT\n\nfastq@1.20.1\n  Matteo Collina <hello@matteocollina.com>\n  git+https://github.com/mcollina/fastq.git\n  ISC\n\nfill-range@7.1.1\n  Jon Schlinkert (https://github.com/jonschlinkert)\n  jonschlinkert/fill-range\n  MIT\n\nfs-extra@11.3.3\n  JP Richardson <jprichardson@gmail.com>\n  https://github.com/jprichardson/node-fs-extra\n  MIT\n\nglob-parent@5.1.2\n  Gulp Team <team@gulpjs.com> (https://gulpjs.com/)\n  gulpjs/glob-parent\n  ISC\n\nglobby@16.1.1\n  Sindre Sorhus <sindresorhus@gmail.com>\n  sindresorhus/globby\n  MIT\n\ngraceful-fs@4.2.11\n  <unknown>\n  https://github.com/isaacs/node-graceful-fs\n  ISC\n\nis-glob@4.0.3\n  Jon Schlinkert (https://github.com/jonschlinkert)\n  micromatch/is-glob\n  MIT\n\nis-path-inside@4.0.0\n  Sindre Sorhus <sindresorhus@gmail.com>\n  sindresorhus/is-path-inside\n  MIT\n\nisexe@4.0.0\n  Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)\n  https://github.com/isaacs/isexe\n  BlueOak-1.0.0\n\njsonfile@6.2.0\n  JP Richardson <jprichardson@gmail.com>\n  git@github.com:jprichardson/node-jsonfile.git\n  MIT\n\nmaml.js@0.0.3\n  Anton Medvedev <anton@medv.io>\n  git+https://github.com/maml-dev/maml.js.git\n  MIT\n\nmerge2@1.4.1\n  <unknown>\n  git@github.com:teambition/merge2.git\n  MIT\n\nmicromatch@4.0.8\n  Jon Schlinkert (https://github.com/jonschlinkert)\n  micromatch/micromatch\n  MIT\n\nnode-fetch-native@1.6.7\n  <unknown>\n  unjs/node-fetch-native\n  MIT\n\npicomatch@2.3.1\n  Jon Schlinkert (https://github.com/jonschlinkert)\n  micromatch/picomatch\n  MIT\n\nrun-parallel@1.2.0\n  Feross Aboukhadijeh <feross@feross.org>\n  git://github.com/feross/run-parallel.git\n  MIT\n\nto-regex-range@5.0.1\n  Jon Schlinkert (https://github.com/jonschlinkert)\n  micromatch/to-regex-range\n  MIT\n\nunicorn-magic@0.4.0\n  Sindre Sorhus <sindresorhus@gmail.com>\n  sindresorhus/unicorn-magic\n  MIT\n\nwhich@6.0.1\n  GitHub Inc.\n  git+https://github.com/npm/node-which.git\n  ISC\n\nyaml@2.8.2\n  Eemeli Aro <eemeli@gmail.com>\n  github:eemeli/yaml\n  ISC\n\nzurk@0.11.10\n  Anton Golub <antongolub@antongolub.com>\n  git+https://github.com/webpod/zurk.git\n  MIT\n"
  },
  {
    "path": "build/cli.cjs",
    "content": "#!/usr/bin/env node\n\"use strict\";\nconst {\n  __export,\n  __toESM,\n  __toCommonJS,\n  __async\n} = require('./esblib.cjs');\n\nconst import_meta_url =\n  typeof document === 'undefined'\n    ? new (require('url').URL)('file:' + __filename).href\n    : (document.currentScript && document.currentScript.src) ||\n      new URL('main.js', document.baseURI).href\n\n\n// src/cli.ts\nvar cli_exports = {};\n__export(cli_exports, {\n  argv: () => argv,\n  autorun: () => autorun,\n  injectGlobalRequire: () => injectGlobalRequire,\n  isMain: () => isMain,\n  main: () => main,\n  normalizeExt: () => normalizeExt,\n  printUsage: () => printUsage,\n  transformMarkdown: () => transformMarkdown\n});\nmodule.exports = __toCommonJS(cli_exports);\nvar import_node_url = __toESM(require(\"url\"), 1);\nvar import_node_process2 = __toESM(require(\"process\"), 1);\nvar import_index = require(\"./index.cjs\");\nvar import_deps = require(\"./deps.cjs\");\n\n// src/repl.ts\nvar import_node_process = __toESM(require(\"process\"), 1);\nvar import_node_repl = __toESM(require(\"repl\"), 1);\nvar import_node_util = require(\"util\");\nvar import_core = require(\"./core.cjs\");\nvar _a;\nvar HISTORY = (_a = import_node_process.default.env.ZX_REPL_HISTORY) != null ? _a : import_core.path.join(import_core.os.homedir(), \".zx_repl_history\");\nfunction startRepl() {\n  return __async(this, arguments, function* (history = HISTORY) {\n    import_core.defaults.verbose = false;\n    const r = import_node_repl.default.start({\n      prompt: import_core.chalk.greenBright.bold(\"\\u276F \"),\n      useGlobal: true,\n      preview: false,\n      writer(output) {\n        return output instanceof import_core.ProcessOutput ? output.toString().trimEnd() : (0, import_node_util.inspect)(output, { colors: true });\n      }\n    });\n    r.setupHistory(history, () => {\n    });\n  });\n}\n\n// src/cli.ts\nvar import_util2 = require(\"./util.cjs\");\n\n// src/md.ts\nvar import_util = require(\"./util.cjs\");\nfunction transformMarkdown(buf) {\n  var _a2;\n  const out = [];\n  const tabRe = /^(  +|\\t)/;\n  const fenceRe = new RegExp(\"^(?<indent> {0,3})(?<fence>(`{3,20}|~{3,20}))(?:(?<js>js|javascript|ts|typescript)|(?<bash>sh|shell|bash)|.*)$\");\n  let state = \"root\";\n  let prevEmpty = true;\n  let fenceChar = \"\";\n  let stripRe = null;\n  let endRe = /^$/;\n  let linePrefix = \"\";\n  let closeOut = \"\";\n  const isEnd = (s) => fenceChar !== \"\" && endRe.test(s);\n  for (const line of (0, import_util.bufToString)(buf).split(/\\r\\n|[\\n\\r\\u2028\\u2029]/)) {\n    switch (state) {\n      case \"root\": {\n        const g = (_a2 = line.match(fenceRe)) == null ? void 0 : _a2.groups;\n        if (g == null ? void 0 : g.fence) {\n          fenceChar = g.fence[0];\n          stripRe = g.indent ? new RegExp(`^ {0,${g.indent.length}}`) : null;\n          endRe = new RegExp(`^ {0,3}${fenceChar}{${g.fence.length},}[ \\\\t]*$`);\n          if (g.js) {\n            out.push(\"\");\n            linePrefix = \"\";\n            closeOut = \"\";\n          } else if (g.bash) {\n            out.push(\"await $`\");\n            linePrefix = \"\";\n            closeOut = \"`\";\n          } else {\n            out.push(\"\");\n            linePrefix = \"// \";\n            closeOut = \"\";\n          }\n          state = \"fence\";\n          prevEmpty = false;\n          break;\n        }\n        if (prevEmpty && tabRe.test(line)) {\n          out.push(line);\n          state = \"tab\";\n          continue;\n        }\n        prevEmpty = line === \"\";\n        out.push(\"// \" + line);\n        continue;\n      }\n      case \"tab\":\n        if (line === \"\") out.push(\"\");\n        else if (tabRe.test(line)) out.push(line);\n        else {\n          out.push(\"// \" + line);\n          state = \"root\";\n        }\n        prevEmpty = line === \"\";\n        break;\n      case \"fence\":\n        if (isEnd(line)) {\n          out.push(closeOut);\n          state = \"root\";\n          prevEmpty = true;\n          fenceChar = \"\";\n        } else {\n          const s = stripRe ? line.replace(stripRe, \"\") : line;\n          out.push(linePrefix + s);\n          prevEmpty = false;\n        }\n        break;\n    }\n  }\n  return out.join(\"\\n\");\n}\n\n// src/cli.ts\nvar import_vendor = require(\"./vendor.cjs\");\nvar import_meta = {};\nvar EXT = \".mjs\";\nvar EXT_RE = /^\\.[mc]?[jt]sx?$/;\nvar argv = (0, import_index.parseArgv)(import_node_process2.default.argv.slice(2), {\n  default: (0, import_index.resolveDefaults)({ [\"prefer-local\"]: false }, \"ZX_\", import_node_process2.default.env, /* @__PURE__ */ new Set([\"env\", \"install\", \"registry\"])),\n  // exclude 'prefer-local' to let minimist infer the type\n  string: [\"shell\", \"prefix\", \"postfix\", \"eval\", \"cwd\", \"ext\", \"registry\", \"env\"],\n  boolean: [\"version\", \"help\", \"quiet\", \"verbose\", \"install\", \"repl\", \"experimental\"],\n  alias: { e: \"eval\", i: \"install\", v: \"version\", h: \"help\", l: \"prefer-local\", \"env-file\": \"env\" },\n  stopEarly: true,\n  parseBoolean: true,\n  camelCase: true\n});\nautorun(import_meta);\nfunction autorun(meta) {\n  if (meta && isMain(meta))\n    main().catch((err) => {\n      if (err instanceof import_index.ProcessOutput) {\n        console.error(\"Error:\", err.message);\n      } else {\n        console.error(err);\n      }\n      import_node_process2.default.exitCode = 1;\n    });\n}\nfunction printUsage() {\n  console.log(`\n ${import_index.chalk.bold(\"zx \" + import_index.VERSION)}\n   A tool for writing better scripts\n\n ${import_index.chalk.bold(\"Usage\")}\n   zx [options] <script>\n\n ${import_index.chalk.bold(\"Options\")}\n   --quiet              suppress any outputs\n   --verbose            enable verbose mode\n   --shell=<path>       custom shell binary\n   --prefix=<command>   prefix all commands\n   --postfix=<command>  postfix all commands\n   --prefer-local, -l   prefer locally installed packages and binaries\n   --cwd=<path>         set current directory\n   --eval=<js>, -e      evaluate script\n   --ext=<.mjs>         script extension\n   --install, -i        install dependencies\n   --registry=<URL>     npm registry, defaults to https://registry.npmjs.org/\n   --version, -v        print current zx version\n   --help, -h           print help\n   --repl               start repl\n   --env=<path>         path to env file\n   --experimental       enables experimental features (deprecated)\n\n ${import_index.chalk.italic(\"Full documentation:\")} ${import_index.chalk.underline(import_index.Fail.DOCS_URL)}\n`);\n}\nfunction main() {\n  return __async(this, null, function* () {\n    var _a2;\n    if (argv.version) {\n      console.log(import_index.VERSION);\n      return;\n    }\n    if (argv.help) {\n      printUsage();\n      return;\n    }\n    if (argv.cwd) import_index.$.cwd = argv.cwd;\n    if (argv.env) {\n      const envfile = import_index.path.resolve((_a2 = import_index.$.cwd) != null ? _a2 : import_node_process2.default.cwd(), argv.env);\n      import_index.dotenv.config(envfile);\n      (0, import_index.resolveDefaults)();\n    }\n    if (argv.verbose) import_index.$.verbose = true;\n    if (argv.quiet) import_index.$.quiet = true;\n    if (argv.shell) import_index.$.shell = argv.shell;\n    if (argv.prefix) import_index.$.prefix = argv.prefix;\n    if (argv.postfix) import_index.$.postfix = argv.postfix;\n    if (argv.preferLocal) import_index.$.preferLocal = argv.preferLocal;\n    yield require(\"./globals.cjs\");\n    if (argv.repl) {\n      yield startRepl();\n      return;\n    }\n    argv.ext = normalizeExt(argv.ext);\n    const { script, scriptPath, tempPath } = yield readScript();\n    yield runScript(script, scriptPath, tempPath);\n  });\n}\nvar rmrf = (p) => {\n  var _a2;\n  if (!p) return;\n  ((_a2 = lstat(p)) == null ? void 0 : _a2.isSymbolicLink()) ? import_index.fs.unlinkSync(p) : import_index.fs.rmSync(p, { force: true, recursive: true });\n};\nfunction runScript(script, scriptPath, tempPath) {\n  return __async(this, null, function* () {\n    let nmLink = \"\";\n    const rmTemp = () => {\n      rmrf(tempPath);\n      rmrf(nmLink);\n    };\n    try {\n      if (tempPath) {\n        scriptPath = tempPath;\n        yield import_index.fs.writeFile(tempPath, script);\n      }\n      const cwd = import_index.path.dirname(scriptPath);\n      if (typeof argv.preferLocal === \"string\") {\n        nmLink = linkNodeModules(cwd, argv.preferLocal);\n      }\n      if (argv.install) {\n        yield (0, import_deps.installDeps)((0, import_deps.parseDeps)(script), cwd, argv.registry);\n      }\n      injectGlobalRequire(scriptPath);\n      import_node_process2.default.once(\"exit\", rmTemp);\n      yield import(import_node_url.default.pathToFileURL(scriptPath).toString());\n    } finally {\n      rmTemp();\n    }\n  });\n}\nfunction linkNodeModules(cwd, external) {\n  const nm = \"node_modules\";\n  const alias = import_index.path.resolve(cwd, nm);\n  const target = import_index.path.basename(external) === nm ? import_index.path.resolve(external) : import_index.path.resolve(external, nm);\n  const aliasStat = lstat(alias);\n  const targetStat = lstat(target);\n  if (!(targetStat == null ? void 0 : targetStat.isDirectory()))\n    throw new import_index.Fail(\n      `Can't link node_modules: ${target} doesn't exist or is not a directory`\n    );\n  if ((aliasStat == null ? void 0 : aliasStat.isDirectory()) && alias !== target)\n    throw new import_index.Fail(`Can't link node_modules: ${alias} already exists`);\n  if (aliasStat) return \"\";\n  import_index.fs.symlinkSync(target, alias, \"junction\");\n  return alias;\n}\nfunction lstat(p) {\n  try {\n    return import_index.fs.lstatSync(p);\n  } catch (e) {\n  }\n}\nfunction readScript() {\n  return __async(this, null, function* () {\n    const [firstArg] = argv._;\n    let script = \"\";\n    let scriptPath = \"\";\n    let tempPath = \"\";\n    let argSlice = 1;\n    if (argv.eval) {\n      argSlice = 0;\n      script = argv.eval;\n      tempPath = getFilepath(import_index.$.cwd, \"zx\", argv.ext);\n    } else if (!firstArg || firstArg === \"-\") {\n      script = yield readScriptFromStdin();\n      tempPath = getFilepath(import_index.$.cwd, \"zx\", argv.ext);\n      if (script.length === 0) {\n        printUsage();\n        import_node_process2.default.exitCode = 1;\n        throw new import_index.Fail(\"No script provided\");\n      }\n    } else if (/^https?:/.test(firstArg)) {\n      const { name, ext: ext2 = argv.ext } = import_index.path.parse(new URL(firstArg).pathname);\n      script = yield readScriptFromHttp(firstArg);\n      tempPath = getFilepath(import_index.$.cwd, name, ext2);\n    } else {\n      script = yield import_index.fs.readFile(firstArg, \"utf8\");\n      scriptPath = firstArg.startsWith(\"file:\") ? import_node_url.default.fileURLToPath(firstArg) : import_index.path.resolve(firstArg);\n    }\n    const { ext, base, dir } = import_index.path.parse(tempPath || scriptPath);\n    if (ext === \"\" || argv.ext && !EXT_RE.test(ext)) {\n      tempPath = getFilepath(dir, base);\n    }\n    if (ext === \".md\") {\n      script = transformMarkdown(script);\n      tempPath = getFilepath(dir, base, EXT);\n    }\n    if (argSlice) (0, import_index.updateArgv)(argv._.slice(argSlice));\n    return { script, scriptPath, tempPath };\n  });\n}\nfunction readScriptFromStdin() {\n  return __async(this, null, function* () {\n    return import_node_process2.default.stdin.isTTY ? \"\" : (0, import_index.stdin)();\n  });\n}\nfunction readScriptFromHttp(remote) {\n  return __async(this, null, function* () {\n    const res = yield (0, import_index.fetch)(remote);\n    if (!res.ok) {\n      console.error(`Error: Can't get ${remote}`);\n      import_node_process2.default.exitCode = 1;\n      throw new import_index.Fail(`Failed to fetch remote script: ${remote} (${res.status})`);\n    }\n    return res.text();\n  });\n}\nfunction injectGlobalRequire(origin) {\n  const __filename = import_index.path.resolve(origin);\n  const __dirname = import_index.path.dirname(__filename);\n  const require2 = (0, import_vendor.createRequire)(origin);\n  Object.assign(globalThis, { __filename, __dirname, require: require2 });\n}\nfunction isMain(meta = import_meta_url, scriptpath = import_node_process2.default.argv[1]) {\n  if (typeof meta === \"string\") {\n    if (meta.startsWith(\"file:\")) {\n      const modulePath = import_node_url.default.fileURLToPath(meta).replace(/\\.\\w+$/, \"\");\n      const mainPath = import_index.fs.realpathSync(scriptpath).replace(/\\.\\w+$/, \"\");\n      return mainPath === modulePath;\n    }\n    return false;\n  }\n  return !!meta.main;\n}\nfunction normalizeExt(ext) {\n  return ext ? import_index.path.parse(`foo.${ext}`).ext : ext;\n}\nfunction getFilepath(cwd = \".\", name = \"zx\", _ext) {\n  const ext = _ext || argv.ext || EXT;\n  return [\n    name + ext,\n    name + \"-\" + (0, import_util2.randomId)() + ext\n  ].map((f) => import_index.path.resolve(import_node_process2.default.cwd(), cwd, f)).find((f) => !import_index.fs.existsSync(f));\n}\n/* c8 ignore next 100 */\n// Annotate the CommonJS export names for ESM import in node:\n0 && (module.exports = {\n  argv,\n  autorun,\n  injectGlobalRequire,\n  isMain,\n  main,\n  normalizeExt,\n  printUsage,\n  transformMarkdown\n});"
  },
  {
    "path": "build/cli.d.ts",
    "content": "#!/usr/bin/env node\nimport { type minimist } from './vendor.js';\nexport { transformMarkdown } from './md.js';\nexport declare const argv: minimist.ParsedArgs;\nexport declare function autorun(meta: ImportMeta): void;\nexport declare function printUsage(): void;\nexport declare function main(): Promise<void>;\nexport declare function injectGlobalRequire(origin: string): void;\nexport declare function isMain(meta?: ImportMeta['url'] | ImportMeta, scriptpath?: string): boolean;\nexport declare function normalizeExt(ext?: string): string | undefined;\n"
  },
  {
    "path": "build/cli.js",
    "content": "#!/usr/bin/env node\n\"use strict\";\nimport \"./deno.js\"\nimport * as __module__ from \"./cli.cjs\"\nconst {\n  argv,\n  autorun,\n  injectGlobalRequire,\n  isMain,\n  main,\n  normalizeExt,\n  printUsage,\n  transformMarkdown\n} = globalThis.Deno ? globalThis.require(\"./cli.cjs\") : __module__\nexport {\n  argv,\n  autorun,\n  injectGlobalRequire,\n  isMain,\n  main,\n  normalizeExt,\n  printUsage,\n  transformMarkdown\n}\n\nautorun(import.meta)\n"
  },
  {
    "path": "build/core.cjs",
    "content": "\"use strict\";\nconst {\n  __spreadValues,\n  __spreadProps,\n  __export,\n  __toESM,\n  __toCommonJS,\n  __async,\n  __await,\n  __asyncGenerator,\n  __yieldStar,\n  __forAwait\n} = require('./esblib.cjs');\n\n\n// src/core.ts\nvar core_exports = {};\n__export(core_exports, {\n  $: () => $,\n  Fail: () => Fail,\n  ProcessOutput: () => ProcessOutput,\n  ProcessPromise: () => ProcessPromise,\n  bus: () => import_internals.bus,\n  cd: () => cd,\n  chalk: () => import_vendor_core3.chalk,\n  defaults: () => defaults,\n  kill: () => kill,\n  log: () => log,\n  os: () => os,\n  path: () => import_node_path.default,\n  ps: () => import_vendor_core3.ps,\n  quote: () => import_util2.quote,\n  quotePowerShell: () => import_util2.quotePowerShell,\n  resolveDefaults: () => resolveDefaults,\n  syncProcessCwd: () => syncProcessCwd,\n  useBash: () => useBash,\n  usePowerShell: () => usePowerShell,\n  usePwsh: () => usePwsh,\n  which: () => import_vendor_core3.which,\n  within: () => within\n});\nmodule.exports = __toCommonJS(core_exports);\nvar import_node_async_hooks = require(\"async_hooks\");\nvar import_node_buffer = require(\"buffer\");\nvar import_node_child_process = __toESM(require(\"child_process\"), 1);\nvar import_node_events = require(\"events\");\nvar import_node_fs = __toESM(require(\"fs\"), 1);\nvar import_node_os = require(\"os\");\nvar import_node_process2 = __toESM(require(\"process\"), 1);\nvar import_node_util2 = require(\"util\");\n\n// src/error.ts\nvar EXIT_CODES = {\n  2: \"Misuse of shell builtins\",\n  126: \"Invoked command cannot execute\",\n  127: \"Command not found\",\n  128: \"Invalid exit argument\",\n  129: \"Hangup\",\n  130: \"Interrupt\",\n  131: \"Quit and dump core\",\n  132: \"Illegal instruction\",\n  133: \"Trace/breakpoint trap\",\n  134: \"Process aborted\",\n  135: 'Bus error: \"access to undefined portion of memory object\"',\n  136: 'Floating point exception: \"erroneous arithmetic operation\"',\n  137: \"Kill (terminate immediately)\",\n  138: \"User-defined 1\",\n  139: \"Segmentation violation\",\n  140: \"User-defined 2\",\n  141: \"Write to pipe with no one reading\",\n  142: \"Signal raised by alarm\",\n  143: \"Termination (request to terminate)\",\n  145: \"Child process terminated, stopped (or continued*)\",\n  146: \"Continue if stopped\",\n  147: \"Stop executing temporarily\",\n  148: \"Terminal stop signal\",\n  149: 'Background process attempting to read from tty (\"in\")',\n  150: 'Background process attempting to write to tty (\"out\")',\n  151: \"Urgent data available on socket\",\n  152: \"CPU time limit exceeded\",\n  153: \"File size limit exceeded\",\n  154: 'Signal raised by timer counting virtual time: \"virtual timer expired\"',\n  155: \"Profiling timer expired\",\n  157: \"Pollable event\",\n  159: \"Bad syscall\"\n};\nvar ERRNO_CODES = {\n  0: \"Success\",\n  1: \"Not super-user\",\n  2: \"No such file or directory\",\n  3: \"No such process\",\n  4: \"Interrupted system call\",\n  5: \"I/O error\",\n  6: \"No such device or address\",\n  7: \"Arg list too long\",\n  8: \"Exec format error\",\n  9: \"Bad file number\",\n  10: \"No children\",\n  11: \"No more processes\",\n  12: \"Not enough core\",\n  13: \"Permission denied\",\n  14: \"Bad address\",\n  15: \"Block device required\",\n  16: \"Mount device busy\",\n  17: \"File exists\",\n  18: \"Cross-device link\",\n  19: \"No such device\",\n  20: \"Not a directory\",\n  21: \"Is a directory\",\n  22: \"Invalid argument\",\n  23: \"Too many open files in system\",\n  24: \"Too many open files\",\n  25: \"Not a typewriter\",\n  26: \"Text file busy\",\n  27: \"File too large\",\n  28: \"No space left on device\",\n  29: \"Illegal seek\",\n  30: \"Read only file system\",\n  31: \"Too many links\",\n  32: \"Broken pipe\",\n  33: \"Math arg out of domain of func\",\n  34: \"Math result not representable\",\n  35: \"File locking deadlock error\",\n  36: \"File or path name too long\",\n  37: \"No record locks available\",\n  38: \"Function not implemented\",\n  39: \"Directory not empty\",\n  40: \"Too many symbolic links\",\n  42: \"No message of desired type\",\n  43: \"Identifier removed\",\n  44: \"Channel number out of range\",\n  45: \"Level 2 not synchronized\",\n  46: \"Level 3 halted\",\n  47: \"Level 3 reset\",\n  48: \"Link number out of range\",\n  49: \"Protocol driver not attached\",\n  50: \"No CSI structure available\",\n  51: \"Level 2 halted\",\n  52: \"Invalid exchange\",\n  53: \"Invalid request descriptor\",\n  54: \"Exchange full\",\n  55: \"No anode\",\n  56: \"Invalid request code\",\n  57: \"Invalid slot\",\n  59: \"Bad font file fmt\",\n  60: \"Device not a stream\",\n  61: \"No data (for no delay io)\",\n  62: \"Timer expired\",\n  63: \"Out of streams resources\",\n  64: \"Machine is not on the network\",\n  65: \"Package not installed\",\n  66: \"The object is remote\",\n  67: \"The link has been severed\",\n  68: \"Advertise error\",\n  69: \"Srmount error\",\n  70: \"Communication error on send\",\n  71: \"Protocol error\",\n  72: \"Multihop attempted\",\n  73: \"Cross mount point (not really error)\",\n  74: \"Trying to read unreadable message\",\n  75: \"Value too large for defined data type\",\n  76: \"Given log. name not unique\",\n  77: \"f.d. invalid for this operation\",\n  78: \"Remote address changed\",\n  79: \"Can   access a needed shared lib\",\n  80: \"Accessing a corrupted shared lib\",\n  81: \".lib section in a.out corrupted\",\n  82: \"Attempting to link in too many libs\",\n  83: \"Attempting to exec a shared library\",\n  84: \"Illegal byte sequence\",\n  86: \"Streams pipe error\",\n  87: \"Too many users\",\n  88: \"Socket operation on non-socket\",\n  89: \"Destination address required\",\n  90: \"Message too long\",\n  91: \"Protocol wrong type for socket\",\n  92: \"Protocol not available\",\n  93: \"Unknown protocol\",\n  94: \"Socket type not supported\",\n  95: \"Not supported\",\n  96: \"Protocol family not supported\",\n  97: \"Address family not supported by protocol family\",\n  98: \"Address already in use\",\n  99: \"Address not available\",\n  100: \"Network interface is not configured\",\n  101: \"Network is unreachable\",\n  102: \"Connection reset by network\",\n  103: \"Connection aborted\",\n  104: \"Connection reset by peer\",\n  105: \"No buffer space available\",\n  106: \"Socket is already connected\",\n  107: \"Socket is not connected\",\n  108: \"Can't send after socket shutdown\",\n  109: \"Too many references\",\n  110: \"Connection timed out\",\n  111: \"Connection refused\",\n  112: \"Host is down\",\n  113: \"Host is unreachable\",\n  114: \"Socket already connected\",\n  115: \"Connection already in progress\",\n  116: \"Stale file handle\",\n  122: \"Quota exceeded\",\n  123: \"No medium (in tape drive)\",\n  125: \"Operation canceled\",\n  130: \"Previous owner died\",\n  131: \"State not recoverable\"\n};\nvar DOCS_URL = \"https://google.github.io/zx\";\nvar _Fail = class _Fail extends Error {\n  static formatExitMessage(code, signal, stderr, from, details = \"\") {\n    if (code == 0 && signal == null) return `exit code: ${code}`;\n    const codeInfo = _Fail.getExitCodeInfo(code);\n    let message = `${stderr}\n    at ${from}\n    exit code: ${code}${codeInfo ? \" (\" + codeInfo + \")\" : \"\"}`;\n    if (signal != null) message += `\n    signal: ${signal}`;\n    if (details) message += `\n    details: \n${details}`;\n    return message;\n  }\n  static formatErrorMessage(err, from) {\n    return `${err.message}\n    errno: ${err.errno} (${_Fail.getErrnoMessage(err.errno)})\n    code: ${err.code}\n    at ${from}`;\n  }\n  static formatErrorDetails(lines = [], lim = 20) {\n    if (lines.length < lim) return lines.join(\"\\n\");\n    let errors = lines.filter((l) => /(fail|error|not ok|exception)/i.test(l));\n    if (errors.length === 0) errors = lines;\n    return errors.slice(0, lim).join(\"\\n\") + (errors.length > lim ? \"\\n...\" : \"\");\n  }\n  static getExitCodeInfo(exitCode) {\n    return EXIT_CODES[exitCode];\n  }\n  static getCallerLocationFromString(stackString = \"unknown\") {\n    const lines = stackString.split(/^\\s*(at\\s)?/m).filter((s) => s == null ? void 0 : s.includes(\":\"));\n    const i = lines.findIndex((l) => l.includes(\"Proxy.set\"));\n    const offset = i < 0 ? i : i + 2;\n    return (lines.find((l) => l.includes(\"file://\")) || lines[offset] || stackString).trim();\n  }\n  static getCallerLocation(err = new Error(\"zx error\")) {\n    return _Fail.getCallerLocationFromString(err.stack);\n  }\n  static getErrnoMessage(errno) {\n    return ERRNO_CODES[-errno] || \"Unknown error\";\n  }\n};\n_Fail.DOCS_URL = DOCS_URL;\n_Fail.EXIT_CODES = EXIT_CODES;\n_Fail.ERRNO_CODES = ERRNO_CODES;\nvar Fail = _Fail;\n\n// src/log.ts\nvar import_vendor_core = require(\"./vendor-core.cjs\");\nvar import_node_util = require(\"util\");\nvar import_node_process = __toESM(require(\"process\"), 1);\nvar formatters = {\n  cmd({ cmd }) {\n    return formatCmd(cmd);\n  },\n  stdout({ data }) {\n    return data;\n  },\n  stderr({ data }) {\n    return data;\n  },\n  custom({ data }) {\n    return data;\n  },\n  fetch(entry) {\n    const init = entry.init ? \" \" + (0, import_node_util.inspect)(entry.init) : \"\";\n    return `$ ${import_vendor_core.chalk.greenBright(\"fetch\")} ${entry.url}${init}\n`;\n  },\n  cd(entry) {\n    return `$ ${import_vendor_core.chalk.greenBright(\"cd\")} ${entry.dir}\n`;\n  },\n  retry(entry) {\n    const attempt = `Attempt: ${entry.attempt}${entry.total == Infinity ? \"\" : `/${entry.total}`}`;\n    const delay = entry.delay > 0 ? `; next in ${entry.delay}ms` : \"\";\n    return `${import_vendor_core.chalk.bgRed.white(\" FAIL \")} ${attempt}${delay}\n`;\n  },\n  end() {\n    return \"\";\n  },\n  kill() {\n    return \"\";\n  }\n};\nvar log = function(entry) {\n  var _a;\n  if (!entry.verbose) return;\n  const stream = log.output || import_node_process.default.stderr;\n  const format = ((_a = log.formatters) == null ? void 0 : _a[entry.kind]) || formatters[entry.kind];\n  if (!format) return;\n  stream.write(format(entry));\n};\nvar SPACE_RE = /\\s/;\nvar SYNTAX = \"()[]{}<>;:+|&=\";\nvar CMD_BREAK = \"|&;><\";\nvar RESERVED_WORDS = /* @__PURE__ */ new Set([\n  \"if\",\n  \"then\",\n  \"else\",\n  \"elif\",\n  \"fi\",\n  \"case\",\n  \"esac\",\n  \"for\",\n  \"select\",\n  \"while\",\n  \"until\",\n  \"do\",\n  \"done\",\n  \"in\",\n  \"EOF\"\n]);\nfunction formatCmd(cmd) {\n  if (cmd == void 0) return import_vendor_core.chalk.grey(\"undefined\");\n  let q = \"\";\n  let out = \"$ \";\n  let buf = \"\";\n  let mode = \"\";\n  let pos = 0;\n  const cap = () => {\n    const word = buf.trim();\n    if (word) {\n      pos++;\n      if (mode === \"syntax\") {\n        if (CMD_BREAK.includes(word)) {\n          pos = 0;\n        }\n        out += import_vendor_core.chalk.red(buf);\n      } else if (mode === \"quote\" || mode === \"dollar\") {\n        out += import_vendor_core.chalk.yellowBright(buf);\n      } else if (RESERVED_WORDS.has(word)) {\n        out += import_vendor_core.chalk.cyanBright(buf);\n      } else if (pos === 1) {\n        out += import_vendor_core.chalk.greenBright(buf);\n        pos = Infinity;\n      } else {\n        out += buf;\n      }\n    } else {\n      out += buf;\n    }\n    mode = \"\";\n    buf = \"\";\n  };\n  for (const c of [...cmd]) {\n    if (!q) {\n      if (c === \"$\") {\n        cap();\n        mode = \"dollar\";\n        buf += c;\n        cap();\n      } else if (c === \"'\" || c === '\"') {\n        cap();\n        mode = \"quote\";\n        q = c;\n        buf += c;\n      } else if (SPACE_RE.test(c)) {\n        cap();\n        buf += c;\n      } else if (SYNTAX.includes(c)) {\n        const isEnv = c === \"=\" && pos === 0;\n        isEnv && (pos = 1);\n        cap();\n        mode = \"syntax\";\n        buf += c;\n        cap();\n        isEnv && (pos = -1);\n      } else {\n        buf += c;\n      }\n    } else {\n      buf += c;\n      if (c === q) {\n        cap();\n        q = \"\";\n      }\n    }\n  }\n  cap();\n  return out.replace(/\\n/g, import_vendor_core.chalk.reset(\"\\n> \")) + \"\\n\";\n}\n\n// src/core.ts\nvar import_vendor_core2 = require(\"./vendor-core.cjs\");\nvar import_util = require(\"./util.cjs\");\nvar import_internals = require(\"./internals.cjs\");\nvar import_node_path = __toESM(require(\"path\"), 1);\nvar os = __toESM(require(\"os\"), 1);\nvar import_vendor_core3 = require(\"./vendor-core.cjs\");\nvar import_util2 = require(\"./util.cjs\");\nvar CWD = /* @__PURE__ */ Symbol(\"processCwd\");\nvar SYNC = /* @__PURE__ */ Symbol(\"syncExec\");\nvar EPF = /* @__PURE__ */ Symbol(\"end-piped-from\");\nvar SHOT = /* @__PURE__ */ Symbol(\"snapshot\");\nvar EOL = import_node_buffer.Buffer.from(import_node_os.EOL);\nvar BR_CC = \"\\n\".charCodeAt(0);\nvar DLMTR = /\\r?\\n/;\nvar SIGTERM = \"SIGTERM\";\nvar ENV_PREFIX = \"ZX_\";\nvar ENV_OPTS = /* @__PURE__ */ new Set([\n  \"cwd\",\n  \"preferLocal\",\n  \"detached\",\n  \"verbose\",\n  \"quiet\",\n  \"timeout\",\n  \"timeoutSignal\",\n  \"killSignal\",\n  \"prefix\",\n  \"postfix\",\n  \"shell\"\n]);\nvar defaults = resolveDefaults({\n  [CWD]: import_node_process2.default.cwd(),\n  [SYNC]: false,\n  verbose: false,\n  env: import_node_process2.default.env,\n  sync: false,\n  shell: true,\n  stdio: \"pipe\",\n  nothrow: false,\n  quiet: false,\n  detached: false,\n  preferLocal: false,\n  spawn: import_node_child_process.default.spawn,\n  spawnSync: import_node_child_process.default.spawnSync,\n  log,\n  kill,\n  killSignal: SIGTERM,\n  timeoutSignal: SIGTERM\n});\nvar storage = new import_node_async_hooks.AsyncLocalStorage();\nvar getStore = () => storage.getStore() || defaults;\nvar getSnapshot = (opts, from, pieces, args) => __spreadProps(__spreadValues({}, opts), {\n  ac: opts.ac || new AbortController(),\n  ee: new import_node_events.EventEmitter(),\n  from,\n  pieces,\n  args,\n  cmd: \"\"\n});\nfunction within(callback) {\n  return storage.run(__spreadValues({}, getStore()), callback);\n}\nvar $ = sync$(\n  function(pieces, ...args) {\n    const opts = getStore();\n    if (!Array.isArray(pieces))\n      return sync$(\n        function(...args2) {\n          return within(() => Object.assign($, opts, pieces).apply(this, args2));\n        },\n        () => $(__spreadProps(__spreadValues({}, pieces), { sync: true }))\n      );\n    const from = Fail.getCallerLocation();\n    const cb = () => cb[SHOT] = getSnapshot(opts, from, pieces, args);\n    const pp = new ProcessPromise(cb);\n    if (!pp.isHalted()) pp.run();\n    return pp.sync ? pp.output : pp;\n  },\n  () => $({ sync: true })\n);\nfunction sync$(fn, makeSync) {\n  return new Proxy(fn, {\n    get(t, key) {\n      if (key === \"sync\") return makeSync();\n      return Reflect.get(key in Function.prototype ? t : getStore(), key);\n    },\n    set(t, key, value) {\n      return Reflect.set(\n        key in Function.prototype ? t : getStore(),\n        key === \"sync\" ? SYNC : key,\n        value\n      );\n    }\n  });\n}\nvar _ProcessPromise = class _ProcessPromise extends Promise {\n  constructor(executor) {\n    let resolve;\n    let reject;\n    super((...args) => {\n      ;\n      [resolve = import_util.noop, reject = import_util.noop] = args;\n      executor(...args);\n    });\n    this._stage = \"initial\";\n    this._id = (0, import_util.randomId)();\n    this._piped = false;\n    this._stdin = new import_vendor_core2.VoidStream();\n    this._zurk = null;\n    this._output = null;\n    // Stream-like API\n    this.writable = true;\n    const snapshot = executor[SHOT];\n    if (snapshot) {\n      this._snapshot = snapshot;\n      this._resolve = resolve;\n      this._reject = reject;\n      if (snapshot.halt) this._stage = \"halted\";\n      try {\n        this.build();\n      } catch (err) {\n        this.finalize(ProcessOutput.fromError(err), true);\n      }\n    } else _ProcessPromise.disarm(this);\n  }\n  // prettier-ignore\n  build() {\n    const $2 = this._snapshot;\n    if (!$2.shell)\n      throw new Fail(`No shell is available: ${Fail.DOCS_URL}/shell`);\n    if (!$2.quote)\n      throw new Fail(`No quote function is defined: ${Fail.DOCS_URL}/quotes`);\n    if ($2.pieces.some((p) => p == null))\n      throw new Fail(`Malformed command at ${$2.from}`);\n    $2.cmd = (0, import_vendor_core2.buildCmd)(\n      $2.quote,\n      $2.pieces,\n      $2.args\n    );\n    if ($2[SYNC] && !(0, import_util.isString)($2.cmd))\n      throw new Fail(\"sync mode does not allow async command resolution\");\n  }\n  run() {\n    var _a, _b;\n    _ProcessPromise.bus.runBack(this);\n    if (this.isRunning() || this.isSettled()) return this;\n    this._stage = \"running\";\n    const self = this;\n    const $2 = self._snapshot;\n    const { id, cwd } = self;\n    if (!import_node_fs.default.existsSync(cwd)) {\n      this.finalize(\n        ProcessOutput.fromError(\n          new Error(`The working directory '${cwd}' does not exist.`)\n        )\n      );\n      return this;\n    }\n    if ($2.preferLocal) {\n      const dirs = $2.preferLocal === true ? [$2.cwd, $2[CWD]] : [$2.preferLocal].flat();\n      $2.env = (0, import_util.preferLocalBin)($2.env, ...dirs);\n    }\n    this._zurk = (0, import_vendor_core2.exec)({\n      cmd: self.fullCmd,\n      cwd,\n      input: (_b = (_a = $2.input) == null ? void 0 : _a.stdout) != null ? _b : $2.input,\n      stdin: self._stdin,\n      sync: self.sync,\n      signal: self.signal,\n      shell: (0, import_util.isString)($2.shell) ? $2.shell : true,\n      id,\n      env: $2.env,\n      spawn: $2.spawn,\n      spawnSync: $2.spawnSync,\n      store: $2.store,\n      stdio: $2.stdio,\n      detached: $2.detached,\n      ee: $2.ee,\n      run(cb, ctx) {\n        return __async(this, null, function* () {\n          try {\n            if (!(0, import_util.isString)(self.cmd)) {\n              $2.cmd = yield self.cmd;\n              ctx.cmd = self.fullCmd;\n            }\n            cb();\n          } catch (error) {\n            self.finalize(ProcessOutput.fromError(error));\n          }\n        });\n      },\n      on: {\n        start: () => {\n          $2.log({ kind: \"cmd\", cmd: $2.cmd, cwd, verbose: self.isVerbose(), id });\n          self.timeout($2.timeout, $2.timeoutSignal);\n        },\n        stdout: (data) => {\n          $2.log({ kind: \"stdout\", data, verbose: !self._piped && self.isVerbose(), id });\n        },\n        stderr: (data) => {\n          $2.log({ kind: \"stderr\", data, verbose: !self.isQuiet(), id });\n        },\n        end: (data, c) => {\n          const { error: _error, status, signal: __signal, duration, ctx: { store } } = data;\n          const { stdout, stderr } = store;\n          const { cause, exitCode, signal: _signal } = self._breakerData || {};\n          const signal = _signal != null ? _signal : __signal;\n          const code = exitCode != null ? exitCode : status;\n          const error = cause != null ? cause : _error;\n          const output = new ProcessOutput({\n            code,\n            signal,\n            error,\n            duration,\n            store,\n            from: $2.from\n          });\n          $2.log({ kind: \"end\", signal, exitCode: code, duration, error, verbose: self.isVerbose(), id });\n          if (stdout.length && (0, import_util.getLast)((0, import_util.getLast)(stdout)) !== BR_CC) c.on.stdout(EOL, c);\n          if (stderr.length && (0, import_util.getLast)((0, import_util.getLast)(stderr)) !== BR_CC) c.on.stderr(EOL, c);\n          self.finalize(output);\n        }\n      }\n    });\n    return this;\n  }\n  break(exitCode, signal, cause) {\n    if (!this.isRunning()) return;\n    this._breakerData = { exitCode, signal, cause };\n    this.kill(signal);\n  }\n  finalize(output, legacy = false) {\n    if (this.isSettled()) return;\n    this._output = output;\n    _ProcessPromise.bus.unpipeBack(this);\n    if (output.ok || this.isNothrow()) {\n      this._stage = \"fulfilled\";\n      this._resolve(output);\n    } else {\n      this._stage = \"rejected\";\n      if (legacy) {\n        this._resolve(output);\n        throw output.cause || output;\n      }\n      this._reject(output);\n      if (this.sync) throw output;\n    }\n  }\n  abort(reason) {\n    if (this.isSettled()) throw new Fail(\"Too late to abort the process.\");\n    if (this.signal !== this.ac.signal)\n      throw new Fail(\"The signal is controlled by another process.\");\n    if (!this.child)\n      throw new Fail(\"Trying to abort a process without creating one.\");\n    this.ac.abort(reason);\n  }\n  kill(signal) {\n    if (this.isSettled()) throw new Fail(\"Too late to kill the process.\");\n    if (!this.child)\n      throw new Fail(\"Trying to kill a process without creating one.\");\n    if (!this.pid) throw new Fail(\"The process pid is undefined.\");\n    return $.kill(this.pid, signal || this._snapshot.killSignal || $.killSignal);\n  }\n  // Configurators\n  stdio(stdin, stdout = \"pipe\", stderr = \"pipe\") {\n    this._snapshot.stdio = Array.isArray(stdin) ? stdin : [stdin, stdout, stderr];\n    return this;\n  }\n  nothrow(v = true) {\n    this._snapshot.nothrow = v;\n    return this;\n  }\n  quiet(v = true) {\n    this._snapshot.quiet = v;\n    return this;\n  }\n  verbose(v = true) {\n    this._snapshot.verbose = v;\n    return this;\n  }\n  timeout(d = 0, signal = $.timeoutSignal) {\n    if (this.isSettled()) return this;\n    const $2 = this._snapshot;\n    $2.timeout = (0, import_util.parseDuration)(d);\n    $2.timeoutSignal = signal;\n    if (this._timeoutId) clearTimeout(this._timeoutId);\n    if ($2.timeout && this.isRunning()) {\n      this._timeoutId = setTimeout(() => this.kill($2.timeoutSignal), $2.timeout);\n      this.finally(() => clearTimeout(this._timeoutId)).catch(import_util.noop);\n    }\n    return this;\n  }\n  /**\n   *  @deprecated Use $({halt: true})`cmd` instead.\n   */\n  halt() {\n    return this;\n  }\n  // Getters\n  get id() {\n    return this._id;\n  }\n  get pid() {\n    var _a;\n    return (_a = this.child) == null ? void 0 : _a.pid;\n  }\n  get cwd() {\n    return this._snapshot.cwd || this._snapshot[CWD];\n  }\n  get cmd() {\n    return this._snapshot.cmd;\n  }\n  get fullCmd() {\n    const { prefix = \"\", postfix = \"\", cmd } = this._snapshot;\n    return prefix + cmd + postfix;\n  }\n  get child() {\n    var _a;\n    return (_a = this._zurk) == null ? void 0 : _a.child;\n  }\n  get stdin() {\n    var _a;\n    return (_a = this.child) == null ? void 0 : _a.stdin;\n  }\n  get stdout() {\n    var _a;\n    return (_a = this.child) == null ? void 0 : _a.stdout;\n  }\n  get stderr() {\n    var _a;\n    return (_a = this.child) == null ? void 0 : _a.stderr;\n  }\n  get exitCode() {\n    return this.then(\n      (o) => o.exitCode,\n      (o) => o.exitCode\n    );\n  }\n  get signal() {\n    return this._snapshot.signal || this.ac.signal;\n  }\n  get ac() {\n    return this._snapshot.ac;\n  }\n  get output() {\n    return this._output;\n  }\n  get stage() {\n    return this._stage;\n  }\n  get sync() {\n    return this._snapshot[SYNC];\n  }\n  get [Symbol.toStringTag]() {\n    return \"ProcessPromise\";\n  }\n  [Symbol.toPrimitive]() {\n    return this.toString();\n  }\n  // Output formatters\n  json() {\n    return this.then((o) => o.json());\n  }\n  text(encoding) {\n    return this.then((o) => o.text(encoding));\n  }\n  lines(delimiter) {\n    return this.then((o) => o.lines(delimiter));\n  }\n  buffer() {\n    return this.then((o) => o.buffer());\n  }\n  blob(type) {\n    return this.then((o) => o.blob(type));\n  }\n  // Status checkers\n  isQuiet() {\n    return this._snapshot.quiet;\n  }\n  isVerbose() {\n    return this._snapshot.verbose && !this.isQuiet();\n  }\n  isNothrow() {\n    return this._snapshot.nothrow;\n  }\n  isHalted() {\n    return this.stage === \"halted\" && !this.sync;\n  }\n  isSettled() {\n    return !!this.output;\n  }\n  isRunning() {\n    return this.stage === \"running\";\n  }\n  // Piping\n  // prettier-ignore\n  get pipe() {\n    const getPipeMethod = (kind) => this._pipe.bind(this, kind);\n    const stdout = getPipeMethod(\"stdout\");\n    const stderr = getPipeMethod(\"stderr\");\n    const stdall = getPipeMethod(\"stdall\");\n    return Object.assign(stdout, { stdout, stderr, stdall });\n  }\n  unpipe(to) {\n    _ProcessPromise.bus.unpipe(this, to);\n    return this;\n  }\n  // prettier-ignore\n  _pipe(source, dest, ...args) {\n    if ((0, import_util.isString)(dest))\n      return this._pipe(source, import_node_fs.default.createWriteStream(dest));\n    if ((0, import_util.isStringLiteral)(dest, ...args))\n      return this._pipe(\n        source,\n        $({\n          halt: true,\n          signal: this.signal\n        })(dest, ...args)\n      );\n    const isP = dest instanceof _ProcessPromise;\n    if (isP && dest.isSettled()) throw new Fail(\"Cannot pipe to a settled process.\");\n    if (!isP && dest.writableEnded) throw new Fail(\"Cannot pipe to a closed stream.\");\n    this._piped = true;\n    _ProcessPromise.bus.pipe(this, dest);\n    const { ee } = this._snapshot;\n    const output = this.output;\n    const from = new import_vendor_core2.VoidStream();\n    const check = () => {\n      var _a;\n      return !!((_a = _ProcessPromise.bus.refs.get(this)) == null ? void 0 : _a.has(dest));\n    };\n    const end = () => {\n      if (!check()) return;\n      setImmediate(() => {\n        _ProcessPromise.bus.unpipe(this, dest);\n        _ProcessPromise.bus.sources(dest).length === 0 && from.end();\n      });\n    };\n    const fill = () => {\n      for (const chunk of this._zurk.store[source]) from.write(chunk);\n    };\n    const fillSettled = () => {\n      if (!output) return;\n      if (isP && !output.ok) dest.break(output.exitCode, output.signal, output.cause);\n      fill();\n      end();\n    };\n    if (!output) {\n      const onData = (chunk) => check() && from.write(chunk);\n      ee.once(source, () => {\n        fill();\n        ee.on(source, onData);\n      }).once(\"end\", () => {\n        ee.removeListener(source, onData);\n        end();\n      });\n    }\n    if (isP) {\n      from.pipe(dest._stdin);\n      if (this.isHalted()) ee.once(\"start\", () => dest.run());\n      else {\n        dest.run();\n        this.catch((e) => dest.break(e.exitCode, e.signal, e.cause));\n      }\n      fillSettled();\n      return dest;\n    }\n    from.once(\"end\", () => dest.emit(EPF)).pipe(dest);\n    fillSettled();\n    return _ProcessPromise.promisifyStream(dest, this);\n  }\n  // Promise API\n  then(onfulfilled, onrejected) {\n    return super.then(onfulfilled, onrejected);\n  }\n  catch(onrejected) {\n    return super.catch(onrejected);\n  }\n  // Async iterator API\n  [Symbol.asyncIterator]() {\n    return __asyncGenerator(this, null, function* () {\n      const memo = [];\n      const dlmtr = this._snapshot.delimiter || $.delimiter || DLMTR;\n      for (const chunk of this._zurk.store.stdout) {\n        yield* __yieldStar((0, import_util.getLines)(chunk, memo, dlmtr));\n      }\n      try {\n        for (var iter = __forAwait(this.stdout || []), more, temp, error; more = !(temp = yield new __await(iter.next())).done; more = false) {\n          const chunk = temp.value;\n          yield* __yieldStar((0, import_util.getLines)(chunk, memo, dlmtr));\n        }\n      } catch (temp) {\n        error = [temp];\n      } finally {\n        try {\n          more && (temp = iter.return) && (yield new __await(temp.call(iter)));\n        } finally {\n          if (error)\n            throw error[0];\n        }\n      }\n      if (memo[0]) yield memo[0];\n      yield new __await(this);\n    });\n  }\n  emit(event, ...args) {\n    return this;\n  }\n  on(event, cb) {\n    this._stdin.on(event, cb);\n    return this;\n  }\n  once(event, cb) {\n    this._stdin.once(event, cb);\n    return this;\n  }\n  write(data, encoding, cb) {\n    this._stdin.write(data, encoding, cb);\n    return this;\n  }\n  end(chunk, cb) {\n    this._stdin.end(chunk, cb);\n    return this;\n  }\n  removeListener(event, cb) {\n    this._stdin.removeListener(event, cb);\n    return this;\n  }\n  // prettier-ignore\n  static disarm(p, toggle = true) {\n    Object.getOwnPropertyNames(_ProcessPromise.prototype).forEach((k) => {\n      if (k in Promise.prototype) return;\n      if (!toggle) {\n        Reflect.deleteProperty(p, k);\n        return;\n      }\n      Object.defineProperty(p, k, { configurable: true, get() {\n        throw new Fail(\"Inappropriate usage. Apply $ instead of direct instantiation.\");\n      } });\n    });\n  }\n};\n// prettier-ignore\n_ProcessPromise.bus = {\n  refs: /* @__PURE__ */ new Map(),\n  streams: /* @__PURE__ */ new WeakMap(),\n  pipe(from, to) {\n    const set = this.refs.get(from) || this.refs.set(from, /* @__PURE__ */ new Set()).get(from);\n    set.add(to);\n  },\n  unpipe(from, to) {\n    const set = this.refs.get(from);\n    if (!set) return;\n    if (to) set.delete(to);\n    if (set.size) return;\n    this.refs.delete(from);\n    from._piped = false;\n  },\n  unpipeBack(to, from) {\n    if (from) return this.unpipe(from, to);\n    for (const _from of this.refs.keys()) {\n      this.unpipe(_from, to);\n    }\n  },\n  runBack(p) {\n    var _a;\n    for (const from of this.sources(p)) {\n      if (from instanceof _ProcessPromise) from.run();\n      else (_a = this.streams.get(from)) == null ? void 0 : _a.run();\n    }\n  },\n  sources(p) {\n    const refs = [];\n    for (const [from, set] of this.refs.entries()) {\n      set.has(p) && refs.push(from);\n    }\n    return refs;\n  }\n};\n_ProcessPromise.promisifyStream = (stream, from) => {\n  const proxy = _ProcessPromise.bus.streams.get(stream) || (0, import_util.proxyOverride)(stream, {\n    then(res = import_util.noop, rej = import_util.noop) {\n      return new Promise((_res, _rej) => {\n        const end = () => _res(res((0, import_util.proxyOverride)(stream, from.output)));\n        stream.once(\"error\", (e) => _rej(rej(e))).once(\"finish\", end).once(EPF, end);\n      });\n    },\n    run() {\n      from.run();\n    },\n    pipe(...args) {\n      const dest = stream.pipe.apply(stream, args);\n      return dest instanceof _ProcessPromise ? dest : _ProcessPromise.promisifyStream(dest, from);\n    }\n  });\n  _ProcessPromise.bus.streams.set(stream, proxy);\n  return proxy;\n};\nvar ProcessPromise = _ProcessPromise;\nvar _ProcessOutput = class _ProcessOutput extends Error {\n  // prettier-ignore\n  constructor(code = null, signal = null, stdout = \"\", stderr = \"\", stdall = \"\", message = \"\", duration = 0, error = null, from = \"\", store = { stdout: [stdout], stderr: [stderr], stdall: [stdall] }) {\n    super(message);\n    const dto = code !== null && typeof code === \"object\" ? code : { code, signal, duration, error, from, store };\n    Object.defineProperties(this, {\n      _dto: { value: dto, enumerable: false },\n      cause: { get() {\n        return dto.error;\n      }, enumerable: false },\n      stdout: { get: (0, import_util.once)(() => (0, import_util.bufArrJoin)(dto.store.stdout)) },\n      stderr: { get: (0, import_util.once)(() => (0, import_util.bufArrJoin)(dto.store.stderr)) },\n      stdall: { get: (0, import_util.once)(() => (0, import_util.bufArrJoin)(dto.store.stdall)) },\n      message: { get: (0, import_util.once)(\n        () => dto.error || message ? _ProcessOutput.getErrorMessage(dto.error || new Error(message), dto.from) : _ProcessOutput.getExitMessage(\n          dto.code,\n          dto.signal,\n          this.stderr,\n          dto.from,\n          this.stderr.trim() ? \"\" : _ProcessOutput.getErrorDetails(this.lines())\n        )\n      ) }\n    });\n  }\n  get exitCode() {\n    return this._dto.code;\n  }\n  get signal() {\n    return this._dto.signal;\n  }\n  get duration() {\n    return this._dto.duration;\n  }\n  get [Symbol.toStringTag]() {\n    return \"ProcessOutput\";\n  }\n  get ok() {\n    return !this._dto.error && this.exitCode === 0;\n  }\n  json() {\n    return JSON.parse(this.stdall);\n  }\n  buffer() {\n    return import_node_buffer.Buffer.from(this.stdall);\n  }\n  blob(type = \"text/plain\") {\n    if (!globalThis.Blob)\n      throw new Fail(\n        \"Blob is not supported in this environment. Provide a polyfill\"\n      );\n    return new Blob([this.buffer()], { type });\n  }\n  text(encoding = \"utf8\") {\n    return encoding === \"utf8\" ? this.toString() : this.buffer().toString(encoding);\n  }\n  lines(delimiter) {\n    return (0, import_util.iteratorToArray)(this[Symbol.iterator](delimiter));\n  }\n  toString() {\n    return this.stdall;\n  }\n  valueOf() {\n    return this.stdall.trim();\n  }\n  [Symbol.toPrimitive]() {\n    return this.valueOf();\n  }\n  // prettier-ignore\n  *[Symbol.iterator](dlmtr = this._dto.delimiter || $.delimiter || DLMTR) {\n    const memo = [];\n    for (const chunk of this._dto.store.stdall) {\n      yield* __yieldStar((0, import_util.getLines)(chunk, memo, dlmtr));\n    }\n    if (memo[0]) yield memo[0];\n  }\n  [import_node_util2.inspect.custom]() {\n    const codeInfo = _ProcessOutput.getExitCodeInfo(this.exitCode);\n    return `ProcessOutput {\n  stdout: ${import_vendor_core2.chalk.green((0, import_node_util2.inspect)(this.stdout))},\n  stderr: ${import_vendor_core2.chalk.red((0, import_node_util2.inspect)(this.stderr))},\n  signal: ${(0, import_node_util2.inspect)(this.signal)},\n  exitCode: ${(this.ok ? import_vendor_core2.chalk.green : import_vendor_core2.chalk.red)(this.exitCode)}${codeInfo ? import_vendor_core2.chalk.grey(\" (\" + codeInfo + \")\") : \"\"},\n  duration: ${this.duration}\n}`;\n  }\n  static fromError(error) {\n    const output = new _ProcessOutput();\n    output._dto.error = error;\n    return output;\n  }\n};\n_ProcessOutput.getExitMessage = Fail.formatExitMessage;\n_ProcessOutput.getErrorMessage = Fail.formatErrorMessage;\n_ProcessOutput.getErrorDetails = Fail.formatErrorDetails;\n_ProcessOutput.getExitCodeInfo = Fail.getExitCodeInfo;\nvar ProcessOutput = _ProcessOutput;\nvar useBash = () => setShell(\"bash\", false);\nvar usePwsh = () => setShell(\"pwsh\");\nvar usePowerShell = () => setShell(\"powershell.exe\");\nfunction setShell(n, ps3 = true) {\n  $.shell = import_vendor_core2.which.sync(n);\n  $.prefix = ps3 ? \"\" : \"set -euo pipefail;\";\n  $.postfix = ps3 ? \"; exit $LastExitCode\" : \"\";\n  $.quote = ps3 ? import_util.quotePowerShell : import_util.quote;\n}\ntry {\n  const { shell, prefix, postfix } = $;\n  useBash();\n  if ((0, import_util.isString)(shell)) $.shell = shell;\n  if ((0, import_util.isString)(prefix)) $.prefix = prefix;\n  if ((0, import_util.isString)(postfix)) $.postfix = postfix;\n} catch (err) {\n}\nvar cwdSyncHook;\nfunction syncProcessCwd(flag = true) {\n  cwdSyncHook = cwdSyncHook || (0, import_node_async_hooks.createHook)({\n    init: syncCwd,\n    before: syncCwd,\n    promiseResolve: syncCwd,\n    after: syncCwd,\n    destroy: syncCwd\n  });\n  if (flag) cwdSyncHook.enable();\n  else cwdSyncHook.disable();\n}\nfunction syncCwd() {\n  if ($[CWD] != import_node_process2.default.cwd()) import_node_process2.default.chdir($[CWD]);\n}\nfunction cd(dir) {\n  if (dir instanceof ProcessOutput) {\n    dir = dir.toString().trim();\n  }\n  $.log({ kind: \"cd\", dir, verbose: !$.quiet && $.verbose });\n  import_node_process2.default.chdir(dir);\n  $[CWD] = import_node_process2.default.cwd();\n}\nfunction kill(_0) {\n  return __async(this, arguments, function* (pid, signal = $.killSignal || SIGTERM) {\n    if (typeof pid !== \"number\" && typeof pid !== \"string\" || !/^\\d+$/.test(pid))\n      throw new Fail(`Invalid pid: ${pid}`);\n    $.log({ kind: \"kill\", pid, signal, verbose: !$.quiet && $.verbose });\n    if (import_node_process2.default.platform === \"win32\" && (yield new Promise((resolve) => {\n      import_node_child_process.default.exec(`taskkill /pid ${pid} /t /f`, (err) => resolve(!err));\n    })))\n      return;\n    for (const p of yield import_vendor_core2.ps.tree({ pid, recursive: true })) {\n      try {\n        import_node_process2.default.kill(+p.pid, signal);\n      } catch (e) {\n      }\n    }\n    try {\n      import_node_process2.default.kill(-pid, signal);\n    } catch (e) {\n      try {\n        import_node_process2.default.kill(+pid, signal);\n      } catch (e2) {\n      }\n    }\n  });\n}\nfunction resolveDefaults(defs = defaults, prefix = ENV_PREFIX, env = import_node_process2.default.env, allowed = ENV_OPTS) {\n  return Object.entries(env).reduce((m, [k, v]) => {\n    if (v && k.startsWith(prefix)) {\n      const _k = (0, import_util.toCamelCase)(k.slice(prefix.length));\n      const _v = (0, import_util.parseBool)(v);\n      if (allowed.has(_k)) m[_k] = _v;\n    }\n    return m;\n  }, defs);\n}\n/* c8 ignore next 100 */\n// Annotate the CommonJS export names for ESM import in node:\n0 && (module.exports = {\n  $,\n  Fail,\n  ProcessOutput,\n  ProcessPromise,\n  bus,\n  cd,\n  chalk,\n  defaults,\n  kill,\n  log,\n  os,\n  path,\n  ps,\n  quote,\n  quotePowerShell,\n  resolveDefaults,\n  syncProcessCwd,\n  useBash,\n  usePowerShell,\n  usePwsh,\n  which,\n  within\n});"
  },
  {
    "path": "build/core.d.ts",
    "content": "/// <reference types=\"node\" />\n/// <reference types=\"fs-extra\" />\n\nimport { Buffer } from 'node:buffer';\nimport cp, { type ChildProcess, type IOType, type StdioOptions } from 'node:child_process';\nimport { type Encoding } from 'node:crypto';\nimport { EventEmitter } from 'node:events';\nimport { type Readable, type Writable } from 'node:stream';\nimport { inspect } from 'node:util';\nimport { Fail } from './error.js';\nimport { log } from './log.js';\nimport { type TSpawnStore } from './vendor-core.js';\nimport { type Duration, quote } from './util.js';\nexport { bus } from './internals.js';\nexport { default as path } from 'node:path';\nexport * as os from 'node:os';\nexport { Fail } from './error.js';\nexport { log, type LogEntry } from './log.js';\nexport { chalk, which, ps } from './vendor-core.js';\nexport { type Duration, quote, quotePowerShell } from './util.js';\ndeclare const CWD: unique symbol;\ndeclare const SYNC: unique symbol;\ndeclare const SHOT: unique symbol;\nexport interface Options {\n    [CWD]: string;\n    [SYNC]: boolean;\n    cwd?: string;\n    ac?: AbortController;\n    signal?: AbortSignal;\n    input?: string | Buffer | Readable | ProcessOutput | ProcessPromise;\n    timeout?: Duration;\n    timeoutSignal?: NodeJS.Signals;\n    stdio: StdioOptions;\n    verbose: boolean;\n    sync: boolean;\n    env: NodeJS.ProcessEnv;\n    shell: string | true;\n    nothrow: boolean;\n    prefix?: string;\n    postfix?: string;\n    quote?: typeof quote;\n    quiet: boolean;\n    detached: boolean;\n    preferLocal: boolean | string | string[];\n    spawn: typeof cp.spawn;\n    spawnSync: typeof cp.spawnSync;\n    store?: TSpawnStore;\n    log: typeof log;\n    kill: typeof kill;\n    killSignal?: NodeJS.Signals;\n    halt?: boolean;\n    delimiter?: string | RegExp;\n}\ntype Snapshot = Options & {\n    from: string;\n    pieces: TemplateStringsArray;\n    args: string[];\n    cmd: string;\n    ee: EventEmitter;\n    ac: AbortController;\n};\nexport declare const defaults: Options;\nexport declare function within<R>(callback: () => R): R;\nexport interface Shell<S = false, R = S extends true ? ProcessOutput : ProcessPromise> {\n    (pieces: TemplateStringsArray, ...args: any[]): R;\n    <O extends Partial<Options> = Partial<Options>, R = O extends {\n        sync: true;\n    } ? Shell<true> : Shell>(opts: O): R;\n    sync: {\n        (pieces: TemplateStringsArray, ...args: any[]): ProcessOutput;\n        (opts: Partial<Omit<Options, 'sync'>>): Shell<true>;\n    };\n}\nexport type $ = Shell & Options;\nexport declare const $: $;\ntype ProcessStage = 'initial' | 'halted' | 'running' | 'fulfilled' | 'rejected';\ntype Resolve = (out: ProcessOutput) => void;\ntype Reject = (error: ProcessOutput | Error) => void;\ntype PromiseCallback = {\n    (resolve: Resolve, reject: Reject): void;\n    [SHOT]?: Snapshot;\n};\ntype PromisifiedStream<D extends Writable = Writable> = D & PromiseLike<ProcessOutput & D> & {\n    run(): void;\n};\ntype PipeAcceptor = Writable | ProcessPromise;\ntype PipeMethod = {\n    (dest: TemplateStringsArray, ...args: any[]): ProcessPromise;\n    (file: string): PromisifiedStream;\n    <D extends Writable>(dest: D): PromisifiedStream<D>;\n    <D extends ProcessPromise>(dest: D): D;\n};\nexport declare class ProcessPromise extends Promise<ProcessOutput> {\n    private _stage;\n    private _id;\n    private _snapshot;\n    private _timeoutId?;\n    private _piped;\n    private _stdin;\n    private _zurk;\n    private _output;\n    private _resolve;\n    private _reject;\n    constructor(executor: PromiseCallback);\n    private build;\n    run(): this;\n    private _breakerData?;\n    private break;\n    private finalize;\n    abort(reason?: string): void;\n    kill(signal?: NodeJS.Signals | null): Promise<void>;\n    stdio(stdin: IOType | StdioOptions, stdout?: IOType, stderr?: IOType): this;\n    nothrow(v?: boolean): this;\n    quiet(v?: boolean): this;\n    verbose(v?: boolean): this;\n    timeout(d?: Duration, signal?: NodeJS.Signals | undefined): this;\n    /**\n     *  @deprecated Use $({halt: true})`cmd` instead.\n     */\n    halt(): this;\n    get id(): string;\n    get pid(): number | undefined;\n    get cwd(): string;\n    get cmd(): string;\n    get fullCmd(): string;\n    get child(): ChildProcess | undefined;\n    get stdin(): Writable;\n    get stdout(): Readable;\n    get stderr(): Readable;\n    get exitCode(): Promise<number | null>;\n    get signal(): AbortSignal;\n    get ac(): AbortController;\n    get output(): ProcessOutput | null;\n    get stage(): ProcessStage;\n    get sync(): boolean;\n    get [Symbol.toStringTag](): string;\n    [Symbol.toPrimitive](): string;\n    json<T = any>(): Promise<T>;\n    text(encoding?: Encoding): Promise<string>;\n    lines(delimiter?: Options['delimiter']): Promise<string[]>;\n    buffer(): Promise<Buffer>;\n    blob(type?: string): Promise<Blob>;\n    isQuiet(): boolean;\n    isVerbose(): boolean;\n    isNothrow(): boolean;\n    isHalted(): boolean;\n    private isSettled;\n    private isRunning;\n    get pipe(): PipeMethod & {\n        [key in keyof TSpawnStore]: PipeMethod;\n    };\n    unpipe(to?: PipeAcceptor): this;\n    private _pipe;\n    private static bus;\n    private static promisifyStream;\n    then<R = ProcessOutput, E = ProcessOutput>(onfulfilled?: ((value: ProcessOutput) => PromiseLike<R> | R) | undefined | null, onrejected?: ((reason: ProcessOutput) => PromiseLike<E> | E) | undefined | null): Promise<R | E>;\n    catch<T = ProcessOutput>(onrejected?: ((reason: ProcessOutput) => PromiseLike<T> | T) | undefined | null): Promise<ProcessOutput | T>;\n    [Symbol.asyncIterator](): AsyncIterator<string>;\n    private writable;\n    private emit;\n    private on;\n    private once;\n    private write;\n    private end;\n    private removeListener;\n    private static disarm;\n}\ntype ProcessDto = {\n    code: number | null;\n    signal: NodeJS.Signals | null;\n    duration: number;\n    error: any;\n    from: string;\n    store: TSpawnStore;\n    delimiter?: string | RegExp;\n};\nexport declare class ProcessOutput extends Error {\n    private readonly _dto;\n    cause: Error | null;\n    message: string;\n    stdout: string;\n    stderr: string;\n    stdall: string;\n    constructor(dto: ProcessDto);\n    constructor(code?: number | null, signal?: NodeJS.Signals | null, stdout?: string, stderr?: string, stdall?: string, message?: string, duration?: number);\n    get exitCode(): number | null;\n    get signal(): NodeJS.Signals | null;\n    get duration(): number;\n    get [Symbol.toStringTag](): string;\n    get ok(): boolean;\n    json<T = any>(): T;\n    buffer(): Buffer;\n    blob(type?: string): Blob;\n    text(encoding?: Encoding): string;\n    lines(delimiter?: string | RegExp): string[];\n    toString(): string;\n    valueOf(): string;\n    [Symbol.toPrimitive](): string;\n    [Symbol.iterator](dlmtr?: Options['delimiter']): Iterator<string>;\n    [inspect.custom](): string;\n    static getExitMessage: typeof Fail.formatExitMessage;\n    static getErrorMessage: typeof Fail.formatErrorMessage;\n    static getErrorDetails: typeof Fail.formatErrorDetails;\n    static getExitCodeInfo: typeof Fail.getExitCodeInfo;\n    static fromError(error: Error): ProcessOutput;\n}\nexport declare const useBash: () => void;\nexport declare const usePwsh: () => void;\nexport declare const usePowerShell: () => void;\nexport declare function syncProcessCwd(flag?: boolean): void;\nexport declare function cd(dir: string | ProcessOutput): void;\nexport declare function kill(pid: number | `${number}`, signal?: NodeJS.Signals): Promise<void>;\nexport declare function resolveDefaults(defs?: Options, prefix?: string, env?: NodeJS.ProcessEnv, allowed?: Set<string>): Options;\n"
  },
  {
    "path": "build/core.js",
    "content": "\"use strict\";\nimport \"./deno.js\"\nimport * as __module__ from \"./core.cjs\"\nconst {\n  $,\n  Fail,\n  ProcessOutput,\n  ProcessPromise,\n  bus,\n  cd,\n  chalk,\n  defaults,\n  kill,\n  log,\n  os,\n  path,\n  ps,\n  quote,\n  quotePowerShell,\n  resolveDefaults,\n  syncProcessCwd,\n  useBash,\n  usePowerShell,\n  usePwsh,\n  which,\n  within\n} = globalThis.Deno ? globalThis.require(\"./core.cjs\") : __module__\nexport {\n  $,\n  Fail,\n  ProcessOutput,\n  ProcessPromise,\n  bus,\n  cd,\n  chalk,\n  defaults,\n  kill,\n  log,\n  os,\n  path,\n  ps,\n  quote,\n  quotePowerShell,\n  resolveDefaults,\n  syncProcessCwd,\n  useBash,\n  usePowerShell,\n  usePwsh,\n  which,\n  within\n}\n\n"
  },
  {
    "path": "build/deno.js",
    "content": "import { createRequire } from 'node:module'\nimport * as process from 'node:process'\n\n// prettier-ignore\nif (globalThis.Deno) {\n  globalThis.require = createRequire(import.meta.url)\n  globalThis.__filename = new URL(import.meta.url).pathname\n  globalThis.__dirname = new URL('.', import.meta.url).pathname\n  globalThis.module = new Proxy({}, { set() { return true } })\n\n  const p = globalThis.process = globalThis.process || process\n  p.version || (p.version = 'v18.0.0')\n  p.version || (p.version = { node: '18.0.0' })\n  p.env || (p.env = globalThis.Deno.env.toObject())\n  p.argv || (p.argv = [globalThis.Deno.execPath(), globalThis.Deno.mainModule.replace('file://', ''), ...globalThis.Deno.args])\n}\n"
  },
  {
    "path": "build/deps.cjs",
    "content": "\"use strict\";\nconst {\n  __export,\n  __toCommonJS,\n  __async\n} = require('./esblib.cjs');\n\n\n// src/deps.ts\nvar deps_exports = {};\n__export(deps_exports, {\n  installDeps: () => installDeps,\n  parseDeps: () => parseDeps\n});\nmodule.exports = __toCommonJS(deps_exports);\nvar import_node_module = require(\"module\");\nvar import_index = require(\"./index.cjs\");\nvar import_vendor = require(\"./vendor.cjs\");\nfunction installDeps(dependencies, prefix, registry, installerType = \"npm\") {\n  return __async(this, null, function* () {\n    const installer = installers[installerType];\n    const packages = Object.entries(dependencies).map(\n      ([name, version]) => `${name}@${version}`\n    );\n    if (packages.length === 0) return;\n    if (!installer) {\n      throw new import_index.Fail(\n        `Unsupported installer type: ${installerType}. Supported types: ${Object.keys(installers).join(\", \")}`\n      );\n    }\n    yield (0, import_index.spinner)(\n      `${installerType} i ${packages.join(\" \")}`,\n      () => installer({ packages, prefix, registry })\n    );\n  });\n}\nvar installers = {\n  npm: (_0) => __async(null, [_0], function* ({ packages, prefix, registry }) {\n    const flags = [\n      \"--no-save\",\n      \"--no-audit\",\n      \"--no-fund\",\n      prefix && `--prefix=${prefix}`,\n      registry && `--registry=${registry}`\n    ].filter(Boolean);\n    yield import_index.$`npm install ${flags} ${packages}`.nothrow();\n  })\n};\nvar builtins = new Set(import_node_module.builtinModules);\nvar nameRe = new RegExp(\"^(?<name>(@[a-z\\\\d-~][\\\\w-.~]*\\\\/)?[a-z\\\\d-~][\\\\w-.~]*)\\\\/?.*$\", \"i\");\nvar versionRe = new RegExp(\"^@(?<version>[~^]?(v?[\\\\dx*]+([-.][\\\\d*a-z-]+)*))\", \"i\");\nfunction parseDeps(content) {\n  return (0, import_vendor.depseek)(content + \"\\n\", { comments: true }).reduce((m, { type, value }, i, list) => {\n    if (type === \"dep\") {\n      const meta = list[i + 1];\n      const name = parsePackageName(value);\n      const version = (meta == null ? void 0 : meta.type) === \"comment\" && parseVersion(meta == null ? void 0 : meta.value.trim()) || \"latest\";\n      if (name) m[name] = version;\n    }\n    return m;\n  }, {});\n}\nfunction parsePackageName(path) {\n  var _a, _b;\n  if (!path) return;\n  const name = (_b = (_a = nameRe.exec(path)) == null ? void 0 : _a.groups) == null ? void 0 : _b.name;\n  if (name && !builtins.has(name)) return name;\n}\nfunction parseVersion(line) {\n  var _a, _b;\n  return ((_b = (_a = versionRe.exec(line)) == null ? void 0 : _a.groups) == null ? void 0 : _b.version) || \"latest\";\n}\n/* c8 ignore next 100 */\n// Annotate the CommonJS export names for ESM import in node:\n0 && (module.exports = {\n  installDeps,\n  parseDeps\n});"
  },
  {
    "path": "build/deps.d.ts",
    "content": "/**\n * Install npm dependencies\n * @param dependencies object of dependencies\n * @param prefix  path to the directory where npm should install the dependencies\n * @param registry custom npm registry URL when installing dependencies\n * @param installerType package manager: npm, yarn, pnpm, bun, etc.\n */\nexport declare function installDeps(dependencies: Record<string, string>, prefix?: string, registry?: string, installerType?: string): Promise<void>;\nexport declare function parseDeps(content: string): Record<string, string>;\n"
  },
  {
    "path": "build/error.d.ts",
    "content": "export declare class Fail extends Error {\n    static DOCS_URL: string;\n    static EXIT_CODES: Record<number, string>;\n    static ERRNO_CODES: Record<number, string>;\n    static formatExitMessage(code: number | null, signal: NodeJS.Signals | null, stderr: string, from: string, details?: string): string;\n    static formatErrorMessage(err: NodeJS.ErrnoException, from: string): string;\n    static formatErrorDetails(lines?: string[], lim?: number): string;\n    static getExitCodeInfo(exitCode: number | null): string | undefined;\n    static getCallerLocationFromString(stackString?: string): string;\n    static getCallerLocation(err?: Error): string;\n    static getErrnoMessage(errno?: number): string;\n}\n"
  },
  {
    "path": "build/esblib.cjs",
    "content": "\nvar __create = Object.create;\n\nvar __defProp = Object.defineProperty;\n\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\n\nvar __getOwnPropNames = Object.getOwnPropertyNames;\n\nvar __getProtoOf = Object.getPrototypeOf;\n\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\n\nvar __export = (target, all) => {\n  for (var name in all)\n    __defProp(target, name, { get: all[name], enumerable: true });\n};\n\nvar __copyProps = (to, from, except, desc) => {\n  if (from && typeof from === \"object\" || typeof from === \"function\") {\n    for (let key of __getOwnPropNames(from))\n      if (!__hasOwnProp.call(to, key) && key !== except)\n        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n  }\n  return to;\n};\n\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n  // If the importer is in node compatibility mode or this is not an ESM\n  // file that has been converted to a CommonJS file using a Babel-\n  // compatible transform (i.e. \"__esModule\" has not been set), then set\n  // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n  isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n  mod\n));\n\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\n\nvar __async = (__this, __arguments, generator) => {\n  return new Promise((resolve, reject) => {\n    var fulfilled = (value) => {\n      try {\n        step(generator.next(value));\n      } catch (e) {\n        reject(e);\n      }\n    };\n    var rejected = (value) => {\n      try {\n        step(generator.throw(value));\n      } catch (e) {\n        reject(e);\n      }\n    };\n    var step = (x2) => x2.done ? resolve(x2.value) : Promise.resolve(x2.value).then(fulfilled, rejected);\n    step((generator = generator.apply(__this, __arguments)).next());\n  });\n};\n\nvar __defProps = Object.defineProperties;\n\nvar __getOwnPropDescs = Object.getOwnPropertyDescriptors;\n\nvar __getOwnPropSymbols = Object.getOwnPropertySymbols;\n\nvar __propIsEnum = Object.prototype.propertyIsEnumerable;\n\nvar __knownSymbol = (name, symbol) => (symbol = Symbol[name]) ? symbol : /* @__PURE__ */ Symbol.for(\"Symbol.\" + name);\n\nvar __typeError = (msg) => {\n  throw TypeError(msg);\n};\n\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\n\nvar __spreadValues = (a, b) => {\n  for (var prop in b || (b = {}))\n    if (__hasOwnProp.call(b, prop))\n      __defNormalProp(a, prop, b[prop]);\n  if (__getOwnPropSymbols)\n    for (var prop of __getOwnPropSymbols(b)) {\n      if (__propIsEnum.call(b, prop))\n        __defNormalProp(a, prop, b[prop]);\n    }\n  return a;\n};\n\nvar __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));\n\nvar __await = function(promise, isYieldStar) {\n  this[0] = promise;\n  this[1] = isYieldStar;\n};\n\nvar __asyncGenerator = (__this, __arguments, generator) => {\n  var resume = (k2, v2, yes, no) => {\n    try {\n      var x2 = generator[k2](v2), isAwait = (v2 = x2.value) instanceof __await, done = x2.done;\n      Promise.resolve(isAwait ? v2[0] : v2).then((y) => isAwait ? resume(k2 === \"return\" ? k2 : \"next\", v2[1] ? { done: y.done, value: y.value } : y, yes, no) : yes({ value: y, done })).catch((e) => resume(\"throw\", e, yes, no));\n    } catch (e) {\n      no(e);\n    }\n  }, method = (k2) => it[k2] = (x2) => new Promise((yes, no) => resume(k2, x2, yes, no)), it = {};\n  return generator = generator.apply(__this, __arguments), it[__knownSymbol(\"asyncIterator\")] = () => it, method(\"next\"), method(\"throw\"), method(\"return\"), it;\n};\n\nvar __yieldStar = (value) => {\n  var obj = value[__knownSymbol(\"asyncIterator\")], isAwait = false, method, it = {};\n  if (obj == null) {\n    obj = value[__knownSymbol(\"iterator\")]();\n    method = (k2) => it[k2] = (x2) => obj[k2](x2);\n  } else {\n    obj = obj.call(value);\n    method = (k2) => it[k2] = (v2) => {\n      if (isAwait) {\n        isAwait = false;\n        if (k2 === \"throw\") throw v2;\n        return v2;\n      }\n      isAwait = true;\n      return {\n        done: false,\n        value: new __await(new Promise((resolve) => {\n          var x2 = obj[k2](v2);\n          if (!(x2 instanceof Object)) __typeError(\"Object expected\");\n          resolve(x2);\n        }), 1)\n      };\n    };\n  }\n  return it[__knownSymbol(\"iterator\")] = () => it, method(\"next\"), \"throw\" in obj ? method(\"throw\") : it.throw = (x2) => {\n    throw x2;\n  }, \"return\" in obj && method(\"return\"), it;\n};\n\nvar __forAwait = (obj, it, method) => (it = obj[__knownSymbol(\"asyncIterator\")]) ? it.call(obj) : (obj = obj[__knownSymbol(\"iterator\")](), it = {}, method = (key, fn) => (fn = obj[key]) && (it[key] = (arg) => new Promise((yes, no, done) => (arg = fn.call(obj, arg), done = arg.done, Promise.resolve(arg.value).then((value) => yes({ value, done }), no)))), method(\"next\"), method(\"return\"), it);\n\nvar __pow = Math.pow;\n\nvar __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, \"default\"), secondTarget && __copyProps(secondTarget, mod, \"default\"));\n\nvar __commonJS = (cb, mod) => function __require() {\n  return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;\n};\n\nvar __esm = (fn, res) => function __init() {\n  return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;\n};\n\nvar __accessCheck = (obj, member, msg) => member.has(obj) || __typeError(\"Cannot \" + msg);\n\nvar __privateGet = (obj, member, getter) => (__accessCheck(obj, member, \"read from private field\"), getter ? getter.call(obj) : member.get(obj));\n\nvar __privateAdd = (obj, member, value) => member.has(obj) ? __typeError(\"Cannot add the same private member more than once\") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);\n\nvar __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, \"write to private field\"), setter ? setter.call(obj, value) : member.set(obj, value), value);\n\nmodule.exports = {\n  __create,\n  __defProp,\n  __getOwnPropDesc,\n  __getOwnPropNames,\n  __getProtoOf,\n  __hasOwnProp,\n  __export,\n  __copyProps,\n  __toESM,\n  __toCommonJS,\n  __async,\n  __defProps,\n  __getOwnPropDescs,\n  __getOwnPropSymbols,\n  __propIsEnum,\n  __knownSymbol,\n  __typeError,\n  __defNormalProp,\n  __spreadValues,\n  __spreadProps,\n  __await,\n  __asyncGenerator,\n  __yieldStar,\n  __forAwait,\n  __pow,\n  __reExport,\n  __commonJS,\n  __esm,\n  __accessCheck,\n  __privateGet,\n  __privateAdd,\n  __privateSet\n};\n"
  },
  {
    "path": "build/globals.cjs",
    "content": "\"use strict\";\nconst {\n  __toESM\n} = require('./esblib.cjs');\n\n\n// src/globals.ts\nvar _ = __toESM(require(\"./index.cjs\"), 1);\nObject.assign(globalThis, _);"
  },
  {
    "path": "build/globals.d.ts",
    "content": "import * as _ from './index.js';\ndeclare global {\n    type ProcessPromise = _.ProcessPromise;\n    type ProcessOutput = _.ProcessOutput;\n    var ProcessPromise: typeof _.ProcessPromise;\n    var ProcessOutput: typeof _.ProcessOutput;\n    var $: typeof _.$;\n    var argv: typeof _.argv;\n    var cd: typeof _.cd;\n    var chalk: typeof _.chalk;\n    var defaults: typeof _.defaults;\n    var dotenv: typeof _.dotenv;\n    var echo: typeof _.echo;\n    var expBackoff: typeof _.expBackoff;\n    var fs: typeof _.fs;\n    var glob: typeof _.glob;\n    var globby: typeof _.globby;\n    var kill: typeof _.kill;\n    var log: typeof _.log;\n    var minimist: typeof _.minimist;\n    var nothrow: typeof _.nothrow;\n    var os: typeof _.os;\n    var parseArgv: typeof _.parseArgv;\n    var path: typeof _.path;\n    var ps: typeof _.ps;\n    var question: typeof _.question;\n    var quiet: typeof _.quiet;\n    var quote: typeof _.quote;\n    var quotePowerShell: typeof _.quotePowerShell;\n    var resolveDefaults: typeof _.resolveDefaults;\n    var retry: typeof _.retry;\n    var sleep: typeof _.sleep;\n    var spinner: typeof _.spinner;\n    var stdin: typeof _.stdin;\n    var syncProcessCwd: typeof _.syncProcessCwd;\n    var tempdir: typeof _.tempdir;\n    var tempfile: typeof _.tempfile;\n    var tmpdir: typeof _.tempdir;\n    var tmpfile: typeof _.tempfile;\n    var updateArgv: typeof _.updateArgv;\n    var usePowerShell: typeof _.usePowerShell;\n    var usePwsh: typeof _.usePwsh;\n    var useBash: typeof _.useBash;\n    var version: typeof _.version;\n    var VERSION: typeof _.VERSION;\n    var which: typeof _.which;\n    var within: typeof _.within;\n    var YAML: typeof _.YAML;\n}\n"
  },
  {
    "path": "build/globals.js",
    "content": "\"use strict\";\nimport \"./deno.js\"\nimport * as __module__ from \"./globals.cjs\"\nconst {\n\n} = globalThis.Deno ? globalThis.require(\"./globals.cjs\") : __module__\nexport {\n\n}\n\n"
  },
  {
    "path": "build/goods.d.ts",
    "content": "import { Buffer } from 'node:buffer';\nimport { Readable } from 'node:stream';\nimport { type Mode } from 'node:fs';\nimport { type ProcessPromise } from './core.js';\nimport { type Duration } from './util.js';\nimport { type RequestInfo, type RequestInit, minimist } from './vendor.js';\nexport { versions } from './versions.js';\nexport declare function tempdir(prefix?: string, mode?: Mode): string;\nexport declare function tempfile(name?: string, data?: string | Buffer, mode?: Mode): string;\nexport { tempdir as tmpdir, tempfile as tmpfile };\ntype ArgvOpts = minimist.Opts & {\n    camelCase?: boolean;\n    parseBoolean?: boolean;\n};\nexport declare const parseArgv: (args?: string[], opts?: ArgvOpts, defs?: Record<string, any>) => minimist.ParsedArgs;\nexport declare function updateArgv(args?: string[], opts?: ArgvOpts): void;\nexport declare const argv: minimist.ParsedArgs;\nexport declare function sleep(duration: Duration): Promise<void>;\nexport declare function fetch(url: RequestInfo, init?: RequestInit): Promise<Response> & {\n    pipe: {\n        (dest: TemplateStringsArray, ...args: any[]): ProcessPromise;\n        <D>(dest: D): D;\n    };\n};\nexport declare function echo(...args: any[]): void;\nexport declare function question(query?: string, { choices, input, output, }?: {\n    choices?: string[];\n    input?: NodeJS.ReadStream;\n    output?: NodeJS.WriteStream;\n}): Promise<string>;\nexport declare function stdin(stream?: Readable): Promise<string>;\nexport declare function retry<T>(count: number, callback: () => T): Promise<T>;\nexport declare function retry<T>(count: number, duration: Duration | Generator<number>, callback: () => T): Promise<T>;\nexport declare function expBackoff(max?: Duration, delay?: Duration): Generator<number, void, unknown>;\nexport declare function spinner<T>(callback: () => T): Promise<T>;\nexport declare function spinner<T>(title: string, callback: () => T): Promise<T>;\n"
  },
  {
    "path": "build/index.cjs",
    "content": "\"use strict\";\nconst {\n  __pow,\n  __export,\n  __reExport,\n  __toESM,\n  __toCommonJS,\n  __async,\n  __forAwait\n} = require('./esblib.cjs');\n\n\n// src/index.ts\nvar index_exports = {};\n__export(index_exports, {\n  MAML: () => import_vendor2.MAML,\n  VERSION: () => VERSION,\n  YAML: () => import_vendor2.YAML,\n  argv: () => argv,\n  dotenv: () => import_vendor2.dotenv,\n  echo: () => echo,\n  expBackoff: () => expBackoff,\n  fetch: () => fetch,\n  fs: () => import_vendor2.fs,\n  glob: () => import_vendor2.glob,\n  globby: () => import_vendor2.glob,\n  minimist: () => import_vendor2.minimist,\n  nothrow: () => nothrow,\n  parseArgv: () => parseArgv,\n  question: () => question,\n  quiet: () => quiet,\n  retry: () => retry,\n  sleep: () => sleep,\n  spinner: () => spinner,\n  stdin: () => stdin,\n  tempdir: () => tempdir,\n  tempfile: () => tempfile,\n  tmpdir: () => tempdir,\n  tmpfile: () => tempfile,\n  updateArgv: () => updateArgv,\n  version: () => version,\n  versions: () => versions\n});\nmodule.exports = __toCommonJS(index_exports);\nvar import_core2 = require(\"./core.cjs\");\n\n// src/goods.ts\nvar import_node_buffer = require(\"buffer\");\nvar import_node_process = __toESM(require(\"process\"), 1);\nvar import_node_readline = require(\"readline\");\nvar import_node_stream = require(\"stream\");\nvar import_core = require(\"./core.cjs\");\nvar import_util = require(\"./util.cjs\");\nvar import_vendor = require(\"./vendor.cjs\");\n\n// src/versions.ts\nvar versions = {\n  zx: \"8.9.0\",\n  chalk: \"5.6.2\",\n  depseek: \"0.4.3\",\n  dotenv: \"0.2.3\",\n  fetch: \"1.6.7\",\n  fs: \"11.3.3\",\n  glob: \"16.1.1\",\n  minimist: \"1.2.8\",\n  ps: \"1.0.0\",\n  which: \"6.0.1\",\n  yaml: \"2.8.2\"\n};\n\n// src/goods.ts\nfunction tempdir(prefix = `zx-${(0, import_util.randomId)()}`, mode) {\n  const dirpath = import_core.path.join(import_core.os.tmpdir(), prefix);\n  import_vendor.fs.mkdirSync(dirpath, { recursive: true, mode });\n  return dirpath;\n}\nfunction tempfile(name, data, mode) {\n  const filepath = name ? import_core.path.join(tempdir(), name) : import_core.path.join(import_core.os.tmpdir(), `zx-${(0, import_util.randomId)()}`);\n  if (data === void 0) import_vendor.fs.closeSync(import_vendor.fs.openSync(filepath, \"w\", mode));\n  else import_vendor.fs.writeFileSync(filepath, data, { mode });\n  return filepath;\n}\nvar parseArgv = (args = import_node_process.default.argv.slice(2), opts = {}, defs = {}) => Object.entries((0, import_vendor.minimist)(args, opts)).reduce(\n  (m, [k, v]) => {\n    const kTrans = opts.camelCase ? import_util.toCamelCase : import_util.identity;\n    const vTrans = opts.parseBoolean ? import_util.parseBool : import_util.identity;\n    const [_k, _v] = k === \"--\" || k === \"_\" ? [k, v] : [kTrans(k), vTrans(v)];\n    m[_k] = _v;\n    return m;\n  },\n  defs\n);\nfunction updateArgv(args, opts) {\n  for (const k in argv) delete argv[k];\n  parseArgv(args, opts, argv);\n}\nvar argv = parseArgv();\nfunction sleep(duration) {\n  return new Promise((resolve) => {\n    setTimeout(resolve, (0, import_util.parseDuration)(duration));\n  });\n}\nvar responseToReadable = (response, rs) => {\n  var _a;\n  const reader = (_a = response.body) == null ? void 0 : _a.getReader();\n  if (!reader) {\n    rs.push(null);\n    return rs;\n  }\n  rs._read = () => __async(null, null, function* () {\n    const result = yield reader.read();\n    rs.push(result.done ? null : import_node_buffer.Buffer.from(result.value));\n  });\n  return rs;\n};\nfunction fetch(url, init) {\n  import_core.$.log({ kind: \"fetch\", url, init, verbose: !import_core.$.quiet && import_core.$.verbose });\n  const p = (0, import_vendor.nodeFetch)(url, init);\n  return Object.assign(p, {\n    pipe(dest, ...args) {\n      const rs = new import_node_stream.Readable();\n      const _dest = (0, import_util.isStringLiteral)(dest, ...args) ? (0, import_core.$)({\n        halt: true,\n        signal: init == null ? void 0 : init.signal\n      })(dest, ...args) : dest;\n      p.then(\n        (r) => {\n          var _a;\n          return responseToReadable(r, rs).pipe((_a = _dest.run) == null ? void 0 : _a.call(_dest));\n        },\n        (err) => {\n          var _a;\n          return (_a = _dest.abort) == null ? void 0 : _a.call(_dest, err);\n        }\n      );\n      return _dest;\n    }\n  });\n}\nfunction echo(pieces, ...args) {\n  const msg = (0, import_util.isStringLiteral)(pieces, ...args) ? args.map((a, i) => pieces[i] + stringify(a)).join(\"\") + (0, import_util.getLast)(pieces) : [pieces, ...args].map(stringify).join(\" \");\n  console.log(msg);\n}\nfunction stringify(arg) {\n  return arg instanceof import_core.ProcessOutput ? arg.toString().trimEnd() : `${arg}`;\n}\nfunction question(_0) {\n  return __async(this, arguments, function* (query, {\n    choices,\n    input = import_node_process.default.stdin,\n    output = import_node_process.default.stdout\n  } = {}) {\n    const completer = Array.isArray(choices) ? (line) => {\n      const hits = choices.filter((c) => c.startsWith(line));\n      return [hits.length ? hits : choices, line];\n    } : void 0;\n    const rl = (0, import_node_readline.createInterface)({\n      input,\n      output,\n      terminal: true,\n      completer\n    });\n    return new Promise(\n      (resolve) => rl.question(query != null ? query : \"\", (answer) => {\n        rl.close();\n        resolve(answer);\n      })\n    );\n  });\n}\nfunction stdin() {\n  return __async(this, arguments, function* (stream = import_node_process.default.stdin) {\n    let buf = \"\";\n    try {\n      for (var iter = __forAwait(stream.setEncoding(\"utf8\")), more, temp, error; more = !(temp = yield iter.next()).done; more = false) {\n        const chunk = temp.value;\n        buf += chunk;\n      }\n    } catch (temp) {\n      error = [temp];\n    } finally {\n      try {\n        more && (temp = iter.return) && (yield temp.call(iter));\n      } finally {\n        if (error)\n          throw error[0];\n      }\n    }\n    return buf;\n  });\n}\nfunction retry(count, d, cb) {\n  return __async(this, null, function* () {\n    if (typeof d === \"function\") return retry(count, 0, d);\n    if (!cb) throw new import_core.Fail(\"Callback is required for retry\");\n    const total = count;\n    const gen = typeof d === \"object\" ? d : (function* (d2) {\n      while (true) yield d2;\n    })((0, import_util.parseDuration)(d));\n    let attempt = 0;\n    let lastErr;\n    while (count-- > 0) {\n      attempt++;\n      try {\n        return yield cb();\n      } catch (err) {\n        lastErr = err;\n        const delay = gen.next().value;\n        import_core.$.log({\n          kind: \"retry\",\n          total,\n          attempt,\n          delay,\n          exception: err,\n          verbose: !import_core.$.quiet && import_core.$.verbose,\n          error: `FAIL Attempt: ${attempt}/${total}, next: ${delay}`\n          // legacy\n        });\n        if (delay > 0) yield sleep(delay);\n      }\n    }\n    throw lastErr;\n  });\n}\nfunction* expBackoff(max = \"60s\", delay = \"100ms\") {\n  const maxMs = (0, import_util.parseDuration)(max);\n  const randMs = (0, import_util.parseDuration)(delay);\n  let n = 0;\n  while (true) {\n    yield Math.min(randMs * __pow(2, n++), maxMs);\n  }\n}\nfunction spinner(title, callback) {\n  return __async(this, null, function* () {\n    if (typeof title === \"function\") return spinner(\"\", title);\n    if (import_core.$.quiet || import_node_process.default.env.CI) return callback();\n    let i = 0;\n    const stream = import_core.$.log.output || import_node_process.default.stderr;\n    const spin = () => stream.write(`  ${\"\\u280B\\u2819\\u2839\\u2838\\u283C\\u2834\\u2826\\u2827\\u2807\\u280F\"[i++ % 10]} ${title}\\r`);\n    return (0, import_core.within)(() => __async(null, null, function* () {\n      import_core.$.verbose = false;\n      const id = setInterval(spin, 100);\n      try {\n        return yield callback();\n      } finally {\n        clearInterval(id);\n        stream.write(\" \".repeat((import_node_process.default.stdout.columns || 1) - 1) + \"\\r\");\n      }\n    }));\n  });\n}\n\n// src/index.ts\n__reExport(index_exports, require(\"./core.cjs\"), module.exports);\nvar import_vendor2 = require(\"./vendor.cjs\");\nimport_core2.bus.lock();\nvar VERSION = versions.zx || \"0.0.0\";\nvar version = VERSION;\nfunction nothrow(promise) {\n  return promise.nothrow();\n}\nfunction quiet(promise) {\n  return promise.quiet();\n}\n/* c8 ignore next 100 */\n// Annotate the CommonJS export names for ESM import in node:\n0 && (module.exports = {\n  MAML,\n  VERSION,\n  YAML,\n  argv,\n  dotenv,\n  echo,\n  expBackoff,\n  fetch,\n  fs,\n  glob,\n  globby,\n  minimist,\n  nothrow,\n  parseArgv,\n  question,\n  quiet,\n  retry,\n  sleep,\n  spinner,\n  stdin,\n  tempdir,\n  tempfile,\n  tmpdir,\n  tmpfile,\n  updateArgv,\n  version,\n  versions,\n  ...require(\"./core.cjs\")\n});"
  },
  {
    "path": "build/index.d.ts",
    "content": "/// <reference types=\"node\" />\n/// <reference types=\"fs-extra\" />\n\nimport { type ProcessPromise } from './core.js';\nexport * from './core.js';\nexport * from './goods.js';\nexport { minimist, dotenv, fs, YAML, MAML, glob, glob as globby, } from './vendor.js';\nexport declare const VERSION: string;\nexport declare const version: string;\n/**\n *  @deprecated Use $`cmd`.nothrow() instead.\n */\nexport declare function nothrow(promise: ProcessPromise): ProcessPromise;\n/**\n * @deprecated Use $`cmd`.quiet() instead.\n */\nexport declare function quiet(promise: ProcessPromise): ProcessPromise;\n"
  },
  {
    "path": "build/index.js",
    "content": "\"use strict\";\nimport \"./deno.js\"\nimport * as __module__ from \"./index.cjs\"\nconst {\n  MAML,\n  VERSION,\n  YAML,\n  argv,\n  dotenv,\n  echo,\n  expBackoff,\n  fetch,\n  fs,\n  glob,\n  globby,\n  minimist,\n  nothrow,\n  parseArgv,\n  question,\n  quiet,\n  retry,\n  sleep,\n  spinner,\n  stdin,\n  tempdir,\n  tempfile,\n  tmpdir,\n  tmpfile,\n  updateArgv,\n  version,\n  versions,\n  $,\n  Fail,\n  ProcessOutput,\n  ProcessPromise,\n  bus,\n  cd,\n  chalk,\n  defaults,\n  kill,\n  log,\n  os,\n  path,\n  ps,\n  quote,\n  quotePowerShell,\n  resolveDefaults,\n  syncProcessCwd,\n  useBash,\n  usePowerShell,\n  usePwsh,\n  which,\n  within\n} = globalThis.Deno ? globalThis.require(\"./index.cjs\") : __module__\nexport {\n  MAML,\n  VERSION,\n  YAML,\n  argv,\n  dotenv,\n  echo,\n  expBackoff,\n  fetch,\n  fs,\n  glob,\n  globby,\n  minimist,\n  nothrow,\n  parseArgv,\n  question,\n  quiet,\n  retry,\n  sleep,\n  spinner,\n  stdin,\n  tempdir,\n  tempfile,\n  tmpdir,\n  tmpfile,\n  updateArgv,\n  version,\n  versions,\n  $,\n  Fail,\n  ProcessOutput,\n  ProcessPromise,\n  bus,\n  cd,\n  chalk,\n  defaults,\n  kill,\n  log,\n  os,\n  path,\n  ps,\n  quote,\n  quotePowerShell,\n  resolveDefaults,\n  syncProcessCwd,\n  useBash,\n  usePowerShell,\n  usePwsh,\n  which,\n  within\n}\n\n"
  },
  {
    "path": "build/internals.cjs",
    "content": "\"use strict\";\nconst {\n  __export,\n  __toCommonJS\n} = require('./esblib.cjs');\n\n\n// src/internals.ts\nvar internals_exports = {};\n__export(internals_exports, {\n  bus: () => bus\n});\nmodule.exports = __toCommonJS(internals_exports);\nvar locked = false;\nvar lock = () => locked = true;\nvar store = /* @__PURE__ */ new Map();\nvar override = store.set.bind(store);\nfunction wrap(name, api) {\n  if (locked) throw new Error(\"bus is locked\");\n  override(name, api);\n  return new Proxy(api, {\n    get(_, key) {\n      var _a, _b;\n      return store.get(name)[key] || ((_b = (_a = store.get(name)) == null ? void 0 : _a.default) == null ? void 0 : _b[key]);\n    },\n    apply(_, self, args) {\n      return store.get(name).apply(self, args);\n    }\n  });\n}\nvar bus = {\n  override,\n  wrap,\n  lock\n};\n/* c8 ignore next 100 */\n// Annotate the CommonJS export names for ESM import in node:\n0 && (module.exports = {\n  bus\n});"
  },
  {
    "path": "build/internals.d.ts",
    "content": "declare function wrap<T extends object>(name: string, api: T): T;\n/**\n * @internal\n * @private\n * @protected\n */\nexport declare const bus: {\n    override: (key: string, value: any) => Map<string, any>;\n    wrap: typeof wrap;\n    lock: () => void;\n};\nexport {};\n"
  },
  {
    "path": "build/log.d.ts",
    "content": "import { type RequestInfo, type RequestInit } from './vendor-core.js';\nimport { type Buffer } from 'node:buffer';\nexport type LogEntry = {\n    verbose?: boolean;\n} & ({\n    kind: 'cmd';\n    cmd: string;\n    cwd: string;\n    id: string;\n} | {\n    kind: 'stdout';\n    data: Buffer;\n    id: string;\n} | {\n    kind: 'stderr';\n    data: Buffer;\n    id: string;\n} | {\n    kind: 'end';\n    exitCode: number | null;\n    signal: NodeJS.Signals | null;\n    duration: number;\n    error: null | Error;\n    id: string;\n} | {\n    kind: 'cd';\n    dir: string;\n} | {\n    kind: 'fetch';\n    url: RequestInfo;\n    init?: RequestInit;\n} | {\n    kind: 'retry';\n    attempt: number;\n    total: number;\n    delay: number;\n    exception: unknown;\n    error?: string;\n} | {\n    kind: 'custom';\n    data: any;\n} | {\n    kind: 'kill';\n    pid: number | `${number}`;\n    signal: NodeJS.Signals | null;\n});\ntype LogFormatters = {\n    [key in LogEntry['kind']]: (entry: Extract<LogEntry, {\n        kind: key;\n    }>) => string | Buffer;\n};\ntype Log = {\n    (entry: LogEntry): void;\n    formatters?: Partial<LogFormatters>;\n    output?: NodeJS.WriteStream;\n};\nexport declare const log: Log;\nexport declare function formatCmd(cmd: string): string;\nexport {};\n"
  },
  {
    "path": "build/md.d.ts",
    "content": "import { type Buffer } from 'node:buffer';\nexport declare function transformMarkdown(buf: Buffer | string): string;\n"
  },
  {
    "path": "build/util.cjs",
    "content": "\"use strict\";\nconst {\n  __spreadValues,\n  __spreadProps,\n  __export,\n  __toESM,\n  __toCommonJS\n} = require('./esblib.cjs');\n\n\n// src/util.ts\nvar util_exports = {};\n__export(util_exports, {\n  bufArrJoin: () => bufArrJoin,\n  bufToString: () => bufToString,\n  getLast: () => getLast,\n  getLines: () => getLines,\n  identity: () => identity,\n  isString: () => isString,\n  isStringLiteral: () => import_vendor_core.isStringLiteral,\n  iteratorToArray: () => iteratorToArray,\n  noop: () => noop,\n  once: () => once,\n  parseBool: () => parseBool,\n  parseDuration: () => parseDuration,\n  preferLocalBin: () => preferLocalBin,\n  proxyOverride: () => proxyOverride,\n  quote: () => quote,\n  quotePowerShell: () => quotePowerShell,\n  randomId: () => randomId,\n  toCamelCase: () => toCamelCase\n});\nmodule.exports = __toCommonJS(util_exports);\nvar import_node_path = __toESM(require(\"path\"), 1);\nvar import_node_process = __toESM(require(\"process\"), 1);\nvar import_vendor_core = require(\"./vendor-core.cjs\");\nfunction noop() {\n}\nfunction identity(v) {\n  return v;\n}\nfunction randomId() {\n  return Math.random().toString(36).slice(2);\n}\nfunction isString(obj) {\n  return typeof obj === \"string\";\n}\nvar utf8Decoder = new TextDecoder(\"utf-8\");\nvar bufToString = (buf) => isString(buf) ? buf : utf8Decoder.decode(buf);\nvar bufArrJoin = (arr) => arr.reduce((acc, buf) => acc + bufToString(buf), \"\");\nvar getLast = (arr) => arr[arr.length - 1];\nfunction preferLocalBin(env, ...dirs) {\n  const pathKey = import_node_process.default.platform === \"win32\" ? Object.keys(env).reverse().find((key) => key.toUpperCase() === \"PATH\") || \"Path\" : \"PATH\";\n  const pathValue = dirs.map(\n    (c) => c && [\n      import_node_path.default.resolve(c, \"node_modules\", \".bin\"),\n      import_node_path.default.resolve(c)\n    ]\n  ).flat().concat(env[pathKey]).filter(Boolean).join(import_node_path.default.delimiter);\n  return __spreadProps(__spreadValues({}, env), {\n    [pathKey]: pathValue\n  });\n}\nfunction quote(arg) {\n  if (arg === \"\") return `$''`;\n  if (/^[\\w/.\\-+@:=,%]+$/.test(arg)) return arg;\n  return `$'` + arg.replace(/\\\\/g, \"\\\\\\\\\").replace(/'/g, \"\\\\'\").replace(/\\f/g, \"\\\\f\").replace(/\\n/g, \"\\\\n\").replace(/\\r/g, \"\\\\r\").replace(/\\t/g, \"\\\\t\").replace(/\\v/g, \"\\\\v\").replace(/\\0/g, \"\\\\0\") + `'`;\n}\nfunction quotePowerShell(arg) {\n  if (arg === \"\") return `''`;\n  if (/^[\\w/.\\-@:=,+%]+$/.test(arg)) return arg;\n  return `'` + arg.replace(/'/g, \"''\") + `'`;\n}\nfunction parseDuration(d) {\n  if (typeof d === \"number\") {\n    if (isNaN(d) || d < 0) throw new Error(`Invalid duration: \"${d}\".`);\n    return d;\n  }\n  const [m, v, u] = d.match(/^(\\d+)(m?s?)$/) || [];\n  if (!m) throw new Error(`Unknown duration: \"${d}\".`);\n  return +v * ({ s: 1e3, ms: 1, m: 6e4 }[u] || 1);\n}\nvar once = (fn) => {\n  let called = false;\n  let result;\n  return (...args) => called ? result : (called = true, result = fn(...args));\n};\nvar proxyOverride = (origin, ...fallbacks) => new Proxy(origin, {\n  get(target, key) {\n    var _a, _b;\n    return (_b = (_a = fallbacks.find((f) => key in f)) == null ? void 0 : _a[key]) != null ? _b : Reflect.get(target, key);\n  }\n});\nvar toCamelCase = (str) => str.toLowerCase().replace(/([a-z])[_-]+([a-z])/g, (_, p1, p2) => p1 + p2.toUpperCase());\nvar parseBool = (v) => v === \"true\" || v !== \"false\" && v;\nvar getLines = (chunk, next, delimiter) => {\n  const lines = ((next.pop() || \"\") + bufToString(chunk)).split(delimiter);\n  next.push(lines.pop());\n  return lines;\n};\nvar iteratorToArray = (it) => {\n  const arr = [];\n  let entry;\n  while (!(entry = it.next()).done) arr.push(entry.value);\n  return arr;\n};\n/* c8 ignore next 100 */\n// Annotate the CommonJS export names for ESM import in node:\n0 && (module.exports = {\n  bufArrJoin,\n  bufToString,\n  getLast,\n  getLines,\n  identity,\n  isString,\n  isStringLiteral,\n  iteratorToArray,\n  noop,\n  once,\n  parseBool,\n  parseDuration,\n  preferLocalBin,\n  proxyOverride,\n  quote,\n  quotePowerShell,\n  randomId,\n  toCamelCase\n});"
  },
  {
    "path": "build/util.d.ts",
    "content": "import { type Buffer } from 'node:buffer';\nimport { type TSpawnStore } from './vendor-core.js';\nexport { isStringLiteral } from './vendor-core.js';\nexport declare function noop(): void;\nexport declare function identity<T>(v: T): T;\nexport declare function randomId(): string;\nexport declare function isString(obj: any): obj is string;\nexport declare const bufToString: (buf: Buffer | string) => string;\nexport declare const bufArrJoin: (arr: TSpawnStore[keyof TSpawnStore]) => string;\nexport declare const getLast: <T>(arr: {\n    length: number;\n    [i: number]: any;\n}) => T;\nexport declare function preferLocalBin(env: NodeJS.ProcessEnv, ...dirs: (string | undefined)[]): {\n    [x: string]: string | undefined;\n    TZ?: string | undefined;\n};\nexport declare function quote(arg: string): string;\nexport declare function quotePowerShell(arg: string): string;\nexport type Duration = number | `${number}` | `${number}m` | `${number}s` | `${number}ms`;\nexport declare function parseDuration(d: Duration): number;\nexport declare const once: <T extends (...args: any[]) => any>(fn: T) => (...args: Parameters<T>) => ReturnType<T>;\nexport declare const proxyOverride: <T extends object>(origin: T, ...fallbacks: any) => T;\nexport declare const toCamelCase: (str: string) => string;\nexport declare const parseBool: (v: string) => boolean | string;\nexport declare const getLines: (chunk: Buffer | string, next: (string | undefined)[], delimiter: string | RegExp) => string[];\nexport declare const iteratorToArray: <T>(it: Iterator<T>) => T[];\n"
  },
  {
    "path": "build/vendor-core.cjs",
    "content": "\"use strict\";\nconst {\n  __create,\n  __spreadValues,\n  __spreadProps,\n  __commonJS,\n  __export,\n  __toESM,\n  __toCommonJS,\n  __async\n} = require('./esblib.cjs');\n\n\n// node_modules/isexe/dist/commonjs/index.min.js\nvar require_index_min = __commonJS({\n  \"node_modules/isexe/dist/commonjs/index.min.js\"(exports2) {\n    \"use strict\";\n    var a = (t, e) => () => (e || t((e = { exports: {} }).exports, e), e.exports);\n    var _ = a((i) => {\n      \"use strict\";\n      Object.defineProperty(i, \"__esModule\", { value: true });\n      i.sync = i.isexe = void 0;\n      var M = require(\"fs\"), x = require(\"fs\").promises, q = (_0, ..._1) => __async(null, [_0, ..._1], function* (t, e = {}) {\n        let { ignoreErrors: r = false } = e;\n        try {\n          return d(yield (0, x.stat)(t), e);\n        } catch (s) {\n          let n = s;\n          if (r || n.code === \"EACCES\") return false;\n          throw n;\n        }\n      });\n      i.isexe = q;\n      var m = (t, e = {}) => {\n        let { ignoreErrors: r = false } = e;\n        try {\n          return d((0, M.statSync)(t), e);\n        } catch (s) {\n          let n = s;\n          if (r || n.code === \"EACCES\") return false;\n          throw n;\n        }\n      };\n      i.sync = m;\n      var d = (t, e) => t.isFile() && A(t, e), A = (t, e) => {\n        var _a, _b, _c, _d, _e, _f, _g, _h;\n        let r = (_b = e.uid) != null ? _b : (_a = process.getuid) == null ? void 0 : _a.call(process), s = (_e = (_d = e.groups) != null ? _d : (_c = process.getgroups) == null ? void 0 : _c.call(process)) != null ? _e : [], n = (_h = (_g = e.gid) != null ? _g : (_f = process.getgid) == null ? void 0 : _f.call(process)) != null ? _h : s[0];\n        if (r === void 0 || n === void 0) throw new Error(\"cannot get uid or gid\");\n        let u = /* @__PURE__ */ new Set([n, ...s]), c = t.mode, S = t.uid, P = t.gid, f = parseInt(\"100\", 8), l = parseInt(\"010\", 8), j = parseInt(\"001\", 8), C = f | l;\n        return !!(c & j || c & l && u.has(P) || c & f && S === r || c & C && r === 0);\n      };\n    });\n    var g2 = a((o) => {\n      \"use strict\";\n      Object.defineProperty(o, \"__esModule\", { value: true });\n      o.sync = o.isexe = void 0;\n      var T = require(\"fs\"), I = require(\"fs\").promises, D = require(\"path\"), F = (_0, ..._1) => __async(null, [_0, ..._1], function* (t, e = {}) {\n        let { ignoreErrors: r = false } = e;\n        try {\n          return y(yield (0, I.stat)(t), t, e);\n        } catch (s) {\n          let n = s;\n          if (r || n.code === \"EACCES\") return false;\n          throw n;\n        }\n      });\n      o.isexe = F;\n      var L = (t, e = {}) => {\n        let { ignoreErrors: r = false } = e;\n        try {\n          return y((0, T.statSync)(t), t, e);\n        } catch (s) {\n          let n = s;\n          if (r || n.code === \"EACCES\") return false;\n          throw n;\n        }\n      };\n      o.sync = L;\n      var B = (t, e) => {\n        let { pathExt: r = process.env.PATHEXT || \"\" } = e, s = r.split(D.delimiter);\n        if (s.indexOf(\"\") !== -1) return true;\n        for (let n of s) {\n          let u = n.toLowerCase(), c = t.substring(t.length - u.length).toLowerCase();\n          if (u && c === u) return true;\n        }\n        return false;\n      }, y = (t, e, r) => t.isFile() && B(e, r);\n    });\n    var p = a((h) => {\n      \"use strict\";\n      Object.defineProperty(h, \"__esModule\", { value: true });\n    });\n    var v = exports2 && exports2.__createBinding || (Object.create ? (function(t, e, r, s) {\n      s === void 0 && (s = r);\n      var n = Object.getOwnPropertyDescriptor(e, r);\n      (!n || (\"get\" in n ? !e.__esModule : n.writable || n.configurable)) && (n = { enumerable: true, get: function() {\n        return e[r];\n      } }), Object.defineProperty(t, s, n);\n    }) : (function(t, e, r, s) {\n      s === void 0 && (s = r), t[s] = e[r];\n    }));\n    var G = exports2 && exports2.__setModuleDefault || (Object.create ? (function(t, e) {\n      Object.defineProperty(t, \"default\", { enumerable: true, value: e });\n    }) : function(t, e) {\n      t.default = e;\n    });\n    var w = exports2 && exports2.__importStar || /* @__PURE__ */ (function() {\n      var t = function(e) {\n        return t = Object.getOwnPropertyNames || function(r) {\n          var s = [];\n          for (var n in r) Object.prototype.hasOwnProperty.call(r, n) && (s[s.length] = n);\n          return s;\n        }, t(e);\n      };\n      return function(e) {\n        if (e && e.__esModule) return e;\n        var r = {};\n        if (e != null) for (var s = t(e), n = 0; n < s.length; n++) s[n] !== \"default\" && v(r, e, s[n]);\n        return G(r, e), r;\n      };\n    })();\n    var X = exports2 && exports2.__exportStar || function(t, e) {\n      for (var r in t) r !== \"default\" && !Object.prototype.hasOwnProperty.call(e, r) && v(e, t, r);\n    };\n    Object.defineProperty(exports2, \"__esModule\", { value: true });\n    exports2.sync = exports2.isexe = exports2.posix = exports2.win32 = void 0;\n    var E = w(_());\n    exports2.posix = E;\n    var O = w(g2());\n    exports2.win32 = O;\n    X(p(), exports2);\n    var H = process.env._ISEXE_TEST_PLATFORM_ || process.platform;\n    var b = H === \"win32\" ? O : E;\n    exports2.isexe = b.isexe;\n    exports2.sync = b.sync;\n  }\n});\n\n// node_modules/which/lib/index.js\nvar require_lib = __commonJS({\n  \"node_modules/which/lib/index.js\"(exports2, module2) {\n    \"use strict\";\n    var { isexe, sync: isexeSync } = require_index_min();\n    var { join, delimiter, sep, posix } = require(\"path\");\n    var isWindows = process.platform === \"win32\";\n    var rSlash = new RegExp(`[${posix.sep}${sep === posix.sep ? \"\" : sep}]`.replace(/(\\\\)/g, \"\\\\$1\"));\n    var rRel = new RegExp(`^\\\\.${rSlash.source}`);\n    var getNotFoundError = (cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: \"ENOENT\" });\n    var getPathInfo = (cmd, {\n      path: optPath = process.env.PATH,\n      pathExt: optPathExt = process.env.PATHEXT,\n      delimiter: optDelimiter = delimiter\n    }) => {\n      const pathEnv = cmd.match(rSlash) ? [\"\"] : [\n        // windows always checks the cwd first\n        ...isWindows ? [process.cwd()] : [],\n        ...(optPath || /* istanbul ignore next: very unusual */\n        \"\").split(optDelimiter)\n      ];\n      if (isWindows) {\n        const pathExtExe = optPathExt || [\".EXE\", \".CMD\", \".BAT\", \".COM\"].join(optDelimiter);\n        const pathExt = pathExtExe.split(optDelimiter).flatMap((item) => [item, item.toLowerCase()]);\n        if (cmd.includes(\".\") && pathExt[0] !== \"\") {\n          pathExt.unshift(\"\");\n        }\n        return { pathEnv, pathExt, pathExtExe };\n      }\n      return { pathEnv, pathExt: [\"\"] };\n    };\n    var getPathPart = (raw, cmd) => {\n      const pathPart = /^\".*\"$/.test(raw) ? raw.slice(1, -1) : raw;\n      const prefix = !pathPart && rRel.test(cmd) ? cmd.slice(0, 2) : \"\";\n      return prefix + join(pathPart, cmd);\n    };\n    var which2 = (_0, ..._1) => __async(null, [_0, ..._1], function* (cmd, opt = {}) {\n      const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);\n      const found = [];\n      for (const envPart of pathEnv) {\n        const p = getPathPart(envPart, cmd);\n        for (const ext of pathExt) {\n          const withExt = p + ext;\n          const is = yield isexe(withExt, { pathExt: pathExtExe, ignoreErrors: true });\n          if (is) {\n            if (!opt.all) {\n              return withExt;\n            }\n            found.push(withExt);\n          }\n        }\n      }\n      if (opt.all && found.length) {\n        return found;\n      }\n      if (opt.nothrow) {\n        return null;\n      }\n      throw getNotFoundError(cmd);\n    });\n    var whichSync = (cmd, opt = {}) => {\n      const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);\n      const found = [];\n      for (const pathEnvPart of pathEnv) {\n        const p = getPathPart(pathEnvPart, cmd);\n        for (const ext of pathExt) {\n          const withExt = p + ext;\n          const is = isexeSync(withExt, { pathExt: pathExtExe, ignoreErrors: true });\n          if (is) {\n            if (!opt.all) {\n              return withExt;\n            }\n            found.push(withExt);\n          }\n        }\n      }\n      if (opt.all && found.length) {\n        return found;\n      }\n      if (opt.nothrow) {\n        return null;\n      }\n      throw getNotFoundError(cmd);\n    };\n    module2.exports = which2;\n    which2.sync = whichSync;\n  }\n});\n\n// src/vendor-core.ts\nvar vendor_core_exports = {};\n__export(vendor_core_exports, {\n  VoidStream: () => VoidStream,\n  buildCmd: () => buildCmd,\n  chalk: () => chalk2,\n  exec: () => exec,\n  isStringLiteral: () => isStringLiteral,\n  ps: () => ps,\n  which: () => which\n});\nmodule.exports = __toCommonJS(vendor_core_exports);\n\n// node_modules/chalk/source/vendor/ansi-styles/index.js\nvar ANSI_BACKGROUND_OFFSET = 10;\nvar wrapAnsi16 = (offset = 0) => (code) => `\\x1B[${code + offset}m`;\nvar wrapAnsi256 = (offset = 0) => (code) => `\\x1B[${38 + offset};5;${code}m`;\nvar wrapAnsi16m = (offset = 0) => (red, green, blue) => `\\x1B[${38 + offset};2;${red};${green};${blue}m`;\nvar styles = {\n  modifier: {\n    reset: [0, 0],\n    // 21 isn't widely supported and 22 does the same thing\n    bold: [1, 22],\n    dim: [2, 22],\n    italic: [3, 23],\n    underline: [4, 24],\n    overline: [53, 55],\n    inverse: [7, 27],\n    hidden: [8, 28],\n    strikethrough: [9, 29]\n  },\n  color: {\n    black: [30, 39],\n    red: [31, 39],\n    green: [32, 39],\n    yellow: [33, 39],\n    blue: [34, 39],\n    magenta: [35, 39],\n    cyan: [36, 39],\n    white: [37, 39],\n    // Bright color\n    blackBright: [90, 39],\n    gray: [90, 39],\n    // Alias of `blackBright`\n    grey: [90, 39],\n    // Alias of `blackBright`\n    redBright: [91, 39],\n    greenBright: [92, 39],\n    yellowBright: [93, 39],\n    blueBright: [94, 39],\n    magentaBright: [95, 39],\n    cyanBright: [96, 39],\n    whiteBright: [97, 39]\n  },\n  bgColor: {\n    bgBlack: [40, 49],\n    bgRed: [41, 49],\n    bgGreen: [42, 49],\n    bgYellow: [43, 49],\n    bgBlue: [44, 49],\n    bgMagenta: [45, 49],\n    bgCyan: [46, 49],\n    bgWhite: [47, 49],\n    // Bright color\n    bgBlackBright: [100, 49],\n    bgGray: [100, 49],\n    // Alias of `bgBlackBright`\n    bgGrey: [100, 49],\n    // Alias of `bgBlackBright`\n    bgRedBright: [101, 49],\n    bgGreenBright: [102, 49],\n    bgYellowBright: [103, 49],\n    bgBlueBright: [104, 49],\n    bgMagentaBright: [105, 49],\n    bgCyanBright: [106, 49],\n    bgWhiteBright: [107, 49]\n  }\n};\nvar modifierNames = Object.keys(styles.modifier);\nvar foregroundColorNames = Object.keys(styles.color);\nvar backgroundColorNames = Object.keys(styles.bgColor);\nvar colorNames = [...foregroundColorNames, ...backgroundColorNames];\nfunction assembleStyles() {\n  const codes = /* @__PURE__ */ new Map();\n  for (const [groupName, group] of Object.entries(styles)) {\n    for (const [styleName, style] of Object.entries(group)) {\n      styles[styleName] = {\n        open: `\\x1B[${style[0]}m`,\n        close: `\\x1B[${style[1]}m`\n      };\n      group[styleName] = styles[styleName];\n      codes.set(style[0], style[1]);\n    }\n    Object.defineProperty(styles, groupName, {\n      value: group,\n      enumerable: false\n    });\n  }\n  Object.defineProperty(styles, \"codes\", {\n    value: codes,\n    enumerable: false\n  });\n  styles.color.close = \"\\x1B[39m\";\n  styles.bgColor.close = \"\\x1B[49m\";\n  styles.color.ansi = wrapAnsi16();\n  styles.color.ansi256 = wrapAnsi256();\n  styles.color.ansi16m = wrapAnsi16m();\n  styles.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET);\n  styles.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);\n  styles.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);\n  Object.defineProperties(styles, {\n    rgbToAnsi256: {\n      value(red, green, blue) {\n        if (red === green && green === blue) {\n          if (red < 8) {\n            return 16;\n          }\n          if (red > 248) {\n            return 231;\n          }\n          return Math.round((red - 8) / 247 * 24) + 232;\n        }\n        return 16 + 36 * Math.round(red / 255 * 5) + 6 * Math.round(green / 255 * 5) + Math.round(blue / 255 * 5);\n      },\n      enumerable: false\n    },\n    hexToRgb: {\n      value(hex) {\n        const matches = /[a-f\\d]{6}|[a-f\\d]{3}/i.exec(hex.toString(16));\n        if (!matches) {\n          return [0, 0, 0];\n        }\n        let [colorString] = matches;\n        if (colorString.length === 3) {\n          colorString = [...colorString].map((character) => character + character).join(\"\");\n        }\n        const integer = Number.parseInt(colorString, 16);\n        return [\n          /* eslint-disable no-bitwise */\n          integer >> 16 & 255,\n          integer >> 8 & 255,\n          integer & 255\n          /* eslint-enable no-bitwise */\n        ];\n      },\n      enumerable: false\n    },\n    hexToAnsi256: {\n      value: (hex) => styles.rgbToAnsi256(...styles.hexToRgb(hex)),\n      enumerable: false\n    },\n    ansi256ToAnsi: {\n      value(code) {\n        if (code < 8) {\n          return 30 + code;\n        }\n        if (code < 16) {\n          return 90 + (code - 8);\n        }\n        let red;\n        let green;\n        let blue;\n        if (code >= 232) {\n          red = ((code - 232) * 10 + 8) / 255;\n          green = red;\n          blue = red;\n        } else {\n          code -= 16;\n          const remainder = code % 36;\n          red = Math.floor(code / 36) / 5;\n          green = Math.floor(remainder / 6) / 5;\n          blue = remainder % 6 / 5;\n        }\n        const value = Math.max(red, green, blue) * 2;\n        if (value === 0) {\n          return 30;\n        }\n        let result = 30 + (Math.round(blue) << 2 | Math.round(green) << 1 | Math.round(red));\n        if (value === 2) {\n          result += 60;\n        }\n        return result;\n      },\n      enumerable: false\n    },\n    rgbToAnsi: {\n      value: (red, green, blue) => styles.ansi256ToAnsi(styles.rgbToAnsi256(red, green, blue)),\n      enumerable: false\n    },\n    hexToAnsi: {\n      value: (hex) => styles.ansi256ToAnsi(styles.hexToAnsi256(hex)),\n      enumerable: false\n    }\n  });\n  return styles;\n}\nvar ansiStyles = assembleStyles();\nvar ansi_styles_default = ansiStyles;\n\n// node_modules/chalk/source/vendor/supports-color/index.js\nvar import_node_process = __toESM(require(\"process\"), 1);\nvar import_node_os = __toESM(require(\"os\"), 1);\nvar import_node_tty = __toESM(require(\"tty\"), 1);\nfunction hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : import_node_process.default.argv) {\n  const prefix = flag.startsWith(\"-\") ? \"\" : flag.length === 1 ? \"-\" : \"--\";\n  const position = argv.indexOf(prefix + flag);\n  const terminatorPosition = argv.indexOf(\"--\");\n  return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);\n}\nvar { env } = import_node_process.default;\nvar flagForceColor;\nif (hasFlag(\"no-color\") || hasFlag(\"no-colors\") || hasFlag(\"color=false\") || hasFlag(\"color=never\")) {\n  flagForceColor = 0;\n} else if (hasFlag(\"color\") || hasFlag(\"colors\") || hasFlag(\"color=true\") || hasFlag(\"color=always\")) {\n  flagForceColor = 1;\n}\nfunction envForceColor() {\n  if (\"FORCE_COLOR\" in env) {\n    if (env.FORCE_COLOR === \"true\") {\n      return 1;\n    }\n    if (env.FORCE_COLOR === \"false\") {\n      return 0;\n    }\n    return env.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);\n  }\n}\nfunction translateLevel(level) {\n  if (level === 0) {\n    return false;\n  }\n  return {\n    level,\n    hasBasic: true,\n    has256: level >= 2,\n    has16m: level >= 3\n  };\n}\nfunction _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {\n  const noFlagForceColor = envForceColor();\n  if (noFlagForceColor !== void 0) {\n    flagForceColor = noFlagForceColor;\n  }\n  const forceColor = sniffFlags ? flagForceColor : noFlagForceColor;\n  if (forceColor === 0) {\n    return 0;\n  }\n  if (sniffFlags) {\n    if (hasFlag(\"color=16m\") || hasFlag(\"color=full\") || hasFlag(\"color=truecolor\")) {\n      return 3;\n    }\n    if (hasFlag(\"color=256\")) {\n      return 2;\n    }\n  }\n  if (\"TF_BUILD\" in env && \"AGENT_NAME\" in env) {\n    return 1;\n  }\n  if (haveStream && !streamIsTTY && forceColor === void 0) {\n    return 0;\n  }\n  const min = forceColor || 0;\n  if (env.TERM === \"dumb\") {\n    return min;\n  }\n  if (import_node_process.default.platform === \"win32\") {\n    const osRelease = import_node_os.default.release().split(\".\");\n    if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {\n      return Number(osRelease[2]) >= 14931 ? 3 : 2;\n    }\n    return 1;\n  }\n  if (\"CI\" in env) {\n    if ([\"GITHUB_ACTIONS\", \"GITEA_ACTIONS\", \"CIRCLECI\"].some((key) => key in env)) {\n      return 3;\n    }\n    if ([\"TRAVIS\", \"APPVEYOR\", \"GITLAB_CI\", \"BUILDKITE\", \"DRONE\"].some((sign) => sign in env) || env.CI_NAME === \"codeship\") {\n      return 1;\n    }\n    return min;\n  }\n  if (\"TEAMCITY_VERSION\" in env) {\n    return /^(9\\.(0*[1-9]\\d*)\\.|\\d{2,}\\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;\n  }\n  if (env.COLORTERM === \"truecolor\") {\n    return 3;\n  }\n  if (env.TERM === \"xterm-kitty\") {\n    return 3;\n  }\n  if (env.TERM === \"xterm-ghostty\") {\n    return 3;\n  }\n  if (env.TERM === \"wezterm\") {\n    return 3;\n  }\n  if (\"TERM_PROGRAM\" in env) {\n    const version = Number.parseInt((env.TERM_PROGRAM_VERSION || \"\").split(\".\")[0], 10);\n    switch (env.TERM_PROGRAM) {\n      case \"iTerm.app\": {\n        return version >= 3 ? 3 : 2;\n      }\n      case \"Apple_Terminal\": {\n        return 2;\n      }\n    }\n  }\n  if (/-256(color)?$/i.test(env.TERM)) {\n    return 2;\n  }\n  if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {\n    return 1;\n  }\n  if (\"COLORTERM\" in env) {\n    return 1;\n  }\n  return min;\n}\nfunction createSupportsColor(stream, options = {}) {\n  const level = _supportsColor(stream, __spreadValues({\n    streamIsTTY: stream && stream.isTTY\n  }, options));\n  return translateLevel(level);\n}\nvar supportsColor = {\n  stdout: createSupportsColor({ isTTY: import_node_tty.default.isatty(1) }),\n  stderr: createSupportsColor({ isTTY: import_node_tty.default.isatty(2) })\n};\nvar supports_color_default = supportsColor;\n\n// node_modules/chalk/source/utilities.js\nfunction stringReplaceAll(string, substring, replacer) {\n  let index = string.indexOf(substring);\n  if (index === -1) {\n    return string;\n  }\n  const substringLength = substring.length;\n  let endIndex = 0;\n  let returnValue = \"\";\n  do {\n    returnValue += string.slice(endIndex, index) + substring + replacer;\n    endIndex = index + substringLength;\n    index = string.indexOf(substring, endIndex);\n  } while (index !== -1);\n  returnValue += string.slice(endIndex);\n  return returnValue;\n}\nfunction stringEncaseCRLFWithFirstIndex(string, prefix, postfix, index) {\n  let endIndex = 0;\n  let returnValue = \"\";\n  do {\n    const gotCR = string[index - 1] === \"\\r\";\n    returnValue += string.slice(endIndex, gotCR ? index - 1 : index) + prefix + (gotCR ? \"\\r\\n\" : \"\\n\") + postfix;\n    endIndex = index + 1;\n    index = string.indexOf(\"\\n\", endIndex);\n  } while (index !== -1);\n  returnValue += string.slice(endIndex);\n  return returnValue;\n}\n\n// node_modules/chalk/source/index.js\nvar { stdout: stdoutColor, stderr: stderrColor } = supports_color_default;\nvar GENERATOR = /* @__PURE__ */ Symbol(\"GENERATOR\");\nvar STYLER = /* @__PURE__ */ Symbol(\"STYLER\");\nvar IS_EMPTY = /* @__PURE__ */ Symbol(\"IS_EMPTY\");\nvar levelMapping = [\n  \"ansi\",\n  \"ansi\",\n  \"ansi256\",\n  \"ansi16m\"\n];\nvar styles2 = /* @__PURE__ */ Object.create(null);\nvar applyOptions = (object, options = {}) => {\n  if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) {\n    throw new Error(\"The `level` option should be an integer from 0 to 3\");\n  }\n  const colorLevel = stdoutColor ? stdoutColor.level : 0;\n  object.level = options.level === void 0 ? colorLevel : options.level;\n};\nvar chalkFactory = (options) => {\n  const chalk3 = (...strings) => strings.join(\" \");\n  applyOptions(chalk3, options);\n  Object.setPrototypeOf(chalk3, createChalk.prototype);\n  return chalk3;\n};\nfunction createChalk(options) {\n  return chalkFactory(options);\n}\nObject.setPrototypeOf(createChalk.prototype, Function.prototype);\nfor (const [styleName, style] of Object.entries(ansi_styles_default)) {\n  styles2[styleName] = {\n    get() {\n      const builder = createBuilder(this, createStyler(style.open, style.close, this[STYLER]), this[IS_EMPTY]);\n      Object.defineProperty(this, styleName, { value: builder });\n      return builder;\n    }\n  };\n}\nstyles2.visible = {\n  get() {\n    const builder = createBuilder(this, this[STYLER], true);\n    Object.defineProperty(this, \"visible\", { value: builder });\n    return builder;\n  }\n};\nvar getModelAnsi = (model, level, type, ...arguments_) => {\n  if (model === \"rgb\") {\n    if (level === \"ansi16m\") {\n      return ansi_styles_default[type].ansi16m(...arguments_);\n    }\n    if (level === \"ansi256\") {\n      return ansi_styles_default[type].ansi256(ansi_styles_default.rgbToAnsi256(...arguments_));\n    }\n    return ansi_styles_default[type].ansi(ansi_styles_default.rgbToAnsi(...arguments_));\n  }\n  if (model === \"hex\") {\n    return getModelAnsi(\"rgb\", level, type, ...ansi_styles_default.hexToRgb(...arguments_));\n  }\n  return ansi_styles_default[type][model](...arguments_);\n};\nvar usedModels = [\"rgb\", \"hex\", \"ansi256\"];\nfor (const model of usedModels) {\n  styles2[model] = {\n    get() {\n      const { level } = this;\n      return function(...arguments_) {\n        const styler = createStyler(getModelAnsi(model, levelMapping[level], \"color\", ...arguments_), ansi_styles_default.color.close, this[STYLER]);\n        return createBuilder(this, styler, this[IS_EMPTY]);\n      };\n    }\n  };\n  const bgModel = \"bg\" + model[0].toUpperCase() + model.slice(1);\n  styles2[bgModel] = {\n    get() {\n      const { level } = this;\n      return function(...arguments_) {\n        const styler = createStyler(getModelAnsi(model, levelMapping[level], \"bgColor\", ...arguments_), ansi_styles_default.bgColor.close, this[STYLER]);\n        return createBuilder(this, styler, this[IS_EMPTY]);\n      };\n    }\n  };\n}\nvar proto = Object.defineProperties(() => {\n}, __spreadProps(__spreadValues({}, styles2), {\n  level: {\n    enumerable: true,\n    get() {\n      return this[GENERATOR].level;\n    },\n    set(level) {\n      this[GENERATOR].level = level;\n    }\n  }\n}));\nvar createStyler = (open, close, parent) => {\n  let openAll;\n  let closeAll;\n  if (parent === void 0) {\n    openAll = open;\n    closeAll = close;\n  } else {\n    openAll = parent.openAll + open;\n    closeAll = close + parent.closeAll;\n  }\n  return {\n    open,\n    close,\n    openAll,\n    closeAll,\n    parent\n  };\n};\nvar createBuilder = (self, _styler, _isEmpty) => {\n  const builder = (...arguments_) => applyStyle(builder, arguments_.length === 1 ? \"\" + arguments_[0] : arguments_.join(\" \"));\n  Object.setPrototypeOf(builder, proto);\n  builder[GENERATOR] = self;\n  builder[STYLER] = _styler;\n  builder[IS_EMPTY] = _isEmpty;\n  return builder;\n};\nvar applyStyle = (self, string) => {\n  if (self.level <= 0 || !string) {\n    return self[IS_EMPTY] ? \"\" : string;\n  }\n  let styler = self[STYLER];\n  if (styler === void 0) {\n    return string;\n  }\n  const { openAll, closeAll } = styler;\n  if (string.includes(\"\\x1B\")) {\n    while (styler !== void 0) {\n      string = stringReplaceAll(string, styler.close, styler.open);\n      styler = styler.parent;\n    }\n  }\n  const lfIndex = string.indexOf(\"\\n\");\n  if (lfIndex !== -1) {\n    string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);\n  }\n  return openAll + string + closeAll;\n};\nObject.defineProperties(createChalk.prototype, styles2);\nvar chalk = createChalk();\nvar chalkStderr = createChalk({ level: stderrColor ? stderrColor.level : 0 });\nvar source_default = chalk;\n\n// src/vendor-core.ts\nvar import_which = __toESM(require_lib(), 1);\n\n// node_modules/@webpod/ps/target/esm/index.mjs\nvar import_node_process4 = __toESM(require(\"process\"), 1);\nvar import_node_fs = __toESM(require(\"fs\"), 1);\nvar import_node_os2 = __toESM(require(\"os\"), 1);\n\n// node_modules/@webpod/ingrid/target/esm/index.mjs\nvar EOL = /\\r?\\n|\\r|\\n/;\nvar EMPTY = \"-\";\nvar parseLine = (line, sep = \" \") => {\n  if (typeof line !== \"string\") throw new Error(\"parseLine: line must be a string\");\n  const result = {\n    spaces: [],\n    words: []\n  };\n  const capture = () => {\n    if (word) {\n      result.words.push({\n        s,\n        e: s + word.length - 1,\n        w: word\n      });\n      word = \"\";\n      s = -1;\n    }\n  };\n  let bb;\n  let word = \"\";\n  let s = -1;\n  for (const i in [...line]) {\n    const prev = line[+i - 1];\n    const char = line[i];\n    if (bb) {\n      word += char;\n      if (char === bb && prev !== \"\\\\\") {\n        bb = void 0;\n      }\n      continue;\n    }\n    if (char === sep) {\n      result.spaces.push(+i);\n      capture();\n      continue;\n    }\n    if (s === -1) s = +i;\n    if (char === '\"' || char === \"'\") bb = char;\n    word += char;\n  }\n  capture();\n  return result;\n};\nvar parseLines = (input, sep) => input.split(EOL).filter(Boolean).map((l) => parseLine(l, sep));\nvar countWordsByIndex = ({ words }, index) => words.filter(({ e }) => e < index).length;\nvar getBorders = (lines) => lines[0].spaces.reduce((m, i) => {\n  const c = countWordsByIndex(lines[0], i);\n  if (lines.every((l) => l.spaces.includes(i) && c === countWordsByIndex(l, i))) {\n    m.push(i);\n  }\n  return m;\n}, []);\nvar parseUnixGrid = (input) => {\n  const lines = parseLines(input);\n  const borders = getBorders(lines);\n  const _borders = [Number.NEGATIVE_INFINITY, ...borders, Number.POSITIVE_INFINITY];\n  const grid = [];\n  for (const { words } of lines) {\n    const row = [];\n    grid.push(row);\n    for (const n in words) {\n      const { w, s, e } = words[n];\n      for (const _b in _borders) {\n        const a = _borders[+_b];\n        const b = _borders[+_b + 1];\n        if (b === void 0) break;\n        const block = row[_b] || (row[_b] = []);\n        if (s > a && e < b) block.push(w);\n      }\n    }\n  }\n  return gridToData(grid);\n};\nvar gridToData = (grid) => {\n  const data = [];\n  const [headers, ...body] = grid;\n  for (const row of body) {\n    const entry = {};\n    data.push(entry);\n    for (const i in headers) {\n      const keys = headers[i];\n      if (keys.length === 0) continue;\n      if (keys.length > row[i].length) {\n        throw new Error(\"Malformed grid: row has more columns than headers\");\n      }\n      for (const k in keys) {\n        const key = keys[k];\n        const to = +k + 1 === keys.length ? Number.POSITIVE_INFINITY : +k + 1;\n        entry[key] = row[i].slice(+k, to);\n      }\n    }\n  }\n  return data;\n};\nvar parseWinGrid = (input, debug = false) => {\n  const lines = input.split(/\\r*\\n+/).filter(Boolean);\n  const headline = lines.shift();\n  const headers = headline.trim().split(/\\s\\s+/);\n  const hl = headers.length;\n  const ll = headline.length;\n  if (debug) {\n    console.log(\"Headers:\", headers);\n    console.log(\"Line lengths:\", lines.map((l) => l.length));\n  }\n  if (lines.every((l) => ll / l.length < 2)) {\n    const spaces = Array.from({ length: ll }).map(\n      (_, i) => lines.every((l) => l[i] === \" \")\n    );\n    const borders = spaces.reduce((m, v, i, a) => {\n      if (v && !a[i - 1]) m.push(i);\n      return m;\n    }, [0]);\n    const data2 = [];\n    debug && console.log(\"Borders:\", borders);\n    for (const line of lines) {\n      const props = [];\n      for (const i in headers) {\n        const k = headers[i];\n        const s = borders[i];\n        const e = borders[+i + 1] || ll;\n        const v = line.slice(s, e).trim();\n        props.push([k, [v || EMPTY]]);\n      }\n      data2.push(Object.fromEntries(props));\n    }\n    return data2;\n  }\n  let w = \"\";\n  let p;\n  const body = input.slice(headline.length);\n  const vals = [];\n  const data = [];\n  const cap = (v) => {\n    const _v = w.trim() || (vals.length === 0 ? v : w.trim());\n    if (!_v) return;\n    vals.push(_v);\n    if (vals.length === hl) {\n      data.push(Object.fromEntries(headers.map((h, i) => [h, [vals[i]]])));\n      vals.length = 0;\n    }\n    w = \"\";\n  };\n  for (const c of body) {\n    w += c;\n    if (c === \" \") {\n      if (p === \"\\n\") {\n        cap(EMPTY);\n      } else if (p === \" \") {\n        cap();\n      }\n    } else if (c === \"\\n\") {\n      cap();\n    }\n    p = c;\n  }\n  cap();\n  return data;\n};\nvar parsers = {\n  unix: parseUnixGrid,\n  win: parseWinGrid\n};\nvar parse = (input, { format = \"unix\", debug = false } = {}) => {\n  const parser = parsers[format];\n  if (!parser) throw new Error(`unsupported format: ${format}`);\n  return parser(input, debug);\n};\n\n// node_modules/zurk/target/esm/spawn.mjs\nvar cp = __toESM(require(\"child_process\"), 1);\nvar import_node_process3 = __toESM(require(\"process\"), 1);\nvar import_node_events = __toESM(require(\"events\"), 1);\nvar import_node_stream = require(\"stream\");\n\n// node_modules/zurk/target/esm/util.mjs\nvar import_node_process2 = __toESM(require(\"process\"), 1);\nvar g = !import_node_process2.default.versions.deno && global || globalThis;\nvar immediate = g.setImmediate || ((f) => g.setTimeout(f, 0));\nvar noop = () => {\n};\nvar randomId = () => Math.random().toString(36).slice(2);\nvar isPromiseLike = (value) => typeof (value == null ? void 0 : value.then) === \"function\";\nvar isStringLiteral = (pieces, ...rest) => {\n  var _a;\n  return (pieces == null ? void 0 : pieces.length) > 0 && ((_a = pieces.raw) == null ? void 0 : _a.length) === pieces.length && // Object.isFrozen(pieces) &&\n  rest.length + 1 === pieces.length;\n};\nvar assign = (target, ...extras) => Object.defineProperties(target, extras.reduce((m, extra) => __spreadValues(__spreadValues({}, m), Object.fromEntries(Object.entries(Object.getOwnPropertyDescriptors(extra)).filter(([, v]) => !Object.prototype.hasOwnProperty.call(v, \"value\") || v.value !== void 0))), {}));\nvar buildCmd = (quote2, pieces, args, subs = substitute) => {\n  if (args.some(isPromiseLike))\n    return Promise.all(args).then((args2) => buildCmd(quote2, pieces, args2, subs));\n  let cmd = pieces[0], i = 0;\n  while (i < args.length) {\n    const s = Array.isArray(args[i]) ? args[i].map((x) => quote2(subs(x))).join(\" \") : quote2(subs(args[i]));\n    cmd += s + pieces[++i];\n  }\n  return cmd;\n};\nvar substitute = (arg) => typeof (arg == null ? void 0 : arg.stdout) === \"string\" ? arg.stdout.replace(/\\n$/, \"\") : `${arg}`;\n\n// node_modules/zurk/target/esm/spawn.mjs\nvar defaults = {\n  get id() {\n    return randomId();\n  },\n  cmd: \"\",\n  get cwd() {\n    return import_node_process3.default.cwd();\n  },\n  sync: false,\n  args: [],\n  input: null,\n  env: import_node_process3.default.env,\n  get ee() {\n    return new import_node_events.default();\n  },\n  get ac() {\n    return g.AbortController && new AbortController();\n  },\n  get signal() {\n    var _a;\n    return (_a = this.ac) == null ? void 0 : _a.signal;\n  },\n  on: {},\n  detached: import_node_process3.default.platform !== \"win32\",\n  shell: true,\n  spawn: cp.spawn,\n  spawnSync: cp.spawnSync,\n  spawnOpts: {},\n  get store() {\n    return createStore();\n  },\n  callback: noop,\n  get stdin() {\n    return new VoidStream();\n  },\n  get stdout() {\n    return new VoidStream();\n  },\n  get stderr() {\n    return new VoidStream();\n  },\n  stdio: [\"pipe\", \"pipe\", \"pipe\"],\n  run: immediate,\n  stack: \"\"\n};\nvar normalizeCtx = (...ctxs) => assign(\n  __spreadValues({}, defaults),\n  { get signal() {\n    var _a;\n    return (_a = this.ac) == null ? void 0 : _a.signal;\n  } },\n  ...ctxs\n);\nvar processInput = (child, input) => {\n  if (input && child.stdin && !child.stdin.destroyed) {\n    if (input instanceof import_node_stream.Readable) {\n      input.pipe(child.stdin);\n    } else {\n      child.stdin.write(input);\n      child.stdin.end();\n    }\n  }\n};\nvar VoidStream = class extends import_node_stream.Transform {\n  _transform(chunk, _, cb) {\n    this.emit(\"data\", chunk);\n    cb();\n  }\n};\nvar buildSpawnOpts = ({ spawnOpts, stdio, cwd, shell, input, env: env2, detached, signal }) => __spreadProps(__spreadValues({}, spawnOpts), {\n  env: env2,\n  cwd,\n  stdio,\n  shell,\n  input,\n  windowsHide: true,\n  detached,\n  signal\n});\nvar toggleListeners = (pos, ee, on = {}) => {\n  for (const [name, listener] of Object.entries(on)) {\n    ee[pos](name, listener);\n  }\n  if (pos === \"on\")\n    ee.once(\"end\", () => toggleListeners(\"off\", ee, on));\n};\nvar createStore = () => ({\n  stdout: [],\n  stderr: [],\n  stdall: []\n});\nvar invoke = (c) => {\n  var _a, _b;\n  const now = Date.now();\n  const stdio = [c.stdin, c.stdout, c.stderr];\n  const push = (kind, data) => {\n    c.store[kind].push(data);\n    c.store.stdall.push(data);\n    c.ee.emit(kind, data, c);\n    c.ee.emit(\"stdall\", data, c);\n  };\n  try {\n    if (c.sync) {\n      toggleListeners(\"on\", c.ee, c.on);\n      const opts = buildSpawnOpts(c);\n      const r = c.spawnSync(c.cmd, c.args, opts);\n      c.ee.emit(\"start\", r, c);\n      if (((_a = r.stdout) == null ? void 0 : _a.length) > 0) {\n        c.stdout.write(r.stdout);\n        push(\"stdout\", r.stdout);\n      }\n      if (((_b = r.stderr) == null ? void 0 : _b.length) > 0) {\n        c.stderr.write(r.stderr);\n        push(\"stderr\", r.stderr);\n      }\n      c.callback(null, c.fulfilled = __spreadProps(__spreadValues({}, r), {\n        get stdout() {\n          return c.store.stdout.join(\"\");\n        },\n        get stderr() {\n          return c.store.stderr.join(\"\");\n        },\n        get stdall() {\n          return c.store.stdall.join(\"\");\n        },\n        stdio,\n        duration: Date.now() - now,\n        ctx: c\n      }));\n      c.ee.emit(\"end\", c.fulfilled, c);\n    } else {\n      c.run(() => {\n        var _a2, _b2, _c;\n        toggleListeners(\"on\", c.ee, c.on);\n        let error = null;\n        let aborted = false;\n        const opts = buildSpawnOpts(c);\n        const child = c.spawn(c.cmd, c.args, opts);\n        const onAbort = (event) => {\n          if (opts.detached && child.pid) {\n            try {\n              import_node_process3.default.kill(-child.pid);\n            } catch (e) {\n              child.kill();\n            }\n          }\n          aborted = true;\n          c.ee.emit(\"abort\", event, c);\n        };\n        c.child = child;\n        c.ee.emit(\"start\", child, c);\n        (_a2 = opts.signal) == null ? void 0 : _a2.addEventListener(\"abort\", onAbort);\n        processInput(child, c.input || c.stdin);\n        (_b2 = child.stdout) == null ? void 0 : _b2.on(\"data\", (d) => {\n          push(\"stdout\", d);\n        }).pipe(c.stdout);\n        (_c = child.stderr) == null ? void 0 : _c.on(\"data\", (d) => {\n          push(\"stderr\", d);\n        }).pipe(c.stderr);\n        child.once(\"error\", (e) => {\n          error = e;\n          c.ee.emit(\"err\", error, c);\n        }).once(\"exit\", () => {\n          var _a3, _b3;\n          if (aborted) {\n            (_a3 = child.stdout) == null ? void 0 : _a3.destroy();\n            (_b3 = child.stderr) == null ? void 0 : _b3.destroy();\n          }\n        }).once(\"close\", (status, signal) => {\n          var _a3;\n          c.fulfilled = {\n            error,\n            status,\n            signal,\n            get stdout() {\n              return c.store.stdout.join(\"\");\n            },\n            get stderr() {\n              return c.store.stderr.join(\"\");\n            },\n            get stdall() {\n              return c.store.stdall.join(\"\");\n            },\n            stdio,\n            duration: Date.now() - now,\n            ctx: c\n          };\n          (_a3 = opts.signal) == null ? void 0 : _a3.removeEventListener(\"abort\", onAbort);\n          c.callback(error, c.fulfilled);\n          c.ee.emit(\"end\", c.fulfilled, c);\n        });\n      }, c);\n    }\n  } catch (error) {\n    c.callback(\n      error,\n      c.fulfilled = {\n        error,\n        status: null,\n        signal: null,\n        stdout: \"\",\n        stderr: \"\",\n        stdall: \"\",\n        stdio,\n        duration: Date.now() - now,\n        ctx: c\n      }\n    );\n    c.ee.emit(\"err\", error, c);\n    c.ee.emit(\"end\", c.fulfilled, c);\n  }\n  return c;\n};\nvar exec = (ctx) => invoke(normalizeCtx(ctx));\n\n// node_modules/@webpod/ps/target/esm/index.mjs\nvar IS_WIN = import_node_process4.default.platform === \"win32\";\nvar IS_WIN2025_PLUS = IS_WIN && Number.parseInt(import_node_os2.default.release().split(\".\")[2], 10) >= 26e3;\nvar LOOKUPS = {\n  wmic: {\n    cmd: \"wmic process get ProcessId,ParentProcessId,CommandLine\",\n    args: [],\n    parse(stdout) {\n      return parse(removeWmicPrefix(stdout), { format: \"win\" });\n    }\n  },\n  ps: {\n    cmd: \"ps\",\n    args: [\"-lx\"],\n    parse(stdout) {\n      return parse(stdout, { format: \"unix\" });\n    }\n  },\n  pwsh: {\n    cmd: \"pwsh\",\n    args: [\"-NoProfile\", \"-Command\", '\"Get-CimInstance Win32_Process | Select-Object ProcessId,ParentProcessId,CommandLine | ConvertTo-Json -Compress\"'],\n    parse(stdout) {\n      let arr = [];\n      try {\n        arr = JSON.parse(stdout);\n      } catch (e) {\n        return [];\n      }\n      return arr.map((p) => ({\n        ProcessId: [p.ProcessId + \"\"],\n        ParentProcessId: [p.ParentProcessId + \"\"],\n        CommandLine: p.CommandLine ? [p.CommandLine] : []\n      }));\n    }\n  }\n};\nvar isBin = (f) => {\n  if (f === \"\") return false;\n  if (!f.includes(\"/\") && !f.includes(\"\\\\\")) return true;\n  if (f.length > 3 && f[0] === '\"')\n    return f[f.length - 1] === '\"' ? isBin(f.slice(1, -1)) : false;\n  try {\n    if (!import_node_fs.default.existsSync(f)) return false;\n    const stat = import_node_fs.default.lstatSync(f);\n    return stat.isFile() || stat.isSymbolicLink();\n  } catch (e) {\n    return false;\n  }\n};\nvar lookup = (query = {}, cb = noop2) => _lookup({ query, cb, sync: false });\nvar lookupSync = (query = {}, cb = noop2) => _lookup({ query, cb, sync: true });\nlookup.sync = lookupSync;\nvar _lookup = ({\n  query = {},\n  cb = noop2,\n  sync = false\n}) => {\n  const pFactory = sync ? makePseudoDeferred.bind(null, []) : makeDeferred;\n  const { promise, resolve, reject } = pFactory();\n  const result = [];\n  const lookupFlow = IS_WIN ? IS_WIN2025_PLUS ? \"pwsh\" : \"wmic\" : \"ps\";\n  const {\n    parse: parse2,\n    cmd,\n    args\n  } = LOOKUPS[lookupFlow];\n  const callback = (err, { stdout }) => {\n    if (err) {\n      reject(err);\n      cb(err);\n      return;\n    }\n    result.push(...filterProcessList(normalizeOutput(parse2(stdout)), query));\n    resolve(result);\n    cb(null, result);\n  };\n  exec({\n    cmd,\n    args,\n    callback,\n    sync,\n    run(cb2) {\n      cb2();\n    }\n  });\n  return Object.assign(promise, result);\n};\nvar filterProcessList = (processList, query = {}) => {\n  const pidList = (query.pid === void 0 ? [] : [query.pid].flat(1)).map((v) => v + \"\");\n  const filters = [\n    (p) => query.command ? new RegExp(query.command, \"i\").test(p.command) : true,\n    (p) => query.arguments ? new RegExp(query.arguments, \"i\").test(p.arguments.join(\" \")) : true,\n    (p) => query.ppid ? query.ppid + \"\" === p.ppid : true\n  ];\n  return processList.filter(\n    (p) => (pidList.length === 0 || pidList.includes(p.pid)) && filters.every((f) => f(p))\n  );\n};\nvar removeWmicPrefix = (stdout) => {\n  const s = stdout.indexOf(LOOKUPS.wmic.cmd + import_node_os2.default.EOL);\n  const e = stdout.includes(\">\") ? stdout.trimEnd().lastIndexOf(import_node_os2.default.EOL) : stdout.length;\n  return (s > 0 ? stdout.slice(s + LOOKUPS.wmic.cmd.length, e) : stdout.slice(0, e)).trimStart();\n};\nvar pickTree = (list, pid, recursive = false) => {\n  const children = list.filter((p) => p.ppid === pid + \"\");\n  return [\n    ...children,\n    ...children.flatMap((p) => recursive ? pickTree(list, p.pid, true) : [])\n  ];\n};\nvar _tree = ({\n  cb = noop2,\n  opts,\n  sync = false\n}) => {\n  if (typeof opts === \"string\" || typeof opts === \"number\") {\n    return _tree({ opts: { pid: opts }, cb, sync });\n  }\n  const onError = (err) => cb(err);\n  const onData = (all) => {\n    if (opts === void 0) return all;\n    const { pid, recursive = false } = opts;\n    const list = pickTree(all, pid, recursive);\n    cb(null, list);\n    return list;\n  };\n  try {\n    const all = _lookup({ sync });\n    return sync ? onData(all) : all.then(onData, (err) => {\n      onError(err);\n      throw err;\n    });\n  } catch (err) {\n    onError(err);\n    return Promise.reject(err);\n  }\n};\nvar tree = (opts, cb) => __async(null, null, function* () {\n  return _tree({ opts, cb });\n});\nvar treeSync = (opts, cb) => _tree({ opts, cb, sync: true });\ntree.sync = treeSync;\nvar kill = (pid, opts, next) => {\n  if (typeof opts == \"function\") {\n    return kill(pid, void 0, opts);\n  }\n  if (typeof opts == \"string\" || typeof opts == \"number\") {\n    return kill(pid, { signal: opts }, next);\n  }\n  const { promise, resolve, reject } = makeDeferred();\n  const {\n    timeout = 30,\n    signal = \"SIGTERM\"\n  } = opts || {};\n  try {\n    import_node_process4.default.kill(+pid, signal);\n  } catch (e) {\n    reject(e);\n    next == null ? void 0 : next(e);\n    return promise;\n  }\n  let checkConfident = 0;\n  let checkTimeoutTimer;\n  let checkIsTimeout = false;\n  const checkKilled = (finishCallback) => lookup({ pid }, (err, list = []) => {\n    if (checkIsTimeout) return;\n    if (err) {\n      clearTimeout(checkTimeoutTimer);\n      reject(err);\n      finishCallback == null ? void 0 : finishCallback(err, pid);\n    } else if (list.length > 0) {\n      checkConfident = checkConfident - 1 || 0;\n      checkKilled(finishCallback);\n    } else {\n      checkConfident++;\n      if (checkConfident === 5) {\n        clearTimeout(checkTimeoutTimer);\n        resolve(pid);\n        finishCallback == null ? void 0 : finishCallback(null, pid);\n      } else {\n        checkKilled(finishCallback);\n      }\n    }\n  });\n  if (next) {\n    checkKilled(next);\n    checkTimeoutTimer = setTimeout(() => {\n      checkIsTimeout = true;\n      next(new Error(\"Kill process timeout\"));\n    }, timeout * 1e3);\n  } else {\n    resolve(pid);\n  }\n  return promise;\n};\nvar normalizeOutput = (data) => data.reduce((m, d) => {\n  var _a, _b;\n  const pid = (_a = d.PID || d.ProcessId) == null ? void 0 : _a[0];\n  const ppid = (_b = d.PPID || d.ParentProcessId) == null ? void 0 : _b[0];\n  const _cmd = d.CMD || d.CommandLine || d.COMMAND || [];\n  const cmd = _cmd.length === 1 ? _cmd[0].split(/\\s+/) : _cmd;\n  if (pid && cmd.length > 0) {\n    const c = cmd.findIndex((_v, i) => isBin(cmd.slice(0, i).join(\" \")));\n    const command = (c === -1 ? cmd : cmd.slice(0, c)).join(\" \");\n    const args = c === -1 ? [] : cmd.slice(c);\n    m.push({\n      pid,\n      ppid,\n      command,\n      arguments: args\n    });\n  }\n  return m;\n}, []);\nvar makeDeferred = () => {\n  let resolve;\n  let reject;\n  const promise = new Promise((res, rej) => {\n    resolve = res;\n    reject = rej;\n  });\n  return { resolve, reject, promise };\n};\nvar makePseudoDeferred = (r = {}) => ({\n  promise: r,\n  resolve: identity,\n  reject(e) {\n    throw e;\n  }\n});\nvar noop2 = () => {\n};\nvar identity = (v) => v;\nvar index_default = { kill, lookup, lookupSync, tree, treeSync };\n\n// src/vendor-core.ts\nvar import_internals = require(\"./internals.cjs\");\nvar chalk2 = import_internals.bus.wrap(\"chalk\", source_default);\nvar which = import_internals.bus.wrap(\"which\", import_which.default);\nvar ps = import_internals.bus.wrap(\"ps\", index_default);\n/* c8 ignore next 100 */\n// Annotate the CommonJS export names for ESM import in node:\n0 && (module.exports = {\n  VoidStream,\n  buildCmd,\n  chalk,\n  exec,\n  isStringLiteral,\n  ps,\n  which\n});"
  },
  {
    "path": "build/vendor-core.d.ts",
    "content": "// Generated by dts-bundle-generator v9.5.1\n\n/// <reference types=\"node\" />\n\nimport { Buffer } from 'node:buffer';\nimport * as cp from 'node:child_process';\nimport EventEmitter from 'node:events';\nimport { Readable, Transform, Writable } from 'node:stream';\n\ntype ColorSupportLevel = 0 | 1 | 2 | 3;\nexport interface ChalkInstance {\n\t(...text: unknown[]): string;\n\t/**\n\tThe color support for Chalk.\n\n\tBy default, color support is automatically detected based on the environment.\n\n\tLevels:\n\t- `0` - All colors disabled.\n\t- `1` - Basic 16 colors support.\n\t- `2` - ANSI 256 colors support.\n\t- `3` - Truecolor 16 million colors support.\n\t*/\n\tlevel: ColorSupportLevel;\n\t/**\n\tUse RGB values to set text color.\n\n\t@example\n\t```\n\timport chalk from 'chalk';\n\n\tchalk.rgb(222, 173, 237);\n\t```\n\t*/\n\trgb: (red: number, green: number, blue: number) => this;\n\t/**\n\tUse HEX value to set text color.\n\n\t@param color - Hexadecimal value representing the desired color.\n\n\t@example\n\t```\n\timport chalk from 'chalk';\n\n\tchalk.hex('#DEADED');\n\t```\n\t*/\n\thex: (color: string) => this;\n\t/**\n\tUse an [8-bit unsigned number](https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit) to set text color.\n\n\t@example\n\t```\n\timport chalk from 'chalk';\n\n\tchalk.ansi256(201);\n\t```\n\t*/\n\tansi256: (index: number) => this;\n\t/**\n\tUse RGB values to set background color.\n\n\t@example\n\t```\n\timport chalk from 'chalk';\n\n\tchalk.bgRgb(222, 173, 237);\n\t```\n\t*/\n\tbgRgb: (red: number, green: number, blue: number) => this;\n\t/**\n\tUse HEX value to set background color.\n\n\t@param color - Hexadecimal value representing the desired color.\n\n\t@example\n\t```\n\timport chalk from 'chalk';\n\n\tchalk.bgHex('#DEADED');\n\t```\n\t*/\n\tbgHex: (color: string) => this;\n\t/**\n\tUse a [8-bit unsigned number](https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit) to set background color.\n\n\t@example\n\t```\n\timport chalk from 'chalk';\n\n\tchalk.bgAnsi256(201);\n\t```\n\t*/\n\tbgAnsi256: (index: number) => this;\n\t/**\n\tModifier: Reset the current style.\n\t*/\n\treadonly reset: this;\n\t/**\n\tModifier: Make the text bold.\n\t*/\n\treadonly bold: this;\n\t/**\n\tModifier: Make the text have lower opacity.\n\t*/\n\treadonly dim: this;\n\t/**\n\tModifier: Make the text italic. *(Not widely supported)*\n\t*/\n\treadonly italic: this;\n\t/**\n\tModifier: Put a horizontal line below the text. *(Not widely supported)*\n\t*/\n\treadonly underline: this;\n\t/**\n\tModifier: Put a horizontal line above the text. *(Not widely supported)*\n\t*/\n\treadonly overline: this;\n\t/**\n\tModifier: Invert background and foreground colors.\n\t*/\n\treadonly inverse: this;\n\t/**\n\tModifier: Print the text but make it invisible.\n\t*/\n\treadonly hidden: this;\n\t/**\n\tModifier: Puts a horizontal line through the center of the text. *(Not widely supported)*\n\t*/\n\treadonly strikethrough: this;\n\t/**\n\tModifier: Print the text only when Chalk has a color level above zero.\n\n\tCan be useful for things that are purely cosmetic.\n\t*/\n\treadonly visible: this;\n\treadonly black: this;\n\treadonly red: this;\n\treadonly green: this;\n\treadonly yellow: this;\n\treadonly blue: this;\n\treadonly magenta: this;\n\treadonly cyan: this;\n\treadonly white: this;\n\t/*\n\tAlias for `blackBright`.\n\t*/\n\treadonly gray: this;\n\t/*\n\tAlias for `blackBright`.\n\t*/\n\treadonly grey: this;\n\treadonly blackBright: this;\n\treadonly redBright: this;\n\treadonly greenBright: this;\n\treadonly yellowBright: this;\n\treadonly blueBright: this;\n\treadonly magentaBright: this;\n\treadonly cyanBright: this;\n\treadonly whiteBright: this;\n\treadonly bgBlack: this;\n\treadonly bgRed: this;\n\treadonly bgGreen: this;\n\treadonly bgYellow: this;\n\treadonly bgBlue: this;\n\treadonly bgMagenta: this;\n\treadonly bgCyan: this;\n\treadonly bgWhite: this;\n\t/*\n\tAlias for `bgBlackBright`.\n\t*/\n\treadonly bgGray: this;\n\t/*\n\tAlias for `bgBlackBright`.\n\t*/\n\treadonly bgGrey: this;\n\treadonly bgBlackBright: this;\n\treadonly bgRedBright: this;\n\treadonly bgGreenBright: this;\n\treadonly bgYellowBright: this;\n\treadonly bgBlueBright: this;\n\treadonly bgMagentaBright: this;\n\treadonly bgCyanBright: this;\n\treadonly bgWhiteBright: this;\n}\ndeclare const chalk: ChalkInstance;\ntype AppendNullIfNothrow<TOptions, TRet> = TOptions extends {\n\tnothrow: infer TVal;\n} ? TVal extends false ? TRet : TRet | null : TRet;\ntype TransformToArrayIfAll<TOptions, TRet> = TOptions extends {\n\tall: infer TVal;\n} ? TVal extends true ? readonly TRet[] : TVal extends false ? TRet : readonly TRet[] | TRet : TRet;\ntype ReturnType$1<TOptions> = AppendNullIfNothrow<TOptions, TransformToArrayIfAll<TOptions, string>>;\ntype Exact<T, U extends T> = {\n\t[Key in keyof U]: Key extends keyof T ? U[Key] : never;\n};\ndeclare function which<TOptions extends which.Options>(cmd: string, options?: Exact<which.Options, TOptions>): Promise<ReturnType$1<Exact<which.Options, TOptions>>>;\ndeclare namespace which {\n\t/** Finds all instances of a specified executable in the PATH environment variable */\n\tfunction sync<TOptions extends Options>(cmd: string, options?: Exact<Options, TOptions>): ReturnType$1<Exact<Options, TOptions>>;\n\t/** Options for which() API */\n\tinterface Options {\n\t\t/** If true, return all matches, instead of just the first one. Note that this means the function returns an array of strings instead of a single string. */\n\t\tall?: boolean | undefined;\n\t\t/** Use instead of the PATH environment variable. */\n\t\tpath?: string | undefined;\n\t\t/** Use instead of the PATHEXT environment variable. */\n\t\tpathExt?: string | undefined;\n\t\t/** Use instead of the platform's native path separator. */\n\t\tdelimiter?: string | undefined;\n\t\t/** If true, returns null when not found */\n\t\tnothrow?: boolean | undefined;\n\t}\n}\ntype TPsLookupCallback = (err: any, processList?: TPsLookupEntry[]) => void;\ntype TPsLookupEntry = {\n\tpid: string;\n\tppid?: string;\n\tcommand: string;\n\targuments: string[];\n};\ntype TPsLookupQuery = {\n\tpid?: number | string | (string | number)[];\n\tcommand?: string;\n\targuments?: string;\n\tppid?: number | string;\n};\ntype TPsKillOptions = {\n\ttimeout?: number;\n\tsignal?: string | number | NodeJS.Signals;\n};\ntype TPsNext = (err?: any, data?: any) => void;\ntype TPsTreeOpts = {\n\tpid: string | number;\n\trecursive?: boolean;\n};\ndeclare const _default: {\n\tkill: (pid: string | number, opts?: TPsNext | TPsKillOptions | TPsKillOptions[\"signal\"], next?: TPsNext) => Promise<void>;\n\tlookup: {\n\t\t(query?: TPsLookupQuery, cb?: TPsLookupCallback): Promise<TPsLookupEntry[]>;\n\t\tsync: (query?: TPsLookupQuery, cb?: TPsLookupCallback) => TPsLookupEntry[];\n\t};\n\tlookupSync: (query?: TPsLookupQuery, cb?: TPsLookupCallback) => TPsLookupEntry[];\n\ttree: {\n\t\t(opts?: string | number | TPsTreeOpts | undefined, cb?: TPsLookupCallback): Promise<TPsLookupEntry[]>;\n\t\tsync: (opts?: string | number | TPsTreeOpts | undefined, cb?: TPsLookupCallback) => TPsLookupEntry[];\n\t};\n\ttreeSync: (opts?: string | number | TPsTreeOpts | undefined, cb?: TPsLookupCallback) => TPsLookupEntry[];\n};\nexport declare const isStringLiteral: (pieces: any, ...rest: any[]) => pieces is TemplateStringsArray;\ntype TQuote = (input: string) => string;\nexport declare const buildCmd: (quote: TQuote, pieces: TemplateStringsArray, args: any[], subs?: TSubstitute) => string | Promise<string>;\ntype TSubstitute = (arg: any) => string;\ntype TSpawnError = any;\ntype TPushable<T = any> = {\n\tpush(...args: T[]): number;\n};\ntype TJoinable = {\n\tjoin(sep?: string): string;\n};\ntype TReducible<T, R> = {\n\treduce<U>(fn: (acc: U, cur: T, i: number, arr: T[]) => U, init: U): R;\n};\ntype TArrayLike<T> = Iterable<T> & TPushable<T> & TJoinable & TReducible<T, any> & {\n\tlength: number;\n\t[i: number]: T | undefined;\n};\ntype TSpawnStoreChunks = TArrayLike<string | Buffer>;\nexport type TSpawnStore = {\n\tstdout: TSpawnStoreChunks;\n\tstderr: TSpawnStoreChunks;\n\tstdall: TSpawnStoreChunks;\n};\ntype TSpawnResult = {\n\tstderr: string;\n\tstdout: string;\n\tstdall: string;\n\tstdio: [\n\t\tReadable | Writable,\n\t\tWritable,\n\t\tWritable\n\t];\n\tstatus: number | null;\n\tsignal: NodeJS.Signals | null;\n\tduration: number;\n\tctx: TSpawnCtxNormalized;\n\terror?: TSpawnError;\n\tchild?: TChild;\n};\ntype TSpawnListeners = {\n\tstart: (data: TChild, ctx: TSpawnCtxNormalized) => void;\n\tstdout: (data: Buffer, ctx: TSpawnCtxNormalized) => void;\n\tstderr: (data: Buffer, ctx: TSpawnCtxNormalized) => void;\n\tstdall: (data: Buffer, ctx: TSpawnCtxNormalized) => void;\n\tabort: (error: Event, ctx: TSpawnCtxNormalized) => void;\n\terr: (error: Error, ctx: TSpawnCtxNormalized) => void;\n\tend: (result: TSpawnResult, ctx: TSpawnCtxNormalized) => void;\n};\ntype TSpawnCtx = Partial<Omit<TSpawnCtxNormalized, \"child\">>;\ntype TChild = ReturnType<typeof cp.spawn>;\ntype TInput = string | Buffer | Readable;\ninterface TSpawnCtxNormalized {\n\tid: string;\n\tcwd: string;\n\tcmd: string;\n\tsync: boolean;\n\targs: ReadonlyArray<string>;\n\tinput: TInput | null;\n\tstdio: cp.StdioOptions;\n\tdetached: boolean;\n\tenv: Record<string, string | undefined>;\n\tee: EventEmitter;\n\ton: Partial<TSpawnListeners>;\n\tac: AbortController;\n\tsignal: AbortController[\"signal\"];\n\tshell: string | boolean | undefined;\n\tspawn: typeof cp.spawn;\n\tspawnSync: typeof cp.spawnSync;\n\tspawnOpts: Record<string, any>;\n\tstore: TSpawnStore;\n\tcallback: (err: TSpawnError, result: TSpawnResult) => void;\n\tstdin: Readable;\n\tstdout: Writable;\n\tstderr: Writable;\n\tchild?: TChild;\n\tfulfilled?: TSpawnResult;\n\terror?: any;\n\trun: (cb: () => void, ctx: TSpawnCtxNormalized) => void;\n\tstack: string;\n}\n/**\n * Transformer that emits data but does not consume it.\n */\nexport declare class VoidStream extends Transform {\n\t_transform(chunk: any, _: string, cb: (err?: Error) => void): void;\n}\n/**\n * Executes a child process\n * @param ctx TSpawnCtx\n * @returns TSpawnCtxNormalized\n */\nexport declare const exec: (ctx: TSpawnCtx) => TSpawnCtxNormalized;\nexport type RequestInfo = Parameters<typeof globalThis.fetch>[0];\ntype RequestInit$1 = Parameters<typeof globalThis.fetch>[1] & {\n\tsignal?: AbortSignal;\n};\ndeclare const chalk$1: typeof chalk;\ndeclare const which$1: typeof which;\nexport declare const ps: typeof _default;\n\nexport {\n\tRequestInit$1 as RequestInit,\n\tchalk$1 as chalk,\n\twhich$1 as which,\n};\n\nexport {};\n"
  },
  {
    "path": "build/vendor-extra.cjs",
    "content": "\"use strict\";\nconst {\n  __spreadValues,\n  __spreadProps,\n  __esm,\n  __commonJS,\n  __export,\n  __toESM,\n  __toCommonJS,\n  __privateGet,\n  __privateAdd,\n  __privateSet,\n  __async,\n  __await,\n  __asyncGenerator,\n  __yieldStar,\n  __forAwait\n} = require('./esblib.cjs');\n\n\n// node_modules/fast-glob/out/utils/array.js\nvar require_array = __commonJS({\n  \"node_modules/fast-glob/out/utils/array.js\"(exports2) {\n    \"use strict\";\n    Object.defineProperty(exports2, \"__esModule\", { value: true });\n    exports2.splitWhen = exports2.flatten = void 0;\n    function flatten(items) {\n      return items.reduce((collection, item) => [].concat(collection, item), []);\n    }\n    exports2.flatten = flatten;\n    function splitWhen(items, predicate) {\n      const result = [[]];\n      let groupIndex = 0;\n      for (const item of items) {\n        if (predicate(item)) {\n          groupIndex++;\n          result[groupIndex] = [];\n        } else {\n          result[groupIndex].push(item);\n        }\n      }\n      return result;\n    }\n    exports2.splitWhen = splitWhen;\n  }\n});\n\n// node_modules/fast-glob/out/utils/errno.js\nvar require_errno = __commonJS({\n  \"node_modules/fast-glob/out/utils/errno.js\"(exports2) {\n    \"use strict\";\n    Object.defineProperty(exports2, \"__esModule\", { value: true });\n    exports2.isEnoentCodeError = void 0;\n    function isEnoentCodeError(error) {\n      return error.code === \"ENOENT\";\n    }\n    exports2.isEnoentCodeError = isEnoentCodeError;\n  }\n});\n\n// node_modules/fast-glob/out/utils/fs.js\nvar require_fs = __commonJS({\n  \"node_modules/fast-glob/out/utils/fs.js\"(exports2) {\n    \"use strict\";\n    Object.defineProperty(exports2, \"__esModule\", { value: true });\n    exports2.createDirentFromStats = void 0;\n    var DirentFromStats = class {\n      constructor(name, stats) {\n        this.name = name;\n        this.isBlockDevice = stats.isBlockDevice.bind(stats);\n        this.isCharacterDevice = stats.isCharacterDevice.bind(stats);\n        this.isDirectory = stats.isDirectory.bind(stats);\n        this.isFIFO = stats.isFIFO.bind(stats);\n        this.isFile = stats.isFile.bind(stats);\n        this.isSocket = stats.isSocket.bind(stats);\n        this.isSymbolicLink = stats.isSymbolicLink.bind(stats);\n      }\n    };\n    function createDirentFromStats(name, stats) {\n      return new DirentFromStats(name, stats);\n    }\n    exports2.createDirentFromStats = createDirentFromStats;\n  }\n});\n\n// node_modules/fast-glob/out/utils/path.js\nvar require_path = __commonJS({\n  \"node_modules/fast-glob/out/utils/path.js\"(exports2) {\n    \"use strict\";\n    Object.defineProperty(exports2, \"__esModule\", { value: true });\n    exports2.convertPosixPathToPattern = exports2.convertWindowsPathToPattern = exports2.convertPathToPattern = exports2.escapePosixPath = exports2.escapeWindowsPath = exports2.escape = exports2.removeLeadingDotSegment = exports2.makeAbsolute = exports2.unixify = void 0;\n    var os = require(\"os\");\n    var path5 = require(\"path\");\n    var IS_WINDOWS_PLATFORM = os.platform() === \"win32\";\n    var LEADING_DOT_SEGMENT_CHARACTERS_COUNT = 2;\n    var POSIX_UNESCAPED_GLOB_SYMBOLS_RE = /(\\\\?)([()*?[\\]{|}]|^!|[!+@](?=\\()|\\\\(?![!()*+?@[\\]{|}]))/g;\n    var WINDOWS_UNESCAPED_GLOB_SYMBOLS_RE = /(\\\\?)([()[\\]{}]|^!|[!+@](?=\\())/g;\n    var DOS_DEVICE_PATH_RE = /^\\\\\\\\([.?])/;\n    var WINDOWS_BACKSLASHES_RE = /\\\\(?![!()+@[\\]{}])/g;\n    function unixify(filepath) {\n      return filepath.replace(/\\\\/g, \"/\");\n    }\n    exports2.unixify = unixify;\n    function makeAbsolute(cwd, filepath) {\n      return path5.resolve(cwd, filepath);\n    }\n    exports2.makeAbsolute = makeAbsolute;\n    function removeLeadingDotSegment(entry) {\n      if (entry.charAt(0) === \".\") {\n        const secondCharactery = entry.charAt(1);\n        if (secondCharactery === \"/\" || secondCharactery === \"\\\\\") {\n          return entry.slice(LEADING_DOT_SEGMENT_CHARACTERS_COUNT);\n        }\n      }\n      return entry;\n    }\n    exports2.removeLeadingDotSegment = removeLeadingDotSegment;\n    exports2.escape = IS_WINDOWS_PLATFORM ? escapeWindowsPath : escapePosixPath;\n    function escapeWindowsPath(pattern) {\n      return pattern.replace(WINDOWS_UNESCAPED_GLOB_SYMBOLS_RE, \"\\\\$2\");\n    }\n    exports2.escapeWindowsPath = escapeWindowsPath;\n    function escapePosixPath(pattern) {\n      return pattern.replace(POSIX_UNESCAPED_GLOB_SYMBOLS_RE, \"\\\\$2\");\n    }\n    exports2.escapePosixPath = escapePosixPath;\n    exports2.convertPathToPattern = IS_WINDOWS_PLATFORM ? convertWindowsPathToPattern : convertPosixPathToPattern;\n    function convertWindowsPathToPattern(filepath) {\n      return escapeWindowsPath(filepath).replace(DOS_DEVICE_PATH_RE, \"//$1\").replace(WINDOWS_BACKSLASHES_RE, \"/\");\n    }\n    exports2.convertWindowsPathToPattern = convertWindowsPathToPattern;\n    function convertPosixPathToPattern(filepath) {\n      return escapePosixPath(filepath);\n    }\n    exports2.convertPosixPathToPattern = convertPosixPathToPattern;\n  }\n});\n\n// node_modules/is-extglob/index.js\nvar require_is_extglob = __commonJS({\n  \"node_modules/is-extglob/index.js\"(exports2, module2) {\n    \"use strict\";\n    module2.exports = function isExtglob(str) {\n      if (typeof str !== \"string\" || str === \"\") {\n        return false;\n      }\n      var match;\n      while (match = /(\\\\).|([@?!+*]\\(.*\\))/g.exec(str)) {\n        if (match[2]) return true;\n        str = str.slice(match.index + match[0].length);\n      }\n      return false;\n    };\n  }\n});\n\n// node_modules/is-glob/index.js\nvar require_is_glob = __commonJS({\n  \"node_modules/is-glob/index.js\"(exports2, module2) {\n    \"use strict\";\n    var isExtglob = require_is_extglob();\n    var chars = { \"{\": \"}\", \"(\": \")\", \"[\": \"]\" };\n    var strictCheck = function(str) {\n      if (str[0] === \"!\") {\n        return true;\n      }\n      var index = 0;\n      var pipeIndex = -2;\n      var closeSquareIndex = -2;\n      var closeCurlyIndex = -2;\n      var closeParenIndex = -2;\n      var backSlashIndex = -2;\n      while (index < str.length) {\n        if (str[index] === \"*\") {\n          return true;\n        }\n        if (str[index + 1] === \"?\" && /[\\].+)]/.test(str[index])) {\n          return true;\n        }\n        if (closeSquareIndex !== -1 && str[index] === \"[\" && str[index + 1] !== \"]\") {\n          if (closeSquareIndex < index) {\n            closeSquareIndex = str.indexOf(\"]\", index);\n          }\n          if (closeSquareIndex > index) {\n            if (backSlashIndex === -1 || backSlashIndex > closeSquareIndex) {\n              return true;\n            }\n            backSlashIndex = str.indexOf(\"\\\\\", index);\n            if (backSlashIndex === -1 || backSlashIndex > closeSquareIndex) {\n              return true;\n            }\n          }\n        }\n        if (closeCurlyIndex !== -1 && str[index] === \"{\" && str[index + 1] !== \"}\") {\n          closeCurlyIndex = str.indexOf(\"}\", index);\n          if (closeCurlyIndex > index) {\n            backSlashIndex = str.indexOf(\"\\\\\", index);\n            if (backSlashIndex === -1 || backSlashIndex > closeCurlyIndex) {\n              return true;\n            }\n          }\n        }\n        if (closeParenIndex !== -1 && str[index] === \"(\" && str[index + 1] === \"?\" && /[:!=]/.test(str[index + 2]) && str[index + 3] !== \")\") {\n          closeParenIndex = str.indexOf(\")\", index);\n          if (closeParenIndex > index) {\n            backSlashIndex = str.indexOf(\"\\\\\", index);\n            if (backSlashIndex === -1 || backSlashIndex > closeParenIndex) {\n              return true;\n            }\n          }\n        }\n        if (pipeIndex !== -1 && str[index] === \"(\" && str[index + 1] !== \"|\") {\n          if (pipeIndex < index) {\n            pipeIndex = str.indexOf(\"|\", index);\n          }\n          if (pipeIndex !== -1 && str[pipeIndex + 1] !== \")\") {\n            closeParenIndex = str.indexOf(\")\", pipeIndex);\n            if (closeParenIndex > pipeIndex) {\n              backSlashIndex = str.indexOf(\"\\\\\", pipeIndex);\n              if (backSlashIndex === -1 || backSlashIndex > closeParenIndex) {\n                return true;\n              }\n            }\n          }\n        }\n        if (str[index] === \"\\\\\") {\n          var open = str[index + 1];\n          index += 2;\n          var close = chars[open];\n          if (close) {\n            var n4 = str.indexOf(close, index);\n            if (n4 !== -1) {\n              index = n4 + 1;\n            }\n          }\n          if (str[index] === \"!\") {\n            return true;\n          }\n        } else {\n          index++;\n        }\n      }\n      return false;\n    };\n    var relaxedCheck = function(str) {\n      if (str[0] === \"!\") {\n        return true;\n      }\n      var index = 0;\n      while (index < str.length) {\n        if (/[*?{}()[\\]]/.test(str[index])) {\n          return true;\n        }\n        if (str[index] === \"\\\\\") {\n          var open = str[index + 1];\n          index += 2;\n          var close = chars[open];\n          if (close) {\n            var n4 = str.indexOf(close, index);\n            if (n4 !== -1) {\n              index = n4 + 1;\n            }\n          }\n          if (str[index] === \"!\") {\n            return true;\n          }\n        } else {\n          index++;\n        }\n      }\n      return false;\n    };\n    module2.exports = function isGlob(str, options) {\n      if (typeof str !== \"string\" || str === \"\") {\n        return false;\n      }\n      if (isExtglob(str)) {\n        return true;\n      }\n      var check = strictCheck;\n      if (options && options.strict === false) {\n        check = relaxedCheck;\n      }\n      return check(str);\n    };\n  }\n});\n\n// node_modules/glob-parent/index.js\nvar require_glob_parent = __commonJS({\n  \"node_modules/glob-parent/index.js\"(exports2, module2) {\n    \"use strict\";\n    var isGlob = require_is_glob();\n    var pathPosixDirname = require(\"path\").posix.dirname;\n    var isWin32 = require(\"os\").platform() === \"win32\";\n    var slash2 = \"/\";\n    var backslash = /\\\\/g;\n    var enclosure = /[\\{\\[].*[\\}\\]]$/;\n    var globby3 = /(^|[^\\\\])([\\{\\[]|\\([^\\)]+$)/;\n    var escaped = /\\\\([\\!\\*\\?\\|\\[\\]\\(\\)\\{\\}])/g;\n    module2.exports = function globParent(str, opts) {\n      var options = Object.assign({ flipBackslashes: true }, opts);\n      if (options.flipBackslashes && isWin32 && str.indexOf(slash2) < 0) {\n        str = str.replace(backslash, slash2);\n      }\n      if (enclosure.test(str)) {\n        str += slash2;\n      }\n      str += \"a\";\n      do {\n        str = pathPosixDirname(str);\n      } while (isGlob(str) || globby3.test(str));\n      return str.replace(escaped, \"$1\");\n    };\n  }\n});\n\n// node_modules/braces/lib/utils.js\nvar require_utils = __commonJS({\n  \"node_modules/braces/lib/utils.js\"(exports2) {\n    \"use strict\";\n    exports2.isInteger = (num) => {\n      if (typeof num === \"number\") {\n        return Number.isInteger(num);\n      }\n      if (typeof num === \"string\" && num.trim() !== \"\") {\n        return Number.isInteger(Number(num));\n      }\n      return false;\n    };\n    exports2.find = (node, type) => node.nodes.find((node2) => node2.type === type);\n    exports2.exceedsLimit = (min, max, step = 1, limit) => {\n      if (limit === false) return false;\n      if (!exports2.isInteger(min) || !exports2.isInteger(max)) return false;\n      return (Number(max) - Number(min)) / Number(step) >= limit;\n    };\n    exports2.escapeNode = (block, n4 = 0, type) => {\n      const node = block.nodes[n4];\n      if (!node) return;\n      if (type && node.type === type || node.type === \"open\" || node.type === \"close\") {\n        if (node.escaped !== true) {\n          node.value = \"\\\\\" + node.value;\n          node.escaped = true;\n        }\n      }\n    };\n    exports2.encloseBrace = (node) => {\n      if (node.type !== \"brace\") return false;\n      if (node.commas >> 0 + node.ranges >> 0 === 0) {\n        node.invalid = true;\n        return true;\n      }\n      return false;\n    };\n    exports2.isInvalidBrace = (block) => {\n      if (block.type !== \"brace\") return false;\n      if (block.invalid === true || block.dollar) return true;\n      if (block.commas >> 0 + block.ranges >> 0 === 0) {\n        block.invalid = true;\n        return true;\n      }\n      if (block.open !== true || block.close !== true) {\n        block.invalid = true;\n        return true;\n      }\n      return false;\n    };\n    exports2.isOpenOrClose = (node) => {\n      if (node.type === \"open\" || node.type === \"close\") {\n        return true;\n      }\n      return node.open === true || node.close === true;\n    };\n    exports2.reduce = (nodes) => nodes.reduce((acc, node) => {\n      if (node.type === \"text\") acc.push(node.value);\n      if (node.type === \"range\") node.type = \"text\";\n      return acc;\n    }, []);\n    exports2.flatten = (...args) => {\n      const result = [];\n      const flat = (arr) => {\n        for (let i = 0; i < arr.length; i++) {\n          const ele = arr[i];\n          if (Array.isArray(ele)) {\n            flat(ele);\n            continue;\n          }\n          if (ele !== void 0) {\n            result.push(ele);\n          }\n        }\n        return result;\n      };\n      flat(args);\n      return result;\n    };\n  }\n});\n\n// node_modules/braces/lib/stringify.js\nvar require_stringify = __commonJS({\n  \"node_modules/braces/lib/stringify.js\"(exports2, module2) {\n    \"use strict\";\n    var utils = require_utils();\n    module2.exports = (ast, options = {}) => {\n      const stringify6 = (node, parent = {}) => {\n        const invalidBlock = options.escapeInvalid && utils.isInvalidBrace(parent);\n        const invalidNode = node.invalid === true && options.escapeInvalid === true;\n        let output = \"\";\n        if (node.value) {\n          if ((invalidBlock || invalidNode) && utils.isOpenOrClose(node)) {\n            return \"\\\\\" + node.value;\n          }\n          return node.value;\n        }\n        if (node.value) {\n          return node.value;\n        }\n        if (node.nodes) {\n          for (const child of node.nodes) {\n            output += stringify6(child);\n          }\n        }\n        return output;\n      };\n      return stringify6(ast);\n    };\n  }\n});\n\n// node_modules/is-number/index.js\nvar require_is_number = __commonJS({\n  \"node_modules/is-number/index.js\"(exports2, module2) {\n    \"use strict\";\n    module2.exports = function(num) {\n      if (typeof num === \"number\") {\n        return num - num === 0;\n      }\n      if (typeof num === \"string\" && num.trim() !== \"\") {\n        return Number.isFinite ? Number.isFinite(+num) : isFinite(+num);\n      }\n      return false;\n    };\n  }\n});\n\n// node_modules/to-regex-range/index.js\nvar require_to_regex_range = __commonJS({\n  \"node_modules/to-regex-range/index.js\"(exports2, module2) {\n    \"use strict\";\n    var isNumber = require_is_number();\n    var toRegexRange = (min, max, options) => {\n      if (isNumber(min) === false) {\n        throw new TypeError(\"toRegexRange: expected the first argument to be a number\");\n      }\n      if (max === void 0 || min === max) {\n        return String(min);\n      }\n      if (isNumber(max) === false) {\n        throw new TypeError(\"toRegexRange: expected the second argument to be a number.\");\n      }\n      let opts = __spreadValues({ relaxZeros: true }, options);\n      if (typeof opts.strictZeros === \"boolean\") {\n        opts.relaxZeros = opts.strictZeros === false;\n      }\n      let relax = String(opts.relaxZeros);\n      let shorthand = String(opts.shorthand);\n      let capture = String(opts.capture);\n      let wrap2 = String(opts.wrap);\n      let cacheKey = min + \":\" + max + \"=\" + relax + shorthand + capture + wrap2;\n      if (toRegexRange.cache.hasOwnProperty(cacheKey)) {\n        return toRegexRange.cache[cacheKey].result;\n      }\n      let a = Math.min(min, max);\n      let b = Math.max(min, max);\n      if (Math.abs(a - b) === 1) {\n        let result = min + \"|\" + max;\n        if (opts.capture) {\n          return `(${result})`;\n        }\n        if (opts.wrap === false) {\n          return result;\n        }\n        return `(?:${result})`;\n      }\n      let isPadded = hasPadding(min) || hasPadding(max);\n      let state = { min, max, a, b };\n      let positives = [];\n      let negatives = [];\n      if (isPadded) {\n        state.isPadded = isPadded;\n        state.maxLen = String(state.max).length;\n      }\n      if (a < 0) {\n        let newMin = b < 0 ? Math.abs(b) : 1;\n        negatives = splitToPatterns(newMin, Math.abs(a), state, opts);\n        a = state.a = 0;\n      }\n      if (b >= 0) {\n        positives = splitToPatterns(a, b, state, opts);\n      }\n      state.negatives = negatives;\n      state.positives = positives;\n      state.result = collatePatterns(negatives, positives, opts);\n      if (opts.capture === true) {\n        state.result = `(${state.result})`;\n      } else if (opts.wrap !== false && positives.length + negatives.length > 1) {\n        state.result = `(?:${state.result})`;\n      }\n      toRegexRange.cache[cacheKey] = state;\n      return state.result;\n    };\n    function collatePatterns(neg, pos, options) {\n      let onlyNegative = filterPatterns(neg, pos, \"-\", false, options) || [];\n      let onlyPositive = filterPatterns(pos, neg, \"\", false, options) || [];\n      let intersected = filterPatterns(neg, pos, \"-?\", true, options) || [];\n      let subpatterns = onlyNegative.concat(intersected).concat(onlyPositive);\n      return subpatterns.join(\"|\");\n    }\n    function splitToRanges(min, max) {\n      let nines = 1;\n      let zeros = 1;\n      let stop = countNines(min, nines);\n      let stops = /* @__PURE__ */ new Set([max]);\n      while (min <= stop && stop <= max) {\n        stops.add(stop);\n        nines += 1;\n        stop = countNines(min, nines);\n      }\n      stop = countZeros(max + 1, zeros) - 1;\n      while (min < stop && stop <= max) {\n        stops.add(stop);\n        zeros += 1;\n        stop = countZeros(max + 1, zeros) - 1;\n      }\n      stops = [...stops];\n      stops.sort(compare);\n      return stops;\n    }\n    function rangeToPattern(start, stop, options) {\n      if (start === stop) {\n        return { pattern: start, count: [], digits: 0 };\n      }\n      let zipped = zip(start, stop);\n      let digits = zipped.length;\n      let pattern = \"\";\n      let count = 0;\n      for (let i = 0; i < digits; i++) {\n        let [startDigit, stopDigit] = zipped[i];\n        if (startDigit === stopDigit) {\n          pattern += startDigit;\n        } else if (startDigit !== \"0\" || stopDigit !== \"9\") {\n          pattern += toCharacterClass(startDigit, stopDigit, options);\n        } else {\n          count++;\n        }\n      }\n      if (count) {\n        pattern += options.shorthand === true ? \"\\\\d\" : \"[0-9]\";\n      }\n      return { pattern, count: [count], digits };\n    }\n    function splitToPatterns(min, max, tok, options) {\n      let ranges = splitToRanges(min, max);\n      let tokens = [];\n      let start = min;\n      let prev;\n      for (let i = 0; i < ranges.length; i++) {\n        let max2 = ranges[i];\n        let obj = rangeToPattern(String(start), String(max2), options);\n        let zeros = \"\";\n        if (!tok.isPadded && prev && prev.pattern === obj.pattern) {\n          if (prev.count.length > 1) {\n            prev.count.pop();\n          }\n          prev.count.push(obj.count[0]);\n          prev.string = prev.pattern + toQuantifier(prev.count);\n          start = max2 + 1;\n          continue;\n        }\n        if (tok.isPadded) {\n          zeros = padZeros(max2, tok, options);\n        }\n        obj.string = zeros + obj.pattern + toQuantifier(obj.count);\n        tokens.push(obj);\n        start = max2 + 1;\n        prev = obj;\n      }\n      return tokens;\n    }\n    function filterPatterns(arr, comparison, prefix, intersection, options) {\n      let result = [];\n      for (let ele of arr) {\n        let { string: string2 } = ele;\n        if (!intersection && !contains(comparison, \"string\", string2)) {\n          result.push(prefix + string2);\n        }\n        if (intersection && contains(comparison, \"string\", string2)) {\n          result.push(prefix + string2);\n        }\n      }\n      return result;\n    }\n    function zip(a, b) {\n      let arr = [];\n      for (let i = 0; i < a.length; i++) arr.push([a[i], b[i]]);\n      return arr;\n    }\n    function compare(a, b) {\n      return a > b ? 1 : b > a ? -1 : 0;\n    }\n    function contains(arr, key, val) {\n      return arr.some((ele) => ele[key] === val);\n    }\n    function countNines(min, len) {\n      return Number(String(min).slice(0, -len) + \"9\".repeat(len));\n    }\n    function countZeros(integer, zeros) {\n      return integer - integer % Math.pow(10, zeros);\n    }\n    function toQuantifier(digits) {\n      let [start = 0, stop = \"\"] = digits;\n      if (stop || start > 1) {\n        return `{${start + (stop ? \",\" + stop : \"\")}}`;\n      }\n      return \"\";\n    }\n    function toCharacterClass(a, b, options) {\n      return `[${a}${b - a === 1 ? \"\" : \"-\"}${b}]`;\n    }\n    function hasPadding(str) {\n      return /^-?(0+)\\d/.test(str);\n    }\n    function padZeros(value, tok, options) {\n      if (!tok.isPadded) {\n        return value;\n      }\n      let diff = Math.abs(tok.maxLen - String(value).length);\n      let relax = options.relaxZeros !== false;\n      switch (diff) {\n        case 0:\n          return \"\";\n        case 1:\n          return relax ? \"0?\" : \"0\";\n        case 2:\n          return relax ? \"0{0,2}\" : \"00\";\n        default: {\n          return relax ? `0{0,${diff}}` : `0{${diff}}`;\n        }\n      }\n    }\n    toRegexRange.cache = {};\n    toRegexRange.clearCache = () => toRegexRange.cache = {};\n    module2.exports = toRegexRange;\n  }\n});\n\n// node_modules/fill-range/index.js\nvar require_fill_range = __commonJS({\n  \"node_modules/fill-range/index.js\"(exports2, module2) {\n    \"use strict\";\n    var util = require(\"util\");\n    var toRegexRange = require_to_regex_range();\n    var isObject = (val) => val !== null && typeof val === \"object\" && !Array.isArray(val);\n    var transform = (toNumber) => {\n      return (value) => toNumber === true ? Number(value) : String(value);\n    };\n    var isValidValue = (value) => {\n      return typeof value === \"number\" || typeof value === \"string\" && value !== \"\";\n    };\n    var isNumber = (num) => Number.isInteger(+num);\n    var zeros = (input) => {\n      let value = `${input}`;\n      let index = -1;\n      if (value[0] === \"-\") value = value.slice(1);\n      if (value === \"0\") return false;\n      while (value[++index] === \"0\") ;\n      return index > 0;\n    };\n    var stringify6 = (start, end, options) => {\n      if (typeof start === \"string\" || typeof end === \"string\") {\n        return true;\n      }\n      return options.stringify === true;\n    };\n    var pad = (input, maxLength, toNumber) => {\n      if (maxLength > 0) {\n        let dash = input[0] === \"-\" ? \"-\" : \"\";\n        if (dash) input = input.slice(1);\n        input = dash + input.padStart(dash ? maxLength - 1 : maxLength, \"0\");\n      }\n      if (toNumber === false) {\n        return String(input);\n      }\n      return input;\n    };\n    var toMaxLen = (input, maxLength) => {\n      let negative = input[0] === \"-\" ? \"-\" : \"\";\n      if (negative) {\n        input = input.slice(1);\n        maxLength--;\n      }\n      while (input.length < maxLength) input = \"0\" + input;\n      return negative ? \"-\" + input : input;\n    };\n    var toSequence = (parts, options, maxLen) => {\n      parts.negatives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0);\n      parts.positives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0);\n      let prefix = options.capture ? \"\" : \"?:\";\n      let positives = \"\";\n      let negatives = \"\";\n      let result;\n      if (parts.positives.length) {\n        positives = parts.positives.map((v2) => toMaxLen(String(v2), maxLen)).join(\"|\");\n      }\n      if (parts.negatives.length) {\n        negatives = `-(${prefix}${parts.negatives.map((v2) => toMaxLen(String(v2), maxLen)).join(\"|\")})`;\n      }\n      if (positives && negatives) {\n        result = `${positives}|${negatives}`;\n      } else {\n        result = positives || negatives;\n      }\n      if (options.wrap) {\n        return `(${prefix}${result})`;\n      }\n      return result;\n    };\n    var toRange = (a, b, isNumbers, options) => {\n      if (isNumbers) {\n        return toRegexRange(a, b, __spreadValues({ wrap: false }, options));\n      }\n      let start = String.fromCharCode(a);\n      if (a === b) return start;\n      let stop = String.fromCharCode(b);\n      return `[${start}-${stop}]`;\n    };\n    var toRegex = (start, end, options) => {\n      if (Array.isArray(start)) {\n        let wrap2 = options.wrap === true;\n        let prefix = options.capture ? \"\" : \"?:\";\n        return wrap2 ? `(${prefix}${start.join(\"|\")})` : start.join(\"|\");\n      }\n      return toRegexRange(start, end, options);\n    };\n    var rangeError = (...args) => {\n      return new RangeError(\"Invalid range arguments: \" + util.inspect(...args));\n    };\n    var invalidRange = (start, end, options) => {\n      if (options.strictRanges === true) throw rangeError([start, end]);\n      return [];\n    };\n    var invalidStep = (step, options) => {\n      if (options.strictRanges === true) {\n        throw new TypeError(`Expected step \"${step}\" to be a number`);\n      }\n      return [];\n    };\n    var fillNumbers = (start, end, step = 1, options = {}) => {\n      let a = Number(start);\n      let b = Number(end);\n      if (!Number.isInteger(a) || !Number.isInteger(b)) {\n        if (options.strictRanges === true) throw rangeError([start, end]);\n        return [];\n      }\n      if (a === 0) a = 0;\n      if (b === 0) b = 0;\n      let descending = a > b;\n      let startString = String(start);\n      let endString = String(end);\n      let stepString = String(step);\n      step = Math.max(Math.abs(step), 1);\n      let padded = zeros(startString) || zeros(endString) || zeros(stepString);\n      let maxLen = padded ? Math.max(startString.length, endString.length, stepString.length) : 0;\n      let toNumber = padded === false && stringify6(start, end, options) === false;\n      let format = options.transform || transform(toNumber);\n      if (options.toRegex && step === 1) {\n        return toRange(toMaxLen(start, maxLen), toMaxLen(end, maxLen), true, options);\n      }\n      let parts = { negatives: [], positives: [] };\n      let push = (num) => parts[num < 0 ? \"negatives\" : \"positives\"].push(Math.abs(num));\n      let range = [];\n      let index = 0;\n      while (descending ? a >= b : a <= b) {\n        if (options.toRegex === true && step > 1) {\n          push(a);\n        } else {\n          range.push(pad(format(a, index), maxLen, toNumber));\n        }\n        a = descending ? a - step : a + step;\n        index++;\n      }\n      if (options.toRegex === true) {\n        return step > 1 ? toSequence(parts, options, maxLen) : toRegex(range, null, __spreadValues({ wrap: false }, options));\n      }\n      return range;\n    };\n    var fillLetters = (start, end, step = 1, options = {}) => {\n      if (!isNumber(start) && start.length > 1 || !isNumber(end) && end.length > 1) {\n        return invalidRange(start, end, options);\n      }\n      let format = options.transform || ((val) => String.fromCharCode(val));\n      let a = `${start}`.charCodeAt(0);\n      let b = `${end}`.charCodeAt(0);\n      let descending = a > b;\n      let min = Math.min(a, b);\n      let max = Math.max(a, b);\n      if (options.toRegex && step === 1) {\n        return toRange(min, max, false, options);\n      }\n      let range = [];\n      let index = 0;\n      while (descending ? a >= b : a <= b) {\n        range.push(format(a, index));\n        a = descending ? a - step : a + step;\n        index++;\n      }\n      if (options.toRegex === true) {\n        return toRegex(range, null, { wrap: false, options });\n      }\n      return range;\n    };\n    var fill = (start, end, step, options = {}) => {\n      if (end == null && isValidValue(start)) {\n        return [start];\n      }\n      if (!isValidValue(start) || !isValidValue(end)) {\n        return invalidRange(start, end, options);\n      }\n      if (typeof step === \"function\") {\n        return fill(start, end, 1, { transform: step });\n      }\n      if (isObject(step)) {\n        return fill(start, end, 0, step);\n      }\n      let opts = __spreadValues({}, options);\n      if (opts.capture === true) opts.wrap = true;\n      step = step || opts.step || 1;\n      if (!isNumber(step)) {\n        if (step != null && !isObject(step)) return invalidStep(step, opts);\n        return fill(start, end, 1, step);\n      }\n      if (isNumber(start) && isNumber(end)) {\n        return fillNumbers(start, end, step, opts);\n      }\n      return fillLetters(start, end, Math.max(Math.abs(step), 1), opts);\n    };\n    module2.exports = fill;\n  }\n});\n\n// node_modules/braces/lib/compile.js\nvar require_compile = __commonJS({\n  \"node_modules/braces/lib/compile.js\"(exports2, module2) {\n    \"use strict\";\n    var fill = require_fill_range();\n    var utils = require_utils();\n    var compile = (ast, options = {}) => {\n      const walk = (node, parent = {}) => {\n        const invalidBlock = utils.isInvalidBrace(parent);\n        const invalidNode = node.invalid === true && options.escapeInvalid === true;\n        const invalid = invalidBlock === true || invalidNode === true;\n        const prefix = options.escapeInvalid === true ? \"\\\\\" : \"\";\n        let output = \"\";\n        if (node.isOpen === true) {\n          return prefix + node.value;\n        }\n        if (node.isClose === true) {\n          console.log(\"node.isClose\", prefix, node.value);\n          return prefix + node.value;\n        }\n        if (node.type === \"open\") {\n          return invalid ? prefix + node.value : \"(\";\n        }\n        if (node.type === \"close\") {\n          return invalid ? prefix + node.value : \")\";\n        }\n        if (node.type === \"comma\") {\n          return node.prev.type === \"comma\" ? \"\" : invalid ? node.value : \"|\";\n        }\n        if (node.value) {\n          return node.value;\n        }\n        if (node.nodes && node.ranges > 0) {\n          const args = utils.reduce(node.nodes);\n          const range = fill(...args, __spreadProps(__spreadValues({}, options), { wrap: false, toRegex: true, strictZeros: true }));\n          if (range.length !== 0) {\n            return args.length > 1 && range.length > 1 ? `(${range})` : range;\n          }\n        }\n        if (node.nodes) {\n          for (const child of node.nodes) {\n            output += walk(child, node);\n          }\n        }\n        return output;\n      };\n      return walk(ast);\n    };\n    module2.exports = compile;\n  }\n});\n\n// node_modules/braces/lib/expand.js\nvar require_expand = __commonJS({\n  \"node_modules/braces/lib/expand.js\"(exports2, module2) {\n    \"use strict\";\n    var fill = require_fill_range();\n    var stringify6 = require_stringify();\n    var utils = require_utils();\n    var append = (queue = \"\", stash = \"\", enclose = false) => {\n      const result = [];\n      queue = [].concat(queue);\n      stash = [].concat(stash);\n      if (!stash.length) return queue;\n      if (!queue.length) {\n        return enclose ? utils.flatten(stash).map((ele) => `{${ele}}`) : stash;\n      }\n      for (const item of queue) {\n        if (Array.isArray(item)) {\n          for (const value of item) {\n            result.push(append(value, stash, enclose));\n          }\n        } else {\n          for (let ele of stash) {\n            if (enclose === true && typeof ele === \"string\") ele = `{${ele}}`;\n            result.push(Array.isArray(ele) ? append(item, ele, enclose) : item + ele);\n          }\n        }\n      }\n      return utils.flatten(result);\n    };\n    var expand = (ast, options = {}) => {\n      const rangeLimit = options.rangeLimit === void 0 ? 1e3 : options.rangeLimit;\n      const walk = (node, parent = {}) => {\n        node.queue = [];\n        let p2 = parent;\n        let q = parent.queue;\n        while (p2.type !== \"brace\" && p2.type !== \"root\" && p2.parent) {\n          p2 = p2.parent;\n          q = p2.queue;\n        }\n        if (node.invalid || node.dollar) {\n          q.push(append(q.pop(), stringify6(node, options)));\n          return;\n        }\n        if (node.type === \"brace\" && node.invalid !== true && node.nodes.length === 2) {\n          q.push(append(q.pop(), [\"{}\"]));\n          return;\n        }\n        if (node.nodes && node.ranges > 0) {\n          const args = utils.reduce(node.nodes);\n          if (utils.exceedsLimit(...args, options.step, rangeLimit)) {\n            throw new RangeError(\"expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.\");\n          }\n          let range = fill(...args, options);\n          if (range.length === 0) {\n            range = stringify6(node, options);\n          }\n          q.push(append(q.pop(), range));\n          node.nodes = [];\n          return;\n        }\n        const enclose = utils.encloseBrace(node);\n        let queue = node.queue;\n        let block = node;\n        while (block.type !== \"brace\" && block.type !== \"root\" && block.parent) {\n          block = block.parent;\n          queue = block.queue;\n        }\n        for (let i = 0; i < node.nodes.length; i++) {\n          const child = node.nodes[i];\n          if (child.type === \"comma\" && node.type === \"brace\") {\n            if (i === 1) queue.push(\"\");\n            queue.push(\"\");\n            continue;\n          }\n          if (child.type === \"close\") {\n            q.push(append(q.pop(), queue, enclose));\n            continue;\n          }\n          if (child.value && child.type !== \"open\") {\n            queue.push(append(queue.pop(), child.value));\n            continue;\n          }\n          if (child.nodes) {\n            walk(child, node);\n          }\n        }\n        return queue;\n      };\n      return utils.flatten(walk(ast));\n    };\n    module2.exports = expand;\n  }\n});\n\n// node_modules/braces/lib/constants.js\nvar require_constants = __commonJS({\n  \"node_modules/braces/lib/constants.js\"(exports2, module2) {\n    \"use strict\";\n    module2.exports = {\n      MAX_LENGTH: 1e4,\n      // Digits\n      CHAR_0: \"0\",\n      /* 0 */\n      CHAR_9: \"9\",\n      /* 9 */\n      // Alphabet chars.\n      CHAR_UPPERCASE_A: \"A\",\n      /* A */\n      CHAR_LOWERCASE_A: \"a\",\n      /* a */\n      CHAR_UPPERCASE_Z: \"Z\",\n      /* Z */\n      CHAR_LOWERCASE_Z: \"z\",\n      /* z */\n      CHAR_LEFT_PARENTHESES: \"(\",\n      /* ( */\n      CHAR_RIGHT_PARENTHESES: \")\",\n      /* ) */\n      CHAR_ASTERISK: \"*\",\n      /* * */\n      // Non-alphabetic chars.\n      CHAR_AMPERSAND: \"&\",\n      /* & */\n      CHAR_AT: \"@\",\n      /* @ */\n      CHAR_BACKSLASH: \"\\\\\",\n      /* \\ */\n      CHAR_BACKTICK: \"`\",\n      /* ` */\n      CHAR_CARRIAGE_RETURN: \"\\r\",\n      /* \\r */\n      CHAR_CIRCUMFLEX_ACCENT: \"^\",\n      /* ^ */\n      CHAR_COLON: \":\",\n      /* : */\n      CHAR_COMMA: \",\",\n      /* , */\n      CHAR_DOLLAR: \"$\",\n      /* . */\n      CHAR_DOT: \".\",\n      /* . */\n      CHAR_DOUBLE_QUOTE: '\"',\n      /* \" */\n      CHAR_EQUAL: \"=\",\n      /* = */\n      CHAR_EXCLAMATION_MARK: \"!\",\n      /* ! */\n      CHAR_FORM_FEED: \"\\f\",\n      /* \\f */\n      CHAR_FORWARD_SLASH: \"/\",\n      /* / */\n      CHAR_HASH: \"#\",\n      /* # */\n      CHAR_HYPHEN_MINUS: \"-\",\n      /* - */\n      CHAR_LEFT_ANGLE_BRACKET: \"<\",\n      /* < */\n      CHAR_LEFT_CURLY_BRACE: \"{\",\n      /* { */\n      CHAR_LEFT_SQUARE_BRACKET: \"[\",\n      /* [ */\n      CHAR_LINE_FEED: \"\\n\",\n      /* \\n */\n      CHAR_NO_BREAK_SPACE: \"\\xA0\",\n      /* \\u00A0 */\n      CHAR_PERCENT: \"%\",\n      /* % */\n      CHAR_PLUS: \"+\",\n      /* + */\n      CHAR_QUESTION_MARK: \"?\",\n      /* ? */\n      CHAR_RIGHT_ANGLE_BRACKET: \">\",\n      /* > */\n      CHAR_RIGHT_CURLY_BRACE: \"}\",\n      /* } */\n      CHAR_RIGHT_SQUARE_BRACKET: \"]\",\n      /* ] */\n      CHAR_SEMICOLON: \";\",\n      /* ; */\n      CHAR_SINGLE_QUOTE: \"'\",\n      /* ' */\n      CHAR_SPACE: \" \",\n      /*   */\n      CHAR_TAB: \"\t\",\n      /* \\t */\n      CHAR_UNDERSCORE: \"_\",\n      /* _ */\n      CHAR_VERTICAL_LINE: \"|\",\n      /* | */\n      CHAR_ZERO_WIDTH_NOBREAK_SPACE: \"\\uFEFF\"\n      /* \\uFEFF */\n    };\n  }\n});\n\n// node_modules/braces/lib/parse.js\nvar require_parse = __commonJS({\n  \"node_modules/braces/lib/parse.js\"(exports2, module2) {\n    \"use strict\";\n    var stringify6 = require_stringify();\n    var {\n      MAX_LENGTH,\n      CHAR_BACKSLASH,\n      /* \\ */\n      CHAR_BACKTICK,\n      /* ` */\n      CHAR_COMMA,\n      /* , */\n      CHAR_DOT,\n      /* . */\n      CHAR_LEFT_PARENTHESES,\n      /* ( */\n      CHAR_RIGHT_PARENTHESES,\n      /* ) */\n      CHAR_LEFT_CURLY_BRACE,\n      /* { */\n      CHAR_RIGHT_CURLY_BRACE,\n      /* } */\n      CHAR_LEFT_SQUARE_BRACKET,\n      /* [ */\n      CHAR_RIGHT_SQUARE_BRACKET,\n      /* ] */\n      CHAR_DOUBLE_QUOTE,\n      /* \" */\n      CHAR_SINGLE_QUOTE,\n      /* ' */\n      CHAR_NO_BREAK_SPACE,\n      CHAR_ZERO_WIDTH_NOBREAK_SPACE\n    } = require_constants();\n    var parse4 = (input, options = {}) => {\n      if (typeof input !== \"string\") {\n        throw new TypeError(\"Expected a string\");\n      }\n      const opts = options || {};\n      const max = typeof opts.maxLength === \"number\" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;\n      if (input.length > max) {\n        throw new SyntaxError(`Input length (${input.length}), exceeds max characters (${max})`);\n      }\n      const ast = { type: \"root\", input, nodes: [] };\n      const stack = [ast];\n      let block = ast;\n      let prev = ast;\n      let brackets = 0;\n      const length = input.length;\n      let index = 0;\n      let depth = 0;\n      let value;\n      const advance = () => input[index++];\n      const push = (node) => {\n        if (node.type === \"text\" && prev.type === \"dot\") {\n          prev.type = \"text\";\n        }\n        if (prev && prev.type === \"text\" && node.type === \"text\") {\n          prev.value += node.value;\n          return;\n        }\n        block.nodes.push(node);\n        node.parent = block;\n        node.prev = prev;\n        prev = node;\n        return node;\n      };\n      push({ type: \"bos\" });\n      while (index < length) {\n        block = stack[stack.length - 1];\n        value = advance();\n        if (value === CHAR_ZERO_WIDTH_NOBREAK_SPACE || value === CHAR_NO_BREAK_SPACE) {\n          continue;\n        }\n        if (value === CHAR_BACKSLASH) {\n          push({ type: \"text\", value: (options.keepEscaping ? value : \"\") + advance() });\n          continue;\n        }\n        if (value === CHAR_RIGHT_SQUARE_BRACKET) {\n          push({ type: \"text\", value: \"\\\\\" + value });\n          continue;\n        }\n        if (value === CHAR_LEFT_SQUARE_BRACKET) {\n          brackets++;\n          let next;\n          while (index < length && (next = advance())) {\n            value += next;\n            if (next === CHAR_LEFT_SQUARE_BRACKET) {\n              brackets++;\n              continue;\n            }\n            if (next === CHAR_BACKSLASH) {\n              value += advance();\n              continue;\n            }\n            if (next === CHAR_RIGHT_SQUARE_BRACKET) {\n              brackets--;\n              if (brackets === 0) {\n                break;\n              }\n            }\n          }\n          push({ type: \"text\", value });\n          continue;\n        }\n        if (value === CHAR_LEFT_PARENTHESES) {\n          block = push({ type: \"paren\", nodes: [] });\n          stack.push(block);\n          push({ type: \"text\", value });\n          continue;\n        }\n        if (value === CHAR_RIGHT_PARENTHESES) {\n          if (block.type !== \"paren\") {\n            push({ type: \"text\", value });\n            continue;\n          }\n          block = stack.pop();\n          push({ type: \"text\", value });\n          block = stack[stack.length - 1];\n          continue;\n        }\n        if (value === CHAR_DOUBLE_QUOTE || value === CHAR_SINGLE_QUOTE || value === CHAR_BACKTICK) {\n          const open = value;\n          let next;\n          if (options.keepQuotes !== true) {\n            value = \"\";\n          }\n          while (index < length && (next = advance())) {\n            if (next === CHAR_BACKSLASH) {\n              value += next + advance();\n              continue;\n            }\n            if (next === open) {\n              if (options.keepQuotes === true) value += next;\n              break;\n            }\n            value += next;\n          }\n          push({ type: \"text\", value });\n          continue;\n        }\n        if (value === CHAR_LEFT_CURLY_BRACE) {\n          depth++;\n          const dollar = prev.value && prev.value.slice(-1) === \"$\" || block.dollar === true;\n          const brace = {\n            type: \"brace\",\n            open: true,\n            close: false,\n            dollar,\n            depth,\n            commas: 0,\n            ranges: 0,\n            nodes: []\n          };\n          block = push(brace);\n          stack.push(block);\n          push({ type: \"open\", value });\n          continue;\n        }\n        if (value === CHAR_RIGHT_CURLY_BRACE) {\n          if (block.type !== \"brace\") {\n            push({ type: \"text\", value });\n            continue;\n          }\n          const type = \"close\";\n          block = stack.pop();\n          block.close = true;\n          push({ type, value });\n          depth--;\n          block = stack[stack.length - 1];\n          continue;\n        }\n        if (value === CHAR_COMMA && depth > 0) {\n          if (block.ranges > 0) {\n            block.ranges = 0;\n            const open = block.nodes.shift();\n            block.nodes = [open, { type: \"text\", value: stringify6(block) }];\n          }\n          push({ type: \"comma\", value });\n          block.commas++;\n          continue;\n        }\n        if (value === CHAR_DOT && depth > 0 && block.commas === 0) {\n          const siblings = block.nodes;\n          if (depth === 0 || siblings.length === 0) {\n            push({ type: \"text\", value });\n            continue;\n          }\n          if (prev.type === \"dot\") {\n            block.range = [];\n            prev.value += value;\n            prev.type = \"range\";\n            if (block.nodes.length !== 3 && block.nodes.length !== 5) {\n              block.invalid = true;\n              block.ranges = 0;\n              prev.type = \"text\";\n              continue;\n            }\n            block.ranges++;\n            block.args = [];\n            continue;\n          }\n          if (prev.type === \"range\") {\n            siblings.pop();\n            const before = siblings[siblings.length - 1];\n            before.value += prev.value + value;\n            prev = before;\n            block.ranges--;\n            continue;\n          }\n          push({ type: \"dot\", value });\n          continue;\n        }\n        push({ type: \"text\", value });\n      }\n      do {\n        block = stack.pop();\n        if (block.type !== \"root\") {\n          block.nodes.forEach((node) => {\n            if (!node.nodes) {\n              if (node.type === \"open\") node.isOpen = true;\n              if (node.type === \"close\") node.isClose = true;\n              if (!node.nodes) node.type = \"text\";\n              node.invalid = true;\n            }\n          });\n          const parent = stack[stack.length - 1];\n          const index2 = parent.nodes.indexOf(block);\n          parent.nodes.splice(index2, 1, ...block.nodes);\n        }\n      } while (stack.length > 0);\n      push({ type: \"eos\" });\n      return ast;\n    };\n    module2.exports = parse4;\n  }\n});\n\n// node_modules/braces/index.js\nvar require_braces = __commonJS({\n  \"node_modules/braces/index.js\"(exports2, module2) {\n    \"use strict\";\n    var stringify6 = require_stringify();\n    var compile = require_compile();\n    var expand = require_expand();\n    var parse4 = require_parse();\n    var braces = (input, options = {}) => {\n      let output = [];\n      if (Array.isArray(input)) {\n        for (const pattern of input) {\n          const result = braces.create(pattern, options);\n          if (Array.isArray(result)) {\n            output.push(...result);\n          } else {\n            output.push(result);\n          }\n        }\n      } else {\n        output = [].concat(braces.create(input, options));\n      }\n      if (options && options.expand === true && options.nodupes === true) {\n        output = [...new Set(output)];\n      }\n      return output;\n    };\n    braces.parse = (input, options = {}) => parse4(input, options);\n    braces.stringify = (input, options = {}) => {\n      if (typeof input === \"string\") {\n        return stringify6(braces.parse(input, options), options);\n      }\n      return stringify6(input, options);\n    };\n    braces.compile = (input, options = {}) => {\n      if (typeof input === \"string\") {\n        input = braces.parse(input, options);\n      }\n      return compile(input, options);\n    };\n    braces.expand = (input, options = {}) => {\n      if (typeof input === \"string\") {\n        input = braces.parse(input, options);\n      }\n      let result = expand(input, options);\n      if (options.noempty === true) {\n        result = result.filter(Boolean);\n      }\n      if (options.nodupes === true) {\n        result = [...new Set(result)];\n      }\n      return result;\n    };\n    braces.create = (input, options = {}) => {\n      if (input === \"\" || input.length < 3) {\n        return [input];\n      }\n      return options.expand !== true ? braces.compile(input, options) : braces.expand(input, options);\n    };\n    module2.exports = braces;\n  }\n});\n\n// node_modules/picomatch/lib/constants.js\nvar require_constants2 = __commonJS({\n  \"node_modules/picomatch/lib/constants.js\"(exports2, module2) {\n    \"use strict\";\n    var path5 = require(\"path\");\n    var WIN_SLASH = \"\\\\\\\\/\";\n    var WIN_NO_SLASH = `[^${WIN_SLASH}]`;\n    var DOT_LITERAL = \"\\\\.\";\n    var PLUS_LITERAL = \"\\\\+\";\n    var QMARK_LITERAL = \"\\\\?\";\n    var SLASH_LITERAL = \"\\\\/\";\n    var ONE_CHAR = \"(?=.)\";\n    var QMARK = \"[^/]\";\n    var END_ANCHOR = `(?:${SLASH_LITERAL}|$)`;\n    var START_ANCHOR = `(?:^|${SLASH_LITERAL})`;\n    var DOTS_SLASH = `${DOT_LITERAL}{1,2}${END_ANCHOR}`;\n    var NO_DOT = `(?!${DOT_LITERAL})`;\n    var NO_DOTS = `(?!${START_ANCHOR}${DOTS_SLASH})`;\n    var NO_DOT_SLASH = `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`;\n    var NO_DOTS_SLASH = `(?!${DOTS_SLASH})`;\n    var QMARK_NO_DOT = `[^.${SLASH_LITERAL}]`;\n    var STAR = `${QMARK}*?`;\n    var POSIX_CHARS = {\n      DOT_LITERAL,\n      PLUS_LITERAL,\n      QMARK_LITERAL,\n      SLASH_LITERAL,\n      ONE_CHAR,\n      QMARK,\n      END_ANCHOR,\n      DOTS_SLASH,\n      NO_DOT,\n      NO_DOTS,\n      NO_DOT_SLASH,\n      NO_DOTS_SLASH,\n      QMARK_NO_DOT,\n      STAR,\n      START_ANCHOR\n    };\n    var WINDOWS_CHARS = __spreadProps(__spreadValues({}, POSIX_CHARS), {\n      SLASH_LITERAL: `[${WIN_SLASH}]`,\n      QMARK: WIN_NO_SLASH,\n      STAR: `${WIN_NO_SLASH}*?`,\n      DOTS_SLASH: `${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$)`,\n      NO_DOT: `(?!${DOT_LITERAL})`,\n      NO_DOTS: `(?!(?:^|[${WIN_SLASH}])${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,\n      NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}(?:[${WIN_SLASH}]|$))`,\n      NO_DOTS_SLASH: `(?!${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,\n      QMARK_NO_DOT: `[^.${WIN_SLASH}]`,\n      START_ANCHOR: `(?:^|[${WIN_SLASH}])`,\n      END_ANCHOR: `(?:[${WIN_SLASH}]|$)`\n    });\n    var POSIX_REGEX_SOURCE = {\n      alnum: \"a-zA-Z0-9\",\n      alpha: \"a-zA-Z\",\n      ascii: \"\\\\x00-\\\\x7F\",\n      blank: \" \\\\t\",\n      cntrl: \"\\\\x00-\\\\x1F\\\\x7F\",\n      digit: \"0-9\",\n      graph: \"\\\\x21-\\\\x7E\",\n      lower: \"a-z\",\n      print: \"\\\\x20-\\\\x7E \",\n      punct: \"\\\\-!\\\"#$%&'()\\\\*+,./:;<=>?@[\\\\]^_`{|}~\",\n      space: \" \\\\t\\\\r\\\\n\\\\v\\\\f\",\n      upper: \"A-Z\",\n      word: \"A-Za-z0-9_\",\n      xdigit: \"A-Fa-f0-9\"\n    };\n    module2.exports = {\n      MAX_LENGTH: 1024 * 64,\n      POSIX_REGEX_SOURCE,\n      // regular expressions\n      REGEX_BACKSLASH: /\\\\(?![*+?^${}(|)[\\]])/g,\n      REGEX_NON_SPECIAL_CHARS: /^[^@![\\].,$*+?^{}()|\\\\/]+/,\n      REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\\]]/,\n      REGEX_SPECIAL_CHARS_BACKREF: /(\\\\?)((\\W)(\\3*))/g,\n      REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\\]])/g,\n      REGEX_REMOVE_BACKSLASH: /(?:\\[.*?[^\\\\]\\]|\\\\(?=.))/g,\n      // Replace globs with equivalent patterns to reduce parsing time.\n      REPLACEMENTS: {\n        \"***\": \"*\",\n        \"**/**\": \"**\",\n        \"**/**/**\": \"**\"\n      },\n      // Digits\n      CHAR_0: 48,\n      /* 0 */\n      CHAR_9: 57,\n      /* 9 */\n      // Alphabet chars.\n      CHAR_UPPERCASE_A: 65,\n      /* A */\n      CHAR_LOWERCASE_A: 97,\n      /* a */\n      CHAR_UPPERCASE_Z: 90,\n      /* Z */\n      CHAR_LOWERCASE_Z: 122,\n      /* z */\n      CHAR_LEFT_PARENTHESES: 40,\n      /* ( */\n      CHAR_RIGHT_PARENTHESES: 41,\n      /* ) */\n      CHAR_ASTERISK: 42,\n      /* * */\n      // Non-alphabetic chars.\n      CHAR_AMPERSAND: 38,\n      /* & */\n      CHAR_AT: 64,\n      /* @ */\n      CHAR_BACKWARD_SLASH: 92,\n      /* \\ */\n      CHAR_CARRIAGE_RETURN: 13,\n      /* \\r */\n      CHAR_CIRCUMFLEX_ACCENT: 94,\n      /* ^ */\n      CHAR_COLON: 58,\n      /* : */\n      CHAR_COMMA: 44,\n      /* , */\n      CHAR_DOT: 46,\n      /* . */\n      CHAR_DOUBLE_QUOTE: 34,\n      /* \" */\n      CHAR_EQUAL: 61,\n      /* = */\n      CHAR_EXCLAMATION_MARK: 33,\n      /* ! */\n      CHAR_FORM_FEED: 12,\n      /* \\f */\n      CHAR_FORWARD_SLASH: 47,\n      /* / */\n      CHAR_GRAVE_ACCENT: 96,\n      /* ` */\n      CHAR_HASH: 35,\n      /* # */\n      CHAR_HYPHEN_MINUS: 45,\n      /* - */\n      CHAR_LEFT_ANGLE_BRACKET: 60,\n      /* < */\n      CHAR_LEFT_CURLY_BRACE: 123,\n      /* { */\n      CHAR_LEFT_SQUARE_BRACKET: 91,\n      /* [ */\n      CHAR_LINE_FEED: 10,\n      /* \\n */\n      CHAR_NO_BREAK_SPACE: 160,\n      /* \\u00A0 */\n      CHAR_PERCENT: 37,\n      /* % */\n      CHAR_PLUS: 43,\n      /* + */\n      CHAR_QUESTION_MARK: 63,\n      /* ? */\n      CHAR_RIGHT_ANGLE_BRACKET: 62,\n      /* > */\n      CHAR_RIGHT_CURLY_BRACE: 125,\n      /* } */\n      CHAR_RIGHT_SQUARE_BRACKET: 93,\n      /* ] */\n      CHAR_SEMICOLON: 59,\n      /* ; */\n      CHAR_SINGLE_QUOTE: 39,\n      /* ' */\n      CHAR_SPACE: 32,\n      /*   */\n      CHAR_TAB: 9,\n      /* \\t */\n      CHAR_UNDERSCORE: 95,\n      /* _ */\n      CHAR_VERTICAL_LINE: 124,\n      /* | */\n      CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279,\n      /* \\uFEFF */\n      SEP: path5.sep,\n      /**\n       * Create EXTGLOB_CHARS\n       */\n      extglobChars(chars) {\n        return {\n          \"!\": { type: \"negate\", open: \"(?:(?!(?:\", close: `))${chars.STAR})` },\n          \"?\": { type: \"qmark\", open: \"(?:\", close: \")?\" },\n          \"+\": { type: \"plus\", open: \"(?:\", close: \")+\" },\n          \"*\": { type: \"star\", open: \"(?:\", close: \")*\" },\n          \"@\": { type: \"at\", open: \"(?:\", close: \")\" }\n        };\n      },\n      /**\n       * Create GLOB_CHARS\n       */\n      globChars(win32) {\n        return win32 === true ? WINDOWS_CHARS : POSIX_CHARS;\n      }\n    };\n  }\n});\n\n// node_modules/picomatch/lib/utils.js\nvar require_utils2 = __commonJS({\n  \"node_modules/picomatch/lib/utils.js\"(exports2) {\n    \"use strict\";\n    var path5 = require(\"path\");\n    var win32 = process.platform === \"win32\";\n    var {\n      REGEX_BACKSLASH,\n      REGEX_REMOVE_BACKSLASH,\n      REGEX_SPECIAL_CHARS,\n      REGEX_SPECIAL_CHARS_GLOBAL\n    } = require_constants2();\n    exports2.isObject = (val) => val !== null && typeof val === \"object\" && !Array.isArray(val);\n    exports2.hasRegexChars = (str) => REGEX_SPECIAL_CHARS.test(str);\n    exports2.isRegexChar = (str) => str.length === 1 && exports2.hasRegexChars(str);\n    exports2.escapeRegex = (str) => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, \"\\\\$1\");\n    exports2.toPosixSlashes = (str) => str.replace(REGEX_BACKSLASH, \"/\");\n    exports2.removeBackslashes = (str) => {\n      return str.replace(REGEX_REMOVE_BACKSLASH, (match) => {\n        return match === \"\\\\\" ? \"\" : match;\n      });\n    };\n    exports2.supportsLookbehinds = () => {\n      const segs = process.version.slice(1).split(\".\").map(Number);\n      if (segs.length === 3 && segs[0] >= 9 || segs[0] === 8 && segs[1] >= 10) {\n        return true;\n      }\n      return false;\n    };\n    exports2.isWindows = (options) => {\n      if (options && typeof options.windows === \"boolean\") {\n        return options.windows;\n      }\n      return win32 === true || path5.sep === \"\\\\\";\n    };\n    exports2.escapeLast = (input, char, lastIdx) => {\n      const idx = input.lastIndexOf(char, lastIdx);\n      if (idx === -1) return input;\n      if (input[idx - 1] === \"\\\\\") return exports2.escapeLast(input, char, idx - 1);\n      return `${input.slice(0, idx)}\\\\${input.slice(idx)}`;\n    };\n    exports2.removePrefix = (input, state = {}) => {\n      let output = input;\n      if (output.startsWith(\"./\")) {\n        output = output.slice(2);\n        state.prefix = \"./\";\n      }\n      return output;\n    };\n    exports2.wrapOutput = (input, state = {}, options = {}) => {\n      const prepend = options.contains ? \"\" : \"^\";\n      const append = options.contains ? \"\" : \"$\";\n      let output = `${prepend}(?:${input})${append}`;\n      if (state.negated === true) {\n        output = `(?:^(?!${output}).*$)`;\n      }\n      return output;\n    };\n  }\n});\n\n// node_modules/picomatch/lib/scan.js\nvar require_scan = __commonJS({\n  \"node_modules/picomatch/lib/scan.js\"(exports2, module2) {\n    \"use strict\";\n    var utils = require_utils2();\n    var {\n      CHAR_ASTERISK,\n      /* * */\n      CHAR_AT,\n      /* @ */\n      CHAR_BACKWARD_SLASH,\n      /* \\ */\n      CHAR_COMMA,\n      /* , */\n      CHAR_DOT,\n      /* . */\n      CHAR_EXCLAMATION_MARK,\n      /* ! */\n      CHAR_FORWARD_SLASH,\n      /* / */\n      CHAR_LEFT_CURLY_BRACE,\n      /* { */\n      CHAR_LEFT_PARENTHESES,\n      /* ( */\n      CHAR_LEFT_SQUARE_BRACKET,\n      /* [ */\n      CHAR_PLUS,\n      /* + */\n      CHAR_QUESTION_MARK,\n      /* ? */\n      CHAR_RIGHT_CURLY_BRACE,\n      /* } */\n      CHAR_RIGHT_PARENTHESES,\n      /* ) */\n      CHAR_RIGHT_SQUARE_BRACKET\n      /* ] */\n    } = require_constants2();\n    var isPathSeparator = (code) => {\n      return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH;\n    };\n    var depth = (token) => {\n      if (token.isPrefix !== true) {\n        token.depth = token.isGlobstar ? Infinity : 1;\n      }\n    };\n    var scan = (input, options) => {\n      const opts = options || {};\n      const length = input.length - 1;\n      const scanToEnd = opts.parts === true || opts.scanToEnd === true;\n      const slashes = [];\n      const tokens = [];\n      const parts = [];\n      let str = input;\n      let index = -1;\n      let start = 0;\n      let lastIndex = 0;\n      let isBrace = false;\n      let isBracket = false;\n      let isGlob = false;\n      let isExtglob = false;\n      let isGlobstar = false;\n      let braceEscaped = false;\n      let backslashes = false;\n      let negated = false;\n      let negatedExtglob = false;\n      let finished2 = false;\n      let braces = 0;\n      let prev;\n      let code;\n      let token = { value: \"\", depth: 0, isGlob: false };\n      const eos = () => index >= length;\n      const peek = () => str.charCodeAt(index + 1);\n      const advance = () => {\n        prev = code;\n        return str.charCodeAt(++index);\n      };\n      while (index < length) {\n        code = advance();\n        let next;\n        if (code === CHAR_BACKWARD_SLASH) {\n          backslashes = token.backslashes = true;\n          code = advance();\n          if (code === CHAR_LEFT_CURLY_BRACE) {\n            braceEscaped = true;\n          }\n          continue;\n        }\n        if (braceEscaped === true || code === CHAR_LEFT_CURLY_BRACE) {\n          braces++;\n          while (eos() !== true && (code = advance())) {\n            if (code === CHAR_BACKWARD_SLASH) {\n              backslashes = token.backslashes = true;\n              advance();\n              continue;\n            }\n            if (code === CHAR_LEFT_CURLY_BRACE) {\n              braces++;\n              continue;\n            }\n            if (braceEscaped !== true && code === CHAR_DOT && (code = advance()) === CHAR_DOT) {\n              isBrace = token.isBrace = true;\n              isGlob = token.isGlob = true;\n              finished2 = true;\n              if (scanToEnd === true) {\n                continue;\n              }\n              break;\n            }\n            if (braceEscaped !== true && code === CHAR_COMMA) {\n              isBrace = token.isBrace = true;\n              isGlob = token.isGlob = true;\n              finished2 = true;\n              if (scanToEnd === true) {\n                continue;\n              }\n              break;\n            }\n            if (code === CHAR_RIGHT_CURLY_BRACE) {\n              braces--;\n              if (braces === 0) {\n                braceEscaped = false;\n                isBrace = token.isBrace = true;\n                finished2 = true;\n                break;\n              }\n            }\n          }\n          if (scanToEnd === true) {\n            continue;\n          }\n          break;\n        }\n        if (code === CHAR_FORWARD_SLASH) {\n          slashes.push(index);\n          tokens.push(token);\n          token = { value: \"\", depth: 0, isGlob: false };\n          if (finished2 === true) continue;\n          if (prev === CHAR_DOT && index === start + 1) {\n            start += 2;\n            continue;\n          }\n          lastIndex = index + 1;\n          continue;\n        }\n        if (opts.noext !== true) {\n          const isExtglobChar = code === CHAR_PLUS || code === CHAR_AT || code === CHAR_ASTERISK || code === CHAR_QUESTION_MARK || code === CHAR_EXCLAMATION_MARK;\n          if (isExtglobChar === true && peek() === CHAR_LEFT_PARENTHESES) {\n            isGlob = token.isGlob = true;\n            isExtglob = token.isExtglob = true;\n            finished2 = true;\n            if (code === CHAR_EXCLAMATION_MARK && index === start) {\n              negatedExtglob = true;\n            }\n            if (scanToEnd === true) {\n              while (eos() !== true && (code = advance())) {\n                if (code === CHAR_BACKWARD_SLASH) {\n                  backslashes = token.backslashes = true;\n                  code = advance();\n                  continue;\n                }\n                if (code === CHAR_RIGHT_PARENTHESES) {\n                  isGlob = token.isGlob = true;\n                  finished2 = true;\n                  break;\n                }\n              }\n              continue;\n            }\n            break;\n          }\n        }\n        if (code === CHAR_ASTERISK) {\n          if (prev === CHAR_ASTERISK) isGlobstar = token.isGlobstar = true;\n          isGlob = token.isGlob = true;\n          finished2 = true;\n          if (scanToEnd === true) {\n            continue;\n          }\n          break;\n        }\n        if (code === CHAR_QUESTION_MARK) {\n          isGlob = token.isGlob = true;\n          finished2 = true;\n          if (scanToEnd === true) {\n            continue;\n          }\n          break;\n        }\n        if (code === CHAR_LEFT_SQUARE_BRACKET) {\n          while (eos() !== true && (next = advance())) {\n            if (next === CHAR_BACKWARD_SLASH) {\n              backslashes = token.backslashes = true;\n              advance();\n              continue;\n            }\n            if (next === CHAR_RIGHT_SQUARE_BRACKET) {\n              isBracket = token.isBracket = true;\n              isGlob = token.isGlob = true;\n              finished2 = true;\n              break;\n            }\n          }\n          if (scanToEnd === true) {\n            continue;\n          }\n          break;\n        }\n        if (opts.nonegate !== true && code === CHAR_EXCLAMATION_MARK && index === start) {\n          negated = token.negated = true;\n          start++;\n          continue;\n        }\n        if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES) {\n          isGlob = token.isGlob = true;\n          if (scanToEnd === true) {\n            while (eos() !== true && (code = advance())) {\n              if (code === CHAR_LEFT_PARENTHESES) {\n                backslashes = token.backslashes = true;\n                code = advance();\n                continue;\n              }\n              if (code === CHAR_RIGHT_PARENTHESES) {\n                finished2 = true;\n                break;\n              }\n            }\n            continue;\n          }\n          break;\n        }\n        if (isGlob === true) {\n          finished2 = true;\n          if (scanToEnd === true) {\n            continue;\n          }\n          break;\n        }\n      }\n      if (opts.noext === true) {\n        isExtglob = false;\n        isGlob = false;\n      }\n      let base = str;\n      let prefix = \"\";\n      let glob2 = \"\";\n      if (start > 0) {\n        prefix = str.slice(0, start);\n        str = str.slice(start);\n        lastIndex -= start;\n      }\n      if (base && isGlob === true && lastIndex > 0) {\n        base = str.slice(0, lastIndex);\n        glob2 = str.slice(lastIndex);\n      } else if (isGlob === true) {\n        base = \"\";\n        glob2 = str;\n      } else {\n        base = str;\n      }\n      if (base && base !== \"\" && base !== \"/\" && base !== str) {\n        if (isPathSeparator(base.charCodeAt(base.length - 1))) {\n          base = base.slice(0, -1);\n        }\n      }\n      if (opts.unescape === true) {\n        if (glob2) glob2 = utils.removeBackslashes(glob2);\n        if (base && backslashes === true) {\n          base = utils.removeBackslashes(base);\n        }\n      }\n      const state = {\n        prefix,\n        input,\n        start,\n        base,\n        glob: glob2,\n        isBrace,\n        isBracket,\n        isGlob,\n        isExtglob,\n        isGlobstar,\n        negated,\n        negatedExtglob\n      };\n      if (opts.tokens === true) {\n        state.maxDepth = 0;\n        if (!isPathSeparator(code)) {\n          tokens.push(token);\n        }\n        state.tokens = tokens;\n      }\n      if (opts.parts === true || opts.tokens === true) {\n        let prevIndex;\n        for (let idx = 0; idx < slashes.length; idx++) {\n          const n4 = prevIndex ? prevIndex + 1 : start;\n          const i = slashes[idx];\n          const value = input.slice(n4, i);\n          if (opts.tokens) {\n            if (idx === 0 && start !== 0) {\n              tokens[idx].isPrefix = true;\n              tokens[idx].value = prefix;\n            } else {\n              tokens[idx].value = value;\n            }\n            depth(tokens[idx]);\n            state.maxDepth += tokens[idx].depth;\n          }\n          if (idx !== 0 || value !== \"\") {\n            parts.push(value);\n          }\n          prevIndex = i;\n        }\n        if (prevIndex && prevIndex + 1 < input.length) {\n          const value = input.slice(prevIndex + 1);\n          parts.push(value);\n          if (opts.tokens) {\n            tokens[tokens.length - 1].value = value;\n            depth(tokens[tokens.length - 1]);\n            state.maxDepth += tokens[tokens.length - 1].depth;\n          }\n        }\n        state.slashes = slashes;\n        state.parts = parts;\n      }\n      return state;\n    };\n    module2.exports = scan;\n  }\n});\n\n// node_modules/picomatch/lib/parse.js\nvar require_parse2 = __commonJS({\n  \"node_modules/picomatch/lib/parse.js\"(exports2, module2) {\n    \"use strict\";\n    var constants = require_constants2();\n    var utils = require_utils2();\n    var {\n      MAX_LENGTH,\n      POSIX_REGEX_SOURCE,\n      REGEX_NON_SPECIAL_CHARS,\n      REGEX_SPECIAL_CHARS_BACKREF,\n      REPLACEMENTS\n    } = constants;\n    var expandRange = (args, options) => {\n      if (typeof options.expandRange === \"function\") {\n        return options.expandRange(...args, options);\n      }\n      args.sort();\n      const value = `[${args.join(\"-\")}]`;\n      try {\n        new RegExp(value);\n      } catch (ex) {\n        return args.map((v2) => utils.escapeRegex(v2)).join(\"..\");\n      }\n      return value;\n    };\n    var syntaxError = (type, char) => {\n      return `Missing ${type}: \"${char}\" - use \"\\\\\\\\${char}\" to match literal characters`;\n    };\n    var parse4 = (input, options) => {\n      if (typeof input !== \"string\") {\n        throw new TypeError(\"Expected a string\");\n      }\n      input = REPLACEMENTS[input] || input;\n      const opts = __spreadValues({}, options);\n      const max = typeof opts.maxLength === \"number\" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;\n      let len = input.length;\n      if (len > max) {\n        throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);\n      }\n      const bos = { type: \"bos\", value: \"\", output: opts.prepend || \"\" };\n      const tokens = [bos];\n      const capture = opts.capture ? \"\" : \"?:\";\n      const win32 = utils.isWindows(options);\n      const PLATFORM_CHARS = constants.globChars(win32);\n      const EXTGLOB_CHARS = constants.extglobChars(PLATFORM_CHARS);\n      const {\n        DOT_LITERAL,\n        PLUS_LITERAL,\n        SLASH_LITERAL,\n        ONE_CHAR,\n        DOTS_SLASH,\n        NO_DOT,\n        NO_DOT_SLASH,\n        NO_DOTS_SLASH,\n        QMARK,\n        QMARK_NO_DOT,\n        STAR,\n        START_ANCHOR\n      } = PLATFORM_CHARS;\n      const globstar = (opts2) => {\n        return `(${capture}(?:(?!${START_ANCHOR}${opts2.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;\n      };\n      const nodot = opts.dot ? \"\" : NO_DOT;\n      const qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT;\n      let star = opts.bash === true ? globstar(opts) : STAR;\n      if (opts.capture) {\n        star = `(${star})`;\n      }\n      if (typeof opts.noext === \"boolean\") {\n        opts.noextglob = opts.noext;\n      }\n      const state = {\n        input,\n        index: -1,\n        start: 0,\n        dot: opts.dot === true,\n        consumed: \"\",\n        output: \"\",\n        prefix: \"\",\n        backtrack: false,\n        negated: false,\n        brackets: 0,\n        braces: 0,\n        parens: 0,\n        quotes: 0,\n        globstar: false,\n        tokens\n      };\n      input = utils.removePrefix(input, state);\n      len = input.length;\n      const extglobs = [];\n      const braces = [];\n      const stack = [];\n      let prev = bos;\n      let value;\n      const eos = () => state.index === len - 1;\n      const peek = state.peek = (n4 = 1) => input[state.index + n4];\n      const advance = state.advance = () => input[++state.index] || \"\";\n      const remaining = () => input.slice(state.index + 1);\n      const consume = (value2 = \"\", num = 0) => {\n        state.consumed += value2;\n        state.index += num;\n      };\n      const append = (token) => {\n        state.output += token.output != null ? token.output : token.value;\n        consume(token.value);\n      };\n      const negate = () => {\n        let count = 1;\n        while (peek() === \"!\" && (peek(2) !== \"(\" || peek(3) === \"?\")) {\n          advance();\n          state.start++;\n          count++;\n        }\n        if (count % 2 === 0) {\n          return false;\n        }\n        state.negated = true;\n        state.start++;\n        return true;\n      };\n      const increment = (type) => {\n        state[type]++;\n        stack.push(type);\n      };\n      const decrement = (type) => {\n        state[type]--;\n        stack.pop();\n      };\n      const push = (tok) => {\n        if (prev.type === \"globstar\") {\n          const isBrace = state.braces > 0 && (tok.type === \"comma\" || tok.type === \"brace\");\n          const isExtglob = tok.extglob === true || extglobs.length && (tok.type === \"pipe\" || tok.type === \"paren\");\n          if (tok.type !== \"slash\" && tok.type !== \"paren\" && !isBrace && !isExtglob) {\n            state.output = state.output.slice(0, -prev.output.length);\n            prev.type = \"star\";\n            prev.value = \"*\";\n            prev.output = star;\n            state.output += prev.output;\n          }\n        }\n        if (extglobs.length && tok.type !== \"paren\") {\n          extglobs[extglobs.length - 1].inner += tok.value;\n        }\n        if (tok.value || tok.output) append(tok);\n        if (prev && prev.type === \"text\" && tok.type === \"text\") {\n          prev.value += tok.value;\n          prev.output = (prev.output || \"\") + tok.value;\n          return;\n        }\n        tok.prev = prev;\n        tokens.push(tok);\n        prev = tok;\n      };\n      const extglobOpen = (type, value2) => {\n        const token = __spreadProps(__spreadValues({}, EXTGLOB_CHARS[value2]), { conditions: 1, inner: \"\" });\n        token.prev = prev;\n        token.parens = state.parens;\n        token.output = state.output;\n        const output = (opts.capture ? \"(\" : \"\") + token.open;\n        increment(\"parens\");\n        push({ type, value: value2, output: state.output ? \"\" : ONE_CHAR });\n        push({ type: \"paren\", extglob: true, value: advance(), output });\n        extglobs.push(token);\n      };\n      const extglobClose = (token) => {\n        let output = token.close + (opts.capture ? \")\" : \"\");\n        let rest;\n        if (token.type === \"negate\") {\n          let extglobStar = star;\n          if (token.inner && token.inner.length > 1 && token.inner.includes(\"/\")) {\n            extglobStar = globstar(opts);\n          }\n          if (extglobStar !== star || eos() || /^\\)+$/.test(remaining())) {\n            output = token.close = `)$))${extglobStar}`;\n          }\n          if (token.inner.includes(\"*\") && (rest = remaining()) && /^\\.[^\\\\/.]+$/.test(rest)) {\n            const expression = parse4(rest, __spreadProps(__spreadValues({}, options), { fastpaths: false })).output;\n            output = token.close = `)${expression})${extglobStar})`;\n          }\n          if (token.prev.type === \"bos\") {\n            state.negatedExtglob = true;\n          }\n        }\n        push({ type: \"paren\", extglob: true, value, output });\n        decrement(\"parens\");\n      };\n      if (opts.fastpaths !== false && !/(^[*!]|[/()[\\]{}\"])/.test(input)) {\n        let backslashes = false;\n        let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m2, esc, chars, first, rest, index) => {\n          if (first === \"\\\\\") {\n            backslashes = true;\n            return m2;\n          }\n          if (first === \"?\") {\n            if (esc) {\n              return esc + first + (rest ? QMARK.repeat(rest.length) : \"\");\n            }\n            if (index === 0) {\n              return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : \"\");\n            }\n            return QMARK.repeat(chars.length);\n          }\n          if (first === \".\") {\n            return DOT_LITERAL.repeat(chars.length);\n          }\n          if (first === \"*\") {\n            if (esc) {\n              return esc + first + (rest ? star : \"\");\n            }\n            return star;\n          }\n          return esc ? m2 : `\\\\${m2}`;\n        });\n        if (backslashes === true) {\n          if (opts.unescape === true) {\n            output = output.replace(/\\\\/g, \"\");\n          } else {\n            output = output.replace(/\\\\+/g, (m2) => {\n              return m2.length % 2 === 0 ? \"\\\\\\\\\" : m2 ? \"\\\\\" : \"\";\n            });\n          }\n        }\n        if (output === input && opts.contains === true) {\n          state.output = input;\n          return state;\n        }\n        state.output = utils.wrapOutput(output, state, options);\n        return state;\n      }\n      while (!eos()) {\n        value = advance();\n        if (value === \"\\0\") {\n          continue;\n        }\n        if (value === \"\\\\\") {\n          const next = peek();\n          if (next === \"/\" && opts.bash !== true) {\n            continue;\n          }\n          if (next === \".\" || next === \";\") {\n            continue;\n          }\n          if (!next) {\n            value += \"\\\\\";\n            push({ type: \"text\", value });\n            continue;\n          }\n          const match = /^\\\\+/.exec(remaining());\n          let slashes = 0;\n          if (match && match[0].length > 2) {\n            slashes = match[0].length;\n            state.index += slashes;\n            if (slashes % 2 !== 0) {\n              value += \"\\\\\";\n            }\n          }\n          if (opts.unescape === true) {\n            value = advance();\n          } else {\n            value += advance();\n          }\n          if (state.brackets === 0) {\n            push({ type: \"text\", value });\n            continue;\n          }\n        }\n        if (state.brackets > 0 && (value !== \"]\" || prev.value === \"[\" || prev.value === \"[^\")) {\n          if (opts.posix !== false && value === \":\") {\n            const inner = prev.value.slice(1);\n            if (inner.includes(\"[\")) {\n              prev.posix = true;\n              if (inner.includes(\":\")) {\n                const idx = prev.value.lastIndexOf(\"[\");\n                const pre = prev.value.slice(0, idx);\n                const rest2 = prev.value.slice(idx + 2);\n                const posix = POSIX_REGEX_SOURCE[rest2];\n                if (posix) {\n                  prev.value = pre + posix;\n                  state.backtrack = true;\n                  advance();\n                  if (!bos.output && tokens.indexOf(prev) === 1) {\n                    bos.output = ONE_CHAR;\n                  }\n                  continue;\n                }\n              }\n            }\n          }\n          if (value === \"[\" && peek() !== \":\" || value === \"-\" && peek() === \"]\") {\n            value = `\\\\${value}`;\n          }\n          if (value === \"]\" && (prev.value === \"[\" || prev.value === \"[^\")) {\n            value = `\\\\${value}`;\n          }\n          if (opts.posix === true && value === \"!\" && prev.value === \"[\") {\n            value = \"^\";\n          }\n          prev.value += value;\n          append({ value });\n          continue;\n        }\n        if (state.quotes === 1 && value !== '\"') {\n          value = utils.escapeRegex(value);\n          prev.value += value;\n          append({ value });\n          continue;\n        }\n        if (value === '\"') {\n          state.quotes = state.quotes === 1 ? 0 : 1;\n          if (opts.keepQuotes === true) {\n            push({ type: \"text\", value });\n          }\n          continue;\n        }\n        if (value === \"(\") {\n          increment(\"parens\");\n          push({ type: \"paren\", value });\n          continue;\n        }\n        if (value === \")\") {\n          if (state.parens === 0 && opts.strictBrackets === true) {\n            throw new SyntaxError(syntaxError(\"opening\", \"(\"));\n          }\n          const extglob = extglobs[extglobs.length - 1];\n          if (extglob && state.parens === extglob.parens + 1) {\n            extglobClose(extglobs.pop());\n            continue;\n          }\n          push({ type: \"paren\", value, output: state.parens ? \")\" : \"\\\\)\" });\n          decrement(\"parens\");\n          continue;\n        }\n        if (value === \"[\") {\n          if (opts.nobracket === true || !remaining().includes(\"]\")) {\n            if (opts.nobracket !== true && opts.strictBrackets === true) {\n              throw new SyntaxError(syntaxError(\"closing\", \"]\"));\n            }\n            value = `\\\\${value}`;\n          } else {\n            increment(\"brackets\");\n          }\n          push({ type: \"bracket\", value });\n          continue;\n        }\n        if (value === \"]\") {\n          if (opts.nobracket === true || prev && prev.type === \"bracket\" && prev.value.length === 1) {\n            push({ type: \"text\", value, output: `\\\\${value}` });\n            continue;\n          }\n          if (state.brackets === 0) {\n            if (opts.strictBrackets === true) {\n              throw new SyntaxError(syntaxError(\"opening\", \"[\"));\n            }\n            push({ type: \"text\", value, output: `\\\\${value}` });\n            continue;\n          }\n          decrement(\"brackets\");\n          const prevValue = prev.value.slice(1);\n          if (prev.posix !== true && prevValue[0] === \"^\" && !prevValue.includes(\"/\")) {\n            value = `/${value}`;\n          }\n          prev.value += value;\n          append({ value });\n          if (opts.literalBrackets === false || utils.hasRegexChars(prevValue)) {\n            continue;\n          }\n          const escaped = utils.escapeRegex(prev.value);\n          state.output = state.output.slice(0, -prev.value.length);\n          if (opts.literalBrackets === true) {\n            state.output += escaped;\n            prev.value = escaped;\n            continue;\n          }\n          prev.value = `(${capture}${escaped}|${prev.value})`;\n          state.output += prev.value;\n          continue;\n        }\n        if (value === \"{\" && opts.nobrace !== true) {\n          increment(\"braces\");\n          const open = {\n            type: \"brace\",\n            value,\n            output: \"(\",\n            outputIndex: state.output.length,\n            tokensIndex: state.tokens.length\n          };\n          braces.push(open);\n          push(open);\n          continue;\n        }\n        if (value === \"}\") {\n          const brace = braces[braces.length - 1];\n          if (opts.nobrace === true || !brace) {\n            push({ type: \"text\", value, output: value });\n            continue;\n          }\n          let output = \")\";\n          if (brace.dots === true) {\n            const arr = tokens.slice();\n            const range = [];\n            for (let i = arr.length - 1; i >= 0; i--) {\n              tokens.pop();\n              if (arr[i].type === \"brace\") {\n                break;\n              }\n              if (arr[i].type !== \"dots\") {\n                range.unshift(arr[i].value);\n              }\n            }\n            output = expandRange(range, opts);\n            state.backtrack = true;\n          }\n          if (brace.comma !== true && brace.dots !== true) {\n            const out = state.output.slice(0, brace.outputIndex);\n            const toks = state.tokens.slice(brace.tokensIndex);\n            brace.value = brace.output = \"\\\\{\";\n            value = output = \"\\\\}\";\n            state.output = out;\n            for (const t3 of toks) {\n              state.output += t3.output || t3.value;\n            }\n          }\n          push({ type: \"brace\", value, output });\n          decrement(\"braces\");\n          braces.pop();\n          continue;\n        }\n        if (value === \"|\") {\n          if (extglobs.length > 0) {\n            extglobs[extglobs.length - 1].conditions++;\n          }\n          push({ type: \"text\", value });\n          continue;\n        }\n        if (value === \",\") {\n          let output = value;\n          const brace = braces[braces.length - 1];\n          if (brace && stack[stack.length - 1] === \"braces\") {\n            brace.comma = true;\n            output = \"|\";\n          }\n          push({ type: \"comma\", value, output });\n          continue;\n        }\n        if (value === \"/\") {\n          if (prev.type === \"dot\" && state.index === state.start + 1) {\n            state.start = state.index + 1;\n            state.consumed = \"\";\n            state.output = \"\";\n            tokens.pop();\n            prev = bos;\n            continue;\n          }\n          push({ type: \"slash\", value, output: SLASH_LITERAL });\n          continue;\n        }\n        if (value === \".\") {\n          if (state.braces > 0 && prev.type === \"dot\") {\n            if (prev.value === \".\") prev.output = DOT_LITERAL;\n            const brace = braces[braces.length - 1];\n            prev.type = \"dots\";\n            prev.output += value;\n            prev.value += value;\n            brace.dots = true;\n            continue;\n          }\n          if (state.braces + state.parens === 0 && prev.type !== \"bos\" && prev.type !== \"slash\") {\n            push({ type: \"text\", value, output: DOT_LITERAL });\n            continue;\n          }\n          push({ type: \"dot\", value, output: DOT_LITERAL });\n          continue;\n        }\n        if (value === \"?\") {\n          const isGroup = prev && prev.value === \"(\";\n          if (!isGroup && opts.noextglob !== true && peek() === \"(\" && peek(2) !== \"?\") {\n            extglobOpen(\"qmark\", value);\n            continue;\n          }\n          if (prev && prev.type === \"paren\") {\n            const next = peek();\n            let output = value;\n            if (next === \"<\" && !utils.supportsLookbehinds()) {\n              throw new Error(\"Node.js v10 or higher is required for regex lookbehinds\");\n            }\n            if (prev.value === \"(\" && !/[!=<:]/.test(next) || next === \"<\" && !/<([!=]|\\w+>)/.test(remaining())) {\n              output = `\\\\${value}`;\n            }\n            push({ type: \"text\", value, output });\n            continue;\n          }\n          if (opts.dot !== true && (prev.type === \"slash\" || prev.type === \"bos\")) {\n            push({ type: \"qmark\", value, output: QMARK_NO_DOT });\n            continue;\n          }\n          push({ type: \"qmark\", value, output: QMARK });\n          continue;\n        }\n        if (value === \"!\") {\n          if (opts.noextglob !== true && peek() === \"(\") {\n            if (peek(2) !== \"?\" || !/[!=<:]/.test(peek(3))) {\n              extglobOpen(\"negate\", value);\n              continue;\n            }\n          }\n          if (opts.nonegate !== true && state.index === 0) {\n            negate();\n            continue;\n          }\n        }\n        if (value === \"+\") {\n          if (opts.noextglob !== true && peek() === \"(\" && peek(2) !== \"?\") {\n            extglobOpen(\"plus\", value);\n            continue;\n          }\n          if (prev && prev.value === \"(\" || opts.regex === false) {\n            push({ type: \"plus\", value, output: PLUS_LITERAL });\n            continue;\n          }\n          if (prev && (prev.type === \"bracket\" || prev.type === \"paren\" || prev.type === \"brace\") || state.parens > 0) {\n            push({ type: \"plus\", value });\n            continue;\n          }\n          push({ type: \"plus\", value: PLUS_LITERAL });\n          continue;\n        }\n        if (value === \"@\") {\n          if (opts.noextglob !== true && peek() === \"(\" && peek(2) !== \"?\") {\n            push({ type: \"at\", extglob: true, value, output: \"\" });\n            continue;\n          }\n          push({ type: \"text\", value });\n          continue;\n        }\n        if (value !== \"*\") {\n          if (value === \"$\" || value === \"^\") {\n            value = `\\\\${value}`;\n          }\n          const match = REGEX_NON_SPECIAL_CHARS.exec(remaining());\n          if (match) {\n            value += match[0];\n            state.index += match[0].length;\n          }\n          push({ type: \"text\", value });\n          continue;\n        }\n        if (prev && (prev.type === \"globstar\" || prev.star === true)) {\n          prev.type = \"star\";\n          prev.star = true;\n          prev.value += value;\n          prev.output = star;\n          state.backtrack = true;\n          state.globstar = true;\n          consume(value);\n          continue;\n        }\n        let rest = remaining();\n        if (opts.noextglob !== true && /^\\([^?]/.test(rest)) {\n          extglobOpen(\"star\", value);\n          continue;\n        }\n        if (prev.type === \"star\") {\n          if (opts.noglobstar === true) {\n            consume(value);\n            continue;\n          }\n          const prior = prev.prev;\n          const before = prior.prev;\n          const isStart = prior.type === \"slash\" || prior.type === \"bos\";\n          const afterStar = before && (before.type === \"star\" || before.type === \"globstar\");\n          if (opts.bash === true && (!isStart || rest[0] && rest[0] !== \"/\")) {\n            push({ type: \"star\", value, output: \"\" });\n            continue;\n          }\n          const isBrace = state.braces > 0 && (prior.type === \"comma\" || prior.type === \"brace\");\n          const isExtglob = extglobs.length && (prior.type === \"pipe\" || prior.type === \"paren\");\n          if (!isStart && prior.type !== \"paren\" && !isBrace && !isExtglob) {\n            push({ type: \"star\", value, output: \"\" });\n            continue;\n          }\n          while (rest.slice(0, 3) === \"/**\") {\n            const after = input[state.index + 4];\n            if (after && after !== \"/\") {\n              break;\n            }\n            rest = rest.slice(3);\n            consume(\"/**\", 3);\n          }\n          if (prior.type === \"bos\" && eos()) {\n            prev.type = \"globstar\";\n            prev.value += value;\n            prev.output = globstar(opts);\n            state.output = prev.output;\n            state.globstar = true;\n            consume(value);\n            continue;\n          }\n          if (prior.type === \"slash\" && prior.prev.type !== \"bos\" && !afterStar && eos()) {\n            state.output = state.output.slice(0, -(prior.output + prev.output).length);\n            prior.output = `(?:${prior.output}`;\n            prev.type = \"globstar\";\n            prev.output = globstar(opts) + (opts.strictSlashes ? \")\" : \"|$)\");\n            prev.value += value;\n            state.globstar = true;\n            state.output += prior.output + prev.output;\n            consume(value);\n            continue;\n          }\n          if (prior.type === \"slash\" && prior.prev.type !== \"bos\" && rest[0] === \"/\") {\n            const end = rest[1] !== void 0 ? \"|$\" : \"\";\n            state.output = state.output.slice(0, -(prior.output + prev.output).length);\n            prior.output = `(?:${prior.output}`;\n            prev.type = \"globstar\";\n            prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`;\n            prev.value += value;\n            state.output += prior.output + prev.output;\n            state.globstar = true;\n            consume(value + advance());\n            push({ type: \"slash\", value: \"/\", output: \"\" });\n            continue;\n          }\n          if (prior.type === \"bos\" && rest[0] === \"/\") {\n            prev.type = \"globstar\";\n            prev.value += value;\n            prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`;\n            state.output = prev.output;\n            state.globstar = true;\n            consume(value + advance());\n            push({ type: \"slash\", value: \"/\", output: \"\" });\n            continue;\n          }\n          state.output = state.output.slice(0, -prev.output.length);\n          prev.type = \"globstar\";\n          prev.output = globstar(opts);\n          prev.value += value;\n          state.output += prev.output;\n          state.globstar = true;\n          consume(value);\n          continue;\n        }\n        const token = { type: \"star\", value, output: star };\n        if (opts.bash === true) {\n          token.output = \".*?\";\n          if (prev.type === \"bos\" || prev.type === \"slash\") {\n            token.output = nodot + token.output;\n          }\n          push(token);\n          continue;\n        }\n        if (prev && (prev.type === \"bracket\" || prev.type === \"paren\") && opts.regex === true) {\n          token.output = value;\n          push(token);\n          continue;\n        }\n        if (state.index === state.start || prev.type === \"slash\" || prev.type === \"dot\") {\n          if (prev.type === \"dot\") {\n            state.output += NO_DOT_SLASH;\n            prev.output += NO_DOT_SLASH;\n          } else if (opts.dot === true) {\n            state.output += NO_DOTS_SLASH;\n            prev.output += NO_DOTS_SLASH;\n          } else {\n            state.output += nodot;\n            prev.output += nodot;\n          }\n          if (peek() !== \"*\") {\n            state.output += ONE_CHAR;\n            prev.output += ONE_CHAR;\n          }\n        }\n        push(token);\n      }\n      while (state.brackets > 0) {\n        if (opts.strictBrackets === true) throw new SyntaxError(syntaxError(\"closing\", \"]\"));\n        state.output = utils.escapeLast(state.output, \"[\");\n        decrement(\"brackets\");\n      }\n      while (state.parens > 0) {\n        if (opts.strictBrackets === true) throw new SyntaxError(syntaxError(\"closing\", \")\"));\n        state.output = utils.escapeLast(state.output, \"(\");\n        decrement(\"parens\");\n      }\n      while (state.braces > 0) {\n        if (opts.strictBrackets === true) throw new SyntaxError(syntaxError(\"closing\", \"}\"));\n        state.output = utils.escapeLast(state.output, \"{\");\n        decrement(\"braces\");\n      }\n      if (opts.strictSlashes !== true && (prev.type === \"star\" || prev.type === \"bracket\")) {\n        push({ type: \"maybe_slash\", value: \"\", output: `${SLASH_LITERAL}?` });\n      }\n      if (state.backtrack === true) {\n        state.output = \"\";\n        for (const token of state.tokens) {\n          state.output += token.output != null ? token.output : token.value;\n          if (token.suffix) {\n            state.output += token.suffix;\n          }\n        }\n      }\n      return state;\n    };\n    parse4.fastpaths = (input, options) => {\n      const opts = __spreadValues({}, options);\n      const max = typeof opts.maxLength === \"number\" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;\n      const len = input.length;\n      if (len > max) {\n        throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);\n      }\n      input = REPLACEMENTS[input] || input;\n      const win32 = utils.isWindows(options);\n      const {\n        DOT_LITERAL,\n        SLASH_LITERAL,\n        ONE_CHAR,\n        DOTS_SLASH,\n        NO_DOT,\n        NO_DOTS,\n        NO_DOTS_SLASH,\n        STAR,\n        START_ANCHOR\n      } = constants.globChars(win32);\n      const nodot = opts.dot ? NO_DOTS : NO_DOT;\n      const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT;\n      const capture = opts.capture ? \"\" : \"?:\";\n      const state = { negated: false, prefix: \"\" };\n      let star = opts.bash === true ? \".*?\" : STAR;\n      if (opts.capture) {\n        star = `(${star})`;\n      }\n      const globstar = (opts2) => {\n        if (opts2.noglobstar === true) return star;\n        return `(${capture}(?:(?!${START_ANCHOR}${opts2.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;\n      };\n      const create = (str) => {\n        switch (str) {\n          case \"*\":\n            return `${nodot}${ONE_CHAR}${star}`;\n          case \".*\":\n            return `${DOT_LITERAL}${ONE_CHAR}${star}`;\n          case \"*.*\":\n            return `${nodot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;\n          case \"*/*\":\n            return `${nodot}${star}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star}`;\n          case \"**\":\n            return nodot + globstar(opts);\n          case \"**/*\":\n            return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star}`;\n          case \"**/*.*\":\n            return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;\n          case \"**/.*\":\n            return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`;\n          default: {\n            const match = /^(.*?)\\.(\\w+)$/.exec(str);\n            if (!match) return;\n            const source2 = create(match[1]);\n            if (!source2) return;\n            return source2 + DOT_LITERAL + match[2];\n          }\n        }\n      };\n      const output = utils.removePrefix(input, state);\n      let source = create(output);\n      if (source && opts.strictSlashes !== true) {\n        source += `${SLASH_LITERAL}?`;\n      }\n      return source;\n    };\n    module2.exports = parse4;\n  }\n});\n\n// node_modules/picomatch/lib/picomatch.js\nvar require_picomatch = __commonJS({\n  \"node_modules/picomatch/lib/picomatch.js\"(exports2, module2) {\n    \"use strict\";\n    var path5 = require(\"path\");\n    var scan = require_scan();\n    var parse4 = require_parse2();\n    var utils = require_utils2();\n    var constants = require_constants2();\n    var isObject = (val) => val && typeof val === \"object\" && !Array.isArray(val);\n    var picomatch = (glob2, options, returnState = false) => {\n      if (Array.isArray(glob2)) {\n        const fns = glob2.map((input) => picomatch(input, options, returnState));\n        const arrayMatcher = (str) => {\n          for (const isMatch of fns) {\n            const state2 = isMatch(str);\n            if (state2) return state2;\n          }\n          return false;\n        };\n        return arrayMatcher;\n      }\n      const isState = isObject(glob2) && glob2.tokens && glob2.input;\n      if (glob2 === \"\" || typeof glob2 !== \"string\" && !isState) {\n        throw new TypeError(\"Expected pattern to be a non-empty string\");\n      }\n      const opts = options || {};\n      const posix = utils.isWindows(options);\n      const regex = isState ? picomatch.compileRe(glob2, options) : picomatch.makeRe(glob2, options, false, true);\n      const state = regex.state;\n      delete regex.state;\n      let isIgnored = () => false;\n      if (opts.ignore) {\n        const ignoreOpts = __spreadProps(__spreadValues({}, options), { ignore: null, onMatch: null, onResult: null });\n        isIgnored = picomatch(opts.ignore, ignoreOpts, returnState);\n      }\n      const matcher = (input, returnObject = false) => {\n        const { isMatch, match, output } = picomatch.test(input, regex, options, { glob: glob2, posix });\n        const result = { glob: glob2, state, regex, posix, input, output, match, isMatch };\n        if (typeof opts.onResult === \"function\") {\n          opts.onResult(result);\n        }\n        if (isMatch === false) {\n          result.isMatch = false;\n          return returnObject ? result : false;\n        }\n        if (isIgnored(input)) {\n          if (typeof opts.onIgnore === \"function\") {\n            opts.onIgnore(result);\n          }\n          result.isMatch = false;\n          return returnObject ? result : false;\n        }\n        if (typeof opts.onMatch === \"function\") {\n          opts.onMatch(result);\n        }\n        return returnObject ? result : true;\n      };\n      if (returnState) {\n        matcher.state = state;\n      }\n      return matcher;\n    };\n    picomatch.test = (input, regex, options, { glob: glob2, posix } = {}) => {\n      if (typeof input !== \"string\") {\n        throw new TypeError(\"Expected input to be a string\");\n      }\n      if (input === \"\") {\n        return { isMatch: false, output: \"\" };\n      }\n      const opts = options || {};\n      const format = opts.format || (posix ? utils.toPosixSlashes : null);\n      let match = input === glob2;\n      let output = match && format ? format(input) : input;\n      if (match === false) {\n        output = format ? format(input) : input;\n        match = output === glob2;\n      }\n      if (match === false || opts.capture === true) {\n        if (opts.matchBase === true || opts.basename === true) {\n          match = picomatch.matchBase(input, regex, options, posix);\n        } else {\n          match = regex.exec(output);\n        }\n      }\n      return { isMatch: Boolean(match), match, output };\n    };\n    picomatch.matchBase = (input, glob2, options, posix = utils.isWindows(options)) => {\n      const regex = glob2 instanceof RegExp ? glob2 : picomatch.makeRe(glob2, options);\n      return regex.test(path5.basename(input));\n    };\n    picomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str);\n    picomatch.parse = (pattern, options) => {\n      if (Array.isArray(pattern)) return pattern.map((p2) => picomatch.parse(p2, options));\n      return parse4(pattern, __spreadProps(__spreadValues({}, options), { fastpaths: false }));\n    };\n    picomatch.scan = (input, options) => scan(input, options);\n    picomatch.compileRe = (state, options, returnOutput = false, returnState = false) => {\n      if (returnOutput === true) {\n        return state.output;\n      }\n      const opts = options || {};\n      const prepend = opts.contains ? \"\" : \"^\";\n      const append = opts.contains ? \"\" : \"$\";\n      let source = `${prepend}(?:${state.output})${append}`;\n      if (state && state.negated === true) {\n        source = `^(?!${source}).*$`;\n      }\n      const regex = picomatch.toRegex(source, options);\n      if (returnState === true) {\n        regex.state = state;\n      }\n      return regex;\n    };\n    picomatch.makeRe = (input, options = {}, returnOutput = false, returnState = false) => {\n      if (!input || typeof input !== \"string\") {\n        throw new TypeError(\"Expected a non-empty string\");\n      }\n      let parsed = { negated: false, fastpaths: true };\n      if (options.fastpaths !== false && (input[0] === \".\" || input[0] === \"*\")) {\n        parsed.output = parse4.fastpaths(input, options);\n      }\n      if (!parsed.output) {\n        parsed = parse4(input, options);\n      }\n      return picomatch.compileRe(parsed, options, returnOutput, returnState);\n    };\n    picomatch.toRegex = (source, options) => {\n      try {\n        const opts = options || {};\n        return new RegExp(source, opts.flags || (opts.nocase ? \"i\" : \"\"));\n      } catch (err) {\n        if (options && options.debug === true) throw err;\n        return /$^/;\n      }\n    };\n    picomatch.constants = constants;\n    module2.exports = picomatch;\n  }\n});\n\n// node_modules/picomatch/index.js\nvar require_picomatch2 = __commonJS({\n  \"node_modules/picomatch/index.js\"(exports2, module2) {\n    \"use strict\";\n    module2.exports = require_picomatch();\n  }\n});\n\n// node_modules/micromatch/index.js\nvar require_micromatch = __commonJS({\n  \"node_modules/micromatch/index.js\"(exports2, module2) {\n    \"use strict\";\n    var util = require(\"util\");\n    var braces = require_braces();\n    var picomatch = require_picomatch2();\n    var utils = require_utils2();\n    var isEmptyString = (v2) => v2 === \"\" || v2 === \"./\";\n    var hasBraces = (v2) => {\n      const index = v2.indexOf(\"{\");\n      return index > -1 && v2.indexOf(\"}\", index) > -1;\n    };\n    var micromatch = (list, patterns, options) => {\n      patterns = [].concat(patterns);\n      list = [].concat(list);\n      let omit = /* @__PURE__ */ new Set();\n      let keep = /* @__PURE__ */ new Set();\n      let items = /* @__PURE__ */ new Set();\n      let negatives = 0;\n      let onResult = (state) => {\n        items.add(state.output);\n        if (options && options.onResult) {\n          options.onResult(state);\n        }\n      };\n      for (let i = 0; i < patterns.length; i++) {\n        let isMatch = picomatch(String(patterns[i]), __spreadProps(__spreadValues({}, options), { onResult }), true);\n        let negated = isMatch.state.negated || isMatch.state.negatedExtglob;\n        if (negated) negatives++;\n        for (let item of list) {\n          let matched = isMatch(item, true);\n          let match = negated ? !matched.isMatch : matched.isMatch;\n          if (!match) continue;\n          if (negated) {\n            omit.add(matched.output);\n          } else {\n            omit.delete(matched.output);\n            keep.add(matched.output);\n          }\n        }\n      }\n      let result = negatives === patterns.length ? [...items] : [...keep];\n      let matches = result.filter((item) => !omit.has(item));\n      if (options && matches.length === 0) {\n        if (options.failglob === true) {\n          throw new Error(`No matches found for \"${patterns.join(\", \")}\"`);\n        }\n        if (options.nonull === true || options.nullglob === true) {\n          return options.unescape ? patterns.map((p2) => p2.replace(/\\\\/g, \"\")) : patterns;\n        }\n      }\n      return matches;\n    };\n    micromatch.match = micromatch;\n    micromatch.matcher = (pattern, options) => picomatch(pattern, options);\n    micromatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str);\n    micromatch.any = micromatch.isMatch;\n    micromatch.not = (list, patterns, options = {}) => {\n      patterns = [].concat(patterns).map(String);\n      let result = /* @__PURE__ */ new Set();\n      let items = [];\n      let onResult = (state) => {\n        if (options.onResult) options.onResult(state);\n        items.push(state.output);\n      };\n      let matches = new Set(micromatch(list, patterns, __spreadProps(__spreadValues({}, options), { onResult })));\n      for (let item of items) {\n        if (!matches.has(item)) {\n          result.add(item);\n        }\n      }\n      return [...result];\n    };\n    micromatch.contains = (str, pattern, options) => {\n      if (typeof str !== \"string\") {\n        throw new TypeError(`Expected a string: \"${util.inspect(str)}\"`);\n      }\n      if (Array.isArray(pattern)) {\n        return pattern.some((p2) => micromatch.contains(str, p2, options));\n      }\n      if (typeof pattern === \"string\") {\n        if (isEmptyString(str) || isEmptyString(pattern)) {\n          return false;\n        }\n        if (str.includes(pattern) || str.startsWith(\"./\") && str.slice(2).includes(pattern)) {\n          return true;\n        }\n      }\n      return micromatch.isMatch(str, pattern, __spreadProps(__spreadValues({}, options), { contains: true }));\n    };\n    micromatch.matchKeys = (obj, patterns, options) => {\n      if (!utils.isObject(obj)) {\n        throw new TypeError(\"Expected the first argument to be an object\");\n      }\n      let keys = micromatch(Object.keys(obj), patterns, options);\n      let res = {};\n      for (let key of keys) res[key] = obj[key];\n      return res;\n    };\n    micromatch.some = (list, patterns, options) => {\n      let items = [].concat(list);\n      for (let pattern of [].concat(patterns)) {\n        let isMatch = picomatch(String(pattern), options);\n        if (items.some((item) => isMatch(item))) {\n          return true;\n        }\n      }\n      return false;\n    };\n    micromatch.every = (list, patterns, options) => {\n      let items = [].concat(list);\n      for (let pattern of [].concat(patterns)) {\n        let isMatch = picomatch(String(pattern), options);\n        if (!items.every((item) => isMatch(item))) {\n          return false;\n        }\n      }\n      return true;\n    };\n    micromatch.all = (str, patterns, options) => {\n      if (typeof str !== \"string\") {\n        throw new TypeError(`Expected a string: \"${util.inspect(str)}\"`);\n      }\n      return [].concat(patterns).every((p2) => picomatch(p2, options)(str));\n    };\n    micromatch.capture = (glob2, input, options) => {\n      let posix = utils.isWindows(options);\n      let regex = picomatch.makeRe(String(glob2), __spreadProps(__spreadValues({}, options), { capture: true }));\n      let match = regex.exec(posix ? utils.toPosixSlashes(input) : input);\n      if (match) {\n        return match.slice(1).map((v2) => v2 === void 0 ? \"\" : v2);\n      }\n    };\n    micromatch.makeRe = (...args) => picomatch.makeRe(...args);\n    micromatch.scan = (...args) => picomatch.scan(...args);\n    micromatch.parse = (patterns, options) => {\n      let res = [];\n      for (let pattern of [].concat(patterns || [])) {\n        for (let str of braces(String(pattern), options)) {\n          res.push(picomatch.parse(str, options));\n        }\n      }\n      return res;\n    };\n    micromatch.braces = (pattern, options) => {\n      if (typeof pattern !== \"string\") throw new TypeError(\"Expected a string\");\n      if (options && options.nobrace === true || !hasBraces(pattern)) {\n        return [pattern];\n      }\n      return braces(pattern, options);\n    };\n    micromatch.braceExpand = (pattern, options) => {\n      if (typeof pattern !== \"string\") throw new TypeError(\"Expected a string\");\n      return micromatch.braces(pattern, __spreadProps(__spreadValues({}, options), { expand: true }));\n    };\n    micromatch.hasBraces = hasBraces;\n    module2.exports = micromatch;\n  }\n});\n\n// node_modules/fast-glob/out/utils/pattern.js\nvar require_pattern = __commonJS({\n  \"node_modules/fast-glob/out/utils/pattern.js\"(exports2) {\n    \"use strict\";\n    Object.defineProperty(exports2, \"__esModule\", { value: true });\n    exports2.isAbsolute = exports2.partitionAbsoluteAndRelative = exports2.removeDuplicateSlashes = exports2.matchAny = exports2.convertPatternsToRe = exports2.makeRe = exports2.getPatternParts = exports2.expandBraceExpansion = exports2.expandPatternsWithBraceExpansion = exports2.isAffectDepthOfReadingPattern = exports2.endsWithSlashGlobStar = exports2.hasGlobStar = exports2.getBaseDirectory = exports2.isPatternRelatedToParentDirectory = exports2.getPatternsOutsideCurrentDirectory = exports2.getPatternsInsideCurrentDirectory = exports2.getPositivePatterns = exports2.getNegativePatterns = exports2.isPositivePattern = exports2.isNegativePattern = exports2.convertToNegativePattern = exports2.convertToPositivePattern = exports2.isDynamicPattern = exports2.isStaticPattern = void 0;\n    var path5 = require(\"path\");\n    var globParent = require_glob_parent();\n    var micromatch = require_micromatch();\n    var GLOBSTAR = \"**\";\n    var ESCAPE_SYMBOL = \"\\\\\";\n    var COMMON_GLOB_SYMBOLS_RE = /[*?]|^!/;\n    var REGEX_CHARACTER_CLASS_SYMBOLS_RE = /\\[[^[]*]/;\n    var REGEX_GROUP_SYMBOLS_RE = /(?:^|[^!*+?@])\\([^(]*\\|[^|]*\\)/;\n    var GLOB_EXTENSION_SYMBOLS_RE = /[!*+?@]\\([^(]*\\)/;\n    var BRACE_EXPANSION_SEPARATORS_RE = /,|\\.\\./;\n    var DOUBLE_SLASH_RE = /(?!^)\\/{2,}/g;\n    function isStaticPattern(pattern, options = {}) {\n      return !isDynamicPattern2(pattern, options);\n    }\n    exports2.isStaticPattern = isStaticPattern;\n    function isDynamicPattern2(pattern, options = {}) {\n      if (pattern === \"\") {\n        return false;\n      }\n      if (options.caseSensitiveMatch === false || pattern.includes(ESCAPE_SYMBOL)) {\n        return true;\n      }\n      if (COMMON_GLOB_SYMBOLS_RE.test(pattern) || REGEX_CHARACTER_CLASS_SYMBOLS_RE.test(pattern) || REGEX_GROUP_SYMBOLS_RE.test(pattern)) {\n        return true;\n      }\n      if (options.extglob !== false && GLOB_EXTENSION_SYMBOLS_RE.test(pattern)) {\n        return true;\n      }\n      if (options.braceExpansion !== false && hasBraceExpansion(pattern)) {\n        return true;\n      }\n      return false;\n    }\n    exports2.isDynamicPattern = isDynamicPattern2;\n    function hasBraceExpansion(pattern) {\n      const openingBraceIndex = pattern.indexOf(\"{\");\n      if (openingBraceIndex === -1) {\n        return false;\n      }\n      const closingBraceIndex = pattern.indexOf(\"}\", openingBraceIndex + 1);\n      if (closingBraceIndex === -1) {\n        return false;\n      }\n      const braceContent = pattern.slice(openingBraceIndex, closingBraceIndex);\n      return BRACE_EXPANSION_SEPARATORS_RE.test(braceContent);\n    }\n    function convertToPositivePattern(pattern) {\n      return isNegativePattern2(pattern) ? pattern.slice(1) : pattern;\n    }\n    exports2.convertToPositivePattern = convertToPositivePattern;\n    function convertToNegativePattern(pattern) {\n      return \"!\" + pattern;\n    }\n    exports2.convertToNegativePattern = convertToNegativePattern;\n    function isNegativePattern2(pattern) {\n      return pattern.startsWith(\"!\") && pattern[1] !== \"(\";\n    }\n    exports2.isNegativePattern = isNegativePattern2;\n    function isPositivePattern(pattern) {\n      return !isNegativePattern2(pattern);\n    }\n    exports2.isPositivePattern = isPositivePattern;\n    function getNegativePatterns(patterns) {\n      return patterns.filter(isNegativePattern2);\n    }\n    exports2.getNegativePatterns = getNegativePatterns;\n    function getPositivePatterns(patterns) {\n      return patterns.filter(isPositivePattern);\n    }\n    exports2.getPositivePatterns = getPositivePatterns;\n    function getPatternsInsideCurrentDirectory(patterns) {\n      return patterns.filter((pattern) => !isPatternRelatedToParentDirectory(pattern));\n    }\n    exports2.getPatternsInsideCurrentDirectory = getPatternsInsideCurrentDirectory;\n    function getPatternsOutsideCurrentDirectory(patterns) {\n      return patterns.filter(isPatternRelatedToParentDirectory);\n    }\n    exports2.getPatternsOutsideCurrentDirectory = getPatternsOutsideCurrentDirectory;\n    function isPatternRelatedToParentDirectory(pattern) {\n      return pattern.startsWith(\"..\") || pattern.startsWith(\"./..\");\n    }\n    exports2.isPatternRelatedToParentDirectory = isPatternRelatedToParentDirectory;\n    function getBaseDirectory(pattern) {\n      return globParent(pattern, { flipBackslashes: false });\n    }\n    exports2.getBaseDirectory = getBaseDirectory;\n    function hasGlobStar(pattern) {\n      return pattern.includes(GLOBSTAR);\n    }\n    exports2.hasGlobStar = hasGlobStar;\n    function endsWithSlashGlobStar(pattern) {\n      return pattern.endsWith(\"/\" + GLOBSTAR);\n    }\n    exports2.endsWithSlashGlobStar = endsWithSlashGlobStar;\n    function isAffectDepthOfReadingPattern(pattern) {\n      const basename = path5.basename(pattern);\n      return endsWithSlashGlobStar(pattern) || isStaticPattern(basename);\n    }\n    exports2.isAffectDepthOfReadingPattern = isAffectDepthOfReadingPattern;\n    function expandPatternsWithBraceExpansion(patterns) {\n      return patterns.reduce((collection, pattern) => {\n        return collection.concat(expandBraceExpansion(pattern));\n      }, []);\n    }\n    exports2.expandPatternsWithBraceExpansion = expandPatternsWithBraceExpansion;\n    function expandBraceExpansion(pattern) {\n      const patterns = micromatch.braces(pattern, { expand: true, nodupes: true, keepEscaping: true });\n      patterns.sort((a, b) => a.length - b.length);\n      return patterns.filter((pattern2) => pattern2 !== \"\");\n    }\n    exports2.expandBraceExpansion = expandBraceExpansion;\n    function getPatternParts(pattern, options) {\n      let { parts } = micromatch.scan(pattern, Object.assign(Object.assign({}, options), { parts: true }));\n      if (parts.length === 0) {\n        parts = [pattern];\n      }\n      if (parts[0].startsWith(\"/\")) {\n        parts[0] = parts[0].slice(1);\n        parts.unshift(\"\");\n      }\n      return parts;\n    }\n    exports2.getPatternParts = getPatternParts;\n    function makeRe(pattern, options) {\n      return micromatch.makeRe(pattern, options);\n    }\n    exports2.makeRe = makeRe;\n    function convertPatternsToRe(patterns, options) {\n      return patterns.map((pattern) => makeRe(pattern, options));\n    }\n    exports2.convertPatternsToRe = convertPatternsToRe;\n    function matchAny(entry, patternsRe) {\n      return patternsRe.some((patternRe) => patternRe.test(entry));\n    }\n    exports2.matchAny = matchAny;\n    function removeDuplicateSlashes(pattern) {\n      return pattern.replace(DOUBLE_SLASH_RE, \"/\");\n    }\n    exports2.removeDuplicateSlashes = removeDuplicateSlashes;\n    function partitionAbsoluteAndRelative(patterns) {\n      const absolute = [];\n      const relative = [];\n      for (const pattern of patterns) {\n        if (isAbsolute(pattern)) {\n          absolute.push(pattern);\n        } else {\n          relative.push(pattern);\n        }\n      }\n      return [absolute, relative];\n    }\n    exports2.partitionAbsoluteAndRelative = partitionAbsoluteAndRelative;\n    function isAbsolute(pattern) {\n      return path5.isAbsolute(pattern);\n    }\n    exports2.isAbsolute = isAbsolute;\n  }\n});\n\n// node_modules/merge2/index.js\nvar require_merge2 = __commonJS({\n  \"node_modules/merge2/index.js\"(exports2, module2) {\n    \"use strict\";\n    var Stream = require(\"stream\");\n    var PassThrough = Stream.PassThrough;\n    var slice = Array.prototype.slice;\n    module2.exports = merge2;\n    function merge2() {\n      const streamsQueue = [];\n      const args = slice.call(arguments);\n      let merging = false;\n      let options = args[args.length - 1];\n      if (options && !Array.isArray(options) && options.pipe == null) {\n        args.pop();\n      } else {\n        options = {};\n      }\n      const doEnd = options.end !== false;\n      const doPipeError = options.pipeError === true;\n      if (options.objectMode == null) {\n        options.objectMode = true;\n      }\n      if (options.highWaterMark == null) {\n        options.highWaterMark = 64 * 1024;\n      }\n      const mergedStream = PassThrough(options);\n      function addStream() {\n        for (let i = 0, len = arguments.length; i < len; i++) {\n          streamsQueue.push(pauseStreams(arguments[i], options));\n        }\n        mergeStream();\n        return this;\n      }\n      function mergeStream() {\n        if (merging) {\n          return;\n        }\n        merging = true;\n        let streams = streamsQueue.shift();\n        if (!streams) {\n          process.nextTick(endStream2);\n          return;\n        }\n        if (!Array.isArray(streams)) {\n          streams = [streams];\n        }\n        let pipesCount = streams.length + 1;\n        function next() {\n          if (--pipesCount > 0) {\n            return;\n          }\n          merging = false;\n          mergeStream();\n        }\n        function pipe(stream) {\n          function onend() {\n            stream.removeListener(\"merge2UnpipeEnd\", onend);\n            stream.removeListener(\"end\", onend);\n            if (doPipeError) {\n              stream.removeListener(\"error\", onerror);\n            }\n            next();\n          }\n          function onerror(err) {\n            mergedStream.emit(\"error\", err);\n          }\n          if (stream._readableState.endEmitted) {\n            return next();\n          }\n          stream.on(\"merge2UnpipeEnd\", onend);\n          stream.on(\"end\", onend);\n          if (doPipeError) {\n            stream.on(\"error\", onerror);\n          }\n          stream.pipe(mergedStream, { end: false });\n          stream.resume();\n        }\n        for (let i = 0; i < streams.length; i++) {\n          pipe(streams[i]);\n        }\n        next();\n      }\n      function endStream2() {\n        merging = false;\n        mergedStream.emit(\"queueDrain\");\n        if (doEnd) {\n          mergedStream.end();\n        }\n      }\n      mergedStream.setMaxListeners(0);\n      mergedStream.add = addStream;\n      mergedStream.on(\"unpipe\", function(stream) {\n        stream.emit(\"merge2UnpipeEnd\");\n      });\n      if (args.length) {\n        addStream.apply(null, args);\n      }\n      return mergedStream;\n    }\n    function pauseStreams(streams, options) {\n      if (!Array.isArray(streams)) {\n        if (!streams._readableState && streams.pipe) {\n          streams = streams.pipe(PassThrough(options));\n        }\n        if (!streams._readableState || !streams.pause || !streams.pipe) {\n          throw new Error(\"Only readable stream can be merged.\");\n        }\n        streams.pause();\n      } else {\n        for (let i = 0, len = streams.length; i < len; i++) {\n          streams[i] = pauseStreams(streams[i], options);\n        }\n      }\n      return streams;\n    }\n  }\n});\n\n// node_modules/fast-glob/out/utils/stream.js\nvar require_stream = __commonJS({\n  \"node_modules/fast-glob/out/utils/stream.js\"(exports2) {\n    \"use strict\";\n    Object.defineProperty(exports2, \"__esModule\", { value: true });\n    exports2.merge = void 0;\n    var merge2 = require_merge2();\n    function merge3(streams) {\n      const mergedStream = merge2(streams);\n      streams.forEach((stream) => {\n        stream.once(\"error\", (error) => mergedStream.emit(\"error\", error));\n      });\n      mergedStream.once(\"close\", () => propagateCloseEventToSources(streams));\n      mergedStream.once(\"end\", () => propagateCloseEventToSources(streams));\n      return mergedStream;\n    }\n    exports2.merge = merge3;\n    function propagateCloseEventToSources(streams) {\n      streams.forEach((stream) => stream.emit(\"close\"));\n    }\n  }\n});\n\n// node_modules/fast-glob/out/utils/string.js\nvar require_string = __commonJS({\n  \"node_modules/fast-glob/out/utils/string.js\"(exports2) {\n    \"use strict\";\n    Object.defineProperty(exports2, \"__esModule\", { value: true });\n    exports2.isEmpty = exports2.isString = void 0;\n    function isString(input) {\n      return typeof input === \"string\";\n    }\n    exports2.isString = isString;\n    function isEmpty2(input) {\n      return input === \"\";\n    }\n    exports2.isEmpty = isEmpty2;\n  }\n});\n\n// node_modules/fast-glob/out/utils/index.js\nvar require_utils3 = __commonJS({\n  \"node_modules/fast-glob/out/utils/index.js\"(exports2) {\n    \"use strict\";\n    Object.defineProperty(exports2, \"__esModule\", { value: true });\n    exports2.string = exports2.stream = exports2.pattern = exports2.path = exports2.fs = exports2.errno = exports2.array = void 0;\n    var array = require_array();\n    exports2.array = array;\n    var errno = require_errno();\n    exports2.errno = errno;\n    var fs6 = require_fs();\n    exports2.fs = fs6;\n    var path5 = require_path();\n    exports2.path = path5;\n    var pattern = require_pattern();\n    exports2.pattern = pattern;\n    var stream = require_stream();\n    exports2.stream = stream;\n    var string2 = require_string();\n    exports2.string = string2;\n  }\n});\n\n// node_modules/fast-glob/out/managers/tasks.js\nvar require_tasks = __commonJS({\n  \"node_modules/fast-glob/out/managers/tasks.js\"(exports2) {\n    \"use strict\";\n    Object.defineProperty(exports2, \"__esModule\", { value: true });\n    exports2.convertPatternGroupToTask = exports2.convertPatternGroupsToTasks = exports2.groupPatternsByBaseDirectory = exports2.getNegativePatternsAsPositive = exports2.getPositivePatterns = exports2.convertPatternsToTasks = exports2.generate = void 0;\n    var utils = require_utils3();\n    function generate(input, settings) {\n      const patterns = processPatterns(input, settings);\n      const ignore = processPatterns(settings.ignore, settings);\n      const positivePatterns = getPositivePatterns(patterns);\n      const negativePatterns = getNegativePatternsAsPositive(patterns, ignore);\n      const staticPatterns = positivePatterns.filter((pattern) => utils.pattern.isStaticPattern(pattern, settings));\n      const dynamicPatterns = positivePatterns.filter((pattern) => utils.pattern.isDynamicPattern(pattern, settings));\n      const staticTasks = convertPatternsToTasks(\n        staticPatterns,\n        negativePatterns,\n        /* dynamic */\n        false\n      );\n      const dynamicTasks = convertPatternsToTasks(\n        dynamicPatterns,\n        negativePatterns,\n        /* dynamic */\n        true\n      );\n      return staticTasks.concat(dynamicTasks);\n    }\n    exports2.generate = generate;\n    function processPatterns(input, settings) {\n      let patterns = input;\n      if (settings.braceExpansion) {\n        patterns = utils.pattern.expandPatternsWithBraceExpansion(patterns);\n      }\n      if (settings.baseNameMatch) {\n        patterns = patterns.map((pattern) => pattern.includes(\"/\") ? pattern : `**/${pattern}`);\n      }\n      return patterns.map((pattern) => utils.pattern.removeDuplicateSlashes(pattern));\n    }\n    function convertPatternsToTasks(positive, negative, dynamic) {\n      const tasks = [];\n      const patternsOutsideCurrentDirectory = utils.pattern.getPatternsOutsideCurrentDirectory(positive);\n      const patternsInsideCurrentDirectory = utils.pattern.getPatternsInsideCurrentDirectory(positive);\n      const outsideCurrentDirectoryGroup = groupPatternsByBaseDirectory(patternsOutsideCurrentDirectory);\n      const insideCurrentDirectoryGroup = groupPatternsByBaseDirectory(patternsInsideCurrentDirectory);\n      tasks.push(...convertPatternGroupsToTasks(outsideCurrentDirectoryGroup, negative, dynamic));\n      if (\".\" in insideCurrentDirectoryGroup) {\n        tasks.push(convertPatternGroupToTask(\".\", patternsInsideCurrentDirectory, negative, dynamic));\n      } else {\n        tasks.push(...convertPatternGroupsToTasks(insideCurrentDirectoryGroup, negative, dynamic));\n      }\n      return tasks;\n    }\n    exports2.convertPatternsToTasks = convertPatternsToTasks;\n    function getPositivePatterns(patterns) {\n      return utils.pattern.getPositivePatterns(patterns);\n    }\n    exports2.getPositivePatterns = getPositivePatterns;\n    function getNegativePatternsAsPositive(patterns, ignore) {\n      const negative = utils.pattern.getNegativePatterns(patterns).concat(ignore);\n      const positive = negative.map(utils.pattern.convertToPositivePattern);\n      return positive;\n    }\n    exports2.getNegativePatternsAsPositive = getNegativePatternsAsPositive;\n    function groupPatternsByBaseDirectory(patterns) {\n      const group = {};\n      return patterns.reduce((collection, pattern) => {\n        const base = utils.pattern.getBaseDirectory(pattern);\n        if (base in collection) {\n          collection[base].push(pattern);\n        } else {\n          collection[base] = [pattern];\n        }\n        return collection;\n      }, group);\n    }\n    exports2.groupPatternsByBaseDirectory = groupPatternsByBaseDirectory;\n    function convertPatternGroupsToTasks(positive, negative, dynamic) {\n      return Object.keys(positive).map((base) => {\n        return convertPatternGroupToTask(base, positive[base], negative, dynamic);\n      });\n    }\n    exports2.convertPatternGroupsToTasks = convertPatternGroupsToTasks;\n    function convertPatternGroupToTask(base, positive, negative, dynamic) {\n      return {\n        dynamic,\n        positive,\n        negative,\n        base,\n        patterns: [].concat(positive, negative.map(utils.pattern.convertToNegativePattern))\n      };\n    }\n    exports2.convertPatternGroupToTask = convertPatternGroupToTask;\n  }\n});\n\n// node_modules/@nodelib/fs.stat/out/providers/async.js\nvar require_async = __commonJS({\n  \"node_modules/@nodelib/fs.stat/out/providers/async.js\"(exports2) {\n    \"use strict\";\n    Object.defineProperty(exports2, \"__esModule\", { value: true });\n    exports2.read = void 0;\n    function read(path5, settings, callback) {\n      settings.fs.lstat(path5, (lstatError, lstat) => {\n        if (lstatError !== null) {\n          callFailureCallback(callback, lstatError);\n          return;\n        }\n        if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) {\n          callSuccessCallback(callback, lstat);\n          return;\n        }\n        settings.fs.stat(path5, (statError, stat) => {\n          if (statError !== null) {\n            if (settings.throwErrorOnBrokenSymbolicLink) {\n              callFailureCallback(callback, statError);\n              return;\n            }\n            callSuccessCallback(callback, lstat);\n            return;\n          }\n          if (settings.markSymbolicLink) {\n            stat.isSymbolicLink = () => true;\n          }\n          callSuccessCallback(callback, stat);\n        });\n      });\n    }\n    exports2.read = read;\n    function callFailureCallback(callback, error) {\n      callback(error);\n    }\n    function callSuccessCallback(callback, result) {\n      callback(null, result);\n    }\n  }\n});\n\n// node_modules/@nodelib/fs.stat/out/providers/sync.js\nvar require_sync = __commonJS({\n  \"node_modules/@nodelib/fs.stat/out/providers/sync.js\"(exports2) {\n    \"use strict\";\n    Object.defineProperty(exports2, \"__esModule\", { value: true });\n    exports2.read = void 0;\n    function read(path5, settings) {\n      const lstat = settings.fs.lstatSync(path5);\n      if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) {\n        return lstat;\n      }\n      try {\n        const stat = settings.fs.statSync(path5);\n        if (settings.markSymbolicLink) {\n          stat.isSymbolicLink = () => true;\n        }\n        return stat;\n      } catch (error) {\n        if (!settings.throwErrorOnBrokenSymbolicLink) {\n          return lstat;\n        }\n        throw error;\n      }\n    }\n    exports2.read = read;\n  }\n});\n\n// node_modules/@nodelib/fs.stat/out/adapters/fs.js\nvar require_fs2 = __commonJS({\n  \"node_modules/@nodelib/fs.stat/out/adapters/fs.js\"(exports2) {\n    \"use strict\";\n    Object.defineProperty(exports2, \"__esModule\", { value: true });\n    exports2.createFileSystemAdapter = exports2.FILE_SYSTEM_ADAPTER = void 0;\n    var fs6 = require(\"fs\");\n    exports2.FILE_SYSTEM_ADAPTER = {\n      lstat: fs6.lstat,\n      stat: fs6.stat,\n      lstatSync: fs6.lstatSync,\n      statSync: fs6.statSync\n    };\n    function createFileSystemAdapter(fsMethods) {\n      if (fsMethods === void 0) {\n        return exports2.FILE_SYSTEM_ADAPTER;\n      }\n      return Object.assign(Object.assign({}, exports2.FILE_SYSTEM_ADAPTER), fsMethods);\n    }\n    exports2.createFileSystemAdapter = createFileSystemAdapter;\n  }\n});\n\n// node_modules/@nodelib/fs.stat/out/settings.js\nvar require_settings = __commonJS({\n  \"node_modules/@nodelib/fs.stat/out/settings.js\"(exports2) {\n    \"use strict\";\n    Object.defineProperty(exports2, \"__esModule\", { value: true });\n    var fs6 = require_fs2();\n    var Settings = class {\n      constructor(_options = {}) {\n        this._options = _options;\n        this.followSymbolicLink = this._getValue(this._options.followSymbolicLink, true);\n        this.fs = fs6.createFileSystemAdapter(this._options.fs);\n        this.markSymbolicLink = this._getValue(this._options.markSymbolicLink, false);\n        this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true);\n      }\n      _getValue(option, value) {\n        return option !== null && option !== void 0 ? option : value;\n      }\n    };\n    exports2.default = Settings;\n  }\n});\n\n// node_modules/@nodelib/fs.stat/out/index.js\nvar require_out = __commonJS({\n  \"node_modules/@nodelib/fs.stat/out/index.js\"(exports2) {\n    \"use strict\";\n    Object.defineProperty(exports2, \"__esModule\", { value: true });\n    exports2.statSync = exports2.stat = exports2.Settings = void 0;\n    var async = require_async();\n    var sync = require_sync();\n    var settings_1 = require_settings();\n    exports2.Settings = settings_1.default;\n    function stat(path5, optionsOrSettingsOrCallback, callback) {\n      if (typeof optionsOrSettingsOrCallback === \"function\") {\n        async.read(path5, getSettings(), optionsOrSettingsOrCallback);\n        return;\n      }\n      async.read(path5, getSettings(optionsOrSettingsOrCallback), callback);\n    }\n    exports2.stat = stat;\n    function statSync(path5, optionsOrSettings) {\n      const settings = getSettings(optionsOrSettings);\n      return sync.read(path5, settings);\n    }\n    exports2.statSync = statSync;\n    function getSettings(settingsOrOptions = {}) {\n      if (settingsOrOptions instanceof settings_1.default) {\n        return settingsOrOptions;\n      }\n      return new settings_1.default(settingsOrOptions);\n    }\n  }\n});\n\n// node_modules/queue-microtask/index.js\nvar require_queue_microtask = __commonJS({\n  \"node_modules/queue-microtask/index.js\"(exports2, module2) {\n    \"use strict\";\n    var promise;\n    module2.exports = typeof queueMicrotask === \"function\" ? queueMicrotask.bind(typeof window !== \"undefined\" ? window : global) : (cb) => (promise || (promise = Promise.resolve())).then(cb).catch((err) => setTimeout(() => {\n      throw err;\n    }, 0));\n  }\n});\n\n// node_modules/run-parallel/index.js\nvar require_run_parallel = __commonJS({\n  \"node_modules/run-parallel/index.js\"(exports2, module2) {\n    \"use strict\";\n    module2.exports = runParallel;\n    var queueMicrotask2 = require_queue_microtask();\n    function runParallel(tasks, cb) {\n      let results, pending, keys;\n      let isSync = true;\n      if (Array.isArray(tasks)) {\n        results = [];\n        pending = tasks.length;\n      } else {\n        keys = Object.keys(tasks);\n        results = {};\n        pending = keys.length;\n      }\n      function done(err) {\n        function end() {\n          if (cb) cb(err, results);\n          cb = null;\n        }\n        if (isSync) queueMicrotask2(end);\n        else end();\n      }\n      function each(i, err, result) {\n        results[i] = result;\n        if (--pending === 0 || err) {\n          done(err);\n        }\n      }\n      if (!pending) {\n        done(null);\n      } else if (keys) {\n        keys.forEach(function(key) {\n          tasks[key](function(err, result) {\n            each(key, err, result);\n          });\n        });\n      } else {\n        tasks.forEach(function(task, i) {\n          task(function(err, result) {\n            each(i, err, result);\n          });\n        });\n      }\n      isSync = false;\n    }\n  }\n});\n\n// node_modules/@nodelib/fs.scandir/out/constants.js\nvar require_constants3 = __commonJS({\n  \"node_modules/@nodelib/fs.scandir/out/constants.js\"(exports2) {\n    \"use strict\";\n    Object.defineProperty(exports2, \"__esModule\", { value: true });\n    exports2.IS_SUPPORT_READDIR_WITH_FILE_TYPES = void 0;\n    var NODE_PROCESS_VERSION_PARTS = process.versions.node.split(\".\");\n    if (NODE_PROCESS_VERSION_PARTS[0] === void 0 || NODE_PROCESS_VERSION_PARTS[1] === void 0) {\n      throw new Error(`Unexpected behavior. The 'process.versions.node' variable has invalid value: ${process.versions.node}`);\n    }\n    var MAJOR_VERSION = Number.parseInt(NODE_PROCESS_VERSION_PARTS[0], 10);\n    var MINOR_VERSION = Number.parseInt(NODE_PROCESS_VERSION_PARTS[1], 10);\n    var SUPPORTED_MAJOR_VERSION = 10;\n    var SUPPORTED_MINOR_VERSION = 10;\n    var IS_MATCHED_BY_MAJOR = MAJOR_VERSION > SUPPORTED_MAJOR_VERSION;\n    var IS_MATCHED_BY_MAJOR_AND_MINOR = MAJOR_VERSION === SUPPORTED_MAJOR_VERSION && MINOR_VERSION >= SUPPORTED_MINOR_VERSION;\n    exports2.IS_SUPPORT_READDIR_WITH_FILE_TYPES = IS_MATCHED_BY_MAJOR || IS_MATCHED_BY_MAJOR_AND_MINOR;\n  }\n});\n\n// node_modules/@nodelib/fs.scandir/out/utils/fs.js\nvar require_fs3 = __commonJS({\n  \"node_modules/@nodelib/fs.scandir/out/utils/fs.js\"(exports2) {\n    \"use strict\";\n    Object.defineProperty(exports2, \"__esModule\", { value: true });\n    exports2.createDirentFromStats = void 0;\n    var DirentFromStats = class {\n      constructor(name, stats) {\n        this.name = name;\n        this.isBlockDevice = stats.isBlockDevice.bind(stats);\n        this.isCharacterDevice = stats.isCharacterDevice.bind(stats);\n        this.isDirectory = stats.isDirectory.bind(stats);\n        this.isFIFO = stats.isFIFO.bind(stats);\n        this.isFile = stats.isFile.bind(stats);\n        this.isSocket = stats.isSocket.bind(stats);\n        this.isSymbolicLink = stats.isSymbolicLink.bind(stats);\n      }\n    };\n    function createDirentFromStats(name, stats) {\n      return new DirentFromStats(name, stats);\n    }\n    exports2.createDirentFromStats = createDirentFromStats;\n  }\n});\n\n// node_modules/@nodelib/fs.scandir/out/utils/index.js\nvar require_utils4 = __commonJS({\n  \"node_modules/@nodelib/fs.scandir/out/utils/index.js\"(exports2) {\n    \"use strict\";\n    Object.defineProperty(exports2, \"__esModule\", { value: true });\n    exports2.fs = void 0;\n    var fs6 = require_fs3();\n    exports2.fs = fs6;\n  }\n});\n\n// node_modules/@nodelib/fs.scandir/out/providers/common.js\nvar require_common = __commonJS({\n  \"node_modules/@nodelib/fs.scandir/out/providers/common.js\"(exports2) {\n    \"use strict\";\n    Object.defineProperty(exports2, \"__esModule\", { value: true });\n    exports2.joinPathSegments = void 0;\n    function joinPathSegments(a, b, separator) {\n      if (a.endsWith(separator)) {\n        return a + b;\n      }\n      return a + separator + b;\n    }\n    exports2.joinPathSegments = joinPathSegments;\n  }\n});\n\n// node_modules/@nodelib/fs.scandir/out/providers/async.js\nvar require_async2 = __commonJS({\n  \"node_modules/@nodelib/fs.scandir/out/providers/async.js\"(exports2) {\n    \"use strict\";\n    Object.defineProperty(exports2, \"__esModule\", { value: true });\n    exports2.readdir = exports2.readdirWithFileTypes = exports2.read = void 0;\n    var fsStat = require_out();\n    var rpl = require_run_parallel();\n    var constants_1 = require_constants3();\n    var utils = require_utils4();\n    var common = require_common();\n    function read(directory, settings, callback) {\n      if (!settings.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) {\n        readdirWithFileTypes(directory, settings, callback);\n        return;\n      }\n      readdir(directory, settings, callback);\n    }\n    exports2.read = read;\n    function readdirWithFileTypes(directory, settings, callback) {\n      settings.fs.readdir(directory, { withFileTypes: true }, (readdirError, dirents) => {\n        if (readdirError !== null) {\n          callFailureCallback(callback, readdirError);\n          return;\n        }\n        const entries = dirents.map((dirent) => ({\n          dirent,\n          name: dirent.name,\n          path: common.joinPathSegments(directory, dirent.name, settings.pathSegmentSeparator)\n        }));\n        if (!settings.followSymbolicLinks) {\n          callSuccessCallback(callback, entries);\n          return;\n        }\n        const tasks = entries.map((entry) => makeRplTaskEntry(entry, settings));\n        rpl(tasks, (rplError, rplEntries) => {\n          if (rplError !== null) {\n            callFailureCallback(callback, rplError);\n            return;\n          }\n          callSuccessCallback(callback, rplEntries);\n        });\n      });\n    }\n    exports2.readdirWithFileTypes = readdirWithFileTypes;\n    function makeRplTaskEntry(entry, settings) {\n      return (done) => {\n        if (!entry.dirent.isSymbolicLink()) {\n          done(null, entry);\n          return;\n        }\n        settings.fs.stat(entry.path, (statError, stats) => {\n          if (statError !== null) {\n            if (settings.throwErrorOnBrokenSymbolicLink) {\n              done(statError);\n              return;\n            }\n            done(null, entry);\n            return;\n          }\n          entry.dirent = utils.fs.createDirentFromStats(entry.name, stats);\n          done(null, entry);\n        });\n      };\n    }\n    function readdir(directory, settings, callback) {\n      settings.fs.readdir(directory, (readdirError, names) => {\n        if (readdirError !== null) {\n          callFailureCallback(callback, readdirError);\n          return;\n        }\n        const tasks = names.map((name) => {\n          const path5 = common.joinPathSegments(directory, name, settings.pathSegmentSeparator);\n          return (done) => {\n            fsStat.stat(path5, settings.fsStatSettings, (error, stats) => {\n              if (error !== null) {\n                done(error);\n                return;\n              }\n              const entry = {\n                name,\n                path: path5,\n                dirent: utils.fs.createDirentFromStats(name, stats)\n              };\n              if (settings.stats) {\n                entry.stats = stats;\n              }\n              done(null, entry);\n            });\n          };\n        });\n        rpl(tasks, (rplError, entries) => {\n          if (rplError !== null) {\n            callFailureCallback(callback, rplError);\n            return;\n          }\n          callSuccessCallback(callback, entries);\n        });\n      });\n    }\n    exports2.readdir = readdir;\n    function callFailureCallback(callback, error) {\n      callback(error);\n    }\n    function callSuccessCallback(callback, result) {\n      callback(null, result);\n    }\n  }\n});\n\n// node_modules/@nodelib/fs.scandir/out/providers/sync.js\nvar require_sync2 = __commonJS({\n  \"node_modules/@nodelib/fs.scandir/out/providers/sync.js\"(exports2) {\n    \"use strict\";\n    Object.defineProperty(exports2, \"__esModule\", { value: true });\n    exports2.readdir = exports2.readdirWithFileTypes = exports2.read = void 0;\n    var fsStat = require_out();\n    var constants_1 = require_constants3();\n    var utils = require_utils4();\n    var common = require_common();\n    function read(directory, settings) {\n      if (!settings.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) {\n        return readdirWithFileTypes(directory, settings);\n      }\n      return readdir(directory, settings);\n    }\n    exports2.read = read;\n    function readdirWithFileTypes(directory, settings) {\n      const dirents = settings.fs.readdirSync(directory, { withFileTypes: true });\n      return dirents.map((dirent) => {\n        const entry = {\n          dirent,\n          name: dirent.name,\n          path: common.joinPathSegments(directory, dirent.name, settings.pathSegmentSeparator)\n        };\n        if (entry.dirent.isSymbolicLink() && settings.followSymbolicLinks) {\n          try {\n            const stats = settings.fs.statSync(entry.path);\n            entry.dirent = utils.fs.createDirentFromStats(entry.name, stats);\n          } catch (error) {\n            if (settings.throwErrorOnBrokenSymbolicLink) {\n              throw error;\n            }\n          }\n        }\n        return entry;\n      });\n    }\n    exports2.readdirWithFileTypes = readdirWithFileTypes;\n    function readdir(directory, settings) {\n      const names = settings.fs.readdirSync(directory);\n      return names.map((name) => {\n        const entryPath = common.joinPathSegments(directory, name, settings.pathSegmentSeparator);\n        const stats = fsStat.statSync(entryPath, settings.fsStatSettings);\n        const entry = {\n          name,\n          path: entryPath,\n          dirent: utils.fs.createDirentFromStats(name, stats)\n        };\n        if (settings.stats) {\n          entry.stats = stats;\n        }\n        return entry;\n      });\n    }\n    exports2.readdir = readdir;\n  }\n});\n\n// node_modules/@nodelib/fs.scandir/out/adapters/fs.js\nvar require_fs4 = __commonJS({\n  \"node_modules/@nodelib/fs.scandir/out/adapters/fs.js\"(exports2) {\n    \"use strict\";\n    Object.defineProperty(exports2, \"__esModule\", { value: true });\n    exports2.createFileSystemAdapter = exports2.FILE_SYSTEM_ADAPTER = void 0;\n    var fs6 = require(\"fs\");\n    exports2.FILE_SYSTEM_ADAPTER = {\n      lstat: fs6.lstat,\n      stat: fs6.stat,\n      lstatSync: fs6.lstatSync,\n      statSync: fs6.statSync,\n      readdir: fs6.readdir,\n      readdirSync: fs6.readdirSync\n    };\n    function createFileSystemAdapter(fsMethods) {\n      if (fsMethods === void 0) {\n        return exports2.FILE_SYSTEM_ADAPTER;\n      }\n      return Object.assign(Object.assign({}, exports2.FILE_SYSTEM_ADAPTER), fsMethods);\n    }\n    exports2.createFileSystemAdapter = createFileSystemAdapter;\n  }\n});\n\n// node_modules/@nodelib/fs.scandir/out/settings.js\nvar require_settings2 = __commonJS({\n  \"node_modules/@nodelib/fs.scandir/out/settings.js\"(exports2) {\n    \"use strict\";\n    Object.defineProperty(exports2, \"__esModule\", { value: true });\n    var path5 = require(\"path\");\n    var fsStat = require_out();\n    var fs6 = require_fs4();\n    var Settings = class {\n      constructor(_options = {}) {\n        this._options = _options;\n        this.followSymbolicLinks = this._getValue(this._options.followSymbolicLinks, false);\n        this.fs = fs6.createFileSystemAdapter(this._options.fs);\n        this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path5.sep);\n        this.stats = this._getValue(this._options.stats, false);\n        this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true);\n        this.fsStatSettings = new fsStat.Settings({\n          followSymbolicLink: this.followSymbolicLinks,\n          fs: this.fs,\n          throwErrorOnBrokenSymbolicLink: this.throwErrorOnBrokenSymbolicLink\n        });\n      }\n      _getValue(option, value) {\n        return option !== null && option !== void 0 ? option : value;\n      }\n    };\n    exports2.default = Settings;\n  }\n});\n\n// node_modules/@nodelib/fs.scandir/out/index.js\nvar require_out2 = __commonJS({\n  \"node_modules/@nodelib/fs.scandir/out/index.js\"(exports2) {\n    \"use strict\";\n    Object.defineProperty(exports2, \"__esModule\", { value: true });\n    exports2.Settings = exports2.scandirSync = exports2.scandir = void 0;\n    var async = require_async2();\n    var sync = require_sync2();\n    var settings_1 = require_settings2();\n    exports2.Settings = settings_1.default;\n    function scandir(path5, optionsOrSettingsOrCallback, callback) {\n      if (typeof optionsOrSettingsOrCallback === \"function\") {\n        async.read(path5, getSettings(), optionsOrSettingsOrCallback);\n        return;\n      }\n      async.read(path5, getSettings(optionsOrSettingsOrCallback), callback);\n    }\n    exports2.scandir = scandir;\n    function scandirSync(path5, optionsOrSettings) {\n      const settings = getSettings(optionsOrSettings);\n      return sync.read(path5, settings);\n    }\n    exports2.scandirSync = scandirSync;\n    function getSettings(settingsOrOptions = {}) {\n      if (settingsOrOptions instanceof settings_1.default) {\n        return settingsOrOptions;\n      }\n      return new settings_1.default(settingsOrOptions);\n    }\n  }\n});\n\n// node_modules/reusify/reusify.js\nvar require_reusify = __commonJS({\n  \"node_modules/reusify/reusify.js\"(exports2, module2) {\n    \"use strict\";\n    function reusify(Constructor) {\n      var head = new Constructor();\n      var tail = head;\n      function get() {\n        var current = head;\n        if (current.next) {\n          head = current.next;\n        } else {\n          head = new Constructor();\n          tail = head;\n        }\n        current.next = null;\n        return current;\n      }\n      function release(obj) {\n        tail.next = obj;\n        tail = obj;\n      }\n      return {\n        get,\n        release\n      };\n    }\n    module2.exports = reusify;\n  }\n});\n\n// node_modules/fastq/queue.js\nvar require_queue = __commonJS({\n  \"node_modules/fastq/queue.js\"(exports2, module2) {\n    \"use strict\";\n    var reusify = require_reusify();\n    function fastqueue(context, worker, _concurrency) {\n      if (typeof context === \"function\") {\n        _concurrency = worker;\n        worker = context;\n        context = null;\n      }\n      if (!(_concurrency >= 1)) {\n        throw new Error(\"fastqueue concurrency must be equal to or greater than 1\");\n      }\n      var cache = reusify(Task);\n      var queueHead = null;\n      var queueTail = null;\n      var _running = 0;\n      var errorHandler = null;\n      var self2 = {\n        push,\n        drain: noop2,\n        saturated: noop2,\n        pause,\n        paused: false,\n        get concurrency() {\n          return _concurrency;\n        },\n        set concurrency(value) {\n          if (!(value >= 1)) {\n            throw new Error(\"fastqueue concurrency must be equal to or greater than 1\");\n          }\n          _concurrency = value;\n          if (self2.paused) return;\n          for (; queueHead && _running < _concurrency; ) {\n            _running++;\n            release();\n          }\n        },\n        running,\n        resume,\n        idle,\n        length,\n        getQueue,\n        unshift,\n        empty: noop2,\n        kill,\n        killAndDrain,\n        error,\n        abort\n      };\n      return self2;\n      function running() {\n        return _running;\n      }\n      function pause() {\n        self2.paused = true;\n      }\n      function length() {\n        var current = queueHead;\n        var counter = 0;\n        while (current) {\n          current = current.next;\n          counter++;\n        }\n        return counter;\n      }\n      function getQueue() {\n        var current = queueHead;\n        var tasks = [];\n        while (current) {\n          tasks.push(current.value);\n          current = current.next;\n        }\n        return tasks;\n      }\n      function resume() {\n        if (!self2.paused) return;\n        self2.paused = false;\n        if (queueHead === null) {\n          _running++;\n          release();\n          return;\n        }\n        for (; queueHead && _running < _concurrency; ) {\n          _running++;\n          release();\n        }\n      }\n      function idle() {\n        return _running === 0 && self2.length() === 0;\n      }\n      function push(value, done) {\n        var current = cache.get();\n        current.context = context;\n        current.release = release;\n        current.value = value;\n        current.callback = done || noop2;\n        current.errorHandler = errorHandler;\n        if (_running >= _concurrency || self2.paused) {\n          if (queueTail) {\n            queueTail.next = current;\n            queueTail = current;\n          } else {\n            queueHead = current;\n            queueTail = current;\n            self2.saturated();\n          }\n        } else {\n          _running++;\n          worker.call(context, current.value, current.worked);\n        }\n      }\n      function unshift(value, done) {\n        var current = cache.get();\n        current.context = context;\n        current.release = release;\n        current.value = value;\n        current.callback = done || noop2;\n        current.errorHandler = errorHandler;\n        if (_running >= _concurrency || self2.paused) {\n          if (queueHead) {\n            current.next = queueHead;\n            queueHead = current;\n          } else {\n            queueHead = current;\n            queueTail = current;\n            self2.saturated();\n          }\n        } else {\n          _running++;\n          worker.call(context, current.value, current.worked);\n        }\n      }\n      function release(holder) {\n        if (holder) {\n          cache.release(holder);\n        }\n        var next = queueHead;\n        if (next && _running <= _concurrency) {\n          if (!self2.paused) {\n            if (queueTail === queueHead) {\n              queueTail = null;\n            }\n            queueHead = next.next;\n            next.next = null;\n            worker.call(context, next.value, next.worked);\n            if (queueTail === null) {\n              self2.empty();\n            }\n          } else {\n            _running--;\n          }\n        } else if (--_running === 0) {\n          self2.drain();\n        }\n      }\n      function kill() {\n        queueHead = null;\n        queueTail = null;\n        self2.drain = noop2;\n      }\n      function killAndDrain() {\n        queueHead = null;\n        queueTail = null;\n        self2.drain();\n        self2.drain = noop2;\n      }\n      function abort() {\n        var current = queueHead;\n        queueHead = null;\n        queueTail = null;\n        while (current) {\n          var next = current.next;\n          var callback = current.callback;\n          var errorHandler2 = current.errorHandler;\n          var val = current.value;\n          var context2 = current.context;\n          current.value = null;\n          current.callback = noop2;\n          current.errorHandler = null;\n          if (errorHandler2) {\n            errorHandler2(new Error(\"abort\"), val);\n          }\n          callback.call(context2, new Error(\"abort\"));\n          current.release(current);\n          current = next;\n        }\n        self2.drain = noop2;\n      }\n      function error(handler) {\n        errorHandler = handler;\n      }\n    }\n    function noop2() {\n    }\n    function Task() {\n      this.value = null;\n      this.callback = noop2;\n      this.next = null;\n      this.release = noop2;\n      this.context = null;\n      this.errorHandler = null;\n      var self2 = this;\n      this.worked = function worked(err, result) {\n        var callback = self2.callback;\n        var errorHandler = self2.errorHandler;\n        var val = self2.value;\n        self2.value = null;\n        self2.callback = noop2;\n        if (self2.errorHandler) {\n          errorHandler(err, val);\n        }\n        callback.call(self2.context, err, result);\n        self2.release(self2);\n      };\n    }\n    function queueAsPromised(context, worker, _concurrency) {\n      if (typeof context === \"function\") {\n        _concurrency = worker;\n        worker = context;\n        context = null;\n      }\n      function asyncWrapper(arg, cb) {\n        worker.call(this, arg).then(function(res) {\n          cb(null, res);\n        }, cb);\n      }\n      var queue = fastqueue(context, asyncWrapper, _concurrency);\n      var pushCb = queue.push;\n      var unshiftCb = queue.unshift;\n      queue.push = push;\n      queue.unshift = unshift;\n      queue.drained = drained;\n      return queue;\n      function push(value) {\n        var p2 = new Promise(function(resolve, reject) {\n          pushCb(value, function(err, result) {\n            if (err) {\n              reject(err);\n              return;\n            }\n            resolve(result);\n          });\n        });\n        p2.catch(noop2);\n        return p2;\n      }\n      function unshift(value) {\n        var p2 = new Promise(function(resolve, reject) {\n          unshiftCb(value, function(err, result) {\n            if (err) {\n              reject(err);\n              return;\n            }\n            resolve(result);\n          });\n        });\n        p2.catch(noop2);\n        return p2;\n      }\n      function drained() {\n        var p2 = new Promise(function(resolve) {\n          process.nextTick(function() {\n            if (queue.idle()) {\n              resolve();\n            } else {\n              var previousDrain = queue.drain;\n              queue.drain = function() {\n                if (typeof previousDrain === \"function\") previousDrain();\n                resolve();\n                queue.drain = previousDrain;\n              };\n            }\n          });\n        });\n        return p2;\n      }\n    }\n    module2.exports = fastqueue;\n    module2.exports.promise = queueAsPromised;\n  }\n});\n\n// node_modules/@nodelib/fs.walk/out/readers/common.js\nvar require_common2 = __commonJS({\n  \"node_modules/@nodelib/fs.walk/out/readers/common.js\"(exports2) {\n    \"use strict\";\n    Object.defineProperty(exports2, \"__esModule\", { value: true });\n    exports2.joinPathSegments = exports2.replacePathSegmentSeparator = exports2.isAppliedFilter = exports2.isFatalError = void 0;\n    function isFatalError(settings, error) {\n      if (settings.errorFilter === null) {\n        return true;\n      }\n      return !settings.errorFilter(error);\n    }\n    exports2.isFatalError = isFatalError;\n    function isAppliedFilter(filter, value) {\n      return filter === null || filter(value);\n    }\n    exports2.isAppliedFilter = isAppliedFilter;\n    function replacePathSegmentSeparator(filepath, separator) {\n      return filepath.split(/[/\\\\]/).join(separator);\n    }\n    exports2.replacePathSegmentSeparator = replacePathSegmentSeparator;\n    function joinPathSegments(a, b, separator) {\n      if (a === \"\") {\n        return b;\n      }\n      if (a.endsWith(separator)) {\n        return a + b;\n      }\n      return a + separator + b;\n    }\n    exports2.joinPathSegments = joinPathSegments;\n  }\n});\n\n// node_modules/@nodelib/fs.walk/out/readers/reader.js\nvar require_reader = __commonJS({\n  \"node_modules/@nodelib/fs.walk/out/readers/reader.js\"(exports2) {\n    \"use strict\";\n    Object.defineProperty(exports2, \"__esModule\", { value: true });\n    var common = require_common2();\n    var Reader = class {\n      constructor(_root, _settings) {\n        this._root = _root;\n        this._settings = _settings;\n        this._root = common.replacePathSegmentSeparator(_root, _settings.pathSegmentSeparator);\n      }\n    };\n    exports2.default = Reader;\n  }\n});\n\n// node_modules/@nodelib/fs.walk/out/readers/async.js\nvar require_async3 = __commonJS({\n  \"node_modules/@nodelib/fs.walk/out/readers/async.js\"(exports2) {\n    \"use strict\";\n    Object.defineProperty(exports2, \"__esModule\", { value: true });\n    var events_1 = require(\"events\");\n    var fsScandir = require_out2();\n    var fastq = require_queue();\n    var common = require_common2();\n    var reader_1 = require_reader();\n    var AsyncReader = class extends reader_1.default {\n      constructor(_root, _settings) {\n        super(_root, _settings);\n        this._settings = _settings;\n        this._scandir = fsScandir.scandir;\n        this._emitter = new events_1.EventEmitter();\n        this._queue = fastq(this._worker.bind(this), this._settings.concurrency);\n        this._isFatalError = false;\n        this._isDestroyed = false;\n        this._queue.drain = () => {\n          if (!this._isFatalError) {\n            this._emitter.emit(\"end\");\n          }\n        };\n      }\n      read() {\n        this._isFatalError = false;\n        this._isDestroyed = false;\n        setImmediate(() => {\n          this._pushToQueue(this._root, this._settings.basePath);\n        });\n        return this._emitter;\n      }\n      get isDestroyed() {\n        return this._isDestroyed;\n      }\n      destroy() {\n        if (this._isDestroyed) {\n          throw new Error(\"The reader is already destroyed\");\n        }\n        this._isDestroyed = true;\n        this._queue.killAndDrain();\n      }\n      onEntry(callback) {\n        this._emitter.on(\"entry\", callback);\n      }\n      onError(callback) {\n        this._emitter.once(\"error\", callback);\n      }\n      onEnd(callback) {\n        this._emitter.once(\"end\", callback);\n      }\n      _pushToQueue(directory, base) {\n        const queueItem = { directory, base };\n        this._queue.push(queueItem, (error) => {\n          if (error !== null) {\n            this._handleError(error);\n          }\n        });\n      }\n      _worker(item, done) {\n        this._scandir(item.directory, this._settings.fsScandirSettings, (error, entries) => {\n          if (error !== null) {\n            done(error, void 0);\n            return;\n          }\n          for (const entry of entries) {\n            this._handleEntry(entry, item.base);\n          }\n          done(null, void 0);\n        });\n      }\n      _handleError(error) {\n        if (this._isDestroyed || !common.isFatalError(this._settings, error)) {\n          return;\n        }\n        this._isFatalError = true;\n        this._isDestroyed = true;\n        this._emitter.emit(\"error\", error);\n      }\n      _handleEntry(entry, base) {\n        if (this._isDestroyed || this._isFatalError) {\n          return;\n        }\n        const fullpath = entry.path;\n        if (base !== void 0) {\n          entry.path = common.joinPathSegments(base, entry.name, this._settings.pathSegmentSeparator);\n        }\n        if (common.isAppliedFilter(this._settings.entryFilter, entry)) {\n          this._emitEntry(entry);\n        }\n        if (entry.dirent.isDirectory() && common.isAppliedFilter(this._settings.deepFilter, entry)) {\n          this._pushToQueue(fullpath, base === void 0 ? void 0 : entry.path);\n        }\n      }\n      _emitEntry(entry) {\n        this._emitter.emit(\"entry\", entry);\n      }\n    };\n    exports2.default = AsyncReader;\n  }\n});\n\n// node_modules/@nodelib/fs.walk/out/providers/async.js\nvar require_async4 = __commonJS({\n  \"node_modules/@nodelib/fs.walk/out/providers/async.js\"(exports2) {\n    \"use strict\";\n    Object.defineProperty(exports2, \"__esModule\", { value: true });\n    var async_1 = require_async3();\n    var AsyncProvider = class {\n      constructor(_root, _settings) {\n        this._root = _root;\n        this._settings = _settings;\n        this._reader = new async_1.default(this._root, this._settings);\n        this._storage = [];\n      }\n      read(callback) {\n        this._reader.onError((error) => {\n          callFailureCallback(callback, error);\n        });\n        this._reader.onEntry((entry) => {\n          this._storage.push(entry);\n        });\n        this._reader.onEnd(() => {\n          callSuccessCallback(callback, this._storage);\n        });\n        this._reader.read();\n      }\n    };\n    exports2.default = AsyncProvider;\n    function callFailureCallback(callback, error) {\n      callback(error);\n    }\n    function callSuccessCallback(callback, entries) {\n      callback(null, entries);\n    }\n  }\n});\n\n// node_modules/@nodelib/fs.walk/out/providers/stream.js\nvar require_stream2 = __commonJS({\n  \"node_modules/@nodelib/fs.walk/out/providers/stream.js\"(exports2) {\n    \"use strict\";\n    Object.defineProperty(exports2, \"__esModule\", { value: true });\n    var stream_1 = require(\"stream\");\n    var async_1 = require_async3();\n    var StreamProvider = class {\n      constructor(_root, _settings) {\n        this._root = _root;\n        this._settings = _settings;\n        this._reader = new async_1.default(this._root, this._settings);\n        this._stream = new stream_1.Readable({\n          objectMode: true,\n          read: () => {\n          },\n          destroy: () => {\n            if (!this._reader.isDestroyed) {\n              this._reader.destroy();\n            }\n          }\n        });\n      }\n      read() {\n        this._reader.onError((error) => {\n          this._stream.emit(\"error\", error);\n        });\n        this._reader.onEntry((entry) => {\n          this._stream.push(entry);\n        });\n        this._reader.onEnd(() => {\n          this._stream.push(null);\n        });\n        this._reader.read();\n        return this._stream;\n      }\n    };\n    exports2.default = StreamProvider;\n  }\n});\n\n// node_modules/@nodelib/fs.walk/out/readers/sync.js\nvar require_sync3 = __commonJS({\n  \"node_modules/@nodelib/fs.walk/out/readers/sync.js\"(exports2) {\n    \"use strict\";\n    Object.defineProperty(exports2, \"__esModule\", { value: true });\n    var fsScandir = require_out2();\n    var common = require_common2();\n    var reader_1 = require_reader();\n    var SyncReader = class extends reader_1.default {\n      constructor() {\n        super(...arguments);\n        this._scandir = fsScandir.scandirSync;\n        this._storage = [];\n        this._queue = /* @__PURE__ */ new Set();\n      }\n      read() {\n        this._pushToQueue(this._root, this._settings.basePath);\n        this._handleQueue();\n        return this._storage;\n      }\n      _pushToQueue(directory, base) {\n        this._queue.add({ directory, base });\n      }\n      _handleQueue() {\n        for (const item of this._queue.values()) {\n          this._handleDirectory(item.directory, item.base);\n        }\n      }\n      _handleDirectory(directory, base) {\n        try {\n          const entries = this._scandir(directory, this._settings.fsScandirSettings);\n          for (const entry of entries) {\n            this._handleEntry(entry, base);\n          }\n        } catch (error) {\n          this._handleError(error);\n        }\n      }\n      _handleError(error) {\n        if (!common.isFatalError(this._settings, error)) {\n          return;\n        }\n        throw error;\n      }\n      _handleEntry(entry, base) {\n        const fullpath = entry.path;\n        if (base !== void 0) {\n          entry.path = common.joinPathSegments(base, entry.name, this._settings.pathSegmentSeparator);\n        }\n        if (common.isAppliedFilter(this._settings.entryFilter, entry)) {\n          this._pushToStorage(entry);\n        }\n        if (entry.dirent.isDirectory() && common.isAppliedFilter(this._settings.deepFilter, entry)) {\n          this._pushToQueue(fullpath, base === void 0 ? void 0 : entry.path);\n        }\n      }\n      _pushToStorage(entry) {\n        this._storage.push(entry);\n      }\n    };\n    exports2.default = SyncReader;\n  }\n});\n\n// node_modules/@nodelib/fs.walk/out/providers/sync.js\nvar require_sync4 = __commonJS({\n  \"node_modules/@nodelib/fs.walk/out/providers/sync.js\"(exports2) {\n    \"use strict\";\n    Object.defineProperty(exports2, \"__esModule\", { value: true });\n    var sync_1 = require_sync3();\n    var SyncProvider = class {\n      constructor(_root, _settings) {\n        this._root = _root;\n        this._settings = _settings;\n        this._reader = new sync_1.default(this._root, this._settings);\n      }\n      read() {\n        return this._reader.read();\n      }\n    };\n    exports2.default = SyncProvider;\n  }\n});\n\n// node_modules/@nodelib/fs.walk/out/settings.js\nvar require_settings3 = __commonJS({\n  \"node_modules/@nodelib/fs.walk/out/settings.js\"(exports2) {\n    \"use strict\";\n    Object.defineProperty(exports2, \"__esModule\", { value: true });\n    var path5 = require(\"path\");\n    var fsScandir = require_out2();\n    var Settings = class {\n      constructor(_options = {}) {\n        this._options = _options;\n        this.basePath = this._getValue(this._options.basePath, void 0);\n        this.concurrency = this._getValue(this._options.concurrency, Number.POSITIVE_INFINITY);\n        this.deepFilter = this._getValue(this._options.deepFilter, null);\n        this.entryFilter = this._getValue(this._options.entryFilter, null);\n        this.errorFilter = this._getValue(this._options.errorFilter, null);\n        this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path5.sep);\n        this.fsScandirSettings = new fsScandir.Settings({\n          followSymbolicLinks: this._options.followSymbolicLinks,\n          fs: this._options.fs,\n          pathSegmentSeparator: this._options.pathSegmentSeparator,\n          stats: this._options.stats,\n          throwErrorOnBrokenSymbolicLink: this._options.throwErrorOnBrokenSymbolicLink\n        });\n      }\n      _getValue(option, value) {\n        return option !== null && option !== void 0 ? option : value;\n      }\n    };\n    exports2.default = Settings;\n  }\n});\n\n// node_modules/@nodelib/fs.walk/out/index.js\nvar require_out3 = __commonJS({\n  \"node_modules/@nodelib/fs.walk/out/index.js\"(exports2) {\n    \"use strict\";\n    Object.defineProperty(exports2, \"__esModule\", { value: true });\n    exports2.Settings = exports2.walkStream = exports2.walkSync = exports2.walk = void 0;\n    var async_1 = require_async4();\n    var stream_1 = require_stream2();\n    var sync_1 = require_sync4();\n    var settings_1 = require_settings3();\n    exports2.Settings = settings_1.default;\n    function walk(directory, optionsOrSettingsOrCallback, callback) {\n      if (typeof optionsOrSettingsOrCallback === \"function\") {\n        new async_1.default(directory, getSettings()).read(optionsOrSettingsOrCallback);\n        return;\n      }\n      new async_1.default(directory, getSettings(optionsOrSettingsOrCallback)).read(callback);\n    }\n    exports2.walk = walk;\n    function walkSync(directory, optionsOrSettings) {\n      const settings = getSettings(optionsOrSettings);\n      const provider = new sync_1.default(directory, settings);\n      return provider.read();\n    }\n    exports2.walkSync = walkSync;\n    function walkStream(directory, optionsOrSettings) {\n      const settings = getSettings(optionsOrSettings);\n      const provider = new stream_1.default(directory, settings);\n      return provider.read();\n    }\n    exports2.walkStream = walkStream;\n    function getSettings(settingsOrOptions = {}) {\n      if (settingsOrOptions instanceof settings_1.default) {\n        return settingsOrOptions;\n      }\n      return new settings_1.default(settingsOrOptions);\n    }\n  }\n});\n\n// node_modules/fast-glob/out/readers/reader.js\nvar require_reader2 = __commonJS({\n  \"node_modules/fast-glob/out/readers/reader.js\"(exports2) {\n    \"use strict\";\n    Object.defineProperty(exports2, \"__esModule\", { value: true });\n    var path5 = require(\"path\");\n    var fsStat = require_out();\n    var utils = require_utils3();\n    var Reader = class {\n      constructor(_settings) {\n        this._settings = _settings;\n        this._fsStatSettings = new fsStat.Settings({\n          followSymbolicLink: this._settings.followSymbolicLinks,\n          fs: this._settings.fs,\n          throwErrorOnBrokenSymbolicLink: this._settings.followSymbolicLinks\n        });\n      }\n      _getFullEntryPath(filepath) {\n        return path5.resolve(this._settings.cwd, filepath);\n      }\n      _makeEntry(stats, pattern) {\n        const entry = {\n          name: pattern,\n          path: pattern,\n          dirent: utils.fs.createDirentFromStats(pattern, stats)\n        };\n        if (this._settings.stats) {\n          entry.stats = stats;\n        }\n        return entry;\n      }\n      _isFatalError(error) {\n        return !utils.errno.isEnoentCodeError(error) && !this._settings.suppressErrors;\n      }\n    };\n    exports2.default = Reader;\n  }\n});\n\n// node_modules/fast-glob/out/readers/stream.js\nvar require_stream3 = __commonJS({\n  \"node_modules/fast-glob/out/readers/stream.js\"(exports2) {\n    \"use strict\";\n    Object.defineProperty(exports2, \"__esModule\", { value: true });\n    var stream_1 = require(\"stream\");\n    var fsStat = require_out();\n    var fsWalk = require_out3();\n    var reader_1 = require_reader2();\n    var ReaderStream = class extends reader_1.default {\n      constructor() {\n        super(...arguments);\n        this._walkStream = fsWalk.walkStream;\n        this._stat = fsStat.stat;\n      }\n      dynamic(root, options) {\n        return this._walkStream(root, options);\n      }\n      static(patterns, options) {\n        const filepaths = patterns.map(this._getFullEntryPath, this);\n        const stream = new stream_1.PassThrough({ objectMode: true });\n        stream._write = (index, _enc, done) => {\n          return this._getEntry(filepaths[index], patterns[index], options).then((entry) => {\n            if (entry !== null && options.entryFilter(entry)) {\n              stream.push(entry);\n            }\n            if (index === filepaths.length - 1) {\n              stream.end();\n            }\n            done();\n          }).catch(done);\n        };\n        for (let i = 0; i < filepaths.length; i++) {\n          stream.write(i);\n        }\n        return stream;\n      }\n      _getEntry(filepath, pattern, options) {\n        return this._getStat(filepath).then((stats) => this._makeEntry(stats, pattern)).catch((error) => {\n          if (options.errorFilter(error)) {\n            return null;\n          }\n          throw error;\n        });\n      }\n      _getStat(filepath) {\n        return new Promise((resolve, reject) => {\n          this._stat(filepath, this._fsStatSettings, (error, stats) => {\n            return error === null ? resolve(stats) : reject(error);\n          });\n        });\n      }\n    };\n    exports2.default = ReaderStream;\n  }\n});\n\n// node_modules/fast-glob/out/readers/async.js\nvar require_async5 = __commonJS({\n  \"node_modules/fast-glob/out/readers/async.js\"(exports2) {\n    \"use strict\";\n    Object.defineProperty(exports2, \"__esModule\", { value: true });\n    var fsWalk = require_out3();\n    var reader_1 = require_reader2();\n    var stream_1 = require_stream3();\n    var ReaderAsync = class extends reader_1.default {\n      constructor() {\n        super(...arguments);\n        this._walkAsync = fsWalk.walk;\n        this._readerStream = new stream_1.default(this._settings);\n      }\n      dynamic(root, options) {\n        return new Promise((resolve, reject) => {\n          this._walkAsync(root, options, (error, entries) => {\n            if (error === null) {\n              resolve(entries);\n            } else {\n              reject(error);\n            }\n          });\n        });\n      }\n      static(patterns, options) {\n        return __async(this, null, function* () {\n          const entries = [];\n          const stream = this._readerStream.static(patterns, options);\n          return new Promise((resolve, reject) => {\n            stream.once(\"error\", reject);\n            stream.on(\"data\", (entry) => entries.push(entry));\n            stream.once(\"end\", () => resolve(entries));\n          });\n        });\n      }\n    };\n    exports2.default = ReaderAsync;\n  }\n});\n\n// node_modules/fast-glob/out/providers/matchers/matcher.js\nvar require_matcher = __commonJS({\n  \"node_modules/fast-glob/out/providers/matchers/matcher.js\"(exports2) {\n    \"use strict\";\n    Object.defineProperty(exports2, \"__esModule\", { value: true });\n    var utils = require_utils3();\n    var Matcher = class {\n      constructor(_patterns, _settings, _micromatchOptions) {\n        this._patterns = _patterns;\n        this._settings = _settings;\n        this._micromatchOptions = _micromatchOptions;\n        this._storage = [];\n        this._fillStorage();\n      }\n      _fillStorage() {\n        for (const pattern of this._patterns) {\n          const segments = this._getPatternSegments(pattern);\n          const sections = this._splitSegmentsIntoSections(segments);\n          this._storage.push({\n            complete: sections.length <= 1,\n            pattern,\n            segments,\n            sections\n          });\n        }\n      }\n      _getPatternSegments(pattern) {\n        const parts = utils.pattern.getPatternParts(pattern, this._micromatchOptions);\n        return parts.map((part) => {\n          const dynamic = utils.pattern.isDynamicPattern(part, this._settings);\n          if (!dynamic) {\n            return {\n              dynamic: false,\n              pattern: part\n            };\n          }\n          return {\n            dynamic: true,\n            pattern: part,\n            patternRe: utils.pattern.makeRe(part, this._micromatchOptions)\n          };\n        });\n      }\n      _splitSegmentsIntoSections(segments) {\n        return utils.array.splitWhen(segments, (segment) => segment.dynamic && utils.pattern.hasGlobStar(segment.pattern));\n      }\n    };\n    exports2.default = Matcher;\n  }\n});\n\n// node_modules/fast-glob/out/providers/matchers/partial.js\nvar require_partial = __commonJS({\n  \"node_modules/fast-glob/out/providers/matchers/partial.js\"(exports2) {\n    \"use strict\";\n    Object.defineProperty(exports2, \"__esModule\", { value: true });\n    var matcher_1 = require_matcher();\n    var PartialMatcher = class extends matcher_1.default {\n      match(filepath) {\n        const parts = filepath.split(\"/\");\n        const levels = parts.length;\n        const patterns = this._storage.filter((info) => !info.complete || info.segments.length > levels);\n        for (const pattern of patterns) {\n          const section = pattern.sections[0];\n          if (!pattern.complete && levels > section.length) {\n            return true;\n          }\n          const match = parts.every((part, index) => {\n            const segment = pattern.segments[index];\n            if (segment.dynamic && segment.patternRe.test(part)) {\n              return true;\n            }\n            if (!segment.dynamic && segment.pattern === part) {\n              return true;\n            }\n            return false;\n          });\n          if (match) {\n            return true;\n          }\n        }\n        return false;\n      }\n    };\n    exports2.default = PartialMatcher;\n  }\n});\n\n// node_modules/fast-glob/out/providers/filters/deep.js\nvar require_deep = __commonJS({\n  \"node_modules/fast-glob/out/providers/filters/deep.js\"(exports2) {\n    \"use strict\";\n    Object.defineProperty(exports2, \"__esModule\", { value: true });\n    var utils = require_utils3();\n    var partial_1 = require_partial();\n    var DeepFilter = class {\n      constructor(_settings, _micromatchOptions) {\n        this._settings = _settings;\n        this._micromatchOptions = _micromatchOptions;\n      }\n      getFilter(basePath, positive, negative) {\n        const matcher = this._getMatcher(positive);\n        const negativeRe = this._getNegativePatternsRe(negative);\n        return (entry) => this._filter(basePath, entry, matcher, negativeRe);\n      }\n      _getMatcher(patterns) {\n        return new partial_1.default(patterns, this._settings, this._micromatchOptions);\n      }\n      _getNegativePatternsRe(patterns) {\n        const affectDepthOfReadingPatterns = patterns.filter(utils.pattern.isAffectDepthOfReadingPattern);\n        return utils.pattern.convertPatternsToRe(affectDepthOfReadingPatterns, this._micromatchOptions);\n      }\n      _filter(basePath, entry, matcher, negativeRe) {\n        if (this._isSkippedByDeep(basePath, entry.path)) {\n          return false;\n        }\n        if (this._isSkippedSymbolicLink(entry)) {\n          return false;\n        }\n        const filepath = utils.path.removeLeadingDotSegment(entry.path);\n        if (this._isSkippedByPositivePatterns(filepath, matcher)) {\n          return false;\n        }\n        return this._isSkippedByNegativePatterns(filepath, negativeRe);\n      }\n      _isSkippedByDeep(basePath, entryPath) {\n        if (this._settings.deep === Infinity) {\n          return false;\n        }\n        return this._getEntryLevel(basePath, entryPath) >= this._settings.deep;\n      }\n      _getEntryLevel(basePath, entryPath) {\n        const entryPathDepth = entryPath.split(\"/\").length;\n        if (basePath === \"\") {\n          return entryPathDepth;\n        }\n        const basePathDepth = basePath.split(\"/\").length;\n        return entryPathDepth - basePathDepth;\n      }\n      _isSkippedSymbolicLink(entry) {\n        return !this._settings.followSymbolicLinks && entry.dirent.isSymbolicLink();\n      }\n      _isSkippedByPositivePatterns(entryPath, matcher) {\n        return !this._settings.baseNameMatch && !matcher.match(entryPath);\n      }\n      _isSkippedByNegativePatterns(entryPath, patternsRe) {\n        return !utils.pattern.matchAny(entryPath, patternsRe);\n      }\n    };\n    exports2.default = DeepFilter;\n  }\n});\n\n// node_modules/fast-glob/out/providers/filters/entry.js\nvar require_entry = __commonJS({\n  \"node_modules/fast-glob/out/providers/filters/entry.js\"(exports2) {\n    \"use strict\";\n    Object.defineProperty(exports2, \"__esModule\", { value: true });\n    var utils = require_utils3();\n    var EntryFilter = class {\n      constructor(_settings, _micromatchOptions) {\n        this._settings = _settings;\n        this._micromatchOptions = _micromatchOptions;\n        this.index = /* @__PURE__ */ new Map();\n      }\n      getFilter(positive, negative) {\n        const [absoluteNegative, relativeNegative] = utils.pattern.partitionAbsoluteAndRelative(negative);\n        const patterns = {\n          positive: {\n            all: utils.pattern.convertPatternsToRe(positive, this._micromatchOptions)\n          },\n          negative: {\n            absolute: utils.pattern.convertPatternsToRe(absoluteNegative, Object.assign(Object.assign({}, this._micromatchOptions), { dot: true })),\n            relative: utils.pattern.convertPatternsToRe(relativeNegative, Object.assign(Object.assign({}, this._micromatchOptions), { dot: true }))\n          }\n        };\n        return (entry) => this._filter(entry, patterns);\n      }\n      _filter(entry, patterns) {\n        const filepath = utils.path.removeLeadingDotSegment(entry.path);\n        if (this._settings.unique && this._isDuplicateEntry(filepath)) {\n          return false;\n        }\n        if (this._onlyFileFilter(entry) || this._onlyDirectoryFilter(entry)) {\n          return false;\n        }\n        const isMatched = this._isMatchToPatternsSet(filepath, patterns, entry.dirent.isDirectory());\n        if (this._settings.unique && isMatched) {\n          this._createIndexRecord(filepath);\n        }\n        return isMatched;\n      }\n      _isDuplicateEntry(filepath) {\n        return this.index.has(filepath);\n      }\n      _createIndexRecord(filepath) {\n        this.index.set(filepath, void 0);\n      }\n      _onlyFileFilter(entry) {\n        return this._settings.onlyFiles && !entry.dirent.isFile();\n      }\n      _onlyDirectoryFilter(entry) {\n        return this._settings.onlyDirectories && !entry.dirent.isDirectory();\n      }\n      _isMatchToPatternsSet(filepath, patterns, isDirectory2) {\n        const isMatched = this._isMatchToPatterns(filepath, patterns.positive.all, isDirectory2);\n        if (!isMatched) {\n          return false;\n        }\n        const isMatchedByRelativeNegative = this._isMatchToPatterns(filepath, patterns.negative.relative, isDirectory2);\n        if (isMatchedByRelativeNegative) {\n          return false;\n        }\n        const isMatchedByAbsoluteNegative = this._isMatchToAbsoluteNegative(filepath, patterns.negative.absolute, isDirectory2);\n        if (isMatchedByAbsoluteNegative) {\n          return false;\n        }\n        return true;\n      }\n      _isMatchToAbsoluteNegative(filepath, patternsRe, isDirectory2) {\n        if (patternsRe.length === 0) {\n          return false;\n        }\n        const fullpath = utils.path.makeAbsolute(this._settings.cwd, filepath);\n        return this._isMatchToPatterns(fullpath, patternsRe, isDirectory2);\n      }\n      _isMatchToPatterns(filepath, patternsRe, isDirectory2) {\n        if (patternsRe.length === 0) {\n          return false;\n        }\n        const isMatched = utils.pattern.matchAny(filepath, patternsRe);\n        if (!isMatched && isDirectory2) {\n          return utils.pattern.matchAny(filepath + \"/\", patternsRe);\n        }\n        return isMatched;\n      }\n    };\n    exports2.default = EntryFilter;\n  }\n});\n\n// node_modules/fast-glob/out/providers/filters/error.js\nvar require_error = __commonJS({\n  \"node_modules/fast-glob/out/providers/filters/error.js\"(exports2) {\n    \"use strict\";\n    Object.defineProperty(exports2, \"__esModule\", { value: true });\n    var utils = require_utils3();\n    var ErrorFilter = class {\n      constructor(_settings) {\n        this._settings = _settings;\n      }\n      getFilter() {\n        return (error) => this._isNonFatalError(error);\n      }\n      _isNonFatalError(error) {\n        return utils.errno.isEnoentCodeError(error) || this._settings.suppressErrors;\n      }\n    };\n    exports2.default = ErrorFilter;\n  }\n});\n\n// node_modules/fast-glob/out/providers/transformers/entry.js\nvar require_entry2 = __commonJS({\n  \"node_modules/fast-glob/out/providers/transformers/entry.js\"(exports2) {\n    \"use strict\";\n    Object.defineProperty(exports2, \"__esModule\", { value: true });\n    var utils = require_utils3();\n    var EntryTransformer = class {\n      constructor(_settings) {\n        this._settings = _settings;\n      }\n      getTransformer() {\n        return (entry) => this._transform(entry);\n      }\n      _transform(entry) {\n        let filepath = entry.path;\n        if (this._settings.absolute) {\n          filepath = utils.path.makeAbsolute(this._settings.cwd, filepath);\n          filepath = utils.path.unixify(filepath);\n        }\n        if (this._settings.markDirectories && entry.dirent.isDirectory()) {\n          filepath += \"/\";\n        }\n        if (!this._settings.objectMode) {\n          return filepath;\n        }\n        return Object.assign(Object.assign({}, entry), { path: filepath });\n      }\n    };\n    exports2.default = EntryTransformer;\n  }\n});\n\n// node_modules/fast-glob/out/providers/provider.js\nvar require_provider = __commonJS({\n  \"node_modules/fast-glob/out/providers/provider.js\"(exports2) {\n    \"use strict\";\n    Object.defineProperty(exports2, \"__esModule\", { value: true });\n    var path5 = require(\"path\");\n    var deep_1 = require_deep();\n    var entry_1 = require_entry();\n    var error_1 = require_error();\n    var entry_2 = require_entry2();\n    var Provider = class {\n      constructor(_settings) {\n        this._settings = _settings;\n        this.errorFilter = new error_1.default(this._settings);\n        this.entryFilter = new entry_1.default(this._settings, this._getMicromatchOptions());\n        this.deepFilter = new deep_1.default(this._settings, this._getMicromatchOptions());\n        this.entryTransformer = new entry_2.default(this._settings);\n      }\n      _getRootDirectory(task) {\n        return path5.resolve(this._settings.cwd, task.base);\n      }\n      _getReaderOptions(task) {\n        const basePath = task.base === \".\" ? \"\" : task.base;\n        return {\n          basePath,\n          pathSegmentSeparator: \"/\",\n          concurrency: this._settings.concurrency,\n          deepFilter: this.deepFilter.getFilter(basePath, task.positive, task.negative),\n          entryFilter: this.entryFilter.getFilter(task.positive, task.negative),\n          errorFilter: this.errorFilter.getFilter(),\n          followSymbolicLinks: this._settings.followSymbolicLinks,\n          fs: this._settings.fs,\n          stats: this._settings.stats,\n          throwErrorOnBrokenSymbolicLink: this._settings.throwErrorOnBrokenSymbolicLink,\n          transform: this.entryTransformer.getTransformer()\n        };\n      }\n      _getMicromatchOptions() {\n        return {\n          dot: this._settings.dot,\n          matchBase: this._settings.baseNameMatch,\n          nobrace: !this._settings.braceExpansion,\n          nocase: !this._settings.caseSensitiveMatch,\n          noext: !this._settings.extglob,\n          noglobstar: !this._settings.globstar,\n          posix: true,\n          strictSlashes: false\n        };\n      }\n    };\n    exports2.default = Provider;\n  }\n});\n\n// node_modules/fast-glob/out/providers/async.js\nvar require_async6 = __commonJS({\n  \"node_modules/fast-glob/out/providers/async.js\"(exports2) {\n    \"use strict\";\n    Object.defineProperty(exports2, \"__esModule\", { value: true });\n    var async_1 = require_async5();\n    var provider_1 = require_provider();\n    var ProviderAsync = class extends provider_1.default {\n      constructor() {\n        super(...arguments);\n        this._reader = new async_1.default(this._settings);\n      }\n      read(task) {\n        return __async(this, null, function* () {\n          const root = this._getRootDirectory(task);\n          const options = this._getReaderOptions(task);\n          const entries = yield this.api(root, task, options);\n          return entries.map((entry) => options.transform(entry));\n        });\n      }\n      api(root, task, options) {\n        if (task.dynamic) {\n          return this._reader.dynamic(root, options);\n        }\n        return this._reader.static(task.patterns, options);\n      }\n    };\n    exports2.default = ProviderAsync;\n  }\n});\n\n// node_modules/fast-glob/out/providers/stream.js\nvar require_stream4 = __commonJS({\n  \"node_modules/fast-glob/out/providers/stream.js\"(exports2) {\n    \"use strict\";\n    Object.defineProperty(exports2, \"__esModule\", { value: true });\n    var stream_1 = require(\"stream\");\n    var stream_2 = require_stream3();\n    var provider_1 = require_provider();\n    var ProviderStream = class extends provider_1.default {\n      constructor() {\n        super(...arguments);\n        this._reader = new stream_2.default(this._settings);\n      }\n      read(task) {\n        const root = this._getRootDirectory(task);\n        const options = this._getReaderOptions(task);\n        const source = this.api(root, task, options);\n        const destination = new stream_1.Readable({ objectMode: true, read: () => {\n        } });\n        source.once(\"error\", (error) => destination.emit(\"error\", error)).on(\"data\", (entry) => destination.emit(\"data\", options.transform(entry))).once(\"end\", () => destination.emit(\"end\"));\n        destination.once(\"close\", () => source.destroy());\n        return destination;\n      }\n      api(root, task, options) {\n        if (task.dynamic) {\n          return this._reader.dynamic(root, options);\n        }\n        return this._reader.static(task.patterns, options);\n      }\n    };\n    exports2.default = ProviderStream;\n  }\n});\n\n// node_modules/fast-glob/out/readers/sync.js\nvar require_sync5 = __commonJS({\n  \"node_modules/fast-glob/out/readers/sync.js\"(exports2) {\n    \"use strict\";\n    Object.defineProperty(exports2, \"__esModule\", { value: true });\n    var fsStat = require_out();\n    var fsWalk = require_out3();\n    var reader_1 = require_reader2();\n    var ReaderSync = class extends reader_1.default {\n      constructor() {\n        super(...arguments);\n        this._walkSync = fsWalk.walkSync;\n        this._statSync = fsStat.statSync;\n      }\n      dynamic(root, options) {\n        return this._walkSync(root, options);\n      }\n      static(patterns, options) {\n        const entries = [];\n        for (const pattern of patterns) {\n          const filepath = this._getFullEntryPath(pattern);\n          const entry = this._getEntry(filepath, pattern, options);\n          if (entry === null || !options.entryFilter(entry)) {\n            continue;\n          }\n          entries.push(entry);\n        }\n        return entries;\n      }\n      _getEntry(filepath, pattern, options) {\n        try {\n          const stats = this._getStat(filepath);\n          return this._makeEntry(stats, pattern);\n        } catch (error) {\n          if (options.errorFilter(error)) {\n            return null;\n          }\n          throw error;\n        }\n      }\n      _getStat(filepath) {\n        return this._statSync(filepath, this._fsStatSettings);\n      }\n    };\n    exports2.default = ReaderSync;\n  }\n});\n\n// node_modules/fast-glob/out/providers/sync.js\nvar require_sync6 = __commonJS({\n  \"node_modules/fast-glob/out/providers/sync.js\"(exports2) {\n    \"use strict\";\n    Object.defineProperty(exports2, \"__esModule\", { value: true });\n    var sync_1 = require_sync5();\n    var provider_1 = require_provider();\n    var ProviderSync = class extends provider_1.default {\n      constructor() {\n        super(...arguments);\n        this._reader = new sync_1.default(this._settings);\n      }\n      read(task) {\n        const root = this._getRootDirectory(task);\n        const options = this._getReaderOptions(task);\n        const entries = this.api(root, task, options);\n        return entries.map(options.transform);\n      }\n      api(root, task, options) {\n        if (task.dynamic) {\n          return this._reader.dynamic(root, options);\n        }\n        return this._reader.static(task.patterns, options);\n      }\n    };\n    exports2.default = ProviderSync;\n  }\n});\n\n// node_modules/fast-glob/out/settings.js\nvar require_settings4 = __commonJS({\n  \"node_modules/fast-glob/out/settings.js\"(exports2) {\n    \"use strict\";\n    Object.defineProperty(exports2, \"__esModule\", { value: true });\n    exports2.DEFAULT_FILE_SYSTEM_ADAPTER = void 0;\n    var fs6 = require(\"fs\");\n    var os = require(\"os\");\n    var CPU_COUNT = Math.max(os.cpus().length, 1);\n    exports2.DEFAULT_FILE_SYSTEM_ADAPTER = {\n      lstat: fs6.lstat,\n      lstatSync: fs6.lstatSync,\n      stat: fs6.stat,\n      statSync: fs6.statSync,\n      readdir: fs6.readdir,\n      readdirSync: fs6.readdirSync\n    };\n    var Settings = class {\n      constructor(_options = {}) {\n        this._options = _options;\n        this.absolute = this._getValue(this._options.absolute, false);\n        this.baseNameMatch = this._getValue(this._options.baseNameMatch, false);\n        this.braceExpansion = this._getValue(this._options.braceExpansion, true);\n        this.caseSensitiveMatch = this._getValue(this._options.caseSensitiveMatch, true);\n        this.concurrency = this._getValue(this._options.concurrency, CPU_COUNT);\n        this.cwd = this._getValue(this._options.cwd, process.cwd());\n        this.deep = this._getValue(this._options.deep, Infinity);\n        this.dot = this._getValue(this._options.dot, false);\n        this.extglob = this._getValue(this._options.extglob, true);\n        this.followSymbolicLinks = this._getValue(this._options.followSymbolicLinks, true);\n        this.fs = this._getFileSystemMethods(this._options.fs);\n        this.globstar = this._getValue(this._options.globstar, true);\n        this.ignore = this._getValue(this._options.ignore, []);\n        this.markDirectories = this._getValue(this._options.markDirectories, false);\n        this.objectMode = this._getValue(this._options.objectMode, false);\n        this.onlyDirectories = this._getValue(this._options.onlyDirectories, false);\n        this.onlyFiles = this._getValue(this._options.onlyFiles, true);\n        this.stats = this._getValue(this._options.stats, false);\n        this.suppressErrors = this._getValue(this._options.suppressErrors, false);\n        this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, false);\n        this.unique = this._getValue(this._options.unique, true);\n        if (this.onlyDirectories) {\n          this.onlyFiles = false;\n        }\n        if (this.stats) {\n          this.objectMode = true;\n        }\n        this.ignore = [].concat(this.ignore);\n      }\n      _getValue(option, value) {\n        return option === void 0 ? value : option;\n      }\n      _getFileSystemMethods(methods = {}) {\n        return Object.assign(Object.assign({}, exports2.DEFAULT_FILE_SYSTEM_ADAPTER), methods);\n      }\n    };\n    exports2.default = Settings;\n  }\n});\n\n// node_modules/fast-glob/out/index.js\nvar require_out4 = __commonJS({\n  \"node_modules/fast-glob/out/index.js\"(exports2, module2) {\n    \"use strict\";\n    var taskManager = require_tasks();\n    var async_1 = require_async6();\n    var stream_1 = require_stream4();\n    var sync_1 = require_sync6();\n    var settings_1 = require_settings4();\n    var utils = require_utils3();\n    function FastGlob(source, options) {\n      return __async(this, null, function* () {\n        assertPatternsInput2(source);\n        const works = getWorks(source, async_1.default, options);\n        const result = yield Promise.all(works);\n        return utils.array.flatten(result);\n      });\n    }\n    (function(FastGlob2) {\n      FastGlob2.glob = FastGlob2;\n      FastGlob2.globSync = sync;\n      FastGlob2.globStream = stream;\n      FastGlob2.async = FastGlob2;\n      function sync(source, options) {\n        assertPatternsInput2(source);\n        const works = getWorks(source, sync_1.default, options);\n        return utils.array.flatten(works);\n      }\n      FastGlob2.sync = sync;\n      function stream(source, options) {\n        assertPatternsInput2(source);\n        const works = getWorks(source, stream_1.default, options);\n        return utils.stream.merge(works);\n      }\n      FastGlob2.stream = stream;\n      function generateTasks2(source, options) {\n        assertPatternsInput2(source);\n        const patterns = [].concat(source);\n        const settings = new settings_1.default(options);\n        return taskManager.generate(patterns, settings);\n      }\n      FastGlob2.generateTasks = generateTasks2;\n      function isDynamicPattern2(source, options) {\n        assertPatternsInput2(source);\n        const settings = new settings_1.default(options);\n        return utils.pattern.isDynamicPattern(source, settings);\n      }\n      FastGlob2.isDynamicPattern = isDynamicPattern2;\n      function escapePath(source) {\n        assertPatternsInput2(source);\n        return utils.path.escape(source);\n      }\n      FastGlob2.escapePath = escapePath;\n      function convertPathToPattern2(source) {\n        assertPatternsInput2(source);\n        return utils.path.convertPathToPattern(source);\n      }\n      FastGlob2.convertPathToPattern = convertPathToPattern2;\n      let posix;\n      (function(posix2) {\n        function escapePath2(source) {\n          assertPatternsInput2(source);\n          return utils.path.escapePosixPath(source);\n        }\n        posix2.escapePath = escapePath2;\n        function convertPathToPattern3(source) {\n          assertPatternsInput2(source);\n          return utils.path.convertPosixPathToPattern(source);\n        }\n        posix2.convertPathToPattern = convertPathToPattern3;\n      })(posix = FastGlob2.posix || (FastGlob2.posix = {}));\n      let win32;\n      (function(win322) {\n        function escapePath2(source) {\n          assertPatternsInput2(source);\n          return utils.path.escapeWindowsPath(source);\n        }\n        win322.escapePath = escapePath2;\n        function convertPathToPattern3(source) {\n          assertPatternsInput2(source);\n          return utils.path.convertWindowsPathToPattern(source);\n        }\n        win322.convertPathToPattern = convertPathToPattern3;\n      })(win32 = FastGlob2.win32 || (FastGlob2.win32 = {}));\n    })(FastGlob || (FastGlob = {}));\n    function getWorks(source, _Provider, options) {\n      const patterns = [].concat(source);\n      const settings = new settings_1.default(options);\n      const tasks = taskManager.generate(patterns, settings);\n      const provider = new _Provider(settings);\n      return tasks.map(provider.read, provider);\n    }\n    function assertPatternsInput2(input) {\n      const source = [].concat(input);\n      const isValidSource = source.every((item) => utils.string.isString(item) && !utils.string.isEmpty(item));\n      if (!isValidSource) {\n        throw new TypeError(\"Patterns must be a string (non empty) or an array of strings\");\n      }\n    }\n    module2.exports = FastGlob;\n  }\n});\n\n// node_modules/ignore/index.js\nvar require_ignore = __commonJS({\n  \"node_modules/ignore/index.js\"(exports2, module2) {\n    \"use strict\";\n    function makeArray(subject) {\n      return Array.isArray(subject) ? subject : [subject];\n    }\n    var UNDEFINED = void 0;\n    var EMPTY = \"\";\n    var SPACE = \" \";\n    var ESCAPE = \"\\\\\";\n    var REGEX_TEST_BLANK_LINE = /^\\s+$/;\n    var REGEX_INVALID_TRAILING_BACKSLASH = /(?:[^\\\\]|^)\\\\$/;\n    var REGEX_REPLACE_LEADING_EXCAPED_EXCLAMATION = /^\\\\!/;\n    var REGEX_REPLACE_LEADING_EXCAPED_HASH = /^\\\\#/;\n    var REGEX_SPLITALL_CRLF = /\\r?\\n/g;\n    var REGEX_TEST_INVALID_PATH = /^\\.{0,2}\\/|^\\.{1,2}$/;\n    var REGEX_TEST_TRAILING_SLASH = /\\/$/;\n    var SLASH = \"/\";\n    var TMP_KEY_IGNORE = \"node-ignore\";\n    if (typeof Symbol !== \"undefined\") {\n      TMP_KEY_IGNORE = /* @__PURE__ */ Symbol.for(\"node-ignore\");\n    }\n    var KEY_IGNORE = TMP_KEY_IGNORE;\n    var define = (object, key, value) => {\n      Object.defineProperty(object, key, { value });\n      return value;\n    };\n    var REGEX_REGEXP_RANGE = /([0-z])-([0-z])/g;\n    var RETURN_FALSE = () => false;\n    var sanitizeRange = (range) => range.replace(\n      REGEX_REGEXP_RANGE,\n      (match, from, to) => from.charCodeAt(0) <= to.charCodeAt(0) ? match : EMPTY\n    );\n    var cleanRangeBackSlash = (slashes) => {\n      const { length } = slashes;\n      return slashes.slice(0, length - length % 2);\n    };\n    var REPLACERS = [\n      [\n        // Remove BOM\n        // TODO:\n        // Other similar zero-width characters?\n        /^\\uFEFF/,\n        () => EMPTY\n      ],\n      // > Trailing spaces are ignored unless they are quoted with backslash (\"\\\")\n      [\n        // (a\\ ) -> (a )\n        // (a  ) -> (a)\n        // (a ) -> (a)\n        // (a \\ ) -> (a  )\n        /((?:\\\\\\\\)*?)(\\\\?\\s+)$/,\n        (_, m1, m2) => m1 + (m2.indexOf(\"\\\\\") === 0 ? SPACE : EMPTY)\n      ],\n      // Replace (\\ ) with ' '\n      // (\\ ) -> ' '\n      // (\\\\ ) -> '\\\\ '\n      // (\\\\\\ ) -> '\\\\ '\n      [\n        /(\\\\+?)\\s/g,\n        (_, m1) => {\n          const { length } = m1;\n          return m1.slice(0, length - length % 2) + SPACE;\n        }\n      ],\n      // Escape metacharacters\n      // which is written down by users but means special for regular expressions.\n      // > There are 12 characters with special meanings:\n      // > - the backslash \\,\n      // > - the caret ^,\n      // > - the dollar sign $,\n      // > - the period or dot .,\n      // > - the vertical bar or pipe symbol |,\n      // > - the question mark ?,\n      // > - the asterisk or star *,\n      // > - the plus sign +,\n      // > - the opening parenthesis (,\n      // > - the closing parenthesis ),\n      // > - and the opening square bracket [,\n      // > - the opening curly brace {,\n      // > These special characters are often called \"metacharacters\".\n      [\n        /[\\\\$.|*+(){^]/g,\n        (match) => `\\\\${match}`\n      ],\n      [\n        // > a question mark (?) matches a single character\n        /(?!\\\\)\\?/g,\n        () => \"[^/]\"\n      ],\n      // leading slash\n      [\n        // > A leading slash matches the beginning of the pathname.\n        // > For example, \"/*.c\" matches \"cat-file.c\" but not \"mozilla-sha1/sha1.c\".\n        // A leading slash matches the beginning of the pathname\n        /^\\//,\n        () => \"^\"\n      ],\n      // replace special metacharacter slash after the leading slash\n      [\n        /\\//g,\n        () => \"\\\\/\"\n      ],\n      [\n        // > A leading \"**\" followed by a slash means match in all directories.\n        // > For example, \"**/foo\" matches file or directory \"foo\" anywhere,\n        // > the same as pattern \"foo\".\n        // > \"**/foo/bar\" matches file or directory \"bar\" anywhere that is directly\n        // >   under directory \"foo\".\n        // Notice that the '*'s have been replaced as '\\\\*'\n        /^\\^*\\\\\\*\\\\\\*\\\\\\//,\n        // '**/foo' <-> 'foo'\n        () => \"^(?:.*\\\\/)?\"\n      ],\n      // starting\n      [\n        // there will be no leading '/'\n        //   (which has been replaced by section \"leading slash\")\n        // If starts with '**', adding a '^' to the regular expression also works\n        /^(?=[^^])/,\n        function startingReplacer() {\n          return !/\\/(?!$)/.test(this) ? \"(?:^|\\\\/)\" : \"^\";\n        }\n      ],\n      // two globstars\n      [\n        // Use lookahead assertions so that we could match more than one `'/**'`\n        /\\\\\\/\\\\\\*\\\\\\*(?=\\\\\\/|$)/g,\n        // Zero, one or several directories\n        // should not use '*', or it will be replaced by the next replacer\n        // Check if it is not the last `'/**'`\n        (_, index, str) => index + 6 < str.length ? \"(?:\\\\/[^\\\\/]+)*\" : \"\\\\/.+\"\n      ],\n      // normal intermediate wildcards\n      [\n        // Never replace escaped '*'\n        // ignore rule '\\*' will match the path '*'\n        // 'abc.*/' -> go\n        // 'abc.*'  -> skip this rule,\n        //    coz trailing single wildcard will be handed by [trailing wildcard]\n        /(^|[^\\\\]+)(\\\\\\*)+(?=.+)/g,\n        // '*.js' matches '.js'\n        // '*.js' doesn't match 'abc'\n        (_, p1, p2) => {\n          const unescaped = p2.replace(/\\\\\\*/g, \"[^\\\\/]*\");\n          return p1 + unescaped;\n        }\n      ],\n      [\n        // unescape, revert step 3 except for back slash\n        // For example, if a user escape a '\\\\*',\n        // after step 3, the result will be '\\\\\\\\\\\\*'\n        /\\\\\\\\\\\\(?=[$.|*+(){^])/g,\n        () => ESCAPE\n      ],\n      [\n        // '\\\\\\\\' -> '\\\\'\n        /\\\\\\\\/g,\n        () => ESCAPE\n      ],\n      [\n        // > The range notation, e.g. [a-zA-Z],\n        // > can be used to match one of the characters in a range.\n        // `\\` is escaped by step 3\n        /(\\\\)?\\[([^\\]/]*?)(\\\\*)($|\\])/g,\n        (match, leadEscape, range, endEscape, close) => leadEscape === ESCAPE ? `\\\\[${range}${cleanRangeBackSlash(endEscape)}${close}` : close === \"]\" ? endEscape.length % 2 === 0 ? `[${sanitizeRange(range)}${endEscape}]` : \"[]\" : \"[]\"\n      ],\n      // ending\n      [\n        // 'js' will not match 'js.'\n        // 'ab' will not match 'abc'\n        /(?:[^*])$/,\n        // WTF!\n        // https://git-scm.com/docs/gitignore\n        // changes in [2.22.1](https://git-scm.com/docs/gitignore/2.22.1)\n        // which re-fixes #24, #38\n        // > If there is a separator at the end of the pattern then the pattern\n        // > will only match directories, otherwise the pattern can match both\n        // > files and directories.\n        // 'js*' will not match 'a.js'\n        // 'js/' will not match 'a.js'\n        // 'js' will match 'a.js' and 'a.js/'\n        (match) => /\\/$/.test(match) ? `${match}$` : `${match}(?=$|\\\\/$)`\n      ]\n    ];\n    var REGEX_REPLACE_TRAILING_WILDCARD = /(^|\\\\\\/)?\\\\\\*$/;\n    var MODE_IGNORE = \"regex\";\n    var MODE_CHECK_IGNORE = \"checkRegex\";\n    var UNDERSCORE = \"_\";\n    var TRAILING_WILD_CARD_REPLACERS = {\n      [MODE_IGNORE](_, p1) {\n        const prefix = p1 ? `${p1}[^/]+` : \"[^/]*\";\n        return `${prefix}(?=$|\\\\/$)`;\n      },\n      [MODE_CHECK_IGNORE](_, p1) {\n        const prefix = p1 ? `${p1}[^/]*` : \"[^/]*\";\n        return `${prefix}(?=$|\\\\/$)`;\n      }\n    };\n    var makeRegexPrefix = (pattern) => REPLACERS.reduce(\n      (prev, [matcher, replacer]) => prev.replace(matcher, replacer.bind(pattern)),\n      pattern\n    );\n    var isString = (subject) => typeof subject === \"string\";\n    var checkPattern = (pattern) => pattern && isString(pattern) && !REGEX_TEST_BLANK_LINE.test(pattern) && !REGEX_INVALID_TRAILING_BACKSLASH.test(pattern) && pattern.indexOf(\"#\") !== 0;\n    var splitPattern = (pattern) => pattern.split(REGEX_SPLITALL_CRLF).filter(Boolean);\n    var IgnoreRule = class {\n      constructor(pattern, mark, body, ignoreCase, negative, prefix) {\n        this.pattern = pattern;\n        this.mark = mark;\n        this.negative = negative;\n        define(this, \"body\", body);\n        define(this, \"ignoreCase\", ignoreCase);\n        define(this, \"regexPrefix\", prefix);\n      }\n      get regex() {\n        const key = UNDERSCORE + MODE_IGNORE;\n        if (this[key]) {\n          return this[key];\n        }\n        return this._make(MODE_IGNORE, key);\n      }\n      get checkRegex() {\n        const key = UNDERSCORE + MODE_CHECK_IGNORE;\n        if (this[key]) {\n          return this[key];\n        }\n        return this._make(MODE_CHECK_IGNORE, key);\n      }\n      _make(mode, key) {\n        const str = this.regexPrefix.replace(\n          REGEX_REPLACE_TRAILING_WILDCARD,\n          // It does not need to bind pattern\n          TRAILING_WILD_CARD_REPLACERS[mode]\n        );\n        const regex = this.ignoreCase ? new RegExp(str, \"i\") : new RegExp(str);\n        return define(this, key, regex);\n      }\n    };\n    var createRule = ({\n      pattern,\n      mark\n    }, ignoreCase) => {\n      let negative = false;\n      let body = pattern;\n      if (body.indexOf(\"!\") === 0) {\n        negative = true;\n        body = body.substr(1);\n      }\n      body = body.replace(REGEX_REPLACE_LEADING_EXCAPED_EXCLAMATION, \"!\").replace(REGEX_REPLACE_LEADING_EXCAPED_HASH, \"#\");\n      const regexPrefix = makeRegexPrefix(body);\n      return new IgnoreRule(\n        pattern,\n        mark,\n        body,\n        ignoreCase,\n        negative,\n        regexPrefix\n      );\n    };\n    var RuleManager = class {\n      constructor(ignoreCase) {\n        this._ignoreCase = ignoreCase;\n        this._rules = [];\n      }\n      _add(pattern) {\n        if (pattern && pattern[KEY_IGNORE]) {\n          this._rules = this._rules.concat(pattern._rules._rules);\n          this._added = true;\n          return;\n        }\n        if (isString(pattern)) {\n          pattern = {\n            pattern\n          };\n        }\n        if (checkPattern(pattern.pattern)) {\n          const rule = createRule(pattern, this._ignoreCase);\n          this._added = true;\n          this._rules.push(rule);\n        }\n      }\n      // @param {Array<string> | string | Ignore} pattern\n      add(pattern) {\n        this._added = false;\n        makeArray(\n          isString(pattern) ? splitPattern(pattern) : pattern\n        ).forEach(this._add, this);\n        return this._added;\n      }\n      // Test one single path without recursively checking parent directories\n      //\n      // - checkUnignored `boolean` whether should check if the path is unignored,\n      //   setting `checkUnignored` to `false` could reduce additional\n      //   path matching.\n      // - check `string` either `MODE_IGNORE` or `MODE_CHECK_IGNORE`\n      // @returns {TestResult} true if a file is ignored\n      test(path5, checkUnignored, mode) {\n        let ignored = false;\n        let unignored = false;\n        let matchedRule;\n        this._rules.forEach((rule) => {\n          const { negative } = rule;\n          if (unignored === negative && ignored !== unignored || negative && !ignored && !unignored && !checkUnignored) {\n            return;\n          }\n          const matched = rule[mode].test(path5);\n          if (!matched) {\n            return;\n          }\n          ignored = !negative;\n          unignored = negative;\n          matchedRule = negative ? UNDEFINED : rule;\n        });\n        const ret = {\n          ignored,\n          unignored\n        };\n        if (matchedRule) {\n          ret.rule = matchedRule;\n        }\n        return ret;\n      }\n    };\n    var throwError = (message, Ctor) => {\n      throw new Ctor(message);\n    };\n    var checkPath = (path5, originalPath, doThrow) => {\n      if (!isString(path5)) {\n        return doThrow(\n          `path must be a string, but got \\`${originalPath}\\``,\n          TypeError\n        );\n      }\n      if (!path5) {\n        return doThrow(`path must not be empty`, TypeError);\n      }\n      if (checkPath.isNotRelative(path5)) {\n        const r2 = \"`path.relative()`d\";\n        return doThrow(\n          `path should be a ${r2} string, but got \"${originalPath}\"`,\n          RangeError\n        );\n      }\n      return true;\n    };\n    var isNotRelative = (path5) => REGEX_TEST_INVALID_PATH.test(path5);\n    checkPath.isNotRelative = isNotRelative;\n    checkPath.convert = (p2) => p2;\n    var Ignore = class {\n      constructor({\n        ignorecase = true,\n        ignoreCase = ignorecase,\n        allowRelativePaths = false\n      } = {}) {\n        define(this, KEY_IGNORE, true);\n        this._rules = new RuleManager(ignoreCase);\n        this._strictPathCheck = !allowRelativePaths;\n        this._initCache();\n      }\n      _initCache() {\n        this._ignoreCache = /* @__PURE__ */ Object.create(null);\n        this._testCache = /* @__PURE__ */ Object.create(null);\n      }\n      add(pattern) {\n        if (this._rules.add(pattern)) {\n          this._initCache();\n        }\n        return this;\n      }\n      // legacy\n      addPattern(pattern) {\n        return this.add(pattern);\n      }\n      // @returns {TestResult}\n      _test(originalPath, cache, checkUnignored, slices) {\n        const path5 = originalPath && checkPath.convert(originalPath);\n        checkPath(\n          path5,\n          originalPath,\n          this._strictPathCheck ? throwError : RETURN_FALSE\n        );\n        return this._t(path5, cache, checkUnignored, slices);\n      }\n      checkIgnore(path5) {\n        if (!REGEX_TEST_TRAILING_SLASH.test(path5)) {\n          return this.test(path5);\n        }\n        const slices = path5.split(SLASH).filter(Boolean);\n        slices.pop();\n        if (slices.length) {\n          const parent = this._t(\n            slices.join(SLASH) + SLASH,\n            this._testCache,\n            true,\n            slices\n          );\n          if (parent.ignored) {\n            return parent;\n          }\n        }\n        return this._rules.test(path5, false, MODE_CHECK_IGNORE);\n      }\n      _t(path5, cache, checkUnignored, slices) {\n        if (path5 in cache) {\n          return cache[path5];\n        }\n        if (!slices) {\n          slices = path5.split(SLASH).filter(Boolean);\n        }\n        slices.pop();\n        if (!slices.length) {\n          return cache[path5] = this._rules.test(path5, checkUnignored, MODE_IGNORE);\n        }\n        const parent = this._t(\n          slices.join(SLASH) + SLASH,\n          cache,\n          checkUnignored,\n          slices\n        );\n        return cache[path5] = parent.ignored ? parent : this._rules.test(path5, checkUnignored, MODE_IGNORE);\n      }\n      ignores(path5) {\n        return this._test(path5, this._ignoreCache, false).ignored;\n      }\n      createFilter() {\n        return (path5) => !this.ignores(path5);\n      }\n      filter(paths) {\n        return makeArray(paths).filter(this.createFilter());\n      }\n      // @returns {TestResult}\n      test(path5) {\n        return this._test(path5, this._testCache, true);\n      }\n    };\n    var factory = (options) => new Ignore(options);\n    var isPathValid = (path5) => checkPath(path5 && checkPath.convert(path5), path5, RETURN_FALSE);\n    var setupWindows = () => {\n      const makePosix = (str) => /^\\\\\\\\\\?\\\\/.test(str) || /[\"<>|\\u0000-\\u001F]+/u.test(str) ? str : str.replace(/\\\\/g, \"/\");\n      checkPath.convert = makePosix;\n      const REGEX_TEST_WINDOWS_PATH_ABSOLUTE = /^[a-z]:\\//i;\n      checkPath.isNotRelative = (path5) => REGEX_TEST_WINDOWS_PATH_ABSOLUTE.test(path5) || isNotRelative(path5);\n    };\n    if (\n      // Detect `process` so that it can run in browsers.\n      typeof process !== \"undefined\" && process.platform === \"win32\"\n    ) {\n      setupWindows();\n    }\n    module2.exports = factory;\n    factory.default = factory;\n    module2.exports.isPathValid = isPathValid;\n    define(module2.exports, /* @__PURE__ */ Symbol.for(\"setupWindows\"), setupWindows);\n  }\n});\n\n// node_modules/universalify/index.js\nvar require_universalify = __commonJS({\n  \"node_modules/universalify/index.js\"(exports2) {\n    \"use strict\";\n    exports2.fromCallback = function(fn) {\n      return Object.defineProperty(function(...args) {\n        if (typeof args[args.length - 1] === \"function\") fn.apply(this, args);\n        else {\n          return new Promise((resolve, reject) => {\n            args.push((err, res) => err != null ? reject(err) : resolve(res));\n            fn.apply(this, args);\n          });\n        }\n      }, \"name\", { value: fn.name });\n    };\n    exports2.fromPromise = function(fn) {\n      return Object.defineProperty(function(...args) {\n        const cb = args[args.length - 1];\n        if (typeof cb !== \"function\") return fn.apply(this, args);\n        else {\n          args.pop();\n          fn.apply(this, args).then((r2) => cb(null, r2), cb);\n        }\n      }, \"name\", { value: fn.name });\n    };\n  }\n});\n\n// node_modules/graceful-fs/polyfills.js\nvar require_polyfills = __commonJS({\n  \"node_modules/graceful-fs/polyfills.js\"(exports2, module2) {\n    \"use strict\";\n    var constants = require(\"constants\");\n    var origCwd = process.cwd;\n    var cwd = null;\n    var platform = process.env.GRACEFUL_FS_PLATFORM || process.platform;\n    process.cwd = function() {\n      if (!cwd)\n        cwd = origCwd.call(process);\n      return cwd;\n    };\n    try {\n      process.cwd();\n    } catch (er) {\n    }\n    if (typeof process.chdir === \"function\") {\n      chdir = process.chdir;\n      process.chdir = function(d) {\n        cwd = null;\n        chdir.call(process, d);\n      };\n      if (Object.setPrototypeOf) Object.setPrototypeOf(process.chdir, chdir);\n    }\n    var chdir;\n    module2.exports = patch;\n    function patch(fs6) {\n      if (constants.hasOwnProperty(\"O_SYMLINK\") && process.version.match(/^v0\\.6\\.[0-2]|^v0\\.5\\./)) {\n        patchLchmod(fs6);\n      }\n      if (!fs6.lutimes) {\n        patchLutimes(fs6);\n      }\n      fs6.chown = chownFix(fs6.chown);\n      fs6.fchown = chownFix(fs6.fchown);\n      fs6.lchown = chownFix(fs6.lchown);\n      fs6.chmod = chmodFix(fs6.chmod);\n      fs6.fchmod = chmodFix(fs6.fchmod);\n      fs6.lchmod = chmodFix(fs6.lchmod);\n      fs6.chownSync = chownFixSync(fs6.chownSync);\n      fs6.fchownSync = chownFixSync(fs6.fchownSync);\n      fs6.lchownSync = chownFixSync(fs6.lchownSync);\n      fs6.chmodSync = chmodFixSync(fs6.chmodSync);\n      fs6.fchmodSync = chmodFixSync(fs6.fchmodSync);\n      fs6.lchmodSync = chmodFixSync(fs6.lchmodSync);\n      fs6.stat = statFix(fs6.stat);\n      fs6.fstat = statFix(fs6.fstat);\n      fs6.lstat = statFix(fs6.lstat);\n      fs6.statSync = statFixSync(fs6.statSync);\n      fs6.fstatSync = statFixSync(fs6.fstatSync);\n      fs6.lstatSync = statFixSync(fs6.lstatSync);\n      if (fs6.chmod && !fs6.lchmod) {\n        fs6.lchmod = function(path5, mode, cb) {\n          if (cb) process.nextTick(cb);\n        };\n        fs6.lchmodSync = function() {\n        };\n      }\n      if (fs6.chown && !fs6.lchown) {\n        fs6.lchown = function(path5, uid, gid, cb) {\n          if (cb) process.nextTick(cb);\n        };\n        fs6.lchownSync = function() {\n        };\n      }\n      if (platform === \"win32\") {\n        fs6.rename = typeof fs6.rename !== \"function\" ? fs6.rename : (function(fs$rename) {\n          function rename(from, to, cb) {\n            var start = Date.now();\n            var backoff = 0;\n            fs$rename(from, to, function CB(er) {\n              if (er && (er.code === \"EACCES\" || er.code === \"EPERM\" || er.code === \"EBUSY\") && Date.now() - start < 6e4) {\n                setTimeout(function() {\n                  fs6.stat(to, function(stater, st2) {\n                    if (stater && stater.code === \"ENOENT\")\n                      fs$rename(from, to, CB);\n                    else\n                      cb(er);\n                  });\n                }, backoff);\n                if (backoff < 100)\n                  backoff += 10;\n                return;\n              }\n              if (cb) cb(er);\n            });\n          }\n          if (Object.setPrototypeOf) Object.setPrototypeOf(rename, fs$rename);\n          return rename;\n        })(fs6.rename);\n      }\n      fs6.read = typeof fs6.read !== \"function\" ? fs6.read : (function(fs$read) {\n        function read(fd, buffer, offset, length, position, callback_) {\n          var callback;\n          if (callback_ && typeof callback_ === \"function\") {\n            var eagCounter = 0;\n            callback = function(er, _, __) {\n              if (er && er.code === \"EAGAIN\" && eagCounter < 10) {\n                eagCounter++;\n                return fs$read.call(fs6, fd, buffer, offset, length, position, callback);\n              }\n              callback_.apply(this, arguments);\n            };\n          }\n          return fs$read.call(fs6, fd, buffer, offset, length, position, callback);\n        }\n        if (Object.setPrototypeOf) Object.setPrototypeOf(read, fs$read);\n        return read;\n      })(fs6.read);\n      fs6.readSync = typeof fs6.readSync !== \"function\" ? fs6.readSync : /* @__PURE__ */ (function(fs$readSync) {\n        return function(fd, buffer, offset, length, position) {\n          var eagCounter = 0;\n          while (true) {\n            try {\n              return fs$readSync.call(fs6, fd, buffer, offset, length, position);\n            } catch (er) {\n              if (er.code === \"EAGAIN\" && eagCounter < 10) {\n                eagCounter++;\n                continue;\n              }\n              throw er;\n            }\n          }\n        };\n      })(fs6.readSync);\n      function patchLchmod(fs7) {\n        fs7.lchmod = function(path5, mode, callback) {\n          fs7.open(\n            path5,\n            constants.O_WRONLY | constants.O_SYMLINK,\n            mode,\n            function(err, fd) {\n              if (err) {\n                if (callback) callback(err);\n                return;\n              }\n              fs7.fchmod(fd, mode, function(err2) {\n                fs7.close(fd, function(err22) {\n                  if (callback) callback(err2 || err22);\n                });\n              });\n            }\n          );\n        };\n        fs7.lchmodSync = function(path5, mode) {\n          var fd = fs7.openSync(path5, constants.O_WRONLY | constants.O_SYMLINK, mode);\n          var threw = true;\n          var ret;\n          try {\n            ret = fs7.fchmodSync(fd, mode);\n            threw = false;\n          } finally {\n            if (threw) {\n              try {\n                fs7.closeSync(fd);\n              } catch (er) {\n              }\n            } else {\n              fs7.closeSync(fd);\n            }\n          }\n          return ret;\n        };\n      }\n      function patchLutimes(fs7) {\n        if (constants.hasOwnProperty(\"O_SYMLINK\") && fs7.futimes) {\n          fs7.lutimes = function(path5, at, mt2, cb) {\n            fs7.open(path5, constants.O_SYMLINK, function(er, fd) {\n              if (er) {\n                if (cb) cb(er);\n                return;\n              }\n              fs7.futimes(fd, at, mt2, function(er2) {\n                fs7.close(fd, function(er22) {\n                  if (cb) cb(er2 || er22);\n                });\n              });\n            });\n          };\n          fs7.lutimesSync = function(path5, at, mt2) {\n            var fd = fs7.openSync(path5, constants.O_SYMLINK);\n            var ret;\n            var threw = true;\n            try {\n              ret = fs7.futimesSync(fd, at, mt2);\n              threw = false;\n            } finally {\n              if (threw) {\n                try {\n                  fs7.closeSync(fd);\n                } catch (er) {\n                }\n              } else {\n                fs7.closeSync(fd);\n              }\n            }\n            return ret;\n          };\n        } else if (fs7.futimes) {\n          fs7.lutimes = function(_a2, _b2, _c, cb) {\n            if (cb) process.nextTick(cb);\n          };\n          fs7.lutimesSync = function() {\n          };\n        }\n      }\n      function chmodFix(orig) {\n        if (!orig) return orig;\n        return function(target, mode, cb) {\n          return orig.call(fs6, target, mode, function(er) {\n            if (chownErOk(er)) er = null;\n            if (cb) cb.apply(this, arguments);\n          });\n        };\n      }\n      function chmodFixSync(orig) {\n        if (!orig) return orig;\n        return function(target, mode) {\n          try {\n            return orig.call(fs6, target, mode);\n          } catch (er) {\n            if (!chownErOk(er)) throw er;\n          }\n        };\n      }\n      function chownFix(orig) {\n        if (!orig) return orig;\n        return function(target, uid, gid, cb) {\n          return orig.call(fs6, target, uid, gid, function(er) {\n            if (chownErOk(er)) er = null;\n            if (cb) cb.apply(this, arguments);\n          });\n        };\n      }\n      function chownFixSync(orig) {\n        if (!orig) return orig;\n        return function(target, uid, gid) {\n          try {\n            return orig.call(fs6, target, uid, gid);\n          } catch (er) {\n            if (!chownErOk(er)) throw er;\n          }\n        };\n      }\n      function statFix(orig) {\n        if (!orig) return orig;\n        return function(target, options, cb) {\n          if (typeof options === \"function\") {\n            cb = options;\n            options = null;\n          }\n          function callback(er, stats) {\n            if (stats) {\n              if (stats.uid < 0) stats.uid += 4294967296;\n              if (stats.gid < 0) stats.gid += 4294967296;\n            }\n            if (cb) cb.apply(this, arguments);\n          }\n          return options ? orig.call(fs6, target, options, callback) : orig.call(fs6, target, callback);\n        };\n      }\n      function statFixSync(orig) {\n        if (!orig) return orig;\n        return function(target, options) {\n          var stats = options ? orig.call(fs6, target, options) : orig.call(fs6, target);\n          if (stats) {\n            if (stats.uid < 0) stats.uid += 4294967296;\n            if (stats.gid < 0) stats.gid += 4294967296;\n          }\n          return stats;\n        };\n      }\n      function chownErOk(er) {\n        if (!er)\n          return true;\n        if (er.code === \"ENOSYS\")\n          return true;\n        var nonroot = !process.getuid || process.getuid() !== 0;\n        if (nonroot) {\n          if (er.code === \"EINVAL\" || er.code === \"EPERM\")\n            return true;\n        }\n        return false;\n      }\n    }\n  }\n});\n\n// node_modules/graceful-fs/legacy-streams.js\nvar require_legacy_streams = __commonJS({\n  \"node_modules/graceful-fs/legacy-streams.js\"(exports2, module2) {\n    \"use strict\";\n    var Stream = require(\"stream\").Stream;\n    module2.exports = legacy;\n    function legacy(fs6) {\n      return {\n        ReadStream,\n        WriteStream\n      };\n      function ReadStream(path5, options) {\n        if (!(this instanceof ReadStream)) return new ReadStream(path5, options);\n        Stream.call(this);\n        var self2 = this;\n        this.path = path5;\n        this.fd = null;\n        this.readable = true;\n        this.paused = false;\n        this.flags = \"r\";\n        this.mode = 438;\n        this.bufferSize = 64 * 1024;\n        options = options || {};\n        var keys = Object.keys(options);\n        for (var index = 0, length = keys.length; index < length; index++) {\n          var key = keys[index];\n          this[key] = options[key];\n        }\n        if (this.encoding) this.setEncoding(this.encoding);\n        if (this.start !== void 0) {\n          if (\"number\" !== typeof this.start) {\n            throw TypeError(\"start must be a Number\");\n          }\n          if (this.end === void 0) {\n            this.end = Infinity;\n          } else if (\"number\" !== typeof this.end) {\n            throw TypeError(\"end must be a Number\");\n          }\n          if (this.start > this.end) {\n            throw new Error(\"start must be <= end\");\n          }\n          this.pos = this.start;\n        }\n        if (this.fd !== null) {\n          process.nextTick(function() {\n            self2._read();\n          });\n          return;\n        }\n        fs6.open(this.path, this.flags, this.mode, function(err, fd) {\n          if (err) {\n            self2.emit(\"error\", err);\n            self2.readable = false;\n            return;\n          }\n          self2.fd = fd;\n          self2.emit(\"open\", fd);\n          self2._read();\n        });\n      }\n      function WriteStream(path5, options) {\n        if (!(this instanceof WriteStream)) return new WriteStream(path5, options);\n        Stream.call(this);\n        this.path = path5;\n        this.fd = null;\n        this.writable = true;\n        this.flags = \"w\";\n        this.encoding = \"binary\";\n        this.mode = 438;\n        this.bytesWritten = 0;\n        options = options || {};\n        var keys = Object.keys(options);\n        for (var index = 0, length = keys.length; index < length; index++) {\n          var key = keys[index];\n          this[key] = options[key];\n        }\n        if (this.start !== void 0) {\n          if (\"number\" !== typeof this.start) {\n            throw TypeError(\"start must be a Number\");\n          }\n          if (this.start < 0) {\n            throw new Error(\"start must be >= zero\");\n          }\n          this.pos = this.start;\n        }\n        this.busy = false;\n        this._queue = [];\n        if (this.fd === null) {\n          this._open = fs6.open;\n          this._queue.push([this._open, this.path, this.flags, this.mode, void 0]);\n          this.flush();\n        }\n      }\n    }\n  }\n});\n\n// node_modules/graceful-fs/clone.js\nvar require_clone = __commonJS({\n  \"node_modules/graceful-fs/clone.js\"(exports2, module2) {\n    \"use strict\";\n    module2.exports = clone;\n    var getPrototypeOf = Object.getPrototypeOf || function(obj) {\n      return obj.__proto__;\n    };\n    function clone(obj) {\n      if (obj === null || typeof obj !== \"object\")\n        return obj;\n      if (obj instanceof Object)\n        var copy = { __proto__: getPrototypeOf(obj) };\n      else\n        var copy = /* @__PURE__ */ Object.create(null);\n      Object.getOwnPropertyNames(obj).forEach(function(key) {\n        Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key));\n      });\n      return copy;\n    }\n  }\n});\n\n// node_modules/graceful-fs/graceful-fs.js\nvar require_graceful_fs = __commonJS({\n  \"node_modules/graceful-fs/graceful-fs.js\"(exports2, module2) {\n    \"use strict\";\n    var fs6 = require(\"fs\");\n    var polyfills = require_polyfills();\n    var legacy = require_legacy_streams();\n    var clone = require_clone();\n    var util = require(\"util\");\n    var gracefulQueue;\n    var previousSymbol;\n    if (typeof Symbol === \"function\" && typeof Symbol.for === \"function\") {\n      gracefulQueue = /* @__PURE__ */ Symbol.for(\"graceful-fs.queue\");\n      previousSymbol = /* @__PURE__ */ Symbol.for(\"graceful-fs.previous\");\n    } else {\n      gracefulQueue = \"___graceful-fs.queue\";\n      previousSymbol = \"___graceful-fs.previous\";\n    }\n    function noop2() {\n    }\n    function publishQueue(context, queue2) {\n      Object.defineProperty(context, gracefulQueue, {\n        get: function() {\n          return queue2;\n        }\n      });\n    }\n    var debug = noop2;\n    if (util.debuglog)\n      debug = util.debuglog(\"gfs4\");\n    else if (/\\bgfs4\\b/i.test(process.env.NODE_DEBUG || \"\"))\n      debug = function() {\n        var m2 = util.format.apply(util, arguments);\n        m2 = \"GFS4: \" + m2.split(/\\n/).join(\"\\nGFS4: \");\n        console.error(m2);\n      };\n    if (!fs6[gracefulQueue]) {\n      queue = global[gracefulQueue] || [];\n      publishQueue(fs6, queue);\n      fs6.close = (function(fs$close) {\n        function close(fd, cb) {\n          return fs$close.call(fs6, fd, function(err) {\n            if (!err) {\n              resetQueue();\n            }\n            if (typeof cb === \"function\")\n              cb.apply(this, arguments);\n          });\n        }\n        Object.defineProperty(close, previousSymbol, {\n          value: fs$close\n        });\n        return close;\n      })(fs6.close);\n      fs6.closeSync = (function(fs$closeSync) {\n        function closeSync(fd) {\n          fs$closeSync.apply(fs6, arguments);\n          resetQueue();\n        }\n        Object.defineProperty(closeSync, previousSymbol, {\n          value: fs$closeSync\n        });\n        return closeSync;\n      })(fs6.closeSync);\n      if (/\\bgfs4\\b/i.test(process.env.NODE_DEBUG || \"\")) {\n        process.on(\"exit\", function() {\n          debug(fs6[gracefulQueue]);\n          require(\"assert\").equal(fs6[gracefulQueue].length, 0);\n        });\n      }\n    }\n    var queue;\n    if (!global[gracefulQueue]) {\n      publishQueue(global, fs6[gracefulQueue]);\n    }\n    module2.exports = patch(clone(fs6));\n    if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs6.__patched) {\n      module2.exports = patch(fs6);\n      fs6.__patched = true;\n    }\n    function patch(fs7) {\n      polyfills(fs7);\n      fs7.gracefulify = patch;\n      fs7.createReadStream = createReadStream;\n      fs7.createWriteStream = createWriteStream;\n      var fs$readFile = fs7.readFile;\n      fs7.readFile = readFile;\n      function readFile(path5, options, cb) {\n        if (typeof options === \"function\")\n          cb = options, options = null;\n        return go$readFile(path5, options, cb);\n        function go$readFile(path6, options2, cb2, startTime) {\n          return fs$readFile(path6, options2, function(err) {\n            if (err && (err.code === \"EMFILE\" || err.code === \"ENFILE\"))\n              enqueue([go$readFile, [path6, options2, cb2], err, startTime || Date.now(), Date.now()]);\n            else {\n              if (typeof cb2 === \"function\")\n                cb2.apply(this, arguments);\n            }\n          });\n        }\n      }\n      var fs$writeFile = fs7.writeFile;\n      fs7.writeFile = writeFile;\n      function writeFile(path5, data, options, cb) {\n        if (typeof options === \"function\")\n          cb = options, options = null;\n        return go$writeFile(path5, data, options, cb);\n        function go$writeFile(path6, data2, options2, cb2, startTime) {\n          return fs$writeFile(path6, data2, options2, function(err) {\n            if (err && (err.code === \"EMFILE\" || err.code === \"ENFILE\"))\n              enqueue([go$writeFile, [path6, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);\n            else {\n              if (typeof cb2 === \"function\")\n                cb2.apply(this, arguments);\n            }\n          });\n        }\n      }\n      var fs$appendFile = fs7.appendFile;\n      if (fs$appendFile)\n        fs7.appendFile = appendFile;\n      function appendFile(path5, data, options, cb) {\n        if (typeof options === \"function\")\n          cb = options, options = null;\n        return go$appendFile(path5, data, options, cb);\n        function go$appendFile(path6, data2, options2, cb2, startTime) {\n          return fs$appendFile(path6, data2, options2, function(err) {\n            if (err && (err.code === \"EMFILE\" || err.code === \"ENFILE\"))\n              enqueue([go$appendFile, [path6, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);\n            else {\n              if (typeof cb2 === \"function\")\n                cb2.apply(this, arguments);\n            }\n          });\n        }\n      }\n      var fs$copyFile = fs7.copyFile;\n      if (fs$copyFile)\n        fs7.copyFile = copyFile;\n      function copyFile(src, dest, flags, cb) {\n        if (typeof flags === \"function\") {\n          cb = flags;\n          flags = 0;\n        }\n        return go$copyFile(src, dest, flags, cb);\n        function go$copyFile(src2, dest2, flags2, cb2, startTime) {\n          return fs$copyFile(src2, dest2, flags2, function(err) {\n            if (err && (err.code === \"EMFILE\" || err.code === \"ENFILE\"))\n              enqueue([go$copyFile, [src2, dest2, flags2, cb2], err, startTime || Date.now(), Date.now()]);\n            else {\n              if (typeof cb2 === \"function\")\n                cb2.apply(this, arguments);\n            }\n          });\n        }\n      }\n      var fs$readdir = fs7.readdir;\n      fs7.readdir = readdir;\n      var noReaddirOptionVersions = /^v[0-5]\\./;\n      function readdir(path5, options, cb) {\n        if (typeof options === \"function\")\n          cb = options, options = null;\n        var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(path6, options2, cb2, startTime) {\n          return fs$readdir(path6, fs$readdirCallback(\n            path6,\n            options2,\n            cb2,\n            startTime\n          ));\n        } : function go$readdir2(path6, options2, cb2, startTime) {\n          return fs$readdir(path6, options2, fs$readdirCallback(\n            path6,\n            options2,\n            cb2,\n            startTime\n          ));\n        };\n        return go$readdir(path5, options, cb);\n        function fs$readdirCallback(path6, options2, cb2, startTime) {\n          return function(err, files) {\n            if (err && (err.code === \"EMFILE\" || err.code === \"ENFILE\"))\n              enqueue([\n                go$readdir,\n                [path6, options2, cb2],\n                err,\n                startTime || Date.now(),\n                Date.now()\n              ]);\n            else {\n              if (files && files.sort)\n                files.sort();\n              if (typeof cb2 === \"function\")\n                cb2.call(this, err, files);\n            }\n          };\n        }\n      }\n      if (process.version.substr(0, 4) === \"v0.8\") {\n        var legStreams = legacy(fs7);\n        ReadStream = legStreams.ReadStream;\n        WriteStream = legStreams.WriteStream;\n      }\n      var fs$ReadStream = fs7.ReadStream;\n      if (fs$ReadStream) {\n        ReadStream.prototype = Object.create(fs$ReadStream.prototype);\n        ReadStream.prototype.open = ReadStream$open;\n      }\n      var fs$WriteStream = fs7.WriteStream;\n      if (fs$WriteStream) {\n        WriteStream.prototype = Object.create(fs$WriteStream.prototype);\n        WriteStream.prototype.open = WriteStream$open;\n      }\n      Object.defineProperty(fs7, \"ReadStream\", {\n        get: function() {\n          return ReadStream;\n        },\n        set: function(val) {\n          ReadStream = val;\n        },\n        enumerable: true,\n        configurable: true\n      });\n      Object.defineProperty(fs7, \"WriteStream\", {\n        get: function() {\n          return WriteStream;\n        },\n        set: function(val) {\n          WriteStream = val;\n        },\n        enumerable: true,\n        configurable: true\n      });\n      var FileReadStream = ReadStream;\n      Object.defineProperty(fs7, \"FileReadStream\", {\n        get: function() {\n          return FileReadStream;\n        },\n        set: function(val) {\n          FileReadStream = val;\n        },\n        enumerable: true,\n        configurable: true\n      });\n      var FileWriteStream = WriteStream;\n      Object.defineProperty(fs7, \"FileWriteStream\", {\n        get: function() {\n          return FileWriteStream;\n        },\n        set: function(val) {\n          FileWriteStream = val;\n        },\n        enumerable: true,\n        configurable: true\n      });\n      function ReadStream(path5, options) {\n        if (this instanceof ReadStream)\n          return fs$ReadStream.apply(this, arguments), this;\n        else\n          return ReadStream.apply(Object.create(ReadStream.prototype), arguments);\n      }\n      function ReadStream$open() {\n        var that = this;\n        open(that.path, that.flags, that.mode, function(err, fd) {\n          if (err) {\n            if (that.autoClose)\n              that.destroy();\n            that.emit(\"error\", err);\n          } else {\n            that.fd = fd;\n            that.emit(\"open\", fd);\n            that.read();\n          }\n        });\n      }\n      function WriteStream(path5, options) {\n        if (this instanceof WriteStream)\n          return fs$WriteStream.apply(this, arguments), this;\n        else\n          return WriteStream.apply(Object.create(WriteStream.prototype), arguments);\n      }\n      function WriteStream$open() {\n        var that = this;\n        open(that.path, that.flags, that.mode, function(err, fd) {\n          if (err) {\n            that.destroy();\n            that.emit(\"error\", err);\n          } else {\n            that.fd = fd;\n            that.emit(\"open\", fd);\n          }\n        });\n      }\n      function createReadStream(path5, options) {\n        return new fs7.ReadStream(path5, options);\n      }\n      function createWriteStream(path5, options) {\n        return new fs7.WriteStream(path5, options);\n      }\n      var fs$open = fs7.open;\n      fs7.open = open;\n      function open(path5, flags, mode, cb) {\n        if (typeof mode === \"function\")\n          cb = mode, mode = null;\n        return go$open(path5, flags, mode, cb);\n        function go$open(path6, flags2, mode2, cb2, startTime) {\n          return fs$open(path6, flags2, mode2, function(err, fd) {\n            if (err && (err.code === \"EMFILE\" || err.code === \"ENFILE\"))\n              enqueue([go$open, [path6, flags2, mode2, cb2], err, startTime || Date.now(), Date.now()]);\n            else {\n              if (typeof cb2 === \"function\")\n                cb2.apply(this, arguments);\n            }\n          });\n        }\n      }\n      return fs7;\n    }\n    function enqueue(elem) {\n      debug(\"ENQUEUE\", elem[0].name, elem[1]);\n      fs6[gracefulQueue].push(elem);\n      retry();\n    }\n    var retryTimer;\n    function resetQueue() {\n      var now = Date.now();\n      for (var i = 0; i < fs6[gracefulQueue].length; ++i) {\n        if (fs6[gracefulQueue][i].length > 2) {\n          fs6[gracefulQueue][i][3] = now;\n          fs6[gracefulQueue][i][4] = now;\n        }\n      }\n      retry();\n    }\n    function retry() {\n      clearTimeout(retryTimer);\n      retryTimer = void 0;\n      if (fs6[gracefulQueue].length === 0)\n        return;\n      var elem = fs6[gracefulQueue].shift();\n      var fn = elem[0];\n      var args = elem[1];\n      var err = elem[2];\n      var startTime = elem[3];\n      var lastTime = elem[4];\n      if (startTime === void 0) {\n        debug(\"RETRY\", fn.name, args);\n        fn.apply(null, args);\n      } else if (Date.now() - startTime >= 6e4) {\n        debug(\"TIMEOUT\", fn.name, args);\n        var cb = args.pop();\n        if (typeof cb === \"function\")\n          cb.call(null, err);\n      } else {\n        var sinceAttempt = Date.now() - lastTime;\n        var sinceStart = Math.max(lastTime - startTime, 1);\n        var desiredDelay = Math.min(sinceStart * 1.2, 100);\n        if (sinceAttempt >= desiredDelay) {\n          debug(\"RETRY\", fn.name, args);\n          fn.apply(null, args.concat([startTime]));\n        } else {\n          fs6[gracefulQueue].push(elem);\n        }\n      }\n      if (retryTimer === void 0) {\n        retryTimer = setTimeout(retry, 0);\n      }\n    }\n  }\n});\n\n// node_modules/fs-extra/lib/fs/index.js\nvar require_fs5 = __commonJS({\n  \"node_modules/fs-extra/lib/fs/index.js\"(exports2) {\n    \"use strict\";\n    var u = require_universalify().fromCallback;\n    var fs6 = require_graceful_fs();\n    var api = [\n      \"access\",\n      \"appendFile\",\n      \"chmod\",\n      \"chown\",\n      \"close\",\n      \"copyFile\",\n      \"cp\",\n      \"fchmod\",\n      \"fchown\",\n      \"fdatasync\",\n      \"fstat\",\n      \"fsync\",\n      \"ftruncate\",\n      \"futimes\",\n      \"glob\",\n      \"lchmod\",\n      \"lchown\",\n      \"lutimes\",\n      \"link\",\n      \"lstat\",\n      \"mkdir\",\n      \"mkdtemp\",\n      \"open\",\n      \"opendir\",\n      \"readdir\",\n      \"readFile\",\n      \"readlink\",\n      \"realpath\",\n      \"rename\",\n      \"rm\",\n      \"rmdir\",\n      \"stat\",\n      \"statfs\",\n      \"symlink\",\n      \"truncate\",\n      \"unlink\",\n      \"utimes\",\n      \"writeFile\"\n    ].filter((key) => {\n      return typeof fs6[key] === \"function\";\n    });\n    Object.assign(exports2, fs6);\n    api.forEach((method) => {\n      exports2[method] = u(fs6[method]);\n    });\n    exports2.exists = function(filename, callback) {\n      if (typeof callback === \"function\") {\n        return fs6.exists(filename, callback);\n      }\n      return new Promise((resolve) => {\n        return fs6.exists(filename, resolve);\n      });\n    };\n    exports2.read = function(fd, buffer, offset, length, position, callback) {\n      if (typeof callback === \"function\") {\n        return fs6.read(fd, buffer, offset, length, position, callback);\n      }\n      return new Promise((resolve, reject) => {\n        fs6.read(fd, buffer, offset, length, position, (err, bytesRead, buffer2) => {\n          if (err) return reject(err);\n          resolve({ bytesRead, buffer: buffer2 });\n        });\n      });\n    };\n    exports2.write = function(fd, buffer, ...args) {\n      if (typeof args[args.length - 1] === \"function\") {\n        return fs6.write(fd, buffer, ...args);\n      }\n      return new Promise((resolve, reject) => {\n        fs6.write(fd, buffer, ...args, (err, bytesWritten, buffer2) => {\n          if (err) return reject(err);\n          resolve({ bytesWritten, buffer: buffer2 });\n        });\n      });\n    };\n    exports2.readv = function(fd, buffers, ...args) {\n      if (typeof args[args.length - 1] === \"function\") {\n        return fs6.readv(fd, buffers, ...args);\n      }\n      return new Promise((resolve, reject) => {\n        fs6.readv(fd, buffers, ...args, (err, bytesRead, buffers2) => {\n          if (err) return reject(err);\n          resolve({ bytesRead, buffers: buffers2 });\n        });\n      });\n    };\n    exports2.writev = function(fd, buffers, ...args) {\n      if (typeof args[args.length - 1] === \"function\") {\n        return fs6.writev(fd, buffers, ...args);\n      }\n      return new Promise((resolve, reject) => {\n        fs6.writev(fd, buffers, ...args, (err, bytesWritten, buffers2) => {\n          if (err) return reject(err);\n          resolve({ bytesWritten, buffers: buffers2 });\n        });\n      });\n    };\n    if (typeof fs6.realpath.native === \"function\") {\n      exports2.realpath.native = u(fs6.realpath.native);\n    } else {\n      process.emitWarning(\n        \"fs.realpath.native is not a function. Is fs being monkey-patched?\",\n        \"Warning\",\n        \"fs-extra-WARN0003\"\n      );\n    }\n  }\n});\n\n// node_modules/fs-extra/lib/mkdirs/utils.js\nvar require_utils5 = __commonJS({\n  \"node_modules/fs-extra/lib/mkdirs/utils.js\"(exports2, module2) {\n    \"use strict\";\n    var path5 = require(\"path\");\n    module2.exports.checkPath = function checkPath(pth) {\n      if (process.platform === \"win32\") {\n        const pathHasInvalidWinCharacters = /[<>:\"|?*]/.test(pth.replace(path5.parse(pth).root, \"\"));\n        if (pathHasInvalidWinCharacters) {\n          const error = new Error(`Path contains invalid characters: ${pth}`);\n          error.code = \"EINVAL\";\n          throw error;\n        }\n      }\n    };\n  }\n});\n\n// node_modules/fs-extra/lib/mkdirs/make-dir.js\nvar require_make_dir = __commonJS({\n  \"node_modules/fs-extra/lib/mkdirs/make-dir.js\"(exports2, module2) {\n    \"use strict\";\n    var fs6 = require_fs5();\n    var { checkPath } = require_utils5();\n    var getMode = (options) => {\n      const defaults = { mode: 511 };\n      if (typeof options === \"number\") return options;\n      return __spreadValues(__spreadValues({}, defaults), options).mode;\n    };\n    module2.exports.makeDir = (dir, options) => __async(null, null, function* () {\n      checkPath(dir);\n      return fs6.mkdir(dir, {\n        mode: getMode(options),\n        recursive: true\n      });\n    });\n    module2.exports.makeDirSync = (dir, options) => {\n      checkPath(dir);\n      return fs6.mkdirSync(dir, {\n        mode: getMode(options),\n        recursive: true\n      });\n    };\n  }\n});\n\n// node_modules/fs-extra/lib/mkdirs/index.js\nvar require_mkdirs = __commonJS({\n  \"node_modules/fs-extra/lib/mkdirs/index.js\"(exports2, module2) {\n    \"use strict\";\n    var u = require_universalify().fromPromise;\n    var { makeDir: _makeDir, makeDirSync } = require_make_dir();\n    var makeDir = u(_makeDir);\n    module2.exports = {\n      mkdirs: makeDir,\n      mkdirsSync: makeDirSync,\n      // alias\n      mkdirp: makeDir,\n      mkdirpSync: makeDirSync,\n      ensureDir: makeDir,\n      ensureDirSync: makeDirSync\n    };\n  }\n});\n\n// node_modules/fs-extra/lib/path-exists/index.js\nvar require_path_exists = __commonJS({\n  \"node_modules/fs-extra/lib/path-exists/index.js\"(exports2, module2) {\n    \"use strict\";\n    var u = require_universalify().fromPromise;\n    var fs6 = require_fs5();\n    function pathExists(path5) {\n      return fs6.access(path5).then(() => true).catch(() => false);\n    }\n    module2.exports = {\n      pathExists: u(pathExists),\n      pathExistsSync: fs6.existsSync\n    };\n  }\n});\n\n// node_modules/fs-extra/lib/util/utimes.js\nvar require_utimes = __commonJS({\n  \"node_modules/fs-extra/lib/util/utimes.js\"(exports2, module2) {\n    \"use strict\";\n    var fs6 = require_fs5();\n    var u = require_universalify().fromPromise;\n    function utimesMillis(path5, atime, mtime) {\n      return __async(this, null, function* () {\n        const fd = yield fs6.open(path5, \"r+\");\n        let closeErr = null;\n        try {\n          yield fs6.futimes(fd, atime, mtime);\n        } finally {\n          try {\n            yield fs6.close(fd);\n          } catch (e) {\n            closeErr = e;\n          }\n        }\n        if (closeErr) {\n          throw closeErr;\n        }\n      });\n    }\n    function utimesMillisSync(path5, atime, mtime) {\n      const fd = fs6.openSync(path5, \"r+\");\n      fs6.futimesSync(fd, atime, mtime);\n      return fs6.closeSync(fd);\n    }\n    module2.exports = {\n      utimesMillis: u(utimesMillis),\n      utimesMillisSync\n    };\n  }\n});\n\n// node_modules/fs-extra/lib/util/stat.js\nvar require_stat = __commonJS({\n  \"node_modules/fs-extra/lib/util/stat.js\"(exports2, module2) {\n    \"use strict\";\n    var fs6 = require_fs5();\n    var path5 = require(\"path\");\n    var u = require_universalify().fromPromise;\n    function getStats(src, dest, opts) {\n      const statFunc = opts.dereference ? (file) => fs6.stat(file, { bigint: true }) : (file) => fs6.lstat(file, { bigint: true });\n      return Promise.all([\n        statFunc(src),\n        statFunc(dest).catch((err) => {\n          if (err.code === \"ENOENT\") return null;\n          throw err;\n        })\n      ]).then(([srcStat, destStat]) => ({ srcStat, destStat }));\n    }\n    function getStatsSync(src, dest, opts) {\n      let destStat;\n      const statFunc = opts.dereference ? (file) => fs6.statSync(file, { bigint: true }) : (file) => fs6.lstatSync(file, { bigint: true });\n      const srcStat = statFunc(src);\n      try {\n        destStat = statFunc(dest);\n      } catch (err) {\n        if (err.code === \"ENOENT\") return { srcStat, destStat: null };\n        throw err;\n      }\n      return { srcStat, destStat };\n    }\n    function checkPaths(src, dest, funcName, opts) {\n      return __async(this, null, function* () {\n        const { srcStat, destStat } = yield getStats(src, dest, opts);\n        if (destStat) {\n          if (areIdentical(srcStat, destStat)) {\n            const srcBaseName = path5.basename(src);\n            const destBaseName = path5.basename(dest);\n            if (funcName === \"move\" && srcBaseName !== destBaseName && srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {\n              return { srcStat, destStat, isChangingCase: true };\n            }\n            throw new Error(\"Source and destination must not be the same.\");\n          }\n          if (srcStat.isDirectory() && !destStat.isDirectory()) {\n            throw new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`);\n          }\n          if (!srcStat.isDirectory() && destStat.isDirectory()) {\n            throw new Error(`Cannot overwrite directory '${dest}' with non-directory '${src}'.`);\n          }\n        }\n        if (srcStat.isDirectory() && isSrcSubdir(src, dest)) {\n          throw new Error(errMsg(src, dest, funcName));\n        }\n        return { srcStat, destStat };\n      });\n    }\n    function checkPathsSync(src, dest, funcName, opts) {\n      const { srcStat, destStat } = getStatsSync(src, dest, opts);\n      if (destStat) {\n        if (areIdentical(srcStat, destStat)) {\n          const srcBaseName = path5.basename(src);\n          const destBaseName = path5.basename(dest);\n          if (funcName === \"move\" && srcBaseName !== destBaseName && srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {\n            return { srcStat, destStat, isChangingCase: true };\n          }\n          throw new Error(\"Source and destination must not be the same.\");\n        }\n        if (srcStat.isDirectory() && !destStat.isDirectory()) {\n          throw new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`);\n        }\n        if (!srcStat.isDirectory() && destStat.isDirectory()) {\n          throw new Error(`Cannot overwrite directory '${dest}' with non-directory '${src}'.`);\n        }\n      }\n      if (srcStat.isDirectory() && isSrcSubdir(src, dest)) {\n        throw new Error(errMsg(src, dest, funcName));\n      }\n      return { srcStat, destStat };\n    }\n    function checkParentPaths(src, srcStat, dest, funcName) {\n      return __async(this, null, function* () {\n        const srcParent = path5.resolve(path5.dirname(src));\n        const destParent = path5.resolve(path5.dirname(dest));\n        if (destParent === srcParent || destParent === path5.parse(destParent).root) return;\n        let destStat;\n        try {\n          destStat = yield fs6.stat(destParent, { bigint: true });\n        } catch (err) {\n          if (err.code === \"ENOENT\") return;\n          throw err;\n        }\n        if (areIdentical(srcStat, destStat)) {\n          throw new Error(errMsg(src, dest, funcName));\n        }\n        return checkParentPaths(src, srcStat, destParent, funcName);\n      });\n    }\n    function checkParentPathsSync(src, srcStat, dest, funcName) {\n      const srcParent = path5.resolve(path5.dirname(src));\n      const destParent = path5.resolve(path5.dirname(dest));\n      if (destParent === srcParent || destParent === path5.parse(destParent).root) return;\n      let destStat;\n      try {\n        destStat = fs6.statSync(destParent, { bigint: true });\n      } catch (err) {\n        if (err.code === \"ENOENT\") return;\n        throw err;\n      }\n      if (areIdentical(srcStat, destStat)) {\n        throw new Error(errMsg(src, dest, funcName));\n      }\n      return checkParentPathsSync(src, srcStat, destParent, funcName);\n    }\n    function areIdentical(srcStat, destStat) {\n      return destStat.ino !== void 0 && destStat.dev !== void 0 && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev;\n    }\n    function isSrcSubdir(src, dest) {\n      const srcArr = path5.resolve(src).split(path5.sep).filter((i) => i);\n      const destArr = path5.resolve(dest).split(path5.sep).filter((i) => i);\n      return srcArr.every((cur, i) => destArr[i] === cur);\n    }\n    function errMsg(src, dest, funcName) {\n      return `Cannot ${funcName} '${src}' to a subdirectory of itself, '${dest}'.`;\n    }\n    module2.exports = {\n      // checkPaths\n      checkPaths: u(checkPaths),\n      checkPathsSync,\n      // checkParent\n      checkParentPaths: u(checkParentPaths),\n      checkParentPathsSync,\n      // Misc\n      isSrcSubdir,\n      areIdentical\n    };\n  }\n});\n\n// node_modules/fs-extra/lib/util/async.js\nvar require_async7 = __commonJS({\n  \"node_modules/fs-extra/lib/util/async.js\"(exports2, module2) {\n    \"use strict\";\n    function asyncIteratorConcurrentProcess(iterator, fn) {\n      return __async(this, null, function* () {\n        const promises = [];\n        try {\n          for (var iter = __forAwait(iterator), more, temp, error; more = !(temp = yield iter.next()).done; more = false) {\n            const item = temp.value;\n            promises.push(\n              fn(item).then(\n                () => null,\n                (err) => err != null ? err : new Error(\"unknown error\")\n              )\n            );\n          }\n        } catch (temp) {\n          error = [temp];\n        } finally {\n          try {\n            more && (temp = iter.return) && (yield temp.call(iter));\n          } finally {\n            if (error)\n              throw error[0];\n          }\n        }\n        yield Promise.all(\n          promises.map(\n            (promise) => promise.then((possibleErr) => {\n              if (possibleErr !== null) throw possibleErr;\n            })\n          )\n        );\n      });\n    }\n    module2.exports = {\n      asyncIteratorConcurrentProcess\n    };\n  }\n});\n\n// node_modules/fs-extra/lib/copy/copy.js\nvar require_copy = __commonJS({\n  \"node_modules/fs-extra/lib/copy/copy.js\"(exports2, module2) {\n    \"use strict\";\n    var fs6 = require_fs5();\n    var path5 = require(\"path\");\n    var { mkdirs } = require_mkdirs();\n    var { pathExists } = require_path_exists();\n    var { utimesMillis } = require_utimes();\n    var stat = require_stat();\n    var { asyncIteratorConcurrentProcess } = require_async7();\n    function copy(_0, _1) {\n      return __async(this, arguments, function* (src, dest, opts = {}) {\n        if (typeof opts === \"function\") {\n          opts = { filter: opts };\n        }\n        opts.clobber = \"clobber\" in opts ? !!opts.clobber : true;\n        opts.overwrite = \"overwrite\" in opts ? !!opts.overwrite : opts.clobber;\n        if (opts.preserveTimestamps && process.arch === \"ia32\") {\n          process.emitWarning(\n            \"Using the preserveTimestamps option in 32-bit node is not recommended;\\n\\n\tsee https://github.com/jprichardson/node-fs-extra/issues/269\",\n            \"Warning\",\n            \"fs-extra-WARN0001\"\n          );\n        }\n        const { srcStat, destStat } = yield stat.checkPaths(src, dest, \"copy\", opts);\n        yield stat.checkParentPaths(src, srcStat, dest, \"copy\");\n        const include = yield runFilter(src, dest, opts);\n        if (!include) return;\n        const destParent = path5.dirname(dest);\n        const dirExists = yield pathExists(destParent);\n        if (!dirExists) {\n          yield mkdirs(destParent);\n        }\n        yield getStatsAndPerformCopy(destStat, src, dest, opts);\n      });\n    }\n    function runFilter(src, dest, opts) {\n      return __async(this, null, function* () {\n        if (!opts.filter) return true;\n        return opts.filter(src, dest);\n      });\n    }\n    function getStatsAndPerformCopy(destStat, src, dest, opts) {\n      return __async(this, null, function* () {\n        const statFn = opts.dereference ? fs6.stat : fs6.lstat;\n        const srcStat = yield statFn(src);\n        if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts);\n        if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts);\n        if (srcStat.isSymbolicLink()) return onLink(destStat, src, dest, opts);\n        if (srcStat.isSocket()) throw new Error(`Cannot copy a socket file: ${src}`);\n        if (srcStat.isFIFO()) throw new Error(`Cannot copy a FIFO pipe: ${src}`);\n        throw new Error(`Unknown file: ${src}`);\n      });\n    }\n    function onFile(srcStat, destStat, src, dest, opts) {\n      return __async(this, null, function* () {\n        if (!destStat) return copyFile(srcStat, src, dest, opts);\n        if (opts.overwrite) {\n          yield fs6.unlink(dest);\n          return copyFile(srcStat, src, dest, opts);\n        }\n        if (opts.errorOnExist) {\n          throw new Error(`'${dest}' already exists`);\n        }\n      });\n    }\n    function copyFile(srcStat, src, dest, opts) {\n      return __async(this, null, function* () {\n        yield fs6.copyFile(src, dest);\n        if (opts.preserveTimestamps) {\n          if (fileIsNotWritable(srcStat.mode)) {\n            yield makeFileWritable(dest, srcStat.mode);\n          }\n          const updatedSrcStat = yield fs6.stat(src);\n          yield utimesMillis(dest, updatedSrcStat.atime, updatedSrcStat.mtime);\n        }\n        return fs6.chmod(dest, srcStat.mode);\n      });\n    }\n    function fileIsNotWritable(srcMode) {\n      return (srcMode & 128) === 0;\n    }\n    function makeFileWritable(dest, srcMode) {\n      return fs6.chmod(dest, srcMode | 128);\n    }\n    function onDir(srcStat, destStat, src, dest, opts) {\n      return __async(this, null, function* () {\n        if (!destStat) {\n          yield fs6.mkdir(dest);\n        }\n        yield asyncIteratorConcurrentProcess(yield fs6.opendir(src), (item) => __async(null, null, function* () {\n          const srcItem = path5.join(src, item.name);\n          const destItem = path5.join(dest, item.name);\n          const include = yield runFilter(srcItem, destItem, opts);\n          if (include) {\n            const { destStat: destStat2 } = yield stat.checkPaths(srcItem, destItem, \"copy\", opts);\n            yield getStatsAndPerformCopy(destStat2, srcItem, destItem, opts);\n          }\n        }));\n        if (!destStat) {\n          yield fs6.chmod(dest, srcStat.mode);\n        }\n      });\n    }\n    function onLink(destStat, src, dest, opts) {\n      return __async(this, null, function* () {\n        let resolvedSrc = yield fs6.readlink(src);\n        if (opts.dereference) {\n          resolvedSrc = path5.resolve(process.cwd(), resolvedSrc);\n        }\n        if (!destStat) {\n          return fs6.symlink(resolvedSrc, dest);\n        }\n        let resolvedDest = null;\n        try {\n          resolvedDest = yield fs6.readlink(dest);\n        } catch (e) {\n          if (e.code === \"EINVAL\" || e.code === \"UNKNOWN\") return fs6.symlink(resolvedSrc, dest);\n          throw e;\n        }\n        if (opts.dereference) {\n          resolvedDest = path5.resolve(process.cwd(), resolvedDest);\n        }\n        if (resolvedSrc !== resolvedDest) {\n          if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {\n            throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`);\n          }\n          if (stat.isSrcSubdir(resolvedDest, resolvedSrc)) {\n            throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`);\n          }\n        }\n        yield fs6.unlink(dest);\n        return fs6.symlink(resolvedSrc, dest);\n      });\n    }\n    module2.exports = copy;\n  }\n});\n\n// node_modules/fs-extra/lib/copy/copy-sync.js\nvar require_copy_sync = __commonJS({\n  \"node_modules/fs-extra/lib/copy/copy-sync.js\"(exports2, module2) {\n    \"use strict\";\n    var fs6 = require_graceful_fs();\n    var path5 = require(\"path\");\n    var mkdirsSync = require_mkdirs().mkdirsSync;\n    var utimesMillisSync = require_utimes().utimesMillisSync;\n    var stat = require_stat();\n    function copySync(src, dest, opts) {\n      if (typeof opts === \"function\") {\n        opts = { filter: opts };\n      }\n      opts = opts || {};\n      opts.clobber = \"clobber\" in opts ? !!opts.clobber : true;\n      opts.overwrite = \"overwrite\" in opts ? !!opts.overwrite : opts.clobber;\n      if (opts.preserveTimestamps && process.arch === \"ia32\") {\n        process.emitWarning(\n          \"Using the preserveTimestamps option in 32-bit node is not recommended;\\n\\n\tsee https://github.com/jprichardson/node-fs-extra/issues/269\",\n          \"Warning\",\n          \"fs-extra-WARN0002\"\n        );\n      }\n      const { srcStat, destStat } = stat.checkPathsSync(src, dest, \"copy\", opts);\n      stat.checkParentPathsSync(src, srcStat, dest, \"copy\");\n      if (opts.filter && !opts.filter(src, dest)) return;\n      const destParent = path5.dirname(dest);\n      if (!fs6.existsSync(destParent)) mkdirsSync(destParent);\n      return getStats(destStat, src, dest, opts);\n    }\n    function getStats(destStat, src, dest, opts) {\n      const statSync = opts.dereference ? fs6.statSync : fs6.lstatSync;\n      const srcStat = statSync(src);\n      if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts);\n      else if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts);\n      else if (srcStat.isSymbolicLink()) return onLink(destStat, src, dest, opts);\n      else if (srcStat.isSocket()) throw new Error(`Cannot copy a socket file: ${src}`);\n      else if (srcStat.isFIFO()) throw new Error(`Cannot copy a FIFO pipe: ${src}`);\n      throw new Error(`Unknown file: ${src}`);\n    }\n    function onFile(srcStat, destStat, src, dest, opts) {\n      if (!destStat) return copyFile(srcStat, src, dest, opts);\n      return mayCopyFile(srcStat, src, dest, opts);\n    }\n    function mayCopyFile(srcStat, src, dest, opts) {\n      if (opts.overwrite) {\n        fs6.unlinkSync(dest);\n        return copyFile(srcStat, src, dest, opts);\n      } else if (opts.errorOnExist) {\n        throw new Error(`'${dest}' already exists`);\n      }\n    }\n    function copyFile(srcStat, src, dest, opts) {\n      fs6.copyFileSync(src, dest);\n      if (opts.preserveTimestamps) handleTimestamps(srcStat.mode, src, dest);\n      return setDestMode(dest, srcStat.mode);\n    }\n    function handleTimestamps(srcMode, src, dest) {\n      if (fileIsNotWritable(srcMode)) makeFileWritable(dest, srcMode);\n      return setDestTimestamps(src, dest);\n    }\n    function fileIsNotWritable(srcMode) {\n      return (srcMode & 128) === 0;\n    }\n    function makeFileWritable(dest, srcMode) {\n      return setDestMode(dest, srcMode | 128);\n    }\n    function setDestMode(dest, srcMode) {\n      return fs6.chmodSync(dest, srcMode);\n    }\n    function setDestTimestamps(src, dest) {\n      const updatedSrcStat = fs6.statSync(src);\n      return utimesMillisSync(dest, updatedSrcStat.atime, updatedSrcStat.mtime);\n    }\n    function onDir(srcStat, destStat, src, dest, opts) {\n      if (!destStat) return mkDirAndCopy(srcStat.mode, src, dest, opts);\n      return copyDir(src, dest, opts);\n    }\n    function mkDirAndCopy(srcMode, src, dest, opts) {\n      fs6.mkdirSync(dest);\n      copyDir(src, dest, opts);\n      return setDestMode(dest, srcMode);\n    }\n    function copyDir(src, dest, opts) {\n      const dir = fs6.opendirSync(src);\n      try {\n        let dirent;\n        while ((dirent = dir.readSync()) !== null) {\n          copyDirItem(dirent.name, src, dest, opts);\n        }\n      } finally {\n        dir.closeSync();\n      }\n    }\n    function copyDirItem(item, src, dest, opts) {\n      const srcItem = path5.join(src, item);\n      const destItem = path5.join(dest, item);\n      if (opts.filter && !opts.filter(srcItem, destItem)) return;\n      const { destStat } = stat.checkPathsSync(srcItem, destItem, \"copy\", opts);\n      return getStats(destStat, srcItem, destItem, opts);\n    }\n    function onLink(destStat, src, dest, opts) {\n      let resolvedSrc = fs6.readlinkSync(src);\n      if (opts.dereference) {\n        resolvedSrc = path5.resolve(process.cwd(), resolvedSrc);\n      }\n      if (!destStat) {\n        return fs6.symlinkSync(resolvedSrc, dest);\n      } else {\n        let resolvedDest;\n        try {\n          resolvedDest = fs6.readlinkSync(dest);\n        } catch (err) {\n          if (err.code === \"EINVAL\" || err.code === \"UNKNOWN\") return fs6.symlinkSync(resolvedSrc, dest);\n          throw err;\n        }\n        if (opts.dereference) {\n          resolvedDest = path5.resolve(process.cwd(), resolvedDest);\n        }\n        if (resolvedSrc !== resolvedDest) {\n          if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {\n            throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`);\n          }\n          if (stat.isSrcSubdir(resolvedDest, resolvedSrc)) {\n            throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`);\n          }\n        }\n        return copyLink(resolvedSrc, dest);\n      }\n    }\n    function copyLink(resolvedSrc, dest) {\n      fs6.unlinkSync(dest);\n      return fs6.symlinkSync(resolvedSrc, dest);\n    }\n    module2.exports = copySync;\n  }\n});\n\n// node_modules/fs-extra/lib/copy/index.js\nvar require_copy2 = __commonJS({\n  \"node_modules/fs-extra/lib/copy/index.js\"(exports2, module2) {\n    \"use strict\";\n    var u = require_universalify().fromPromise;\n    module2.exports = {\n      copy: u(require_copy()),\n      copySync: require_copy_sync()\n    };\n  }\n});\n\n// node_modules/fs-extra/lib/remove/index.js\nvar require_remove = __commonJS({\n  \"node_modules/fs-extra/lib/remove/index.js\"(exports2, module2) {\n    \"use strict\";\n    var fs6 = require_graceful_fs();\n    var u = require_universalify().fromCallback;\n    function remove(path5, callback) {\n      fs6.rm(path5, { recursive: true, force: true }, callback);\n    }\n    function removeSync(path5) {\n      fs6.rmSync(path5, { recursive: true, force: true });\n    }\n    module2.exports = {\n      remove: u(remove),\n      removeSync\n    };\n  }\n});\n\n// node_modules/fs-extra/lib/empty/index.js\nvar require_empty = __commonJS({\n  \"node_modules/fs-extra/lib/empty/index.js\"(exports2, module2) {\n    \"use strict\";\n    var u = require_universalify().fromPromise;\n    var fs6 = require_fs5();\n    var path5 = require(\"path\");\n    var mkdir = require_mkdirs();\n    var remove = require_remove();\n    var emptyDir = u(function emptyDir2(dir) {\n      return __async(this, null, function* () {\n        let items;\n        try {\n          items = yield fs6.readdir(dir);\n        } catch (e) {\n          return mkdir.mkdirs(dir);\n        }\n        return Promise.all(items.map((item) => remove.remove(path5.join(dir, item))));\n      });\n    });\n    function emptyDirSync(dir) {\n      let items;\n      try {\n        items = fs6.readdirSync(dir);\n      } catch (e) {\n        return mkdir.mkdirsSync(dir);\n      }\n      items.forEach((item) => {\n        item = path5.join(dir, item);\n        remove.removeSync(item);\n      });\n    }\n    module2.exports = {\n      emptyDirSync,\n      emptydirSync: emptyDirSync,\n      emptyDir,\n      emptydir: emptyDir\n    };\n  }\n});\n\n// node_modules/fs-extra/lib/ensure/file.js\nvar require_file = __commonJS({\n  \"node_modules/fs-extra/lib/ensure/file.js\"(exports2, module2) {\n    \"use strict\";\n    var u = require_universalify().fromPromise;\n    var path5 = require(\"path\");\n    var fs6 = require_fs5();\n    var mkdir = require_mkdirs();\n    function createFile(file) {\n      return __async(this, null, function* () {\n        let stats;\n        try {\n          stats = yield fs6.stat(file);\n        } catch (e) {\n        }\n        if (stats && stats.isFile()) return;\n        const dir = path5.dirname(file);\n        let dirStats = null;\n        try {\n          dirStats = yield fs6.stat(dir);\n        } catch (err) {\n          if (err.code === \"ENOENT\") {\n            yield mkdir.mkdirs(dir);\n            yield fs6.writeFile(file, \"\");\n            return;\n          } else {\n            throw err;\n          }\n        }\n        if (dirStats.isDirectory()) {\n          yield fs6.writeFile(file, \"\");\n        } else {\n          yield fs6.readdir(dir);\n        }\n      });\n    }\n    function createFileSync(file) {\n      let stats;\n      try {\n        stats = fs6.statSync(file);\n      } catch (e) {\n      }\n      if (stats && stats.isFile()) return;\n      const dir = path5.dirname(file);\n      try {\n        if (!fs6.statSync(dir).isDirectory()) {\n          fs6.readdirSync(dir);\n        }\n      } catch (err) {\n        if (err && err.code === \"ENOENT\") mkdir.mkdirsSync(dir);\n        else throw err;\n      }\n      fs6.writeFileSync(file, \"\");\n    }\n    module2.exports = {\n      createFile: u(createFile),\n      createFileSync\n    };\n  }\n});\n\n// node_modules/fs-extra/lib/ensure/link.js\nvar require_link = __commonJS({\n  \"node_modules/fs-extra/lib/ensure/link.js\"(exports2, module2) {\n    \"use strict\";\n    var u = require_universalify().fromPromise;\n    var path5 = require(\"path\");\n    var fs6 = require_fs5();\n    var mkdir = require_mkdirs();\n    var { pathExists } = require_path_exists();\n    var { areIdentical } = require_stat();\n    function createLink(srcpath, dstpath) {\n      return __async(this, null, function* () {\n        let dstStat;\n        try {\n          dstStat = yield fs6.lstat(dstpath);\n        } catch (e) {\n        }\n        let srcStat;\n        try {\n          srcStat = yield fs6.lstat(srcpath);\n        } catch (err) {\n          err.message = err.message.replace(\"lstat\", \"ensureLink\");\n          throw err;\n        }\n        if (dstStat && areIdentical(srcStat, dstStat)) return;\n        const dir = path5.dirname(dstpath);\n        const dirExists = yield pathExists(dir);\n        if (!dirExists) {\n          yield mkdir.mkdirs(dir);\n        }\n        yield fs6.link(srcpath, dstpath);\n      });\n    }\n    function createLinkSync(srcpath, dstpath) {\n      let dstStat;\n      try {\n        dstStat = fs6.lstatSync(dstpath);\n      } catch (e) {\n      }\n      try {\n        const srcStat = fs6.lstatSync(srcpath);\n        if (dstStat && areIdentical(srcStat, dstStat)) return;\n      } catch (err) {\n        err.message = err.message.replace(\"lstat\", \"ensureLink\");\n        throw err;\n      }\n      const dir = path5.dirname(dstpath);\n      const dirExists = fs6.existsSync(dir);\n      if (dirExists) return fs6.linkSync(srcpath, dstpath);\n      mkdir.mkdirsSync(dir);\n      return fs6.linkSync(srcpath, dstpath);\n    }\n    module2.exports = {\n      createLink: u(createLink),\n      createLinkSync\n    };\n  }\n});\n\n// node_modules/fs-extra/lib/ensure/symlink-paths.js\nvar require_symlink_paths = __commonJS({\n  \"node_modules/fs-extra/lib/ensure/symlink-paths.js\"(exports2, module2) {\n    \"use strict\";\n    var path5 = require(\"path\");\n    var fs6 = require_fs5();\n    var { pathExists } = require_path_exists();\n    var u = require_universalify().fromPromise;\n    function symlinkPaths(srcpath, dstpath) {\n      return __async(this, null, function* () {\n        if (path5.isAbsolute(srcpath)) {\n          try {\n            yield fs6.lstat(srcpath);\n          } catch (err) {\n            err.message = err.message.replace(\"lstat\", \"ensureSymlink\");\n            throw err;\n          }\n          return {\n            toCwd: srcpath,\n            toDst: srcpath\n          };\n        }\n        const dstdir = path5.dirname(dstpath);\n        const relativeToDst = path5.join(dstdir, srcpath);\n        const exists = yield pathExists(relativeToDst);\n        if (exists) {\n          return {\n            toCwd: relativeToDst,\n            toDst: srcpath\n          };\n        }\n        try {\n          yield fs6.lstat(srcpath);\n        } catch (err) {\n          err.message = err.message.replace(\"lstat\", \"ensureSymlink\");\n          throw err;\n        }\n        return {\n          toCwd: srcpath,\n          toDst: path5.relative(dstdir, srcpath)\n        };\n      });\n    }\n    function symlinkPathsSync(srcpath, dstpath) {\n      if (path5.isAbsolute(srcpath)) {\n        const exists2 = fs6.existsSync(srcpath);\n        if (!exists2) throw new Error(\"absolute srcpath does not exist\");\n        return {\n          toCwd: srcpath,\n          toDst: srcpath\n        };\n      }\n      const dstdir = path5.dirname(dstpath);\n      const relativeToDst = path5.join(dstdir, srcpath);\n      const exists = fs6.existsSync(relativeToDst);\n      if (exists) {\n        return {\n          toCwd: relativeToDst,\n          toDst: srcpath\n        };\n      }\n      const srcExists = fs6.existsSync(srcpath);\n      if (!srcExists) throw new Error(\"relative srcpath does not exist\");\n      return {\n        toCwd: srcpath,\n        toDst: path5.relative(dstdir, srcpath)\n      };\n    }\n    module2.exports = {\n      symlinkPaths: u(symlinkPaths),\n      symlinkPathsSync\n    };\n  }\n});\n\n// node_modules/fs-extra/lib/ensure/symlink-type.js\nvar require_symlink_type = __commonJS({\n  \"node_modules/fs-extra/lib/ensure/symlink-type.js\"(exports2, module2) {\n    \"use strict\";\n    var fs6 = require_fs5();\n    var u = require_universalify().fromPromise;\n    function symlinkType(srcpath, type) {\n      return __async(this, null, function* () {\n        if (type) return type;\n        let stats;\n        try {\n          stats = yield fs6.lstat(srcpath);\n        } catch (e) {\n          return \"file\";\n        }\n        return stats && stats.isDirectory() ? \"dir\" : \"file\";\n      });\n    }\n    function symlinkTypeSync(srcpath, type) {\n      if (type) return type;\n      let stats;\n      try {\n        stats = fs6.lstatSync(srcpath);\n      } catch (e) {\n        return \"file\";\n      }\n      return stats && stats.isDirectory() ? \"dir\" : \"file\";\n    }\n    module2.exports = {\n      symlinkType: u(symlinkType),\n      symlinkTypeSync\n    };\n  }\n});\n\n// node_modules/fs-extra/lib/ensure/symlink.js\nvar require_symlink = __commonJS({\n  \"node_modules/fs-extra/lib/ensure/symlink.js\"(exports2, module2) {\n    \"use strict\";\n    var u = require_universalify().fromPromise;\n    var path5 = require(\"path\");\n    var fs6 = require_fs5();\n    var { mkdirs, mkdirsSync } = require_mkdirs();\n    var { symlinkPaths, symlinkPathsSync } = require_symlink_paths();\n    var { symlinkType, symlinkTypeSync } = require_symlink_type();\n    var { pathExists } = require_path_exists();\n    var { areIdentical } = require_stat();\n    function createSymlink(srcpath, dstpath, type) {\n      return __async(this, null, function* () {\n        let stats;\n        try {\n          stats = yield fs6.lstat(dstpath);\n        } catch (e) {\n        }\n        if (stats && stats.isSymbolicLink()) {\n          const [srcStat, dstStat] = yield Promise.all([\n            fs6.stat(srcpath),\n            fs6.stat(dstpath)\n          ]);\n          if (areIdentical(srcStat, dstStat)) return;\n        }\n        const relative = yield symlinkPaths(srcpath, dstpath);\n        srcpath = relative.toDst;\n        const toType = yield symlinkType(relative.toCwd, type);\n        const dir = path5.dirname(dstpath);\n        if (!(yield pathExists(dir))) {\n          yield mkdirs(dir);\n        }\n        return fs6.symlink(srcpath, dstpath, toType);\n      });\n    }\n    function createSymlinkSync(srcpath, dstpath, type) {\n      let stats;\n      try {\n        stats = fs6.lstatSync(dstpath);\n      } catch (e) {\n      }\n      if (stats && stats.isSymbolicLink()) {\n        const srcStat = fs6.statSync(srcpath);\n        const dstStat = fs6.statSync(dstpath);\n        if (areIdentical(srcStat, dstStat)) return;\n      }\n      const relative = symlinkPathsSync(srcpath, dstpath);\n      srcpath = relative.toDst;\n      type = symlinkTypeSync(relative.toCwd, type);\n      const dir = path5.dirname(dstpath);\n      const exists = fs6.existsSync(dir);\n      if (exists) return fs6.symlinkSync(srcpath, dstpath, type);\n      mkdirsSync(dir);\n      return fs6.symlinkSync(srcpath, dstpath, type);\n    }\n    module2.exports = {\n      createSymlink: u(createSymlink),\n      createSymlinkSync\n    };\n  }\n});\n\n// node_modules/fs-extra/lib/ensure/index.js\nvar require_ensure = __commonJS({\n  \"node_modules/fs-extra/lib/ensure/index.js\"(exports2, module2) {\n    \"use strict\";\n    var { createFile, createFileSync } = require_file();\n    var { createLink, createLinkSync } = require_link();\n    var { createSymlink, createSymlinkSync } = require_symlink();\n    module2.exports = {\n      // file\n      createFile,\n      createFileSync,\n      ensureFile: createFile,\n      ensureFileSync: createFileSync,\n      // link\n      createLink,\n      createLinkSync,\n      ensureLink: createLink,\n      ensureLinkSync: createLinkSync,\n      // symlink\n      createSymlink,\n      createSymlinkSync,\n      ensureSymlink: createSymlink,\n      ensureSymlinkSync: createSymlinkSync\n    };\n  }\n});\n\n// node_modules/jsonfile/utils.js\nvar require_utils6 = __commonJS({\n  \"node_modules/jsonfile/utils.js\"(exports2, module2) {\n    \"use strict\";\n    function stringify6(obj, { EOL = \"\\n\", finalEOL = true, replacer = null, spaces } = {}) {\n      const EOF = finalEOL ? EOL : \"\";\n      const str = JSON.stringify(obj, replacer, spaces);\n      return str.replace(/\\n/g, EOL) + EOF;\n    }\n    function stripBom(content) {\n      if (Buffer.isBuffer(content)) content = content.toString(\"utf8\");\n      return content.replace(/^\\uFEFF/, \"\");\n    }\n    module2.exports = { stringify: stringify6, stripBom };\n  }\n});\n\n// node_modules/jsonfile/index.js\nvar require_jsonfile = __commonJS({\n  \"node_modules/jsonfile/index.js\"(exports2, module2) {\n    \"use strict\";\n    var _fs2;\n    try {\n      _fs2 = require_graceful_fs();\n    } catch (_) {\n      _fs2 = require(\"fs\");\n    }\n    var universalify = require_universalify();\n    var { stringify: stringify6, stripBom } = require_utils6();\n    function _readFile(_0) {\n      return __async(this, arguments, function* (file, options = {}) {\n        if (typeof options === \"string\") {\n          options = { encoding: options };\n        }\n        const fs6 = options.fs || _fs2;\n        const shouldThrow = \"throws\" in options ? options.throws : true;\n        let data = yield universalify.fromCallback(fs6.readFile)(file, options);\n        data = stripBom(data);\n        let obj;\n        try {\n          obj = JSON.parse(data, options ? options.reviver : null);\n        } catch (err) {\n          if (shouldThrow) {\n            err.message = `${file}: ${err.message}`;\n            throw err;\n          } else {\n            return null;\n          }\n        }\n        return obj;\n      });\n    }\n    var readFile = universalify.fromPromise(_readFile);\n    function readFileSync(file, options = {}) {\n      if (typeof options === \"string\") {\n        options = { encoding: options };\n      }\n      const fs6 = options.fs || _fs2;\n      const shouldThrow = \"throws\" in options ? options.throws : true;\n      try {\n        let content = fs6.readFileSync(file, options);\n        content = stripBom(content);\n        return JSON.parse(content, options.reviver);\n      } catch (err) {\n        if (shouldThrow) {\n          err.message = `${file}: ${err.message}`;\n          throw err;\n        } else {\n          return null;\n        }\n      }\n    }\n    function _writeFile(_0, _1) {\n      return __async(this, arguments, function* (file, obj, options = {}) {\n        const fs6 = options.fs || _fs2;\n        const str = stringify6(obj, options);\n        yield universalify.fromCallback(fs6.writeFile)(file, str, options);\n      });\n    }\n    var writeFile = universalify.fromPromise(_writeFile);\n    function writeFileSync(file, obj, options = {}) {\n      const fs6 = options.fs || _fs2;\n      const str = stringify6(obj, options);\n      return fs6.writeFileSync(file, str, options);\n    }\n    module2.exports = {\n      readFile,\n      readFileSync,\n      writeFile,\n      writeFileSync\n    };\n  }\n});\n\n// node_modules/fs-extra/lib/json/jsonfile.js\nvar require_jsonfile2 = __commonJS({\n  \"node_modules/fs-extra/lib/json/jsonfile.js\"(exports2, module2) {\n    \"use strict\";\n    var jsonFile = require_jsonfile();\n    module2.exports = {\n      // jsonfile exports\n      readJson: jsonFile.readFile,\n      readJsonSync: jsonFile.readFileSync,\n      writeJson: jsonFile.writeFile,\n      writeJsonSync: jsonFile.writeFileSync\n    };\n  }\n});\n\n// node_modules/fs-extra/lib/output-file/index.js\nvar require_output_file = __commonJS({\n  \"node_modules/fs-extra/lib/output-file/index.js\"(exports2, module2) {\n    \"use strict\";\n    var u = require_universalify().fromPromise;\n    var fs6 = require_fs5();\n    var path5 = require(\"path\");\n    var mkdir = require_mkdirs();\n    var pathExists = require_path_exists().pathExists;\n    function outputFile(file, data, encoding = \"utf-8\") {\n      return __async(this, null, function* () {\n        const dir = path5.dirname(file);\n        if (!(yield pathExists(dir))) {\n          yield mkdir.mkdirs(dir);\n        }\n        return fs6.writeFile(file, data, encoding);\n      });\n    }\n    function outputFileSync(file, ...args) {\n      const dir = path5.dirname(file);\n      if (!fs6.existsSync(dir)) {\n        mkdir.mkdirsSync(dir);\n      }\n      fs6.writeFileSync(file, ...args);\n    }\n    module2.exports = {\n      outputFile: u(outputFile),\n      outputFileSync\n    };\n  }\n});\n\n// node_modules/fs-extra/lib/json/output-json.js\nvar require_output_json = __commonJS({\n  \"node_modules/fs-extra/lib/json/output-json.js\"(exports2, module2) {\n    \"use strict\";\n    var { stringify: stringify6 } = require_utils6();\n    var { outputFile } = require_output_file();\n    function outputJson(_0, _1) {\n      return __async(this, arguments, function* (file, data, options = {}) {\n        const str = stringify6(data, options);\n        yield outputFile(file, str, options);\n      });\n    }\n    module2.exports = outputJson;\n  }\n});\n\n// node_modules/fs-extra/lib/json/output-json-sync.js\nvar require_output_json_sync = __commonJS({\n  \"node_modules/fs-extra/lib/json/output-json-sync.js\"(exports2, module2) {\n    \"use strict\";\n    var { stringify: stringify6 } = require_utils6();\n    var { outputFileSync } = require_output_file();\n    function outputJsonSync(file, data, options) {\n      const str = stringify6(data, options);\n      outputFileSync(file, str, options);\n    }\n    module2.exports = outputJsonSync;\n  }\n});\n\n// node_modules/fs-extra/lib/json/index.js\nvar require_json = __commonJS({\n  \"node_modules/fs-extra/lib/json/index.js\"(exports2, module2) {\n    \"use strict\";\n    var u = require_universalify().fromPromise;\n    var jsonFile = require_jsonfile2();\n    jsonFile.outputJson = u(require_output_json());\n    jsonFile.outputJsonSync = require_output_json_sync();\n    jsonFile.outputJSON = jsonFile.outputJson;\n    jsonFile.outputJSONSync = jsonFile.outputJsonSync;\n    jsonFile.writeJSON = jsonFile.writeJson;\n    jsonFile.writeJSONSync = jsonFile.writeJsonSync;\n    jsonFile.readJSON = jsonFile.readJson;\n    jsonFile.readJSONSync = jsonFile.readJsonSync;\n    module2.exports = jsonFile;\n  }\n});\n\n// node_modules/fs-extra/lib/move/move.js\nvar require_move = __commonJS({\n  \"node_modules/fs-extra/lib/move/move.js\"(exports2, module2) {\n    \"use strict\";\n    var fs6 = require_fs5();\n    var path5 = require(\"path\");\n    var { copy } = require_copy2();\n    var { remove } = require_remove();\n    var { mkdirp } = require_mkdirs();\n    var { pathExists } = require_path_exists();\n    var stat = require_stat();\n    function move(_0, _1) {\n      return __async(this, arguments, function* (src, dest, opts = {}) {\n        const overwrite = opts.overwrite || opts.clobber || false;\n        const { srcStat, isChangingCase = false } = yield stat.checkPaths(src, dest, \"move\", opts);\n        yield stat.checkParentPaths(src, srcStat, dest, \"move\");\n        const destParent = path5.dirname(dest);\n        const parsedParentPath = path5.parse(destParent);\n        if (parsedParentPath.root !== destParent) {\n          yield mkdirp(destParent);\n        }\n        return doRename(src, dest, overwrite, isChangingCase);\n      });\n    }\n    function doRename(src, dest, overwrite, isChangingCase) {\n      return __async(this, null, function* () {\n        if (!isChangingCase) {\n          if (overwrite) {\n            yield remove(dest);\n          } else if (yield pathExists(dest)) {\n            throw new Error(\"dest already exists.\");\n          }\n        }\n        try {\n          yield fs6.rename(src, dest);\n        } catch (err) {\n          if (err.code !== \"EXDEV\") {\n            throw err;\n          }\n          yield moveAcrossDevice(src, dest, overwrite);\n        }\n      });\n    }\n    function moveAcrossDevice(src, dest, overwrite) {\n      return __async(this, null, function* () {\n        const opts = {\n          overwrite,\n          errorOnExist: true,\n          preserveTimestamps: true\n        };\n        yield copy(src, dest, opts);\n        return remove(src);\n      });\n    }\n    module2.exports = move;\n  }\n});\n\n// node_modules/fs-extra/lib/move/move-sync.js\nvar require_move_sync = __commonJS({\n  \"node_modules/fs-extra/lib/move/move-sync.js\"(exports2, module2) {\n    \"use strict\";\n    var fs6 = require_graceful_fs();\n    var path5 = require(\"path\");\n    var copySync = require_copy2().copySync;\n    var removeSync = require_remove().removeSync;\n    var mkdirpSync = require_mkdirs().mkdirpSync;\n    var stat = require_stat();\n    function moveSync(src, dest, opts) {\n      opts = opts || {};\n      const overwrite = opts.overwrite || opts.clobber || false;\n      const { srcStat, isChangingCase = false } = stat.checkPathsSync(src, dest, \"move\", opts);\n      stat.checkParentPathsSync(src, srcStat, dest, \"move\");\n      if (!isParentRoot(dest)) mkdirpSync(path5.dirname(dest));\n      return doRename(src, dest, overwrite, isChangingCase);\n    }\n    function isParentRoot(dest) {\n      const parent = path5.dirname(dest);\n      const parsedPath = path5.parse(parent);\n      return parsedPath.root === parent;\n    }\n    function doRename(src, dest, overwrite, isChangingCase) {\n      if (isChangingCase) return rename(src, dest, overwrite);\n      if (overwrite) {\n        removeSync(dest);\n        return rename(src, dest, overwrite);\n      }\n      if (fs6.existsSync(dest)) throw new Error(\"dest already exists.\");\n      return rename(src, dest, overwrite);\n    }\n    function rename(src, dest, overwrite) {\n      try {\n        fs6.renameSync(src, dest);\n      } catch (err) {\n        if (err.code !== \"EXDEV\") throw err;\n        return moveAcrossDevice(src, dest, overwrite);\n      }\n    }\n    function moveAcrossDevice(src, dest, overwrite) {\n      const opts = {\n        overwrite,\n        errorOnExist: true,\n        preserveTimestamps: true\n      };\n      copySync(src, dest, opts);\n      return removeSync(src);\n    }\n    module2.exports = moveSync;\n  }\n});\n\n// node_modules/fs-extra/lib/move/index.js\nvar require_move2 = __commonJS({\n  \"node_modules/fs-extra/lib/move/index.js\"(exports2, module2) {\n    \"use strict\";\n    var u = require_universalify().fromPromise;\n    module2.exports = {\n      move: u(require_move()),\n      moveSync: require_move_sync()\n    };\n  }\n});\n\n// node_modules/fs-extra/lib/index.js\nvar require_lib = __commonJS({\n  \"node_modules/fs-extra/lib/index.js\"(exports2, module2) {\n    \"use strict\";\n    module2.exports = __spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, require_fs5()), require_copy2()), require_empty()), require_ensure()), require_json()), require_mkdirs()), require_move2()), require_output_file()), require_path_exists()), require_remove());\n  }\n});\n\n// node_modules/create-require/create-require.js\nvar require_create_require = __commonJS({\n  \"node_modules/create-require/create-require.js\"(exports2, module2) {\n    \"use strict\";\n    var nativeModule = require(\"module\");\n    var path5 = require(\"path\");\n    var fs6 = require(\"fs\");\n    function createRequire2(filename) {\n      if (!filename) {\n        filename = process.cwd();\n      }\n      if (isDir(filename)) {\n        filename = path5.join(filename, \"index.js\");\n      }\n      if (nativeModule.createRequire) {\n        return nativeModule.createRequire(filename);\n      }\n      if (nativeModule.createRequireFromPath) {\n        return nativeModule.createRequireFromPath(filename);\n      }\n      return _createRequire2(filename);\n    }\n    function _createRequire2(filename) {\n      const mod = new nativeModule.Module(filename, null);\n      mod.filename = filename;\n      mod.paths = nativeModule.Module._nodeModulePaths(path5.dirname(filename));\n      mod._compile(\"module.exports = require;\", filename);\n      return mod.exports;\n    }\n    function isDir(path6) {\n      try {\n        const stat = fs6.lstatSync(path6);\n        return stat.isDirectory();\n      } catch (e) {\n        return false;\n      }\n    }\n    module2.exports = createRequire2;\n  }\n});\n\n// node_modules/node-fetch-native/dist/shared/node-fetch-native.DfbY2q-x.mjs\nfunction f(e) {\n  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, \"default\") ? e.default : e;\n}\nvar t, o, n;\nvar init_node_fetch_native_DfbY2q_x = __esm({\n  \"node_modules/node-fetch-native/dist/shared/node-fetch-native.DfbY2q-x.mjs\"() {\n    \"use strict\";\n    t = Object.defineProperty;\n    o = (e, l) => t(e, \"name\", { value: l, configurable: true });\n    n = typeof globalThis < \"u\" ? globalThis : typeof window < \"u\" ? window : typeof global < \"u\" ? global : typeof self < \"u\" ? self : {};\n    o(f, \"getDefaultExportFromCjs\");\n  }\n});\n\n// node_modules/node-fetch-native/dist/chunks/multipart-parser.mjs\nvar multipart_parser_exports = {};\n__export(multipart_parser_exports, {\n  toFormData: () => Z\n});\nfunction v(u) {\n  const a = u.match(/\\bfilename=(\"(.*?)\"|([^()<>@,;:\\\\\"/[\\]?={}\\s\\t]+))($|;\\s)/i);\n  if (!a) return;\n  const n4 = a[2] || a[3] || \"\";\n  let r2 = n4.slice(n4.lastIndexOf(\"\\\\\") + 1);\n  return r2 = r2.replace(/%22/g, '\"'), r2 = r2.replace(/&#(\\d{4});/g, (d, l) => String.fromCharCode(l)), r2;\n}\nfunction Z(u, a) {\n  return __async(this, null, function* () {\n    if (!/multipart/i.test(a)) throw new TypeError(\"Failed to fetch\");\n    const n4 = a.match(/boundary=(?:\"([^\"]+)\"|([^;]+))/i);\n    if (!n4) throw new TypeError(\"no or bad content-type header, no multipart boundary\");\n    const r2 = new k(n4[1] || n4[2]);\n    let d, l, c2, p2, e, i;\n    const A = [], H2 = new br(), O2 = E((s) => {\n      c2 += f2.decode(s, { stream: true });\n    }, \"onPartData\"), y = E((s) => {\n      A.push(s);\n    }, \"appendToFile\"), o3 = E(() => {\n      const s = new qn(A, i, { type: e });\n      H2.append(p2, s);\n    }, \"appendFileToFormData\"), L = E(() => {\n      H2.append(p2, c2);\n    }, \"appendEntryToFormData\"), f2 = new TextDecoder(\"utf-8\");\n    f2.decode(), r2.onPartBegin = function() {\n      r2.onPartData = O2, r2.onPartEnd = L, d = \"\", l = \"\", c2 = \"\", p2 = \"\", e = \"\", i = null, A.length = 0;\n    }, r2.onHeaderField = function(s) {\n      d += f2.decode(s, { stream: true });\n    }, r2.onHeaderValue = function(s) {\n      l += f2.decode(s, { stream: true });\n    }, r2.onHeaderEnd = function() {\n      if (l += f2.decode(), d = d.toLowerCase(), d === \"content-disposition\") {\n        const s = l.match(/\\bname=(\"([^\"]*)\"|([^()<>@,;:\\\\\"/[\\]?={}\\s\\t]+))/i);\n        s && (p2 = s[2] || s[3] || \"\"), i = v(l), i && (r2.onPartData = y, r2.onPartEnd = o3);\n      } else d === \"content-type\" && (e = l);\n      l = \"\", d = \"\";\n    };\n    try {\n      for (var iter = __forAwait(u), more, temp, error; more = !(temp = yield iter.next()).done; more = false) {\n        const s = temp.value;\n        r2.write(s);\n      }\n    } catch (temp) {\n      error = [temp];\n    } finally {\n      try {\n        more && (temp = iter.return) && (yield temp.call(iter));\n      } finally {\n        if (error)\n          throw error[0];\n      }\n    }\n    return r2.end(), H2;\n  });\n}\nvar B, E, D, t2, w, R, g, N, x, P, C, I, M, $, m, F, k;\nvar init_multipart_parser = __esm({\n  \"node_modules/node-fetch-native/dist/chunks/multipart-parser.mjs\"() {\n    \"use strict\";\n    init_node();\n    init_node_fetch_native_DfbY2q_x();\n    B = Object.defineProperty;\n    E = (u, a) => B(u, \"name\", { value: a, configurable: true });\n    D = 0;\n    t2 = { START_BOUNDARY: D++, HEADER_FIELD_START: D++, HEADER_FIELD: D++, HEADER_VALUE_START: D++, HEADER_VALUE: D++, HEADER_VALUE_ALMOST_DONE: D++, HEADERS_ALMOST_DONE: D++, PART_DATA_START: D++, PART_DATA: D++, END: D++ };\n    w = 1;\n    R = { PART_BOUNDARY: w, LAST_BOUNDARY: w *= 2 };\n    g = 10;\n    N = 13;\n    x = 32;\n    P = 45;\n    C = 58;\n    I = 97;\n    M = 122;\n    $ = E((u) => u | 32, \"lower\");\n    m = E(() => {\n    }, \"noop\");\n    F = class F2 {\n      constructor(a) {\n        this.index = 0, this.flags = 0, this.onHeaderEnd = m, this.onHeaderField = m, this.onHeadersEnd = m, this.onHeaderValue = m, this.onPartBegin = m, this.onPartData = m, this.onPartEnd = m, this.boundaryChars = {}, a = `\\r\n--` + a;\n        const n4 = new Uint8Array(a.length);\n        for (let r2 = 0; r2 < a.length; r2++) n4[r2] = a.charCodeAt(r2), this.boundaryChars[n4[r2]] = true;\n        this.boundary = n4, this.lookbehind = new Uint8Array(this.boundary.length + 8), this.state = t2.START_BOUNDARY;\n      }\n      write(a) {\n        let n4 = 0;\n        const r2 = a.length;\n        let d = this.index, { lookbehind: l, boundary: c2, boundaryChars: p2, index: e, state: i, flags: A } = this;\n        const H2 = this.boundary.length, O2 = H2 - 1, y = a.length;\n        let o3, L;\n        const f2 = E((h2) => {\n          this[h2 + \"Mark\"] = n4;\n        }, \"mark\"), s = E((h2) => {\n          delete this[h2 + \"Mark\"];\n        }, \"clear\"), T2 = E((h2, S, _, U) => {\n          (S === void 0 || S !== _) && this[h2](U && U.subarray(S, _));\n        }, \"callback\"), b = E((h2, S) => {\n          const _ = h2 + \"Mark\";\n          _ in this && (S ? (T2(h2, this[_], n4, a), delete this[_]) : (T2(h2, this[_], a.length, a), this[_] = 0));\n        }, \"dataCallback\");\n        for (n4 = 0; n4 < r2; n4++) switch (o3 = a[n4], i) {\n          case t2.START_BOUNDARY:\n            if (e === c2.length - 2) {\n              if (o3 === P) A |= R.LAST_BOUNDARY;\n              else if (o3 !== N) return;\n              e++;\n              break;\n            } else if (e - 1 === c2.length - 2) {\n              if (A & R.LAST_BOUNDARY && o3 === P) i = t2.END, A = 0;\n              else if (!(A & R.LAST_BOUNDARY) && o3 === g) e = 0, T2(\"onPartBegin\"), i = t2.HEADER_FIELD_START;\n              else return;\n              break;\n            }\n            o3 !== c2[e + 2] && (e = -2), o3 === c2[e + 2] && e++;\n            break;\n          case t2.HEADER_FIELD_START:\n            i = t2.HEADER_FIELD, f2(\"onHeaderField\"), e = 0;\n          case t2.HEADER_FIELD:\n            if (o3 === N) {\n              s(\"onHeaderField\"), i = t2.HEADERS_ALMOST_DONE;\n              break;\n            }\n            if (e++, o3 === P) break;\n            if (o3 === C) {\n              if (e === 1) return;\n              b(\"onHeaderField\", true), i = t2.HEADER_VALUE_START;\n              break;\n            }\n            if (L = $(o3), L < I || L > M) return;\n            break;\n          case t2.HEADER_VALUE_START:\n            if (o3 === x) break;\n            f2(\"onHeaderValue\"), i = t2.HEADER_VALUE;\n          case t2.HEADER_VALUE:\n            o3 === N && (b(\"onHeaderValue\", true), T2(\"onHeaderEnd\"), i = t2.HEADER_VALUE_ALMOST_DONE);\n            break;\n          case t2.HEADER_VALUE_ALMOST_DONE:\n            if (o3 !== g) return;\n            i = t2.HEADER_FIELD_START;\n            break;\n          case t2.HEADERS_ALMOST_DONE:\n            if (o3 !== g) return;\n            T2(\"onHeadersEnd\"), i = t2.PART_DATA_START;\n            break;\n          case t2.PART_DATA_START:\n            i = t2.PART_DATA, f2(\"onPartData\");\n          case t2.PART_DATA:\n            if (d = e, e === 0) {\n              for (n4 += O2; n4 < y && !(a[n4] in p2); ) n4 += H2;\n              n4 -= O2, o3 = a[n4];\n            }\n            if (e < c2.length) c2[e] === o3 ? (e === 0 && b(\"onPartData\", true), e++) : e = 0;\n            else if (e === c2.length) e++, o3 === N ? A |= R.PART_BOUNDARY : o3 === P ? A |= R.LAST_BOUNDARY : e = 0;\n            else if (e - 1 === c2.length) if (A & R.PART_BOUNDARY) {\n              if (e = 0, o3 === g) {\n                A &= ~R.PART_BOUNDARY, T2(\"onPartEnd\"), T2(\"onPartBegin\"), i = t2.HEADER_FIELD_START;\n                break;\n              }\n            } else A & R.LAST_BOUNDARY && o3 === P ? (T2(\"onPartEnd\"), i = t2.END, A = 0) : e = 0;\n            if (e > 0) l[e - 1] = o3;\n            else if (d > 0) {\n              const h2 = new Uint8Array(l.buffer, l.byteOffset, l.byteLength);\n              T2(\"onPartData\", 0, d, h2), d = 0, f2(\"onPartData\"), n4--;\n            }\n            break;\n          case t2.END:\n            break;\n          default:\n            throw new Error(`Unexpected state entered: ${i}`);\n        }\n        b(\"onHeaderField\"), b(\"onHeaderValue\"), b(\"onPartData\"), this.index = e, this.state = i, this.flags = A;\n      }\n      end() {\n        if (this.state === t2.HEADER_FIELD_START && this.index === 0 || this.state === t2.PART_DATA && this.index === this.boundary.length) this.onPartEnd();\n        else if (this.state !== t2.END) throw new Error(\"MultipartParser.end(): stream ended unexpectedly\");\n      }\n    };\n    E(F, \"MultipartParser\");\n    k = F;\n    E(v, \"_fileName\");\n    E(Z, \"toFormData\");\n  }\n});\n\n// node_modules/node-fetch-native/dist/node.mjs\nfunction Us(i) {\n  if (!/^data:/i.test(i)) throw new TypeError('`uri` does not appear to be a Data URI (must begin with \"data:\")');\n  i = i.replace(/\\r?\\n/g, \"\");\n  const o3 = i.indexOf(\",\");\n  if (o3 === -1 || o3 <= 4) throw new TypeError(\"malformed data: URI\");\n  const a = i.substring(5, o3).split(\";\");\n  let f2 = \"\", l = false;\n  const p2 = a[0] || \"text/plain\";\n  let h2 = p2;\n  for (let A = 1; A < a.length; A++) a[A] === \"base64\" ? l = true : a[A] && (h2 += `;${a[A]}`, a[A].indexOf(\"charset=\") === 0 && (f2 = a[A].substring(8)));\n  !a[0] && !f2.length && (h2 += \";charset=US-ASCII\", f2 = \"US-ASCII\");\n  const S = l ? \"base64\" : \"ascii\", v2 = unescape(i.substring(o3 + 1)), w2 = Buffer.from(v2, S);\n  return w2.type = p2, w2.typeFull = h2, w2.charset = f2, w2;\n}\nfunction Ns() {\n  return bi || (bi = 1, (function(i, o3) {\n    (function(a, f2) {\n      f2(o3);\n    })(xs, function(a) {\n      function f2() {\n      }\n      n2(f2, \"noop\");\n      function l(e) {\n        return typeof e == \"object\" && e !== null || typeof e == \"function\";\n      }\n      n2(l, \"typeIsObject\");\n      const p2 = f2;\n      function h2(e, t3) {\n        try {\n          Object.defineProperty(e, \"name\", { value: t3, configurable: true });\n        } catch (e2) {\n        }\n      }\n      n2(h2, \"setFunctionName\");\n      const S = Promise, v2 = Promise.prototype.then, w2 = Promise.reject.bind(S);\n      function A(e) {\n        return new S(e);\n      }\n      n2(A, \"newPromise\");\n      function T2(e) {\n        return A((t3) => t3(e));\n      }\n      n2(T2, \"promiseResolvedWith\");\n      function b(e) {\n        return w2(e);\n      }\n      n2(b, \"promiseRejectedWith\");\n      function q(e, t3, r2) {\n        return v2.call(e, t3, r2);\n      }\n      n2(q, \"PerformPromiseThen\");\n      function g2(e, t3, r2) {\n        q(q(e, t3, r2), void 0, p2);\n      }\n      n2(g2, \"uponPromise\");\n      function V(e, t3) {\n        g2(e, t3);\n      }\n      n2(V, \"uponFulfillment\");\n      function I2(e, t3) {\n        g2(e, void 0, t3);\n      }\n      n2(I2, \"uponRejection\");\n      function F4(e, t3, r2) {\n        return q(e, t3, r2);\n      }\n      n2(F4, \"transformPromiseWith\");\n      function Q(e) {\n        q(e, void 0, p2);\n      }\n      n2(Q, \"setPromiseIsHandledToTrue\");\n      let ge = n2((e) => {\n        if (typeof queueMicrotask == \"function\") ge = queueMicrotask;\n        else {\n          const t3 = T2(void 0);\n          ge = n2((r2) => q(t3, r2), \"_queueMicrotask\");\n        }\n        return ge(e);\n      }, \"_queueMicrotask\");\n      function z(e, t3, r2) {\n        if (typeof e != \"function\") throw new TypeError(\"Argument is not a function\");\n        return Function.prototype.apply.call(e, t3, r2);\n      }\n      n2(z, \"reflectCall\");\n      function j(e, t3, r2) {\n        try {\n          return T2(z(e, t3, r2));\n        } catch (s) {\n          return b(s);\n        }\n      }\n      n2(j, \"promiseCall\");\n      const U = 16384, bn = class bn {\n        constructor() {\n          this._cursor = 0, this._size = 0, this._front = { _elements: [], _next: void 0 }, this._back = this._front, this._cursor = 0, this._size = 0;\n        }\n        get length() {\n          return this._size;\n        }\n        push(t3) {\n          const r2 = this._back;\n          let s = r2;\n          r2._elements.length === U - 1 && (s = { _elements: [], _next: void 0 }), r2._elements.push(t3), s !== r2 && (this._back = s, r2._next = s), ++this._size;\n        }\n        shift() {\n          const t3 = this._front;\n          let r2 = t3;\n          const s = this._cursor;\n          let u = s + 1;\n          const c2 = t3._elements, d = c2[s];\n          return u === U && (r2 = t3._next, u = 0), --this._size, this._cursor = u, t3 !== r2 && (this._front = r2), c2[s] = void 0, d;\n        }\n        forEach(t3) {\n          let r2 = this._cursor, s = this._front, u = s._elements;\n          for (; (r2 !== u.length || s._next !== void 0) && !(r2 === u.length && (s = s._next, u = s._elements, r2 = 0, u.length === 0)); ) t3(u[r2]), ++r2;\n        }\n        peek() {\n          const t3 = this._front, r2 = this._cursor;\n          return t3._elements[r2];\n        }\n      };\n      n2(bn, \"SimpleQueue\");\n      let D2 = bn;\n      const jt = /* @__PURE__ */ Symbol(\"[[AbortSteps]]\"), Qn = /* @__PURE__ */ Symbol(\"[[ErrorSteps]]\"), Ar = /* @__PURE__ */ Symbol(\"[[CancelSteps]]\"), Br = /* @__PURE__ */ Symbol(\"[[PullSteps]]\"), kr = /* @__PURE__ */ Symbol(\"[[ReleaseSteps]]\");\n      function Yn(e, t3) {\n        e._ownerReadableStream = t3, t3._reader = e, t3._state === \"readable\" ? qr(e) : t3._state === \"closed\" ? xi(e) : Gn(e, t3._storedError);\n      }\n      n2(Yn, \"ReadableStreamReaderGenericInitialize\");\n      function Wr(e, t3) {\n        const r2 = e._ownerReadableStream;\n        return ie(r2, t3);\n      }\n      n2(Wr, \"ReadableStreamReaderGenericCancel\");\n      function _e(e) {\n        const t3 = e._ownerReadableStream;\n        t3._state === \"readable\" ? Or(e, new TypeError(\"Reader was released and can no longer be used to monitor the stream's closedness\")) : Ni(e, new TypeError(\"Reader was released and can no longer be used to monitor the stream's closedness\")), t3._readableStreamController[kr](), t3._reader = void 0, e._ownerReadableStream = void 0;\n      }\n      n2(_e, \"ReadableStreamReaderGenericRelease\");\n      function Lt(e) {\n        return new TypeError(\"Cannot \" + e + \" a stream using a released reader\");\n      }\n      n2(Lt, \"readerLockException\");\n      function qr(e) {\n        e._closedPromise = A((t3, r2) => {\n          e._closedPromise_resolve = t3, e._closedPromise_reject = r2;\n        });\n      }\n      n2(qr, \"defaultReaderClosedPromiseInitialize\");\n      function Gn(e, t3) {\n        qr(e), Or(e, t3);\n      }\n      n2(Gn, \"defaultReaderClosedPromiseInitializeAsRejected\");\n      function xi(e) {\n        qr(e), Zn(e);\n      }\n      n2(xi, \"defaultReaderClosedPromiseInitializeAsResolved\");\n      function Or(e, t3) {\n        e._closedPromise_reject !== void 0 && (Q(e._closedPromise), e._closedPromise_reject(t3), e._closedPromise_resolve = void 0, e._closedPromise_reject = void 0);\n      }\n      n2(Or, \"defaultReaderClosedPromiseReject\");\n      function Ni(e, t3) {\n        Gn(e, t3);\n      }\n      n2(Ni, \"defaultReaderClosedPromiseResetToRejected\");\n      function Zn(e) {\n        e._closedPromise_resolve !== void 0 && (e._closedPromise_resolve(void 0), e._closedPromise_resolve = void 0, e._closedPromise_reject = void 0);\n      }\n      n2(Zn, \"defaultReaderClosedPromiseResolve\");\n      const Kn = Number.isFinite || function(e) {\n        return typeof e == \"number\" && isFinite(e);\n      }, Hi = Math.trunc || function(e) {\n        return e < 0 ? Math.ceil(e) : Math.floor(e);\n      };\n      function Vi(e) {\n        return typeof e == \"object\" || typeof e == \"function\";\n      }\n      n2(Vi, \"isDictionary\");\n      function ue(e, t3) {\n        if (e !== void 0 && !Vi(e)) throw new TypeError(`${t3} is not an object.`);\n      }\n      n2(ue, \"assertDictionary\");\n      function Z2(e, t3) {\n        if (typeof e != \"function\") throw new TypeError(`${t3} is not a function.`);\n      }\n      n2(Z2, \"assertFunction\");\n      function Qi(e) {\n        return typeof e == \"object\" && e !== null || typeof e == \"function\";\n      }\n      n2(Qi, \"isObject\");\n      function Jn(e, t3) {\n        if (!Qi(e)) throw new TypeError(`${t3} is not an object.`);\n      }\n      n2(Jn, \"assertObject\");\n      function Se(e, t3, r2) {\n        if (e === void 0) throw new TypeError(`Parameter ${t3} is required in '${r2}'.`);\n      }\n      n2(Se, \"assertRequiredArgument\");\n      function zr(e, t3, r2) {\n        if (e === void 0) throw new TypeError(`${t3} is required in '${r2}'.`);\n      }\n      n2(zr, \"assertRequiredField\");\n      function Ir(e) {\n        return Number(e);\n      }\n      n2(Ir, \"convertUnrestrictedDouble\");\n      function Xn(e) {\n        return e === 0 ? 0 : e;\n      }\n      n2(Xn, \"censorNegativeZero\");\n      function Yi(e) {\n        return Xn(Hi(e));\n      }\n      n2(Yi, \"integerPart\");\n      function Fr(e, t3) {\n        const s = Number.MAX_SAFE_INTEGER;\n        let u = Number(e);\n        if (u = Xn(u), !Kn(u)) throw new TypeError(`${t3} is not a finite number`);\n        if (u = Yi(u), u < 0 || u > s) throw new TypeError(`${t3} is outside the accepted range of 0 to ${s}, inclusive`);\n        return !Kn(u) || u === 0 ? 0 : u;\n      }\n      n2(Fr, \"convertUnsignedLongLongWithEnforceRange\");\n      function jr(e, t3) {\n        if (!We(e)) throw new TypeError(`${t3} is not a ReadableStream.`);\n      }\n      n2(jr, \"assertReadableStream\");\n      function Qe(e) {\n        return new fe(e);\n      }\n      n2(Qe, \"AcquireReadableStreamDefaultReader\");\n      function eo(e, t3) {\n        e._reader._readRequests.push(t3);\n      }\n      n2(eo, \"ReadableStreamAddReadRequest\");\n      function Lr(e, t3, r2) {\n        const u = e._reader._readRequests.shift();\n        r2 ? u._closeSteps() : u._chunkSteps(t3);\n      }\n      n2(Lr, \"ReadableStreamFulfillReadRequest\");\n      function $t(e) {\n        return e._reader._readRequests.length;\n      }\n      n2($t, \"ReadableStreamGetNumReadRequests\");\n      function to(e) {\n        const t3 = e._reader;\n        return !(t3 === void 0 || !Ee(t3));\n      }\n      n2(to, \"ReadableStreamHasDefaultReader\");\n      const mn = class mn {\n        constructor(t3) {\n          if (Se(t3, 1, \"ReadableStreamDefaultReader\"), jr(t3, \"First parameter\"), qe(t3)) throw new TypeError(\"This stream has already been locked for exclusive reading by another reader\");\n          Yn(this, t3), this._readRequests = new D2();\n        }\n        get closed() {\n          return Ee(this) ? this._closedPromise : b(Dt(\"closed\"));\n        }\n        cancel(t3 = void 0) {\n          return Ee(this) ? this._ownerReadableStream === void 0 ? b(Lt(\"cancel\")) : Wr(this, t3) : b(Dt(\"cancel\"));\n        }\n        read() {\n          if (!Ee(this)) return b(Dt(\"read\"));\n          if (this._ownerReadableStream === void 0) return b(Lt(\"read from\"));\n          let t3, r2;\n          const s = A((c2, d) => {\n            t3 = c2, r2 = d;\n          });\n          return _t(this, { _chunkSteps: n2((c2) => t3({ value: c2, done: false }), \"_chunkSteps\"), _closeSteps: n2(() => t3({ value: void 0, done: true }), \"_closeSteps\"), _errorSteps: n2((c2) => r2(c2), \"_errorSteps\") }), s;\n        }\n        releaseLock() {\n          if (!Ee(this)) throw Dt(\"releaseLock\");\n          this._ownerReadableStream !== void 0 && Gi(this);\n        }\n      };\n      n2(mn, \"ReadableStreamDefaultReader\");\n      let fe = mn;\n      Object.defineProperties(fe.prototype, { cancel: { enumerable: true }, read: { enumerable: true }, releaseLock: { enumerable: true }, closed: { enumerable: true } }), h2(fe.prototype.cancel, \"cancel\"), h2(fe.prototype.read, \"read\"), h2(fe.prototype.releaseLock, \"releaseLock\"), typeof Symbol.toStringTag == \"symbol\" && Object.defineProperty(fe.prototype, Symbol.toStringTag, { value: \"ReadableStreamDefaultReader\", configurable: true });\n      function Ee(e) {\n        return !l(e) || !Object.prototype.hasOwnProperty.call(e, \"_readRequests\") ? false : e instanceof fe;\n      }\n      n2(Ee, \"IsReadableStreamDefaultReader\");\n      function _t(e, t3) {\n        const r2 = e._ownerReadableStream;\n        r2._disturbed = true, r2._state === \"closed\" ? t3._closeSteps() : r2._state === \"errored\" ? t3._errorSteps(r2._storedError) : r2._readableStreamController[Br](t3);\n      }\n      n2(_t, \"ReadableStreamDefaultReaderRead\");\n      function Gi(e) {\n        _e(e);\n        const t3 = new TypeError(\"Reader was released\");\n        ro(e, t3);\n      }\n      n2(Gi, \"ReadableStreamDefaultReaderRelease\");\n      function ro(e, t3) {\n        const r2 = e._readRequests;\n        e._readRequests = new D2(), r2.forEach((s) => {\n          s._errorSteps(t3);\n        });\n      }\n      n2(ro, \"ReadableStreamDefaultReaderErrorReadRequests\");\n      function Dt(e) {\n        return new TypeError(`ReadableStreamDefaultReader.prototype.${e} can only be used on a ReadableStreamDefaultReader`);\n      }\n      n2(Dt, \"defaultReaderBrandCheckException\");\n      const Zi = Object.getPrototypeOf(Object.getPrototypeOf(function() {\n        return __asyncGenerator(this, null, function* () {\n        });\n      }).prototype || {}), yn = class yn {\n        constructor(t3, r2) {\n          this._ongoingPromise = void 0, this._isFinished = false, this._reader = t3, this._preventCancel = r2;\n        }\n        next() {\n          const t3 = n2(() => this._nextSteps(), \"nextSteps\");\n          return this._ongoingPromise = this._ongoingPromise ? F4(this._ongoingPromise, t3, t3) : t3(), this._ongoingPromise;\n        }\n        return(t3) {\n          const r2 = n2(() => this._returnSteps(t3), \"returnSteps\");\n          return this._ongoingPromise ? F4(this._ongoingPromise, r2, r2) : r2();\n        }\n        _nextSteps() {\n          if (this._isFinished) return Promise.resolve({ value: void 0, done: true });\n          const t3 = this._reader;\n          let r2, s;\n          const u = A((d, m2) => {\n            r2 = d, s = m2;\n          });\n          return _t(t3, { _chunkSteps: n2((d) => {\n            this._ongoingPromise = void 0, ge(() => r2({ value: d, done: false }));\n          }, \"_chunkSteps\"), _closeSteps: n2(() => {\n            this._ongoingPromise = void 0, this._isFinished = true, _e(t3), r2({ value: void 0, done: true });\n          }, \"_closeSteps\"), _errorSteps: n2((d) => {\n            this._ongoingPromise = void 0, this._isFinished = true, _e(t3), s(d);\n          }, \"_errorSteps\") }), u;\n        }\n        _returnSteps(t3) {\n          if (this._isFinished) return Promise.resolve({ value: t3, done: true });\n          this._isFinished = true;\n          const r2 = this._reader;\n          if (!this._preventCancel) {\n            const s = Wr(r2, t3);\n            return _e(r2), F4(s, () => ({ value: t3, done: true }));\n          }\n          return _e(r2), T2({ value: t3, done: true });\n        }\n      };\n      n2(yn, \"ReadableStreamAsyncIteratorImpl\");\n      let Mt = yn;\n      const no = { next() {\n        return oo(this) ? this._asyncIteratorImpl.next() : b(io(\"next\"));\n      }, return(e) {\n        return oo(this) ? this._asyncIteratorImpl.return(e) : b(io(\"return\"));\n      } };\n      Object.setPrototypeOf(no, Zi);\n      function Ki(e, t3) {\n        const r2 = Qe(e), s = new Mt(r2, t3), u = Object.create(no);\n        return u._asyncIteratorImpl = s, u;\n      }\n      n2(Ki, \"AcquireReadableStreamAsyncIterator\");\n      function oo(e) {\n        if (!l(e) || !Object.prototype.hasOwnProperty.call(e, \"_asyncIteratorImpl\")) return false;\n        try {\n          return e._asyncIteratorImpl instanceof Mt;\n        } catch (e2) {\n          return false;\n        }\n      }\n      n2(oo, \"IsReadableStreamAsyncIterator\");\n      function io(e) {\n        return new TypeError(`ReadableStreamAsyncIterator.${e} can only be used on a ReadableSteamAsyncIterator`);\n      }\n      n2(io, \"streamAsyncIteratorBrandCheckException\");\n      const ao = Number.isNaN || function(e) {\n        return e !== e;\n      };\n      var $r, Dr, Mr;\n      function St(e) {\n        return e.slice();\n      }\n      n2(St, \"CreateArrayFromList\");\n      function so(e, t3, r2, s, u) {\n        new Uint8Array(e).set(new Uint8Array(r2, s, u), t3);\n      }\n      n2(so, \"CopyDataBlockBytes\");\n      let we = n2((e) => (typeof e.transfer == \"function\" ? we = n2((t3) => t3.transfer(), \"TransferArrayBuffer\") : typeof structuredClone == \"function\" ? we = n2((t3) => structuredClone(t3, { transfer: [t3] }), \"TransferArrayBuffer\") : we = n2((t3) => t3, \"TransferArrayBuffer\"), we(e)), \"TransferArrayBuffer\"), Ae = n2((e) => (typeof e.detached == \"boolean\" ? Ae = n2((t3) => t3.detached, \"IsDetachedBuffer\") : Ae = n2((t3) => t3.byteLength === 0, \"IsDetachedBuffer\"), Ae(e)), \"IsDetachedBuffer\");\n      function lo(e, t3, r2) {\n        if (e.slice) return e.slice(t3, r2);\n        const s = r2 - t3, u = new ArrayBuffer(s);\n        return so(u, 0, e, t3, s), u;\n      }\n      n2(lo, \"ArrayBufferSlice\");\n      function Ut(e, t3) {\n        const r2 = e[t3];\n        if (r2 != null) {\n          if (typeof r2 != \"function\") throw new TypeError(`${String(t3)} is not a function`);\n          return r2;\n        }\n      }\n      n2(Ut, \"GetMethod\");\n      function Ji(e) {\n        const t3 = { [Symbol.iterator]: () => e.iterator }, r2 = (function() {\n          return __asyncGenerator(this, null, function* () {\n            return yield* __yieldStar(t3);\n          });\n        })(), s = r2.next;\n        return { iterator: r2, nextMethod: s, done: false };\n      }\n      n2(Ji, \"CreateAsyncFromSyncIterator\");\n      const Ur = (Mr = ($r = Symbol.asyncIterator) !== null && $r !== void 0 ? $r : (Dr = Symbol.for) === null || Dr === void 0 ? void 0 : Dr.call(Symbol, \"Symbol.asyncIterator\")) !== null && Mr !== void 0 ? Mr : \"@@asyncIterator\";\n      function uo(e, t3 = \"sync\", r2) {\n        if (r2 === void 0) if (t3 === \"async\") {\n          if (r2 = Ut(e, Ur), r2 === void 0) {\n            const c2 = Ut(e, Symbol.iterator), d = uo(e, \"sync\", c2);\n            return Ji(d);\n          }\n        } else r2 = Ut(e, Symbol.iterator);\n        if (r2 === void 0) throw new TypeError(\"The object is not iterable\");\n        const s = z(r2, e, []);\n        if (!l(s)) throw new TypeError(\"The iterator method must return an object\");\n        const u = s.next;\n        return { iterator: s, nextMethod: u, done: false };\n      }\n      n2(uo, \"GetIterator\");\n      function Xi(e) {\n        const t3 = z(e.nextMethod, e.iterator, []);\n        if (!l(t3)) throw new TypeError(\"The iterator.next() method must return an object\");\n        return t3;\n      }\n      n2(Xi, \"IteratorNext\");\n      function ea(e) {\n        return !!e.done;\n      }\n      n2(ea, \"IteratorComplete\");\n      function ta(e) {\n        return e.value;\n      }\n      n2(ta, \"IteratorValue\");\n      function ra(e) {\n        return !(typeof e != \"number\" || ao(e) || e < 0);\n      }\n      n2(ra, \"IsNonNegativeNumber\");\n      function fo(e) {\n        const t3 = lo(e.buffer, e.byteOffset, e.byteOffset + e.byteLength);\n        return new Uint8Array(t3);\n      }\n      n2(fo, \"CloneAsUint8Array\");\n      function xr(e) {\n        const t3 = e._queue.shift();\n        return e._queueTotalSize -= t3.size, e._queueTotalSize < 0 && (e._queueTotalSize = 0), t3.value;\n      }\n      n2(xr, \"DequeueValue\");\n      function Nr(e, t3, r2) {\n        if (!ra(r2) || r2 === 1 / 0) throw new RangeError(\"Size must be a finite, non-NaN, non-negative number.\");\n        e._queue.push({ value: t3, size: r2 }), e._queueTotalSize += r2;\n      }\n      n2(Nr, \"EnqueueValueWithSize\");\n      function na(e) {\n        return e._queue.peek().value;\n      }\n      n2(na, \"PeekQueueValue\");\n      function Be(e) {\n        e._queue = new D2(), e._queueTotalSize = 0;\n      }\n      n2(Be, \"ResetQueue\");\n      function co(e) {\n        return e === DataView;\n      }\n      n2(co, \"isDataViewConstructor\");\n      function oa(e) {\n        return co(e.constructor);\n      }\n      n2(oa, \"isDataView\");\n      function ia(e) {\n        return co(e) ? 1 : e.BYTES_PER_ELEMENT;\n      }\n      n2(ia, \"arrayBufferViewElementSize\");\n      const gn = class gn {\n        constructor() {\n          throw new TypeError(\"Illegal constructor\");\n        }\n        get view() {\n          if (!Hr(this)) throw Zr(\"view\");\n          return this._view;\n        }\n        respond(t3) {\n          if (!Hr(this)) throw Zr(\"respond\");\n          if (Se(t3, 1, \"respond\"), t3 = Fr(t3, \"First parameter\"), this._associatedReadableByteStreamController === void 0) throw new TypeError(\"This BYOB request has been invalidated\");\n          if (Ae(this._view.buffer)) throw new TypeError(\"The BYOB request's buffer has been detached and so cannot be used as a response\");\n          Vt(this._associatedReadableByteStreamController, t3);\n        }\n        respondWithNewView(t3) {\n          if (!Hr(this)) throw Zr(\"respondWithNewView\");\n          if (Se(t3, 1, \"respondWithNewView\"), !ArrayBuffer.isView(t3)) throw new TypeError(\"You can only respond with array buffer views\");\n          if (this._associatedReadableByteStreamController === void 0) throw new TypeError(\"This BYOB request has been invalidated\");\n          if (Ae(t3.buffer)) throw new TypeError(\"The given view's buffer has been detached and so cannot be used as a response\");\n          Qt(this._associatedReadableByteStreamController, t3);\n        }\n      };\n      n2(gn, \"ReadableStreamBYOBRequest\");\n      let Re = gn;\n      Object.defineProperties(Re.prototype, { respond: { enumerable: true }, respondWithNewView: { enumerable: true }, view: { enumerable: true } }), h2(Re.prototype.respond, \"respond\"), h2(Re.prototype.respondWithNewView, \"respondWithNewView\"), typeof Symbol.toStringTag == \"symbol\" && Object.defineProperty(Re.prototype, Symbol.toStringTag, { value: \"ReadableStreamBYOBRequest\", configurable: true });\n      const _n = class _n {\n        constructor() {\n          throw new TypeError(\"Illegal constructor\");\n        }\n        get byobRequest() {\n          if (!Ie(this)) throw Rt(\"byobRequest\");\n          return Gr(this);\n        }\n        get desiredSize() {\n          if (!Ie(this)) throw Rt(\"desiredSize\");\n          return Ro(this);\n        }\n        close() {\n          if (!Ie(this)) throw Rt(\"close\");\n          if (this._closeRequested) throw new TypeError(\"The stream has already been closed; do not close it again!\");\n          const t3 = this._controlledReadableByteStream._state;\n          if (t3 !== \"readable\") throw new TypeError(`The stream (in ${t3} state) is not in the readable state and cannot be closed`);\n          wt(this);\n        }\n        enqueue(t3) {\n          if (!Ie(this)) throw Rt(\"enqueue\");\n          if (Se(t3, 1, \"enqueue\"), !ArrayBuffer.isView(t3)) throw new TypeError(\"chunk must be an array buffer view\");\n          if (t3.byteLength === 0) throw new TypeError(\"chunk must have non-zero byteLength\");\n          if (t3.buffer.byteLength === 0) throw new TypeError(\"chunk's buffer must have non-zero byteLength\");\n          if (this._closeRequested) throw new TypeError(\"stream is closed or draining\");\n          const r2 = this._controlledReadableByteStream._state;\n          if (r2 !== \"readable\") throw new TypeError(`The stream (in ${r2} state) is not in the readable state and cannot be enqueued to`);\n          Ht(this, t3);\n        }\n        error(t3 = void 0) {\n          if (!Ie(this)) throw Rt(\"error\");\n          K(this, t3);\n        }\n        [Ar](t3) {\n          ho(this), Be(this);\n          const r2 = this._cancelAlgorithm(t3);\n          return Nt(this), r2;\n        }\n        [Br](t3) {\n          const r2 = this._controlledReadableByteStream;\n          if (this._queueTotalSize > 0) {\n            wo(this, t3);\n            return;\n          }\n          const s = this._autoAllocateChunkSize;\n          if (s !== void 0) {\n            let u;\n            try {\n              u = new ArrayBuffer(s);\n            } catch (d) {\n              t3._errorSteps(d);\n              return;\n            }\n            const c2 = { buffer: u, bufferByteLength: s, byteOffset: 0, byteLength: s, bytesFilled: 0, minimumFill: 1, elementSize: 1, viewConstructor: Uint8Array, readerType: \"default\" };\n            this._pendingPullIntos.push(c2);\n          }\n          eo(r2, t3), Fe(this);\n        }\n        [kr]() {\n          if (this._pendingPullIntos.length > 0) {\n            const t3 = this._pendingPullIntos.peek();\n            t3.readerType = \"none\", this._pendingPullIntos = new D2(), this._pendingPullIntos.push(t3);\n          }\n        }\n      };\n      n2(_n, \"ReadableByteStreamController\");\n      let te = _n;\n      Object.defineProperties(te.prototype, { close: { enumerable: true }, enqueue: { enumerable: true }, error: { enumerable: true }, byobRequest: { enumerable: true }, desiredSize: { enumerable: true } }), h2(te.prototype.close, \"close\"), h2(te.prototype.enqueue, \"enqueue\"), h2(te.prototype.error, \"error\"), typeof Symbol.toStringTag == \"symbol\" && Object.defineProperty(te.prototype, Symbol.toStringTag, { value: \"ReadableByteStreamController\", configurable: true });\n      function Ie(e) {\n        return !l(e) || !Object.prototype.hasOwnProperty.call(e, \"_controlledReadableByteStream\") ? false : e instanceof te;\n      }\n      n2(Ie, \"IsReadableByteStreamController\");\n      function Hr(e) {\n        return !l(e) || !Object.prototype.hasOwnProperty.call(e, \"_associatedReadableByteStreamController\") ? false : e instanceof Re;\n      }\n      n2(Hr, \"IsReadableStreamBYOBRequest\");\n      function Fe(e) {\n        if (!fa(e)) return;\n        if (e._pulling) {\n          e._pullAgain = true;\n          return;\n        }\n        e._pulling = true;\n        const r2 = e._pullAlgorithm();\n        g2(r2, () => (e._pulling = false, e._pullAgain && (e._pullAgain = false, Fe(e)), null), (s) => (K(e, s), null));\n      }\n      n2(Fe, \"ReadableByteStreamControllerCallPullIfNeeded\");\n      function ho(e) {\n        Qr(e), e._pendingPullIntos = new D2();\n      }\n      n2(ho, \"ReadableByteStreamControllerClearPendingPullIntos\");\n      function Vr(e, t3) {\n        let r2 = false;\n        e._state === \"closed\" && (r2 = true);\n        const s = po(t3);\n        t3.readerType === \"default\" ? Lr(e, s, r2) : ma(e, s, r2);\n      }\n      n2(Vr, \"ReadableByteStreamControllerCommitPullIntoDescriptor\");\n      function po(e) {\n        const t3 = e.bytesFilled, r2 = e.elementSize;\n        return new e.viewConstructor(e.buffer, e.byteOffset, t3 / r2);\n      }\n      n2(po, \"ReadableByteStreamControllerConvertPullIntoDescriptor\");\n      function xt(e, t3, r2, s) {\n        e._queue.push({ buffer: t3, byteOffset: r2, byteLength: s }), e._queueTotalSize += s;\n      }\n      n2(xt, \"ReadableByteStreamControllerEnqueueChunkToQueue\");\n      function bo(e, t3, r2, s) {\n        let u;\n        try {\n          u = lo(t3, r2, r2 + s);\n        } catch (c2) {\n          throw K(e, c2), c2;\n        }\n        xt(e, u, 0, s);\n      }\n      n2(bo, \"ReadableByteStreamControllerEnqueueClonedChunkToQueue\");\n      function mo(e, t3) {\n        t3.bytesFilled > 0 && bo(e, t3.buffer, t3.byteOffset, t3.bytesFilled), Ye(e);\n      }\n      n2(mo, \"ReadableByteStreamControllerEnqueueDetachedPullIntoToQueue\");\n      function yo(e, t3) {\n        const r2 = Math.min(e._queueTotalSize, t3.byteLength - t3.bytesFilled), s = t3.bytesFilled + r2;\n        let u = r2, c2 = false;\n        const d = s % t3.elementSize, m2 = s - d;\n        m2 >= t3.minimumFill && (u = m2 - t3.bytesFilled, c2 = true);\n        const R3 = e._queue;\n        for (; u > 0; ) {\n          const y = R3.peek(), C2 = Math.min(u, y.byteLength), P2 = t3.byteOffset + t3.bytesFilled;\n          so(t3.buffer, P2, y.buffer, y.byteOffset, C2), y.byteLength === C2 ? R3.shift() : (y.byteOffset += C2, y.byteLength -= C2), e._queueTotalSize -= C2, go(e, C2, t3), u -= C2;\n        }\n        return c2;\n      }\n      n2(yo, \"ReadableByteStreamControllerFillPullIntoDescriptorFromQueue\");\n      function go(e, t3, r2) {\n        r2.bytesFilled += t3;\n      }\n      n2(go, \"ReadableByteStreamControllerFillHeadPullIntoDescriptor\");\n      function _o(e) {\n        e._queueTotalSize === 0 && e._closeRequested ? (Nt(e), At(e._controlledReadableByteStream)) : Fe(e);\n      }\n      n2(_o, \"ReadableByteStreamControllerHandleQueueDrain\");\n      function Qr(e) {\n        e._byobRequest !== null && (e._byobRequest._associatedReadableByteStreamController = void 0, e._byobRequest._view = null, e._byobRequest = null);\n      }\n      n2(Qr, \"ReadableByteStreamControllerInvalidateBYOBRequest\");\n      function Yr(e) {\n        for (; e._pendingPullIntos.length > 0; ) {\n          if (e._queueTotalSize === 0) return;\n          const t3 = e._pendingPullIntos.peek();\n          yo(e, t3) && (Ye(e), Vr(e._controlledReadableByteStream, t3));\n        }\n      }\n      n2(Yr, \"ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue\");\n      function aa(e) {\n        const t3 = e._controlledReadableByteStream._reader;\n        for (; t3._readRequests.length > 0; ) {\n          if (e._queueTotalSize === 0) return;\n          const r2 = t3._readRequests.shift();\n          wo(e, r2);\n        }\n      }\n      n2(aa, \"ReadableByteStreamControllerProcessReadRequestsUsingQueue\");\n      function sa(e, t3, r2, s) {\n        const u = e._controlledReadableByteStream, c2 = t3.constructor, d = ia(c2), { byteOffset: m2, byteLength: R3 } = t3, y = r2 * d;\n        let C2;\n        try {\n          C2 = we(t3.buffer);\n        } catch (B2) {\n          s._errorSteps(B2);\n          return;\n        }\n        const P2 = { buffer: C2, bufferByteLength: C2.byteLength, byteOffset: m2, byteLength: R3, bytesFilled: 0, minimumFill: y, elementSize: d, viewConstructor: c2, readerType: \"byob\" };\n        if (e._pendingPullIntos.length > 0) {\n          e._pendingPullIntos.push(P2), Po(u, s);\n          return;\n        }\n        if (u._state === \"closed\") {\n          const B2 = new c2(P2.buffer, P2.byteOffset, 0);\n          s._closeSteps(B2);\n          return;\n        }\n        if (e._queueTotalSize > 0) {\n          if (yo(e, P2)) {\n            const B2 = po(P2);\n            _o(e), s._chunkSteps(B2);\n            return;\n          }\n          if (e._closeRequested) {\n            const B2 = new TypeError(\"Insufficient bytes to fill elements in the given buffer\");\n            K(e, B2), s._errorSteps(B2);\n            return;\n          }\n        }\n        e._pendingPullIntos.push(P2), Po(u, s), Fe(e);\n      }\n      n2(sa, \"ReadableByteStreamControllerPullInto\");\n      function la(e, t3) {\n        t3.readerType === \"none\" && Ye(e);\n        const r2 = e._controlledReadableByteStream;\n        if (Kr(r2)) for (; vo(r2) > 0; ) {\n          const s = Ye(e);\n          Vr(r2, s);\n        }\n      }\n      n2(la, \"ReadableByteStreamControllerRespondInClosedState\");\n      function ua(e, t3, r2) {\n        if (go(e, t3, r2), r2.readerType === \"none\") {\n          mo(e, r2), Yr(e);\n          return;\n        }\n        if (r2.bytesFilled < r2.minimumFill) return;\n        Ye(e);\n        const s = r2.bytesFilled % r2.elementSize;\n        if (s > 0) {\n          const u = r2.byteOffset + r2.bytesFilled;\n          bo(e, r2.buffer, u - s, s);\n        }\n        r2.bytesFilled -= s, Vr(e._controlledReadableByteStream, r2), Yr(e);\n      }\n      n2(ua, \"ReadableByteStreamControllerRespondInReadableState\");\n      function So(e, t3) {\n        const r2 = e._pendingPullIntos.peek();\n        Qr(e), e._controlledReadableByteStream._state === \"closed\" ? la(e, r2) : ua(e, t3, r2), Fe(e);\n      }\n      n2(So, \"ReadableByteStreamControllerRespondInternal\");\n      function Ye(e) {\n        return e._pendingPullIntos.shift();\n      }\n      n2(Ye, \"ReadableByteStreamControllerShiftPendingPullInto\");\n      function fa(e) {\n        const t3 = e._controlledReadableByteStream;\n        return t3._state !== \"readable\" || e._closeRequested || !e._started ? false : !!(to(t3) && $t(t3) > 0 || Kr(t3) && vo(t3) > 0 || Ro(e) > 0);\n      }\n      n2(fa, \"ReadableByteStreamControllerShouldCallPull\");\n      function Nt(e) {\n        e._pullAlgorithm = void 0, e._cancelAlgorithm = void 0;\n      }\n      n2(Nt, \"ReadableByteStreamControllerClearAlgorithms\");\n      function wt(e) {\n        const t3 = e._controlledReadableByteStream;\n        if (!(e._closeRequested || t3._state !== \"readable\")) {\n          if (e._queueTotalSize > 0) {\n            e._closeRequested = true;\n            return;\n          }\n          if (e._pendingPullIntos.length > 0) {\n            const r2 = e._pendingPullIntos.peek();\n            if (r2.bytesFilled % r2.elementSize !== 0) {\n              const s = new TypeError(\"Insufficient bytes to fill elements in the given buffer\");\n              throw K(e, s), s;\n            }\n          }\n          Nt(e), At(t3);\n        }\n      }\n      n2(wt, \"ReadableByteStreamControllerClose\");\n      function Ht(e, t3) {\n        const r2 = e._controlledReadableByteStream;\n        if (e._closeRequested || r2._state !== \"readable\") return;\n        const { buffer: s, byteOffset: u, byteLength: c2 } = t3;\n        if (Ae(s)) throw new TypeError(\"chunk's buffer is detached and so cannot be enqueued\");\n        const d = we(s);\n        if (e._pendingPullIntos.length > 0) {\n          const m2 = e._pendingPullIntos.peek();\n          if (Ae(m2.buffer)) throw new TypeError(\"The BYOB request's buffer has been detached and so cannot be filled with an enqueued chunk\");\n          Qr(e), m2.buffer = we(m2.buffer), m2.readerType === \"none\" && mo(e, m2);\n        }\n        if (to(r2)) if (aa(e), $t(r2) === 0) xt(e, d, u, c2);\n        else {\n          e._pendingPullIntos.length > 0 && Ye(e);\n          const m2 = new Uint8Array(d, u, c2);\n          Lr(r2, m2, false);\n        }\n        else Kr(r2) ? (xt(e, d, u, c2), Yr(e)) : xt(e, d, u, c2);\n        Fe(e);\n      }\n      n2(Ht, \"ReadableByteStreamControllerEnqueue\");\n      function K(e, t3) {\n        const r2 = e._controlledReadableByteStream;\n        r2._state === \"readable\" && (ho(e), Be(e), Nt(e), Zo(r2, t3));\n      }\n      n2(K, \"ReadableByteStreamControllerError\");\n      function wo(e, t3) {\n        const r2 = e._queue.shift();\n        e._queueTotalSize -= r2.byteLength, _o(e);\n        const s = new Uint8Array(r2.buffer, r2.byteOffset, r2.byteLength);\n        t3._chunkSteps(s);\n      }\n      n2(wo, \"ReadableByteStreamControllerFillReadRequestFromQueue\");\n      function Gr(e) {\n        if (e._byobRequest === null && e._pendingPullIntos.length > 0) {\n          const t3 = e._pendingPullIntos.peek(), r2 = new Uint8Array(t3.buffer, t3.byteOffset + t3.bytesFilled, t3.byteLength - t3.bytesFilled), s = Object.create(Re.prototype);\n          da(s, e, r2), e._byobRequest = s;\n        }\n        return e._byobRequest;\n      }\n      n2(Gr, \"ReadableByteStreamControllerGetBYOBRequest\");\n      function Ro(e) {\n        const t3 = e._controlledReadableByteStream._state;\n        return t3 === \"errored\" ? null : t3 === \"closed\" ? 0 : e._strategyHWM - e._queueTotalSize;\n      }\n      n2(Ro, \"ReadableByteStreamControllerGetDesiredSize\");\n      function Vt(e, t3) {\n        const r2 = e._pendingPullIntos.peek();\n        if (e._controlledReadableByteStream._state === \"closed\") {\n          if (t3 !== 0) throw new TypeError(\"bytesWritten must be 0 when calling respond() on a closed stream\");\n        } else {\n          if (t3 === 0) throw new TypeError(\"bytesWritten must be greater than 0 when calling respond() on a readable stream\");\n          if (r2.bytesFilled + t3 > r2.byteLength) throw new RangeError(\"bytesWritten out of range\");\n        }\n        r2.buffer = we(r2.buffer), So(e, t3);\n      }\n      n2(Vt, \"ReadableByteStreamControllerRespond\");\n      function Qt(e, t3) {\n        const r2 = e._pendingPullIntos.peek();\n        if (e._controlledReadableByteStream._state === \"closed\") {\n          if (t3.byteLength !== 0) throw new TypeError(\"The view's length must be 0 when calling respondWithNewView() on a closed stream\");\n        } else if (t3.byteLength === 0) throw new TypeError(\"The view's length must be greater than 0 when calling respondWithNewView() on a readable stream\");\n        if (r2.byteOffset + r2.bytesFilled !== t3.byteOffset) throw new RangeError(\"The region specified by view does not match byobRequest\");\n        if (r2.bufferByteLength !== t3.buffer.byteLength) throw new RangeError(\"The buffer of view has different capacity than byobRequest\");\n        if (r2.bytesFilled + t3.byteLength > r2.byteLength) throw new RangeError(\"The region specified by view is larger than byobRequest\");\n        const u = t3.byteLength;\n        r2.buffer = we(t3.buffer), So(e, u);\n      }\n      n2(Qt, \"ReadableByteStreamControllerRespondWithNewView\");\n      function To(e, t3, r2, s, u, c2, d) {\n        t3._controlledReadableByteStream = e, t3._pullAgain = false, t3._pulling = false, t3._byobRequest = null, t3._queue = t3._queueTotalSize = void 0, Be(t3), t3._closeRequested = false, t3._started = false, t3._strategyHWM = c2, t3._pullAlgorithm = s, t3._cancelAlgorithm = u, t3._autoAllocateChunkSize = d, t3._pendingPullIntos = new D2(), e._readableStreamController = t3;\n        const m2 = r2();\n        g2(T2(m2), () => (t3._started = true, Fe(t3), null), (R3) => (K(t3, R3), null));\n      }\n      n2(To, \"SetUpReadableByteStreamController\");\n      function ca(e, t3, r2) {\n        const s = Object.create(te.prototype);\n        let u, c2, d;\n        t3.start !== void 0 ? u = n2(() => t3.start(s), \"startAlgorithm\") : u = n2(() => {\n        }, \"startAlgorithm\"), t3.pull !== void 0 ? c2 = n2(() => t3.pull(s), \"pullAlgorithm\") : c2 = n2(() => T2(void 0), \"pullAlgorithm\"), t3.cancel !== void 0 ? d = n2((R3) => t3.cancel(R3), \"cancelAlgorithm\") : d = n2(() => T2(void 0), \"cancelAlgorithm\");\n        const m2 = t3.autoAllocateChunkSize;\n        if (m2 === 0) throw new TypeError(\"autoAllocateChunkSize must be greater than 0\");\n        To(e, s, u, c2, d, r2, m2);\n      }\n      n2(ca, \"SetUpReadableByteStreamControllerFromUnderlyingSource\");\n      function da(e, t3, r2) {\n        e._associatedReadableByteStreamController = t3, e._view = r2;\n      }\n      n2(da, \"SetUpReadableStreamBYOBRequest\");\n      function Zr(e) {\n        return new TypeError(`ReadableStreamBYOBRequest.prototype.${e} can only be used on a ReadableStreamBYOBRequest`);\n      }\n      n2(Zr, \"byobRequestBrandCheckException\");\n      function Rt(e) {\n        return new TypeError(`ReadableByteStreamController.prototype.${e} can only be used on a ReadableByteStreamController`);\n      }\n      n2(Rt, \"byteStreamControllerBrandCheckException\");\n      function ha(e, t3) {\n        ue(e, t3);\n        const r2 = e == null ? void 0 : e.mode;\n        return { mode: r2 === void 0 ? void 0 : pa(r2, `${t3} has member 'mode' that`) };\n      }\n      n2(ha, \"convertReaderOptions\");\n      function pa(e, t3) {\n        if (e = `${e}`, e !== \"byob\") throw new TypeError(`${t3} '${e}' is not a valid enumeration value for ReadableStreamReaderMode`);\n        return e;\n      }\n      n2(pa, \"convertReadableStreamReaderMode\");\n      function ba(e, t3) {\n        var r2;\n        ue(e, t3);\n        const s = (r2 = e == null ? void 0 : e.min) !== null && r2 !== void 0 ? r2 : 1;\n        return { min: Fr(s, `${t3} has member 'min' that`) };\n      }\n      n2(ba, \"convertByobReadOptions\");\n      function Co(e) {\n        return new ce(e);\n      }\n      n2(Co, \"AcquireReadableStreamBYOBReader\");\n      function Po(e, t3) {\n        e._reader._readIntoRequests.push(t3);\n      }\n      n2(Po, \"ReadableStreamAddReadIntoRequest\");\n      function ma(e, t3, r2) {\n        const u = e._reader._readIntoRequests.shift();\n        r2 ? u._closeSteps(t3) : u._chunkSteps(t3);\n      }\n      n2(ma, \"ReadableStreamFulfillReadIntoRequest\");\n      function vo(e) {\n        return e._reader._readIntoRequests.length;\n      }\n      n2(vo, \"ReadableStreamGetNumReadIntoRequests\");\n      function Kr(e) {\n        const t3 = e._reader;\n        return !(t3 === void 0 || !je(t3));\n      }\n      n2(Kr, \"ReadableStreamHasBYOBReader\");\n      const Sn = class Sn {\n        constructor(t3) {\n          if (Se(t3, 1, \"ReadableStreamBYOBReader\"), jr(t3, \"First parameter\"), qe(t3)) throw new TypeError(\"This stream has already been locked for exclusive reading by another reader\");\n          if (!Ie(t3._readableStreamController)) throw new TypeError(\"Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte source\");\n          Yn(this, t3), this._readIntoRequests = new D2();\n        }\n        get closed() {\n          return je(this) ? this._closedPromise : b(Yt(\"closed\"));\n        }\n        cancel(t3 = void 0) {\n          return je(this) ? this._ownerReadableStream === void 0 ? b(Lt(\"cancel\")) : Wr(this, t3) : b(Yt(\"cancel\"));\n        }\n        read(t3, r2 = {}) {\n          if (!je(this)) return b(Yt(\"read\"));\n          if (!ArrayBuffer.isView(t3)) return b(new TypeError(\"view must be an array buffer view\"));\n          if (t3.byteLength === 0) return b(new TypeError(\"view must have non-zero byteLength\"));\n          if (t3.buffer.byteLength === 0) return b(new TypeError(\"view's buffer must have non-zero byteLength\"));\n          if (Ae(t3.buffer)) return b(new TypeError(\"view's buffer has been detached\"));\n          let s;\n          try {\n            s = ba(r2, \"options\");\n          } catch (y) {\n            return b(y);\n          }\n          const u = s.min;\n          if (u === 0) return b(new TypeError(\"options.min must be greater than 0\"));\n          if (oa(t3)) {\n            if (u > t3.byteLength) return b(new RangeError(\"options.min must be less than or equal to view's byteLength\"));\n          } else if (u > t3.length) return b(new RangeError(\"options.min must be less than or equal to view's length\"));\n          if (this._ownerReadableStream === void 0) return b(Lt(\"read from\"));\n          let c2, d;\n          const m2 = A((y, C2) => {\n            c2 = y, d = C2;\n          });\n          return Eo(this, t3, u, { _chunkSteps: n2((y) => c2({ value: y, done: false }), \"_chunkSteps\"), _closeSteps: n2((y) => c2({ value: y, done: true }), \"_closeSteps\"), _errorSteps: n2((y) => d(y), \"_errorSteps\") }), m2;\n        }\n        releaseLock() {\n          if (!je(this)) throw Yt(\"releaseLock\");\n          this._ownerReadableStream !== void 0 && ya(this);\n        }\n      };\n      n2(Sn, \"ReadableStreamBYOBReader\");\n      let ce = Sn;\n      Object.defineProperties(ce.prototype, { cancel: { enumerable: true }, read: { enumerable: true }, releaseLock: { enumerable: true }, closed: { enumerable: true } }), h2(ce.prototype.cancel, \"cancel\"), h2(ce.prototype.read, \"read\"), h2(ce.prototype.releaseLock, \"releaseLock\"), typeof Symbol.toStringTag == \"symbol\" && Object.defineProperty(ce.prototype, Symbol.toStringTag, { value: \"ReadableStreamBYOBReader\", configurable: true });\n      function je(e) {\n        return !l(e) || !Object.prototype.hasOwnProperty.call(e, \"_readIntoRequests\") ? false : e instanceof ce;\n      }\n      n2(je, \"IsReadableStreamBYOBReader\");\n      function Eo(e, t3, r2, s) {\n        const u = e._ownerReadableStream;\n        u._disturbed = true, u._state === \"errored\" ? s._errorSteps(u._storedError) : sa(u._readableStreamController, t3, r2, s);\n      }\n      n2(Eo, \"ReadableStreamBYOBReaderRead\");\n      function ya(e) {\n        _e(e);\n        const t3 = new TypeError(\"Reader was released\");\n        Ao(e, t3);\n      }\n      n2(ya, \"ReadableStreamBYOBReaderRelease\");\n      function Ao(e, t3) {\n        const r2 = e._readIntoRequests;\n        e._readIntoRequests = new D2(), r2.forEach((s) => {\n          s._errorSteps(t3);\n        });\n      }\n      n2(Ao, \"ReadableStreamBYOBReaderErrorReadIntoRequests\");\n      function Yt(e) {\n        return new TypeError(`ReadableStreamBYOBReader.prototype.${e} can only be used on a ReadableStreamBYOBReader`);\n      }\n      n2(Yt, \"byobReaderBrandCheckException\");\n      function Tt(e, t3) {\n        const { highWaterMark: r2 } = e;\n        if (r2 === void 0) return t3;\n        if (ao(r2) || r2 < 0) throw new RangeError(\"Invalid highWaterMark\");\n        return r2;\n      }\n      n2(Tt, \"ExtractHighWaterMark\");\n      function Gt(e) {\n        const { size: t3 } = e;\n        return t3 || (() => 1);\n      }\n      n2(Gt, \"ExtractSizeAlgorithm\");\n      function Zt(e, t3) {\n        ue(e, t3);\n        const r2 = e == null ? void 0 : e.highWaterMark, s = e == null ? void 0 : e.size;\n        return { highWaterMark: r2 === void 0 ? void 0 : Ir(r2), size: s === void 0 ? void 0 : ga(s, `${t3} has member 'size' that`) };\n      }\n      n2(Zt, \"convertQueuingStrategy\");\n      function ga(e, t3) {\n        return Z2(e, t3), (r2) => Ir(e(r2));\n      }\n      n2(ga, \"convertQueuingStrategySize\");\n      function _a2(e, t3) {\n        ue(e, t3);\n        const r2 = e == null ? void 0 : e.abort, s = e == null ? void 0 : e.close, u = e == null ? void 0 : e.start, c2 = e == null ? void 0 : e.type, d = e == null ? void 0 : e.write;\n        return { abort: r2 === void 0 ? void 0 : Sa(r2, e, `${t3} has member 'abort' that`), close: s === void 0 ? void 0 : wa(s, e, `${t3} has member 'close' that`), start: u === void 0 ? void 0 : Ra(u, e, `${t3} has member 'start' that`), write: d === void 0 ? void 0 : Ta(d, e, `${t3} has member 'write' that`), type: c2 };\n      }\n      n2(_a2, \"convertUnderlyingSink\");\n      function Sa(e, t3, r2) {\n        return Z2(e, r2), (s) => j(e, t3, [s]);\n      }\n      n2(Sa, \"convertUnderlyingSinkAbortCallback\");\n      function wa(e, t3, r2) {\n        return Z2(e, r2), () => j(e, t3, []);\n      }\n      n2(wa, \"convertUnderlyingSinkCloseCallback\");\n      function Ra(e, t3, r2) {\n        return Z2(e, r2), (s) => z(e, t3, [s]);\n      }\n      n2(Ra, \"convertUnderlyingSinkStartCallback\");\n      function Ta(e, t3, r2) {\n        return Z2(e, r2), (s, u) => j(e, t3, [s, u]);\n      }\n      n2(Ta, \"convertUnderlyingSinkWriteCallback\");\n      function Bo(e, t3) {\n        if (!Ge(e)) throw new TypeError(`${t3} is not a WritableStream.`);\n      }\n      n2(Bo, \"assertWritableStream\");\n      function Ca(e) {\n        if (typeof e != \"object\" || e === null) return false;\n        try {\n          return typeof e.aborted == \"boolean\";\n        } catch (e2) {\n          return false;\n        }\n      }\n      n2(Ca, \"isAbortSignal\");\n      const Pa = typeof AbortController == \"function\";\n      function va() {\n        if (Pa) return new AbortController();\n      }\n      n2(va, \"createAbortController\");\n      const wn = class wn {\n        constructor(t3 = {}, r2 = {}) {\n          t3 === void 0 ? t3 = null : Jn(t3, \"First parameter\");\n          const s = Zt(r2, \"Second parameter\"), u = _a2(t3, \"First parameter\");\n          if (Wo(this), u.type !== void 0) throw new RangeError(\"Invalid type is specified\");\n          const d = Gt(s), m2 = Tt(s, 1);\n          Da(this, u, m2, d);\n        }\n        get locked() {\n          if (!Ge(this)) throw tr(\"locked\");\n          return Ze(this);\n        }\n        abort(t3 = void 0) {\n          return Ge(this) ? Ze(this) ? b(new TypeError(\"Cannot abort a stream that already has a writer\")) : Kt(this, t3) : b(tr(\"abort\"));\n        }\n        close() {\n          return Ge(this) ? Ze(this) ? b(new TypeError(\"Cannot close a stream that already has a writer\")) : he(this) ? b(new TypeError(\"Cannot close an already-closing stream\")) : qo(this) : b(tr(\"close\"));\n        }\n        getWriter() {\n          if (!Ge(this)) throw tr(\"getWriter\");\n          return ko(this);\n        }\n      };\n      n2(wn, \"WritableStream\");\n      let de = wn;\n      Object.defineProperties(de.prototype, { abort: { enumerable: true }, close: { enumerable: true }, getWriter: { enumerable: true }, locked: { enumerable: true } }), h2(de.prototype.abort, \"abort\"), h2(de.prototype.close, \"close\"), h2(de.prototype.getWriter, \"getWriter\"), typeof Symbol.toStringTag == \"symbol\" && Object.defineProperty(de.prototype, Symbol.toStringTag, { value: \"WritableStream\", configurable: true });\n      function ko(e) {\n        return new re(e);\n      }\n      n2(ko, \"AcquireWritableStreamDefaultWriter\");\n      function Ea(e, t3, r2, s, u = 1, c2 = () => 1) {\n        const d = Object.create(de.prototype);\n        Wo(d);\n        const m2 = Object.create(ke.prototype);\n        return Lo(d, m2, e, t3, r2, s, u, c2), d;\n      }\n      n2(Ea, \"CreateWritableStream\");\n      function Wo(e) {\n        e._state = \"writable\", e._storedError = void 0, e._writer = void 0, e._writableStreamController = void 0, e._writeRequests = new D2(), e._inFlightWriteRequest = void 0, e._closeRequest = void 0, e._inFlightCloseRequest = void 0, e._pendingAbortRequest = void 0, e._backpressure = false;\n      }\n      n2(Wo, \"InitializeWritableStream\");\n      function Ge(e) {\n        return !l(e) || !Object.prototype.hasOwnProperty.call(e, \"_writableStreamController\") ? false : e instanceof de;\n      }\n      n2(Ge, \"IsWritableStream\");\n      function Ze(e) {\n        return e._writer !== void 0;\n      }\n      n2(Ze, \"IsWritableStreamLocked\");\n      function Kt(e, t3) {\n        var r2;\n        if (e._state === \"closed\" || e._state === \"errored\") return T2(void 0);\n        e._writableStreamController._abortReason = t3, (r2 = e._writableStreamController._abortController) === null || r2 === void 0 || r2.abort(t3);\n        const s = e._state;\n        if (s === \"closed\" || s === \"errored\") return T2(void 0);\n        if (e._pendingAbortRequest !== void 0) return e._pendingAbortRequest._promise;\n        let u = false;\n        s === \"erroring\" && (u = true, t3 = void 0);\n        const c2 = A((d, m2) => {\n          e._pendingAbortRequest = { _promise: void 0, _resolve: d, _reject: m2, _reason: t3, _wasAlreadyErroring: u };\n        });\n        return e._pendingAbortRequest._promise = c2, u || Xr(e, t3), c2;\n      }\n      n2(Kt, \"WritableStreamAbort\");\n      function qo(e) {\n        const t3 = e._state;\n        if (t3 === \"closed\" || t3 === \"errored\") return b(new TypeError(`The stream (in ${t3} state) is not in the writable state and cannot be closed`));\n        const r2 = A((u, c2) => {\n          const d = { _resolve: u, _reject: c2 };\n          e._closeRequest = d;\n        }), s = e._writer;\n        return s !== void 0 && e._backpressure && t3 === \"writable\" && ln(s), Ma(e._writableStreamController), r2;\n      }\n      n2(qo, \"WritableStreamClose\");\n      function Aa(e) {\n        return A((r2, s) => {\n          const u = { _resolve: r2, _reject: s };\n          e._writeRequests.push(u);\n        });\n      }\n      n2(Aa, \"WritableStreamAddWriteRequest\");\n      function Jr(e, t3) {\n        if (e._state === \"writable\") {\n          Xr(e, t3);\n          return;\n        }\n        en(e);\n      }\n      n2(Jr, \"WritableStreamDealWithRejection\");\n      function Xr(e, t3) {\n        const r2 = e._writableStreamController;\n        e._state = \"erroring\", e._storedError = t3;\n        const s = e._writer;\n        s !== void 0 && zo(s, t3), !Oa(e) && r2._started && en(e);\n      }\n      n2(Xr, \"WritableStreamStartErroring\");\n      function en(e) {\n        e._state = \"errored\", e._writableStreamController[Qn]();\n        const t3 = e._storedError;\n        if (e._writeRequests.forEach((u) => {\n          u._reject(t3);\n        }), e._writeRequests = new D2(), e._pendingAbortRequest === void 0) {\n          Jt(e);\n          return;\n        }\n        const r2 = e._pendingAbortRequest;\n        if (e._pendingAbortRequest = void 0, r2._wasAlreadyErroring) {\n          r2._reject(t3), Jt(e);\n          return;\n        }\n        const s = e._writableStreamController[jt](r2._reason);\n        g2(s, () => (r2._resolve(), Jt(e), null), (u) => (r2._reject(u), Jt(e), null));\n      }\n      n2(en, \"WritableStreamFinishErroring\");\n      function Ba(e) {\n        e._inFlightWriteRequest._resolve(void 0), e._inFlightWriteRequest = void 0;\n      }\n      n2(Ba, \"WritableStreamFinishInFlightWrite\");\n      function ka(e, t3) {\n        e._inFlightWriteRequest._reject(t3), e._inFlightWriteRequest = void 0, Jr(e, t3);\n      }\n      n2(ka, \"WritableStreamFinishInFlightWriteWithError\");\n      function Wa(e) {\n        e._inFlightCloseRequest._resolve(void 0), e._inFlightCloseRequest = void 0, e._state === \"erroring\" && (e._storedError = void 0, e._pendingAbortRequest !== void 0 && (e._pendingAbortRequest._resolve(), e._pendingAbortRequest = void 0)), e._state = \"closed\";\n        const r2 = e._writer;\n        r2 !== void 0 && Uo(r2);\n      }\n      n2(Wa, \"WritableStreamFinishInFlightClose\");\n      function qa(e, t3) {\n        e._inFlightCloseRequest._reject(t3), e._inFlightCloseRequest = void 0, e._pendingAbortRequest !== void 0 && (e._pendingAbortRequest._reject(t3), e._pendingAbortRequest = void 0), Jr(e, t3);\n      }\n      n2(qa, \"WritableStreamFinishInFlightCloseWithError\");\n      function he(e) {\n        return !(e._closeRequest === void 0 && e._inFlightCloseRequest === void 0);\n      }\n      n2(he, \"WritableStreamCloseQueuedOrInFlight\");\n      function Oa(e) {\n        return !(e._inFlightWriteRequest === void 0 && e._inFlightCloseRequest === void 0);\n      }\n      n2(Oa, \"WritableStreamHasOperationMarkedInFlight\");\n      function za(e) {\n        e._inFlightCloseRequest = e._closeRequest, e._closeRequest = void 0;\n      }\n      n2(za, \"WritableStreamMarkCloseRequestInFlight\");\n      function Ia(e) {\n        e._inFlightWriteRequest = e._writeRequests.shift();\n      }\n      n2(Ia, \"WritableStreamMarkFirstWriteRequestInFlight\");\n      function Jt(e) {\n        e._closeRequest !== void 0 && (e._closeRequest._reject(e._storedError), e._closeRequest = void 0);\n        const t3 = e._writer;\n        t3 !== void 0 && an(t3, e._storedError);\n      }\n      n2(Jt, \"WritableStreamRejectCloseAndClosedPromiseIfNeeded\");\n      function tn(e, t3) {\n        const r2 = e._writer;\n        r2 !== void 0 && t3 !== e._backpressure && (t3 ? Ya(r2) : ln(r2)), e._backpressure = t3;\n      }\n      n2(tn, \"WritableStreamUpdateBackpressure\");\n      const Rn = class Rn {\n        constructor(t3) {\n          if (Se(t3, 1, \"WritableStreamDefaultWriter\"), Bo(t3, \"First parameter\"), Ze(t3)) throw new TypeError(\"This stream has already been locked for exclusive writing by another writer\");\n          this._ownerWritableStream = t3, t3._writer = this;\n          const r2 = t3._state;\n          if (r2 === \"writable\") !he(t3) && t3._backpressure ? nr(this) : xo(this), rr(this);\n          else if (r2 === \"erroring\") sn(this, t3._storedError), rr(this);\n          else if (r2 === \"closed\") xo(this), Va(this);\n          else {\n            const s = t3._storedError;\n            sn(this, s), Mo(this, s);\n          }\n        }\n        get closed() {\n          return Le(this) ? this._closedPromise : b($e(\"closed\"));\n        }\n        get desiredSize() {\n          if (!Le(this)) throw $e(\"desiredSize\");\n          if (this._ownerWritableStream === void 0) throw Pt(\"desiredSize\");\n          return $a(this);\n        }\n        get ready() {\n          return Le(this) ? this._readyPromise : b($e(\"ready\"));\n        }\n        abort(t3 = void 0) {\n          return Le(this) ? this._ownerWritableStream === void 0 ? b(Pt(\"abort\")) : Fa(this, t3) : b($e(\"abort\"));\n        }\n        close() {\n          if (!Le(this)) return b($e(\"close\"));\n          const t3 = this._ownerWritableStream;\n          return t3 === void 0 ? b(Pt(\"close\")) : he(t3) ? b(new TypeError(\"Cannot close an already-closing stream\")) : Oo(this);\n        }\n        releaseLock() {\n          if (!Le(this)) throw $e(\"releaseLock\");\n          this._ownerWritableStream !== void 0 && Io(this);\n        }\n        write(t3 = void 0) {\n          return Le(this) ? this._ownerWritableStream === void 0 ? b(Pt(\"write to\")) : Fo(this, t3) : b($e(\"write\"));\n        }\n      };\n      n2(Rn, \"WritableStreamDefaultWriter\");\n      let re = Rn;\n      Object.defineProperties(re.prototype, { abort: { enumerable: true }, close: { enumerable: true }, releaseLock: { enumerable: true }, write: { enumerable: true }, closed: { enumerable: true }, desiredSize: { enumerable: true }, ready: { enumerable: true } }), h2(re.prototype.abort, \"abort\"), h2(re.prototype.close, \"close\"), h2(re.prototype.releaseLock, \"releaseLock\"), h2(re.prototype.write, \"write\"), typeof Symbol.toStringTag == \"symbol\" && Object.defineProperty(re.prototype, Symbol.toStringTag, { value: \"WritableStreamDefaultWriter\", configurable: true });\n      function Le(e) {\n        return !l(e) || !Object.prototype.hasOwnProperty.call(e, \"_ownerWritableStream\") ? false : e instanceof re;\n      }\n      n2(Le, \"IsWritableStreamDefaultWriter\");\n      function Fa(e, t3) {\n        const r2 = e._ownerWritableStream;\n        return Kt(r2, t3);\n      }\n      n2(Fa, \"WritableStreamDefaultWriterAbort\");\n      function Oo(e) {\n        const t3 = e._ownerWritableStream;\n        return qo(t3);\n      }\n      n2(Oo, \"WritableStreamDefaultWriterClose\");\n      function ja(e) {\n        const t3 = e._ownerWritableStream, r2 = t3._state;\n        return he(t3) || r2 === \"closed\" ? T2(void 0) : r2 === \"errored\" ? b(t3._storedError) : Oo(e);\n      }\n      n2(ja, \"WritableStreamDefaultWriterCloseWithErrorPropagation\");\n      function La(e, t3) {\n        e._closedPromiseState === \"pending\" ? an(e, t3) : Qa(e, t3);\n      }\n      n2(La, \"WritableStreamDefaultWriterEnsureClosedPromiseRejected\");\n      function zo(e, t3) {\n        e._readyPromiseState === \"pending\" ? No(e, t3) : Ga(e, t3);\n      }\n      n2(zo, \"WritableStreamDefaultWriterEnsureReadyPromiseRejected\");\n      function $a(e) {\n        const t3 = e._ownerWritableStream, r2 = t3._state;\n        return r2 === \"errored\" || r2 === \"erroring\" ? null : r2 === \"closed\" ? 0 : $o(t3._writableStreamController);\n      }\n      n2($a, \"WritableStreamDefaultWriterGetDesiredSize\");\n      function Io(e) {\n        const t3 = e._ownerWritableStream, r2 = new TypeError(\"Writer was released and can no longer be used to monitor the stream's closedness\");\n        zo(e, r2), La(e, r2), t3._writer = void 0, e._ownerWritableStream = void 0;\n      }\n      n2(Io, \"WritableStreamDefaultWriterRelease\");\n      function Fo(e, t3) {\n        const r2 = e._ownerWritableStream, s = r2._writableStreamController, u = Ua(s, t3);\n        if (r2 !== e._ownerWritableStream) return b(Pt(\"write to\"));\n        const c2 = r2._state;\n        if (c2 === \"errored\") return b(r2._storedError);\n        if (he(r2) || c2 === \"closed\") return b(new TypeError(\"The stream is closing or closed and cannot be written to\"));\n        if (c2 === \"erroring\") return b(r2._storedError);\n        const d = Aa(r2);\n        return xa(s, t3, u), d;\n      }\n      n2(Fo, \"WritableStreamDefaultWriterWrite\");\n      const jo = {}, Tn = class Tn {\n        constructor() {\n          throw new TypeError(\"Illegal constructor\");\n        }\n        get abortReason() {\n          if (!rn(this)) throw on2(\"abortReason\");\n          return this._abortReason;\n        }\n        get signal() {\n          if (!rn(this)) throw on2(\"signal\");\n          if (this._abortController === void 0) throw new TypeError(\"WritableStreamDefaultController.prototype.signal is not supported\");\n          return this._abortController.signal;\n        }\n        error(t3 = void 0) {\n          if (!rn(this)) throw on2(\"error\");\n          this._controlledWritableStream._state === \"writable\" && Do(this, t3);\n        }\n        [jt](t3) {\n          const r2 = this._abortAlgorithm(t3);\n          return Xt(this), r2;\n        }\n        [Qn]() {\n          Be(this);\n        }\n      };\n      n2(Tn, \"WritableStreamDefaultController\");\n      let ke = Tn;\n      Object.defineProperties(ke.prototype, { abortReason: { enumerable: true }, signal: { enumerable: true }, error: { enumerable: true } }), typeof Symbol.toStringTag == \"symbol\" && Object.defineProperty(ke.prototype, Symbol.toStringTag, { value: \"WritableStreamDefaultController\", configurable: true });\n      function rn(e) {\n        return !l(e) || !Object.prototype.hasOwnProperty.call(e, \"_controlledWritableStream\") ? false : e instanceof ke;\n      }\n      n2(rn, \"IsWritableStreamDefaultController\");\n      function Lo(e, t3, r2, s, u, c2, d, m2) {\n        t3._controlledWritableStream = e, e._writableStreamController = t3, t3._queue = void 0, t3._queueTotalSize = void 0, Be(t3), t3._abortReason = void 0, t3._abortController = va(), t3._started = false, t3._strategySizeAlgorithm = m2, t3._strategyHWM = d, t3._writeAlgorithm = s, t3._closeAlgorithm = u, t3._abortAlgorithm = c2;\n        const R3 = nn(t3);\n        tn(e, R3);\n        const y = r2(), C2 = T2(y);\n        g2(C2, () => (t3._started = true, er(t3), null), (P2) => (t3._started = true, Jr(e, P2), null));\n      }\n      n2(Lo, \"SetUpWritableStreamDefaultController\");\n      function Da(e, t3, r2, s) {\n        const u = Object.create(ke.prototype);\n        let c2, d, m2, R3;\n        t3.start !== void 0 ? c2 = n2(() => t3.start(u), \"startAlgorithm\") : c2 = n2(() => {\n        }, \"startAlgorithm\"), t3.write !== void 0 ? d = n2((y) => t3.write(y, u), \"writeAlgorithm\") : d = n2(() => T2(void 0), \"writeAlgorithm\"), t3.close !== void 0 ? m2 = n2(() => t3.close(), \"closeAlgorithm\") : m2 = n2(() => T2(void 0), \"closeAlgorithm\"), t3.abort !== void 0 ? R3 = n2((y) => t3.abort(y), \"abortAlgorithm\") : R3 = n2(() => T2(void 0), \"abortAlgorithm\"), Lo(e, u, c2, d, m2, R3, r2, s);\n      }\n      n2(Da, \"SetUpWritableStreamDefaultControllerFromUnderlyingSink\");\n      function Xt(e) {\n        e._writeAlgorithm = void 0, e._closeAlgorithm = void 0, e._abortAlgorithm = void 0, e._strategySizeAlgorithm = void 0;\n      }\n      n2(Xt, \"WritableStreamDefaultControllerClearAlgorithms\");\n      function Ma(e) {\n        Nr(e, jo, 0), er(e);\n      }\n      n2(Ma, \"WritableStreamDefaultControllerClose\");\n      function Ua(e, t3) {\n        try {\n          return e._strategySizeAlgorithm(t3);\n        } catch (r2) {\n          return Ct(e, r2), 1;\n        }\n      }\n      n2(Ua, \"WritableStreamDefaultControllerGetChunkSize\");\n      function $o(e) {\n        return e._strategyHWM - e._queueTotalSize;\n      }\n      n2($o, \"WritableStreamDefaultControllerGetDesiredSize\");\n      function xa(e, t3, r2) {\n        try {\n          Nr(e, t3, r2);\n        } catch (u) {\n          Ct(e, u);\n          return;\n        }\n        const s = e._controlledWritableStream;\n        if (!he(s) && s._state === \"writable\") {\n          const u = nn(e);\n          tn(s, u);\n        }\n        er(e);\n      }\n      n2(xa, \"WritableStreamDefaultControllerWrite\");\n      function er(e) {\n        const t3 = e._controlledWritableStream;\n        if (!e._started || t3._inFlightWriteRequest !== void 0) return;\n        if (t3._state === \"erroring\") {\n          en(t3);\n          return;\n        }\n        if (e._queue.length === 0) return;\n        const s = na(e);\n        s === jo ? Na(e) : Ha(e, s);\n      }\n      n2(er, \"WritableStreamDefaultControllerAdvanceQueueIfNeeded\");\n      function Ct(e, t3) {\n        e._controlledWritableStream._state === \"writable\" && Do(e, t3);\n      }\n      n2(Ct, \"WritableStreamDefaultControllerErrorIfNeeded\");\n      function Na(e) {\n        const t3 = e._controlledWritableStream;\n        za(t3), xr(e);\n        const r2 = e._closeAlgorithm();\n        Xt(e), g2(r2, () => (Wa(t3), null), (s) => (qa(t3, s), null));\n      }\n      n2(Na, \"WritableStreamDefaultControllerProcessClose\");\n      function Ha(e, t3) {\n        const r2 = e._controlledWritableStream;\n        Ia(r2);\n        const s = e._writeAlgorithm(t3);\n        g2(s, () => {\n          Ba(r2);\n          const u = r2._state;\n          if (xr(e), !he(r2) && u === \"writable\") {\n            const c2 = nn(e);\n            tn(r2, c2);\n          }\n          return er(e), null;\n        }, (u) => (r2._state === \"writable\" && Xt(e), ka(r2, u), null));\n      }\n      n2(Ha, \"WritableStreamDefaultControllerProcessWrite\");\n      function nn(e) {\n        return $o(e) <= 0;\n      }\n      n2(nn, \"WritableStreamDefaultControllerGetBackpressure\");\n      function Do(e, t3) {\n        const r2 = e._controlledWritableStream;\n        Xt(e), Xr(r2, t3);\n      }\n      n2(Do, \"WritableStreamDefaultControllerError\");\n      function tr(e) {\n        return new TypeError(`WritableStream.prototype.${e} can only be used on a WritableStream`);\n      }\n      n2(tr, \"streamBrandCheckException$2\");\n      function on2(e) {\n        return new TypeError(`WritableStreamDefaultController.prototype.${e} can only be used on a WritableStreamDefaultController`);\n      }\n      n2(on2, \"defaultControllerBrandCheckException$2\");\n      function $e(e) {\n        return new TypeError(`WritableStreamDefaultWriter.prototype.${e} can only be used on a WritableStreamDefaultWriter`);\n      }\n      n2($e, \"defaultWriterBrandCheckException\");\n      function Pt(e) {\n        return new TypeError(\"Cannot \" + e + \" a stream using a released writer\");\n      }\n      n2(Pt, \"defaultWriterLockException\");\n      function rr(e) {\n        e._closedPromise = A((t3, r2) => {\n          e._closedPromise_resolve = t3, e._closedPromise_reject = r2, e._closedPromiseState = \"pending\";\n        });\n      }\n      n2(rr, \"defaultWriterClosedPromiseInitialize\");\n      function Mo(e, t3) {\n        rr(e), an(e, t3);\n      }\n      n2(Mo, \"defaultWriterClosedPromiseInitializeAsRejected\");\n      function Va(e) {\n        rr(e), Uo(e);\n      }\n      n2(Va, \"defaultWriterClosedPromiseInitializeAsResolved\");\n      function an(e, t3) {\n        e._closedPromise_reject !== void 0 && (Q(e._closedPromise), e._closedPromise_reject(t3), e._closedPromise_resolve = void 0, e._closedPromise_reject = void 0, e._closedPromiseState = \"rejected\");\n      }\n      n2(an, \"defaultWriterClosedPromiseReject\");\n      function Qa(e, t3) {\n        Mo(e, t3);\n      }\n      n2(Qa, \"defaultWriterClosedPromiseResetToRejected\");\n      function Uo(e) {\n        e._closedPromise_resolve !== void 0 && (e._closedPromise_resolve(void 0), e._closedPromise_resolve = void 0, e._closedPromise_reject = void 0, e._closedPromiseState = \"resolved\");\n      }\n      n2(Uo, \"defaultWriterClosedPromiseResolve\");\n      function nr(e) {\n        e._readyPromise = A((t3, r2) => {\n          e._readyPromise_resolve = t3, e._readyPromise_reject = r2;\n        }), e._readyPromiseState = \"pending\";\n      }\n      n2(nr, \"defaultWriterReadyPromiseInitialize\");\n      function sn(e, t3) {\n        nr(e), No(e, t3);\n      }\n      n2(sn, \"defaultWriterReadyPromiseInitializeAsRejected\");\n      function xo(e) {\n        nr(e), ln(e);\n      }\n      n2(xo, \"defaultWriterReadyPromiseInitializeAsResolved\");\n      function No(e, t3) {\n        e._readyPromise_reject !== void 0 && (Q(e._readyPromise), e._readyPromise_reject(t3), e._readyPromise_resolve = void 0, e._readyPromise_reject = void 0, e._readyPromiseState = \"rejected\");\n      }\n      n2(No, \"defaultWriterReadyPromiseReject\");\n      function Ya(e) {\n        nr(e);\n      }\n      n2(Ya, \"defaultWriterReadyPromiseReset\");\n      function Ga(e, t3) {\n        sn(e, t3);\n      }\n      n2(Ga, \"defaultWriterReadyPromiseResetToRejected\");\n      function ln(e) {\n        e._readyPromise_resolve !== void 0 && (e._readyPromise_resolve(void 0), e._readyPromise_resolve = void 0, e._readyPromise_reject = void 0, e._readyPromiseState = \"fulfilled\");\n      }\n      n2(ln, \"defaultWriterReadyPromiseResolve\");\n      function Za() {\n        if (typeof globalThis < \"u\") return globalThis;\n        if (typeof self < \"u\") return self;\n        if (typeof n < \"u\") return n;\n      }\n      n2(Za, \"getGlobals\");\n      const un = Za();\n      function Ka(e) {\n        if (!(typeof e == \"function\" || typeof e == \"object\") || e.name !== \"DOMException\") return false;\n        try {\n          return new e(), true;\n        } catch (e2) {\n          return false;\n        }\n      }\n      n2(Ka, \"isDOMExceptionConstructor\");\n      function Ja() {\n        const e = un == null ? void 0 : un.DOMException;\n        return Ka(e) ? e : void 0;\n      }\n      n2(Ja, \"getFromGlobal\");\n      function Xa() {\n        const e = n2(function(r2, s) {\n          this.message = r2 || \"\", this.name = s || \"Error\", Error.captureStackTrace && Error.captureStackTrace(this, this.constructor);\n        }, \"DOMException\");\n        return h2(e, \"DOMException\"), e.prototype = Object.create(Error.prototype), Object.defineProperty(e.prototype, \"constructor\", { value: e, writable: true, configurable: true }), e;\n      }\n      n2(Xa, \"createPolyfill\");\n      const es = Ja() || Xa();\n      function Ho(e, t3, r2, s, u, c2) {\n        const d = Qe(e), m2 = ko(t3);\n        e._disturbed = true;\n        let R3 = false, y = T2(void 0);\n        return A((C2, P2) => {\n          let B2;\n          if (c2 !== void 0) {\n            if (B2 = n2(() => {\n              const _ = c2.reason !== void 0 ? c2.reason : new es(\"Aborted\", \"AbortError\"), E2 = [];\n              s || E2.push(() => t3._state === \"writable\" ? Kt(t3, _) : T2(void 0)), u || E2.push(() => e._state === \"readable\" ? ie(e, _) : T2(void 0)), N2(() => Promise.all(E2.map((k2) => k2())), true, _);\n            }, \"abortAlgorithm\"), c2.aborted) {\n              B2();\n              return;\n            }\n            c2.addEventListener(\"abort\", B2);\n          }\n          function ae() {\n            return A((_, E2) => {\n              function k2(Y) {\n                Y ? _() : q(nt(), k2, E2);\n              }\n              n2(k2, \"next\"), k2(false);\n            });\n          }\n          n2(ae, \"pipeLoop\");\n          function nt() {\n            return R3 ? T2(true) : q(m2._readyPromise, () => A((_, E2) => {\n              _t(d, { _chunkSteps: n2((k2) => {\n                y = q(Fo(m2, k2), void 0, f2), _(false);\n              }, \"_chunkSteps\"), _closeSteps: n2(() => _(true), \"_closeSteps\"), _errorSteps: E2 });\n            }));\n          }\n          if (n2(nt, \"pipeStep\"), Te(e, d._closedPromise, (_) => (s ? J(true, _) : N2(() => Kt(t3, _), true, _), null)), Te(t3, m2._closedPromise, (_) => (u ? J(true, _) : N2(() => ie(e, _), true, _), null)), x2(e, d._closedPromise, () => (r2 ? J() : N2(() => ja(m2)), null)), he(t3) || t3._state === \"closed\") {\n            const _ = new TypeError(\"the destination writable stream closed before all data could be piped to it\");\n            u ? J(true, _) : N2(() => ie(e, _), true, _);\n          }\n          Q(ae());\n          function Oe() {\n            const _ = y;\n            return q(y, () => _ !== y ? Oe() : void 0);\n          }\n          n2(Oe, \"waitForWritesToFinish\");\n          function Te(_, E2, k2) {\n            _._state === \"errored\" ? k2(_._storedError) : I2(E2, k2);\n          }\n          n2(Te, \"isOrBecomesErrored\");\n          function x2(_, E2, k2) {\n            _._state === \"closed\" ? k2() : V(E2, k2);\n          }\n          n2(x2, \"isOrBecomesClosed\");\n          function N2(_, E2, k2) {\n            if (R3) return;\n            R3 = true, t3._state === \"writable\" && !he(t3) ? V(Oe(), Y) : Y();\n            function Y() {\n              return g2(_(), () => Ce(E2, k2), (ot) => Ce(true, ot)), null;\n            }\n            n2(Y, \"doTheRest\");\n          }\n          n2(N2, \"shutdownWithAction\");\n          function J(_, E2) {\n            R3 || (R3 = true, t3._state === \"writable\" && !he(t3) ? V(Oe(), () => Ce(_, E2)) : Ce(_, E2));\n          }\n          n2(J, \"shutdown\");\n          function Ce(_, E2) {\n            return Io(m2), _e(d), c2 !== void 0 && c2.removeEventListener(\"abort\", B2), _ ? P2(E2) : C2(void 0), null;\n          }\n          n2(Ce, \"finalize\");\n        });\n      }\n      n2(Ho, \"ReadableStreamPipeTo\");\n      const Cn = class Cn {\n        constructor() {\n          throw new TypeError(\"Illegal constructor\");\n        }\n        get desiredSize() {\n          if (!or(this)) throw ar(\"desiredSize\");\n          return fn(this);\n        }\n        close() {\n          if (!or(this)) throw ar(\"close\");\n          if (!Je(this)) throw new TypeError(\"The stream is not in a state that permits close\");\n          De(this);\n        }\n        enqueue(t3 = void 0) {\n          if (!or(this)) throw ar(\"enqueue\");\n          if (!Je(this)) throw new TypeError(\"The stream is not in a state that permits enqueue\");\n          return Ke(this, t3);\n        }\n        error(t3 = void 0) {\n          if (!or(this)) throw ar(\"error\");\n          oe(this, t3);\n        }\n        [Ar](t3) {\n          Be(this);\n          const r2 = this._cancelAlgorithm(t3);\n          return ir(this), r2;\n        }\n        [Br](t3) {\n          const r2 = this._controlledReadableStream;\n          if (this._queue.length > 0) {\n            const s = xr(this);\n            this._closeRequested && this._queue.length === 0 ? (ir(this), At(r2)) : vt(this), t3._chunkSteps(s);\n          } else eo(r2, t3), vt(this);\n        }\n        [kr]() {\n        }\n      };\n      n2(Cn, \"ReadableStreamDefaultController\");\n      let ne = Cn;\n      Object.defineProperties(ne.prototype, { close: { enumerable: true }, enqueue: { enumerable: true }, error: { enumerable: true }, desiredSize: { enumerable: true } }), h2(ne.prototype.close, \"close\"), h2(ne.prototype.enqueue, \"enqueue\"), h2(ne.prototype.error, \"error\"), typeof Symbol.toStringTag == \"symbol\" && Object.defineProperty(ne.prototype, Symbol.toStringTag, { value: \"ReadableStreamDefaultController\", configurable: true });\n      function or(e) {\n        return !l(e) || !Object.prototype.hasOwnProperty.call(e, \"_controlledReadableStream\") ? false : e instanceof ne;\n      }\n      n2(or, \"IsReadableStreamDefaultController\");\n      function vt(e) {\n        if (!Vo(e)) return;\n        if (e._pulling) {\n          e._pullAgain = true;\n          return;\n        }\n        e._pulling = true;\n        const r2 = e._pullAlgorithm();\n        g2(r2, () => (e._pulling = false, e._pullAgain && (e._pullAgain = false, vt(e)), null), (s) => (oe(e, s), null));\n      }\n      n2(vt, \"ReadableStreamDefaultControllerCallPullIfNeeded\");\n      function Vo(e) {\n        const t3 = e._controlledReadableStream;\n        return !Je(e) || !e._started ? false : !!(qe(t3) && $t(t3) > 0 || fn(e) > 0);\n      }\n      n2(Vo, \"ReadableStreamDefaultControllerShouldCallPull\");\n      function ir(e) {\n        e._pullAlgorithm = void 0, e._cancelAlgorithm = void 0, e._strategySizeAlgorithm = void 0;\n      }\n      n2(ir, \"ReadableStreamDefaultControllerClearAlgorithms\");\n      function De(e) {\n        if (!Je(e)) return;\n        const t3 = e._controlledReadableStream;\n        e._closeRequested = true, e._queue.length === 0 && (ir(e), At(t3));\n      }\n      n2(De, \"ReadableStreamDefaultControllerClose\");\n      function Ke(e, t3) {\n        if (!Je(e)) return;\n        const r2 = e._controlledReadableStream;\n        if (qe(r2) && $t(r2) > 0) Lr(r2, t3, false);\n        else {\n          let s;\n          try {\n            s = e._strategySizeAlgorithm(t3);\n          } catch (u) {\n            throw oe(e, u), u;\n          }\n          try {\n            Nr(e, t3, s);\n          } catch (u) {\n            throw oe(e, u), u;\n          }\n        }\n        vt(e);\n      }\n      n2(Ke, \"ReadableStreamDefaultControllerEnqueue\");\n      function oe(e, t3) {\n        const r2 = e._controlledReadableStream;\n        r2._state === \"readable\" && (Be(e), ir(e), Zo(r2, t3));\n      }\n      n2(oe, \"ReadableStreamDefaultControllerError\");\n      function fn(e) {\n        const t3 = e._controlledReadableStream._state;\n        return t3 === \"errored\" ? null : t3 === \"closed\" ? 0 : e._strategyHWM - e._queueTotalSize;\n      }\n      n2(fn, \"ReadableStreamDefaultControllerGetDesiredSize\");\n      function ts(e) {\n        return !Vo(e);\n      }\n      n2(ts, \"ReadableStreamDefaultControllerHasBackpressure\");\n      function Je(e) {\n        const t3 = e._controlledReadableStream._state;\n        return !e._closeRequested && t3 === \"readable\";\n      }\n      n2(Je, \"ReadableStreamDefaultControllerCanCloseOrEnqueue\");\n      function Qo(e, t3, r2, s, u, c2, d) {\n        t3._controlledReadableStream = e, t3._queue = void 0, t3._queueTotalSize = void 0, Be(t3), t3._started = false, t3._closeRequested = false, t3._pullAgain = false, t3._pulling = false, t3._strategySizeAlgorithm = d, t3._strategyHWM = c2, t3._pullAlgorithm = s, t3._cancelAlgorithm = u, e._readableStreamController = t3;\n        const m2 = r2();\n        g2(T2(m2), () => (t3._started = true, vt(t3), null), (R3) => (oe(t3, R3), null));\n      }\n      n2(Qo, \"SetUpReadableStreamDefaultController\");\n      function rs(e, t3, r2, s) {\n        const u = Object.create(ne.prototype);\n        let c2, d, m2;\n        t3.start !== void 0 ? c2 = n2(() => t3.start(u), \"startAlgorithm\") : c2 = n2(() => {\n        }, \"startAlgorithm\"), t3.pull !== void 0 ? d = n2(() => t3.pull(u), \"pullAlgorithm\") : d = n2(() => T2(void 0), \"pullAlgorithm\"), t3.cancel !== void 0 ? m2 = n2((R3) => t3.cancel(R3), \"cancelAlgorithm\") : m2 = n2(() => T2(void 0), \"cancelAlgorithm\"), Qo(e, u, c2, d, m2, r2, s);\n      }\n      n2(rs, \"SetUpReadableStreamDefaultControllerFromUnderlyingSource\");\n      function ar(e) {\n        return new TypeError(`ReadableStreamDefaultController.prototype.${e} can only be used on a ReadableStreamDefaultController`);\n      }\n      n2(ar, \"defaultControllerBrandCheckException$1\");\n      function ns(e, t3) {\n        return Ie(e._readableStreamController) ? is(e) : os(e);\n      }\n      n2(ns, \"ReadableStreamTee\");\n      function os(e, t3) {\n        const r2 = Qe(e);\n        let s = false, u = false, c2 = false, d = false, m2, R3, y, C2, P2;\n        const B2 = A((x2) => {\n          P2 = x2;\n        });\n        function ae() {\n          return s ? (u = true, T2(void 0)) : (s = true, _t(r2, { _chunkSteps: n2((N2) => {\n            ge(() => {\n              u = false;\n              const J = N2, Ce = N2;\n              c2 || Ke(y._readableStreamController, J), d || Ke(C2._readableStreamController, Ce), s = false, u && ae();\n            });\n          }, \"_chunkSteps\"), _closeSteps: n2(() => {\n            s = false, c2 || De(y._readableStreamController), d || De(C2._readableStreamController), (!c2 || !d) && P2(void 0);\n          }, \"_closeSteps\"), _errorSteps: n2(() => {\n            s = false;\n          }, \"_errorSteps\") }), T2(void 0));\n        }\n        n2(ae, \"pullAlgorithm\");\n        function nt(x2) {\n          if (c2 = true, m2 = x2, d) {\n            const N2 = St([m2, R3]), J = ie(e, N2);\n            P2(J);\n          }\n          return B2;\n        }\n        n2(nt, \"cancel1Algorithm\");\n        function Oe(x2) {\n          if (d = true, R3 = x2, c2) {\n            const N2 = St([m2, R3]), J = ie(e, N2);\n            P2(J);\n          }\n          return B2;\n        }\n        n2(Oe, \"cancel2Algorithm\");\n        function Te() {\n        }\n        return n2(Te, \"startAlgorithm\"), y = Et(Te, ae, nt), C2 = Et(Te, ae, Oe), I2(r2._closedPromise, (x2) => (oe(y._readableStreamController, x2), oe(C2._readableStreamController, x2), (!c2 || !d) && P2(void 0), null)), [y, C2];\n      }\n      n2(os, \"ReadableStreamDefaultTee\");\n      function is(e) {\n        let t3 = Qe(e), r2 = false, s = false, u = false, c2 = false, d = false, m2, R3, y, C2, P2;\n        const B2 = A((_) => {\n          P2 = _;\n        });\n        function ae(_) {\n          I2(_._closedPromise, (E2) => (_ !== t3 || (K(y._readableStreamController, E2), K(C2._readableStreamController, E2), (!c2 || !d) && P2(void 0)), null));\n        }\n        n2(ae, \"forwardReaderError\");\n        function nt() {\n          je(t3) && (_e(t3), t3 = Qe(e), ae(t3)), _t(t3, { _chunkSteps: n2((E2) => {\n            ge(() => {\n              s = false, u = false;\n              const k2 = E2;\n              let Y = E2;\n              if (!c2 && !d) try {\n                Y = fo(E2);\n              } catch (ot) {\n                K(y._readableStreamController, ot), K(C2._readableStreamController, ot), P2(ie(e, ot));\n                return;\n              }\n              c2 || Ht(y._readableStreamController, k2), d || Ht(C2._readableStreamController, Y), r2 = false, s ? Te() : u && x2();\n            });\n          }, \"_chunkSteps\"), _closeSteps: n2(() => {\n            r2 = false, c2 || wt(y._readableStreamController), d || wt(C2._readableStreamController), y._readableStreamController._pendingPullIntos.length > 0 && Vt(y._readableStreamController, 0), C2._readableStreamController._pendingPullIntos.length > 0 && Vt(C2._readableStreamController, 0), (!c2 || !d) && P2(void 0);\n          }, \"_closeSteps\"), _errorSteps: n2(() => {\n            r2 = false;\n          }, \"_errorSteps\") });\n        }\n        n2(nt, \"pullWithDefaultReader\");\n        function Oe(_, E2) {\n          Ee(t3) && (_e(t3), t3 = Co(e), ae(t3));\n          const k2 = E2 ? C2 : y, Y = E2 ? y : C2;\n          Eo(t3, _, 1, { _chunkSteps: n2((it) => {\n            ge(() => {\n              s = false, u = false;\n              const at = E2 ? d : c2;\n              if (E2 ? c2 : d) at || Qt(k2._readableStreamController, it);\n              else {\n                let ui;\n                try {\n                  ui = fo(it);\n                } catch (kn) {\n                  K(k2._readableStreamController, kn), K(Y._readableStreamController, kn), P2(ie(e, kn));\n                  return;\n                }\n                at || Qt(k2._readableStreamController, it), Ht(Y._readableStreamController, ui);\n              }\n              r2 = false, s ? Te() : u && x2();\n            });\n          }, \"_chunkSteps\"), _closeSteps: n2((it) => {\n            r2 = false;\n            const at = E2 ? d : c2, cr = E2 ? c2 : d;\n            at || wt(k2._readableStreamController), cr || wt(Y._readableStreamController), it !== void 0 && (at || Qt(k2._readableStreamController, it), !cr && Y._readableStreamController._pendingPullIntos.length > 0 && Vt(Y._readableStreamController, 0)), (!at || !cr) && P2(void 0);\n          }, \"_closeSteps\"), _errorSteps: n2(() => {\n            r2 = false;\n          }, \"_errorSteps\") });\n        }\n        n2(Oe, \"pullWithBYOBReader\");\n        function Te() {\n          if (r2) return s = true, T2(void 0);\n          r2 = true;\n          const _ = Gr(y._readableStreamController);\n          return _ === null ? nt() : Oe(_._view, false), T2(void 0);\n        }\n        n2(Te, \"pull1Algorithm\");\n        function x2() {\n          if (r2) return u = true, T2(void 0);\n          r2 = true;\n          const _ = Gr(C2._readableStreamController);\n          return _ === null ? nt() : Oe(_._view, true), T2(void 0);\n        }\n        n2(x2, \"pull2Algorithm\");\n        function N2(_) {\n          if (c2 = true, m2 = _, d) {\n            const E2 = St([m2, R3]), k2 = ie(e, E2);\n            P2(k2);\n          }\n          return B2;\n        }\n        n2(N2, \"cancel1Algorithm\");\n        function J(_) {\n          if (d = true, R3 = _, c2) {\n            const E2 = St([m2, R3]), k2 = ie(e, E2);\n            P2(k2);\n          }\n          return B2;\n        }\n        n2(J, \"cancel2Algorithm\");\n        function Ce() {\n        }\n        return n2(Ce, \"startAlgorithm\"), y = Go(Ce, Te, N2), C2 = Go(Ce, x2, J), ae(t3), [y, C2];\n      }\n      n2(is, \"ReadableByteStreamTee\");\n      function as(e) {\n        return l(e) && typeof e.getReader < \"u\";\n      }\n      n2(as, \"isReadableStreamLike\");\n      function ss(e) {\n        return as(e) ? us(e.getReader()) : ls(e);\n      }\n      n2(ss, \"ReadableStreamFrom\");\n      function ls(e) {\n        let t3;\n        const r2 = uo(e, \"async\"), s = f2;\n        function u() {\n          let d;\n          try {\n            d = Xi(r2);\n          } catch (R3) {\n            return b(R3);\n          }\n          const m2 = T2(d);\n          return F4(m2, (R3) => {\n            if (!l(R3)) throw new TypeError(\"The promise returned by the iterator.next() method must fulfill with an object\");\n            if (ea(R3)) De(t3._readableStreamController);\n            else {\n              const C2 = ta(R3);\n              Ke(t3._readableStreamController, C2);\n            }\n          });\n        }\n        n2(u, \"pullAlgorithm\");\n        function c2(d) {\n          const m2 = r2.iterator;\n          let R3;\n          try {\n            R3 = Ut(m2, \"return\");\n          } catch (P2) {\n            return b(P2);\n          }\n          if (R3 === void 0) return T2(void 0);\n          let y;\n          try {\n            y = z(R3, m2, [d]);\n          } catch (P2) {\n            return b(P2);\n          }\n          const C2 = T2(y);\n          return F4(C2, (P2) => {\n            if (!l(P2)) throw new TypeError(\"The promise returned by the iterator.return() method must fulfill with an object\");\n          });\n        }\n        return n2(c2, \"cancelAlgorithm\"), t3 = Et(s, u, c2, 0), t3;\n      }\n      n2(ls, \"ReadableStreamFromIterable\");\n      function us(e) {\n        let t3;\n        const r2 = f2;\n        function s() {\n          let c2;\n          try {\n            c2 = e.read();\n          } catch (d) {\n            return b(d);\n          }\n          return F4(c2, (d) => {\n            if (!l(d)) throw new TypeError(\"The promise returned by the reader.read() method must fulfill with an object\");\n            if (d.done) De(t3._readableStreamController);\n            else {\n              const m2 = d.value;\n              Ke(t3._readableStreamController, m2);\n            }\n          });\n        }\n        n2(s, \"pullAlgorithm\");\n        function u(c2) {\n          try {\n            return T2(e.cancel(c2));\n          } catch (d) {\n            return b(d);\n          }\n        }\n        return n2(u, \"cancelAlgorithm\"), t3 = Et(r2, s, u, 0), t3;\n      }\n      n2(us, \"ReadableStreamFromDefaultReader\");\n      function fs6(e, t3) {\n        ue(e, t3);\n        const r2 = e, s = r2 == null ? void 0 : r2.autoAllocateChunkSize, u = r2 == null ? void 0 : r2.cancel, c2 = r2 == null ? void 0 : r2.pull, d = r2 == null ? void 0 : r2.start, m2 = r2 == null ? void 0 : r2.type;\n        return { autoAllocateChunkSize: s === void 0 ? void 0 : Fr(s, `${t3} has member 'autoAllocateChunkSize' that`), cancel: u === void 0 ? void 0 : cs(u, r2, `${t3} has member 'cancel' that`), pull: c2 === void 0 ? void 0 : ds(c2, r2, `${t3} has member 'pull' that`), start: d === void 0 ? void 0 : hs(d, r2, `${t3} has member 'start' that`), type: m2 === void 0 ? void 0 : ps(m2, `${t3} has member 'type' that`) };\n      }\n      n2(fs6, \"convertUnderlyingDefaultOrByteSource\");\n      function cs(e, t3, r2) {\n        return Z2(e, r2), (s) => j(e, t3, [s]);\n      }\n      n2(cs, \"convertUnderlyingSourceCancelCallback\");\n      function ds(e, t3, r2) {\n        return Z2(e, r2), (s) => j(e, t3, [s]);\n      }\n      n2(ds, \"convertUnderlyingSourcePullCallback\");\n      function hs(e, t3, r2) {\n        return Z2(e, r2), (s) => z(e, t3, [s]);\n      }\n      n2(hs, \"convertUnderlyingSourceStartCallback\");\n      function ps(e, t3) {\n        if (e = `${e}`, e !== \"bytes\") throw new TypeError(`${t3} '${e}' is not a valid enumeration value for ReadableStreamType`);\n        return e;\n      }\n      n2(ps, \"convertReadableStreamType\");\n      function bs(e, t3) {\n        return ue(e, t3), { preventCancel: !!(e == null ? void 0 : e.preventCancel) };\n      }\n      n2(bs, \"convertIteratorOptions\");\n      function Yo(e, t3) {\n        ue(e, t3);\n        const r2 = e == null ? void 0 : e.preventAbort, s = e == null ? void 0 : e.preventCancel, u = e == null ? void 0 : e.preventClose, c2 = e == null ? void 0 : e.signal;\n        return c2 !== void 0 && ms(c2, `${t3} has member 'signal' that`), { preventAbort: !!r2, preventCancel: !!s, preventClose: !!u, signal: c2 };\n      }\n      n2(Yo, \"convertPipeOptions\");\n      function ms(e, t3) {\n        if (!Ca(e)) throw new TypeError(`${t3} is not an AbortSignal.`);\n      }\n      n2(ms, \"assertAbortSignal\");\n      function ys(e, t3) {\n        ue(e, t3);\n        const r2 = e == null ? void 0 : e.readable;\n        zr(r2, \"readable\", \"ReadableWritablePair\"), jr(r2, `${t3} has member 'readable' that`);\n        const s = e == null ? void 0 : e.writable;\n        return zr(s, \"writable\", \"ReadableWritablePair\"), Bo(s, `${t3} has member 'writable' that`), { readable: r2, writable: s };\n      }\n      n2(ys, \"convertReadableWritablePair\");\n      const Pn = class Pn {\n        constructor(t3 = {}, r2 = {}) {\n          t3 === void 0 ? t3 = null : Jn(t3, \"First parameter\");\n          const s = Zt(r2, \"Second parameter\"), u = fs6(t3, \"First parameter\");\n          if (cn(this), u.type === \"bytes\") {\n            if (s.size !== void 0) throw new RangeError(\"The strategy for a byte stream cannot have a size function\");\n            const c2 = Tt(s, 0);\n            ca(this, u, c2);\n          } else {\n            const c2 = Gt(s), d = Tt(s, 1);\n            rs(this, u, d, c2);\n          }\n        }\n        get locked() {\n          if (!We(this)) throw Me(\"locked\");\n          return qe(this);\n        }\n        cancel(t3 = void 0) {\n          return We(this) ? qe(this) ? b(new TypeError(\"Cannot cancel a stream that already has a reader\")) : ie(this, t3) : b(Me(\"cancel\"));\n        }\n        getReader(t3 = void 0) {\n          if (!We(this)) throw Me(\"getReader\");\n          return ha(t3, \"First parameter\").mode === void 0 ? Qe(this) : Co(this);\n        }\n        pipeThrough(t3, r2 = {}) {\n          if (!We(this)) throw Me(\"pipeThrough\");\n          Se(t3, 1, \"pipeThrough\");\n          const s = ys(t3, \"First parameter\"), u = Yo(r2, \"Second parameter\");\n          if (qe(this)) throw new TypeError(\"ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream\");\n          if (Ze(s.writable)) throw new TypeError(\"ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream\");\n          const c2 = Ho(this, s.writable, u.preventClose, u.preventAbort, u.preventCancel, u.signal);\n          return Q(c2), s.readable;\n        }\n        pipeTo(t3, r2 = {}) {\n          if (!We(this)) return b(Me(\"pipeTo\"));\n          if (t3 === void 0) return b(\"Parameter 1 is required in 'pipeTo'.\");\n          if (!Ge(t3)) return b(new TypeError(\"ReadableStream.prototype.pipeTo's first argument must be a WritableStream\"));\n          let s;\n          try {\n            s = Yo(r2, \"Second parameter\");\n          } catch (u) {\n            return b(u);\n          }\n          return qe(this) ? b(new TypeError(\"ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream\")) : Ze(t3) ? b(new TypeError(\"ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream\")) : Ho(this, t3, s.preventClose, s.preventAbort, s.preventCancel, s.signal);\n        }\n        tee() {\n          if (!We(this)) throw Me(\"tee\");\n          const t3 = ns(this);\n          return St(t3);\n        }\n        values(t3 = void 0) {\n          if (!We(this)) throw Me(\"values\");\n          const r2 = bs(t3, \"First parameter\");\n          return Ki(this, r2.preventCancel);\n        }\n        [Ur](t3) {\n          return this.values(t3);\n        }\n        static from(t3) {\n          return ss(t3);\n        }\n      };\n      n2(Pn, \"ReadableStream\");\n      let L = Pn;\n      Object.defineProperties(L, { from: { enumerable: true } }), Object.defineProperties(L.prototype, { cancel: { enumerable: true }, getReader: { enumerable: true }, pipeThrough: { enumerable: true }, pipeTo: { enumerable: true }, tee: { enumerable: true }, values: { enumerable: true }, locked: { enumerable: true } }), h2(L.from, \"from\"), h2(L.prototype.cancel, \"cancel\"), h2(L.prototype.getReader, \"getReader\"), h2(L.prototype.pipeThrough, \"pipeThrough\"), h2(L.prototype.pipeTo, \"pipeTo\"), h2(L.prototype.tee, \"tee\"), h2(L.prototype.values, \"values\"), typeof Symbol.toStringTag == \"symbol\" && Object.defineProperty(L.prototype, Symbol.toStringTag, { value: \"ReadableStream\", configurable: true }), Object.defineProperty(L.prototype, Ur, { value: L.prototype.values, writable: true, configurable: true });\n      function Et(e, t3, r2, s = 1, u = () => 1) {\n        const c2 = Object.create(L.prototype);\n        cn(c2);\n        const d = Object.create(ne.prototype);\n        return Qo(c2, d, e, t3, r2, s, u), c2;\n      }\n      n2(Et, \"CreateReadableStream\");\n      function Go(e, t3, r2) {\n        const s = Object.create(L.prototype);\n        cn(s);\n        const u = Object.create(te.prototype);\n        return To(s, u, e, t3, r2, 0, void 0), s;\n      }\n      n2(Go, \"CreateReadableByteStream\");\n      function cn(e) {\n        e._state = \"readable\", e._reader = void 0, e._storedError = void 0, e._disturbed = false;\n      }\n      n2(cn, \"InitializeReadableStream\");\n      function We(e) {\n        return !l(e) || !Object.prototype.hasOwnProperty.call(e, \"_readableStreamController\") ? false : e instanceof L;\n      }\n      n2(We, \"IsReadableStream\");\n      function qe(e) {\n        return e._reader !== void 0;\n      }\n      n2(qe, \"IsReadableStreamLocked\");\n      function ie(e, t3) {\n        if (e._disturbed = true, e._state === \"closed\") return T2(void 0);\n        if (e._state === \"errored\") return b(e._storedError);\n        At(e);\n        const r2 = e._reader;\n        if (r2 !== void 0 && je(r2)) {\n          const u = r2._readIntoRequests;\n          r2._readIntoRequests = new D2(), u.forEach((c2) => {\n            c2._closeSteps(void 0);\n          });\n        }\n        const s = e._readableStreamController[Ar](t3);\n        return F4(s, f2);\n      }\n      n2(ie, \"ReadableStreamCancel\");\n      function At(e) {\n        e._state = \"closed\";\n        const t3 = e._reader;\n        if (t3 !== void 0 && (Zn(t3), Ee(t3))) {\n          const r2 = t3._readRequests;\n          t3._readRequests = new D2(), r2.forEach((s) => {\n            s._closeSteps();\n          });\n        }\n      }\n      n2(At, \"ReadableStreamClose\");\n      function Zo(e, t3) {\n        e._state = \"errored\", e._storedError = t3;\n        const r2 = e._reader;\n        r2 !== void 0 && (Or(r2, t3), Ee(r2) ? ro(r2, t3) : Ao(r2, t3));\n      }\n      n2(Zo, \"ReadableStreamError\");\n      function Me(e) {\n        return new TypeError(`ReadableStream.prototype.${e} can only be used on a ReadableStream`);\n      }\n      n2(Me, \"streamBrandCheckException$1\");\n      function Ko(e, t3) {\n        ue(e, t3);\n        const r2 = e == null ? void 0 : e.highWaterMark;\n        return zr(r2, \"highWaterMark\", \"QueuingStrategyInit\"), { highWaterMark: Ir(r2) };\n      }\n      n2(Ko, \"convertQueuingStrategyInit\");\n      const Jo = n2((e) => e.byteLength, \"byteLengthSizeFunction\");\n      h2(Jo, \"size\");\n      const vn = class vn {\n        constructor(t3) {\n          Se(t3, 1, \"ByteLengthQueuingStrategy\"), t3 = Ko(t3, \"First parameter\"), this._byteLengthQueuingStrategyHighWaterMark = t3.highWaterMark;\n        }\n        get highWaterMark() {\n          if (!ei(this)) throw Xo(\"highWaterMark\");\n          return this._byteLengthQueuingStrategyHighWaterMark;\n        }\n        get size() {\n          if (!ei(this)) throw Xo(\"size\");\n          return Jo;\n        }\n      };\n      n2(vn, \"ByteLengthQueuingStrategy\");\n      let Xe = vn;\n      Object.defineProperties(Xe.prototype, { highWaterMark: { enumerable: true }, size: { enumerable: true } }), typeof Symbol.toStringTag == \"symbol\" && Object.defineProperty(Xe.prototype, Symbol.toStringTag, { value: \"ByteLengthQueuingStrategy\", configurable: true });\n      function Xo(e) {\n        return new TypeError(`ByteLengthQueuingStrategy.prototype.${e} can only be used on a ByteLengthQueuingStrategy`);\n      }\n      n2(Xo, \"byteLengthBrandCheckException\");\n      function ei(e) {\n        return !l(e) || !Object.prototype.hasOwnProperty.call(e, \"_byteLengthQueuingStrategyHighWaterMark\") ? false : e instanceof Xe;\n      }\n      n2(ei, \"IsByteLengthQueuingStrategy\");\n      const ti = n2(() => 1, \"countSizeFunction\");\n      h2(ti, \"size\");\n      const En = class En {\n        constructor(t3) {\n          Se(t3, 1, \"CountQueuingStrategy\"), t3 = Ko(t3, \"First parameter\"), this._countQueuingStrategyHighWaterMark = t3.highWaterMark;\n        }\n        get highWaterMark() {\n          if (!ni(this)) throw ri(\"highWaterMark\");\n          return this._countQueuingStrategyHighWaterMark;\n        }\n        get size() {\n          if (!ni(this)) throw ri(\"size\");\n          return ti;\n        }\n      };\n      n2(En, \"CountQueuingStrategy\");\n      let et = En;\n      Object.defineProperties(et.prototype, { highWaterMark: { enumerable: true }, size: { enumerable: true } }), typeof Symbol.toStringTag == \"symbol\" && Object.defineProperty(et.prototype, Symbol.toStringTag, { value: \"CountQueuingStrategy\", configurable: true });\n      function ri(e) {\n        return new TypeError(`CountQueuingStrategy.prototype.${e} can only be used on a CountQueuingStrategy`);\n      }\n      n2(ri, \"countBrandCheckException\");\n      function ni(e) {\n        return !l(e) || !Object.prototype.hasOwnProperty.call(e, \"_countQueuingStrategyHighWaterMark\") ? false : e instanceof et;\n      }\n      n2(ni, \"IsCountQueuingStrategy\");\n      function gs(e, t3) {\n        ue(e, t3);\n        const r2 = e == null ? void 0 : e.cancel, s = e == null ? void 0 : e.flush, u = e == null ? void 0 : e.readableType, c2 = e == null ? void 0 : e.start, d = e == null ? void 0 : e.transform, m2 = e == null ? void 0 : e.writableType;\n        return { cancel: r2 === void 0 ? void 0 : Rs(r2, e, `${t3} has member 'cancel' that`), flush: s === void 0 ? void 0 : _s(s, e, `${t3} has member 'flush' that`), readableType: u, start: c2 === void 0 ? void 0 : Ss(c2, e, `${t3} has member 'start' that`), transform: d === void 0 ? void 0 : ws(d, e, `${t3} has member 'transform' that`), writableType: m2 };\n      }\n      n2(gs, \"convertTransformer\");\n      function _s(e, t3, r2) {\n        return Z2(e, r2), (s) => j(e, t3, [s]);\n      }\n      n2(_s, \"convertTransformerFlushCallback\");\n      function Ss(e, t3, r2) {\n        return Z2(e, r2), (s) => z(e, t3, [s]);\n      }\n      n2(Ss, \"convertTransformerStartCallback\");\n      function ws(e, t3, r2) {\n        return Z2(e, r2), (s, u) => j(e, t3, [s, u]);\n      }\n      n2(ws, \"convertTransformerTransformCallback\");\n      function Rs(e, t3, r2) {\n        return Z2(e, r2), (s) => j(e, t3, [s]);\n      }\n      n2(Rs, \"convertTransformerCancelCallback\");\n      const An = class An {\n        constructor(t3 = {}, r2 = {}, s = {}) {\n          t3 === void 0 && (t3 = null);\n          const u = Zt(r2, \"Second parameter\"), c2 = Zt(s, \"Third parameter\"), d = gs(t3, \"First parameter\");\n          if (d.readableType !== void 0) throw new RangeError(\"Invalid readableType specified\");\n          if (d.writableType !== void 0) throw new RangeError(\"Invalid writableType specified\");\n          const m2 = Tt(c2, 0), R3 = Gt(c2), y = Tt(u, 1), C2 = Gt(u);\n          let P2;\n          const B2 = A((ae) => {\n            P2 = ae;\n          });\n          Ts(this, B2, y, C2, m2, R3), Ps(this, d), d.start !== void 0 ? P2(d.start(this._transformStreamController)) : P2(void 0);\n        }\n        get readable() {\n          if (!oi(this)) throw li(\"readable\");\n          return this._readable;\n        }\n        get writable() {\n          if (!oi(this)) throw li(\"writable\");\n          return this._writable;\n        }\n      };\n      n2(An, \"TransformStream\");\n      let tt = An;\n      Object.defineProperties(tt.prototype, { readable: { enumerable: true }, writable: { enumerable: true } }), typeof Symbol.toStringTag == \"symbol\" && Object.defineProperty(tt.prototype, Symbol.toStringTag, { value: \"TransformStream\", configurable: true });\n      function Ts(e, t3, r2, s, u, c2) {\n        function d() {\n          return t3;\n        }\n        n2(d, \"startAlgorithm\");\n        function m2(B2) {\n          return As(e, B2);\n        }\n        n2(m2, \"writeAlgorithm\");\n        function R3(B2) {\n          return Bs(e, B2);\n        }\n        n2(R3, \"abortAlgorithm\");\n        function y() {\n          return ks(e);\n        }\n        n2(y, \"closeAlgorithm\"), e._writable = Ea(d, m2, y, R3, r2, s);\n        function C2() {\n          return Ws(e);\n        }\n        n2(C2, \"pullAlgorithm\");\n        function P2(B2) {\n          return qs(e, B2);\n        }\n        n2(P2, \"cancelAlgorithm\"), e._readable = Et(d, C2, P2, u, c2), e._backpressure = void 0, e._backpressureChangePromise = void 0, e._backpressureChangePromise_resolve = void 0, sr(e, true), e._transformStreamController = void 0;\n      }\n      n2(Ts, \"InitializeTransformStream\");\n      function oi(e) {\n        return !l(e) || !Object.prototype.hasOwnProperty.call(e, \"_transformStreamController\") ? false : e instanceof tt;\n      }\n      n2(oi, \"IsTransformStream\");\n      function ii(e, t3) {\n        oe(e._readable._readableStreamController, t3), dn(e, t3);\n      }\n      n2(ii, \"TransformStreamError\");\n      function dn(e, t3) {\n        ur(e._transformStreamController), Ct(e._writable._writableStreamController, t3), hn(e);\n      }\n      n2(dn, \"TransformStreamErrorWritableAndUnblockWrite\");\n      function hn(e) {\n        e._backpressure && sr(e, false);\n      }\n      n2(hn, \"TransformStreamUnblockWrite\");\n      function sr(e, t3) {\n        e._backpressureChangePromise !== void 0 && e._backpressureChangePromise_resolve(), e._backpressureChangePromise = A((r2) => {\n          e._backpressureChangePromise_resolve = r2;\n        }), e._backpressure = t3;\n      }\n      n2(sr, \"TransformStreamSetBackpressure\");\n      const Bn = class Bn {\n        constructor() {\n          throw new TypeError(\"Illegal constructor\");\n        }\n        get desiredSize() {\n          if (!lr(this)) throw fr(\"desiredSize\");\n          const t3 = this._controlledTransformStream._readable._readableStreamController;\n          return fn(t3);\n        }\n        enqueue(t3 = void 0) {\n          if (!lr(this)) throw fr(\"enqueue\");\n          ai(this, t3);\n        }\n        error(t3 = void 0) {\n          if (!lr(this)) throw fr(\"error\");\n          vs(this, t3);\n        }\n        terminate() {\n          if (!lr(this)) throw fr(\"terminate\");\n          Es(this);\n        }\n      };\n      n2(Bn, \"TransformStreamDefaultController\");\n      let pe = Bn;\n      Object.defineProperties(pe.prototype, { enqueue: { enumerable: true }, error: { enumerable: true }, terminate: { enumerable: true }, desiredSize: { enumerable: true } }), h2(pe.prototype.enqueue, \"enqueue\"), h2(pe.prototype.error, \"error\"), h2(pe.prototype.terminate, \"terminate\"), typeof Symbol.toStringTag == \"symbol\" && Object.defineProperty(pe.prototype, Symbol.toStringTag, { value: \"TransformStreamDefaultController\", configurable: true });\n      function lr(e) {\n        return !l(e) || !Object.prototype.hasOwnProperty.call(e, \"_controlledTransformStream\") ? false : e instanceof pe;\n      }\n      n2(lr, \"IsTransformStreamDefaultController\");\n      function Cs(e, t3, r2, s, u) {\n        t3._controlledTransformStream = e, e._transformStreamController = t3, t3._transformAlgorithm = r2, t3._flushAlgorithm = s, t3._cancelAlgorithm = u, t3._finishPromise = void 0, t3._finishPromise_resolve = void 0, t3._finishPromise_reject = void 0;\n      }\n      n2(Cs, \"SetUpTransformStreamDefaultController\");\n      function Ps(e, t3) {\n        const r2 = Object.create(pe.prototype);\n        let s, u, c2;\n        t3.transform !== void 0 ? s = n2((d) => t3.transform(d, r2), \"transformAlgorithm\") : s = n2((d) => {\n          try {\n            return ai(r2, d), T2(void 0);\n          } catch (m2) {\n            return b(m2);\n          }\n        }, \"transformAlgorithm\"), t3.flush !== void 0 ? u = n2(() => t3.flush(r2), \"flushAlgorithm\") : u = n2(() => T2(void 0), \"flushAlgorithm\"), t3.cancel !== void 0 ? c2 = n2((d) => t3.cancel(d), \"cancelAlgorithm\") : c2 = n2(() => T2(void 0), \"cancelAlgorithm\"), Cs(e, r2, s, u, c2);\n      }\n      n2(Ps, \"SetUpTransformStreamDefaultControllerFromTransformer\");\n      function ur(e) {\n        e._transformAlgorithm = void 0, e._flushAlgorithm = void 0, e._cancelAlgorithm = void 0;\n      }\n      n2(ur, \"TransformStreamDefaultControllerClearAlgorithms\");\n      function ai(e, t3) {\n        const r2 = e._controlledTransformStream, s = r2._readable._readableStreamController;\n        if (!Je(s)) throw new TypeError(\"Readable side is not in a state that permits enqueue\");\n        try {\n          Ke(s, t3);\n        } catch (c2) {\n          throw dn(r2, c2), r2._readable._storedError;\n        }\n        ts(s) !== r2._backpressure && sr(r2, true);\n      }\n      n2(ai, \"TransformStreamDefaultControllerEnqueue\");\n      function vs(e, t3) {\n        ii(e._controlledTransformStream, t3);\n      }\n      n2(vs, \"TransformStreamDefaultControllerError\");\n      function si(e, t3) {\n        const r2 = e._transformAlgorithm(t3);\n        return F4(r2, void 0, (s) => {\n          throw ii(e._controlledTransformStream, s), s;\n        });\n      }\n      n2(si, \"TransformStreamDefaultControllerPerformTransform\");\n      function Es(e) {\n        const t3 = e._controlledTransformStream, r2 = t3._readable._readableStreamController;\n        De(r2);\n        const s = new TypeError(\"TransformStream terminated\");\n        dn(t3, s);\n      }\n      n2(Es, \"TransformStreamDefaultControllerTerminate\");\n      function As(e, t3) {\n        const r2 = e._transformStreamController;\n        if (e._backpressure) {\n          const s = e._backpressureChangePromise;\n          return F4(s, () => {\n            const u = e._writable;\n            if (u._state === \"erroring\") throw u._storedError;\n            return si(r2, t3);\n          });\n        }\n        return si(r2, t3);\n      }\n      n2(As, \"TransformStreamDefaultSinkWriteAlgorithm\");\n      function Bs(e, t3) {\n        const r2 = e._transformStreamController;\n        if (r2._finishPromise !== void 0) return r2._finishPromise;\n        const s = e._readable;\n        r2._finishPromise = A((c2, d) => {\n          r2._finishPromise_resolve = c2, r2._finishPromise_reject = d;\n        });\n        const u = r2._cancelAlgorithm(t3);\n        return ur(r2), g2(u, () => (s._state === \"errored\" ? rt(r2, s._storedError) : (oe(s._readableStreamController, t3), pn(r2)), null), (c2) => (oe(s._readableStreamController, c2), rt(r2, c2), null)), r2._finishPromise;\n      }\n      n2(Bs, \"TransformStreamDefaultSinkAbortAlgorithm\");\n      function ks(e) {\n        const t3 = e._transformStreamController;\n        if (t3._finishPromise !== void 0) return t3._finishPromise;\n        const r2 = e._readable;\n        t3._finishPromise = A((u, c2) => {\n          t3._finishPromise_resolve = u, t3._finishPromise_reject = c2;\n        });\n        const s = t3._flushAlgorithm();\n        return ur(t3), g2(s, () => (r2._state === \"errored\" ? rt(t3, r2._storedError) : (De(r2._readableStreamController), pn(t3)), null), (u) => (oe(r2._readableStreamController, u), rt(t3, u), null)), t3._finishPromise;\n      }\n      n2(ks, \"TransformStreamDefaultSinkCloseAlgorithm\");\n      function Ws(e) {\n        return sr(e, false), e._backpressureChangePromise;\n      }\n      n2(Ws, \"TransformStreamDefaultSourcePullAlgorithm\");\n      function qs(e, t3) {\n        const r2 = e._transformStreamController;\n        if (r2._finishPromise !== void 0) return r2._finishPromise;\n        const s = e._writable;\n        r2._finishPromise = A((c2, d) => {\n          r2._finishPromise_resolve = c2, r2._finishPromise_reject = d;\n        });\n        const u = r2._cancelAlgorithm(t3);\n        return ur(r2), g2(u, () => (s._state === \"errored\" ? rt(r2, s._storedError) : (Ct(s._writableStreamController, t3), hn(e), pn(r2)), null), (c2) => (Ct(s._writableStreamController, c2), hn(e), rt(r2, c2), null)), r2._finishPromise;\n      }\n      n2(qs, \"TransformStreamDefaultSourceCancelAlgorithm\");\n      function fr(e) {\n        return new TypeError(`TransformStreamDefaultController.prototype.${e} can only be used on a TransformStreamDefaultController`);\n      }\n      n2(fr, \"defaultControllerBrandCheckException\");\n      function pn(e) {\n        e._finishPromise_resolve !== void 0 && (e._finishPromise_resolve(), e._finishPromise_resolve = void 0, e._finishPromise_reject = void 0);\n      }\n      n2(pn, \"defaultControllerFinishPromiseResolve\");\n      function rt(e, t3) {\n        e._finishPromise_reject !== void 0 && (Q(e._finishPromise), e._finishPromise_reject(t3), e._finishPromise_resolve = void 0, e._finishPromise_reject = void 0);\n      }\n      n2(rt, \"defaultControllerFinishPromiseReject\");\n      function li(e) {\n        return new TypeError(`TransformStream.prototype.${e} can only be used on a TransformStream`);\n      }\n      n2(li, \"streamBrandCheckException\"), a.ByteLengthQueuingStrategy = Xe, a.CountQueuingStrategy = et, a.ReadableByteStreamController = te, a.ReadableStream = L, a.ReadableStreamBYOBReader = ce, a.ReadableStreamBYOBRequest = Re, a.ReadableStreamDefaultController = ne, a.ReadableStreamDefaultReader = fe, a.TransformStream = tt, a.TransformStreamDefaultController = pe, a.WritableStream = de, a.WritableStreamDefaultController = ke, a.WritableStreamDefaultWriter = re;\n    });\n  })(kt, kt.exports)), kt.exports;\n}\nfunction Hs() {\n  if (mi) return pi;\n  mi = 1;\n  const i = 65536;\n  if (!globalThis.ReadableStream) try {\n    const o3 = require(\"process\"), { emitWarning: a } = o3;\n    try {\n      o3.emitWarning = () => {\n      }, Object.assign(globalThis, require(\"stream/web\")), o3.emitWarning = a;\n    } catch (f2) {\n      throw o3.emitWarning = a, f2;\n    }\n  } catch (e) {\n    Object.assign(globalThis, Ns());\n  }\n  try {\n    const { Blob: o3 } = require(\"buffer\");\n    o3 && !o3.prototype.stream && (o3.prototype.stream = n2(function(f2) {\n      let l = 0;\n      const p2 = this;\n      return new ReadableStream({ type: \"bytes\", pull(h2) {\n        return __async(this, null, function* () {\n          const v2 = yield p2.slice(l, Math.min(p2.size, l + i)).arrayBuffer();\n          l += v2.byteLength, h2.enqueue(new Uint8Array(v2)), l === p2.size && h2.close();\n        });\n      } });\n    }, \"name\"));\n  } catch (e) {\n  }\n  return pi;\n}\nfunction Wn(i, o3 = true) {\n  return __asyncGenerator(this, null, function* () {\n    for (const a of i) if (\"stream\" in a) yield* __yieldStar(a.stream());\n    else if (ArrayBuffer.isView(a)) if (o3) {\n      let f2 = a.byteOffset;\n      const l = a.byteOffset + a.byteLength;\n      for (; f2 !== l; ) {\n        const p2 = Math.min(l - f2, yi), h2 = a.buffer.slice(f2, f2 + p2);\n        f2 += h2.byteLength, yield new Uint8Array(h2);\n      }\n    } else yield a;\n    else {\n      let f2 = 0, l = a;\n      for (; f2 !== l.size; ) {\n        const h2 = yield new __await(l.slice(f2, Math.min(l.size, f2 + yi)).arrayBuffer());\n        f2 += h2.byteLength, yield new Uint8Array(h2);\n      }\n    }\n  });\n}\nfunction Zs(i, o3 = ut) {\n  var a = `${_i()}${_i()}`.replace(/\\./g, \"\").slice(-28).padStart(32, \"-\"), f2 = [], l = `--${a}\\r\nContent-Disposition: form-data; name=\"`;\n  return i.forEach((p2, h2) => typeof p2 == \"string\" ? f2.push(l + On(h2) + `\"\\r\n\\r\n${p2.replace(new RegExp(\"\\\\r(?!\\\\n)|(?<!\\\\r)\\\\n\", \"g\"), `\\r\n`)}\\r\n`) : f2.push(l + On(h2) + `\"; filename=\"${On(p2.name, 1)}\"\\r\nContent-Type: ${p2.type || \"application/octet-stream\"}\\r\n\\r\n`, p2, `\\r\n`)), f2.push(`--${a}--`), new o3(f2, { type: \"multipart/form-data; boundary=\" + a });\n}\nfunction zn(i) {\n  return __async(this, null, function* () {\n    if (i[H].disturbed) throw new TypeError(`body used already for: ${i.url}`);\n    if (i[H].disturbed = true, i[H].error) throw i[H].error;\n    const { body: o3 } = i;\n    if (o3 === null) return import_node_buffer.Buffer.alloc(0);\n    if (!(o3 instanceof import_node_stream3.default)) return import_node_buffer.Buffer.alloc(0);\n    const a = [];\n    let f2 = 0;\n    try {\n      try {\n        for (var iter = __forAwait(o3), more, temp, error; more = !(temp = yield iter.next()).done; more = false) {\n          const l = temp.value;\n          if (i.size > 0 && f2 + l.length > i.size) {\n            const p2 = new G(`content size at ${i.url} over limit: ${i.size}`, \"max-size\");\n            throw o3.destroy(p2), p2;\n          }\n          f2 += l.length, a.push(l);\n        }\n      } catch (temp) {\n        error = [temp];\n      } finally {\n        try {\n          more && (temp = iter.return) && (yield temp.call(iter));\n        } finally {\n          if (error)\n            throw error[0];\n        }\n      }\n    } catch (l) {\n      throw l instanceof ft ? l : new G(`Invalid response body while trying to fetch ${i.url}: ${l.message}`, \"system\", l);\n    }\n    if (o3.readableEnded === true || o3._readableState.ended === true) try {\n      return a.every((l) => typeof l == \"string\") ? import_node_buffer.Buffer.from(a.join(\"\")) : import_node_buffer.Buffer.concat(a, f2);\n    } catch (l) {\n      throw new G(`Could not create Buffer from response body for ${i.url}: ${l.message}`, \"system\", l);\n    }\n    else throw new G(`Premature close of server response while trying to fetch ${i.url}`);\n  });\n}\nfunction ol(i = []) {\n  return new ye(i.reduce((o3, a, f2, l) => (f2 % 2 === 0 && o3.push(l.slice(f2, f2 + 2)), o3), []).filter(([o3, a]) => {\n    try {\n      return gr(o3), Fn(o3, String(a)), true;\n    } catch (e) {\n      return false;\n    }\n  }));\n}\nfunction Ti(i, o3 = false) {\n  return i == null || (i = new URL(i), /^(about|blob|data):$/.test(i.protocol)) ? \"no-referrer\" : (i.username = \"\", i.password = \"\", i.hash = \"\", o3 && (i.pathname = \"\", i.search = \"\"), i);\n}\nfunction ll(i) {\n  if (!Ci.has(i)) throw new TypeError(`Invalid referrerPolicy: ${i}`);\n  return i;\n}\nfunction ul(i) {\n  if (/^(http|ws)s:$/.test(i.protocol)) return true;\n  const o3 = i.host.replace(/(^\\[)|(]$)/g, \"\"), a = (0, import_node_net.isIP)(o3);\n  return a === 4 && /^127\\./.test(o3) || a === 6 && /^(((0+:){7})|(::(0+:){0,6}))0*1$/.test(o3) ? true : i.host === \"localhost\" || i.host.endsWith(\".localhost\") ? false : i.protocol === \"file:\";\n}\nfunction ct(i) {\n  return /^about:(blank|srcdoc)$/.test(i) || i.protocol === \"data:\" || /^(blob|filesystem):$/.test(i.protocol) ? true : ul(i);\n}\nfunction fl(i, { referrerURLCallback: o3, referrerOriginCallback: a } = {}) {\n  if (i.referrer === \"no-referrer\" || i.referrerPolicy === \"\") return null;\n  const f2 = i.referrerPolicy;\n  if (i.referrer === \"about:client\") return \"no-referrer\";\n  const l = i.referrer;\n  let p2 = Ti(l), h2 = Ti(l, true);\n  p2.toString().length > 4096 && (p2 = h2), o3 && (p2 = o3(p2)), a && (h2 = a(h2));\n  const S = new URL(i.url);\n  switch (f2) {\n    case \"no-referrer\":\n      return \"no-referrer\";\n    case \"origin\":\n      return h2;\n    case \"unsafe-url\":\n      return p2;\n    case \"strict-origin\":\n      return ct(p2) && !ct(S) ? \"no-referrer\" : h2.toString();\n    case \"strict-origin-when-cross-origin\":\n      return p2.origin === S.origin ? p2 : ct(p2) && !ct(S) ? \"no-referrer\" : h2;\n    case \"same-origin\":\n      return p2.origin === S.origin ? p2 : \"no-referrer\";\n    case \"origin-when-cross-origin\":\n      return p2.origin === S.origin ? p2 : h2;\n    case \"no-referrer-when-downgrade\":\n      return ct(p2) && !ct(S) ? \"no-referrer\" : p2;\n    default:\n      throw new TypeError(`Invalid referrerPolicy: ${f2}`);\n  }\n}\nfunction cl(i) {\n  const o3 = (i.get(\"referrer-policy\") || \"\").split(/[,\\s]+/);\n  let a = \"\";\n  for (const f2 of o3) f2 && Ci.has(f2) && (a = f2);\n  return a;\n}\nfunction pl() {\n  if (Pi) return Ln;\n  if (Pi = 1, !globalThis.DOMException) try {\n    const { MessageChannel: i } = require(\"worker_threads\"), o3 = new i().port1, a = new ArrayBuffer();\n    o3.postMessage(a, [a, a]);\n  } catch (i) {\n    i.constructor.name === \"DOMException\" && (globalThis.DOMException = i.constructor);\n  }\n  return Ln = globalThis.DOMException, Ln;\n}\nfunction Ai(i, o3) {\n  return __async(this, null, function* () {\n    return new Promise((a, f2) => {\n      const l = new dt(i, o3), { parsedURL: p2, options: h2 } = hl(l);\n      if (!wl.has(p2.protocol)) throw new TypeError(`node-fetch cannot load ${i}. URL scheme \"${p2.protocol.replace(/:$/, \"\")}\" is not supported.`);\n      if (p2.protocol === \"data:\") {\n        const g2 = Us(l.url), V = new le(g2, { headers: { \"Content-Type\": g2.typeFull } });\n        a(V);\n        return;\n      }\n      const S = (p2.protocol === \"https:\" ? import_node_https.default : import_node_http.default).request, { signal: v2 } = l;\n      let w2 = null;\n      const A = n2(() => {\n        const g2 = new _r(\"The operation was aborted.\");\n        f2(g2), l.body && l.body instanceof import_node_stream3.default.Readable && l.body.destroy(g2), !(!w2 || !w2.body) && w2.body.emit(\"error\", g2);\n      }, \"abort\");\n      if (v2 && v2.aborted) {\n        A();\n        return;\n      }\n      const T2 = n2(() => {\n        A(), q();\n      }, \"abortAndFinalize\"), b = S(p2.toString(), h2);\n      v2 && v2.addEventListener(\"abort\", T2);\n      const q = n2(() => {\n        b.abort(), v2 && v2.removeEventListener(\"abort\", T2);\n      }, \"finalize\");\n      b.on(\"error\", (g2) => {\n        f2(new G(`request to ${l.url} failed, reason: ${g2.message}`, \"system\", g2)), q();\n      }), Rl(b, (g2) => {\n        w2 && w2.body && w2.body.destroy(g2);\n      }), process.version < \"v14\" && b.on(\"socket\", (g2) => {\n        let V;\n        g2.prependListener(\"end\", () => {\n          V = g2._eventsCount;\n        }), g2.prependListener(\"close\", (I2) => {\n          if (w2 && V < g2._eventsCount && !I2) {\n            const F4 = new Error(\"Premature close\");\n            F4.code = \"ERR_STREAM_PREMATURE_CLOSE\", w2.body.emit(\"error\", F4);\n          }\n        });\n      }), b.on(\"response\", (g2) => {\n        b.setTimeout(0);\n        const V = ol(g2.rawHeaders);\n        if (jn(g2.statusCode)) {\n          const z = V.get(\"Location\");\n          let j = null;\n          try {\n            j = z === null ? null : new URL(z, l.url);\n          } catch (e) {\n            if (l.redirect !== \"manual\") {\n              f2(new G(`uri requested responds with an invalid redirect URL: ${z}`, \"invalid-redirect\")), q();\n              return;\n            }\n          }\n          switch (l.redirect) {\n            case \"error\":\n              f2(new G(`uri requested responds with a redirect, redirect mode is set to error: ${l.url}`, \"no-redirect\")), q();\n              return;\n            case \"manual\":\n              break;\n            case \"follow\": {\n              if (j === null) break;\n              if (l.counter >= l.follow) {\n                f2(new G(`maximum redirect reached at: ${l.url}`, \"max-redirect\")), q();\n                return;\n              }\n              const U = { headers: new ye(l.headers), follow: l.follow, counter: l.counter + 1, agent: l.agent, compress: l.compress, method: l.method, body: In(l), signal: l.signal, size: l.size, referrer: l.referrer, referrerPolicy: l.referrerPolicy };\n              if (!Js(l.url, j) || !Xs(l.url, j)) for (const jt of [\"authorization\", \"www-authenticate\", \"cookie\", \"cookie2\"]) U.headers.delete(jt);\n              if (g2.statusCode !== 303 && l.body && o3.body instanceof import_node_stream3.default.Readable) {\n                f2(new G(\"Cannot follow redirect with body being a readable stream\", \"unsupported-redirect\")), q();\n                return;\n              }\n              (g2.statusCode === 303 || (g2.statusCode === 301 || g2.statusCode === 302) && l.method === \"POST\") && (U.method = \"GET\", U.body = void 0, U.headers.delete(\"content-length\"));\n              const D2 = cl(V);\n              D2 && (U.referrerPolicy = D2), a(Ai(new dt(j, U))), q();\n              return;\n            }\n            default:\n              return f2(new TypeError(`Redirect option '${l.redirect}' is not a valid value of RequestRedirect`));\n          }\n        }\n        v2 && g2.once(\"end\", () => {\n          v2.removeEventListener(\"abort\", T2);\n        });\n        let I2 = (0, import_node_stream3.pipeline)(g2, new import_node_stream3.PassThrough(), (z) => {\n          z && f2(z);\n        });\n        process.version < \"v12.10\" && g2.on(\"aborted\", T2);\n        const F4 = { url: l.url, status: g2.statusCode, statusText: g2.statusMessage, headers: V, size: l.size, counter: l.counter, highWaterMark: l.highWaterMark }, Q = V.get(\"Content-Encoding\");\n        if (!l.compress || l.method === \"HEAD\" || Q === null || g2.statusCode === 204 || g2.statusCode === 304) {\n          w2 = new le(I2, F4), a(w2);\n          return;\n        }\n        const ge = { flush: import_node_zlib.default.Z_SYNC_FLUSH, finishFlush: import_node_zlib.default.Z_SYNC_FLUSH };\n        if (Q === \"gzip\" || Q === \"x-gzip\") {\n          I2 = (0, import_node_stream3.pipeline)(I2, import_node_zlib.default.createGunzip(ge), (z) => {\n            z && f2(z);\n          }), w2 = new le(I2, F4), a(w2);\n          return;\n        }\n        if (Q === \"deflate\" || Q === \"x-deflate\") {\n          const z = (0, import_node_stream3.pipeline)(g2, new import_node_stream3.PassThrough(), (j) => {\n            j && f2(j);\n          });\n          z.once(\"data\", (j) => {\n            (j[0] & 15) === 8 ? I2 = (0, import_node_stream3.pipeline)(I2, import_node_zlib.default.createInflate(), (U) => {\n              U && f2(U);\n            }) : I2 = (0, import_node_stream3.pipeline)(I2, import_node_zlib.default.createInflateRaw(), (U) => {\n              U && f2(U);\n            }), w2 = new le(I2, F4), a(w2);\n          }), z.once(\"end\", () => {\n            w2 || (w2 = new le(I2, F4), a(w2));\n          });\n          return;\n        }\n        if (Q === \"br\") {\n          I2 = (0, import_node_stream3.pipeline)(I2, import_node_zlib.default.createBrotliDecompress(), (z) => {\n            z && f2(z);\n          }), w2 = new le(I2, F4), a(w2);\n          return;\n        }\n        w2 = new le(I2, F4), a(w2);\n      }), nl(b, l).catch(f2);\n    });\n  });\n}\nfunction Rl(i, o3) {\n  const a = import_node_buffer.Buffer.from(`0\\r\n\\r\n`);\n  let f2 = false, l = false, p2;\n  i.on(\"response\", (h2) => {\n    const { headers: S } = h2;\n    f2 = S[\"transfer-encoding\"] === \"chunked\" && !S[\"content-length\"];\n  }), i.on(\"socket\", (h2) => {\n    const S = n2(() => {\n      if (f2 && !l) {\n        const w2 = new Error(\"Premature close\");\n        w2.code = \"ERR_STREAM_PREMATURE_CLOSE\", o3(w2);\n      }\n    }, \"onSocketClose\"), v2 = n2((w2) => {\n      l = import_node_buffer.Buffer.compare(w2.slice(-5), a) === 0, !l && p2 && (l = import_node_buffer.Buffer.compare(p2.slice(-3), a.slice(0, 3)) === 0 && import_node_buffer.Buffer.compare(w2.slice(-2), a.slice(3)) === 0), p2 = w2;\n    }, \"onData\");\n    h2.prependListener(\"close\", S), h2.on(\"data\", v2), i.on(\"close\", () => {\n      h2.removeListener(\"close\", S), h2.removeListener(\"data\", v2);\n    });\n  });\n}\nfunction W(i) {\n  const o3 = Bi.get(i);\n  return console.assert(o3 != null, \"'this' is expected an Event object, but got\", i), o3;\n}\nfunction ki(i) {\n  if (i.passiveListener != null) {\n    typeof console < \"u\" && typeof console.error == \"function\" && console.error(\"Unable to preventDefault inside passive event listener invocation.\", i.passiveListener);\n    return;\n  }\n  i.event.cancelable && (i.canceled = true, typeof i.event.preventDefault == \"function\" && i.event.preventDefault());\n}\nfunction ht(i, o3) {\n  Bi.set(this, { eventTarget: i, event: o3, eventPhase: 2, currentTarget: i, canceled: false, stopped: false, immediateStopped: false, passiveListener: null, timeStamp: o3.timeStamp || Date.now() }), Object.defineProperty(this, \"isTrusted\", { value: false, enumerable: true });\n  const a = Object.keys(o3);\n  for (let f2 = 0; f2 < a.length; ++f2) {\n    const l = a[f2];\n    l in this || Object.defineProperty(this, l, Wi(l));\n  }\n}\nfunction Wi(i) {\n  return { get() {\n    return W(this).event[i];\n  }, set(o3) {\n    W(this).event[i] = o3;\n  }, configurable: true, enumerable: true };\n}\nfunction Tl(i) {\n  return { value() {\n    const o3 = W(this).event;\n    return o3[i].apply(o3, arguments);\n  }, configurable: true, enumerable: true };\n}\nfunction Cl(i, o3) {\n  const a = Object.keys(o3);\n  if (a.length === 0) return i;\n  function f2(l, p2) {\n    i.call(this, l, p2);\n  }\n  n2(f2, \"CustomEvent\"), f2.prototype = Object.create(i.prototype, { constructor: { value: f2, configurable: true, writable: true } });\n  for (let l = 0; l < a.length; ++l) {\n    const p2 = a[l];\n    if (!(p2 in i.prototype)) {\n      const S = typeof Object.getOwnPropertyDescriptor(o3, p2).value == \"function\";\n      Object.defineProperty(f2.prototype, p2, S ? Tl(p2) : Wi(p2));\n    }\n  }\n  return f2;\n}\nfunction qi(i) {\n  if (i == null || i === Object.prototype) return ht;\n  let o3 = Dn.get(i);\n  return o3 == null && (o3 = Cl(qi(Object.getPrototypeOf(i)), i), Dn.set(i, o3)), o3;\n}\nfunction Pl(i, o3) {\n  const a = qi(Object.getPrototypeOf(o3));\n  return new a(i, o3);\n}\nfunction vl(i) {\n  return W(i).immediateStopped;\n}\nfunction El(i, o3) {\n  W(i).eventPhase = o3;\n}\nfunction Al(i, o3) {\n  W(i).currentTarget = o3;\n}\nfunction Oi(i, o3) {\n  W(i).passiveListener = o3;\n}\nfunction Rr(i) {\n  return i !== null && typeof i == \"object\";\n}\nfunction Ot(i) {\n  const o3 = zi.get(i);\n  if (o3 == null) throw new TypeError(\"'this' is expected an EventTarget object, but got another value.\");\n  return o3;\n}\nfunction Bl(i) {\n  return { get() {\n    let a = Ot(this).get(i);\n    for (; a != null; ) {\n      if (a.listenerType === wr) return a.listener;\n      a = a.next;\n    }\n    return null;\n  }, set(o3) {\n    typeof o3 != \"function\" && !Rr(o3) && (o3 = null);\n    const a = Ot(this);\n    let f2 = null, l = a.get(i);\n    for (; l != null; ) l.listenerType === wr ? f2 !== null ? f2.next = l.next : l.next !== null ? a.set(i, l.next) : a.delete(i) : f2 = l, l = l.next;\n    if (o3 !== null) {\n      const p2 = { listener: o3, listenerType: wr, passive: false, once: false, next: null };\n      f2 === null ? a.set(i, p2) : f2.next = p2;\n    }\n  }, configurable: true, enumerable: true };\n}\nfunction ji(i, o3) {\n  Object.defineProperty(i, `on${o3}`, Bl(o3));\n}\nfunction Li(i) {\n  function o3() {\n    Pe.call(this);\n  }\n  n2(o3, \"CustomEventTarget\"), o3.prototype = Object.create(Pe.prototype, { constructor: { value: o3, configurable: true, writable: true } });\n  for (let a = 0; a < i.length; ++a) ji(o3.prototype, i[a]);\n  return o3;\n}\nfunction Pe() {\n  if (this instanceof Pe) {\n    zi.set(this, /* @__PURE__ */ new Map());\n    return;\n  }\n  if (arguments.length === 1 && Array.isArray(arguments[0])) return Li(arguments[0]);\n  if (arguments.length > 0) {\n    const i = new Array(arguments.length);\n    for (let o3 = 0; o3 < arguments.length; ++o3) i[o3] = arguments[o3];\n    return Li(i);\n  }\n  throw new TypeError(\"Cannot call a class as a function\");\n}\nfunction kl() {\n  const i = Object.create(pt.prototype);\n  return Pe.call(i), Tr.set(i, false), i;\n}\nfunction Wl(i) {\n  Tr.get(i) === false && (Tr.set(i, true), i.dispatchEvent({ type: \"abort\" }));\n}\nfunction Di(i) {\n  const o3 = $i.get(i);\n  if (o3 == null) throw new TypeError(`Expected 'this' to be an 'AbortController' object, but got ${i === null ? \"null\" : typeof i}`);\n  return o3;\n}\nfunction Ui() {\n  var _a2, _b2, _c, _d;\n  !((_b2 = (_a2 = globalThis.process) == null ? void 0 : _a2.versions) == null ? void 0 : _b2.node) && !((_d = (_c = globalThis.process) == null ? void 0 : _c.env) == null ? void 0 : _d.DISABLE_NODE_FETCH_NATIVE_WARN || true) && console.warn(\"[node-fetch-native] Node.js compatible build of `node-fetch-native` is being used in a non-Node.js environment. Please make sure you are using proper export conditions or report this issue to https://github.com/unjs/node-fetch-native. You can set `process.env.DISABLE_NODE_FETCH_NATIVE_WARN` to disable this warning.\");\n}\nvar import_node_http, import_node_https, import_node_zlib, import_node_stream3, import_node_buffer, import_node_util3, import_node_url2, import_node_net, import_node_fs4, import_node_path5, Os, fi, n2, ci, O, be, X, ve, zt, bt, Cr, ze, It, Ft, mt, ee, yt, He, Ve, gt, pi, kt, xs, bi, mi, yi, gi, ut, Vs, qn, Wt, Qs, Ys, _i, Gs, Si, On, Ue, br, Un, ft, xn, G, mr, wi, yr, Ks, Js, Xs, el, H, Nn, xe, In, tl, Ri, rl, nl, gr, Fn, Pr, ye, il, jn, se, Ne, le, al, Ci, sl, $2, qt, dl, vr, dt, hl, Hn, _r, Ln, Pi, bl, ml, $n, yl, gl, _l, Sl, vi, Ei, Er, Sr, wl, Bi, Dn, zi, Ii, Fi, wr, Vn, pt, Tr, Mn, $i, ql, Ol, Mi;\nvar init_node = __esm({\n  \"node_modules/node-fetch-native/dist/node.mjs\"() {\n    \"use strict\";\n    import_node_http = __toESM(require(\"http\"), 1);\n    import_node_https = __toESM(require(\"https\"), 1);\n    import_node_zlib = __toESM(require(\"zlib\"), 1);\n    import_node_stream3 = __toESM(require(\"stream\"), 1);\n    import_node_buffer = require(\"buffer\");\n    import_node_util3 = require(\"util\");\n    init_node_fetch_native_DfbY2q_x();\n    import_node_url2 = require(\"url\");\n    import_node_net = require(\"net\");\n    import_node_fs4 = require(\"fs\");\n    import_node_path5 = require(\"path\");\n    Os = Object.defineProperty;\n    fi = (i) => {\n      throw TypeError(i);\n    };\n    n2 = (i, o3) => Os(i, \"name\", { value: o3, configurable: true });\n    ci = (i, o3, a) => o3.has(i) || fi(\"Cannot \" + a);\n    O = (i, o3, a) => (ci(i, o3, \"read from private field\"), a ? a.call(i) : o3.get(i));\n    be = (i, o3, a) => o3.has(i) ? fi(\"Cannot add the same private member more than once\") : o3 instanceof WeakSet ? o3.add(i) : o3.set(i, a);\n    X = (i, o3, a, f2) => (ci(i, o3, \"write to private field\"), f2 ? f2.call(i, a) : o3.set(i, a), a);\n    n2(Us, \"dataUriToBuffer\");\n    pi = {};\n    kt = { exports: {} };\n    xs = kt.exports;\n    n2(Ns, \"requirePonyfill_es2018\");\n    n2(Hs, \"requireStreams\"), Hs();\n    yi = 65536;\n    n2(Wn, \"toIterator\");\n    gi = (ze = class {\n      constructor(o3 = [], a = {}) {\n        be(this, ve, []);\n        be(this, zt, \"\");\n        be(this, bt, 0);\n        be(this, Cr, \"transparent\");\n        if (typeof o3 != \"object\" || o3 === null) throw new TypeError(\"Failed to construct 'Blob': The provided value cannot be converted to a sequence.\");\n        if (typeof o3[Symbol.iterator] != \"function\") throw new TypeError(\"Failed to construct 'Blob': The object must have a callable @@iterator property.\");\n        if (typeof a != \"object\" && typeof a != \"function\") throw new TypeError(\"Failed to construct 'Blob': parameter 2 cannot convert to dictionary.\");\n        a === null && (a = {});\n        const f2 = new TextEncoder();\n        for (const p2 of o3) {\n          let h2;\n          ArrayBuffer.isView(p2) ? h2 = new Uint8Array(p2.buffer.slice(p2.byteOffset, p2.byteOffset + p2.byteLength)) : p2 instanceof ArrayBuffer ? h2 = new Uint8Array(p2.slice(0)) : p2 instanceof ze ? h2 = p2 : h2 = f2.encode(`${p2}`), X(this, bt, O(this, bt) + (ArrayBuffer.isView(h2) ? h2.byteLength : h2.size)), O(this, ve).push(h2);\n        }\n        X(this, Cr, `${a.endings === void 0 ? \"transparent\" : a.endings}`);\n        const l = a.type === void 0 ? \"\" : String(a.type);\n        X(this, zt, /^[\\x20-\\x7E]*$/.test(l) ? l : \"\");\n      }\n      get size() {\n        return O(this, bt);\n      }\n      get type() {\n        return O(this, zt);\n      }\n      text() {\n        return __async(this, null, function* () {\n          const o3 = new TextDecoder();\n          let a = \"\";\n          try {\n            for (var iter = __forAwait(Wn(O(this, ve), false)), more, temp, error; more = !(temp = yield iter.next()).done; more = false) {\n              const f2 = temp.value;\n              a += o3.decode(f2, { stream: true });\n            }\n          } catch (temp) {\n            error = [temp];\n          } finally {\n            try {\n              more && (temp = iter.return) && (yield temp.call(iter));\n            } finally {\n              if (error)\n                throw error[0];\n            }\n          }\n          return a += o3.decode(), a;\n        });\n      }\n      arrayBuffer() {\n        return __async(this, null, function* () {\n          const o3 = new Uint8Array(this.size);\n          let a = 0;\n          try {\n            for (var iter = __forAwait(Wn(O(this, ve), false)), more, temp, error; more = !(temp = yield iter.next()).done; more = false) {\n              const f2 = temp.value;\n              o3.set(f2, a), a += f2.length;\n            }\n          } catch (temp) {\n            error = [temp];\n          } finally {\n            try {\n              more && (temp = iter.return) && (yield temp.call(iter));\n            } finally {\n              if (error)\n                throw error[0];\n            }\n          }\n          return o3.buffer;\n        });\n      }\n      stream() {\n        const o3 = Wn(O(this, ve), true);\n        return new globalThis.ReadableStream({ type: \"bytes\", pull(a) {\n          return __async(this, null, function* () {\n            const f2 = yield o3.next();\n            f2.done ? a.close() : a.enqueue(f2.value);\n          });\n        }, cancel() {\n          return __async(this, null, function* () {\n            yield o3.return();\n          });\n        } });\n      }\n      slice(o3 = 0, a = this.size, f2 = \"\") {\n        const { size: l } = this;\n        let p2 = o3 < 0 ? Math.max(l + o3, 0) : Math.min(o3, l), h2 = a < 0 ? Math.max(l + a, 0) : Math.min(a, l);\n        const S = Math.max(h2 - p2, 0), v2 = O(this, ve), w2 = [];\n        let A = 0;\n        for (const b of v2) {\n          if (A >= S) break;\n          const q = ArrayBuffer.isView(b) ? b.byteLength : b.size;\n          if (p2 && q <= p2) p2 -= q, h2 -= q;\n          else {\n            let g2;\n            ArrayBuffer.isView(b) ? (g2 = b.subarray(p2, Math.min(q, h2)), A += g2.byteLength) : (g2 = b.slice(p2, Math.min(q, h2)), A += g2.size), h2 -= q, w2.push(g2), p2 = 0;\n          }\n        }\n        const T2 = new ze([], { type: String(f2).toLowerCase() });\n        return X(T2, bt, S), X(T2, ve, w2), T2;\n      }\n      get [Symbol.toStringTag]() {\n        return \"Blob\";\n      }\n      static [Symbol.hasInstance](o3) {\n        return o3 && typeof o3 == \"object\" && typeof o3.constructor == \"function\" && (typeof o3.stream == \"function\" || typeof o3.arrayBuffer == \"function\") && /^(Blob|File)$/.test(o3[Symbol.toStringTag]);\n      }\n    }, ve = /* @__PURE__ */ new WeakMap(), zt = /* @__PURE__ */ new WeakMap(), bt = /* @__PURE__ */ new WeakMap(), Cr = /* @__PURE__ */ new WeakMap(), n2(ze, \"Blob\"), ze);\n    Object.defineProperties(gi.prototype, { size: { enumerable: true }, type: { enumerable: true }, slice: { enumerable: true } });\n    ut = gi;\n    Vs = (mt = class extends ut {\n      constructor(a, f2, l = {}) {\n        if (arguments.length < 2) throw new TypeError(`Failed to construct 'File': 2 arguments required, but only ${arguments.length} present.`);\n        super(a, l);\n        be(this, It, 0);\n        be(this, Ft, \"\");\n        l === null && (l = {});\n        const p2 = l.lastModified === void 0 ? Date.now() : Number(l.lastModified);\n        Number.isNaN(p2) || X(this, It, p2), X(this, Ft, String(f2));\n      }\n      get name() {\n        return O(this, Ft);\n      }\n      get lastModified() {\n        return O(this, It);\n      }\n      get [Symbol.toStringTag]() {\n        return \"File\";\n      }\n      static [Symbol.hasInstance](a) {\n        return !!a && a instanceof ut && /^(File)$/.test(a[Symbol.toStringTag]);\n      }\n    }, It = /* @__PURE__ */ new WeakMap(), Ft = /* @__PURE__ */ new WeakMap(), n2(mt, \"File\"), mt);\n    qn = Vs;\n    ({ toStringTag: Wt, iterator: Qs, hasInstance: Ys } = Symbol);\n    _i = Math.random;\n    Gs = \"append,set,get,getAll,delete,keys,values,entries,forEach,constructor\".split(\",\");\n    Si = n2((i, o3, a) => (i += \"\", /^(Blob|File)$/.test(o3 && o3[Wt]) ? [(a = a !== void 0 ? a + \"\" : o3[Wt] == \"File\" ? o3.name : \"blob\", i), o3.name !== a || o3[Wt] == \"blob\" ? new qn([o3], a, o3) : o3] : [i, o3 + \"\"]), \"f\");\n    On = n2((i, o3) => (o3 ? i : i.replace(/\\r?\\n|\\r/g, `\\r\n`)).replace(/\\n/g, \"%0A\").replace(/\\r/g, \"%0D\").replace(/\"/g, \"%22\"), \"e$1\");\n    Ue = n2((i, o3, a) => {\n      if (o3.length < a) throw new TypeError(`Failed to execute '${i}' on 'FormData': ${a} arguments required, but only ${o3.length} present.`);\n    }, \"x\");\n    br = (yt = class {\n      constructor(...o3) {\n        be(this, ee, []);\n        if (o3.length) throw new TypeError(\"Failed to construct 'FormData': parameter 1 is not of type 'HTMLFormElement'.\");\n      }\n      get [Wt]() {\n        return \"FormData\";\n      }\n      [Qs]() {\n        return this.entries();\n      }\n      static [Ys](o3) {\n        return o3 && typeof o3 == \"object\" && o3[Wt] === \"FormData\" && !Gs.some((a) => typeof o3[a] != \"function\");\n      }\n      append(...o3) {\n        Ue(\"append\", arguments, 2), O(this, ee).push(Si(...o3));\n      }\n      delete(o3) {\n        Ue(\"delete\", arguments, 1), o3 += \"\", X(this, ee, O(this, ee).filter(([a]) => a !== o3));\n      }\n      get(o3) {\n        Ue(\"get\", arguments, 1), o3 += \"\";\n        for (var a = O(this, ee), f2 = a.length, l = 0; l < f2; l++) if (a[l][0] === o3) return a[l][1];\n        return null;\n      }\n      getAll(o3, a) {\n        return Ue(\"getAll\", arguments, 1), a = [], o3 += \"\", O(this, ee).forEach((f2) => f2[0] === o3 && a.push(f2[1])), a;\n      }\n      has(o3) {\n        return Ue(\"has\", arguments, 1), o3 += \"\", O(this, ee).some((a) => a[0] === o3);\n      }\n      forEach(o3, a) {\n        Ue(\"forEach\", arguments, 1);\n        for (var [f2, l] of this) o3.call(a, l, f2, this);\n      }\n      set(...o3) {\n        Ue(\"set\", arguments, 2);\n        var a = [], f2 = true;\n        o3 = Si(...o3), O(this, ee).forEach((l) => {\n          l[0] === o3[0] ? f2 && (f2 = !a.push(o3)) : a.push(l);\n        }), f2 && a.push(o3), X(this, ee, a);\n      }\n      *entries() {\n        yield* __yieldStar(O(this, ee));\n      }\n      *keys() {\n        for (var [o3] of this) yield o3;\n      }\n      *values() {\n        for (var [, o3] of this) yield o3;\n      }\n    }, ee = /* @__PURE__ */ new WeakMap(), n2(yt, \"FormData\"), yt);\n    n2(Zs, \"formDataToBlob\");\n    Un = class Un2 extends Error {\n      constructor(o3, a) {\n        super(o3), Error.captureStackTrace(this, this.constructor), this.type = a;\n      }\n      get name() {\n        return this.constructor.name;\n      }\n      get [Symbol.toStringTag]() {\n        return this.constructor.name;\n      }\n    };\n    n2(Un, \"FetchBaseError\");\n    ft = Un;\n    xn = class xn2 extends ft {\n      constructor(o3, a, f2) {\n        super(o3, a), f2 && (this.code = this.errno = f2.code, this.erroredSysCall = f2.syscall);\n      }\n    };\n    n2(xn, \"FetchError\");\n    G = xn;\n    mr = Symbol.toStringTag;\n    wi = n2((i) => typeof i == \"object\" && typeof i.append == \"function\" && typeof i.delete == \"function\" && typeof i.get == \"function\" && typeof i.getAll == \"function\" && typeof i.has == \"function\" && typeof i.set == \"function\" && typeof i.sort == \"function\" && i[mr] === \"URLSearchParams\", \"isURLSearchParameters\");\n    yr = n2((i) => i && typeof i == \"object\" && typeof i.arrayBuffer == \"function\" && typeof i.type == \"string\" && typeof i.stream == \"function\" && typeof i.constructor == \"function\" && /^(Blob|File)$/.test(i[mr]), \"isBlob\");\n    Ks = n2((i) => typeof i == \"object\" && (i[mr] === \"AbortSignal\" || i[mr] === \"EventTarget\"), \"isAbortSignal\");\n    Js = n2((i, o3) => {\n      const a = new URL(o3).hostname, f2 = new URL(i).hostname;\n      return a === f2 || a.endsWith(`.${f2}`);\n    }, \"isDomainOrSubdomain\");\n    Xs = n2((i, o3) => {\n      const a = new URL(o3).protocol, f2 = new URL(i).protocol;\n      return a === f2;\n    }, \"isSameProtocol\");\n    el = (0, import_node_util3.promisify)(import_node_stream3.default.pipeline);\n    H = /* @__PURE__ */ Symbol(\"Body internals\");\n    Nn = class Nn2 {\n      constructor(o3, { size: a = 0 } = {}) {\n        let f2 = null;\n        o3 === null ? o3 = null : wi(o3) ? o3 = import_node_buffer.Buffer.from(o3.toString()) : yr(o3) || import_node_buffer.Buffer.isBuffer(o3) || (import_node_util3.types.isAnyArrayBuffer(o3) ? o3 = import_node_buffer.Buffer.from(o3) : ArrayBuffer.isView(o3) ? o3 = import_node_buffer.Buffer.from(o3.buffer, o3.byteOffset, o3.byteLength) : o3 instanceof import_node_stream3.default || (o3 instanceof br ? (o3 = Zs(o3), f2 = o3.type.split(\"=\")[1]) : o3 = import_node_buffer.Buffer.from(String(o3))));\n        let l = o3;\n        import_node_buffer.Buffer.isBuffer(o3) ? l = import_node_stream3.default.Readable.from(o3) : yr(o3) && (l = import_node_stream3.default.Readable.from(o3.stream())), this[H] = { body: o3, stream: l, boundary: f2, disturbed: false, error: null }, this.size = a, o3 instanceof import_node_stream3.default && o3.on(\"error\", (p2) => {\n          const h2 = p2 instanceof ft ? p2 : new G(`Invalid response body while trying to fetch ${this.url}: ${p2.message}`, \"system\", p2);\n          this[H].error = h2;\n        });\n      }\n      get body() {\n        return this[H].stream;\n      }\n      get bodyUsed() {\n        return this[H].disturbed;\n      }\n      arrayBuffer() {\n        return __async(this, null, function* () {\n          const { buffer: o3, byteOffset: a, byteLength: f2 } = yield zn(this);\n          return o3.slice(a, a + f2);\n        });\n      }\n      formData() {\n        return __async(this, null, function* () {\n          const o3 = this.headers.get(\"content-type\");\n          if (o3.startsWith(\"application/x-www-form-urlencoded\")) {\n            const f2 = new br(), l = new URLSearchParams(yield this.text());\n            for (const [p2, h2] of l) f2.append(p2, h2);\n            return f2;\n          }\n          const { toFormData: a } = yield Promise.resolve().then(() => (init_multipart_parser(), multipart_parser_exports));\n          return a(this.body, o3);\n        });\n      }\n      blob() {\n        return __async(this, null, function* () {\n          const o3 = this.headers && this.headers.get(\"content-type\") || this[H].body && this[H].body.type || \"\", a = yield this.arrayBuffer();\n          return new ut([a], { type: o3 });\n        });\n      }\n      json() {\n        return __async(this, null, function* () {\n          const o3 = yield this.text();\n          return JSON.parse(o3);\n        });\n      }\n      text() {\n        return __async(this, null, function* () {\n          const o3 = yield zn(this);\n          return new TextDecoder().decode(o3);\n        });\n      }\n      buffer() {\n        return zn(this);\n      }\n    };\n    n2(Nn, \"Body\");\n    xe = Nn;\n    xe.prototype.buffer = (0, import_node_util3.deprecate)(xe.prototype.buffer, \"Please use 'response.arrayBuffer()' instead of 'response.buffer()'\", \"node-fetch#buffer\"), Object.defineProperties(xe.prototype, { body: { enumerable: true }, bodyUsed: { enumerable: true }, arrayBuffer: { enumerable: true }, blob: { enumerable: true }, json: { enumerable: true }, text: { enumerable: true }, data: { get: (0, import_node_util3.deprecate)(() => {\n    }, \"data doesn't exist, use json(), text(), arrayBuffer(), or body instead\", \"https://github.com/node-fetch/node-fetch/issues/1000 (response)\") } });\n    n2(zn, \"consumeBody\");\n    In = n2((i, o3) => {\n      let a, f2, { body: l } = i[H];\n      if (i.bodyUsed) throw new Error(\"cannot clone body after it is used\");\n      return l instanceof import_node_stream3.default && typeof l.getBoundary != \"function\" && (a = new import_node_stream3.PassThrough({ highWaterMark: o3 }), f2 = new import_node_stream3.PassThrough({ highWaterMark: o3 }), l.pipe(a), l.pipe(f2), i[H].stream = a, l = f2), l;\n    }, \"clone\");\n    tl = (0, import_node_util3.deprecate)((i) => i.getBoundary(), \"form-data doesn't follow the spec and requires special treatment. Use alternative package\", \"https://github.com/node-fetch/node-fetch/issues/1167\");\n    Ri = n2((i, o3) => i === null ? null : typeof i == \"string\" ? \"text/plain;charset=UTF-8\" : wi(i) ? \"application/x-www-form-urlencoded;charset=UTF-8\" : yr(i) ? i.type || null : import_node_buffer.Buffer.isBuffer(i) || import_node_util3.types.isAnyArrayBuffer(i) || ArrayBuffer.isView(i) ? null : i instanceof br ? `multipart/form-data; boundary=${o3[H].boundary}` : i && typeof i.getBoundary == \"function\" ? `multipart/form-data;boundary=${tl(i)}` : i instanceof import_node_stream3.default ? null : \"text/plain;charset=UTF-8\", \"extractContentType\");\n    rl = n2((i) => {\n      const { body: o3 } = i[H];\n      return o3 === null ? 0 : yr(o3) ? o3.size : import_node_buffer.Buffer.isBuffer(o3) ? o3.length : o3 && typeof o3.getLengthSync == \"function\" && o3.hasKnownLength && o3.hasKnownLength() ? o3.getLengthSync() : null;\n    }, \"getTotalBytes\");\n    nl = n2((_0, _1) => __async(null, [_0, _1], function* (i, { body: o3 }) {\n      o3 === null ? i.end() : yield el(o3, i);\n    }), \"writeToStream\");\n    gr = typeof import_node_http.default.validateHeaderName == \"function\" ? import_node_http.default.validateHeaderName : (i) => {\n      if (!/^[\\^`\\-\\w!#$%&'*+.|~]+$/.test(i)) {\n        const o3 = new TypeError(`Header name must be a valid HTTP token [${i}]`);\n        throw Object.defineProperty(o3, \"code\", { value: \"ERR_INVALID_HTTP_TOKEN\" }), o3;\n      }\n    };\n    Fn = typeof import_node_http.default.validateHeaderValue == \"function\" ? import_node_http.default.validateHeaderValue : (i, o3) => {\n      if (/[^\\t\\u0020-\\u007E\\u0080-\\u00FF]/.test(o3)) {\n        const a = new TypeError(`Invalid character in header content [\"${i}\"]`);\n        throw Object.defineProperty(a, \"code\", { value: \"ERR_INVALID_CHAR\" }), a;\n      }\n    };\n    Pr = class Pr2 extends URLSearchParams {\n      constructor(o3) {\n        let a = [];\n        if (o3 instanceof Pr2) {\n          const f2 = o3.raw();\n          for (const [l, p2] of Object.entries(f2)) a.push(...p2.map((h2) => [l, h2]));\n        } else if (o3 != null) if (typeof o3 == \"object\" && !import_node_util3.types.isBoxedPrimitive(o3)) {\n          const f2 = o3[Symbol.iterator];\n          if (f2 == null) a.push(...Object.entries(o3));\n          else {\n            if (typeof f2 != \"function\") throw new TypeError(\"Header pairs must be iterable\");\n            a = [...o3].map((l) => {\n              if (typeof l != \"object\" || import_node_util3.types.isBoxedPrimitive(l)) throw new TypeError(\"Each header pair must be an iterable object\");\n              return [...l];\n            }).map((l) => {\n              if (l.length !== 2) throw new TypeError(\"Each header pair must be a name/value tuple\");\n              return [...l];\n            });\n          }\n        } else throw new TypeError(\"Failed to construct 'Headers': The provided value is not of type '(sequence<sequence<ByteString>> or record<ByteString, ByteString>)\");\n        return a = a.length > 0 ? a.map(([f2, l]) => (gr(f2), Fn(f2, String(l)), [String(f2).toLowerCase(), String(l)])) : void 0, super(a), new Proxy(this, { get(f2, l, p2) {\n          switch (l) {\n            case \"append\":\n            case \"set\":\n              return (h2, S) => (gr(h2), Fn(h2, String(S)), URLSearchParams.prototype[l].call(f2, String(h2).toLowerCase(), String(S)));\n            case \"delete\":\n            case \"has\":\n            case \"getAll\":\n              return (h2) => (gr(h2), URLSearchParams.prototype[l].call(f2, String(h2).toLowerCase()));\n            case \"keys\":\n              return () => (f2.sort(), new Set(URLSearchParams.prototype.keys.call(f2)).keys());\n            default:\n              return Reflect.get(f2, l, p2);\n          }\n        } });\n      }\n      get [Symbol.toStringTag]() {\n        return this.constructor.name;\n      }\n      toString() {\n        return Object.prototype.toString.call(this);\n      }\n      get(o3) {\n        const a = this.getAll(o3);\n        if (a.length === 0) return null;\n        let f2 = a.join(\", \");\n        return /^content-encoding$/i.test(o3) && (f2 = f2.toLowerCase()), f2;\n      }\n      forEach(o3, a = void 0) {\n        for (const f2 of this.keys()) Reflect.apply(o3, a, [this.get(f2), f2, this]);\n      }\n      *values() {\n        for (const o3 of this.keys()) yield this.get(o3);\n      }\n      *entries() {\n        for (const o3 of this.keys()) yield [o3, this.get(o3)];\n      }\n      [Symbol.iterator]() {\n        return this.entries();\n      }\n      raw() {\n        return [...this.keys()].reduce((o3, a) => (o3[a] = this.getAll(a), o3), {});\n      }\n      [/* @__PURE__ */ Symbol.for(\"nodejs.util.inspect.custom\")]() {\n        return [...this.keys()].reduce((o3, a) => {\n          const f2 = this.getAll(a);\n          return a === \"host\" ? o3[a] = f2[0] : o3[a] = f2.length > 1 ? f2 : f2[0], o3;\n        }, {});\n      }\n    };\n    n2(Pr, \"Headers\");\n    ye = Pr;\n    Object.defineProperties(ye.prototype, [\"get\", \"entries\", \"forEach\", \"values\"].reduce((i, o3) => (i[o3] = { enumerable: true }, i), {}));\n    n2(ol, \"fromRawHeaders\");\n    il = /* @__PURE__ */ new Set([301, 302, 303, 307, 308]);\n    jn = n2((i) => il.has(i), \"isRedirect\");\n    se = /* @__PURE__ */ Symbol(\"Response internals\");\n    Ne = class Ne2 extends xe {\n      constructor(o3 = null, a = {}) {\n        super(o3, a);\n        const f2 = a.status != null ? a.status : 200, l = new ye(a.headers);\n        if (o3 !== null && !l.has(\"Content-Type\")) {\n          const p2 = Ri(o3, this);\n          p2 && l.append(\"Content-Type\", p2);\n        }\n        this[se] = { type: \"default\", url: a.url, status: f2, statusText: a.statusText || \"\", headers: l, counter: a.counter, highWaterMark: a.highWaterMark };\n      }\n      get type() {\n        return this[se].type;\n      }\n      get url() {\n        return this[se].url || \"\";\n      }\n      get status() {\n        return this[se].status;\n      }\n      get ok() {\n        return this[se].status >= 200 && this[se].status < 300;\n      }\n      get redirected() {\n        return this[se].counter > 0;\n      }\n      get statusText() {\n        return this[se].statusText;\n      }\n      get headers() {\n        return this[se].headers;\n      }\n      get highWaterMark() {\n        return this[se].highWaterMark;\n      }\n      clone() {\n        return new Ne2(In(this, this.highWaterMark), { type: this.type, url: this.url, status: this.status, statusText: this.statusText, headers: this.headers, ok: this.ok, redirected: this.redirected, size: this.size, highWaterMark: this.highWaterMark });\n      }\n      static redirect(o3, a = 302) {\n        if (!jn(a)) throw new RangeError('Failed to execute \"redirect\" on \"response\": Invalid status code');\n        return new Ne2(null, { headers: { location: new URL(o3).toString() }, status: a });\n      }\n      static error() {\n        const o3 = new Ne2(null, { status: 0, statusText: \"\" });\n        return o3[se].type = \"error\", o3;\n      }\n      static json(o3 = void 0, a = {}) {\n        const f2 = JSON.stringify(o3);\n        if (f2 === void 0) throw new TypeError(\"data is not JSON serializable\");\n        const l = new ye(a && a.headers);\n        return l.has(\"content-type\") || l.set(\"content-type\", \"application/json\"), new Ne2(f2, __spreadProps(__spreadValues({}, a), { headers: l }));\n      }\n      get [Symbol.toStringTag]() {\n        return \"Response\";\n      }\n    };\n    n2(Ne, \"Response\");\n    le = Ne;\n    Object.defineProperties(le.prototype, { type: { enumerable: true }, url: { enumerable: true }, status: { enumerable: true }, ok: { enumerable: true }, redirected: { enumerable: true }, statusText: { enumerable: true }, headers: { enumerable: true }, clone: { enumerable: true } });\n    al = n2((i) => {\n      if (i.search) return i.search;\n      const o3 = i.href.length - 1, a = i.hash || (i.href[o3] === \"#\" ? \"#\" : \"\");\n      return i.href[o3 - a.length] === \"?\" ? \"?\" : \"\";\n    }, \"getSearch\");\n    n2(Ti, \"stripURLForUseAsAReferrer\");\n    Ci = /* @__PURE__ */ new Set([\"\", \"no-referrer\", \"no-referrer-when-downgrade\", \"same-origin\", \"origin\", \"strict-origin\", \"origin-when-cross-origin\", \"strict-origin-when-cross-origin\", \"unsafe-url\"]);\n    sl = \"strict-origin-when-cross-origin\";\n    n2(ll, \"validateReferrerPolicy\");\n    n2(ul, \"isOriginPotentiallyTrustworthy\");\n    n2(ct, \"isUrlPotentiallyTrustworthy\");\n    n2(fl, \"determineRequestsReferrer\");\n    n2(cl, \"parseReferrerPolicyFromHeader\");\n    $2 = /* @__PURE__ */ Symbol(\"Request internals\");\n    qt = n2((i) => typeof i == \"object\" && typeof i[$2] == \"object\", \"isRequest\");\n    dl = (0, import_node_util3.deprecate)(() => {\n    }, \".data is not a valid RequestInit property, use .body instead\", \"https://github.com/node-fetch/node-fetch/issues/1000 (request)\");\n    vr = class vr2 extends xe {\n      constructor(o3, a = {}) {\n        let f2;\n        if (qt(o3) ? f2 = new URL(o3.url) : (f2 = new URL(o3), o3 = {}), f2.username !== \"\" || f2.password !== \"\") throw new TypeError(`${f2} is an url with embedded credentials.`);\n        let l = a.method || o3.method || \"GET\";\n        if (/^(delete|get|head|options|post|put)$/i.test(l) && (l = l.toUpperCase()), !qt(a) && \"data\" in a && dl(), (a.body != null || qt(o3) && o3.body !== null) && (l === \"GET\" || l === \"HEAD\")) throw new TypeError(\"Request with GET/HEAD method cannot have body\");\n        const p2 = a.body ? a.body : qt(o3) && o3.body !== null ? In(o3) : null;\n        super(p2, { size: a.size || o3.size || 0 });\n        const h2 = new ye(a.headers || o3.headers || {});\n        if (p2 !== null && !h2.has(\"Content-Type\")) {\n          const w2 = Ri(p2, this);\n          w2 && h2.set(\"Content-Type\", w2);\n        }\n        let S = qt(o3) ? o3.signal : null;\n        if (\"signal\" in a && (S = a.signal), S != null && !Ks(S)) throw new TypeError(\"Expected signal to be an instanceof AbortSignal or EventTarget\");\n        let v2 = a.referrer == null ? o3.referrer : a.referrer;\n        if (v2 === \"\") v2 = \"no-referrer\";\n        else if (v2) {\n          const w2 = new URL(v2);\n          v2 = /^about:(\\/\\/)?client$/.test(w2) ? \"client\" : w2;\n        } else v2 = void 0;\n        this[$2] = { method: l, redirect: a.redirect || o3.redirect || \"follow\", headers: h2, parsedURL: f2, signal: S, referrer: v2 }, this.follow = a.follow === void 0 ? o3.follow === void 0 ? 20 : o3.follow : a.follow, this.compress = a.compress === void 0 ? o3.compress === void 0 ? true : o3.compress : a.compress, this.counter = a.counter || o3.counter || 0, this.agent = a.agent || o3.agent, this.highWaterMark = a.highWaterMark || o3.highWaterMark || 16384, this.insecureHTTPParser = a.insecureHTTPParser || o3.insecureHTTPParser || false, this.referrerPolicy = a.referrerPolicy || o3.referrerPolicy || \"\";\n      }\n      get method() {\n        return this[$2].method;\n      }\n      get url() {\n        return (0, import_node_url2.format)(this[$2].parsedURL);\n      }\n      get headers() {\n        return this[$2].headers;\n      }\n      get redirect() {\n        return this[$2].redirect;\n      }\n      get signal() {\n        return this[$2].signal;\n      }\n      get referrer() {\n        if (this[$2].referrer === \"no-referrer\") return \"\";\n        if (this[$2].referrer === \"client\") return \"about:client\";\n        if (this[$2].referrer) return this[$2].referrer.toString();\n      }\n      get referrerPolicy() {\n        return this[$2].referrerPolicy;\n      }\n      set referrerPolicy(o3) {\n        this[$2].referrerPolicy = ll(o3);\n      }\n      clone() {\n        return new vr2(this);\n      }\n      get [Symbol.toStringTag]() {\n        return \"Request\";\n      }\n    };\n    n2(vr, \"Request\");\n    dt = vr;\n    Object.defineProperties(dt.prototype, { method: { enumerable: true }, url: { enumerable: true }, headers: { enumerable: true }, redirect: { enumerable: true }, clone: { enumerable: true }, signal: { enumerable: true }, referrer: { enumerable: true }, referrerPolicy: { enumerable: true } });\n    hl = n2((i) => {\n      const { parsedURL: o3 } = i[$2], a = new ye(i[$2].headers);\n      a.has(\"Accept\") || a.set(\"Accept\", \"*/*\");\n      let f2 = null;\n      if (i.body === null && /^(post|put)$/i.test(i.method) && (f2 = \"0\"), i.body !== null) {\n        const S = rl(i);\n        typeof S == \"number\" && !Number.isNaN(S) && (f2 = String(S));\n      }\n      f2 && a.set(\"Content-Length\", f2), i.referrerPolicy === \"\" && (i.referrerPolicy = sl), i.referrer && i.referrer !== \"no-referrer\" ? i[$2].referrer = fl(i) : i[$2].referrer = \"no-referrer\", i[$2].referrer instanceof URL && a.set(\"Referer\", i.referrer), a.has(\"User-Agent\") || a.set(\"User-Agent\", \"node-fetch\"), i.compress && !a.has(\"Accept-Encoding\") && a.set(\"Accept-Encoding\", \"gzip, deflate, br\");\n      let { agent: l } = i;\n      typeof l == \"function\" && (l = l(o3));\n      const p2 = al(o3), h2 = { path: o3.pathname + p2, method: i.method, headers: a[/* @__PURE__ */ Symbol.for(\"nodejs.util.inspect.custom\")](), insecureHTTPParser: i.insecureHTTPParser, agent: l };\n      return { parsedURL: o3, options: h2 };\n    }, \"getNodeRequestOptions\");\n    Hn = class Hn2 extends ft {\n      constructor(o3, a = \"aborted\") {\n        super(o3, a);\n      }\n    };\n    n2(Hn, \"AbortError\");\n    _r = Hn;\n    n2(pl, \"requireNodeDomexception\");\n    bl = pl();\n    ml = f(bl);\n    ({ stat: $n } = import_node_fs4.promises);\n    yl = n2((i, o3) => vi((0, import_node_fs4.statSync)(i), i, o3), \"blobFromSync\");\n    gl = n2((i, o3) => $n(i).then((a) => vi(a, i, o3)), \"blobFrom\");\n    _l = n2((i, o3) => $n(i).then((a) => Ei(a, i, o3)), \"fileFrom\");\n    Sl = n2((i, o3) => Ei((0, import_node_fs4.statSync)(i), i, o3), \"fileFromSync\");\n    vi = n2((i, o3, a = \"\") => new ut([new Sr({ path: o3, size: i.size, lastModified: i.mtimeMs, start: 0 })], { type: a }), \"fromBlob\");\n    Ei = n2((i, o3, a = \"\") => new qn([new Sr({ path: o3, size: i.size, lastModified: i.mtimeMs, start: 0 })], (0, import_node_path5.basename)(o3), { type: a, lastModified: i.mtimeMs }), \"fromFile\");\n    Er = class Er2 {\n      constructor(o3) {\n        be(this, He);\n        be(this, Ve);\n        X(this, He, o3.path), X(this, Ve, o3.start), this.size = o3.size, this.lastModified = o3.lastModified;\n      }\n      slice(o3, a) {\n        return new Er2({ path: O(this, He), lastModified: this.lastModified, size: a - o3, start: O(this, Ve) + o3 });\n      }\n      stream() {\n        return __asyncGenerator(this, null, function* () {\n          const { mtimeMs: o3 } = yield new __await($n(O(this, He)));\n          if (o3 > this.lastModified) throw new ml(\"The requested file could not be read, typically due to permission problems that have occurred after a reference to a file was acquired.\", \"NotReadableError\");\n          yield* __yieldStar((0, import_node_fs4.createReadStream)(O(this, He), { start: O(this, Ve), end: O(this, Ve) + this.size - 1 }));\n        });\n      }\n      get [Symbol.toStringTag]() {\n        return \"Blob\";\n      }\n    };\n    He = /* @__PURE__ */ new WeakMap(), Ve = /* @__PURE__ */ new WeakMap(), n2(Er, \"BlobDataItem\");\n    Sr = Er;\n    wl = /* @__PURE__ */ new Set([\"data:\", \"http:\", \"https:\"]);\n    n2(Ai, \"fetch$1\");\n    n2(Rl, \"fixResponseChunkedTransferBadEnding\");\n    Bi = /* @__PURE__ */ new WeakMap();\n    Dn = /* @__PURE__ */ new WeakMap();\n    n2(W, \"pd\");\n    n2(ki, \"setCancelFlag\");\n    n2(ht, \"Event\"), ht.prototype = { get type() {\n      return W(this).event.type;\n    }, get target() {\n      return W(this).eventTarget;\n    }, get currentTarget() {\n      return W(this).currentTarget;\n    }, composedPath() {\n      const i = W(this).currentTarget;\n      return i == null ? [] : [i];\n    }, get NONE() {\n      return 0;\n    }, get CAPTURING_PHASE() {\n      return 1;\n    }, get AT_TARGET() {\n      return 2;\n    }, get BUBBLING_PHASE() {\n      return 3;\n    }, get eventPhase() {\n      return W(this).eventPhase;\n    }, stopPropagation() {\n      const i = W(this);\n      i.stopped = true, typeof i.event.stopPropagation == \"function\" && i.event.stopPropagation();\n    }, stopImmediatePropagation() {\n      const i = W(this);\n      i.stopped = true, i.immediateStopped = true, typeof i.event.stopImmediatePropagation == \"function\" && i.event.stopImmediatePropagation();\n    }, get bubbles() {\n      return !!W(this).event.bubbles;\n    }, get cancelable() {\n      return !!W(this).event.cancelable;\n    }, preventDefault() {\n      ki(W(this));\n    }, get defaultPrevented() {\n      return W(this).canceled;\n    }, get composed() {\n      return !!W(this).event.composed;\n    }, get timeStamp() {\n      return W(this).timeStamp;\n    }, get srcElement() {\n      return W(this).eventTarget;\n    }, get cancelBubble() {\n      return W(this).stopped;\n    }, set cancelBubble(i) {\n      if (!i) return;\n      const o3 = W(this);\n      o3.stopped = true, typeof o3.event.cancelBubble == \"boolean\" && (o3.event.cancelBubble = true);\n    }, get returnValue() {\n      return !W(this).canceled;\n    }, set returnValue(i) {\n      i || ki(W(this));\n    }, initEvent() {\n    } }, Object.defineProperty(ht.prototype, \"constructor\", { value: ht, configurable: true, writable: true }), typeof window < \"u\" && typeof window.Event < \"u\" && (Object.setPrototypeOf(ht.prototype, window.Event.prototype), Dn.set(window.Event.prototype, ht));\n    n2(Wi, \"defineRedirectDescriptor\");\n    n2(Tl, \"defineCallDescriptor\");\n    n2(Cl, \"defineWrapper\");\n    n2(qi, \"getWrapper\");\n    n2(Pl, \"wrapEvent\");\n    n2(vl, \"isStopped\");\n    n2(El, \"setEventPhase\");\n    n2(Al, \"setCurrentTarget\");\n    n2(Oi, \"setPassiveListener\");\n    zi = /* @__PURE__ */ new WeakMap();\n    Ii = 1;\n    Fi = 2;\n    wr = 3;\n    n2(Rr, \"isObject\");\n    n2(Ot, \"getListeners\");\n    n2(Bl, \"defineEventAttributeDescriptor\");\n    n2(ji, \"defineEventAttribute\");\n    n2(Li, \"defineCustomEventTarget\");\n    n2(Pe, \"EventTarget\"), Pe.prototype = { addEventListener(i, o3, a) {\n      if (o3 == null) return;\n      if (typeof o3 != \"function\" && !Rr(o3)) throw new TypeError(\"'listener' should be a function or an object.\");\n      const f2 = Ot(this), l = Rr(a), h2 = (l ? !!a.capture : !!a) ? Ii : Fi, S = { listener: o3, listenerType: h2, passive: l && !!a.passive, once: l && !!a.once, next: null };\n      let v2 = f2.get(i);\n      if (v2 === void 0) {\n        f2.set(i, S);\n        return;\n      }\n      let w2 = null;\n      for (; v2 != null; ) {\n        if (v2.listener === o3 && v2.listenerType === h2) return;\n        w2 = v2, v2 = v2.next;\n      }\n      w2.next = S;\n    }, removeEventListener(i, o3, a) {\n      if (o3 == null) return;\n      const f2 = Ot(this), p2 = (Rr(a) ? !!a.capture : !!a) ? Ii : Fi;\n      let h2 = null, S = f2.get(i);\n      for (; S != null; ) {\n        if (S.listener === o3 && S.listenerType === p2) {\n          h2 !== null ? h2.next = S.next : S.next !== null ? f2.set(i, S.next) : f2.delete(i);\n          return;\n        }\n        h2 = S, S = S.next;\n      }\n    }, dispatchEvent(i) {\n      if (i == null || typeof i.type != \"string\") throw new TypeError('\"event.type\" should be a string.');\n      const o3 = Ot(this), a = i.type;\n      let f2 = o3.get(a);\n      if (f2 == null) return true;\n      const l = Pl(this, i);\n      let p2 = null;\n      for (; f2 != null; ) {\n        if (f2.once ? p2 !== null ? p2.next = f2.next : f2.next !== null ? o3.set(a, f2.next) : o3.delete(a) : p2 = f2, Oi(l, f2.passive ? f2.listener : null), typeof f2.listener == \"function\") try {\n          f2.listener.call(this, l);\n        } catch (h2) {\n          typeof console < \"u\" && typeof console.error == \"function\" && console.error(h2);\n        }\n        else f2.listenerType !== wr && typeof f2.listener.handleEvent == \"function\" && f2.listener.handleEvent(l);\n        if (vl(l)) break;\n        f2 = f2.next;\n      }\n      return Oi(l, null), El(l, 0), Al(l, null), !l.defaultPrevented;\n    } }, Object.defineProperty(Pe.prototype, \"constructor\", { value: Pe, configurable: true, writable: true }), typeof window < \"u\" && typeof window.EventTarget < \"u\" && Object.setPrototypeOf(Pe.prototype, window.EventTarget.prototype);\n    Vn = class Vn2 extends Pe {\n      constructor() {\n        throw super(), new TypeError(\"AbortSignal cannot be constructed directly\");\n      }\n      get aborted() {\n        const o3 = Tr.get(this);\n        if (typeof o3 != \"boolean\") throw new TypeError(`Expected 'this' to be an 'AbortSignal' object, but got ${this === null ? \"null\" : typeof this}`);\n        return o3;\n      }\n    };\n    n2(Vn, \"AbortSignal\");\n    pt = Vn;\n    ji(pt.prototype, \"abort\");\n    n2(kl, \"createAbortSignal\");\n    n2(Wl, \"abortSignal\");\n    Tr = /* @__PURE__ */ new WeakMap();\n    Object.defineProperties(pt.prototype, { aborted: { enumerable: true } }), typeof Symbol == \"function\" && typeof Symbol.toStringTag == \"symbol\" && Object.defineProperty(pt.prototype, Symbol.toStringTag, { configurable: true, value: \"AbortSignal\" });\n    Mn = (gt = class {\n      constructor() {\n        $i.set(this, kl());\n      }\n      get signal() {\n        return Di(this);\n      }\n      abort() {\n        Wl(Di(this));\n      }\n    }, n2(gt, \"AbortController\"), gt);\n    $i = /* @__PURE__ */ new WeakMap();\n    n2(Di, \"getSignal\"), Object.defineProperties(Mn.prototype, { signal: { enumerable: true }, abort: { enumerable: true } }), typeof Symbol == \"function\" && typeof Symbol.toStringTag == \"symbol\" && Object.defineProperty(Mn.prototype, Symbol.toStringTag, { configurable: true, value: \"AbortController\" });\n    ql = Object.defineProperty;\n    Ol = n2((i, o3) => ql(i, \"name\", { value: o3, configurable: true }), \"e\");\n    Mi = Ai;\n    Ui();\n    n2(Ui, \"s\"), Ol(Ui, \"checkNodeEnvironment\");\n  }\n});\n\n// node_modules/minimist/index.js\nvar require_minimist = __commonJS({\n  \"node_modules/minimist/index.js\"(exports2, module2) {\n    \"use strict\";\n    function hasKey(obj, keys) {\n      var o3 = obj;\n      keys.slice(0, -1).forEach(function(key2) {\n        o3 = o3[key2] || {};\n      });\n      var key = keys[keys.length - 1];\n      return key in o3;\n    }\n    function isNumber(x2) {\n      if (typeof x2 === \"number\") {\n        return true;\n      }\n      if (/^0x[0-9a-f]+$/i.test(x2)) {\n        return true;\n      }\n      return /^[-+]?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(e[-+]?\\d+)?$/.test(x2);\n    }\n    function isConstructorOrProto(obj, key) {\n      return key === \"constructor\" && typeof obj[key] === \"function\" || key === \"__proto__\";\n    }\n    module2.exports = function(args, opts) {\n      if (!opts) {\n        opts = {};\n      }\n      var flags = {\n        bools: {},\n        strings: {},\n        unknownFn: null\n      };\n      if (typeof opts.unknown === \"function\") {\n        flags.unknownFn = opts.unknown;\n      }\n      if (typeof opts.boolean === \"boolean\" && opts.boolean) {\n        flags.allBools = true;\n      } else {\n        [].concat(opts.boolean).filter(Boolean).forEach(function(key2) {\n          flags.bools[key2] = true;\n        });\n      }\n      var aliases = {};\n      function aliasIsBoolean(key2) {\n        return aliases[key2].some(function(x2) {\n          return flags.bools[x2];\n        });\n      }\n      Object.keys(opts.alias || {}).forEach(function(key2) {\n        aliases[key2] = [].concat(opts.alias[key2]);\n        aliases[key2].forEach(function(x2) {\n          aliases[x2] = [key2].concat(aliases[key2].filter(function(y) {\n            return x2 !== y;\n          }));\n        });\n      });\n      [].concat(opts.string).filter(Boolean).forEach(function(key2) {\n        flags.strings[key2] = true;\n        if (aliases[key2]) {\n          [].concat(aliases[key2]).forEach(function(k2) {\n            flags.strings[k2] = true;\n          });\n        }\n      });\n      var defaults = opts.default || {};\n      var argv = { _: [] };\n      function argDefined(key2, arg2) {\n        return flags.allBools && /^--[^=]+$/.test(arg2) || flags.strings[key2] || flags.bools[key2] || aliases[key2];\n      }\n      function setKey(obj, keys, value2) {\n        var o3 = obj;\n        for (var i2 = 0; i2 < keys.length - 1; i2++) {\n          var key2 = keys[i2];\n          if (isConstructorOrProto(o3, key2)) {\n            return;\n          }\n          if (o3[key2] === void 0) {\n            o3[key2] = {};\n          }\n          if (o3[key2] === Object.prototype || o3[key2] === Number.prototype || o3[key2] === String.prototype) {\n            o3[key2] = {};\n          }\n          if (o3[key2] === Array.prototype) {\n            o3[key2] = [];\n          }\n          o3 = o3[key2];\n        }\n        var lastKey = keys[keys.length - 1];\n        if (isConstructorOrProto(o3, lastKey)) {\n          return;\n        }\n        if (o3 === Object.prototype || o3 === Number.prototype || o3 === String.prototype) {\n          o3 = {};\n        }\n        if (o3 === Array.prototype) {\n          o3 = [];\n        }\n        if (o3[lastKey] === void 0 || flags.bools[lastKey] || typeof o3[lastKey] === \"boolean\") {\n          o3[lastKey] = value2;\n        } else if (Array.isArray(o3[lastKey])) {\n          o3[lastKey].push(value2);\n        } else {\n          o3[lastKey] = [o3[lastKey], value2];\n        }\n      }\n      function setArg(key2, val, arg2) {\n        if (arg2 && flags.unknownFn && !argDefined(key2, arg2)) {\n          if (flags.unknownFn(arg2) === false) {\n            return;\n          }\n        }\n        var value2 = !flags.strings[key2] && isNumber(val) ? Number(val) : val;\n        setKey(argv, key2.split(\".\"), value2);\n        (aliases[key2] || []).forEach(function(x2) {\n          setKey(argv, x2.split(\".\"), value2);\n        });\n      }\n      Object.keys(flags.bools).forEach(function(key2) {\n        setArg(key2, defaults[key2] === void 0 ? false : defaults[key2]);\n      });\n      var notFlags = [];\n      if (args.indexOf(\"--\") !== -1) {\n        notFlags = args.slice(args.indexOf(\"--\") + 1);\n        args = args.slice(0, args.indexOf(\"--\"));\n      }\n      for (var i = 0; i < args.length; i++) {\n        var arg = args[i];\n        var key;\n        var next;\n        if (/^--.+=/.test(arg)) {\n          var m2 = arg.match(/^--([^=]+)=([\\s\\S]*)$/);\n          key = m2[1];\n          var value = m2[2];\n          if (flags.bools[key]) {\n            value = value !== \"false\";\n          }\n          setArg(key, value, arg);\n        } else if (/^--no-.+/.test(arg)) {\n          key = arg.match(/^--no-(.+)/)[1];\n          setArg(key, false, arg);\n        } else if (/^--.+/.test(arg)) {\n          key = arg.match(/^--(.+)/)[1];\n          next = args[i + 1];\n          if (next !== void 0 && !/^(-|--)[^-]/.test(next) && !flags.bools[key] && !flags.allBools && (aliases[key] ? !aliasIsBoolean(key) : true)) {\n            setArg(key, next, arg);\n            i += 1;\n          } else if (/^(true|false)$/.test(next)) {\n            setArg(key, next === \"true\", arg);\n            i += 1;\n          } else {\n            setArg(key, flags.strings[key] ? \"\" : true, arg);\n          }\n        } else if (/^-[^-]+/.test(arg)) {\n          var letters = arg.slice(1, -1).split(\"\");\n          var broken = false;\n          for (var j = 0; j < letters.length; j++) {\n            next = arg.slice(j + 2);\n            if (next === \"-\") {\n              setArg(letters[j], next, arg);\n              continue;\n            }\n            if (/[A-Za-z]/.test(letters[j]) && next[0] === \"=\") {\n              setArg(letters[j], next.slice(1), arg);\n              broken = true;\n              break;\n            }\n            if (/[A-Za-z]/.test(letters[j]) && /-?\\d+(\\.\\d*)?(e-?\\d+)?$/.test(next)) {\n              setArg(letters[j], next, arg);\n              broken = true;\n              break;\n            }\n            if (letters[j + 1] && letters[j + 1].match(/\\W/)) {\n              setArg(letters[j], arg.slice(j + 2), arg);\n              broken = true;\n              break;\n            } else {\n              setArg(letters[j], flags.strings[letters[j]] ? \"\" : true, arg);\n            }\n          }\n          key = arg.slice(-1)[0];\n          if (!broken && key !== \"-\") {\n            if (args[i + 1] && !/^(-|--)[^-]/.test(args[i + 1]) && !flags.bools[key] && (aliases[key] ? !aliasIsBoolean(key) : true)) {\n              setArg(key, args[i + 1], arg);\n              i += 1;\n            } else if (args[i + 1] && /^(true|false)$/.test(args[i + 1])) {\n              setArg(key, args[i + 1] === \"true\", arg);\n              i += 1;\n            } else {\n              setArg(key, flags.strings[key] ? \"\" : true, arg);\n            }\n          }\n        } else {\n          if (!flags.unknownFn || flags.unknownFn(arg) !== false) {\n            argv._.push(flags.strings._ || !isNumber(arg) ? arg : Number(arg));\n          }\n          if (opts.stopEarly) {\n            argv._.push.apply(argv._, args.slice(i + 1));\n            break;\n          }\n        }\n      }\n      Object.keys(defaults).forEach(function(k2) {\n        if (!hasKey(argv, k2.split(\".\"))) {\n          setKey(argv, k2.split(\".\"), defaults[k2]);\n          (aliases[k2] || []).forEach(function(x2) {\n            setKey(argv, x2.split(\".\"), defaults[k2]);\n          });\n        }\n      });\n      if (opts[\"--\"]) {\n        argv[\"--\"] = notFlags.slice();\n      } else {\n        notFlags.forEach(function(k2) {\n          argv._.push(k2);\n        });\n      }\n      return argv;\n    };\n  }\n});\n\n// src/vendor-extra.ts\nvar vendor_extra_exports = {};\n__export(vendor_extra_exports, {\n  MAML: () => MAML,\n  YAML: () => YAML,\n  createRequire: () => createRequire,\n  depseek: () => depseek,\n  dotenv: () => dotenv,\n  fs: () => fs5,\n  glob: () => glob,\n  minimist: () => minimist,\n  nodeFetch: () => nodeFetch\n});\nmodule.exports = __toCommonJS(vendor_extra_exports);\n\n// node_modules/globby/index.js\nvar import_node_process2 = __toESM(require(\"process\"), 1);\nvar import_node_fs3 = __toESM(require(\"fs\"), 1);\nvar import_node_path4 = __toESM(require(\"path\"), 1);\nvar import_node_stream2 = require(\"stream\");\n\n// node_modules/@sindresorhus/merge-streams/index.js\nvar import_node_events = require(\"events\");\nvar import_node_stream = require(\"stream\");\nvar import_promises = require(\"stream\").promises;\nfunction mergeStreams(streams) {\n  if (!Array.isArray(streams)) {\n    throw new TypeError(`Expected an array, got \\`${typeof streams}\\`.`);\n  }\n  for (const stream of streams) {\n    validateStream(stream);\n  }\n  const objectMode = streams.some(({ readableObjectMode }) => readableObjectMode);\n  const highWaterMark = getHighWaterMark(streams, objectMode);\n  const passThroughStream = new MergedStream({\n    objectMode,\n    writableHighWaterMark: highWaterMark,\n    readableHighWaterMark: highWaterMark\n  });\n  for (const stream of streams) {\n    passThroughStream.add(stream);\n  }\n  return passThroughStream;\n}\nvar getHighWaterMark = (streams, objectMode) => {\n  if (streams.length === 0) {\n    return (0, import_node_stream.getDefaultHighWaterMark)(objectMode);\n  }\n  const highWaterMarks = streams.filter(({ readableObjectMode }) => readableObjectMode === objectMode).map(({ readableHighWaterMark }) => readableHighWaterMark);\n  return Math.max(...highWaterMarks);\n};\nvar _streams, _ended, _aborted, _onFinished, _unpipeEvent, _streamPromises;\nvar MergedStream = class extends import_node_stream.PassThrough {\n  constructor() {\n    super(...arguments);\n    __privateAdd(this, _streams, /* @__PURE__ */ new Set([]));\n    __privateAdd(this, _ended, /* @__PURE__ */ new Set([]));\n    __privateAdd(this, _aborted, /* @__PURE__ */ new Set([]));\n    __privateAdd(this, _onFinished);\n    __privateAdd(this, _unpipeEvent, /* @__PURE__ */ Symbol(\"unpipe\"));\n    __privateAdd(this, _streamPromises, /* @__PURE__ */ new WeakMap());\n  }\n  add(stream) {\n    var _a2;\n    validateStream(stream);\n    if (__privateGet(this, _streams).has(stream)) {\n      return;\n    }\n    __privateGet(this, _streams).add(stream);\n    (_a2 = __privateGet(this, _onFinished)) != null ? _a2 : __privateSet(this, _onFinished, onMergedStreamFinished(this, __privateGet(this, _streams), __privateGet(this, _unpipeEvent)));\n    const streamPromise = endWhenStreamsDone({\n      passThroughStream: this,\n      stream,\n      streams: __privateGet(this, _streams),\n      ended: __privateGet(this, _ended),\n      aborted: __privateGet(this, _aborted),\n      onFinished: __privateGet(this, _onFinished),\n      unpipeEvent: __privateGet(this, _unpipeEvent)\n    });\n    __privateGet(this, _streamPromises).set(stream, streamPromise);\n    stream.pipe(this, { end: false });\n  }\n  remove(stream) {\n    return __async(this, null, function* () {\n      validateStream(stream);\n      if (!__privateGet(this, _streams).has(stream)) {\n        return false;\n      }\n      const streamPromise = __privateGet(this, _streamPromises).get(stream);\n      if (streamPromise === void 0) {\n        return false;\n      }\n      __privateGet(this, _streamPromises).delete(stream);\n      stream.unpipe(this);\n      yield streamPromise;\n      return true;\n    });\n  }\n};\n_streams = new WeakMap();\n_ended = new WeakMap();\n_aborted = new WeakMap();\n_onFinished = new WeakMap();\n_unpipeEvent = new WeakMap();\n_streamPromises = new WeakMap();\nvar onMergedStreamFinished = (passThroughStream, streams, unpipeEvent) => __async(null, null, function* () {\n  updateMaxListeners(passThroughStream, PASSTHROUGH_LISTENERS_COUNT);\n  const controller = new AbortController();\n  try {\n    yield Promise.race([\n      onMergedStreamEnd(passThroughStream, controller),\n      onInputStreamsUnpipe(passThroughStream, streams, unpipeEvent, controller)\n    ]);\n  } finally {\n    controller.abort();\n    updateMaxListeners(passThroughStream, -PASSTHROUGH_LISTENERS_COUNT);\n  }\n});\nvar onMergedStreamEnd = (_0, _1) => __async(null, [_0, _1], function* (passThroughStream, { signal }) {\n  try {\n    yield (0, import_promises.finished)(passThroughStream, { signal, cleanup: true });\n  } catch (error) {\n    errorOrAbortStream(passThroughStream, error);\n    throw error;\n  }\n});\nvar onInputStreamsUnpipe = (_0, _1, _2, _3) => __async(null, [_0, _1, _2, _3], function* (passThroughStream, streams, unpipeEvent, { signal }) {\n  try {\n    for (var iter = __forAwait((0, import_node_events.on)(passThroughStream, \"unpipe\", { signal })), more, temp, error; more = !(temp = yield iter.next()).done; more = false) {\n      const [unpipedStream] = temp.value;\n      if (streams.has(unpipedStream)) {\n        unpipedStream.emit(unpipeEvent);\n      }\n    }\n  } catch (temp) {\n    error = [temp];\n  } finally {\n    try {\n      more && (temp = iter.return) && (yield temp.call(iter));\n    } finally {\n      if (error)\n        throw error[0];\n    }\n  }\n});\nvar validateStream = (stream) => {\n  if (typeof (stream == null ? void 0 : stream.pipe) !== \"function\") {\n    throw new TypeError(`Expected a readable stream, got: \\`${typeof stream}\\`.`);\n  }\n};\nvar endWhenStreamsDone = (_0) => __async(null, [_0], function* ({ passThroughStream, stream, streams, ended, aborted, onFinished, unpipeEvent }) {\n  updateMaxListeners(passThroughStream, PASSTHROUGH_LISTENERS_PER_STREAM);\n  const controller = new AbortController();\n  try {\n    yield Promise.race([\n      afterMergedStreamFinished(onFinished, stream, controller),\n      onInputStreamEnd({\n        passThroughStream,\n        stream,\n        streams,\n        ended,\n        aborted,\n        controller\n      }),\n      onInputStreamUnpipe({\n        stream,\n        streams,\n        ended,\n        aborted,\n        unpipeEvent,\n        controller\n      })\n    ]);\n  } finally {\n    controller.abort();\n    updateMaxListeners(passThroughStream, -PASSTHROUGH_LISTENERS_PER_STREAM);\n  }\n  if (streams.size > 0 && streams.size === ended.size + aborted.size) {\n    if (ended.size === 0 && aborted.size > 0) {\n      abortStream(passThroughStream);\n    } else {\n      endStream(passThroughStream);\n    }\n  }\n});\nvar afterMergedStreamFinished = (_0, _1, _2) => __async(null, [_0, _1, _2], function* (onFinished, stream, { signal }) {\n  try {\n    yield onFinished;\n    if (!signal.aborted) {\n      abortStream(stream);\n    }\n  } catch (error) {\n    if (!signal.aborted) {\n      errorOrAbortStream(stream, error);\n    }\n  }\n});\nvar onInputStreamEnd = (_0) => __async(null, [_0], function* ({ passThroughStream, stream, streams, ended, aborted, controller: { signal } }) {\n  try {\n    yield (0, import_promises.finished)(stream, {\n      signal,\n      cleanup: true,\n      readable: true,\n      writable: false\n    });\n    if (streams.has(stream)) {\n      ended.add(stream);\n    }\n  } catch (error) {\n    if (signal.aborted || !streams.has(stream)) {\n      return;\n    }\n    if (isAbortError(error)) {\n      aborted.add(stream);\n    } else {\n      errorStream(passThroughStream, error);\n    }\n  }\n});\nvar onInputStreamUnpipe = (_0) => __async(null, [_0], function* ({ stream, streams, ended, aborted, unpipeEvent, controller: { signal } }) {\n  yield (0, import_node_events.once)(stream, unpipeEvent, { signal });\n  if (!stream.readable) {\n    return (0, import_node_events.once)(signal, \"abort\", { signal });\n  }\n  streams.delete(stream);\n  ended.delete(stream);\n  aborted.delete(stream);\n});\nvar endStream = (stream) => {\n  if (stream.writable) {\n    stream.end();\n  }\n};\nvar errorOrAbortStream = (stream, error) => {\n  if (isAbortError(error)) {\n    abortStream(stream);\n  } else {\n    errorStream(stream, error);\n  }\n};\nvar isAbortError = (error) => (error == null ? void 0 : error.code) === \"ERR_STREAM_PREMATURE_CLOSE\";\nvar abortStream = (stream) => {\n  if (stream.readable || stream.writable) {\n    stream.destroy();\n  }\n};\nvar errorStream = (stream, error) => {\n  if (!stream.destroyed) {\n    stream.once(\"error\", noop);\n    stream.destroy(error);\n  }\n};\nvar noop = () => {\n};\nvar updateMaxListeners = (passThroughStream, increment) => {\n  const maxListeners = passThroughStream.getMaxListeners();\n  if (maxListeners !== 0 && maxListeners !== Number.POSITIVE_INFINITY) {\n    passThroughStream.setMaxListeners(maxListeners + increment);\n  }\n};\nvar PASSTHROUGH_LISTENERS_COUNT = 2;\nvar PASSTHROUGH_LISTENERS_PER_STREAM = 1;\n\n// node_modules/globby/index.js\nvar import_fast_glob3 = __toESM(require_out4(), 1);\n\n// node_modules/globby/node_modules/unicorn-magic/node.js\nvar import_node_util = require(\"util\");\nvar import_node_child_process = require(\"child_process\");\nvar import_node_url = require(\"url\");\nvar execFileOriginal = (0, import_node_util.promisify)(import_node_child_process.execFile);\nfunction toPath(urlOrPath) {\n  return urlOrPath instanceof URL ? (0, import_node_url.fileURLToPath)(urlOrPath) : urlOrPath;\n}\nvar TEN_MEGABYTES_IN_BYTES = 10 * 1024 * 1024;\n\n// node_modules/globby/ignore.js\nvar import_node_process = __toESM(require(\"process\"), 1);\nvar import_node_fs2 = __toESM(require(\"fs\"), 1);\nvar import_promises2 = __toESM(require(\"fs\").promises, 1);\nvar import_node_path3 = __toESM(require(\"path\"), 1);\nvar import_fast_glob2 = __toESM(require_out4(), 1);\nvar import_ignore = __toESM(require_ignore(), 1);\n\n// node_modules/is-path-inside/index.js\nvar import_node_path = __toESM(require(\"path\"), 1);\nfunction isPathInside(childPath, parentPath) {\n  const relation = import_node_path.default.relative(parentPath, childPath);\n  return Boolean(\n    relation && relation !== \"..\" && !relation.startsWith(`..${import_node_path.default.sep}`) && relation !== import_node_path.default.resolve(childPath)\n  );\n}\n\n// node_modules/slash/index.js\nfunction slash(path5) {\n  const isExtendedLengthPath = path5.startsWith(\"\\\\\\\\?\\\\\");\n  if (isExtendedLengthPath) {\n    return path5;\n  }\n  return path5.replace(/\\\\/g, \"/\");\n}\n\n// node_modules/globby/utilities.js\nvar import_node_fs = __toESM(require(\"fs\"), 1);\nvar import_node_path2 = __toESM(require(\"path\"), 1);\nvar import_node_util2 = require(\"util\");\nvar import_fast_glob = __toESM(require_out4(), 1);\nvar isNegativePattern = (pattern) => pattern[0] === \"!\";\nvar normalizeAbsolutePatternToRelative = (pattern) => {\n  if (!pattern.startsWith(\"/\")) {\n    return pattern;\n  }\n  const inner = pattern.slice(1);\n  const firstSlashIndex = inner.indexOf(\"/\");\n  const firstSegment = firstSlashIndex > 0 ? inner.slice(0, firstSlashIndex) : inner;\n  if (firstSlashIndex > 0 && !import_fast_glob.default.isDynamicPattern(firstSegment)) {\n    return pattern;\n  }\n  return inner;\n};\nvar absolutePrefixesMatch = (positivePrefix, negativePrefix) => negativePrefix === positivePrefix;\nvar getStaticAbsolutePathPrefix = (pattern) => {\n  if (!import_node_path2.default.isAbsolute(pattern)) {\n    return void 0;\n  }\n  const staticSegments = [];\n  for (const segment of pattern.split(\"/\")) {\n    if (!segment) {\n      continue;\n    }\n    if (import_fast_glob.default.isDynamicPattern(segment)) {\n      break;\n    }\n    staticSegments.push(segment);\n  }\n  return staticSegments.length === 0 ? void 0 : `/${staticSegments.join(\"/\")}`;\n};\nvar normalizeNegativePattern = (pattern, positiveAbsolutePathPrefixes = [], hasRelativePositivePattern = false) => {\n  if (!pattern.startsWith(\"/\")) {\n    return pattern;\n  }\n  const normalizedPattern = normalizeAbsolutePatternToRelative(pattern);\n  if (normalizedPattern !== pattern) {\n    return normalizedPattern;\n  }\n  if (hasRelativePositivePattern) {\n    return pattern.slice(1);\n  }\n  const negativeAbsolutePathPrefix = getStaticAbsolutePathPrefix(pattern);\n  const preserveAsAbsolutePattern = negativeAbsolutePathPrefix !== void 0 && positiveAbsolutePathPrefixes.some((positiveAbsolutePathPrefix) => absolutePrefixesMatch(positiveAbsolutePathPrefix, negativeAbsolutePathPrefix));\n  return preserveAsAbsolutePattern ? pattern : pattern.slice(1);\n};\nvar bindFsMethod = (object, methodName) => {\n  const method = object == null ? void 0 : object[methodName];\n  return typeof method === \"function\" ? method.bind(object) : void 0;\n};\nvar promisifyFsMethod = (object, methodName) => {\n  const method = object == null ? void 0 : object[methodName];\n  if (typeof method !== \"function\") {\n    return void 0;\n  }\n  return (0, import_node_util2.promisify)(method.bind(object));\n};\nvar normalizeDirectoryPatternForFastGlob = (pattern) => {\n  if (!pattern.endsWith(\"/\")) {\n    return pattern;\n  }\n  const trimmedPattern = pattern.replace(/\\/+$/u, \"\");\n  if (!trimmedPattern) {\n    return \"/**\";\n  }\n  if (trimmedPattern === \"**\") {\n    return \"**/**\";\n  }\n  const hasLeadingSlash = trimmedPattern.startsWith(\"/\");\n  const patternBody = hasLeadingSlash ? trimmedPattern.slice(1) : trimmedPattern;\n  const hasInnerSlash = patternBody.includes(\"/\");\n  const needsRecursivePrefix = !hasLeadingSlash && !hasInnerSlash && !trimmedPattern.startsWith(\"**/\");\n  const recursivePrefix = needsRecursivePrefix ? \"**/\" : \"\";\n  return `${recursivePrefix}${trimmedPattern}/**`;\n};\nvar getParentDirectoryPrefix = (pattern) => {\n  const normalizedPattern = isNegativePattern(pattern) ? pattern.slice(1) : pattern;\n  const match = normalizedPattern.match(/^(\\.\\.\\/)+/);\n  return match ? match[0] : \"\";\n};\nvar adjustIgnorePatternsForParentDirectories = (patterns, ignorePatterns) => {\n  if (patterns.length === 0 || ignorePatterns.length === 0) {\n    return ignorePatterns;\n  }\n  const parentPrefixes = patterns.map((pattern) => getParentDirectoryPrefix(pattern));\n  const firstPrefix = parentPrefixes[0];\n  if (!firstPrefix) {\n    return ignorePatterns;\n  }\n  const allSamePrefix = parentPrefixes.every((prefix) => prefix === firstPrefix);\n  if (!allSamePrefix) {\n    return ignorePatterns;\n  }\n  return ignorePatterns.map((pattern) => {\n    if (pattern.startsWith(\"**/\") && !pattern.startsWith(\"../\")) {\n      return firstPrefix + pattern;\n    }\n    return pattern;\n  });\n};\nvar getAsyncStatMethod = (fsImplementation) => {\n  var _a2;\n  return (_a2 = bindFsMethod(fsImplementation == null ? void 0 : fsImplementation.promises, \"stat\")) != null ? _a2 : bindFsMethod(import_node_fs.default.promises, \"stat\");\n};\nvar getStatSyncMethod = (fsImplementation) => {\n  if (fsImplementation) {\n    return bindFsMethod(fsImplementation, \"statSync\");\n  }\n  return bindFsMethod(import_node_fs.default, \"statSync\");\n};\nvar pathHasGitDirectory = (stats) => {\n  var _a2, _b2;\n  return Boolean(((_a2 = stats == null ? void 0 : stats.isDirectory) == null ? void 0 : _a2.call(stats)) || ((_b2 = stats == null ? void 0 : stats.isFile) == null ? void 0 : _b2.call(stats)));\n};\nvar buildPathChain = (startPath, rootPath) => {\n  const chain = [];\n  let currentPath = startPath;\n  chain.push(currentPath);\n  while (currentPath !== rootPath) {\n    const parentPath = import_node_path2.default.dirname(currentPath);\n    if (parentPath === currentPath) {\n      break;\n    }\n    currentPath = parentPath;\n    chain.push(currentPath);\n  }\n  return chain;\n};\nvar findGitRootInChain = (paths, statMethod) => __async(null, null, function* () {\n  for (const directory of paths) {\n    const gitPath = import_node_path2.default.join(directory, \".git\");\n    try {\n      const stats = yield statMethod(gitPath);\n      if (pathHasGitDirectory(stats)) {\n        return directory;\n      }\n    } catch (e) {\n    }\n  }\n  return void 0;\n});\nvar findGitRootSyncUncached = (cwd, fsImplementation) => {\n  const statSyncMethod = getStatSyncMethod(fsImplementation);\n  if (!statSyncMethod) {\n    return void 0;\n  }\n  const currentPath = import_node_path2.default.resolve(cwd);\n  const { root } = import_node_path2.default.parse(currentPath);\n  const chain = buildPathChain(currentPath, root);\n  for (const directory of chain) {\n    const gitPath = import_node_path2.default.join(directory, \".git\");\n    try {\n      const stats = statSyncMethod(gitPath);\n      if (pathHasGitDirectory(stats)) {\n        return directory;\n      }\n    } catch (e) {\n    }\n  }\n  return void 0;\n};\nvar findGitRootSync = (cwd, fsImplementation) => {\n  if (typeof cwd !== \"string\") {\n    throw new TypeError(\"cwd must be a string\");\n  }\n  return findGitRootSyncUncached(cwd, fsImplementation);\n};\nvar findGitRootAsyncUncached = (cwd, fsImplementation) => __async(null, null, function* () {\n  const statMethod = getAsyncStatMethod(fsImplementation);\n  if (!statMethod) {\n    return findGitRootSync(cwd, fsImplementation);\n  }\n  const currentPath = import_node_path2.default.resolve(cwd);\n  const { root } = import_node_path2.default.parse(currentPath);\n  const chain = buildPathChain(currentPath, root);\n  return findGitRootInChain(chain, statMethod);\n});\nvar findGitRoot = (cwd, fsImplementation) => __async(null, null, function* () {\n  if (typeof cwd !== \"string\") {\n    throw new TypeError(\"cwd must be a string\");\n  }\n  return findGitRootAsyncUncached(cwd, fsImplementation);\n});\nvar isWithinGitRoot = (gitRoot, cwd) => {\n  const resolvedGitRoot = import_node_path2.default.resolve(gitRoot);\n  const resolvedCwd = import_node_path2.default.resolve(cwd);\n  return resolvedCwd === resolvedGitRoot || isPathInside(resolvedCwd, resolvedGitRoot);\n};\nvar getParentGitignorePaths = (gitRoot, cwd) => {\n  if (gitRoot && typeof gitRoot !== \"string\") {\n    throw new TypeError(\"gitRoot must be a string or undefined\");\n  }\n  if (typeof cwd !== \"string\") {\n    throw new TypeError(\"cwd must be a string\");\n  }\n  if (!gitRoot) {\n    return [];\n  }\n  if (!isWithinGitRoot(gitRoot, cwd)) {\n    return [];\n  }\n  const chain = buildPathChain(import_node_path2.default.resolve(cwd), import_node_path2.default.resolve(gitRoot));\n  return [...chain].reverse().map((directory) => import_node_path2.default.join(directory, \".gitignore\"));\n};\nvar convertPatternsForFastGlob = (patterns, usingGitRoot, normalizeDirectoryPatternForFastGlob2) => {\n  if (usingGitRoot) {\n    return [];\n  }\n  const result = [];\n  let hasNegations = false;\n  for (const pattern of patterns) {\n    if (isNegativePattern(pattern)) {\n      hasNegations = true;\n      break;\n    }\n    result.push(normalizeDirectoryPatternForFastGlob2(pattern));\n  }\n  return hasNegations ? [] : result;\n};\n\n// node_modules/globby/ignore.js\nvar defaultIgnoredDirectories = [\n  \"**/node_modules\",\n  \"**/flow-typed\",\n  \"**/coverage\",\n  \"**/.git\"\n];\nvar ignoreFilesGlobOptions = {\n  absolute: true,\n  dot: true\n};\nvar GITIGNORE_FILES_PATTERN = \"**/.gitignore\";\nvar getReadFileMethod = (fsImplementation) => {\n  var _a2, _b2;\n  return (_b2 = (_a2 = bindFsMethod(fsImplementation == null ? void 0 : fsImplementation.promises, \"readFile\")) != null ? _a2 : bindFsMethod(import_promises2.default, \"readFile\")) != null ? _b2 : promisifyFsMethod(fsImplementation, \"readFile\");\n};\nvar getReadFileSyncMethod = (fsImplementation) => {\n  var _a2;\n  return (_a2 = bindFsMethod(fsImplementation, \"readFileSync\")) != null ? _a2 : bindFsMethod(import_node_fs2.default, \"readFileSync\");\n};\nvar shouldSkipIgnoreFileError = (error, suppressErrors) => {\n  if (!error) {\n    return Boolean(suppressErrors);\n  }\n  if (error.code === \"ENOENT\" || error.code === \"ENOTDIR\") {\n    return true;\n  }\n  return Boolean(suppressErrors);\n};\nvar createIgnoreFileReadError = (filePath, error) => {\n  if (error instanceof Error) {\n    error.message = `Failed to read ignore file at ${filePath}: ${error.message}`;\n    return error;\n  }\n  return new Error(`Failed to read ignore file at ${filePath}: ${String(error)}`);\n};\nvar processIgnoreFileCore = (filePath, readMethod, suppressErrors) => {\n  try {\n    const content = readMethod(filePath, \"utf8\");\n    return { filePath, content };\n  } catch (error) {\n    if (shouldSkipIgnoreFileError(error, suppressErrors)) {\n      return void 0;\n    }\n    throw createIgnoreFileReadError(filePath, error);\n  }\n};\nvar readIgnoreFilesSafely = (paths, readFileMethod, suppressErrors) => __async(null, null, function* () {\n  const fileResults = yield Promise.all(paths.map((filePath) => __async(null, null, function* () {\n    try {\n      const content = yield readFileMethod(filePath, \"utf8\");\n      return { filePath, content };\n    } catch (error) {\n      if (shouldSkipIgnoreFileError(error, suppressErrors)) {\n        return void 0;\n      }\n      throw createIgnoreFileReadError(filePath, error);\n    }\n  })));\n  return fileResults.filter(Boolean);\n});\nvar readIgnoreFilesSafelySync = (paths, readFileSyncMethod, suppressErrors) => paths.map((filePath) => processIgnoreFileCore(filePath, readFileSyncMethod, suppressErrors)).filter(Boolean);\nvar dedupePaths = (paths) => {\n  const seen = /* @__PURE__ */ new Set();\n  return paths.filter((filePath) => {\n    if (seen.has(filePath)) {\n      return false;\n    }\n    seen.add(filePath);\n    return true;\n  });\n};\nvar globIgnoreFiles = (globFunction, patterns, normalizedOptions) => globFunction(patterns, __spreadValues(__spreadValues({}, normalizedOptions), ignoreFilesGlobOptions));\nvar getParentIgnorePaths = (gitRoot, normalizedOptions) => gitRoot ? getParentGitignorePaths(gitRoot, normalizedOptions.cwd) : [];\nvar combineIgnoreFilePaths = (gitRoot, normalizedOptions, childPaths) => dedupePaths([\n  ...getParentIgnorePaths(gitRoot, normalizedOptions),\n  ...childPaths\n]);\nvar buildIgnoreResult = (files, normalizedOptions, gitRoot) => {\n  const baseDir = gitRoot || normalizedOptions.cwd;\n  const patterns = getPatternsFromIgnoreFiles(files, baseDir);\n  return {\n    patterns,\n    predicate: createIgnorePredicate(patterns, normalizedOptions.cwd, baseDir),\n    usingGitRoot: Boolean(gitRoot && gitRoot !== normalizedOptions.cwd)\n  };\n};\nvar applyBaseToPattern = (pattern, base) => {\n  if (!base) {\n    return pattern;\n  }\n  const isNegative = isNegativePattern(pattern);\n  const cleanPattern = isNegative ? pattern.slice(1) : pattern;\n  const slashIndex = cleanPattern.indexOf(\"/\");\n  const hasNonTrailingSlash = slashIndex !== -1 && slashIndex !== cleanPattern.length - 1;\n  let result;\n  if (!hasNonTrailingSlash) {\n    result = import_node_path3.default.posix.join(base, \"**\", cleanPattern);\n  } else if (cleanPattern.startsWith(\"/\")) {\n    result = import_node_path3.default.posix.join(base, cleanPattern.slice(1));\n  } else {\n    result = import_node_path3.default.posix.join(base, cleanPattern);\n  }\n  return isNegative ? \"!\" + result : result;\n};\nvar parseIgnoreFile = (file, cwd) => {\n  const base = slash(import_node_path3.default.relative(cwd, import_node_path3.default.dirname(file.filePath)));\n  return file.content.split(/\\r?\\n/).filter((line) => line && !line.startsWith(\"#\")).map((pattern) => applyBaseToPattern(pattern, base));\n};\nvar toRelativePath = (fileOrDirectory, cwd) => {\n  if (import_node_path3.default.isAbsolute(fileOrDirectory)) {\n    const relativePath = import_node_path3.default.relative(cwd, fileOrDirectory);\n    if (relativePath && !isPathInside(fileOrDirectory, cwd)) {\n      return void 0;\n    }\n    return relativePath;\n  }\n  if (fileOrDirectory.startsWith(\"./\")) {\n    return fileOrDirectory.slice(2);\n  }\n  if (fileOrDirectory.startsWith(\"../\")) {\n    return void 0;\n  }\n  return fileOrDirectory;\n};\nvar createIgnorePredicate = (patterns, cwd, baseDir) => {\n  const ignores = (0, import_ignore.default)().add(patterns);\n  const resolvedCwd = import_node_path3.default.normalize(import_node_path3.default.resolve(cwd));\n  const resolvedBaseDir = import_node_path3.default.normalize(import_node_path3.default.resolve(baseDir));\n  return (fileOrDirectory) => {\n    fileOrDirectory = toPath(fileOrDirectory);\n    const normalizedPath = import_node_path3.default.normalize(import_node_path3.default.resolve(fileOrDirectory));\n    if (normalizedPath === resolvedCwd) {\n      return false;\n    }\n    const relativePath = toRelativePath(fileOrDirectory, resolvedBaseDir);\n    if (relativePath === void 0) {\n      return false;\n    }\n    return relativePath ? ignores.ignores(slash(relativePath)) : false;\n  };\n};\nvar normalizeOptions = (options = {}) => {\n  var _a2, _b2, _c, _d;\n  const ignoreOption = options.ignore ? Array.isArray(options.ignore) ? options.ignore : [options.ignore] : [];\n  const cwd = (_a2 = toPath(options.cwd)) != null ? _a2 : import_node_process.default.cwd();\n  const deep = typeof options.deep === \"number\" ? Math.max(0, options.deep) + 1 : Number.POSITIVE_INFINITY;\n  return {\n    cwd,\n    suppressErrors: (_b2 = options.suppressErrors) != null ? _b2 : false,\n    deep,\n    ignore: [...ignoreOption, ...defaultIgnoredDirectories],\n    followSymbolicLinks: (_c = options.followSymbolicLinks) != null ? _c : true,\n    concurrency: options.concurrency,\n    throwErrorOnBrokenSymbolicLink: (_d = options.throwErrorOnBrokenSymbolicLink) != null ? _d : false,\n    fs: options.fs\n  };\n};\nvar collectIgnoreFileArtifactsAsync = (patterns, options, includeParentIgnoreFiles) => __async(null, null, function* () {\n  const normalizedOptions = normalizeOptions(options);\n  const childPaths = yield globIgnoreFiles(import_fast_glob2.default, patterns, normalizedOptions);\n  const gitRoot = includeParentIgnoreFiles ? yield findGitRoot(normalizedOptions.cwd, normalizedOptions.fs) : void 0;\n  const allPaths = combineIgnoreFilePaths(gitRoot, normalizedOptions, childPaths);\n  const readFileMethod = getReadFileMethod(normalizedOptions.fs);\n  const files = yield readIgnoreFilesSafely(allPaths, readFileMethod, normalizedOptions.suppressErrors);\n  return { files, normalizedOptions, gitRoot };\n});\nvar collectIgnoreFileArtifactsSync = (patterns, options, includeParentIgnoreFiles) => {\n  const normalizedOptions = normalizeOptions(options);\n  const childPaths = globIgnoreFiles(import_fast_glob2.default.sync, patterns, normalizedOptions);\n  const gitRoot = includeParentIgnoreFiles ? findGitRootSync(normalizedOptions.cwd, normalizedOptions.fs) : void 0;\n  const allPaths = combineIgnoreFilePaths(gitRoot, normalizedOptions, childPaths);\n  const readFileSyncMethod = getReadFileSyncMethod(normalizedOptions.fs);\n  const files = readIgnoreFilesSafelySync(allPaths, readFileSyncMethod, normalizedOptions.suppressErrors);\n  return { files, normalizedOptions, gitRoot };\n};\nvar isIgnoredByIgnoreFiles = (patterns, options) => __async(null, null, function* () {\n  const { files, normalizedOptions, gitRoot } = yield collectIgnoreFileArtifactsAsync(patterns, options, false);\n  return buildIgnoreResult(files, normalizedOptions, gitRoot).predicate;\n});\nvar isIgnoredByIgnoreFilesSync = (patterns, options) => {\n  const { files, normalizedOptions, gitRoot } = collectIgnoreFileArtifactsSync(patterns, options, false);\n  return buildIgnoreResult(files, normalizedOptions, gitRoot).predicate;\n};\nvar getPatternsFromIgnoreFiles = (files, baseDir) => files.flatMap((file) => parseIgnoreFile(file, baseDir));\nvar getIgnorePatternsAndPredicate = (patterns, options, includeParentIgnoreFiles = false) => __async(null, null, function* () {\n  const { files, normalizedOptions, gitRoot } = yield collectIgnoreFileArtifactsAsync(\n    patterns,\n    options,\n    includeParentIgnoreFiles\n  );\n  return buildIgnoreResult(files, normalizedOptions, gitRoot);\n});\nvar getIgnorePatternsAndPredicateSync = (patterns, options, includeParentIgnoreFiles = false) => {\n  const { files, normalizedOptions, gitRoot } = collectIgnoreFileArtifactsSync(\n    patterns,\n    options,\n    includeParentIgnoreFiles\n  );\n  return buildIgnoreResult(files, normalizedOptions, gitRoot);\n};\nvar isGitIgnored = (options) => isIgnoredByIgnoreFiles(GITIGNORE_FILES_PATTERN, options);\nvar isGitIgnoredSync = (options) => isIgnoredByIgnoreFilesSync(GITIGNORE_FILES_PATTERN, options);\n\n// node_modules/globby/index.js\nvar assertPatternsInput = (patterns) => {\n  if (patterns.some((pattern) => typeof pattern !== \"string\")) {\n    throw new TypeError(\"Patterns must be a string or an array of strings\");\n  }\n};\nvar getStatMethod = (fsImplementation) => {\n  var _a2, _b2;\n  return (_b2 = (_a2 = bindFsMethod(fsImplementation == null ? void 0 : fsImplementation.promises, \"stat\")) != null ? _a2 : bindFsMethod(import_node_fs3.default.promises, \"stat\")) != null ? _b2 : promisifyFsMethod(fsImplementation, \"stat\");\n};\nvar getStatSyncMethod2 = (fsImplementation) => {\n  var _a2;\n  return (_a2 = bindFsMethod(fsImplementation, \"statSync\")) != null ? _a2 : bindFsMethod(import_node_fs3.default, \"statSync\");\n};\nvar isDirectory = (path5, fsImplementation) => __async(null, null, function* () {\n  try {\n    const stats = yield getStatMethod(fsImplementation)(path5);\n    return stats.isDirectory();\n  } catch (e) {\n    return false;\n  }\n});\nvar isDirectorySync = (path5, fsImplementation) => {\n  try {\n    const stats = getStatSyncMethod2(fsImplementation)(path5);\n    return stats.isDirectory();\n  } catch (e) {\n    return false;\n  }\n};\nvar normalizePathForDirectoryGlob = (filePath, cwd) => {\n  const path5 = isNegativePattern(filePath) ? filePath.slice(1) : filePath;\n  return import_node_path4.default.isAbsolute(path5) ? path5 : import_node_path4.default.join(cwd, path5);\n};\nvar shouldExpandGlobstarDirectory = (pattern) => {\n  const match = pattern == null ? void 0 : pattern.match(/\\*\\*\\/([^/]+)$/);\n  if (!match) {\n    return false;\n  }\n  const dirname = match[1];\n  const hasWildcards = /[*?[\\]{}]/.test(dirname);\n  const hasExtension = import_node_path4.default.extname(dirname) && !dirname.startsWith(\".\");\n  return !hasWildcards && !hasExtension;\n};\nvar getDirectoryGlob = ({ directoryPath, files, extensions }) => {\n  const extensionGlob = (extensions == null ? void 0 : extensions.length) > 0 ? `.${extensions.length > 1 ? `{${extensions.join(\",\")}}` : extensions[0]}` : \"\";\n  return files ? files.map((file) => import_node_path4.default.posix.join(directoryPath, `**/${import_node_path4.default.extname(file) ? file : `${file}${extensionGlob}`}`)) : [import_node_path4.default.posix.join(directoryPath, `**${extensionGlob ? `/*${extensionGlob}` : \"\"}`)];\n};\nvar directoryToGlob = (_0, ..._1) => __async(null, [_0, ..._1], function* (directoryPaths, {\n  cwd = import_node_process2.default.cwd(),\n  files,\n  extensions,\n  fs: fsImplementation\n} = {}) {\n  const globs = yield Promise.all(directoryPaths.map((directoryPath) => __async(null, null, function* () {\n    const checkPattern = isNegativePattern(directoryPath) ? directoryPath.slice(1) : directoryPath;\n    if (shouldExpandGlobstarDirectory(checkPattern)) {\n      return getDirectoryGlob({ directoryPath, files, extensions });\n    }\n    const pathToCheck = normalizePathForDirectoryGlob(directoryPath, cwd);\n    return (yield isDirectory(pathToCheck, fsImplementation)) ? getDirectoryGlob({ directoryPath, files, extensions }) : directoryPath;\n  })));\n  return globs.flat();\n});\nvar directoryToGlobSync = (directoryPaths, {\n  cwd = import_node_process2.default.cwd(),\n  files,\n  extensions,\n  fs: fsImplementation\n} = {}) => directoryPaths.flatMap((directoryPath) => {\n  const checkPattern = isNegativePattern(directoryPath) ? directoryPath.slice(1) : directoryPath;\n  if (shouldExpandGlobstarDirectory(checkPattern)) {\n    return getDirectoryGlob({ directoryPath, files, extensions });\n  }\n  const pathToCheck = normalizePathForDirectoryGlob(directoryPath, cwd);\n  return isDirectorySync(pathToCheck, fsImplementation) ? getDirectoryGlob({ directoryPath, files, extensions }) : directoryPath;\n});\nvar toPatternsArray = (patterns) => {\n  patterns = [...new Set([patterns].flat())];\n  assertPatternsInput(patterns);\n  return patterns;\n};\nvar checkCwdOption = (cwd, fsImplementation = import_node_fs3.default) => {\n  if (!cwd || !fsImplementation.statSync) {\n    return;\n  }\n  let stats;\n  try {\n    stats = fsImplementation.statSync(cwd);\n  } catch (e) {\n    return;\n  }\n  if (!stats.isDirectory()) {\n    throw new Error(`The \\`cwd\\` option must be a path to a directory, got: ${cwd}`);\n  }\n};\nvar normalizeOptions2 = (options = {}) => {\n  var _a2;\n  const ignore = options.ignore ? Array.isArray(options.ignore) ? options.ignore : [options.ignore] : [];\n  options = __spreadProps(__spreadValues({}, options), {\n    ignore,\n    expandDirectories: (_a2 = options.expandDirectories) != null ? _a2 : true,\n    cwd: toPath(options.cwd)\n  });\n  checkCwdOption(options.cwd, options.fs);\n  return options;\n};\nvar normalizeArguments = (function_) => (patterns, options) => __async(null, null, function* () {\n  return function_(toPatternsArray(patterns), normalizeOptions2(options));\n});\nvar normalizeArgumentsSync = (function_) => (patterns, options) => function_(toPatternsArray(patterns), normalizeOptions2(options));\nvar getIgnoreFilesPatterns = (options) => {\n  const { ignoreFiles, gitignore } = options;\n  const patterns = ignoreFiles ? toPatternsArray(ignoreFiles) : [];\n  if (gitignore) {\n    patterns.push(GITIGNORE_FILES_PATTERN);\n  }\n  return patterns;\n};\nvar applyIgnoreFilesAndGetFilter = (options) => __async(null, null, function* () {\n  const ignoreFilesPatterns = getIgnoreFilesPatterns(options);\n  if (ignoreFilesPatterns.length === 0) {\n    return {\n      options,\n      filter: createFilterFunction(false, options.cwd)\n    };\n  }\n  const includeParentIgnoreFiles = options.gitignore === true;\n  const { patterns, predicate, usingGitRoot } = yield getIgnorePatternsAndPredicate(ignoreFilesPatterns, options, includeParentIgnoreFiles);\n  const patternsForFastGlob = convertPatternsForFastGlob(patterns, usingGitRoot, normalizeDirectoryPatternForFastGlob);\n  const modifiedOptions = __spreadProps(__spreadValues({}, options), {\n    ignore: [...options.ignore, ...patternsForFastGlob]\n  });\n  return {\n    options: modifiedOptions,\n    filter: createFilterFunction(predicate, options.cwd)\n  };\n});\nvar applyIgnoreFilesAndGetFilterSync = (options) => {\n  const ignoreFilesPatterns = getIgnoreFilesPatterns(options);\n  if (ignoreFilesPatterns.length === 0) {\n    return {\n      options,\n      filter: createFilterFunction(false, options.cwd)\n    };\n  }\n  const includeParentIgnoreFiles = options.gitignore === true;\n  const { patterns, predicate, usingGitRoot } = getIgnorePatternsAndPredicateSync(ignoreFilesPatterns, options, includeParentIgnoreFiles);\n  const patternsForFastGlob = convertPatternsForFastGlob(patterns, usingGitRoot, normalizeDirectoryPatternForFastGlob);\n  const modifiedOptions = __spreadProps(__spreadValues({}, options), {\n    ignore: [...options.ignore, ...patternsForFastGlob]\n  });\n  return {\n    options: modifiedOptions,\n    filter: createFilterFunction(predicate, options.cwd)\n  };\n};\nvar createFilterFunction = (isIgnored, cwd) => {\n  const seen = /* @__PURE__ */ new Set();\n  const basePath = cwd || import_node_process2.default.cwd();\n  const pathCache = /* @__PURE__ */ new Map();\n  return (fastGlobResult) => {\n    var _a2;\n    const pathKey = import_node_path4.default.normalize((_a2 = fastGlobResult.path) != null ? _a2 : fastGlobResult);\n    if (seen.has(pathKey)) {\n      return false;\n    }\n    if (isIgnored) {\n      let absolutePath = pathCache.get(pathKey);\n      if (absolutePath === void 0) {\n        absolutePath = import_node_path4.default.isAbsolute(pathKey) ? pathKey : import_node_path4.default.resolve(basePath, pathKey);\n        pathCache.set(pathKey, absolutePath);\n        if (pathCache.size > 1e4) {\n          pathCache.clear();\n        }\n      }\n      if (isIgnored(absolutePath)) {\n        return false;\n      }\n    }\n    seen.add(pathKey);\n    return true;\n  };\n};\nvar unionFastGlobResults = (results, filter) => results.flat().filter((fastGlobResult) => filter(fastGlobResult));\nvar convertNegativePatterns = (patterns, options) => {\n  if (patterns.length > 0 && patterns.every((pattern) => isNegativePattern(pattern))) {\n    if (options.expandNegationOnlyPatterns === false) {\n      return [];\n    }\n    patterns = [\"**/*\", ...patterns];\n  }\n  const positiveAbsolutePathPrefixes = [];\n  let hasRelativePositivePattern = false;\n  const normalizedPatterns = [];\n  for (const pattern of patterns) {\n    if (isNegativePattern(pattern)) {\n      normalizedPatterns.push(`!${normalizeNegativePattern(pattern.slice(1), positiveAbsolutePathPrefixes, hasRelativePositivePattern)}`);\n      continue;\n    }\n    normalizedPatterns.push(pattern);\n    const staticAbsolutePathPrefix = getStaticAbsolutePathPrefix(pattern);\n    if (staticAbsolutePathPrefix === void 0) {\n      hasRelativePositivePattern = true;\n      continue;\n    }\n    positiveAbsolutePathPrefixes.push(staticAbsolutePathPrefix);\n  }\n  patterns = normalizedPatterns;\n  const tasks = [];\n  while (patterns.length > 0) {\n    const index = patterns.findIndex((pattern) => isNegativePattern(pattern));\n    if (index === -1) {\n      tasks.push({ patterns, options });\n      break;\n    }\n    const ignorePattern = patterns[index].slice(1);\n    for (const task of tasks) {\n      task.options.ignore.push(ignorePattern);\n    }\n    if (index !== 0) {\n      tasks.push({\n        patterns: patterns.slice(0, index),\n        options: __spreadProps(__spreadValues({}, options), {\n          ignore: [\n            ...options.ignore,\n            ignorePattern\n          ]\n        })\n      });\n    }\n    patterns = patterns.slice(index + 1);\n  }\n  return tasks;\n};\nvar applyParentDirectoryIgnoreAdjustments = (tasks) => tasks.map((task) => ({\n  patterns: task.patterns,\n  options: __spreadProps(__spreadValues({}, task.options), {\n    ignore: adjustIgnorePatternsForParentDirectories(task.patterns, task.options.ignore)\n  })\n}));\nvar normalizeExpandDirectoriesOption = (options, cwd) => __spreadValues(__spreadValues({}, cwd ? { cwd } : {}), Array.isArray(options) ? { files: options } : options);\nvar generateTasks = (patterns, options) => __async(null, null, function* () {\n  const globTasks = convertNegativePatterns(patterns, options);\n  const { cwd, expandDirectories, fs: fsImplementation } = options;\n  if (!expandDirectories) {\n    return applyParentDirectoryIgnoreAdjustments(globTasks);\n  }\n  const directoryToGlobOptions = __spreadProps(__spreadValues({}, normalizeExpandDirectoriesOption(expandDirectories, cwd)), {\n    fs: fsImplementation\n  });\n  return Promise.all(globTasks.map((task) => __async(null, null, function* () {\n    let { patterns: patterns2, options: options2 } = task;\n    [\n      patterns2,\n      options2.ignore\n    ] = yield Promise.all([\n      directoryToGlob(patterns2, directoryToGlobOptions),\n      directoryToGlob(options2.ignore, { cwd, fs: fsImplementation })\n    ]);\n    options2.ignore = adjustIgnorePatternsForParentDirectories(patterns2, options2.ignore);\n    return { patterns: patterns2, options: options2 };\n  })));\n});\nvar generateTasksSync = (patterns, options) => {\n  const globTasks = convertNegativePatterns(patterns, options);\n  const { cwd, expandDirectories, fs: fsImplementation } = options;\n  if (!expandDirectories) {\n    return applyParentDirectoryIgnoreAdjustments(globTasks);\n  }\n  const directoryToGlobSyncOptions = __spreadProps(__spreadValues({}, normalizeExpandDirectoriesOption(expandDirectories, cwd)), {\n    fs: fsImplementation\n  });\n  return globTasks.map((task) => {\n    let { patterns: patterns2, options: options2 } = task;\n    patterns2 = directoryToGlobSync(patterns2, directoryToGlobSyncOptions);\n    options2.ignore = directoryToGlobSync(options2.ignore, { cwd, fs: fsImplementation });\n    options2.ignore = adjustIgnorePatternsForParentDirectories(patterns2, options2.ignore);\n    return { patterns: patterns2, options: options2 };\n  });\n};\nvar globby = normalizeArguments((patterns, options) => __async(null, null, function* () {\n  const { options: modifiedOptions, filter } = yield applyIgnoreFilesAndGetFilter(options);\n  const tasks = yield generateTasks(patterns, modifiedOptions);\n  const results = yield Promise.all(tasks.map((task) => (0, import_fast_glob3.default)(task.patterns, task.options)));\n  return unionFastGlobResults(results, filter);\n}));\nvar globbySync = normalizeArgumentsSync((patterns, options) => {\n  const { options: modifiedOptions, filter } = applyIgnoreFilesAndGetFilterSync(options);\n  const tasks = generateTasksSync(patterns, modifiedOptions);\n  const results = tasks.map((task) => import_fast_glob3.default.sync(task.patterns, task.options));\n  return unionFastGlobResults(results, filter);\n});\nvar globbyStream = normalizeArgumentsSync((patterns, options) => {\n  const { options: modifiedOptions, filter } = applyIgnoreFilesAndGetFilterSync(options);\n  const tasks = generateTasksSync(patterns, modifiedOptions);\n  const streams = tasks.map((task) => import_fast_glob3.default.stream(task.patterns, task.options));\n  if (streams.length === 0) {\n    return import_node_stream2.Readable.from([]);\n  }\n  const stream = mergeStreams(streams).filter((fastGlobResult) => filter(fastGlobResult));\n  return stream;\n});\nvar isDynamicPattern = normalizeArgumentsSync((patterns, options) => patterns.some((pattern) => import_fast_glob3.default.isDynamicPattern(pattern, options)));\nvar generateGlobTasks = normalizeArguments(generateTasks);\nvar generateGlobTasksSync = normalizeArgumentsSync(generateTasksSync);\nvar { convertPathToPattern } = import_fast_glob3.default;\n\n// node_modules/yaml/browser/index.js\nvar browser_exports = {};\n__export(browser_exports, {\n  Alias: () => Alias,\n  CST: () => cst_exports,\n  Composer: () => Composer,\n  Document: () => Document,\n  Lexer: () => Lexer,\n  LineCounter: () => LineCounter,\n  Pair: () => Pair,\n  Parser: () => Parser,\n  Scalar: () => Scalar,\n  Schema: () => Schema,\n  YAMLError: () => YAMLError,\n  YAMLMap: () => YAMLMap,\n  YAMLParseError: () => YAMLParseError,\n  YAMLSeq: () => YAMLSeq,\n  YAMLWarning: () => YAMLWarning,\n  default: () => browser_default,\n  isAlias: () => isAlias,\n  isCollection: () => isCollection,\n  isDocument: () => isDocument,\n  isMap: () => isMap,\n  isNode: () => isNode,\n  isPair: () => isPair,\n  isScalar: () => isScalar,\n  isSeq: () => isSeq,\n  parse: () => parse,\n  parseAllDocuments: () => parseAllDocuments,\n  parseDocument: () => parseDocument,\n  stringify: () => stringify3,\n  visit: () => visit,\n  visitAsync: () => visitAsync\n});\n\n// node_modules/yaml/browser/dist/index.js\nvar dist_exports = {};\n__export(dist_exports, {\n  Alias: () => Alias,\n  CST: () => cst_exports,\n  Composer: () => Composer,\n  Document: () => Document,\n  Lexer: () => Lexer,\n  LineCounter: () => LineCounter,\n  Pair: () => Pair,\n  Parser: () => Parser,\n  Scalar: () => Scalar,\n  Schema: () => Schema,\n  YAMLError: () => YAMLError,\n  YAMLMap: () => YAMLMap,\n  YAMLParseError: () => YAMLParseError,\n  YAMLSeq: () => YAMLSeq,\n  YAMLWarning: () => YAMLWarning,\n  isAlias: () => isAlias,\n  isCollection: () => isCollection,\n  isDocument: () => isDocument,\n  isMap: () => isMap,\n  isNode: () => isNode,\n  isPair: () => isPair,\n  isScalar: () => isScalar,\n  isSeq: () => isSeq,\n  parse: () => parse,\n  parseAllDocuments: () => parseAllDocuments,\n  parseDocument: () => parseDocument,\n  stringify: () => stringify3,\n  visit: () => visit,\n  visitAsync: () => visitAsync\n});\n\n// node_modules/yaml/browser/dist/nodes/identity.js\nvar ALIAS = /* @__PURE__ */ Symbol.for(\"yaml.alias\");\nvar DOC = /* @__PURE__ */ Symbol.for(\"yaml.document\");\nvar MAP = /* @__PURE__ */ Symbol.for(\"yaml.map\");\nvar PAIR = /* @__PURE__ */ Symbol.for(\"yaml.pair\");\nvar SCALAR = /* @__PURE__ */ Symbol.for(\"yaml.scalar\");\nvar SEQ = /* @__PURE__ */ Symbol.for(\"yaml.seq\");\nvar NODE_TYPE = /* @__PURE__ */ Symbol.for(\"yaml.node.type\");\nvar isAlias = (node) => !!node && typeof node === \"object\" && node[NODE_TYPE] === ALIAS;\nvar isDocument = (node) => !!node && typeof node === \"object\" && node[NODE_TYPE] === DOC;\nvar isMap = (node) => !!node && typeof node === \"object\" && node[NODE_TYPE] === MAP;\nvar isPair = (node) => !!node && typeof node === \"object\" && node[NODE_TYPE] === PAIR;\nvar isScalar = (node) => !!node && typeof node === \"object\" && node[NODE_TYPE] === SCALAR;\nvar isSeq = (node) => !!node && typeof node === \"object\" && node[NODE_TYPE] === SEQ;\nfunction isCollection(node) {\n  if (node && typeof node === \"object\")\n    switch (node[NODE_TYPE]) {\n      case MAP:\n      case SEQ:\n        return true;\n    }\n  return false;\n}\nfunction isNode(node) {\n  if (node && typeof node === \"object\")\n    switch (node[NODE_TYPE]) {\n      case ALIAS:\n      case MAP:\n      case SCALAR:\n      case SEQ:\n        return true;\n    }\n  return false;\n}\nvar hasAnchor = (node) => (isScalar(node) || isCollection(node)) && !!node.anchor;\n\n// node_modules/yaml/browser/dist/visit.js\nvar BREAK = /* @__PURE__ */ Symbol(\"break visit\");\nvar SKIP = /* @__PURE__ */ Symbol(\"skip children\");\nvar REMOVE = /* @__PURE__ */ Symbol(\"remove node\");\nfunction visit(node, visitor) {\n  const visitor_ = initVisitor(visitor);\n  if (isDocument(node)) {\n    const cd = visit_(null, node.contents, visitor_, Object.freeze([node]));\n    if (cd === REMOVE)\n      node.contents = null;\n  } else\n    visit_(null, node, visitor_, Object.freeze([]));\n}\nvisit.BREAK = BREAK;\nvisit.SKIP = SKIP;\nvisit.REMOVE = REMOVE;\nfunction visit_(key, node, visitor, path5) {\n  const ctrl = callVisitor(key, node, visitor, path5);\n  if (isNode(ctrl) || isPair(ctrl)) {\n    replaceNode(key, path5, ctrl);\n    return visit_(key, ctrl, visitor, path5);\n  }\n  if (typeof ctrl !== \"symbol\") {\n    if (isCollection(node)) {\n      path5 = Object.freeze(path5.concat(node));\n      for (let i = 0; i < node.items.length; ++i) {\n        const ci2 = visit_(i, node.items[i], visitor, path5);\n        if (typeof ci2 === \"number\")\n          i = ci2 - 1;\n        else if (ci2 === BREAK)\n          return BREAK;\n        else if (ci2 === REMOVE) {\n          node.items.splice(i, 1);\n          i -= 1;\n        }\n      }\n    } else if (isPair(node)) {\n      path5 = Object.freeze(path5.concat(node));\n      const ck = visit_(\"key\", node.key, visitor, path5);\n      if (ck === BREAK)\n        return BREAK;\n      else if (ck === REMOVE)\n        node.key = null;\n      const cv = visit_(\"value\", node.value, visitor, path5);\n      if (cv === BREAK)\n        return BREAK;\n      else if (cv === REMOVE)\n        node.value = null;\n    }\n  }\n  return ctrl;\n}\nfunction visitAsync(node, visitor) {\n  return __async(this, null, function* () {\n    const visitor_ = initVisitor(visitor);\n    if (isDocument(node)) {\n      const cd = yield visitAsync_(null, node.contents, visitor_, Object.freeze([node]));\n      if (cd === REMOVE)\n        node.contents = null;\n    } else\n      yield visitAsync_(null, node, visitor_, Object.freeze([]));\n  });\n}\nvisitAsync.BREAK = BREAK;\nvisitAsync.SKIP = SKIP;\nvisitAsync.REMOVE = REMOVE;\nfunction visitAsync_(key, node, visitor, path5) {\n  return __async(this, null, function* () {\n    const ctrl = yield callVisitor(key, node, visitor, path5);\n    if (isNode(ctrl) || isPair(ctrl)) {\n      replaceNode(key, path5, ctrl);\n      return visitAsync_(key, ctrl, visitor, path5);\n    }\n    if (typeof ctrl !== \"symbol\") {\n      if (isCollection(node)) {\n        path5 = Object.freeze(path5.concat(node));\n        for (let i = 0; i < node.items.length; ++i) {\n          const ci2 = yield visitAsync_(i, node.items[i], visitor, path5);\n          if (typeof ci2 === \"number\")\n            i = ci2 - 1;\n          else if (ci2 === BREAK)\n            return BREAK;\n          else if (ci2 === REMOVE) {\n            node.items.splice(i, 1);\n            i -= 1;\n          }\n        }\n      } else if (isPair(node)) {\n        path5 = Object.freeze(path5.concat(node));\n        const ck = yield visitAsync_(\"key\", node.key, visitor, path5);\n        if (ck === BREAK)\n          return BREAK;\n        else if (ck === REMOVE)\n          node.key = null;\n        const cv = yield visitAsync_(\"value\", node.value, visitor, path5);\n        if (cv === BREAK)\n          return BREAK;\n        else if (cv === REMOVE)\n          node.value = null;\n      }\n    }\n    return ctrl;\n  });\n}\nfunction initVisitor(visitor) {\n  if (typeof visitor === \"object\" && (visitor.Collection || visitor.Node || visitor.Value)) {\n    return Object.assign({\n      Alias: visitor.Node,\n      Map: visitor.Node,\n      Scalar: visitor.Node,\n      Seq: visitor.Node\n    }, visitor.Value && {\n      Map: visitor.Value,\n      Scalar: visitor.Value,\n      Seq: visitor.Value\n    }, visitor.Collection && {\n      Map: visitor.Collection,\n      Seq: visitor.Collection\n    }, visitor);\n  }\n  return visitor;\n}\nfunction callVisitor(key, node, visitor, path5) {\n  var _a2, _b2, _c, _d, _e;\n  if (typeof visitor === \"function\")\n    return visitor(key, node, path5);\n  if (isMap(node))\n    return (_a2 = visitor.Map) == null ? void 0 : _a2.call(visitor, key, node, path5);\n  if (isSeq(node))\n    return (_b2 = visitor.Seq) == null ? void 0 : _b2.call(visitor, key, node, path5);\n  if (isPair(node))\n    return (_c = visitor.Pair) == null ? void 0 : _c.call(visitor, key, node, path5);\n  if (isScalar(node))\n    return (_d = visitor.Scalar) == null ? void 0 : _d.call(visitor, key, node, path5);\n  if (isAlias(node))\n    return (_e = visitor.Alias) == null ? void 0 : _e.call(visitor, key, node, path5);\n  return void 0;\n}\nfunction replaceNode(key, path5, node) {\n  const parent = path5[path5.length - 1];\n  if (isCollection(parent)) {\n    parent.items[key] = node;\n  } else if (isPair(parent)) {\n    if (key === \"key\")\n      parent.key = node;\n    else\n      parent.value = node;\n  } else if (isDocument(parent)) {\n    parent.contents = node;\n  } else {\n    const pt2 = isAlias(parent) ? \"alias\" : \"scalar\";\n    throw new Error(`Cannot replace node with ${pt2} parent`);\n  }\n}\n\n// node_modules/yaml/browser/dist/doc/directives.js\nvar escapeChars = {\n  \"!\": \"%21\",\n  \",\": \"%2C\",\n  \"[\": \"%5B\",\n  \"]\": \"%5D\",\n  \"{\": \"%7B\",\n  \"}\": \"%7D\"\n};\nvar escapeTagName = (tn) => tn.replace(/[!,[\\]{}]/g, (ch) => escapeChars[ch]);\nvar Directives = class _Directives {\n  constructor(yaml, tags) {\n    this.docStart = null;\n    this.docEnd = false;\n    this.yaml = Object.assign({}, _Directives.defaultYaml, yaml);\n    this.tags = Object.assign({}, _Directives.defaultTags, tags);\n  }\n  clone() {\n    const copy = new _Directives(this.yaml, this.tags);\n    copy.docStart = this.docStart;\n    return copy;\n  }\n  /**\n   * During parsing, get a Directives instance for the current document and\n   * update the stream state according to the current version's spec.\n   */\n  atDocument() {\n    const res = new _Directives(this.yaml, this.tags);\n    switch (this.yaml.version) {\n      case \"1.1\":\n        this.atNextDocument = true;\n        break;\n      case \"1.2\":\n        this.atNextDocument = false;\n        this.yaml = {\n          explicit: _Directives.defaultYaml.explicit,\n          version: \"1.2\"\n        };\n        this.tags = Object.assign({}, _Directives.defaultTags);\n        break;\n    }\n    return res;\n  }\n  /**\n   * @param onError - May be called even if the action was successful\n   * @returns `true` on success\n   */\n  add(line, onError) {\n    if (this.atNextDocument) {\n      this.yaml = { explicit: _Directives.defaultYaml.explicit, version: \"1.1\" };\n      this.tags = Object.assign({}, _Directives.defaultTags);\n      this.atNextDocument = false;\n    }\n    const parts = line.trim().split(/[ \\t]+/);\n    const name = parts.shift();\n    switch (name) {\n      case \"%TAG\": {\n        if (parts.length !== 2) {\n          onError(0, \"%TAG directive should contain exactly two parts\");\n          if (parts.length < 2)\n            return false;\n        }\n        const [handle, prefix] = parts;\n        this.tags[handle] = prefix;\n        return true;\n      }\n      case \"%YAML\": {\n        this.yaml.explicit = true;\n        if (parts.length !== 1) {\n          onError(0, \"%YAML directive should contain exactly one part\");\n          return false;\n        }\n        const [version] = parts;\n        if (version === \"1.1\" || version === \"1.2\") {\n          this.yaml.version = version;\n          return true;\n        } else {\n          const isValid = /^\\d+\\.\\d+$/.test(version);\n          onError(6, `Unsupported YAML version ${version}`, isValid);\n          return false;\n        }\n      }\n      default:\n        onError(0, `Unknown directive ${name}`, true);\n        return false;\n    }\n  }\n  /**\n   * Resolves a tag, matching handles to those defined in %TAG directives.\n   *\n   * @returns Resolved tag, which may also be the non-specific tag `'!'` or a\n   *   `'!local'` tag, or `null` if unresolvable.\n   */\n  tagName(source, onError) {\n    if (source === \"!\")\n      return \"!\";\n    if (source[0] !== \"!\") {\n      onError(`Not a valid tag: ${source}`);\n      return null;\n    }\n    if (source[1] === \"<\") {\n      const verbatim = source.slice(2, -1);\n      if (verbatim === \"!\" || verbatim === \"!!\") {\n        onError(`Verbatim tags aren't resolved, so ${source} is invalid.`);\n        return null;\n      }\n      if (source[source.length - 1] !== \">\")\n        onError(\"Verbatim tags must end with a >\");\n      return verbatim;\n    }\n    const [, handle, suffix] = source.match(new RegExp(\"^(.*!)([^!]*)$\", \"s\"));\n    if (!suffix)\n      onError(`The ${source} tag has no suffix`);\n    const prefix = this.tags[handle];\n    if (prefix) {\n      try {\n        return prefix + decodeURIComponent(suffix);\n      } catch (error) {\n        onError(String(error));\n        return null;\n      }\n    }\n    if (handle === \"!\")\n      return source;\n    onError(`Could not resolve tag: ${source}`);\n    return null;\n  }\n  /**\n   * Given a fully resolved tag, returns its printable string form,\n   * taking into account current tag prefixes and defaults.\n   */\n  tagString(tag) {\n    for (const [handle, prefix] of Object.entries(this.tags)) {\n      if (tag.startsWith(prefix))\n        return handle + escapeTagName(tag.substring(prefix.length));\n    }\n    return tag[0] === \"!\" ? tag : `!<${tag}>`;\n  }\n  toString(doc) {\n    const lines = this.yaml.explicit ? [`%YAML ${this.yaml.version || \"1.2\"}`] : [];\n    const tagEntries = Object.entries(this.tags);\n    let tagNames;\n    if (doc && tagEntries.length > 0 && isNode(doc.contents)) {\n      const tags = {};\n      visit(doc.contents, (_key, node) => {\n        if (isNode(node) && node.tag)\n          tags[node.tag] = true;\n      });\n      tagNames = Object.keys(tags);\n    } else\n      tagNames = [];\n    for (const [handle, prefix] of tagEntries) {\n      if (handle === \"!!\" && prefix === \"tag:yaml.org,2002:\")\n        continue;\n      if (!doc || tagNames.some((tn) => tn.startsWith(prefix)))\n        lines.push(`%TAG ${handle} ${prefix}`);\n    }\n    return lines.join(\"\\n\");\n  }\n};\nDirectives.defaultYaml = { explicit: false, version: \"1.2\" };\nDirectives.defaultTags = { \"!!\": \"tag:yaml.org,2002:\" };\n\n// node_modules/yaml/browser/dist/doc/anchors.js\nfunction anchorIsValid(anchor) {\n  if (/[\\x00-\\x19\\s,[\\]{}]/.test(anchor)) {\n    const sa = JSON.stringify(anchor);\n    const msg = `Anchor must not contain whitespace or control characters: ${sa}`;\n    throw new Error(msg);\n  }\n  return true;\n}\nfunction anchorNames(root) {\n  const anchors = /* @__PURE__ */ new Set();\n  visit(root, {\n    Value(_key, node) {\n      if (node.anchor)\n        anchors.add(node.anchor);\n    }\n  });\n  return anchors;\n}\nfunction findNewAnchor(prefix, exclude) {\n  for (let i = 1; true; ++i) {\n    const name = `${prefix}${i}`;\n    if (!exclude.has(name))\n      return name;\n  }\n}\nfunction createNodeAnchors(doc, prefix) {\n  const aliasObjects = [];\n  const sourceObjects = /* @__PURE__ */ new Map();\n  let prevAnchors = null;\n  return {\n    onAnchor: (source) => {\n      aliasObjects.push(source);\n      prevAnchors != null ? prevAnchors : prevAnchors = anchorNames(doc);\n      const anchor = findNewAnchor(prefix, prevAnchors);\n      prevAnchors.add(anchor);\n      return anchor;\n    },\n    /**\n     * With circular references, the source node is only resolved after all\n     * of its child nodes are. This is why anchors are set only after all of\n     * the nodes have been created.\n     */\n    setAnchors: () => {\n      for (const source of aliasObjects) {\n        const ref = sourceObjects.get(source);\n        if (typeof ref === \"object\" && ref.anchor && (isScalar(ref.node) || isCollection(ref.node))) {\n          ref.node.anchor = ref.anchor;\n        } else {\n          const error = new Error(\"Failed to resolve repeated object (this should not happen)\");\n          error.source = source;\n          throw error;\n        }\n      }\n    },\n    sourceObjects\n  };\n}\n\n// node_modules/yaml/browser/dist/doc/applyReviver.js\nfunction applyReviver(reviver, obj, key, val) {\n  if (val && typeof val === \"object\") {\n    if (Array.isArray(val)) {\n      for (let i = 0, len = val.length; i < len; ++i) {\n        const v0 = val[i];\n        const v1 = applyReviver(reviver, val, String(i), v0);\n        if (v1 === void 0)\n          delete val[i];\n        else if (v1 !== v0)\n          val[i] = v1;\n      }\n    } else if (val instanceof Map) {\n      for (const k2 of Array.from(val.keys())) {\n        const v0 = val.get(k2);\n        const v1 = applyReviver(reviver, val, k2, v0);\n        if (v1 === void 0)\n          val.delete(k2);\n        else if (v1 !== v0)\n          val.set(k2, v1);\n      }\n    } else if (val instanceof Set) {\n      for (const v0 of Array.from(val)) {\n        const v1 = applyReviver(reviver, val, v0, v0);\n        if (v1 === void 0)\n          val.delete(v0);\n        else if (v1 !== v0) {\n          val.delete(v0);\n          val.add(v1);\n        }\n      }\n    } else {\n      for (const [k2, v0] of Object.entries(val)) {\n        const v1 = applyReviver(reviver, val, k2, v0);\n        if (v1 === void 0)\n          delete val[k2];\n        else if (v1 !== v0)\n          val[k2] = v1;\n      }\n    }\n  }\n  return reviver.call(obj, key, val);\n}\n\n// node_modules/yaml/browser/dist/nodes/toJS.js\nfunction toJS(value, arg, ctx) {\n  if (Array.isArray(value))\n    return value.map((v2, i) => toJS(v2, String(i), ctx));\n  if (value && typeof value.toJSON === \"function\") {\n    if (!ctx || !hasAnchor(value))\n      return value.toJSON(arg, ctx);\n    const data = { aliasCount: 0, count: 1, res: void 0 };\n    ctx.anchors.set(value, data);\n    ctx.onCreate = (res2) => {\n      data.res = res2;\n      delete ctx.onCreate;\n    };\n    const res = value.toJSON(arg, ctx);\n    if (ctx.onCreate)\n      ctx.onCreate(res);\n    return res;\n  }\n  if (typeof value === \"bigint\" && !(ctx == null ? void 0 : ctx.keep))\n    return Number(value);\n  return value;\n}\n\n// node_modules/yaml/browser/dist/nodes/Node.js\nvar NodeBase = class {\n  constructor(type) {\n    Object.defineProperty(this, NODE_TYPE, { value: type });\n  }\n  /** Create a copy of this node.  */\n  clone() {\n    const copy = Object.create(Object.getPrototypeOf(this), Object.getOwnPropertyDescriptors(this));\n    if (this.range)\n      copy.range = this.range.slice();\n    return copy;\n  }\n  /** A plain JavaScript representation of this node. */\n  toJS(doc, { mapAsMap, maxAliasCount, onAnchor, reviver } = {}) {\n    if (!isDocument(doc))\n      throw new TypeError(\"A document argument is required\");\n    const ctx = {\n      anchors: /* @__PURE__ */ new Map(),\n      doc,\n      keep: true,\n      mapAsMap: mapAsMap === true,\n      mapKeyWarned: false,\n      maxAliasCount: typeof maxAliasCount === \"number\" ? maxAliasCount : 100\n    };\n    const res = toJS(this, \"\", ctx);\n    if (typeof onAnchor === \"function\")\n      for (const { count, res: res2 } of ctx.anchors.values())\n        onAnchor(res2, count);\n    return typeof reviver === \"function\" ? applyReviver(reviver, { \"\": res }, \"\", res) : res;\n  }\n};\n\n// node_modules/yaml/browser/dist/nodes/Alias.js\nvar Alias = class extends NodeBase {\n  constructor(source) {\n    super(ALIAS);\n    this.source = source;\n    Object.defineProperty(this, \"tag\", {\n      set() {\n        throw new Error(\"Alias nodes cannot have tags\");\n      }\n    });\n  }\n  /**\n   * Resolve the value of this alias within `doc`, finding the last\n   * instance of the `source` anchor before this node.\n   */\n  resolve(doc, ctx) {\n    let nodes;\n    if (ctx == null ? void 0 : ctx.aliasResolveCache) {\n      nodes = ctx.aliasResolveCache;\n    } else {\n      nodes = [];\n      visit(doc, {\n        Node: (_key, node) => {\n          if (isAlias(node) || hasAnchor(node))\n            nodes.push(node);\n        }\n      });\n      if (ctx)\n        ctx.aliasResolveCache = nodes;\n    }\n    let found = void 0;\n    for (const node of nodes) {\n      if (node === this)\n        break;\n      if (node.anchor === this.source)\n        found = node;\n    }\n    return found;\n  }\n  toJSON(_arg, ctx) {\n    if (!ctx)\n      return { source: this.source };\n    const { anchors, doc, maxAliasCount } = ctx;\n    const source = this.resolve(doc, ctx);\n    if (!source) {\n      const msg = `Unresolved alias (the anchor must be set before the alias): ${this.source}`;\n      throw new ReferenceError(msg);\n    }\n    let data = anchors.get(source);\n    if (!data) {\n      toJS(source, null, ctx);\n      data = anchors.get(source);\n    }\n    if ((data == null ? void 0 : data.res) === void 0) {\n      const msg = \"This should not happen: Alias anchor was not resolved?\";\n      throw new ReferenceError(msg);\n    }\n    if (maxAliasCount >= 0) {\n      data.count += 1;\n      if (data.aliasCount === 0)\n        data.aliasCount = getAliasCount(doc, source, anchors);\n      if (data.count * data.aliasCount > maxAliasCount) {\n        const msg = \"Excessive alias count indicates a resource exhaustion attack\";\n        throw new ReferenceError(msg);\n      }\n    }\n    return data.res;\n  }\n  toString(ctx, _onComment, _onChompKeep) {\n    const src = `*${this.source}`;\n    if (ctx) {\n      anchorIsValid(this.source);\n      if (ctx.options.verifyAliasOrder && !ctx.anchors.has(this.source)) {\n        const msg = `Unresolved alias (the anchor must be set before the alias): ${this.source}`;\n        throw new Error(msg);\n      }\n      if (ctx.implicitKey)\n        return `${src} `;\n    }\n    return src;\n  }\n};\nfunction getAliasCount(doc, node, anchors) {\n  if (isAlias(node)) {\n    const source = node.resolve(doc);\n    const anchor = anchors && source && anchors.get(source);\n    return anchor ? anchor.count * anchor.aliasCount : 0;\n  } else if (isCollection(node)) {\n    let count = 0;\n    for (const item of node.items) {\n      const c2 = getAliasCount(doc, item, anchors);\n      if (c2 > count)\n        count = c2;\n    }\n    return count;\n  } else if (isPair(node)) {\n    const kc = getAliasCount(doc, node.key, anchors);\n    const vc = getAliasCount(doc, node.value, anchors);\n    return Math.max(kc, vc);\n  }\n  return 1;\n}\n\n// node_modules/yaml/browser/dist/nodes/Scalar.js\nvar isScalarValue = (value) => !value || typeof value !== \"function\" && typeof value !== \"object\";\nvar Scalar = class extends NodeBase {\n  constructor(value) {\n    super(SCALAR);\n    this.value = value;\n  }\n  toJSON(arg, ctx) {\n    return (ctx == null ? void 0 : ctx.keep) ? this.value : toJS(this.value, arg, ctx);\n  }\n  toString() {\n    return String(this.value);\n  }\n};\nScalar.BLOCK_FOLDED = \"BLOCK_FOLDED\";\nScalar.BLOCK_LITERAL = \"BLOCK_LITERAL\";\nScalar.PLAIN = \"PLAIN\";\nScalar.QUOTE_DOUBLE = \"QUOTE_DOUBLE\";\nScalar.QUOTE_SINGLE = \"QUOTE_SINGLE\";\n\n// node_modules/yaml/browser/dist/doc/createNode.js\nvar defaultTagPrefix = \"tag:yaml.org,2002:\";\nfunction findTagObject(value, tagName, tags) {\n  var _a2;\n  if (tagName) {\n    const match = tags.filter((t3) => t3.tag === tagName);\n    const tagObj = (_a2 = match.find((t3) => !t3.format)) != null ? _a2 : match[0];\n    if (!tagObj)\n      throw new Error(`Tag ${tagName} not found`);\n    return tagObj;\n  }\n  return tags.find((t3) => {\n    var _a3;\n    return ((_a3 = t3.identify) == null ? void 0 : _a3.call(t3, value)) && !t3.format;\n  });\n}\nfunction createNode(value, tagName, ctx) {\n  var _a2, _b2, _c, _d;\n  if (isDocument(value))\n    value = value.contents;\n  if (isNode(value))\n    return value;\n  if (isPair(value)) {\n    const map2 = (_b2 = (_a2 = ctx.schema[MAP]).createNode) == null ? void 0 : _b2.call(_a2, ctx.schema, null, ctx);\n    map2.items.push(value);\n    return map2;\n  }\n  if (value instanceof String || value instanceof Number || value instanceof Boolean || typeof BigInt !== \"undefined\" && value instanceof BigInt) {\n    value = value.valueOf();\n  }\n  const { aliasDuplicateObjects, onAnchor, onTagObj, schema: schema4, sourceObjects } = ctx;\n  let ref = void 0;\n  if (aliasDuplicateObjects && value && typeof value === \"object\") {\n    ref = sourceObjects.get(value);\n    if (ref) {\n      (_c = ref.anchor) != null ? _c : ref.anchor = onAnchor(value);\n      return new Alias(ref.anchor);\n    } else {\n      ref = { anchor: null, node: null };\n      sourceObjects.set(value, ref);\n    }\n  }\n  if (tagName == null ? void 0 : tagName.startsWith(\"!!\"))\n    tagName = defaultTagPrefix + tagName.slice(2);\n  let tagObj = findTagObject(value, tagName, schema4.tags);\n  if (!tagObj) {\n    if (value && typeof value.toJSON === \"function\") {\n      value = value.toJSON();\n    }\n    if (!value || typeof value !== \"object\") {\n      const node2 = new Scalar(value);\n      if (ref)\n        ref.node = node2;\n      return node2;\n    }\n    tagObj = value instanceof Map ? schema4[MAP] : Symbol.iterator in Object(value) ? schema4[SEQ] : schema4[MAP];\n  }\n  if (onTagObj) {\n    onTagObj(tagObj);\n    delete ctx.onTagObj;\n  }\n  const node = (tagObj == null ? void 0 : tagObj.createNode) ? tagObj.createNode(ctx.schema, value, ctx) : typeof ((_d = tagObj == null ? void 0 : tagObj.nodeClass) == null ? void 0 : _d.from) === \"function\" ? tagObj.nodeClass.from(ctx.schema, value, ctx) : new Scalar(value);\n  if (tagName)\n    node.tag = tagName;\n  else if (!tagObj.default)\n    node.tag = tagObj.tag;\n  if (ref)\n    ref.node = node;\n  return node;\n}\n\n// node_modules/yaml/browser/dist/nodes/Collection.js\nfunction collectionFromPath(schema4, path5, value) {\n  let v2 = value;\n  for (let i = path5.length - 1; i >= 0; --i) {\n    const k2 = path5[i];\n    if (typeof k2 === \"number\" && Number.isInteger(k2) && k2 >= 0) {\n      const a = [];\n      a[k2] = v2;\n      v2 = a;\n    } else {\n      v2 = /* @__PURE__ */ new Map([[k2, v2]]);\n    }\n  }\n  return createNode(v2, void 0, {\n    aliasDuplicateObjects: false,\n    keepUndefined: false,\n    onAnchor: () => {\n      throw new Error(\"This should not happen, please report a bug.\");\n    },\n    schema: schema4,\n    sourceObjects: /* @__PURE__ */ new Map()\n  });\n}\nvar isEmptyPath = (path5) => path5 == null || typeof path5 === \"object\" && !!path5[Symbol.iterator]().next().done;\nvar Collection = class extends NodeBase {\n  constructor(type, schema4) {\n    super(type);\n    Object.defineProperty(this, \"schema\", {\n      value: schema4,\n      configurable: true,\n      enumerable: false,\n      writable: true\n    });\n  }\n  /**\n   * Create a copy of this collection.\n   *\n   * @param schema - If defined, overwrites the original's schema\n   */\n  clone(schema4) {\n    const copy = Object.create(Object.getPrototypeOf(this), Object.getOwnPropertyDescriptors(this));\n    if (schema4)\n      copy.schema = schema4;\n    copy.items = copy.items.map((it) => isNode(it) || isPair(it) ? it.clone(schema4) : it);\n    if (this.range)\n      copy.range = this.range.slice();\n    return copy;\n  }\n  /**\n   * Adds a value to the collection. For `!!map` and `!!omap` the value must\n   * be a Pair instance or a `{ key, value }` object, which may not have a key\n   * that already exists in the map.\n   */\n  addIn(path5, value) {\n    if (isEmptyPath(path5))\n      this.add(value);\n    else {\n      const [key, ...rest] = path5;\n      const node = this.get(key, true);\n      if (isCollection(node))\n        node.addIn(rest, value);\n      else if (node === void 0 && this.schema)\n        this.set(key, collectionFromPath(this.schema, rest, value));\n      else\n        throw new Error(`Expected YAML collection at ${key}. Remaining path: ${rest}`);\n    }\n  }\n  /**\n   * Removes a value from the collection.\n   * @returns `true` if the item was found and removed.\n   */\n  deleteIn(path5) {\n    const [key, ...rest] = path5;\n    if (rest.length === 0)\n      return this.delete(key);\n    const node = this.get(key, true);\n    if (isCollection(node))\n      return node.deleteIn(rest);\n    else\n      throw new Error(`Expected YAML collection at ${key}. Remaining path: ${rest}`);\n  }\n  /**\n   * Returns item at `key`, or `undefined` if not found. By default unwraps\n   * scalar values from their surrounding node; to disable set `keepScalar` to\n   * `true` (collections are always returned intact).\n   */\n  getIn(path5, keepScalar) {\n    const [key, ...rest] = path5;\n    const node = this.get(key, true);\n    if (rest.length === 0)\n      return !keepScalar && isScalar(node) ? node.value : node;\n    else\n      return isCollection(node) ? node.getIn(rest, keepScalar) : void 0;\n  }\n  hasAllNullValues(allowScalar) {\n    return this.items.every((node) => {\n      if (!isPair(node))\n        return false;\n      const n4 = node.value;\n      return n4 == null || allowScalar && isScalar(n4) && n4.value == null && !n4.commentBefore && !n4.comment && !n4.tag;\n    });\n  }\n  /**\n   * Checks if the collection includes a value with the key `key`.\n   */\n  hasIn(path5) {\n    const [key, ...rest] = path5;\n    if (rest.length === 0)\n      return this.has(key);\n    const node = this.get(key, true);\n    return isCollection(node) ? node.hasIn(rest) : false;\n  }\n  /**\n   * Sets a value in this collection. For `!!set`, `value` needs to be a\n   * boolean to add/remove the item from the set.\n   */\n  setIn(path5, value) {\n    const [key, ...rest] = path5;\n    if (rest.length === 0) {\n      this.set(key, value);\n    } else {\n      const node = this.get(key, true);\n      if (isCollection(node))\n        node.setIn(rest, value);\n      else if (node === void 0 && this.schema)\n        this.set(key, collectionFromPath(this.schema, rest, value));\n      else\n        throw new Error(`Expected YAML collection at ${key}. Remaining path: ${rest}`);\n    }\n  }\n};\n\n// node_modules/yaml/browser/dist/stringify/stringifyComment.js\nvar stringifyComment = (str) => str.replace(/^(?!$)(?: $)?/gm, \"#\");\nfunction indentComment(comment, indent) {\n  if (/^\\n+$/.test(comment))\n    return comment.substring(1);\n  return indent ? comment.replace(/^(?! *$)/gm, indent) : comment;\n}\nvar lineComment = (str, indent, comment) => str.endsWith(\"\\n\") ? indentComment(comment, indent) : comment.includes(\"\\n\") ? \"\\n\" + indentComment(comment, indent) : (str.endsWith(\" \") ? \"\" : \" \") + comment;\n\n// node_modules/yaml/browser/dist/stringify/foldFlowLines.js\nvar FOLD_FLOW = \"flow\";\nvar FOLD_BLOCK = \"block\";\nvar FOLD_QUOTED = \"quoted\";\nfunction foldFlowLines(text, indent, mode = \"flow\", { indentAtStart, lineWidth = 80, minContentWidth = 20, onFold, onOverflow } = {}) {\n  if (!lineWidth || lineWidth < 0)\n    return text;\n  if (lineWidth < minContentWidth)\n    minContentWidth = 0;\n  const endStep = Math.max(1 + minContentWidth, 1 + lineWidth - indent.length);\n  if (text.length <= endStep)\n    return text;\n  const folds = [];\n  const escapedFolds = {};\n  let end = lineWidth - indent.length;\n  if (typeof indentAtStart === \"number\") {\n    if (indentAtStart > lineWidth - Math.max(2, minContentWidth))\n      folds.push(0);\n    else\n      end = lineWidth - indentAtStart;\n  }\n  let split = void 0;\n  let prev = void 0;\n  let overflow = false;\n  let i = -1;\n  let escStart = -1;\n  let escEnd = -1;\n  if (mode === FOLD_BLOCK) {\n    i = consumeMoreIndentedLines(text, i, indent.length);\n    if (i !== -1)\n      end = i + endStep;\n  }\n  for (let ch; ch = text[i += 1]; ) {\n    if (mode === FOLD_QUOTED && ch === \"\\\\\") {\n      escStart = i;\n      switch (text[i + 1]) {\n        case \"x\":\n          i += 3;\n          break;\n        case \"u\":\n          i += 5;\n          break;\n        case \"U\":\n          i += 9;\n          break;\n        default:\n          i += 1;\n      }\n      escEnd = i;\n    }\n    if (ch === \"\\n\") {\n      if (mode === FOLD_BLOCK)\n        i = consumeMoreIndentedLines(text, i, indent.length);\n      end = i + indent.length + endStep;\n      split = void 0;\n    } else {\n      if (ch === \" \" && prev && prev !== \" \" && prev !== \"\\n\" && prev !== \"\t\") {\n        const next = text[i + 1];\n        if (next && next !== \" \" && next !== \"\\n\" && next !== \"\t\")\n          split = i;\n      }\n      if (i >= end) {\n        if (split) {\n          folds.push(split);\n          end = split + endStep;\n          split = void 0;\n        } else if (mode === FOLD_QUOTED) {\n          while (prev === \" \" || prev === \"\t\") {\n            prev = ch;\n            ch = text[i += 1];\n            overflow = true;\n          }\n          const j = i > escEnd + 1 ? i - 2 : escStart - 1;\n          if (escapedFolds[j])\n            return text;\n          folds.push(j);\n          escapedFolds[j] = true;\n          end = j + endStep;\n          split = void 0;\n        } else {\n          overflow = true;\n        }\n      }\n    }\n    prev = ch;\n  }\n  if (overflow && onOverflow)\n    onOverflow();\n  if (folds.length === 0)\n    return text;\n  if (onFold)\n    onFold();\n  let res = text.slice(0, folds[0]);\n  for (let i2 = 0; i2 < folds.length; ++i2) {\n    const fold = folds[i2];\n    const end2 = folds[i2 + 1] || text.length;\n    if (fold === 0)\n      res = `\n${indent}${text.slice(0, end2)}`;\n    else {\n      if (mode === FOLD_QUOTED && escapedFolds[fold])\n        res += `${text[fold]}\\\\`;\n      res += `\n${indent}${text.slice(fold + 1, end2)}`;\n    }\n  }\n  return res;\n}\nfunction consumeMoreIndentedLines(text, i, indent) {\n  let end = i;\n  let start = i + 1;\n  let ch = text[start];\n  while (ch === \" \" || ch === \"\t\") {\n    if (i < start + indent) {\n      ch = text[++i];\n    } else {\n      do {\n        ch = text[++i];\n      } while (ch && ch !== \"\\n\");\n      end = i;\n      start = i + 1;\n      ch = text[start];\n    }\n  }\n  return end;\n}\n\n// node_modules/yaml/browser/dist/stringify/stringifyString.js\nvar getFoldOptions = (ctx, isBlock2) => ({\n  indentAtStart: isBlock2 ? ctx.indent.length : ctx.indentAtStart,\n  lineWidth: ctx.options.lineWidth,\n  minContentWidth: ctx.options.minContentWidth\n});\nvar containsDocumentMarker = (str) => /^(%|---|\\.\\.\\.)/m.test(str);\nfunction lineLengthOverLimit(str, lineWidth, indentLength) {\n  if (!lineWidth || lineWidth < 0)\n    return false;\n  const limit = lineWidth - indentLength;\n  const strLen = str.length;\n  if (strLen <= limit)\n    return false;\n  for (let i = 0, start = 0; i < strLen; ++i) {\n    if (str[i] === \"\\n\") {\n      if (i - start > limit)\n        return true;\n      start = i + 1;\n      if (strLen - start <= limit)\n        return false;\n    }\n  }\n  return true;\n}\nfunction doubleQuotedString(value, ctx) {\n  const json = JSON.stringify(value);\n  if (ctx.options.doubleQuotedAsJSON)\n    return json;\n  const { implicitKey } = ctx;\n  const minMultiLineLength = ctx.options.doubleQuotedMinMultiLineLength;\n  const indent = ctx.indent || (containsDocumentMarker(value) ? \"  \" : \"\");\n  let str = \"\";\n  let start = 0;\n  for (let i = 0, ch = json[i]; ch; ch = json[++i]) {\n    if (ch === \" \" && json[i + 1] === \"\\\\\" && json[i + 2] === \"n\") {\n      str += json.slice(start, i) + \"\\\\ \";\n      i += 1;\n      start = i;\n      ch = \"\\\\\";\n    }\n    if (ch === \"\\\\\")\n      switch (json[i + 1]) {\n        case \"u\":\n          {\n            str += json.slice(start, i);\n            const code = json.substr(i + 2, 4);\n            switch (code) {\n              case \"0000\":\n                str += \"\\\\0\";\n                break;\n              case \"0007\":\n                str += \"\\\\a\";\n                break;\n              case \"000b\":\n                str += \"\\\\v\";\n                break;\n              case \"001b\":\n                str += \"\\\\e\";\n                break;\n              case \"0085\":\n                str += \"\\\\N\";\n                break;\n              case \"00a0\":\n                str += \"\\\\_\";\n                break;\n              case \"2028\":\n                str += \"\\\\L\";\n                break;\n              case \"2029\":\n                str += \"\\\\P\";\n                break;\n              default:\n                if (code.substr(0, 2) === \"00\")\n                  str += \"\\\\x\" + code.substr(2);\n                else\n                  str += json.substr(i, 6);\n            }\n            i += 5;\n            start = i + 1;\n          }\n          break;\n        case \"n\":\n          if (implicitKey || json[i + 2] === '\"' || json.length < minMultiLineLength) {\n            i += 1;\n          } else {\n            str += json.slice(start, i) + \"\\n\\n\";\n            while (json[i + 2] === \"\\\\\" && json[i + 3] === \"n\" && json[i + 4] !== '\"') {\n              str += \"\\n\";\n              i += 2;\n            }\n            str += indent;\n            if (json[i + 2] === \" \")\n              str += \"\\\\\";\n            i += 1;\n            start = i + 1;\n          }\n          break;\n        default:\n          i += 1;\n      }\n  }\n  str = start ? str + json.slice(start) : json;\n  return implicitKey ? str : foldFlowLines(str, indent, FOLD_QUOTED, getFoldOptions(ctx, false));\n}\nfunction singleQuotedString(value, ctx) {\n  if (ctx.options.singleQuote === false || ctx.implicitKey && value.includes(\"\\n\") || /[ \\t]\\n|\\n[ \\t]/.test(value))\n    return doubleQuotedString(value, ctx);\n  const indent = ctx.indent || (containsDocumentMarker(value) ? \"  \" : \"\");\n  const res = \"'\" + value.replace(/'/g, \"''\").replace(/\\n+/g, `$&\n${indent}`) + \"'\";\n  return ctx.implicitKey ? res : foldFlowLines(res, indent, FOLD_FLOW, getFoldOptions(ctx, false));\n}\nfunction quotedString(value, ctx) {\n  const { singleQuote } = ctx.options;\n  let qs;\n  if (singleQuote === false)\n    qs = doubleQuotedString;\n  else {\n    const hasDouble = value.includes('\"');\n    const hasSingle = value.includes(\"'\");\n    if (hasDouble && !hasSingle)\n      qs = singleQuotedString;\n    else if (hasSingle && !hasDouble)\n      qs = doubleQuotedString;\n    else\n      qs = singleQuote ? singleQuotedString : doubleQuotedString;\n  }\n  return qs(value, ctx);\n}\nvar blockEndNewlines;\ntry {\n  blockEndNewlines = new RegExp(\"(^|(?<!\\n))\\n+(?!\\n|$)\", \"g\");\n} catch (e) {\n  blockEndNewlines = /\\n+(?!\\n|$)/g;\n}\nfunction blockString({ comment, type, value }, ctx, onComment, onChompKeep) {\n  const { blockQuote, commentString, lineWidth } = ctx.options;\n  if (!blockQuote || /\\n[\\t ]+$/.test(value)) {\n    return quotedString(value, ctx);\n  }\n  const indent = ctx.indent || (ctx.forceBlockIndent || containsDocumentMarker(value) ? \"  \" : \"\");\n  const literal = blockQuote === \"literal\" ? true : blockQuote === \"folded\" || type === Scalar.BLOCK_FOLDED ? false : type === Scalar.BLOCK_LITERAL ? true : !lineLengthOverLimit(value, lineWidth, indent.length);\n  if (!value)\n    return literal ? \"|\\n\" : \">\\n\";\n  let chomp;\n  let endStart;\n  for (endStart = value.length; endStart > 0; --endStart) {\n    const ch = value[endStart - 1];\n    if (ch !== \"\\n\" && ch !== \"\t\" && ch !== \" \")\n      break;\n  }\n  let end = value.substring(endStart);\n  const endNlPos = end.indexOf(\"\\n\");\n  if (endNlPos === -1) {\n    chomp = \"-\";\n  } else if (value === end || endNlPos !== end.length - 1) {\n    chomp = \"+\";\n    if (onChompKeep)\n      onChompKeep();\n  } else {\n    chomp = \"\";\n  }\n  if (end) {\n    value = value.slice(0, -end.length);\n    if (end[end.length - 1] === \"\\n\")\n      end = end.slice(0, -1);\n    end = end.replace(blockEndNewlines, `$&${indent}`);\n  }\n  let startWithSpace = false;\n  let startEnd;\n  let startNlPos = -1;\n  for (startEnd = 0; startEnd < value.length; ++startEnd) {\n    const ch = value[startEnd];\n    if (ch === \" \")\n      startWithSpace = true;\n    else if (ch === \"\\n\")\n      startNlPos = startEnd;\n    else\n      break;\n  }\n  let start = value.substring(0, startNlPos < startEnd ? startNlPos + 1 : startEnd);\n  if (start) {\n    value = value.substring(start.length);\n    start = start.replace(/\\n+/g, `$&${indent}`);\n  }\n  const indentSize = indent ? \"2\" : \"1\";\n  let header = (startWithSpace ? indentSize : \"\") + chomp;\n  if (comment) {\n    header += \" \" + commentString(comment.replace(/ ?[\\r\\n]+/g, \" \"));\n    if (onComment)\n      onComment();\n  }\n  if (!literal) {\n    const foldedValue = value.replace(/\\n+/g, \"\\n$&\").replace(/(?:^|\\n)([\\t ].*)(?:([\\n\\t ]*)\\n(?![\\n\\t ]))?/g, \"$1$2\").replace(/\\n+/g, `$&${indent}`);\n    let literalFallback = false;\n    const foldOptions = getFoldOptions(ctx, true);\n    if (blockQuote !== \"folded\" && type !== Scalar.BLOCK_FOLDED) {\n      foldOptions.onOverflow = () => {\n        literalFallback = true;\n      };\n    }\n    const body = foldFlowLines(`${start}${foldedValue}${end}`, indent, FOLD_BLOCK, foldOptions);\n    if (!literalFallback)\n      return `>${header}\n${indent}${body}`;\n  }\n  value = value.replace(/\\n+/g, `$&${indent}`);\n  return `|${header}\n${indent}${start}${value}${end}`;\n}\nfunction plainString(item, ctx, onComment, onChompKeep) {\n  const { type, value } = item;\n  const { actualString, implicitKey, indent, indentStep, inFlow } = ctx;\n  if (implicitKey && value.includes(\"\\n\") || inFlow && /[[\\]{},]/.test(value)) {\n    return quotedString(value, ctx);\n  }\n  if (/^[\\n\\t ,[\\]{}#&*!|>'\"%@`]|^[?-]$|^[?-][ \\t]|[\\n:][ \\t]|[ \\t]\\n|[\\n\\t ]#|[\\n\\t :]$/.test(value)) {\n    return implicitKey || inFlow || !value.includes(\"\\n\") ? quotedString(value, ctx) : blockString(item, ctx, onComment, onChompKeep);\n  }\n  if (!implicitKey && !inFlow && type !== Scalar.PLAIN && value.includes(\"\\n\")) {\n    return blockString(item, ctx, onComment, onChompKeep);\n  }\n  if (containsDocumentMarker(value)) {\n    if (indent === \"\") {\n      ctx.forceBlockIndent = true;\n      return blockString(item, ctx, onComment, onChompKeep);\n    } else if (implicitKey && indent === indentStep) {\n      return quotedString(value, ctx);\n    }\n  }\n  const str = value.replace(/\\n+/g, `$&\n${indent}`);\n  if (actualString) {\n    const test = (tag) => {\n      var _a2;\n      return tag.default && tag.tag !== \"tag:yaml.org,2002:str\" && ((_a2 = tag.test) == null ? void 0 : _a2.test(str));\n    };\n    const { compat, tags } = ctx.doc.schema;\n    if (tags.some(test) || (compat == null ? void 0 : compat.some(test)))\n      return quotedString(value, ctx);\n  }\n  return implicitKey ? str : foldFlowLines(str, indent, FOLD_FLOW, getFoldOptions(ctx, false));\n}\nfunction stringifyString(item, ctx, onComment, onChompKeep) {\n  const { implicitKey, inFlow } = ctx;\n  const ss = typeof item.value === \"string\" ? item : Object.assign({}, item, { value: String(item.value) });\n  let { type } = item;\n  if (type !== Scalar.QUOTE_DOUBLE) {\n    if (/[\\x00-\\x08\\x0b-\\x1f\\x7f-\\x9f\\u{D800}-\\u{DFFF}]/u.test(ss.value))\n      type = Scalar.QUOTE_DOUBLE;\n  }\n  const _stringify = (_type) => {\n    switch (_type) {\n      case Scalar.BLOCK_FOLDED:\n      case Scalar.BLOCK_LITERAL:\n        return implicitKey || inFlow ? quotedString(ss.value, ctx) : blockString(ss, ctx, onComment, onChompKeep);\n      case Scalar.QUOTE_DOUBLE:\n        return doubleQuotedString(ss.value, ctx);\n      case Scalar.QUOTE_SINGLE:\n        return singleQuotedString(ss.value, ctx);\n      case Scalar.PLAIN:\n        return plainString(ss, ctx, onComment, onChompKeep);\n      default:\n        return null;\n    }\n  };\n  let res = _stringify(type);\n  if (res === null) {\n    const { defaultKeyType, defaultStringType } = ctx.options;\n    const t3 = implicitKey && defaultKeyType || defaultStringType;\n    res = _stringify(t3);\n    if (res === null)\n      throw new Error(`Unsupported default string type ${t3}`);\n  }\n  return res;\n}\n\n// node_modules/yaml/browser/dist/stringify/stringify.js\nfunction createStringifyContext(doc, options) {\n  const opt = Object.assign({\n    blockQuote: true,\n    commentString: stringifyComment,\n    defaultKeyType: null,\n    defaultStringType: \"PLAIN\",\n    directives: null,\n    doubleQuotedAsJSON: false,\n    doubleQuotedMinMultiLineLength: 40,\n    falseStr: \"false\",\n    flowCollectionPadding: true,\n    indentSeq: true,\n    lineWidth: 80,\n    minContentWidth: 20,\n    nullStr: \"null\",\n    simpleKeys: false,\n    singleQuote: null,\n    trueStr: \"true\",\n    verifyAliasOrder: true\n  }, doc.schema.toStringOptions, options);\n  let inFlow;\n  switch (opt.collectionStyle) {\n    case \"block\":\n      inFlow = false;\n      break;\n    case \"flow\":\n      inFlow = true;\n      break;\n    default:\n      inFlow = null;\n  }\n  return {\n    anchors: /* @__PURE__ */ new Set(),\n    doc,\n    flowCollectionPadding: opt.flowCollectionPadding ? \" \" : \"\",\n    indent: \"\",\n    indentStep: typeof opt.indent === \"number\" ? \" \".repeat(opt.indent) : \"  \",\n    inFlow,\n    options: opt\n  };\n}\nfunction getTagObject(tags, item) {\n  var _a2, _b2, _c, _d;\n  if (item.tag) {\n    const match = tags.filter((t3) => t3.tag === item.tag);\n    if (match.length > 0)\n      return (_a2 = match.find((t3) => t3.format === item.format)) != null ? _a2 : match[0];\n  }\n  let tagObj = void 0;\n  let obj;\n  if (isScalar(item)) {\n    obj = item.value;\n    let match = tags.filter((t3) => {\n      var _a3;\n      return (_a3 = t3.identify) == null ? void 0 : _a3.call(t3, obj);\n    });\n    if (match.length > 1) {\n      const testMatch = match.filter((t3) => t3.test);\n      if (testMatch.length > 0)\n        match = testMatch;\n    }\n    tagObj = (_b2 = match.find((t3) => t3.format === item.format)) != null ? _b2 : match.find((t3) => !t3.format);\n  } else {\n    obj = item;\n    tagObj = tags.find((t3) => t3.nodeClass && obj instanceof t3.nodeClass);\n  }\n  if (!tagObj) {\n    const name = (_d = (_c = obj == null ? void 0 : obj.constructor) == null ? void 0 : _c.name) != null ? _d : obj === null ? \"null\" : typeof obj;\n    throw new Error(`Tag not resolved for ${name} value`);\n  }\n  return tagObj;\n}\nfunction stringifyProps(node, tagObj, { anchors, doc }) {\n  var _a2;\n  if (!doc.directives)\n    return \"\";\n  const props = [];\n  const anchor = (isScalar(node) || isCollection(node)) && node.anchor;\n  if (anchor && anchorIsValid(anchor)) {\n    anchors.add(anchor);\n    props.push(`&${anchor}`);\n  }\n  const tag = (_a2 = node.tag) != null ? _a2 : tagObj.default ? null : tagObj.tag;\n  if (tag)\n    props.push(doc.directives.tagString(tag));\n  return props.join(\" \");\n}\nfunction stringify(item, ctx, onComment, onChompKeep) {\n  var _a2, _b2;\n  if (isPair(item))\n    return item.toString(ctx, onComment, onChompKeep);\n  if (isAlias(item)) {\n    if (ctx.doc.directives)\n      return item.toString(ctx);\n    if ((_a2 = ctx.resolvedAliases) == null ? void 0 : _a2.has(item)) {\n      throw new TypeError(`Cannot stringify circular structure without alias nodes`);\n    } else {\n      if (ctx.resolvedAliases)\n        ctx.resolvedAliases.add(item);\n      else\n        ctx.resolvedAliases = /* @__PURE__ */ new Set([item]);\n      item = item.resolve(ctx.doc);\n    }\n  }\n  let tagObj = void 0;\n  const node = isNode(item) ? item : ctx.doc.createNode(item, { onTagObj: (o3) => tagObj = o3 });\n  tagObj != null ? tagObj : tagObj = getTagObject(ctx.doc.schema.tags, node);\n  const props = stringifyProps(node, tagObj, ctx);\n  if (props.length > 0)\n    ctx.indentAtStart = ((_b2 = ctx.indentAtStart) != null ? _b2 : 0) + props.length + 1;\n  const str = typeof tagObj.stringify === \"function\" ? tagObj.stringify(node, ctx, onComment, onChompKeep) : isScalar(node) ? stringifyString(node, ctx, onComment, onChompKeep) : node.toString(ctx, onComment, onChompKeep);\n  if (!props)\n    return str;\n  return isScalar(node) || str[0] === \"{\" || str[0] === \"[\" ? `${props} ${str}` : `${props}\n${ctx.indent}${str}`;\n}\n\n// node_modules/yaml/browser/dist/stringify/stringifyPair.js\nfunction stringifyPair({ key, value }, ctx, onComment, onChompKeep) {\n  var _a2, _b2;\n  const { allNullValues, doc, indent, indentStep, options: { commentString, indentSeq, simpleKeys } } = ctx;\n  let keyComment = isNode(key) && key.comment || null;\n  if (simpleKeys) {\n    if (keyComment) {\n      throw new Error(\"With simple keys, key nodes cannot have comments\");\n    }\n    if (isCollection(key) || !isNode(key) && typeof key === \"object\") {\n      const msg = \"With simple keys, collection cannot be used as a key value\";\n      throw new Error(msg);\n    }\n  }\n  let explicitKey = !simpleKeys && (!key || keyComment && value == null && !ctx.inFlow || isCollection(key) || (isScalar(key) ? key.type === Scalar.BLOCK_FOLDED || key.type === Scalar.BLOCK_LITERAL : typeof key === \"object\"));\n  ctx = Object.assign({}, ctx, {\n    allNullValues: false,\n    implicitKey: !explicitKey && (simpleKeys || !allNullValues),\n    indent: indent + indentStep\n  });\n  let keyCommentDone = false;\n  let chompKeep = false;\n  let str = stringify(key, ctx, () => keyCommentDone = true, () => chompKeep = true);\n  if (!explicitKey && !ctx.inFlow && str.length > 1024) {\n    if (simpleKeys)\n      throw new Error(\"With simple keys, single line scalar must not span more than 1024 characters\");\n    explicitKey = true;\n  }\n  if (ctx.inFlow) {\n    if (allNullValues || value == null) {\n      if (keyCommentDone && onComment)\n        onComment();\n      return str === \"\" ? \"?\" : explicitKey ? `? ${str}` : str;\n    }\n  } else if (allNullValues && !simpleKeys || value == null && explicitKey) {\n    str = `? ${str}`;\n    if (keyComment && !keyCommentDone) {\n      str += lineComment(str, ctx.indent, commentString(keyComment));\n    } else if (chompKeep && onChompKeep)\n      onChompKeep();\n    return str;\n  }\n  if (keyCommentDone)\n    keyComment = null;\n  if (explicitKey) {\n    if (keyComment)\n      str += lineComment(str, ctx.indent, commentString(keyComment));\n    str = `? ${str}\n${indent}:`;\n  } else {\n    str = `${str}:`;\n    if (keyComment)\n      str += lineComment(str, ctx.indent, commentString(keyComment));\n  }\n  let vsb, vcb, valueComment;\n  if (isNode(value)) {\n    vsb = !!value.spaceBefore;\n    vcb = value.commentBefore;\n    valueComment = value.comment;\n  } else {\n    vsb = false;\n    vcb = null;\n    valueComment = null;\n    if (value && typeof value === \"object\")\n      value = doc.createNode(value);\n  }\n  ctx.implicitKey = false;\n  if (!explicitKey && !keyComment && isScalar(value))\n    ctx.indentAtStart = str.length + 1;\n  chompKeep = false;\n  if (!indentSeq && indentStep.length >= 2 && !ctx.inFlow && !explicitKey && isSeq(value) && !value.flow && !value.tag && !value.anchor) {\n    ctx.indent = ctx.indent.substring(2);\n  }\n  let valueCommentDone = false;\n  const valueStr = stringify(value, ctx, () => valueCommentDone = true, () => chompKeep = true);\n  let ws = \" \";\n  if (keyComment || vsb || vcb) {\n    ws = vsb ? \"\\n\" : \"\";\n    if (vcb) {\n      const cs = commentString(vcb);\n      ws += `\n${indentComment(cs, ctx.indent)}`;\n    }\n    if (valueStr === \"\" && !ctx.inFlow) {\n      if (ws === \"\\n\" && valueComment)\n        ws = \"\\n\\n\";\n    } else {\n      ws += `\n${ctx.indent}`;\n    }\n  } else if (!explicitKey && isCollection(value)) {\n    const vs0 = valueStr[0];\n    const nl0 = valueStr.indexOf(\"\\n\");\n    const hasNewline = nl0 !== -1;\n    const flow = (_b2 = (_a2 = ctx.inFlow) != null ? _a2 : value.flow) != null ? _b2 : value.items.length === 0;\n    if (hasNewline || !flow) {\n      let hasPropsLine = false;\n      if (hasNewline && (vs0 === \"&\" || vs0 === \"!\")) {\n        let sp0 = valueStr.indexOf(\" \");\n        if (vs0 === \"&\" && sp0 !== -1 && sp0 < nl0 && valueStr[sp0 + 1] === \"!\") {\n          sp0 = valueStr.indexOf(\" \", sp0 + 1);\n        }\n        if (sp0 === -1 || nl0 < sp0)\n          hasPropsLine = true;\n      }\n      if (!hasPropsLine)\n        ws = `\n${ctx.indent}`;\n    }\n  } else if (valueStr === \"\" || valueStr[0] === \"\\n\") {\n    ws = \"\";\n  }\n  str += ws + valueStr;\n  if (ctx.inFlow) {\n    if (valueCommentDone && onComment)\n      onComment();\n  } else if (valueComment && !valueCommentDone) {\n    str += lineComment(str, ctx.indent, commentString(valueComment));\n  } else if (chompKeep && onChompKeep) {\n    onChompKeep();\n  }\n  return str;\n}\n\n// node_modules/yaml/browser/dist/log.js\nfunction warn(logLevel, warning) {\n  if (logLevel === \"debug\" || logLevel === \"warn\") {\n    console.warn(warning);\n  }\n}\n\n// node_modules/yaml/browser/dist/schema/yaml-1.1/merge.js\nvar MERGE_KEY = \"<<\";\nvar merge = {\n  identify: (value) => value === MERGE_KEY || typeof value === \"symbol\" && value.description === MERGE_KEY,\n  default: \"key\",\n  tag: \"tag:yaml.org,2002:merge\",\n  test: /^<<$/,\n  resolve: () => Object.assign(new Scalar(Symbol(MERGE_KEY)), {\n    addToJSMap: addMergeToJSMap\n  }),\n  stringify: () => MERGE_KEY\n};\nvar isMergeKey = (ctx, key) => (merge.identify(key) || isScalar(key) && (!key.type || key.type === Scalar.PLAIN) && merge.identify(key.value)) && (ctx == null ? void 0 : ctx.doc.schema.tags.some((tag) => tag.tag === merge.tag && tag.default));\nfunction addMergeToJSMap(ctx, map2, value) {\n  value = ctx && isAlias(value) ? value.resolve(ctx.doc) : value;\n  if (isSeq(value))\n    for (const it of value.items)\n      mergeValue(ctx, map2, it);\n  else if (Array.isArray(value))\n    for (const it of value)\n      mergeValue(ctx, map2, it);\n  else\n    mergeValue(ctx, map2, value);\n}\nfunction mergeValue(ctx, map2, value) {\n  const source = ctx && isAlias(value) ? value.resolve(ctx.doc) : value;\n  if (!isMap(source))\n    throw new Error(\"Merge sources must be maps or map aliases\");\n  const srcMap = source.toJSON(null, ctx, Map);\n  for (const [key, value2] of srcMap) {\n    if (map2 instanceof Map) {\n      if (!map2.has(key))\n        map2.set(key, value2);\n    } else if (map2 instanceof Set) {\n      map2.add(key);\n    } else if (!Object.prototype.hasOwnProperty.call(map2, key)) {\n      Object.defineProperty(map2, key, {\n        value: value2,\n        writable: true,\n        enumerable: true,\n        configurable: true\n      });\n    }\n  }\n  return map2;\n}\n\n// node_modules/yaml/browser/dist/nodes/addPairToJSMap.js\nfunction addPairToJSMap(ctx, map2, { key, value }) {\n  if (isNode(key) && key.addToJSMap)\n    key.addToJSMap(ctx, map2, value);\n  else if (isMergeKey(ctx, key))\n    addMergeToJSMap(ctx, map2, value);\n  else {\n    const jsKey = toJS(key, \"\", ctx);\n    if (map2 instanceof Map) {\n      map2.set(jsKey, toJS(value, jsKey, ctx));\n    } else if (map2 instanceof Set) {\n      map2.add(jsKey);\n    } else {\n      const stringKey = stringifyKey(key, jsKey, ctx);\n      const jsValue = toJS(value, stringKey, ctx);\n      if (stringKey in map2)\n        Object.defineProperty(map2, stringKey, {\n          value: jsValue,\n          writable: true,\n          enumerable: true,\n          configurable: true\n        });\n      else\n        map2[stringKey] = jsValue;\n    }\n  }\n  return map2;\n}\nfunction stringifyKey(key, jsKey, ctx) {\n  if (jsKey === null)\n    return \"\";\n  if (typeof jsKey !== \"object\")\n    return String(jsKey);\n  if (isNode(key) && (ctx == null ? void 0 : ctx.doc)) {\n    const strCtx = createStringifyContext(ctx.doc, {});\n    strCtx.anchors = /* @__PURE__ */ new Set();\n    for (const node of ctx.anchors.keys())\n      strCtx.anchors.add(node.anchor);\n    strCtx.inFlow = true;\n    strCtx.inStringifyKey = true;\n    const strKey = key.toString(strCtx);\n    if (!ctx.mapKeyWarned) {\n      let jsonStr = JSON.stringify(strKey);\n      if (jsonStr.length > 40)\n        jsonStr = jsonStr.substring(0, 36) + '...\"';\n      warn(ctx.doc.options.logLevel, `Keys with collection values will be stringified due to JS Object restrictions: ${jsonStr}. Set mapAsMap: true to use object keys.`);\n      ctx.mapKeyWarned = true;\n    }\n    return strKey;\n  }\n  return JSON.stringify(jsKey);\n}\n\n// node_modules/yaml/browser/dist/nodes/Pair.js\nfunction createPair(key, value, ctx) {\n  const k2 = createNode(key, void 0, ctx);\n  const v2 = createNode(value, void 0, ctx);\n  return new Pair(k2, v2);\n}\nvar Pair = class _Pair {\n  constructor(key, value = null) {\n    Object.defineProperty(this, NODE_TYPE, { value: PAIR });\n    this.key = key;\n    this.value = value;\n  }\n  clone(schema4) {\n    let { key, value } = this;\n    if (isNode(key))\n      key = key.clone(schema4);\n    if (isNode(value))\n      value = value.clone(schema4);\n    return new _Pair(key, value);\n  }\n  toJSON(_, ctx) {\n    const pair = (ctx == null ? void 0 : ctx.mapAsMap) ? /* @__PURE__ */ new Map() : {};\n    return addPairToJSMap(ctx, pair, this);\n  }\n  toString(ctx, onComment, onChompKeep) {\n    return (ctx == null ? void 0 : ctx.doc) ? stringifyPair(this, ctx, onComment, onChompKeep) : JSON.stringify(this);\n  }\n};\n\n// node_modules/yaml/browser/dist/stringify/stringifyCollection.js\nfunction stringifyCollection(collection, ctx, options) {\n  var _a2;\n  const flow = (_a2 = ctx.inFlow) != null ? _a2 : collection.flow;\n  const stringify6 = flow ? stringifyFlowCollection : stringifyBlockCollection;\n  return stringify6(collection, ctx, options);\n}\nfunction stringifyBlockCollection({ comment, items }, ctx, { blockItemPrefix, flowChars, itemIndent, onChompKeep, onComment }) {\n  const { indent, options: { commentString } } = ctx;\n  const itemCtx = Object.assign({}, ctx, { indent: itemIndent, type: null });\n  let chompKeep = false;\n  const lines = [];\n  for (let i = 0; i < items.length; ++i) {\n    const item = items[i];\n    let comment2 = null;\n    if (isNode(item)) {\n      if (!chompKeep && item.spaceBefore)\n        lines.push(\"\");\n      addCommentBefore(ctx, lines, item.commentBefore, chompKeep);\n      if (item.comment)\n        comment2 = item.comment;\n    } else if (isPair(item)) {\n      const ik = isNode(item.key) ? item.key : null;\n      if (ik) {\n        if (!chompKeep && ik.spaceBefore)\n          lines.push(\"\");\n        addCommentBefore(ctx, lines, ik.commentBefore, chompKeep);\n      }\n    }\n    chompKeep = false;\n    let str2 = stringify(item, itemCtx, () => comment2 = null, () => chompKeep = true);\n    if (comment2)\n      str2 += lineComment(str2, itemIndent, commentString(comment2));\n    if (chompKeep && comment2)\n      chompKeep = false;\n    lines.push(blockItemPrefix + str2);\n  }\n  let str;\n  if (lines.length === 0) {\n    str = flowChars.start + flowChars.end;\n  } else {\n    str = lines[0];\n    for (let i = 1; i < lines.length; ++i) {\n      const line = lines[i];\n      str += line ? `\n${indent}${line}` : \"\\n\";\n    }\n  }\n  if (comment) {\n    str += \"\\n\" + indentComment(commentString(comment), indent);\n    if (onComment)\n      onComment();\n  } else if (chompKeep && onChompKeep)\n    onChompKeep();\n  return str;\n}\nfunction stringifyFlowCollection({ items }, ctx, { flowChars, itemIndent }) {\n  const { indent, indentStep, flowCollectionPadding: fcPadding, options: { commentString } } = ctx;\n  itemIndent += indentStep;\n  const itemCtx = Object.assign({}, ctx, {\n    indent: itemIndent,\n    inFlow: true,\n    type: null\n  });\n  let reqNewline = false;\n  let linesAtValue = 0;\n  const lines = [];\n  for (let i = 0; i < items.length; ++i) {\n    const item = items[i];\n    let comment = null;\n    if (isNode(item)) {\n      if (item.spaceBefore)\n        lines.push(\"\");\n      addCommentBefore(ctx, lines, item.commentBefore, false);\n      if (item.comment)\n        comment = item.comment;\n    } else if (isPair(item)) {\n      const ik = isNode(item.key) ? item.key : null;\n      if (ik) {\n        if (ik.spaceBefore)\n          lines.push(\"\");\n        addCommentBefore(ctx, lines, ik.commentBefore, false);\n        if (ik.comment)\n          reqNewline = true;\n      }\n      const iv = isNode(item.value) ? item.value : null;\n      if (iv) {\n        if (iv.comment)\n          comment = iv.comment;\n        if (iv.commentBefore)\n          reqNewline = true;\n      } else if (item.value == null && (ik == null ? void 0 : ik.comment)) {\n        comment = ik.comment;\n      }\n    }\n    if (comment)\n      reqNewline = true;\n    let str = stringify(item, itemCtx, () => comment = null);\n    if (i < items.length - 1)\n      str += \",\";\n    if (comment)\n      str += lineComment(str, itemIndent, commentString(comment));\n    if (!reqNewline && (lines.length > linesAtValue || str.includes(\"\\n\")))\n      reqNewline = true;\n    lines.push(str);\n    linesAtValue = lines.length;\n  }\n  const { start, end } = flowChars;\n  if (lines.length === 0) {\n    return start + end;\n  } else {\n    if (!reqNewline) {\n      const len = lines.reduce((sum, line) => sum + line.length + 2, 2);\n      reqNewline = ctx.options.lineWidth > 0 && len > ctx.options.lineWidth;\n    }\n    if (reqNewline) {\n      let str = start;\n      for (const line of lines)\n        str += line ? `\n${indentStep}${indent}${line}` : \"\\n\";\n      return `${str}\n${indent}${end}`;\n    } else {\n      return `${start}${fcPadding}${lines.join(\" \")}${fcPadding}${end}`;\n    }\n  }\n}\nfunction addCommentBefore({ indent, options: { commentString } }, lines, comment, chompKeep) {\n  if (comment && chompKeep)\n    comment = comment.replace(/^\\n+/, \"\");\n  if (comment) {\n    const ic = indentComment(commentString(comment), indent);\n    lines.push(ic.trimStart());\n  }\n}\n\n// node_modules/yaml/browser/dist/nodes/YAMLMap.js\nfunction findPair(items, key) {\n  const k2 = isScalar(key) ? key.value : key;\n  for (const it of items) {\n    if (isPair(it)) {\n      if (it.key === key || it.key === k2)\n        return it;\n      if (isScalar(it.key) && it.key.value === k2)\n        return it;\n    }\n  }\n  return void 0;\n}\nvar YAMLMap = class extends Collection {\n  static get tagName() {\n    return \"tag:yaml.org,2002:map\";\n  }\n  constructor(schema4) {\n    super(MAP, schema4);\n    this.items = [];\n  }\n  /**\n   * A generic collection parsing method that can be extended\n   * to other node classes that inherit from YAMLMap\n   */\n  static from(schema4, obj, ctx) {\n    const { keepUndefined, replacer } = ctx;\n    const map2 = new this(schema4);\n    const add = (key, value) => {\n      if (typeof replacer === \"function\")\n        value = replacer.call(obj, key, value);\n      else if (Array.isArray(replacer) && !replacer.includes(key))\n        return;\n      if (value !== void 0 || keepUndefined)\n        map2.items.push(createPair(key, value, ctx));\n    };\n    if (obj instanceof Map) {\n      for (const [key, value] of obj)\n        add(key, value);\n    } else if (obj && typeof obj === \"object\") {\n      for (const key of Object.keys(obj))\n        add(key, obj[key]);\n    }\n    if (typeof schema4.sortMapEntries === \"function\") {\n      map2.items.sort(schema4.sortMapEntries);\n    }\n    return map2;\n  }\n  /**\n   * Adds a value to the collection.\n   *\n   * @param overwrite - If not set `true`, using a key that is already in the\n   *   collection will throw. Otherwise, overwrites the previous value.\n   */\n  add(pair, overwrite) {\n    var _a2;\n    let _pair;\n    if (isPair(pair))\n      _pair = pair;\n    else if (!pair || typeof pair !== \"object\" || !(\"key\" in pair)) {\n      _pair = new Pair(pair, pair == null ? void 0 : pair.value);\n    } else\n      _pair = new Pair(pair.key, pair.value);\n    const prev = findPair(this.items, _pair.key);\n    const sortEntries = (_a2 = this.schema) == null ? void 0 : _a2.sortMapEntries;\n    if (prev) {\n      if (!overwrite)\n        throw new Error(`Key ${_pair.key} already set`);\n      if (isScalar(prev.value) && isScalarValue(_pair.value))\n        prev.value.value = _pair.value;\n      else\n        prev.value = _pair.value;\n    } else if (sortEntries) {\n      const i = this.items.findIndex((item) => sortEntries(_pair, item) < 0);\n      if (i === -1)\n        this.items.push(_pair);\n      else\n        this.items.splice(i, 0, _pair);\n    } else {\n      this.items.push(_pair);\n    }\n  }\n  delete(key) {\n    const it = findPair(this.items, key);\n    if (!it)\n      return false;\n    const del = this.items.splice(this.items.indexOf(it), 1);\n    return del.length > 0;\n  }\n  get(key, keepScalar) {\n    var _a2;\n    const it = findPair(this.items, key);\n    const node = it == null ? void 0 : it.value;\n    return (_a2 = !keepScalar && isScalar(node) ? node.value : node) != null ? _a2 : void 0;\n  }\n  has(key) {\n    return !!findPair(this.items, key);\n  }\n  set(key, value) {\n    this.add(new Pair(key, value), true);\n  }\n  /**\n   * @param ctx - Conversion context, originally set in Document#toJS()\n   * @param {Class} Type - If set, forces the returned collection type\n   * @returns Instance of Type, Map, or Object\n   */\n  toJSON(_, ctx, Type) {\n    const map2 = Type ? new Type() : (ctx == null ? void 0 : ctx.mapAsMap) ? /* @__PURE__ */ new Map() : {};\n    if (ctx == null ? void 0 : ctx.onCreate)\n      ctx.onCreate(map2);\n    for (const item of this.items)\n      addPairToJSMap(ctx, map2, item);\n    return map2;\n  }\n  toString(ctx, onComment, onChompKeep) {\n    if (!ctx)\n      return JSON.stringify(this);\n    for (const item of this.items) {\n      if (!isPair(item))\n        throw new Error(`Map items must all be pairs; found ${JSON.stringify(item)} instead`);\n    }\n    if (!ctx.allNullValues && this.hasAllNullValues(false))\n      ctx = Object.assign({}, ctx, { allNullValues: true });\n    return stringifyCollection(this, ctx, {\n      blockItemPrefix: \"\",\n      flowChars: { start: \"{\", end: \"}\" },\n      itemIndent: ctx.indent || \"\",\n      onChompKeep,\n      onComment\n    });\n  }\n};\n\n// node_modules/yaml/browser/dist/schema/common/map.js\nvar map = {\n  collection: \"map\",\n  default: true,\n  nodeClass: YAMLMap,\n  tag: \"tag:yaml.org,2002:map\",\n  resolve(map2, onError) {\n    if (!isMap(map2))\n      onError(\"Expected a mapping for this tag\");\n    return map2;\n  },\n  createNode: (schema4, obj, ctx) => YAMLMap.from(schema4, obj, ctx)\n};\n\n// node_modules/yaml/browser/dist/nodes/YAMLSeq.js\nvar YAMLSeq = class extends Collection {\n  static get tagName() {\n    return \"tag:yaml.org,2002:seq\";\n  }\n  constructor(schema4) {\n    super(SEQ, schema4);\n    this.items = [];\n  }\n  add(value) {\n    this.items.push(value);\n  }\n  /**\n   * Removes a value from the collection.\n   *\n   * `key` must contain a representation of an integer for this to succeed.\n   * It may be wrapped in a `Scalar`.\n   *\n   * @returns `true` if the item was found and removed.\n   */\n  delete(key) {\n    const idx = asItemIndex(key);\n    if (typeof idx !== \"number\")\n      return false;\n    const del = this.items.splice(idx, 1);\n    return del.length > 0;\n  }\n  get(key, keepScalar) {\n    const idx = asItemIndex(key);\n    if (typeof idx !== \"number\")\n      return void 0;\n    const it = this.items[idx];\n    return !keepScalar && isScalar(it) ? it.value : it;\n  }\n  /**\n   * Checks if the collection includes a value with the key `key`.\n   *\n   * `key` must contain a representation of an integer for this to succeed.\n   * It may be wrapped in a `Scalar`.\n   */\n  has(key) {\n    const idx = asItemIndex(key);\n    return typeof idx === \"number\" && idx < this.items.length;\n  }\n  /**\n   * Sets a value in this collection. For `!!set`, `value` needs to be a\n   * boolean to add/remove the item from the set.\n   *\n   * If `key` does not contain a representation of an integer, this will throw.\n   * It may be wrapped in a `Scalar`.\n   */\n  set(key, value) {\n    const idx = asItemIndex(key);\n    if (typeof idx !== \"number\")\n      throw new Error(`Expected a valid index, not ${key}.`);\n    const prev = this.items[idx];\n    if (isScalar(prev) && isScalarValue(value))\n      prev.value = value;\n    else\n      this.items[idx] = value;\n  }\n  toJSON(_, ctx) {\n    const seq2 = [];\n    if (ctx == null ? void 0 : ctx.onCreate)\n      ctx.onCreate(seq2);\n    let i = 0;\n    for (const item of this.items)\n      seq2.push(toJS(item, String(i++), ctx));\n    return seq2;\n  }\n  toString(ctx, onComment, onChompKeep) {\n    if (!ctx)\n      return JSON.stringify(this);\n    return stringifyCollection(this, ctx, {\n      blockItemPrefix: \"- \",\n      flowChars: { start: \"[\", end: \"]\" },\n      itemIndent: (ctx.indent || \"\") + \"  \",\n      onChompKeep,\n      onComment\n    });\n  }\n  static from(schema4, obj, ctx) {\n    const { replacer } = ctx;\n    const seq2 = new this(schema4);\n    if (obj && Symbol.iterator in Object(obj)) {\n      let i = 0;\n      for (let it of obj) {\n        if (typeof replacer === \"function\") {\n          const key = obj instanceof Set ? it : String(i++);\n          it = replacer.call(obj, key, it);\n        }\n        seq2.items.push(createNode(it, void 0, ctx));\n      }\n    }\n    return seq2;\n  }\n};\nfunction asItemIndex(key) {\n  let idx = isScalar(key) ? key.value : key;\n  if (idx && typeof idx === \"string\")\n    idx = Number(idx);\n  return typeof idx === \"number\" && Number.isInteger(idx) && idx >= 0 ? idx : null;\n}\n\n// node_modules/yaml/browser/dist/schema/common/seq.js\nvar seq = {\n  collection: \"seq\",\n  default: true,\n  nodeClass: YAMLSeq,\n  tag: \"tag:yaml.org,2002:seq\",\n  resolve(seq2, onError) {\n    if (!isSeq(seq2))\n      onError(\"Expected a sequence for this tag\");\n    return seq2;\n  },\n  createNode: (schema4, obj, ctx) => YAMLSeq.from(schema4, obj, ctx)\n};\n\n// node_modules/yaml/browser/dist/schema/common/string.js\nvar string = {\n  identify: (value) => typeof value === \"string\",\n  default: true,\n  tag: \"tag:yaml.org,2002:str\",\n  resolve: (str) => str,\n  stringify(item, ctx, onComment, onChompKeep) {\n    ctx = Object.assign({ actualString: true }, ctx);\n    return stringifyString(item, ctx, onComment, onChompKeep);\n  }\n};\n\n// node_modules/yaml/browser/dist/schema/common/null.js\nvar nullTag = {\n  identify: (value) => value == null,\n  createNode: () => new Scalar(null),\n  default: true,\n  tag: \"tag:yaml.org,2002:null\",\n  test: /^(?:~|[Nn]ull|NULL)?$/,\n  resolve: () => new Scalar(null),\n  stringify: ({ source }, ctx) => typeof source === \"string\" && nullTag.test.test(source) ? source : ctx.options.nullStr\n};\n\n// node_modules/yaml/browser/dist/schema/core/bool.js\nvar boolTag = {\n  identify: (value) => typeof value === \"boolean\",\n  default: true,\n  tag: \"tag:yaml.org,2002:bool\",\n  test: /^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,\n  resolve: (str) => new Scalar(str[0] === \"t\" || str[0] === \"T\"),\n  stringify({ source, value }, ctx) {\n    if (source && boolTag.test.test(source)) {\n      const sv = source[0] === \"t\" || source[0] === \"T\";\n      if (value === sv)\n        return source;\n    }\n    return value ? ctx.options.trueStr : ctx.options.falseStr;\n  }\n};\n\n// node_modules/yaml/browser/dist/stringify/stringifyNumber.js\nfunction stringifyNumber({ format, minFractionDigits, tag, value }) {\n  if (typeof value === \"bigint\")\n    return String(value);\n  const num = typeof value === \"number\" ? value : Number(value);\n  if (!isFinite(num))\n    return isNaN(num) ? \".nan\" : num < 0 ? \"-.inf\" : \".inf\";\n  let n4 = Object.is(value, -0) ? \"-0\" : JSON.stringify(value);\n  if (!format && minFractionDigits && (!tag || tag === \"tag:yaml.org,2002:float\") && /^\\d/.test(n4)) {\n    let i = n4.indexOf(\".\");\n    if (i < 0) {\n      i = n4.length;\n      n4 += \".\";\n    }\n    let d = minFractionDigits - (n4.length - i - 1);\n    while (d-- > 0)\n      n4 += \"0\";\n  }\n  return n4;\n}\n\n// node_modules/yaml/browser/dist/schema/core/float.js\nvar floatNaN = {\n  identify: (value) => typeof value === \"number\",\n  default: true,\n  tag: \"tag:yaml.org,2002:float\",\n  test: /^(?:[-+]?\\.(?:inf|Inf|INF)|\\.nan|\\.NaN|\\.NAN)$/,\n  resolve: (str) => str.slice(-3).toLowerCase() === \"nan\" ? NaN : str[0] === \"-\" ? Number.NEGATIVE_INFINITY : Number.POSITIVE_INFINITY,\n  stringify: stringifyNumber\n};\nvar floatExp = {\n  identify: (value) => typeof value === \"number\",\n  default: true,\n  tag: \"tag:yaml.org,2002:float\",\n  format: \"EXP\",\n  test: /^[-+]?(?:\\.[0-9]+|[0-9]+(?:\\.[0-9]*)?)[eE][-+]?[0-9]+$/,\n  resolve: (str) => parseFloat(str),\n  stringify(node) {\n    const num = Number(node.value);\n    return isFinite(num) ? num.toExponential() : stringifyNumber(node);\n  }\n};\nvar float = {\n  identify: (value) => typeof value === \"number\",\n  default: true,\n  tag: \"tag:yaml.org,2002:float\",\n  test: /^[-+]?(?:\\.[0-9]+|[0-9]+\\.[0-9]*)$/,\n  resolve(str) {\n    const node = new Scalar(parseFloat(str));\n    const dot = str.indexOf(\".\");\n    if (dot !== -1 && str[str.length - 1] === \"0\")\n      node.minFractionDigits = str.length - dot - 1;\n    return node;\n  },\n  stringify: stringifyNumber\n};\n\n// node_modules/yaml/browser/dist/schema/core/int.js\nvar intIdentify = (value) => typeof value === \"bigint\" || Number.isInteger(value);\nvar intResolve = (str, offset, radix, { intAsBigInt }) => intAsBigInt ? BigInt(str) : parseInt(str.substring(offset), radix);\nfunction intStringify(node, radix, prefix) {\n  const { value } = node;\n  if (intIdentify(value) && value >= 0)\n    return prefix + value.toString(radix);\n  return stringifyNumber(node);\n}\nvar intOct = {\n  identify: (value) => intIdentify(value) && value >= 0,\n  default: true,\n  tag: \"tag:yaml.org,2002:int\",\n  format: \"OCT\",\n  test: /^0o[0-7]+$/,\n  resolve: (str, _onError, opt) => intResolve(str, 2, 8, opt),\n  stringify: (node) => intStringify(node, 8, \"0o\")\n};\nvar int = {\n  identify: intIdentify,\n  default: true,\n  tag: \"tag:yaml.org,2002:int\",\n  test: /^[-+]?[0-9]+$/,\n  resolve: (str, _onError, opt) => intResolve(str, 0, 10, opt),\n  stringify: stringifyNumber\n};\nvar intHex = {\n  identify: (value) => intIdentify(value) && value >= 0,\n  default: true,\n  tag: \"tag:yaml.org,2002:int\",\n  format: \"HEX\",\n  test: /^0x[0-9a-fA-F]+$/,\n  resolve: (str, _onError, opt) => intResolve(str, 2, 16, opt),\n  stringify: (node) => intStringify(node, 16, \"0x\")\n};\n\n// node_modules/yaml/browser/dist/schema/core/schema.js\nvar schema = [\n  map,\n  seq,\n  string,\n  nullTag,\n  boolTag,\n  intOct,\n  int,\n  intHex,\n  floatNaN,\n  floatExp,\n  float\n];\n\n// node_modules/yaml/browser/dist/schema/json/schema.js\nfunction intIdentify2(value) {\n  return typeof value === \"bigint\" || Number.isInteger(value);\n}\nvar stringifyJSON = ({ value }) => JSON.stringify(value);\nvar jsonScalars = [\n  {\n    identify: (value) => typeof value === \"string\",\n    default: true,\n    tag: \"tag:yaml.org,2002:str\",\n    resolve: (str) => str,\n    stringify: stringifyJSON\n  },\n  {\n    identify: (value) => value == null,\n    createNode: () => new Scalar(null),\n    default: true,\n    tag: \"tag:yaml.org,2002:null\",\n    test: /^null$/,\n    resolve: () => null,\n    stringify: stringifyJSON\n  },\n  {\n    identify: (value) => typeof value === \"boolean\",\n    default: true,\n    tag: \"tag:yaml.org,2002:bool\",\n    test: /^true$|^false$/,\n    resolve: (str) => str === \"true\",\n    stringify: stringifyJSON\n  },\n  {\n    identify: intIdentify2,\n    default: true,\n    tag: \"tag:yaml.org,2002:int\",\n    test: /^-?(?:0|[1-9][0-9]*)$/,\n    resolve: (str, _onError, { intAsBigInt }) => intAsBigInt ? BigInt(str) : parseInt(str, 10),\n    stringify: ({ value }) => intIdentify2(value) ? value.toString() : JSON.stringify(value)\n  },\n  {\n    identify: (value) => typeof value === \"number\",\n    default: true,\n    tag: \"tag:yaml.org,2002:float\",\n    test: /^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,\n    resolve: (str) => parseFloat(str),\n    stringify: stringifyJSON\n  }\n];\nvar jsonError = {\n  default: true,\n  tag: \"\",\n  test: /^/,\n  resolve(str, onError) {\n    onError(`Unresolved plain scalar ${JSON.stringify(str)}`);\n    return str;\n  }\n};\nvar schema2 = [map, seq].concat(jsonScalars, jsonError);\n\n// node_modules/yaml/browser/dist/schema/yaml-1.1/binary.js\nvar binary = {\n  identify: (value) => value instanceof Uint8Array,\n  // Buffer inherits from Uint8Array\n  default: false,\n  tag: \"tag:yaml.org,2002:binary\",\n  /**\n   * Returns a Buffer in node and an Uint8Array in browsers\n   *\n   * To use the resulting buffer as an image, you'll want to do something like:\n   *\n   *   const blob = new Blob([buffer], { type: 'image/jpeg' })\n   *   document.querySelector('#photo').src = URL.createObjectURL(blob)\n   */\n  resolve(src, onError) {\n    if (typeof atob === \"function\") {\n      const str = atob(src.replace(/[\\n\\r]/g, \"\"));\n      const buffer = new Uint8Array(str.length);\n      for (let i = 0; i < str.length; ++i)\n        buffer[i] = str.charCodeAt(i);\n      return buffer;\n    } else {\n      onError(\"This environment does not support reading binary tags; either Buffer or atob is required\");\n      return src;\n    }\n  },\n  stringify({ comment, type, value }, ctx, onComment, onChompKeep) {\n    if (!value)\n      return \"\";\n    const buf = value;\n    let str;\n    if (typeof btoa === \"function\") {\n      let s = \"\";\n      for (let i = 0; i < buf.length; ++i)\n        s += String.fromCharCode(buf[i]);\n      str = btoa(s);\n    } else {\n      throw new Error(\"This environment does not support writing binary tags; either Buffer or btoa is required\");\n    }\n    type != null ? type : type = Scalar.BLOCK_LITERAL;\n    if (type !== Scalar.QUOTE_DOUBLE) {\n      const lineWidth = Math.max(ctx.options.lineWidth - ctx.indent.length, ctx.options.minContentWidth);\n      const n4 = Math.ceil(str.length / lineWidth);\n      const lines = new Array(n4);\n      for (let i = 0, o3 = 0; i < n4; ++i, o3 += lineWidth) {\n        lines[i] = str.substr(o3, lineWidth);\n      }\n      str = lines.join(type === Scalar.BLOCK_LITERAL ? \"\\n\" : \" \");\n    }\n    return stringifyString({ comment, type, value: str }, ctx, onComment, onChompKeep);\n  }\n};\n\n// node_modules/yaml/browser/dist/schema/yaml-1.1/pairs.js\nfunction resolvePairs(seq2, onError) {\n  var _a2;\n  if (isSeq(seq2)) {\n    for (let i = 0; i < seq2.items.length; ++i) {\n      let item = seq2.items[i];\n      if (isPair(item))\n        continue;\n      else if (isMap(item)) {\n        if (item.items.length > 1)\n          onError(\"Each pair must have its own sequence indicator\");\n        const pair = item.items[0] || new Pair(new Scalar(null));\n        if (item.commentBefore)\n          pair.key.commentBefore = pair.key.commentBefore ? `${item.commentBefore}\n${pair.key.commentBefore}` : item.commentBefore;\n        if (item.comment) {\n          const cn = (_a2 = pair.value) != null ? _a2 : pair.key;\n          cn.comment = cn.comment ? `${item.comment}\n${cn.comment}` : item.comment;\n        }\n        item = pair;\n      }\n      seq2.items[i] = isPair(item) ? item : new Pair(item);\n    }\n  } else\n    onError(\"Expected a sequence for this tag\");\n  return seq2;\n}\nfunction createPairs(schema4, iterable, ctx) {\n  const { replacer } = ctx;\n  const pairs2 = new YAMLSeq(schema4);\n  pairs2.tag = \"tag:yaml.org,2002:pairs\";\n  let i = 0;\n  if (iterable && Symbol.iterator in Object(iterable))\n    for (let it of iterable) {\n      if (typeof replacer === \"function\")\n        it = replacer.call(iterable, String(i++), it);\n      let key, value;\n      if (Array.isArray(it)) {\n        if (it.length === 2) {\n          key = it[0];\n          value = it[1];\n        } else\n          throw new TypeError(`Expected [key, value] tuple: ${it}`);\n      } else if (it && it instanceof Object) {\n        const keys = Object.keys(it);\n        if (keys.length === 1) {\n          key = keys[0];\n          value = it[key];\n        } else {\n          throw new TypeError(`Expected tuple with one key, not ${keys.length} keys`);\n        }\n      } else {\n        key = it;\n      }\n      pairs2.items.push(createPair(key, value, ctx));\n    }\n  return pairs2;\n}\nvar pairs = {\n  collection: \"seq\",\n  default: false,\n  tag: \"tag:yaml.org,2002:pairs\",\n  resolve: resolvePairs,\n  createNode: createPairs\n};\n\n// node_modules/yaml/browser/dist/schema/yaml-1.1/omap.js\nvar YAMLOMap = class _YAMLOMap extends YAMLSeq {\n  constructor() {\n    super();\n    this.add = YAMLMap.prototype.add.bind(this);\n    this.delete = YAMLMap.prototype.delete.bind(this);\n    this.get = YAMLMap.prototype.get.bind(this);\n    this.has = YAMLMap.prototype.has.bind(this);\n    this.set = YAMLMap.prototype.set.bind(this);\n    this.tag = _YAMLOMap.tag;\n  }\n  /**\n   * If `ctx` is given, the return type is actually `Map<unknown, unknown>`,\n   * but TypeScript won't allow widening the signature of a child method.\n   */\n  toJSON(_, ctx) {\n    if (!ctx)\n      return super.toJSON(_);\n    const map2 = /* @__PURE__ */ new Map();\n    if (ctx == null ? void 0 : ctx.onCreate)\n      ctx.onCreate(map2);\n    for (const pair of this.items) {\n      let key, value;\n      if (isPair(pair)) {\n        key = toJS(pair.key, \"\", ctx);\n        value = toJS(pair.value, key, ctx);\n      } else {\n        key = toJS(pair, \"\", ctx);\n      }\n      if (map2.has(key))\n        throw new Error(\"Ordered maps must not include duplicate keys\");\n      map2.set(key, value);\n    }\n    return map2;\n  }\n  static from(schema4, iterable, ctx) {\n    const pairs2 = createPairs(schema4, iterable, ctx);\n    const omap2 = new this();\n    omap2.items = pairs2.items;\n    return omap2;\n  }\n};\nYAMLOMap.tag = \"tag:yaml.org,2002:omap\";\nvar omap = {\n  collection: \"seq\",\n  identify: (value) => value instanceof Map,\n  nodeClass: YAMLOMap,\n  default: false,\n  tag: \"tag:yaml.org,2002:omap\",\n  resolve(seq2, onError) {\n    const pairs2 = resolvePairs(seq2, onError);\n    const seenKeys = [];\n    for (const { key } of pairs2.items) {\n      if (isScalar(key)) {\n        if (seenKeys.includes(key.value)) {\n          onError(`Ordered maps must not include duplicate keys: ${key.value}`);\n        } else {\n          seenKeys.push(key.value);\n        }\n      }\n    }\n    return Object.assign(new YAMLOMap(), pairs2);\n  },\n  createNode: (schema4, iterable, ctx) => YAMLOMap.from(schema4, iterable, ctx)\n};\n\n// node_modules/yaml/browser/dist/schema/yaml-1.1/bool.js\nfunction boolStringify({ value, source }, ctx) {\n  const boolObj = value ? trueTag : falseTag;\n  if (source && boolObj.test.test(source))\n    return source;\n  return value ? ctx.options.trueStr : ctx.options.falseStr;\n}\nvar trueTag = {\n  identify: (value) => value === true,\n  default: true,\n  tag: \"tag:yaml.org,2002:bool\",\n  test: /^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,\n  resolve: () => new Scalar(true),\n  stringify: boolStringify\n};\nvar falseTag = {\n  identify: (value) => value === false,\n  default: true,\n  tag: \"tag:yaml.org,2002:bool\",\n  test: /^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,\n  resolve: () => new Scalar(false),\n  stringify: boolStringify\n};\n\n// node_modules/yaml/browser/dist/schema/yaml-1.1/float.js\nvar floatNaN2 = {\n  identify: (value) => typeof value === \"number\",\n  default: true,\n  tag: \"tag:yaml.org,2002:float\",\n  test: /^(?:[-+]?\\.(?:inf|Inf|INF)|\\.nan|\\.NaN|\\.NAN)$/,\n  resolve: (str) => str.slice(-3).toLowerCase() === \"nan\" ? NaN : str[0] === \"-\" ? Number.NEGATIVE_INFINITY : Number.POSITIVE_INFINITY,\n  stringify: stringifyNumber\n};\nvar floatExp2 = {\n  identify: (value) => typeof value === \"number\",\n  default: true,\n  tag: \"tag:yaml.org,2002:float\",\n  format: \"EXP\",\n  test: /^[-+]?(?:[0-9][0-9_]*)?(?:\\.[0-9_]*)?[eE][-+]?[0-9]+$/,\n  resolve: (str) => parseFloat(str.replace(/_/g, \"\")),\n  stringify(node) {\n    const num = Number(node.value);\n    return isFinite(num) ? num.toExponential() : stringifyNumber(node);\n  }\n};\nvar float2 = {\n  identify: (value) => typeof value === \"number\",\n  default: true,\n  tag: \"tag:yaml.org,2002:float\",\n  test: /^[-+]?(?:[0-9][0-9_]*)?\\.[0-9_]*$/,\n  resolve(str) {\n    const node = new Scalar(parseFloat(str.replace(/_/g, \"\")));\n    const dot = str.indexOf(\".\");\n    if (dot !== -1) {\n      const f2 = str.substring(dot + 1).replace(/_/g, \"\");\n      if (f2[f2.length - 1] === \"0\")\n        node.minFractionDigits = f2.length;\n    }\n    return node;\n  },\n  stringify: stringifyNumber\n};\n\n// node_modules/yaml/browser/dist/schema/yaml-1.1/int.js\nvar intIdentify3 = (value) => typeof value === \"bigint\" || Number.isInteger(value);\nfunction intResolve2(str, offset, radix, { intAsBigInt }) {\n  const sign = str[0];\n  if (sign === \"-\" || sign === \"+\")\n    offset += 1;\n  str = str.substring(offset).replace(/_/g, \"\");\n  if (intAsBigInt) {\n    switch (radix) {\n      case 2:\n        str = `0b${str}`;\n        break;\n      case 8:\n        str = `0o${str}`;\n        break;\n      case 16:\n        str = `0x${str}`;\n        break;\n    }\n    const n5 = BigInt(str);\n    return sign === \"-\" ? BigInt(-1) * n5 : n5;\n  }\n  const n4 = parseInt(str, radix);\n  return sign === \"-\" ? -1 * n4 : n4;\n}\nfunction intStringify2(node, radix, prefix) {\n  const { value } = node;\n  if (intIdentify3(value)) {\n    const str = value.toString(radix);\n    return value < 0 ? \"-\" + prefix + str.substr(1) : prefix + str;\n  }\n  return stringifyNumber(node);\n}\nvar intBin = {\n  identify: intIdentify3,\n  default: true,\n  tag: \"tag:yaml.org,2002:int\",\n  format: \"BIN\",\n  test: /^[-+]?0b[0-1_]+$/,\n  resolve: (str, _onError, opt) => intResolve2(str, 2, 2, opt),\n  stringify: (node) => intStringify2(node, 2, \"0b\")\n};\nvar intOct2 = {\n  identify: intIdentify3,\n  default: true,\n  tag: \"tag:yaml.org,2002:int\",\n  format: \"OCT\",\n  test: /^[-+]?0[0-7_]+$/,\n  resolve: (str, _onError, opt) => intResolve2(str, 1, 8, opt),\n  stringify: (node) => intStringify2(node, 8, \"0\")\n};\nvar int2 = {\n  identify: intIdentify3,\n  default: true,\n  tag: \"tag:yaml.org,2002:int\",\n  test: /^[-+]?[0-9][0-9_]*$/,\n  resolve: (str, _onError, opt) => intResolve2(str, 0, 10, opt),\n  stringify: stringifyNumber\n};\nvar intHex2 = {\n  identify: intIdentify3,\n  default: true,\n  tag: \"tag:yaml.org,2002:int\",\n  format: \"HEX\",\n  test: /^[-+]?0x[0-9a-fA-F_]+$/,\n  resolve: (str, _onError, opt) => intResolve2(str, 2, 16, opt),\n  stringify: (node) => intStringify2(node, 16, \"0x\")\n};\n\n// node_modules/yaml/browser/dist/schema/yaml-1.1/set.js\nvar YAMLSet = class _YAMLSet extends YAMLMap {\n  constructor(schema4) {\n    super(schema4);\n    this.tag = _YAMLSet.tag;\n  }\n  add(key) {\n    let pair;\n    if (isPair(key))\n      pair = key;\n    else if (key && typeof key === \"object\" && \"key\" in key && \"value\" in key && key.value === null)\n      pair = new Pair(key.key, null);\n    else\n      pair = new Pair(key, null);\n    const prev = findPair(this.items, pair.key);\n    if (!prev)\n      this.items.push(pair);\n  }\n  /**\n   * If `keepPair` is `true`, returns the Pair matching `key`.\n   * Otherwise, returns the value of that Pair's key.\n   */\n  get(key, keepPair) {\n    const pair = findPair(this.items, key);\n    return !keepPair && isPair(pair) ? isScalar(pair.key) ? pair.key.value : pair.key : pair;\n  }\n  set(key, value) {\n    if (typeof value !== \"boolean\")\n      throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof value}`);\n    const prev = findPair(this.items, key);\n    if (prev && !value) {\n      this.items.splice(this.items.indexOf(prev), 1);\n    } else if (!prev && value) {\n      this.items.push(new Pair(key));\n    }\n  }\n  toJSON(_, ctx) {\n    return super.toJSON(_, ctx, Set);\n  }\n  toString(ctx, onComment, onChompKeep) {\n    if (!ctx)\n      return JSON.stringify(this);\n    if (this.hasAllNullValues(true))\n      return super.toString(Object.assign({}, ctx, { allNullValues: true }), onComment, onChompKeep);\n    else\n      throw new Error(\"Set items must all have null values\");\n  }\n  static from(schema4, iterable, ctx) {\n    const { replacer } = ctx;\n    const set2 = new this(schema4);\n    if (iterable && Symbol.iterator in Object(iterable))\n      for (let value of iterable) {\n        if (typeof replacer === \"function\")\n          value = replacer.call(iterable, value, value);\n        set2.items.push(createPair(value, null, ctx));\n      }\n    return set2;\n  }\n};\nYAMLSet.tag = \"tag:yaml.org,2002:set\";\nvar set = {\n  collection: \"map\",\n  identify: (value) => value instanceof Set,\n  nodeClass: YAMLSet,\n  default: false,\n  tag: \"tag:yaml.org,2002:set\",\n  createNode: (schema4, iterable, ctx) => YAMLSet.from(schema4, iterable, ctx),\n  resolve(map2, onError) {\n    if (isMap(map2)) {\n      if (map2.hasAllNullValues(true))\n        return Object.assign(new YAMLSet(), map2);\n      else\n        onError(\"Set items must all have null values\");\n    } else\n      onError(\"Expected a mapping for this tag\");\n    return map2;\n  }\n};\n\n// node_modules/yaml/browser/dist/schema/yaml-1.1/timestamp.js\nfunction parseSexagesimal(str, asBigInt) {\n  const sign = str[0];\n  const parts = sign === \"-\" || sign === \"+\" ? str.substring(1) : str;\n  const num = (n4) => asBigInt ? BigInt(n4) : Number(n4);\n  const res = parts.replace(/_/g, \"\").split(\":\").reduce((res2, p2) => res2 * num(60) + num(p2), num(0));\n  return sign === \"-\" ? num(-1) * res : res;\n}\nfunction stringifySexagesimal(node) {\n  let { value } = node;\n  let num = (n4) => n4;\n  if (typeof value === \"bigint\")\n    num = (n4) => BigInt(n4);\n  else if (isNaN(value) || !isFinite(value))\n    return stringifyNumber(node);\n  let sign = \"\";\n  if (value < 0) {\n    sign = \"-\";\n    value *= num(-1);\n  }\n  const _60 = num(60);\n  const parts = [value % _60];\n  if (value < 60) {\n    parts.unshift(0);\n  } else {\n    value = (value - parts[0]) / _60;\n    parts.unshift(value % _60);\n    if (value >= 60) {\n      value = (value - parts[0]) / _60;\n      parts.unshift(value);\n    }\n  }\n  return sign + parts.map((n4) => String(n4).padStart(2, \"0\")).join(\":\").replace(/000000\\d*$/, \"\");\n}\nvar intTime = {\n  identify: (value) => typeof value === \"bigint\" || Number.isInteger(value),\n  default: true,\n  tag: \"tag:yaml.org,2002:int\",\n  format: \"TIME\",\n  test: /^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,\n  resolve: (str, _onError, { intAsBigInt }) => parseSexagesimal(str, intAsBigInt),\n  stringify: stringifySexagesimal\n};\nvar floatTime = {\n  identify: (value) => typeof value === \"number\",\n  default: true,\n  tag: \"tag:yaml.org,2002:float\",\n  format: \"TIME\",\n  test: /^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*$/,\n  resolve: (str) => parseSexagesimal(str, false),\n  stringify: stringifySexagesimal\n};\nvar timestamp = {\n  identify: (value) => value instanceof Date,\n  default: true,\n  tag: \"tag:yaml.org,2002:timestamp\",\n  // If the time zone is omitted, the timestamp is assumed to be specified in UTC. The time part\n  // may be omitted altogether, resulting in a date format. In such a case, the time part is\n  // assumed to be 00:00:00Z (start of day, UTC).\n  test: RegExp(\"^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\\\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\\\.[0-9]+)?)(?:[ \\\\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$\"),\n  resolve(str) {\n    const match = str.match(timestamp.test);\n    if (!match)\n      throw new Error(\"!!timestamp expects a date, starting with yyyy-mm-dd\");\n    const [, year, month, day, hour, minute, second] = match.map(Number);\n    const millisec = match[7] ? Number((match[7] + \"00\").substr(1, 3)) : 0;\n    let date = Date.UTC(year, month - 1, day, hour || 0, minute || 0, second || 0, millisec);\n    const tz = match[8];\n    if (tz && tz !== \"Z\") {\n      let d = parseSexagesimal(tz, false);\n      if (Math.abs(d) < 30)\n        d *= 60;\n      date -= 6e4 * d;\n    }\n    return new Date(date);\n  },\n  stringify: ({ value }) => {\n    var _a2;\n    return (_a2 = value == null ? void 0 : value.toISOString().replace(/(T00:00:00)?\\.000Z$/, \"\")) != null ? _a2 : \"\";\n  }\n};\n\n// node_modules/yaml/browser/dist/schema/yaml-1.1/schema.js\nvar schema3 = [\n  map,\n  seq,\n  string,\n  nullTag,\n  trueTag,\n  falseTag,\n  intBin,\n  intOct2,\n  int2,\n  intHex2,\n  floatNaN2,\n  floatExp2,\n  float2,\n  binary,\n  merge,\n  omap,\n  pairs,\n  set,\n  intTime,\n  floatTime,\n  timestamp\n];\n\n// node_modules/yaml/browser/dist/schema/tags.js\nvar schemas = /* @__PURE__ */ new Map([\n  [\"core\", schema],\n  [\"failsafe\", [map, seq, string]],\n  [\"json\", schema2],\n  [\"yaml11\", schema3],\n  [\"yaml-1.1\", schema3]\n]);\nvar tagsByName = {\n  binary,\n  bool: boolTag,\n  float,\n  floatExp,\n  floatNaN,\n  floatTime,\n  int,\n  intHex,\n  intOct,\n  intTime,\n  map,\n  merge,\n  null: nullTag,\n  omap,\n  pairs,\n  seq,\n  set,\n  timestamp\n};\nvar coreKnownTags = {\n  \"tag:yaml.org,2002:binary\": binary,\n  \"tag:yaml.org,2002:merge\": merge,\n  \"tag:yaml.org,2002:omap\": omap,\n  \"tag:yaml.org,2002:pairs\": pairs,\n  \"tag:yaml.org,2002:set\": set,\n  \"tag:yaml.org,2002:timestamp\": timestamp\n};\nfunction getTags(customTags, schemaName, addMergeTag) {\n  const schemaTags = schemas.get(schemaName);\n  if (schemaTags && !customTags) {\n    return addMergeTag && !schemaTags.includes(merge) ? schemaTags.concat(merge) : schemaTags.slice();\n  }\n  let tags = schemaTags;\n  if (!tags) {\n    if (Array.isArray(customTags))\n      tags = [];\n    else {\n      const keys = Array.from(schemas.keys()).filter((key) => key !== \"yaml11\").map((key) => JSON.stringify(key)).join(\", \");\n      throw new Error(`Unknown schema \"${schemaName}\"; use one of ${keys} or define customTags array`);\n    }\n  }\n  if (Array.isArray(customTags)) {\n    for (const tag of customTags)\n      tags = tags.concat(tag);\n  } else if (typeof customTags === \"function\") {\n    tags = customTags(tags.slice());\n  }\n  if (addMergeTag)\n    tags = tags.concat(merge);\n  return tags.reduce((tags2, tag) => {\n    const tagObj = typeof tag === \"string\" ? tagsByName[tag] : tag;\n    if (!tagObj) {\n      const tagName = JSON.stringify(tag);\n      const keys = Object.keys(tagsByName).map((key) => JSON.stringify(key)).join(\", \");\n      throw new Error(`Unknown custom tag ${tagName}; use one of ${keys}`);\n    }\n    if (!tags2.includes(tagObj))\n      tags2.push(tagObj);\n    return tags2;\n  }, []);\n}\n\n// node_modules/yaml/browser/dist/schema/Schema.js\nvar sortMapEntriesByKey = (a, b) => a.key < b.key ? -1 : a.key > b.key ? 1 : 0;\nvar Schema = class _Schema {\n  constructor({ compat, customTags, merge: merge2, resolveKnownTags, schema: schema4, sortMapEntries, toStringDefaults }) {\n    this.compat = Array.isArray(compat) ? getTags(compat, \"compat\") : compat ? getTags(null, compat) : null;\n    this.name = typeof schema4 === \"string\" && schema4 || \"core\";\n    this.knownTags = resolveKnownTags ? coreKnownTags : {};\n    this.tags = getTags(customTags, this.name, merge2);\n    this.toStringOptions = toStringDefaults != null ? toStringDefaults : null;\n    Object.defineProperty(this, MAP, { value: map });\n    Object.defineProperty(this, SCALAR, { value: string });\n    Object.defineProperty(this, SEQ, { value: seq });\n    this.sortMapEntries = typeof sortMapEntries === \"function\" ? sortMapEntries : sortMapEntries === true ? sortMapEntriesByKey : null;\n  }\n  clone() {\n    const copy = Object.create(_Schema.prototype, Object.getOwnPropertyDescriptors(this));\n    copy.tags = this.tags.slice();\n    return copy;\n  }\n};\n\n// node_modules/yaml/browser/dist/stringify/stringifyDocument.js\nfunction stringifyDocument(doc, options) {\n  var _a2;\n  const lines = [];\n  let hasDirectives = options.directives === true;\n  if (options.directives !== false && doc.directives) {\n    const dir = doc.directives.toString(doc);\n    if (dir) {\n      lines.push(dir);\n      hasDirectives = true;\n    } else if (doc.directives.docStart)\n      hasDirectives = true;\n  }\n  if (hasDirectives)\n    lines.push(\"---\");\n  const ctx = createStringifyContext(doc, options);\n  const { commentString } = ctx.options;\n  if (doc.commentBefore) {\n    if (lines.length !== 1)\n      lines.unshift(\"\");\n    const cs = commentString(doc.commentBefore);\n    lines.unshift(indentComment(cs, \"\"));\n  }\n  let chompKeep = false;\n  let contentComment = null;\n  if (doc.contents) {\n    if (isNode(doc.contents)) {\n      if (doc.contents.spaceBefore && hasDirectives)\n        lines.push(\"\");\n      if (doc.contents.commentBefore) {\n        const cs = commentString(doc.contents.commentBefore);\n        lines.push(indentComment(cs, \"\"));\n      }\n      ctx.forceBlockIndent = !!doc.comment;\n      contentComment = doc.contents.comment;\n    }\n    const onChompKeep = contentComment ? void 0 : () => chompKeep = true;\n    let body = stringify(doc.contents, ctx, () => contentComment = null, onChompKeep);\n    if (contentComment)\n      body += lineComment(body, \"\", commentString(contentComment));\n    if ((body[0] === \"|\" || body[0] === \">\") && lines[lines.length - 1] === \"---\") {\n      lines[lines.length - 1] = `--- ${body}`;\n    } else\n      lines.push(body);\n  } else {\n    lines.push(stringify(doc.contents, ctx));\n  }\n  if ((_a2 = doc.directives) == null ? void 0 : _a2.docEnd) {\n    if (doc.comment) {\n      const cs = commentString(doc.comment);\n      if (cs.includes(\"\\n\")) {\n        lines.push(\"...\");\n        lines.push(indentComment(cs, \"\"));\n      } else {\n        lines.push(`... ${cs}`);\n      }\n    } else {\n      lines.push(\"...\");\n    }\n  } else {\n    let dc = doc.comment;\n    if (dc && chompKeep)\n      dc = dc.replace(/^\\n+/, \"\");\n    if (dc) {\n      if ((!chompKeep || contentComment) && lines[lines.length - 1] !== \"\")\n        lines.push(\"\");\n      lines.push(indentComment(commentString(dc), \"\"));\n    }\n  }\n  return lines.join(\"\\n\") + \"\\n\";\n}\n\n// node_modules/yaml/browser/dist/doc/Document.js\nvar Document = class _Document {\n  constructor(value, replacer, options) {\n    this.commentBefore = null;\n    this.comment = null;\n    this.errors = [];\n    this.warnings = [];\n    Object.defineProperty(this, NODE_TYPE, { value: DOC });\n    let _replacer = null;\n    if (typeof replacer === \"function\" || Array.isArray(replacer)) {\n      _replacer = replacer;\n    } else if (options === void 0 && replacer) {\n      options = replacer;\n      replacer = void 0;\n    }\n    const opt = Object.assign({\n      intAsBigInt: false,\n      keepSourceTokens: false,\n      logLevel: \"warn\",\n      prettyErrors: true,\n      strict: true,\n      stringKeys: false,\n      uniqueKeys: true,\n      version: \"1.2\"\n    }, options);\n    this.options = opt;\n    let { version } = opt;\n    if (options == null ? void 0 : options._directives) {\n      this.directives = options._directives.atDocument();\n      if (this.directives.yaml.explicit)\n        version = this.directives.yaml.version;\n    } else\n      this.directives = new Directives({ version });\n    this.setSchema(version, options);\n    this.contents = value === void 0 ? null : this.createNode(value, _replacer, options);\n  }\n  /**\n   * Create a deep copy of this Document and its contents.\n   *\n   * Custom Node values that inherit from `Object` still refer to their original instances.\n   */\n  clone() {\n    const copy = Object.create(_Document.prototype, {\n      [NODE_TYPE]: { value: DOC }\n    });\n    copy.commentBefore = this.commentBefore;\n    copy.comment = this.comment;\n    copy.errors = this.errors.slice();\n    copy.warnings = this.warnings.slice();\n    copy.options = Object.assign({}, this.options);\n    if (this.directives)\n      copy.directives = this.directives.clone();\n    copy.schema = this.schema.clone();\n    copy.contents = isNode(this.contents) ? this.contents.clone(copy.schema) : this.contents;\n    if (this.range)\n      copy.range = this.range.slice();\n    return copy;\n  }\n  /** Adds a value to the document. */\n  add(value) {\n    if (assertCollection(this.contents))\n      this.contents.add(value);\n  }\n  /** Adds a value to the document. */\n  addIn(path5, value) {\n    if (assertCollection(this.contents))\n      this.contents.addIn(path5, value);\n  }\n  /**\n   * Create a new `Alias` node, ensuring that the target `node` has the required anchor.\n   *\n   * If `node` already has an anchor, `name` is ignored.\n   * Otherwise, the `node.anchor` value will be set to `name`,\n   * or if an anchor with that name is already present in the document,\n   * `name` will be used as a prefix for a new unique anchor.\n   * If `name` is undefined, the generated anchor will use 'a' as a prefix.\n   */\n  createAlias(node, name) {\n    if (!node.anchor) {\n      const prev = anchorNames(this);\n      node.anchor = // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing\n      !name || prev.has(name) ? findNewAnchor(name || \"a\", prev) : name;\n    }\n    return new Alias(node.anchor);\n  }\n  createNode(value, replacer, options) {\n    let _replacer = void 0;\n    if (typeof replacer === \"function\") {\n      value = replacer.call({ \"\": value }, \"\", value);\n      _replacer = replacer;\n    } else if (Array.isArray(replacer)) {\n      const keyToStr = (v2) => typeof v2 === \"number\" || v2 instanceof String || v2 instanceof Number;\n      const asStr = replacer.filter(keyToStr).map(String);\n      if (asStr.length > 0)\n        replacer = replacer.concat(asStr);\n      _replacer = replacer;\n    } else if (options === void 0 && replacer) {\n      options = replacer;\n      replacer = void 0;\n    }\n    const { aliasDuplicateObjects, anchorPrefix, flow, keepUndefined, onTagObj, tag } = options != null ? options : {};\n    const { onAnchor, setAnchors, sourceObjects } = createNodeAnchors(\n      this,\n      // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing\n      anchorPrefix || \"a\"\n    );\n    const ctx = {\n      aliasDuplicateObjects: aliasDuplicateObjects != null ? aliasDuplicateObjects : true,\n      keepUndefined: keepUndefined != null ? keepUndefined : false,\n      onAnchor,\n      onTagObj,\n      replacer: _replacer,\n      schema: this.schema,\n      sourceObjects\n    };\n    const node = createNode(value, tag, ctx);\n    if (flow && isCollection(node))\n      node.flow = true;\n    setAnchors();\n    return node;\n  }\n  /**\n   * Convert a key and a value into a `Pair` using the current schema,\n   * recursively wrapping all values as `Scalar` or `Collection` nodes.\n   */\n  createPair(key, value, options = {}) {\n    const k2 = this.createNode(key, null, options);\n    const v2 = this.createNode(value, null, options);\n    return new Pair(k2, v2);\n  }\n  /**\n   * Removes a value from the document.\n   * @returns `true` if the item was found and removed.\n   */\n  delete(key) {\n    return assertCollection(this.contents) ? this.contents.delete(key) : false;\n  }\n  /**\n   * Removes a value from the document.\n   * @returns `true` if the item was found and removed.\n   */\n  deleteIn(path5) {\n    if (isEmptyPath(path5)) {\n      if (this.contents == null)\n        return false;\n      this.contents = null;\n      return true;\n    }\n    return assertCollection(this.contents) ? this.contents.deleteIn(path5) : false;\n  }\n  /**\n   * Returns item at `key`, or `undefined` if not found. By default unwraps\n   * scalar values from their surrounding node; to disable set `keepScalar` to\n   * `true` (collections are always returned intact).\n   */\n  get(key, keepScalar) {\n    return isCollection(this.contents) ? this.contents.get(key, keepScalar) : void 0;\n  }\n  /**\n   * Returns item at `path`, or `undefined` if not found. By default unwraps\n   * scalar values from their surrounding node; to disable set `keepScalar` to\n   * `true` (collections are always returned intact).\n   */\n  getIn(path5, keepScalar) {\n    if (isEmptyPath(path5))\n      return !keepScalar && isScalar(this.contents) ? this.contents.value : this.contents;\n    return isCollection(this.contents) ? this.contents.getIn(path5, keepScalar) : void 0;\n  }\n  /**\n   * Checks if the document includes a value with the key `key`.\n   */\n  has(key) {\n    return isCollection(this.contents) ? this.contents.has(key) : false;\n  }\n  /**\n   * Checks if the document includes a value at `path`.\n   */\n  hasIn(path5) {\n    if (isEmptyPath(path5))\n      return this.contents !== void 0;\n    return isCollection(this.contents) ? this.contents.hasIn(path5) : false;\n  }\n  /**\n   * Sets a value in this document. For `!!set`, `value` needs to be a\n   * boolean to add/remove the item from the set.\n   */\n  set(key, value) {\n    if (this.contents == null) {\n      this.contents = collectionFromPath(this.schema, [key], value);\n    } else if (assertCollection(this.contents)) {\n      this.contents.set(key, value);\n    }\n  }\n  /**\n   * Sets a value in this document. For `!!set`, `value` needs to be a\n   * boolean to add/remove the item from the set.\n   */\n  setIn(path5, value) {\n    if (isEmptyPath(path5)) {\n      this.contents = value;\n    } else if (this.contents == null) {\n      this.contents = collectionFromPath(this.schema, Array.from(path5), value);\n    } else if (assertCollection(this.contents)) {\n      this.contents.setIn(path5, value);\n    }\n  }\n  /**\n   * Change the YAML version and schema used by the document.\n   * A `null` version disables support for directives, explicit tags, anchors, and aliases.\n   * It also requires the `schema` option to be given as a `Schema` instance value.\n   *\n   * Overrides all previously set schema options.\n   */\n  setSchema(version, options = {}) {\n    if (typeof version === \"number\")\n      version = String(version);\n    let opt;\n    switch (version) {\n      case \"1.1\":\n        if (this.directives)\n          this.directives.yaml.version = \"1.1\";\n        else\n          this.directives = new Directives({ version: \"1.1\" });\n        opt = { resolveKnownTags: false, schema: \"yaml-1.1\" };\n        break;\n      case \"1.2\":\n      case \"next\":\n        if (this.directives)\n          this.directives.yaml.version = version;\n        else\n          this.directives = new Directives({ version });\n        opt = { resolveKnownTags: true, schema: \"core\" };\n        break;\n      case null:\n        if (this.directives)\n          delete this.directives;\n        opt = null;\n        break;\n      default: {\n        const sv = JSON.stringify(version);\n        throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${sv}`);\n      }\n    }\n    if (options.schema instanceof Object)\n      this.schema = options.schema;\n    else if (opt)\n      this.schema = new Schema(Object.assign(opt, options));\n    else\n      throw new Error(`With a null YAML version, the { schema: Schema } option is required`);\n  }\n  // json & jsonArg are only used from toJSON()\n  toJS({ json, jsonArg, mapAsMap, maxAliasCount, onAnchor, reviver } = {}) {\n    const ctx = {\n      anchors: /* @__PURE__ */ new Map(),\n      doc: this,\n      keep: !json,\n      mapAsMap: mapAsMap === true,\n      mapKeyWarned: false,\n      maxAliasCount: typeof maxAliasCount === \"number\" ? maxAliasCount : 100\n    };\n    const res = toJS(this.contents, jsonArg != null ? jsonArg : \"\", ctx);\n    if (typeof onAnchor === \"function\")\n      for (const { count, res: res2 } of ctx.anchors.values())\n        onAnchor(res2, count);\n    return typeof reviver === \"function\" ? applyReviver(reviver, { \"\": res }, \"\", res) : res;\n  }\n  /**\n   * A JSON representation of the document `contents`.\n   *\n   * @param jsonArg Used by `JSON.stringify` to indicate the array index or\n   *   property name.\n   */\n  toJSON(jsonArg, onAnchor) {\n    return this.toJS({ json: true, jsonArg, mapAsMap: false, onAnchor });\n  }\n  /** A YAML representation of the document. */\n  toString(options = {}) {\n    if (this.errors.length > 0)\n      throw new Error(\"Document with errors cannot be stringified\");\n    if (\"indent\" in options && (!Number.isInteger(options.indent) || Number(options.indent) <= 0)) {\n      const s = JSON.stringify(options.indent);\n      throw new Error(`\"indent\" option must be a positive integer, not ${s}`);\n    }\n    return stringifyDocument(this, options);\n  }\n};\nfunction assertCollection(contents) {\n  if (isCollection(contents))\n    return true;\n  throw new Error(\"Expected a YAML collection as document contents\");\n}\n\n// node_modules/yaml/browser/dist/errors.js\nvar YAMLError = class extends Error {\n  constructor(name, pos, code, message) {\n    super();\n    this.name = name;\n    this.code = code;\n    this.message = message;\n    this.pos = pos;\n  }\n};\nvar YAMLParseError = class extends YAMLError {\n  constructor(pos, code, message) {\n    super(\"YAMLParseError\", pos, code, message);\n  }\n};\nvar YAMLWarning = class extends YAMLError {\n  constructor(pos, code, message) {\n    super(\"YAMLWarning\", pos, code, message);\n  }\n};\nvar prettifyError = (src, lc) => (error) => {\n  if (error.pos[0] === -1)\n    return;\n  error.linePos = error.pos.map((pos) => lc.linePos(pos));\n  const { line, col } = error.linePos[0];\n  error.message += ` at line ${line}, column ${col}`;\n  let ci2 = col - 1;\n  let lineStr = src.substring(lc.lineStarts[line - 1], lc.lineStarts[line]).replace(/[\\n\\r]+$/, \"\");\n  if (ci2 >= 60 && lineStr.length > 80) {\n    const trimStart = Math.min(ci2 - 39, lineStr.length - 79);\n    lineStr = \"\\u2026\" + lineStr.substring(trimStart);\n    ci2 -= trimStart - 1;\n  }\n  if (lineStr.length > 80)\n    lineStr = lineStr.substring(0, 79) + \"\\u2026\";\n  if (line > 1 && /^ *$/.test(lineStr.substring(0, ci2))) {\n    let prev = src.substring(lc.lineStarts[line - 2], lc.lineStarts[line - 1]);\n    if (prev.length > 80)\n      prev = prev.substring(0, 79) + \"\\u2026\\n\";\n    lineStr = prev + lineStr;\n  }\n  if (/[^ ]/.test(lineStr)) {\n    let count = 1;\n    const end = error.linePos[1];\n    if ((end == null ? void 0 : end.line) === line && end.col > col) {\n      count = Math.max(1, Math.min(end.col - col, 80 - ci2));\n    }\n    const pointer = \" \".repeat(ci2) + \"^\".repeat(count);\n    error.message += `:\n\n${lineStr}\n${pointer}\n`;\n  }\n};\n\n// node_modules/yaml/browser/dist/compose/resolve-props.js\nfunction resolveProps(tokens, { flow, indicator, next, offset, onError, parentIndent, startOnNewline }) {\n  let spaceBefore = false;\n  let atNewline = startOnNewline;\n  let hasSpace = startOnNewline;\n  let comment = \"\";\n  let commentSep = \"\";\n  let hasNewline = false;\n  let reqSpace = false;\n  let tab = null;\n  let anchor = null;\n  let tag = null;\n  let newlineAfterProp = null;\n  let comma = null;\n  let found = null;\n  let start = null;\n  for (const token of tokens) {\n    if (reqSpace) {\n      if (token.type !== \"space\" && token.type !== \"newline\" && token.type !== \"comma\")\n        onError(token.offset, \"MISSING_CHAR\", \"Tags and anchors must be separated from the next token by white space\");\n      reqSpace = false;\n    }\n    if (tab) {\n      if (atNewline && token.type !== \"comment\" && token.type !== \"newline\") {\n        onError(tab, \"TAB_AS_INDENT\", \"Tabs are not allowed as indentation\");\n      }\n      tab = null;\n    }\n    switch (token.type) {\n      case \"space\":\n        if (!flow && (indicator !== \"doc-start\" || (next == null ? void 0 : next.type) !== \"flow-collection\") && token.source.includes(\"\t\")) {\n          tab = token;\n        }\n        hasSpace = true;\n        break;\n      case \"comment\": {\n        if (!hasSpace)\n          onError(token, \"MISSING_CHAR\", \"Comments must be separated from other tokens by white space characters\");\n        const cb = token.source.substring(1) || \" \";\n        if (!comment)\n          comment = cb;\n        else\n          comment += commentSep + cb;\n        commentSep = \"\";\n        atNewline = false;\n        break;\n      }\n      case \"newline\":\n        if (atNewline) {\n          if (comment)\n            comment += token.source;\n          else if (!found || indicator !== \"seq-item-ind\")\n            spaceBefore = true;\n        } else\n          commentSep += token.source;\n        atNewline = true;\n        hasNewline = true;\n        if (anchor || tag)\n          newlineAfterProp = token;\n        hasSpace = true;\n        break;\n      case \"anchor\":\n        if (anchor)\n          onError(token, \"MULTIPLE_ANCHORS\", \"A node can have at most one anchor\");\n        if (token.source.endsWith(\":\"))\n          onError(token.offset + token.source.length - 1, \"BAD_ALIAS\", \"Anchor ending in : is ambiguous\", true);\n        anchor = token;\n        start != null ? start : start = token.offset;\n        atNewline = false;\n        hasSpace = false;\n        reqSpace = true;\n        break;\n      case \"tag\": {\n        if (tag)\n          onError(token, \"MULTIPLE_TAGS\", \"A node can have at most one tag\");\n        tag = token;\n        start != null ? start : start = token.offset;\n        atNewline = false;\n        hasSpace = false;\n        reqSpace = true;\n        break;\n      }\n      case indicator:\n        if (anchor || tag)\n          onError(token, \"BAD_PROP_ORDER\", `Anchors and tags must be after the ${token.source} indicator`);\n        if (found)\n          onError(token, \"UNEXPECTED_TOKEN\", `Unexpected ${token.source} in ${flow != null ? flow : \"collection\"}`);\n        found = token;\n        atNewline = indicator === \"seq-item-ind\" || indicator === \"explicit-key-ind\";\n        hasSpace = false;\n        break;\n      case \"comma\":\n        if (flow) {\n          if (comma)\n            onError(token, \"UNEXPECTED_TOKEN\", `Unexpected , in ${flow}`);\n          comma = token;\n          atNewline = false;\n          hasSpace = false;\n          break;\n        }\n      // else fallthrough\n      default:\n        onError(token, \"UNEXPECTED_TOKEN\", `Unexpected ${token.type} token`);\n        atNewline = false;\n        hasSpace = false;\n    }\n  }\n  const last = tokens[tokens.length - 1];\n  const end = last ? last.offset + last.source.length : offset;\n  if (reqSpace && next && next.type !== \"space\" && next.type !== \"newline\" && next.type !== \"comma\" && (next.type !== \"scalar\" || next.source !== \"\")) {\n    onError(next.offset, \"MISSING_CHAR\", \"Tags and anchors must be separated from the next token by white space\");\n  }\n  if (tab && (atNewline && tab.indent <= parentIndent || (next == null ? void 0 : next.type) === \"block-map\" || (next == null ? void 0 : next.type) === \"block-seq\"))\n    onError(tab, \"TAB_AS_INDENT\", \"Tabs are not allowed as indentation\");\n  return {\n    comma,\n    found,\n    spaceBefore,\n    comment,\n    hasNewline,\n    anchor,\n    tag,\n    newlineAfterProp,\n    end,\n    start: start != null ? start : end\n  };\n}\n\n// node_modules/yaml/browser/dist/compose/util-contains-newline.js\nfunction containsNewline(key) {\n  if (!key)\n    return null;\n  switch (key.type) {\n    case \"alias\":\n    case \"scalar\":\n    case \"double-quoted-scalar\":\n    case \"single-quoted-scalar\":\n      if (key.source.includes(\"\\n\"))\n        return true;\n      if (key.end) {\n        for (const st2 of key.end)\n          if (st2.type === \"newline\")\n            return true;\n      }\n      return false;\n    case \"flow-collection\":\n      for (const it of key.items) {\n        for (const st2 of it.start)\n          if (st2.type === \"newline\")\n            return true;\n        if (it.sep) {\n          for (const st2 of it.sep)\n            if (st2.type === \"newline\")\n              return true;\n        }\n        if (containsNewline(it.key) || containsNewline(it.value))\n          return true;\n      }\n      return false;\n    default:\n      return true;\n  }\n}\n\n// node_modules/yaml/browser/dist/compose/util-flow-indent-check.js\nfunction flowIndentCheck(indent, fc, onError) {\n  if ((fc == null ? void 0 : fc.type) === \"flow-collection\") {\n    const end = fc.end[0];\n    if (end.indent === indent && (end.source === \"]\" || end.source === \"}\") && containsNewline(fc)) {\n      const msg = \"Flow end indicator should be more indented than parent\";\n      onError(end, \"BAD_INDENT\", msg, true);\n    }\n  }\n}\n\n// node_modules/yaml/browser/dist/compose/util-map-includes.js\nfunction mapIncludes(ctx, items, search) {\n  const { uniqueKeys } = ctx.options;\n  if (uniqueKeys === false)\n    return false;\n  const isEqual = typeof uniqueKeys === \"function\" ? uniqueKeys : (a, b) => a === b || isScalar(a) && isScalar(b) && a.value === b.value;\n  return items.some((pair) => isEqual(pair.key, search));\n}\n\n// node_modules/yaml/browser/dist/compose/resolve-block-map.js\nvar startColMsg = \"All mapping items must start at the same column\";\nfunction resolveBlockMap({ composeNode: composeNode2, composeEmptyNode: composeEmptyNode2 }, ctx, bm, onError, tag) {\n  var _a2, _b2;\n  const NodeClass = (_a2 = tag == null ? void 0 : tag.nodeClass) != null ? _a2 : YAMLMap;\n  const map2 = new NodeClass(ctx.schema);\n  if (ctx.atRoot)\n    ctx.atRoot = false;\n  let offset = bm.offset;\n  let commentEnd = null;\n  for (const collItem of bm.items) {\n    const { start, key, sep, value } = collItem;\n    const keyProps = resolveProps(start, {\n      indicator: \"explicit-key-ind\",\n      next: key != null ? key : sep == null ? void 0 : sep[0],\n      offset,\n      onError,\n      parentIndent: bm.indent,\n      startOnNewline: true\n    });\n    const implicitKey = !keyProps.found;\n    if (implicitKey) {\n      if (key) {\n        if (key.type === \"block-seq\")\n          onError(offset, \"BLOCK_AS_IMPLICIT_KEY\", \"A block sequence may not be used as an implicit map key\");\n        else if (\"indent\" in key && key.indent !== bm.indent)\n          onError(offset, \"BAD_INDENT\", startColMsg);\n      }\n      if (!keyProps.anchor && !keyProps.tag && !sep) {\n        commentEnd = keyProps.end;\n        if (keyProps.comment) {\n          if (map2.comment)\n            map2.comment += \"\\n\" + keyProps.comment;\n          else\n            map2.comment = keyProps.comment;\n        }\n        continue;\n      }\n      if (keyProps.newlineAfterProp || containsNewline(key)) {\n        onError(key != null ? key : start[start.length - 1], \"MULTILINE_IMPLICIT_KEY\", \"Implicit keys need to be on a single line\");\n      }\n    } else if (((_b2 = keyProps.found) == null ? void 0 : _b2.indent) !== bm.indent) {\n      onError(offset, \"BAD_INDENT\", startColMsg);\n    }\n    ctx.atKey = true;\n    const keyStart = keyProps.end;\n    const keyNode = key ? composeNode2(ctx, key, keyProps, onError) : composeEmptyNode2(ctx, keyStart, start, null, keyProps, onError);\n    if (ctx.schema.compat)\n      flowIndentCheck(bm.indent, key, onError);\n    ctx.atKey = false;\n    if (mapIncludes(ctx, map2.items, keyNode))\n      onError(keyStart, \"DUPLICATE_KEY\", \"Map keys must be unique\");\n    const valueProps = resolveProps(sep != null ? sep : [], {\n      indicator: \"map-value-ind\",\n      next: value,\n      offset: keyNode.range[2],\n      onError,\n      parentIndent: bm.indent,\n      startOnNewline: !key || key.type === \"block-scalar\"\n    });\n    offset = valueProps.end;\n    if (valueProps.found) {\n      if (implicitKey) {\n        if ((value == null ? void 0 : value.type) === \"block-map\" && !valueProps.hasNewline)\n          onError(offset, \"BLOCK_AS_IMPLICIT_KEY\", \"Nested mappings are not allowed in compact mappings\");\n        if (ctx.options.strict && keyProps.start < valueProps.found.offset - 1024)\n          onError(keyNode.range, \"KEY_OVER_1024_CHARS\", \"The : indicator must be at most 1024 chars after the start of an implicit block mapping key\");\n      }\n      const valueNode = value ? composeNode2(ctx, value, valueProps, onError) : composeEmptyNode2(ctx, offset, sep, null, valueProps, onError);\n      if (ctx.schema.compat)\n        flowIndentCheck(bm.indent, value, onError);\n      offset = valueNode.range[2];\n      const pair = new Pair(keyNode, valueNode);\n      if (ctx.options.keepSourceTokens)\n        pair.srcToken = collItem;\n      map2.items.push(pair);\n    } else {\n      if (implicitKey)\n        onError(keyNode.range, \"MISSING_CHAR\", \"Implicit map keys need to be followed by map values\");\n      if (valueProps.comment) {\n        if (keyNode.comment)\n          keyNode.comment += \"\\n\" + valueProps.comment;\n        else\n          keyNode.comment = valueProps.comment;\n      }\n      const pair = new Pair(keyNode);\n      if (ctx.options.keepSourceTokens)\n        pair.srcToken = collItem;\n      map2.items.push(pair);\n    }\n  }\n  if (commentEnd && commentEnd < offset)\n    onError(commentEnd, \"IMPOSSIBLE\", \"Map comment with trailing content\");\n  map2.range = [bm.offset, offset, commentEnd != null ? commentEnd : offset];\n  return map2;\n}\n\n// node_modules/yaml/browser/dist/compose/resolve-block-seq.js\nfunction resolveBlockSeq({ composeNode: composeNode2, composeEmptyNode: composeEmptyNode2 }, ctx, bs, onError, tag) {\n  var _a2;\n  const NodeClass = (_a2 = tag == null ? void 0 : tag.nodeClass) != null ? _a2 : YAMLSeq;\n  const seq2 = new NodeClass(ctx.schema);\n  if (ctx.atRoot)\n    ctx.atRoot = false;\n  if (ctx.atKey)\n    ctx.atKey = false;\n  let offset = bs.offset;\n  let commentEnd = null;\n  for (const { start, value } of bs.items) {\n    const props = resolveProps(start, {\n      indicator: \"seq-item-ind\",\n      next: value,\n      offset,\n      onError,\n      parentIndent: bs.indent,\n      startOnNewline: true\n    });\n    if (!props.found) {\n      if (props.anchor || props.tag || value) {\n        if ((value == null ? void 0 : value.type) === \"block-seq\")\n          onError(props.end, \"BAD_INDENT\", \"All sequence items must start at the same column\");\n        else\n          onError(offset, \"MISSING_CHAR\", \"Sequence item without - indicator\");\n      } else {\n        commentEnd = props.end;\n        if (props.comment)\n          seq2.comment = props.comment;\n        continue;\n      }\n    }\n    const node = value ? composeNode2(ctx, value, props, onError) : composeEmptyNode2(ctx, props.end, start, null, props, onError);\n    if (ctx.schema.compat)\n      flowIndentCheck(bs.indent, value, onError);\n    offset = node.range[2];\n    seq2.items.push(node);\n  }\n  seq2.range = [bs.offset, offset, commentEnd != null ? commentEnd : offset];\n  return seq2;\n}\n\n// node_modules/yaml/browser/dist/compose/resolve-end.js\nfunction resolveEnd(end, offset, reqSpace, onError) {\n  let comment = \"\";\n  if (end) {\n    let hasSpace = false;\n    let sep = \"\";\n    for (const token of end) {\n      const { source, type } = token;\n      switch (type) {\n        case \"space\":\n          hasSpace = true;\n          break;\n        case \"comment\": {\n          if (reqSpace && !hasSpace)\n            onError(token, \"MISSING_CHAR\", \"Comments must be separated from other tokens by white space characters\");\n          const cb = source.substring(1) || \" \";\n          if (!comment)\n            comment = cb;\n          else\n            comment += sep + cb;\n          sep = \"\";\n          break;\n        }\n        case \"newline\":\n          if (comment)\n            sep += source;\n          hasSpace = true;\n          break;\n        default:\n          onError(token, \"UNEXPECTED_TOKEN\", `Unexpected ${type} at node end`);\n      }\n      offset += source.length;\n    }\n  }\n  return { comment, offset };\n}\n\n// node_modules/yaml/browser/dist/compose/resolve-flow-collection.js\nvar blockMsg = \"Block collections are not allowed within flow collections\";\nvar isBlock = (token) => token && (token.type === \"block-map\" || token.type === \"block-seq\");\nfunction resolveFlowCollection({ composeNode: composeNode2, composeEmptyNode: composeEmptyNode2 }, ctx, fc, onError, tag) {\n  var _a2, _b2, _c;\n  const isMap2 = fc.start.source === \"{\";\n  const fcName = isMap2 ? \"flow map\" : \"flow sequence\";\n  const NodeClass = (_a2 = tag == null ? void 0 : tag.nodeClass) != null ? _a2 : isMap2 ? YAMLMap : YAMLSeq;\n  const coll = new NodeClass(ctx.schema);\n  coll.flow = true;\n  const atRoot = ctx.atRoot;\n  if (atRoot)\n    ctx.atRoot = false;\n  if (ctx.atKey)\n    ctx.atKey = false;\n  let offset = fc.offset + fc.start.source.length;\n  for (let i = 0; i < fc.items.length; ++i) {\n    const collItem = fc.items[i];\n    const { start, key, sep, value } = collItem;\n    const props = resolveProps(start, {\n      flow: fcName,\n      indicator: \"explicit-key-ind\",\n      next: key != null ? key : sep == null ? void 0 : sep[0],\n      offset,\n      onError,\n      parentIndent: fc.indent,\n      startOnNewline: false\n    });\n    if (!props.found) {\n      if (!props.anchor && !props.tag && !sep && !value) {\n        if (i === 0 && props.comma)\n          onError(props.comma, \"UNEXPECTED_TOKEN\", `Unexpected , in ${fcName}`);\n        else if (i < fc.items.length - 1)\n          onError(props.start, \"UNEXPECTED_TOKEN\", `Unexpected empty item in ${fcName}`);\n        if (props.comment) {\n          if (coll.comment)\n            coll.comment += \"\\n\" + props.comment;\n          else\n            coll.comment = props.comment;\n        }\n        offset = props.end;\n        continue;\n      }\n      if (!isMap2 && ctx.options.strict && containsNewline(key))\n        onError(\n          key,\n          // checked by containsNewline()\n          \"MULTILINE_IMPLICIT_KEY\",\n          \"Implicit keys of flow sequence pairs need to be on a single line\"\n        );\n    }\n    if (i === 0) {\n      if (props.comma)\n        onError(props.comma, \"UNEXPECTED_TOKEN\", `Unexpected , in ${fcName}`);\n    } else {\n      if (!props.comma)\n        onError(props.start, \"MISSING_CHAR\", `Missing , between ${fcName} items`);\n      if (props.comment) {\n        let prevItemComment = \"\";\n        loop: for (const st2 of start) {\n          switch (st2.type) {\n            case \"comma\":\n            case \"space\":\n              break;\n            case \"comment\":\n              prevItemComment = st2.source.substring(1);\n              break loop;\n            default:\n              break loop;\n          }\n        }\n        if (prevItemComment) {\n          let prev = coll.items[coll.items.length - 1];\n          if (isPair(prev))\n            prev = (_b2 = prev.value) != null ? _b2 : prev.key;\n          if (prev.comment)\n            prev.comment += \"\\n\" + prevItemComment;\n          else\n            prev.comment = prevItemComment;\n          props.comment = props.comment.substring(prevItemComment.length + 1);\n        }\n      }\n    }\n    if (!isMap2 && !sep && !props.found) {\n      const valueNode = value ? composeNode2(ctx, value, props, onError) : composeEmptyNode2(ctx, props.end, sep, null, props, onError);\n      coll.items.push(valueNode);\n      offset = valueNode.range[2];\n      if (isBlock(value))\n        onError(valueNode.range, \"BLOCK_IN_FLOW\", blockMsg);\n    } else {\n      ctx.atKey = true;\n      const keyStart = props.end;\n      const keyNode = key ? composeNode2(ctx, key, props, onError) : composeEmptyNode2(ctx, keyStart, start, null, props, onError);\n      if (isBlock(key))\n        onError(keyNode.range, \"BLOCK_IN_FLOW\", blockMsg);\n      ctx.atKey = false;\n      const valueProps = resolveProps(sep != null ? sep : [], {\n        flow: fcName,\n        indicator: \"map-value-ind\",\n        next: value,\n        offset: keyNode.range[2],\n        onError,\n        parentIndent: fc.indent,\n        startOnNewline: false\n      });\n      if (valueProps.found) {\n        if (!isMap2 && !props.found && ctx.options.strict) {\n          if (sep)\n            for (const st2 of sep) {\n              if (st2 === valueProps.found)\n                break;\n              if (st2.type === \"newline\") {\n                onError(st2, \"MULTILINE_IMPLICIT_KEY\", \"Implicit keys of flow sequence pairs need to be on a single line\");\n                break;\n              }\n            }\n          if (props.start < valueProps.found.offset - 1024)\n            onError(valueProps.found, \"KEY_OVER_1024_CHARS\", \"The : indicator must be at most 1024 chars after the start of an implicit flow sequence key\");\n        }\n      } else if (value) {\n        if (\"source\" in value && ((_c = value.source) == null ? void 0 : _c[0]) === \":\")\n          onError(value, \"MISSING_CHAR\", `Missing space after : in ${fcName}`);\n        else\n          onError(valueProps.start, \"MISSING_CHAR\", `Missing , or : between ${fcName} items`);\n      }\n      const valueNode = value ? composeNode2(ctx, value, valueProps, onError) : valueProps.found ? composeEmptyNode2(ctx, valueProps.end, sep, null, valueProps, onError) : null;\n      if (valueNode) {\n        if (isBlock(value))\n          onError(valueNode.range, \"BLOCK_IN_FLOW\", blockMsg);\n      } else if (valueProps.comment) {\n        if (keyNode.comment)\n          keyNode.comment += \"\\n\" + valueProps.comment;\n        else\n          keyNode.comment = valueProps.comment;\n      }\n      const pair = new Pair(keyNode, valueNode);\n      if (ctx.options.keepSourceTokens)\n        pair.srcToken = collItem;\n      if (isMap2) {\n        const map2 = coll;\n        if (mapIncludes(ctx, map2.items, keyNode))\n          onError(keyStart, \"DUPLICATE_KEY\", \"Map keys must be unique\");\n        map2.items.push(pair);\n      } else {\n        const map2 = new YAMLMap(ctx.schema);\n        map2.flow = true;\n        map2.items.push(pair);\n        const endRange = (valueNode != null ? valueNode : keyNode).range;\n        map2.range = [keyNode.range[0], endRange[1], endRange[2]];\n        coll.items.push(map2);\n      }\n      offset = valueNode ? valueNode.range[2] : valueProps.end;\n    }\n  }\n  const expectedEnd = isMap2 ? \"}\" : \"]\";\n  const [ce, ...ee2] = fc.end;\n  let cePos = offset;\n  if ((ce == null ? void 0 : ce.source) === expectedEnd)\n    cePos = ce.offset + ce.source.length;\n  else {\n    const name = fcName[0].toUpperCase() + fcName.substring(1);\n    const msg = atRoot ? `${name} must end with a ${expectedEnd}` : `${name} in block collection must be sufficiently indented and end with a ${expectedEnd}`;\n    onError(offset, atRoot ? \"MISSING_CHAR\" : \"BAD_INDENT\", msg);\n    if (ce && ce.source.length !== 1)\n      ee2.unshift(ce);\n  }\n  if (ee2.length > 0) {\n    const end = resolveEnd(ee2, cePos, ctx.options.strict, onError);\n    if (end.comment) {\n      if (coll.comment)\n        coll.comment += \"\\n\" + end.comment;\n      else\n        coll.comment = end.comment;\n    }\n    coll.range = [fc.offset, cePos, end.offset];\n  } else {\n    coll.range = [fc.offset, cePos, cePos];\n  }\n  return coll;\n}\n\n// node_modules/yaml/browser/dist/compose/compose-collection.js\nfunction resolveCollection(CN2, ctx, token, onError, tagName, tag) {\n  const coll = token.type === \"block-map\" ? resolveBlockMap(CN2, ctx, token, onError, tag) : token.type === \"block-seq\" ? resolveBlockSeq(CN2, ctx, token, onError, tag) : resolveFlowCollection(CN2, ctx, token, onError, tag);\n  const Coll = coll.constructor;\n  if (tagName === \"!\" || tagName === Coll.tagName) {\n    coll.tag = Coll.tagName;\n    return coll;\n  }\n  if (tagName)\n    coll.tag = tagName;\n  return coll;\n}\nfunction composeCollection(CN2, ctx, token, props, onError) {\n  var _a2, _b2, _c;\n  const tagToken = props.tag;\n  const tagName = !tagToken ? null : ctx.directives.tagName(tagToken.source, (msg) => onError(tagToken, \"TAG_RESOLVE_FAILED\", msg));\n  if (token.type === \"block-seq\") {\n    const { anchor, newlineAfterProp: nl2 } = props;\n    const lastProp = anchor && tagToken ? anchor.offset > tagToken.offset ? anchor : tagToken : anchor != null ? anchor : tagToken;\n    if (lastProp && (!nl2 || nl2.offset < lastProp.offset)) {\n      const message = \"Missing newline after block sequence props\";\n      onError(lastProp, \"MISSING_CHAR\", message);\n    }\n  }\n  const expType = token.type === \"block-map\" ? \"map\" : token.type === \"block-seq\" ? \"seq\" : token.start.source === \"{\" ? \"map\" : \"seq\";\n  if (!tagToken || !tagName || tagName === \"!\" || tagName === YAMLMap.tagName && expType === \"map\" || tagName === YAMLSeq.tagName && expType === \"seq\") {\n    return resolveCollection(CN2, ctx, token, onError, tagName);\n  }\n  let tag = ctx.schema.tags.find((t3) => t3.tag === tagName && t3.collection === expType);\n  if (!tag) {\n    const kt2 = ctx.schema.knownTags[tagName];\n    if ((kt2 == null ? void 0 : kt2.collection) === expType) {\n      ctx.schema.tags.push(Object.assign({}, kt2, { default: false }));\n      tag = kt2;\n    } else {\n      if (kt2) {\n        onError(tagToken, \"BAD_COLLECTION_TYPE\", `${kt2.tag} used for ${expType} collection, but expects ${(_a2 = kt2.collection) != null ? _a2 : \"scalar\"}`, true);\n      } else {\n        onError(tagToken, \"TAG_RESOLVE_FAILED\", `Unresolved tag: ${tagName}`, true);\n      }\n      return resolveCollection(CN2, ctx, token, onError, tagName);\n    }\n  }\n  const coll = resolveCollection(CN2, ctx, token, onError, tagName, tag);\n  const res = (_c = (_b2 = tag.resolve) == null ? void 0 : _b2.call(tag, coll, (msg) => onError(tagToken, \"TAG_RESOLVE_FAILED\", msg), ctx.options)) != null ? _c : coll;\n  const node = isNode(res) ? res : new Scalar(res);\n  node.range = coll.range;\n  node.tag = tagName;\n  if (tag == null ? void 0 : tag.format)\n    node.format = tag.format;\n  return node;\n}\n\n// node_modules/yaml/browser/dist/compose/resolve-block-scalar.js\nfunction resolveBlockScalar(ctx, scalar, onError) {\n  const start = scalar.offset;\n  const header = parseBlockScalarHeader(scalar, ctx.options.strict, onError);\n  if (!header)\n    return { value: \"\", type: null, comment: \"\", range: [start, start, start] };\n  const type = header.mode === \">\" ? Scalar.BLOCK_FOLDED : Scalar.BLOCK_LITERAL;\n  const lines = scalar.source ? splitLines(scalar.source) : [];\n  let chompStart = lines.length;\n  for (let i = lines.length - 1; i >= 0; --i) {\n    const content = lines[i][1];\n    if (content === \"\" || content === \"\\r\")\n      chompStart = i;\n    else\n      break;\n  }\n  if (chompStart === 0) {\n    const value2 = header.chomp === \"+\" && lines.length > 0 ? \"\\n\".repeat(Math.max(1, lines.length - 1)) : \"\";\n    let end2 = start + header.length;\n    if (scalar.source)\n      end2 += scalar.source.length;\n    return { value: value2, type, comment: header.comment, range: [start, end2, end2] };\n  }\n  let trimIndent = scalar.indent + header.indent;\n  let offset = scalar.offset + header.length;\n  let contentStart = 0;\n  for (let i = 0; i < chompStart; ++i) {\n    const [indent, content] = lines[i];\n    if (content === \"\" || content === \"\\r\") {\n      if (header.indent === 0 && indent.length > trimIndent)\n        trimIndent = indent.length;\n    } else {\n      if (indent.length < trimIndent) {\n        const message = \"Block scalars with more-indented leading empty lines must use an explicit indentation indicator\";\n        onError(offset + indent.length, \"MISSING_CHAR\", message);\n      }\n      if (header.indent === 0)\n        trimIndent = indent.length;\n      contentStart = i;\n      if (trimIndent === 0 && !ctx.atRoot) {\n        const message = \"Block scalar values in collections must be indented\";\n        onError(offset, \"BAD_INDENT\", message);\n      }\n      break;\n    }\n    offset += indent.length + content.length + 1;\n  }\n  for (let i = lines.length - 1; i >= chompStart; --i) {\n    if (lines[i][0].length > trimIndent)\n      chompStart = i + 1;\n  }\n  let value = \"\";\n  let sep = \"\";\n  let prevMoreIndented = false;\n  for (let i = 0; i < contentStart; ++i)\n    value += lines[i][0].slice(trimIndent) + \"\\n\";\n  for (let i = contentStart; i < chompStart; ++i) {\n    let [indent, content] = lines[i];\n    offset += indent.length + content.length + 1;\n    const crlf = content[content.length - 1] === \"\\r\";\n    if (crlf)\n      content = content.slice(0, -1);\n    if (content && indent.length < trimIndent) {\n      const src = header.indent ? \"explicit indentation indicator\" : \"first line\";\n      const message = `Block scalar lines must not be less indented than their ${src}`;\n      onError(offset - content.length - (crlf ? 2 : 1), \"BAD_INDENT\", message);\n      indent = \"\";\n    }\n    if (type === Scalar.BLOCK_LITERAL) {\n      value += sep + indent.slice(trimIndent) + content;\n      sep = \"\\n\";\n    } else if (indent.length > trimIndent || content[0] === \"\t\") {\n      if (sep === \" \")\n        sep = \"\\n\";\n      else if (!prevMoreIndented && sep === \"\\n\")\n        sep = \"\\n\\n\";\n      value += sep + indent.slice(trimIndent) + content;\n      sep = \"\\n\";\n      prevMoreIndented = true;\n    } else if (content === \"\") {\n      if (sep === \"\\n\")\n        value += \"\\n\";\n      else\n        sep = \"\\n\";\n    } else {\n      value += sep + content;\n      sep = \" \";\n      prevMoreIndented = false;\n    }\n  }\n  switch (header.chomp) {\n    case \"-\":\n      break;\n    case \"+\":\n      for (let i = chompStart; i < lines.length; ++i)\n        value += \"\\n\" + lines[i][0].slice(trimIndent);\n      if (value[value.length - 1] !== \"\\n\")\n        value += \"\\n\";\n      break;\n    default:\n      value += \"\\n\";\n  }\n  const end = start + header.length + scalar.source.length;\n  return { value, type, comment: header.comment, range: [start, end, end] };\n}\nfunction parseBlockScalarHeader({ offset, props }, strict, onError) {\n  if (props[0].type !== \"block-scalar-header\") {\n    onError(props[0], \"IMPOSSIBLE\", \"Block scalar header not found\");\n    return null;\n  }\n  const { source } = props[0];\n  const mode = source[0];\n  let indent = 0;\n  let chomp = \"\";\n  let error = -1;\n  for (let i = 1; i < source.length; ++i) {\n    const ch = source[i];\n    if (!chomp && (ch === \"-\" || ch === \"+\"))\n      chomp = ch;\n    else {\n      const n4 = Number(ch);\n      if (!indent && n4)\n        indent = n4;\n      else if (error === -1)\n        error = offset + i;\n    }\n  }\n  if (error !== -1)\n    onError(error, \"UNEXPECTED_TOKEN\", `Block scalar header includes extra characters: ${source}`);\n  let hasSpace = false;\n  let comment = \"\";\n  let length = source.length;\n  for (let i = 1; i < props.length; ++i) {\n    const token = props[i];\n    switch (token.type) {\n      case \"space\":\n        hasSpace = true;\n      // fallthrough\n      case \"newline\":\n        length += token.source.length;\n        break;\n      case \"comment\":\n        if (strict && !hasSpace) {\n          const message = \"Comments must be separated from other tokens by white space characters\";\n          onError(token, \"MISSING_CHAR\", message);\n        }\n        length += token.source.length;\n        comment = token.source.substring(1);\n        break;\n      case \"error\":\n        onError(token, \"UNEXPECTED_TOKEN\", token.message);\n        length += token.source.length;\n        break;\n      /* istanbul ignore next should not happen */\n      default: {\n        const message = `Unexpected token in block scalar header: ${token.type}`;\n        onError(token, \"UNEXPECTED_TOKEN\", message);\n        const ts = token.source;\n        if (ts && typeof ts === \"string\")\n          length += ts.length;\n      }\n    }\n  }\n  return { mode, indent, chomp, comment, length };\n}\nfunction splitLines(source) {\n  const split = source.split(/\\n( *)/);\n  const first = split[0];\n  const m2 = first.match(/^( *)/);\n  const line0 = (m2 == null ? void 0 : m2[1]) ? [m2[1], first.slice(m2[1].length)] : [\"\", first];\n  const lines = [line0];\n  for (let i = 1; i < split.length; i += 2)\n    lines.push([split[i], split[i + 1]]);\n  return lines;\n}\n\n// node_modules/yaml/browser/dist/compose/resolve-flow-scalar.js\nfunction resolveFlowScalar(scalar, strict, onError) {\n  const { offset, type, source, end } = scalar;\n  let _type;\n  let value;\n  const _onError = (rel, code, msg) => onError(offset + rel, code, msg);\n  switch (type) {\n    case \"scalar\":\n      _type = Scalar.PLAIN;\n      value = plainValue(source, _onError);\n      break;\n    case \"single-quoted-scalar\":\n      _type = Scalar.QUOTE_SINGLE;\n      value = singleQuotedValue(source, _onError);\n      break;\n    case \"double-quoted-scalar\":\n      _type = Scalar.QUOTE_DOUBLE;\n      value = doubleQuotedValue(source, _onError);\n      break;\n    /* istanbul ignore next should not happen */\n    default:\n      onError(scalar, \"UNEXPECTED_TOKEN\", `Expected a flow scalar value, but found: ${type}`);\n      return {\n        value: \"\",\n        type: null,\n        comment: \"\",\n        range: [offset, offset + source.length, offset + source.length]\n      };\n  }\n  const valueEnd = offset + source.length;\n  const re = resolveEnd(end, valueEnd, strict, onError);\n  return {\n    value,\n    type: _type,\n    comment: re.comment,\n    range: [offset, valueEnd, re.offset]\n  };\n}\nfunction plainValue(source, onError) {\n  let badChar = \"\";\n  switch (source[0]) {\n    /* istanbul ignore next should not happen */\n    case \"\t\":\n      badChar = \"a tab character\";\n      break;\n    case \",\":\n      badChar = \"flow indicator character ,\";\n      break;\n    case \"%\":\n      badChar = \"directive indicator character %\";\n      break;\n    case \"|\":\n    case \">\": {\n      badChar = `block scalar indicator ${source[0]}`;\n      break;\n    }\n    case \"@\":\n    case \"`\": {\n      badChar = `reserved character ${source[0]}`;\n      break;\n    }\n  }\n  if (badChar)\n    onError(0, \"BAD_SCALAR_START\", `Plain value cannot start with ${badChar}`);\n  return foldLines(source);\n}\nfunction singleQuotedValue(source, onError) {\n  if (source[source.length - 1] !== \"'\" || source.length === 1)\n    onError(source.length, \"MISSING_CHAR\", \"Missing closing 'quote\");\n  return foldLines(source.slice(1, -1)).replace(/''/g, \"'\");\n}\nfunction foldLines(source) {\n  var _a2;\n  let first, line;\n  try {\n    first = new RegExp(\"(.*?)(?<![ \t])[ \t]*\\r?\\n\", \"sy\");\n    line = new RegExp(\"[ \t]*(.*?)(?:(?<![ \t])[ \t]*)?\\r?\\n\", \"sy\");\n  } catch (e) {\n    first = new RegExp(\"(.*?)[ \\\\t]*\\\\r?\\\\n\", \"sy\");\n    line = new RegExp(\"[ \\\\t]*(.*?)[ \\\\t]*\\\\r?\\\\n\", \"sy\");\n  }\n  let match = first.exec(source);\n  if (!match)\n    return source;\n  let res = match[1];\n  let sep = \" \";\n  let pos = first.lastIndex;\n  line.lastIndex = pos;\n  while (match = line.exec(source)) {\n    if (match[1] === \"\") {\n      if (sep === \"\\n\")\n        res += sep;\n      else\n        sep = \"\\n\";\n    } else {\n      res += sep + match[1];\n      sep = \" \";\n    }\n    pos = line.lastIndex;\n  }\n  const last = new RegExp(\"[ \\\\t]*(.*)\", \"sy\");\n  last.lastIndex = pos;\n  match = last.exec(source);\n  return res + sep + ((_a2 = match == null ? void 0 : match[1]) != null ? _a2 : \"\");\n}\nfunction doubleQuotedValue(source, onError) {\n  let res = \"\";\n  for (let i = 1; i < source.length - 1; ++i) {\n    const ch = source[i];\n    if (ch === \"\\r\" && source[i + 1] === \"\\n\")\n      continue;\n    if (ch === \"\\n\") {\n      const { fold, offset } = foldNewline(source, i);\n      res += fold;\n      i = offset;\n    } else if (ch === \"\\\\\") {\n      let next = source[++i];\n      const cc = escapeCodes[next];\n      if (cc)\n        res += cc;\n      else if (next === \"\\n\") {\n        next = source[i + 1];\n        while (next === \" \" || next === \"\t\")\n          next = source[++i + 1];\n      } else if (next === \"\\r\" && source[i + 1] === \"\\n\") {\n        next = source[++i + 1];\n        while (next === \" \" || next === \"\t\")\n          next = source[++i + 1];\n      } else if (next === \"x\" || next === \"u\" || next === \"U\") {\n        const length = { x: 2, u: 4, U: 8 }[next];\n        res += parseCharCode(source, i + 1, length, onError);\n        i += length;\n      } else {\n        const raw = source.substr(i - 1, 2);\n        onError(i - 1, \"BAD_DQ_ESCAPE\", `Invalid escape sequence ${raw}`);\n        res += raw;\n      }\n    } else if (ch === \" \" || ch === \"\t\") {\n      const wsStart = i;\n      let next = source[i + 1];\n      while (next === \" \" || next === \"\t\")\n        next = source[++i + 1];\n      if (next !== \"\\n\" && !(next === \"\\r\" && source[i + 2] === \"\\n\"))\n        res += i > wsStart ? source.slice(wsStart, i + 1) : ch;\n    } else {\n      res += ch;\n    }\n  }\n  if (source[source.length - 1] !== '\"' || source.length === 1)\n    onError(source.length, \"MISSING_CHAR\", 'Missing closing \"quote');\n  return res;\n}\nfunction foldNewline(source, offset) {\n  let fold = \"\";\n  let ch = source[offset + 1];\n  while (ch === \" \" || ch === \"\t\" || ch === \"\\n\" || ch === \"\\r\") {\n    if (ch === \"\\r\" && source[offset + 2] !== \"\\n\")\n      break;\n    if (ch === \"\\n\")\n      fold += \"\\n\";\n    offset += 1;\n    ch = source[offset + 1];\n  }\n  if (!fold)\n    fold = \" \";\n  return { fold, offset };\n}\nvar escapeCodes = {\n  \"0\": \"\\0\",\n  // null character\n  a: \"\\x07\",\n  // bell character\n  b: \"\\b\",\n  // backspace\n  e: \"\\x1B\",\n  // escape character\n  f: \"\\f\",\n  // form feed\n  n: \"\\n\",\n  // line feed\n  r: \"\\r\",\n  // carriage return\n  t: \"\t\",\n  // horizontal tab\n  v: \"\\v\",\n  // vertical tab\n  N: \"\\x85\",\n  // Unicode next line\n  _: \"\\xA0\",\n  // Unicode non-breaking space\n  L: \"\\u2028\",\n  // Unicode line separator\n  P: \"\\u2029\",\n  // Unicode paragraph separator\n  \" \": \" \",\n  '\"': '\"',\n  \"/\": \"/\",\n  \"\\\\\": \"\\\\\",\n  \"\t\": \"\t\"\n};\nfunction parseCharCode(source, offset, length, onError) {\n  const cc = source.substr(offset, length);\n  const ok = cc.length === length && /^[0-9a-fA-F]+$/.test(cc);\n  const code = ok ? parseInt(cc, 16) : NaN;\n  if (isNaN(code)) {\n    const raw = source.substr(offset - 2, length + 2);\n    onError(offset - 2, \"BAD_DQ_ESCAPE\", `Invalid escape sequence ${raw}`);\n    return raw;\n  }\n  return String.fromCodePoint(code);\n}\n\n// node_modules/yaml/browser/dist/compose/compose-scalar.js\nfunction composeScalar(ctx, token, tagToken, onError) {\n  const { value, type, comment, range } = token.type === \"block-scalar\" ? resolveBlockScalar(ctx, token, onError) : resolveFlowScalar(token, ctx.options.strict, onError);\n  const tagName = tagToken ? ctx.directives.tagName(tagToken.source, (msg) => onError(tagToken, \"TAG_RESOLVE_FAILED\", msg)) : null;\n  let tag;\n  if (ctx.options.stringKeys && ctx.atKey) {\n    tag = ctx.schema[SCALAR];\n  } else if (tagName)\n    tag = findScalarTagByName(ctx.schema, value, tagName, tagToken, onError);\n  else if (token.type === \"scalar\")\n    tag = findScalarTagByTest(ctx, value, token, onError);\n  else\n    tag = ctx.schema[SCALAR];\n  let scalar;\n  try {\n    const res = tag.resolve(value, (msg) => onError(tagToken != null ? tagToken : token, \"TAG_RESOLVE_FAILED\", msg), ctx.options);\n    scalar = isScalar(res) ? res : new Scalar(res);\n  } catch (error) {\n    const msg = error instanceof Error ? error.message : String(error);\n    onError(tagToken != null ? tagToken : token, \"TAG_RESOLVE_FAILED\", msg);\n    scalar = new Scalar(value);\n  }\n  scalar.range = range;\n  scalar.source = value;\n  if (type)\n    scalar.type = type;\n  if (tagName)\n    scalar.tag = tagName;\n  if (tag.format)\n    scalar.format = tag.format;\n  if (comment)\n    scalar.comment = comment;\n  return scalar;\n}\nfunction findScalarTagByName(schema4, value, tagName, tagToken, onError) {\n  var _a2;\n  if (tagName === \"!\")\n    return schema4[SCALAR];\n  const matchWithTest = [];\n  for (const tag of schema4.tags) {\n    if (!tag.collection && tag.tag === tagName) {\n      if (tag.default && tag.test)\n        matchWithTest.push(tag);\n      else\n        return tag;\n    }\n  }\n  for (const tag of matchWithTest)\n    if ((_a2 = tag.test) == null ? void 0 : _a2.test(value))\n      return tag;\n  const kt2 = schema4.knownTags[tagName];\n  if (kt2 && !kt2.collection) {\n    schema4.tags.push(Object.assign({}, kt2, { default: false, test: void 0 }));\n    return kt2;\n  }\n  onError(tagToken, \"TAG_RESOLVE_FAILED\", `Unresolved tag: ${tagName}`, tagName !== \"tag:yaml.org,2002:str\");\n  return schema4[SCALAR];\n}\nfunction findScalarTagByTest({ atKey, directives, schema: schema4 }, value, token, onError) {\n  var _a2;\n  const tag = schema4.tags.find((tag2) => {\n    var _a3;\n    return (tag2.default === true || atKey && tag2.default === \"key\") && ((_a3 = tag2.test) == null ? void 0 : _a3.test(value));\n  }) || schema4[SCALAR];\n  if (schema4.compat) {\n    const compat = (_a2 = schema4.compat.find((tag2) => {\n      var _a3;\n      return tag2.default && ((_a3 = tag2.test) == null ? void 0 : _a3.test(value));\n    })) != null ? _a2 : schema4[SCALAR];\n    if (tag.tag !== compat.tag) {\n      const ts = directives.tagString(tag.tag);\n      const cs = directives.tagString(compat.tag);\n      const msg = `Value may be parsed as either ${ts} or ${cs}`;\n      onError(token, \"TAG_RESOLVE_FAILED\", msg, true);\n    }\n  }\n  return tag;\n}\n\n// node_modules/yaml/browser/dist/compose/util-empty-scalar-position.js\nfunction emptyScalarPosition(offset, before, pos) {\n  if (before) {\n    pos != null ? pos : pos = before.length;\n    for (let i = pos - 1; i >= 0; --i) {\n      let st2 = before[i];\n      switch (st2.type) {\n        case \"space\":\n        case \"comment\":\n        case \"newline\":\n          offset -= st2.source.length;\n          continue;\n      }\n      st2 = before[++i];\n      while ((st2 == null ? void 0 : st2.type) === \"space\") {\n        offset += st2.source.length;\n        st2 = before[++i];\n      }\n      break;\n    }\n  }\n  return offset;\n}\n\n// node_modules/yaml/browser/dist/compose/compose-node.js\nvar CN = { composeNode, composeEmptyNode };\nfunction composeNode(ctx, token, props, onError) {\n  const atKey = ctx.atKey;\n  const { spaceBefore, comment, anchor, tag } = props;\n  let node;\n  let isSrcToken = true;\n  switch (token.type) {\n    case \"alias\":\n      node = composeAlias(ctx, token, onError);\n      if (anchor || tag)\n        onError(token, \"ALIAS_PROPS\", \"An alias node must not specify any properties\");\n      break;\n    case \"scalar\":\n    case \"single-quoted-scalar\":\n    case \"double-quoted-scalar\":\n    case \"block-scalar\":\n      node = composeScalar(ctx, token, tag, onError);\n      if (anchor)\n        node.anchor = anchor.source.substring(1);\n      break;\n    case \"block-map\":\n    case \"block-seq\":\n    case \"flow-collection\":\n      node = composeCollection(CN, ctx, token, props, onError);\n      if (anchor)\n        node.anchor = anchor.source.substring(1);\n      break;\n    default: {\n      const message = token.type === \"error\" ? token.message : `Unsupported token (type: ${token.type})`;\n      onError(token, \"UNEXPECTED_TOKEN\", message);\n      node = composeEmptyNode(ctx, token.offset, void 0, null, props, onError);\n      isSrcToken = false;\n    }\n  }\n  if (anchor && node.anchor === \"\")\n    onError(anchor, \"BAD_ALIAS\", \"Anchor cannot be an empty string\");\n  if (atKey && ctx.options.stringKeys && (!isScalar(node) || typeof node.value !== \"string\" || node.tag && node.tag !== \"tag:yaml.org,2002:str\")) {\n    const msg = \"With stringKeys, all keys must be strings\";\n    onError(tag != null ? tag : token, \"NON_STRING_KEY\", msg);\n  }\n  if (spaceBefore)\n    node.spaceBefore = true;\n  if (comment) {\n    if (token.type === \"scalar\" && token.source === \"\")\n      node.comment = comment;\n    else\n      node.commentBefore = comment;\n  }\n  if (ctx.options.keepSourceTokens && isSrcToken)\n    node.srcToken = token;\n  return node;\n}\nfunction composeEmptyNode(ctx, offset, before, pos, { spaceBefore, comment, anchor, tag, end }, onError) {\n  const token = {\n    type: \"scalar\",\n    offset: emptyScalarPosition(offset, before, pos),\n    indent: -1,\n    source: \"\"\n  };\n  const node = composeScalar(ctx, token, tag, onError);\n  if (anchor) {\n    node.anchor = anchor.source.substring(1);\n    if (node.anchor === \"\")\n      onError(anchor, \"BAD_ALIAS\", \"Anchor cannot be an empty string\");\n  }\n  if (spaceBefore)\n    node.spaceBefore = true;\n  if (comment) {\n    node.comment = comment;\n    node.range[2] = end;\n  }\n  return node;\n}\nfunction composeAlias({ options }, { offset, source, end }, onError) {\n  const alias = new Alias(source.substring(1));\n  if (alias.source === \"\")\n    onError(offset, \"BAD_ALIAS\", \"Alias cannot be an empty string\");\n  if (alias.source.endsWith(\":\"))\n    onError(offset + source.length - 1, \"BAD_ALIAS\", \"Alias ending in : is ambiguous\", true);\n  const valueEnd = offset + source.length;\n  const re = resolveEnd(end, valueEnd, options.strict, onError);\n  alias.range = [offset, valueEnd, re.offset];\n  if (re.comment)\n    alias.comment = re.comment;\n  return alias;\n}\n\n// node_modules/yaml/browser/dist/compose/compose-doc.js\nfunction composeDoc(options, directives, { offset, start, value, end }, onError) {\n  const opts = Object.assign({ _directives: directives }, options);\n  const doc = new Document(void 0, opts);\n  const ctx = {\n    atKey: false,\n    atRoot: true,\n    directives: doc.directives,\n    options: doc.options,\n    schema: doc.schema\n  };\n  const props = resolveProps(start, {\n    indicator: \"doc-start\",\n    next: value != null ? value : end == null ? void 0 : end[0],\n    offset,\n    onError,\n    parentIndent: 0,\n    startOnNewline: true\n  });\n  if (props.found) {\n    doc.directives.docStart = true;\n    if (value && (value.type === \"block-map\" || value.type === \"block-seq\") && !props.hasNewline)\n      onError(props.end, \"MISSING_CHAR\", \"Block collection cannot start on same line with directives-end marker\");\n  }\n  doc.contents = value ? composeNode(ctx, value, props, onError) : composeEmptyNode(ctx, props.end, start, null, props, onError);\n  const contentEnd = doc.contents.range[2];\n  const re = resolveEnd(end, contentEnd, false, onError);\n  if (re.comment)\n    doc.comment = re.comment;\n  doc.range = [offset, contentEnd, re.offset];\n  return doc;\n}\n\n// node_modules/yaml/browser/dist/compose/composer.js\nfunction getErrorPos(src) {\n  if (typeof src === \"number\")\n    return [src, src + 1];\n  if (Array.isArray(src))\n    return src.length === 2 ? src : [src[0], src[1]];\n  const { offset, source } = src;\n  return [offset, offset + (typeof source === \"string\" ? source.length : 1)];\n}\nfunction parsePrelude(prelude) {\n  var _a2;\n  let comment = \"\";\n  let atComment = false;\n  let afterEmptyLine = false;\n  for (let i = 0; i < prelude.length; ++i) {\n    const source = prelude[i];\n    switch (source[0]) {\n      case \"#\":\n        comment += (comment === \"\" ? \"\" : afterEmptyLine ? \"\\n\\n\" : \"\\n\") + (source.substring(1) || \" \");\n        atComment = true;\n        afterEmptyLine = false;\n        break;\n      case \"%\":\n        if (((_a2 = prelude[i + 1]) == null ? void 0 : _a2[0]) !== \"#\")\n          i += 1;\n        atComment = false;\n        break;\n      default:\n        if (!atComment)\n          afterEmptyLine = true;\n        atComment = false;\n    }\n  }\n  return { comment, afterEmptyLine };\n}\nvar Composer = class {\n  constructor(options = {}) {\n    this.doc = null;\n    this.atDirectives = false;\n    this.prelude = [];\n    this.errors = [];\n    this.warnings = [];\n    this.onError = (source, code, message, warning) => {\n      const pos = getErrorPos(source);\n      if (warning)\n        this.warnings.push(new YAMLWarning(pos, code, message));\n      else\n        this.errors.push(new YAMLParseError(pos, code, message));\n    };\n    this.directives = new Directives({ version: options.version || \"1.2\" });\n    this.options = options;\n  }\n  decorate(doc, afterDoc) {\n    const { comment, afterEmptyLine } = parsePrelude(this.prelude);\n    if (comment) {\n      const dc = doc.contents;\n      if (afterDoc) {\n        doc.comment = doc.comment ? `${doc.comment}\n${comment}` : comment;\n      } else if (afterEmptyLine || doc.directives.docStart || !dc) {\n        doc.commentBefore = comment;\n      } else if (isCollection(dc) && !dc.flow && dc.items.length > 0) {\n        let it = dc.items[0];\n        if (isPair(it))\n          it = it.key;\n        const cb = it.commentBefore;\n        it.commentBefore = cb ? `${comment}\n${cb}` : comment;\n      } else {\n        const cb = dc.commentBefore;\n        dc.commentBefore = cb ? `${comment}\n${cb}` : comment;\n      }\n    }\n    if (afterDoc) {\n      Array.prototype.push.apply(doc.errors, this.errors);\n      Array.prototype.push.apply(doc.warnings, this.warnings);\n    } else {\n      doc.errors = this.errors;\n      doc.warnings = this.warnings;\n    }\n    this.prelude = [];\n    this.errors = [];\n    this.warnings = [];\n  }\n  /**\n   * Current stream status information.\n   *\n   * Mostly useful at the end of input for an empty stream.\n   */\n  streamInfo() {\n    return {\n      comment: parsePrelude(this.prelude).comment,\n      directives: this.directives,\n      errors: this.errors,\n      warnings: this.warnings\n    };\n  }\n  /**\n   * Compose tokens into documents.\n   *\n   * @param forceDoc - If the stream contains no document, still emit a final document including any comments and directives that would be applied to a subsequent document.\n   * @param endOffset - Should be set if `forceDoc` is also set, to set the document range end and to indicate errors correctly.\n   */\n  *compose(tokens, forceDoc = false, endOffset = -1) {\n    for (const token of tokens)\n      yield* __yieldStar(this.next(token));\n    yield* __yieldStar(this.end(forceDoc, endOffset));\n  }\n  /** Advance the composer by one CST token. */\n  *next(token) {\n    switch (token.type) {\n      case \"directive\":\n        this.directives.add(token.source, (offset, message, warning) => {\n          const pos = getErrorPos(token);\n          pos[0] += offset;\n          this.onError(pos, \"BAD_DIRECTIVE\", message, warning);\n        });\n        this.prelude.push(token.source);\n        this.atDirectives = true;\n        break;\n      case \"document\": {\n        const doc = composeDoc(this.options, this.directives, token, this.onError);\n        if (this.atDirectives && !doc.directives.docStart)\n          this.onError(token, \"MISSING_CHAR\", \"Missing directives-end/doc-start indicator line\");\n        this.decorate(doc, false);\n        if (this.doc)\n          yield this.doc;\n        this.doc = doc;\n        this.atDirectives = false;\n        break;\n      }\n      case \"byte-order-mark\":\n      case \"space\":\n        break;\n      case \"comment\":\n      case \"newline\":\n        this.prelude.push(token.source);\n        break;\n      case \"error\": {\n        const msg = token.source ? `${token.message}: ${JSON.stringify(token.source)}` : token.message;\n        const error = new YAMLParseError(getErrorPos(token), \"UNEXPECTED_TOKEN\", msg);\n        if (this.atDirectives || !this.doc)\n          this.errors.push(error);\n        else\n          this.doc.errors.push(error);\n        break;\n      }\n      case \"doc-end\": {\n        if (!this.doc) {\n          const msg = \"Unexpected doc-end without preceding document\";\n          this.errors.push(new YAMLParseError(getErrorPos(token), \"UNEXPECTED_TOKEN\", msg));\n          break;\n        }\n        this.doc.directives.docEnd = true;\n        const end = resolveEnd(token.end, token.offset + token.source.length, this.doc.options.strict, this.onError);\n        this.decorate(this.doc, true);\n        if (end.comment) {\n          const dc = this.doc.comment;\n          this.doc.comment = dc ? `${dc}\n${end.comment}` : end.comment;\n        }\n        this.doc.range[2] = end.offset;\n        break;\n      }\n      default:\n        this.errors.push(new YAMLParseError(getErrorPos(token), \"UNEXPECTED_TOKEN\", `Unsupported token ${token.type}`));\n    }\n  }\n  /**\n   * Call at end of input to yield any remaining document.\n   *\n   * @param forceDoc - If the stream contains no document, still emit a final document including any comments and directives that would be applied to a subsequent document.\n   * @param endOffset - Should be set if `forceDoc` is also set, to set the document range end and to indicate errors correctly.\n   */\n  *end(forceDoc = false, endOffset = -1) {\n    if (this.doc) {\n      this.decorate(this.doc, true);\n      yield this.doc;\n      this.doc = null;\n    } else if (forceDoc) {\n      const opts = Object.assign({ _directives: this.directives }, this.options);\n      const doc = new Document(void 0, opts);\n      if (this.atDirectives)\n        this.onError(endOffset, \"MISSING_CHAR\", \"Missing directives-end indicator line\");\n      doc.range = [0, endOffset, endOffset];\n      this.decorate(doc, false);\n      yield doc;\n    }\n  }\n};\n\n// node_modules/yaml/browser/dist/parse/cst.js\nvar cst_exports = {};\n__export(cst_exports, {\n  BOM: () => BOM,\n  DOCUMENT: () => DOCUMENT,\n  FLOW_END: () => FLOW_END,\n  SCALAR: () => SCALAR2,\n  createScalarToken: () => createScalarToken,\n  isCollection: () => isCollection2,\n  isScalar: () => isScalar2,\n  prettyToken: () => prettyToken,\n  resolveAsScalar: () => resolveAsScalar,\n  setScalarValue: () => setScalarValue,\n  stringify: () => stringify2,\n  tokenType: () => tokenType,\n  visit: () => visit2\n});\n\n// node_modules/yaml/browser/dist/parse/cst-scalar.js\nfunction resolveAsScalar(token, strict = true, onError) {\n  if (token) {\n    const _onError = (pos, code, message) => {\n      const offset = typeof pos === \"number\" ? pos : Array.isArray(pos) ? pos[0] : pos.offset;\n      if (onError)\n        onError(offset, code, message);\n      else\n        throw new YAMLParseError([offset, offset + 1], code, message);\n    };\n    switch (token.type) {\n      case \"scalar\":\n      case \"single-quoted-scalar\":\n      case \"double-quoted-scalar\":\n        return resolveFlowScalar(token, strict, _onError);\n      case \"block-scalar\":\n        return resolveBlockScalar({ options: { strict } }, token, _onError);\n    }\n  }\n  return null;\n}\nfunction createScalarToken(value, context) {\n  var _a2;\n  const { implicitKey = false, indent, inFlow = false, offset = -1, type = \"PLAIN\" } = context;\n  const source = stringifyString({ type, value }, {\n    implicitKey,\n    indent: indent > 0 ? \" \".repeat(indent) : \"\",\n    inFlow,\n    options: { blockQuote: true, lineWidth: -1 }\n  });\n  const end = (_a2 = context.end) != null ? _a2 : [\n    { type: \"newline\", offset: -1, indent, source: \"\\n\" }\n  ];\n  switch (source[0]) {\n    case \"|\":\n    case \">\": {\n      const he = source.indexOf(\"\\n\");\n      const head = source.substring(0, he);\n      const body = source.substring(he + 1) + \"\\n\";\n      const props = [\n        { type: \"block-scalar-header\", offset, indent, source: head }\n      ];\n      if (!addEndtoBlockProps(props, end))\n        props.push({ type: \"newline\", offset: -1, indent, source: \"\\n\" });\n      return { type: \"block-scalar\", offset, indent, props, source: body };\n    }\n    case '\"':\n      return { type: \"double-quoted-scalar\", offset, indent, source, end };\n    case \"'\":\n      return { type: \"single-quoted-scalar\", offset, indent, source, end };\n    default:\n      return { type: \"scalar\", offset, indent, source, end };\n  }\n}\nfunction setScalarValue(token, value, context = {}) {\n  let { afterKey = false, implicitKey = false, inFlow = false, type } = context;\n  let indent = \"indent\" in token ? token.indent : null;\n  if (afterKey && typeof indent === \"number\")\n    indent += 2;\n  if (!type)\n    switch (token.type) {\n      case \"single-quoted-scalar\":\n        type = \"QUOTE_SINGLE\";\n        break;\n      case \"double-quoted-scalar\":\n        type = \"QUOTE_DOUBLE\";\n        break;\n      case \"block-scalar\": {\n        const header = token.props[0];\n        if (header.type !== \"block-scalar-header\")\n          throw new Error(\"Invalid block scalar header\");\n        type = header.source[0] === \">\" ? \"BLOCK_FOLDED\" : \"BLOCK_LITERAL\";\n        break;\n      }\n      default:\n        type = \"PLAIN\";\n    }\n  const source = stringifyString({ type, value }, {\n    implicitKey: implicitKey || indent === null,\n    indent: indent !== null && indent > 0 ? \" \".repeat(indent) : \"\",\n    inFlow,\n    options: { blockQuote: true, lineWidth: -1 }\n  });\n  switch (source[0]) {\n    case \"|\":\n    case \">\":\n      setBlockScalarValue(token, source);\n      break;\n    case '\"':\n      setFlowScalarValue(token, source, \"double-quoted-scalar\");\n      break;\n    case \"'\":\n      setFlowScalarValue(token, source, \"single-quoted-scalar\");\n      break;\n    default:\n      setFlowScalarValue(token, source, \"scalar\");\n  }\n}\nfunction setBlockScalarValue(token, source) {\n  const he = source.indexOf(\"\\n\");\n  const head = source.substring(0, he);\n  const body = source.substring(he + 1) + \"\\n\";\n  if (token.type === \"block-scalar\") {\n    const header = token.props[0];\n    if (header.type !== \"block-scalar-header\")\n      throw new Error(\"Invalid block scalar header\");\n    header.source = head;\n    token.source = body;\n  } else {\n    const { offset } = token;\n    const indent = \"indent\" in token ? token.indent : -1;\n    const props = [\n      { type: \"block-scalar-header\", offset, indent, source: head }\n    ];\n    if (!addEndtoBlockProps(props, \"end\" in token ? token.end : void 0))\n      props.push({ type: \"newline\", offset: -1, indent, source: \"\\n\" });\n    for (const key of Object.keys(token))\n      if (key !== \"type\" && key !== \"offset\")\n        delete token[key];\n    Object.assign(token, { type: \"block-scalar\", indent, props, source: body });\n  }\n}\nfunction addEndtoBlockProps(props, end) {\n  if (end)\n    for (const st2 of end)\n      switch (st2.type) {\n        case \"space\":\n        case \"comment\":\n          props.push(st2);\n          break;\n        case \"newline\":\n          props.push(st2);\n          return true;\n      }\n  return false;\n}\nfunction setFlowScalarValue(token, source, type) {\n  switch (token.type) {\n    case \"scalar\":\n    case \"double-quoted-scalar\":\n    case \"single-quoted-scalar\":\n      token.type = type;\n      token.source = source;\n      break;\n    case \"block-scalar\": {\n      const end = token.props.slice(1);\n      let oa = source.length;\n      if (token.props[0].type === \"block-scalar-header\")\n        oa -= token.props[0].source.length;\n      for (const tok of end)\n        tok.offset += oa;\n      delete token.props;\n      Object.assign(token, { type, source, end });\n      break;\n    }\n    case \"block-map\":\n    case \"block-seq\": {\n      const offset = token.offset + source.length;\n      const nl2 = { type: \"newline\", offset, indent: token.indent, source: \"\\n\" };\n      delete token.items;\n      Object.assign(token, { type, source, end: [nl2] });\n      break;\n    }\n    default: {\n      const indent = \"indent\" in token ? token.indent : -1;\n      const end = \"end\" in token && Array.isArray(token.end) ? token.end.filter((st2) => st2.type === \"space\" || st2.type === \"comment\" || st2.type === \"newline\") : [];\n      for (const key of Object.keys(token))\n        if (key !== \"type\" && key !== \"offset\")\n          delete token[key];\n      Object.assign(token, { type, indent, source, end });\n    }\n  }\n}\n\n// node_modules/yaml/browser/dist/parse/cst-stringify.js\nvar stringify2 = (cst) => \"type\" in cst ? stringifyToken(cst) : stringifyItem(cst);\nfunction stringifyToken(token) {\n  switch (token.type) {\n    case \"block-scalar\": {\n      let res = \"\";\n      for (const tok of token.props)\n        res += stringifyToken(tok);\n      return res + token.source;\n    }\n    case \"block-map\":\n    case \"block-seq\": {\n      let res = \"\";\n      for (const item of token.items)\n        res += stringifyItem(item);\n      return res;\n    }\n    case \"flow-collection\": {\n      let res = token.start.source;\n      for (const item of token.items)\n        res += stringifyItem(item);\n      for (const st2 of token.end)\n        res += st2.source;\n      return res;\n    }\n    case \"document\": {\n      let res = stringifyItem(token);\n      if (token.end)\n        for (const st2 of token.end)\n          res += st2.source;\n      return res;\n    }\n    default: {\n      let res = token.source;\n      if (\"end\" in token && token.end)\n        for (const st2 of token.end)\n          res += st2.source;\n      return res;\n    }\n  }\n}\nfunction stringifyItem({ start, key, sep, value }) {\n  let res = \"\";\n  for (const st2 of start)\n    res += st2.source;\n  if (key)\n    res += stringifyToken(key);\n  if (sep)\n    for (const st2 of sep)\n      res += st2.source;\n  if (value)\n    res += stringifyToken(value);\n  return res;\n}\n\n// node_modules/yaml/browser/dist/parse/cst-visit.js\nvar BREAK2 = /* @__PURE__ */ Symbol(\"break visit\");\nvar SKIP2 = /* @__PURE__ */ Symbol(\"skip children\");\nvar REMOVE2 = /* @__PURE__ */ Symbol(\"remove item\");\nfunction visit2(cst, visitor) {\n  if (\"type\" in cst && cst.type === \"document\")\n    cst = { start: cst.start, value: cst.value };\n  _visit(Object.freeze([]), cst, visitor);\n}\nvisit2.BREAK = BREAK2;\nvisit2.SKIP = SKIP2;\nvisit2.REMOVE = REMOVE2;\nvisit2.itemAtPath = (cst, path5) => {\n  let item = cst;\n  for (const [field, index] of path5) {\n    const tok = item == null ? void 0 : item[field];\n    if (tok && \"items\" in tok) {\n      item = tok.items[index];\n    } else\n      return void 0;\n  }\n  return item;\n};\nvisit2.parentCollection = (cst, path5) => {\n  const parent = visit2.itemAtPath(cst, path5.slice(0, -1));\n  const field = path5[path5.length - 1][0];\n  const coll = parent == null ? void 0 : parent[field];\n  if (coll && \"items\" in coll)\n    return coll;\n  throw new Error(\"Parent collection not found\");\n};\nfunction _visit(path5, item, visitor) {\n  let ctrl = visitor(item, path5);\n  if (typeof ctrl === \"symbol\")\n    return ctrl;\n  for (const field of [\"key\", \"value\"]) {\n    const token = item[field];\n    if (token && \"items\" in token) {\n      for (let i = 0; i < token.items.length; ++i) {\n        const ci2 = _visit(Object.freeze(path5.concat([[field, i]])), token.items[i], visitor);\n        if (typeof ci2 === \"number\")\n          i = ci2 - 1;\n        else if (ci2 === BREAK2)\n          return BREAK2;\n        else if (ci2 === REMOVE2) {\n          token.items.splice(i, 1);\n          i -= 1;\n        }\n      }\n      if (typeof ctrl === \"function\" && field === \"key\")\n        ctrl = ctrl(item, path5);\n    }\n  }\n  return typeof ctrl === \"function\" ? ctrl(item, path5) : ctrl;\n}\n\n// node_modules/yaml/browser/dist/parse/cst.js\nvar BOM = \"\\uFEFF\";\nvar DOCUMENT = \"\u0002\";\nvar FLOW_END = \"\u0018\";\nvar SCALAR2 = \"\u001f\";\nvar isCollection2 = (token) => !!token && \"items\" in token;\nvar isScalar2 = (token) => !!token && (token.type === \"scalar\" || token.type === \"single-quoted-scalar\" || token.type === \"double-quoted-scalar\" || token.type === \"block-scalar\");\nfunction prettyToken(token) {\n  switch (token) {\n    case BOM:\n      return \"<BOM>\";\n    case DOCUMENT:\n      return \"<DOC>\";\n    case FLOW_END:\n      return \"<FLOW_END>\";\n    case SCALAR2:\n      return \"<SCALAR>\";\n    default:\n      return JSON.stringify(token);\n  }\n}\nfunction tokenType(source) {\n  switch (source) {\n    case BOM:\n      return \"byte-order-mark\";\n    case DOCUMENT:\n      return \"doc-mode\";\n    case FLOW_END:\n      return \"flow-error-end\";\n    case SCALAR2:\n      return \"scalar\";\n    case \"---\":\n      return \"doc-start\";\n    case \"...\":\n      return \"doc-end\";\n    case \"\":\n    case \"\\n\":\n    case \"\\r\\n\":\n      return \"newline\";\n    case \"-\":\n      return \"seq-item-ind\";\n    case \"?\":\n      return \"explicit-key-ind\";\n    case \":\":\n      return \"map-value-ind\";\n    case \"{\":\n      return \"flow-map-start\";\n    case \"}\":\n      return \"flow-map-end\";\n    case \"[\":\n      return \"flow-seq-start\";\n    case \"]\":\n      return \"flow-seq-end\";\n    case \",\":\n      return \"comma\";\n  }\n  switch (source[0]) {\n    case \" \":\n    case \"\t\":\n      return \"space\";\n    case \"#\":\n      return \"comment\";\n    case \"%\":\n      return \"directive-line\";\n    case \"*\":\n      return \"alias\";\n    case \"&\":\n      return \"anchor\";\n    case \"!\":\n      return \"tag\";\n    case \"'\":\n      return \"single-quoted-scalar\";\n    case '\"':\n      return \"double-quoted-scalar\";\n    case \"|\":\n    case \">\":\n      return \"block-scalar-header\";\n  }\n  return null;\n}\n\n// node_modules/yaml/browser/dist/parse/lexer.js\nfunction isEmpty(ch) {\n  switch (ch) {\n    case void 0:\n    case \" \":\n    case \"\\n\":\n    case \"\\r\":\n    case \"\t\":\n      return true;\n    default:\n      return false;\n  }\n}\nvar hexDigits = new Set(\"0123456789ABCDEFabcdef\");\nvar tagChars = new Set(\"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()\");\nvar flowIndicatorChars = new Set(\",[]{}\");\nvar invalidAnchorChars = new Set(\" ,[]{}\\n\\r\t\");\nvar isNotAnchorChar = (ch) => !ch || invalidAnchorChars.has(ch);\nvar Lexer = class {\n  constructor() {\n    this.atEnd = false;\n    this.blockScalarIndent = -1;\n    this.blockScalarKeep = false;\n    this.buffer = \"\";\n    this.flowKey = false;\n    this.flowLevel = 0;\n    this.indentNext = 0;\n    this.indentValue = 0;\n    this.lineEndPos = null;\n    this.next = null;\n    this.pos = 0;\n  }\n  /**\n   * Generate YAML tokens from the `source` string. If `incomplete`,\n   * a part of the last line may be left as a buffer for the next call.\n   *\n   * @returns A generator of lexical tokens\n   */\n  *lex(source, incomplete = false) {\n    var _a2;\n    if (source) {\n      if (typeof source !== \"string\")\n        throw TypeError(\"source is not a string\");\n      this.buffer = this.buffer ? this.buffer + source : source;\n      this.lineEndPos = null;\n    }\n    this.atEnd = !incomplete;\n    let next = (_a2 = this.next) != null ? _a2 : \"stream\";\n    while (next && (incomplete || this.hasChars(1)))\n      next = yield* __yieldStar(this.parseNext(next));\n  }\n  atLineEnd() {\n    let i = this.pos;\n    let ch = this.buffer[i];\n    while (ch === \" \" || ch === \"\t\")\n      ch = this.buffer[++i];\n    if (!ch || ch === \"#\" || ch === \"\\n\")\n      return true;\n    if (ch === \"\\r\")\n      return this.buffer[i + 1] === \"\\n\";\n    return false;\n  }\n  charAt(n4) {\n    return this.buffer[this.pos + n4];\n  }\n  continueScalar(offset) {\n    let ch = this.buffer[offset];\n    if (this.indentNext > 0) {\n      let indent = 0;\n      while (ch === \" \")\n        ch = this.buffer[++indent + offset];\n      if (ch === \"\\r\") {\n        const next = this.buffer[indent + offset + 1];\n        if (next === \"\\n\" || !next && !this.atEnd)\n          return offset + indent + 1;\n      }\n      return ch === \"\\n\" || indent >= this.indentNext || !ch && !this.atEnd ? offset + indent : -1;\n    }\n    if (ch === \"-\" || ch === \".\") {\n      const dt2 = this.buffer.substr(offset, 3);\n      if ((dt2 === \"---\" || dt2 === \"...\") && isEmpty(this.buffer[offset + 3]))\n        return -1;\n    }\n    return offset;\n  }\n  getLine() {\n    let end = this.lineEndPos;\n    if (typeof end !== \"number\" || end !== -1 && end < this.pos) {\n      end = this.buffer.indexOf(\"\\n\", this.pos);\n      this.lineEndPos = end;\n    }\n    if (end === -1)\n      return this.atEnd ? this.buffer.substring(this.pos) : null;\n    if (this.buffer[end - 1] === \"\\r\")\n      end -= 1;\n    return this.buffer.substring(this.pos, end);\n  }\n  hasChars(n4) {\n    return this.pos + n4 <= this.buffer.length;\n  }\n  setNext(state) {\n    this.buffer = this.buffer.substring(this.pos);\n    this.pos = 0;\n    this.lineEndPos = null;\n    this.next = state;\n    return null;\n  }\n  peek(n4) {\n    return this.buffer.substr(this.pos, n4);\n  }\n  *parseNext(next) {\n    switch (next) {\n      case \"stream\":\n        return yield* __yieldStar(this.parseStream());\n      case \"line-start\":\n        return yield* __yieldStar(this.parseLineStart());\n      case \"block-start\":\n        return yield* __yieldStar(this.parseBlockStart());\n      case \"doc\":\n        return yield* __yieldStar(this.parseDocument());\n      case \"flow\":\n        return yield* __yieldStar(this.parseFlowCollection());\n      case \"quoted-scalar\":\n        return yield* __yieldStar(this.parseQuotedScalar());\n      case \"block-scalar\":\n        return yield* __yieldStar(this.parseBlockScalar());\n      case \"plain-scalar\":\n        return yield* __yieldStar(this.parsePlainScalar());\n    }\n  }\n  *parseStream() {\n    let line = this.getLine();\n    if (line === null)\n      return this.setNext(\"stream\");\n    if (line[0] === BOM) {\n      yield* __yieldStar(this.pushCount(1));\n      line = line.substring(1);\n    }\n    if (line[0] === \"%\") {\n      let dirEnd = line.length;\n      let cs = line.indexOf(\"#\");\n      while (cs !== -1) {\n        const ch = line[cs - 1];\n        if (ch === \" \" || ch === \"\t\") {\n          dirEnd = cs - 1;\n          break;\n        } else {\n          cs = line.indexOf(\"#\", cs + 1);\n        }\n      }\n      while (true) {\n        const ch = line[dirEnd - 1];\n        if (ch === \" \" || ch === \"\t\")\n          dirEnd -= 1;\n        else\n          break;\n      }\n      const n4 = (yield* __yieldStar(this.pushCount(dirEnd))) + (yield* __yieldStar(this.pushSpaces(true)));\n      yield* __yieldStar(this.pushCount(line.length - n4));\n      this.pushNewline();\n      return \"stream\";\n    }\n    if (this.atLineEnd()) {\n      const sp = yield* __yieldStar(this.pushSpaces(true));\n      yield* __yieldStar(this.pushCount(line.length - sp));\n      yield* __yieldStar(this.pushNewline());\n      return \"stream\";\n    }\n    yield DOCUMENT;\n    return yield* __yieldStar(this.parseLineStart());\n  }\n  *parseLineStart() {\n    const ch = this.charAt(0);\n    if (!ch && !this.atEnd)\n      return this.setNext(\"line-start\");\n    if (ch === \"-\" || ch === \".\") {\n      if (!this.atEnd && !this.hasChars(4))\n        return this.setNext(\"line-start\");\n      const s = this.peek(3);\n      if ((s === \"---\" || s === \"...\") && isEmpty(this.charAt(3))) {\n        yield* __yieldStar(this.pushCount(3));\n        this.indentValue = 0;\n        this.indentNext = 0;\n        return s === \"---\" ? \"doc\" : \"stream\";\n      }\n    }\n    this.indentValue = yield* __yieldStar(this.pushSpaces(false));\n    if (this.indentNext > this.indentValue && !isEmpty(this.charAt(1)))\n      this.indentNext = this.indentValue;\n    return yield* __yieldStar(this.parseBlockStart());\n  }\n  *parseBlockStart() {\n    const [ch0, ch1] = this.peek(2);\n    if (!ch1 && !this.atEnd)\n      return this.setNext(\"block-start\");\n    if ((ch0 === \"-\" || ch0 === \"?\" || ch0 === \":\") && isEmpty(ch1)) {\n      const n4 = (yield* __yieldStar(this.pushCount(1))) + (yield* __yieldStar(this.pushSpaces(true)));\n      this.indentNext = this.indentValue + 1;\n      this.indentValue += n4;\n      return yield* __yieldStar(this.parseBlockStart());\n    }\n    return \"doc\";\n  }\n  *parseDocument() {\n    yield* __yieldStar(this.pushSpaces(true));\n    const line = this.getLine();\n    if (line === null)\n      return this.setNext(\"doc\");\n    let n4 = yield* __yieldStar(this.pushIndicators());\n    switch (line[n4]) {\n      case \"#\":\n        yield* __yieldStar(this.pushCount(line.length - n4));\n      // fallthrough\n      case void 0:\n        yield* __yieldStar(this.pushNewline());\n        return yield* __yieldStar(this.parseLineStart());\n      case \"{\":\n      case \"[\":\n        yield* __yieldStar(this.pushCount(1));\n        this.flowKey = false;\n        this.flowLevel = 1;\n        return \"flow\";\n      case \"}\":\n      case \"]\":\n        yield* __yieldStar(this.pushCount(1));\n        return \"doc\";\n      case \"*\":\n        yield* __yieldStar(this.pushUntil(isNotAnchorChar));\n        return \"doc\";\n      case '\"':\n      case \"'\":\n        return yield* __yieldStar(this.parseQuotedScalar());\n      case \"|\":\n      case \">\":\n        n4 += yield* __yieldStar(this.parseBlockScalarHeader());\n        n4 += yield* __yieldStar(this.pushSpaces(true));\n        yield* __yieldStar(this.pushCount(line.length - n4));\n        yield* __yieldStar(this.pushNewline());\n        return yield* __yieldStar(this.parseBlockScalar());\n      default:\n        return yield* __yieldStar(this.parsePlainScalar());\n    }\n  }\n  *parseFlowCollection() {\n    let nl2, sp;\n    let indent = -1;\n    do {\n      nl2 = yield* __yieldStar(this.pushNewline());\n      if (nl2 > 0) {\n        sp = yield* __yieldStar(this.pushSpaces(false));\n        this.indentValue = indent = sp;\n      } else {\n        sp = 0;\n      }\n      sp += yield* __yieldStar(this.pushSpaces(true));\n    } while (nl2 + sp > 0);\n    const line = this.getLine();\n    if (line === null)\n      return this.setNext(\"flow\");\n    if (indent !== -1 && indent < this.indentNext && line[0] !== \"#\" || indent === 0 && (line.startsWith(\"---\") || line.startsWith(\"...\")) && isEmpty(line[3])) {\n      const atFlowEndMarker = indent === this.indentNext - 1 && this.flowLevel === 1 && (line[0] === \"]\" || line[0] === \"}\");\n      if (!atFlowEndMarker) {\n        this.flowLevel = 0;\n        yield FLOW_END;\n        return yield* __yieldStar(this.parseLineStart());\n      }\n    }\n    let n4 = 0;\n    while (line[n4] === \",\") {\n      n4 += yield* __yieldStar(this.pushCount(1));\n      n4 += yield* __yieldStar(this.pushSpaces(true));\n      this.flowKey = false;\n    }\n    n4 += yield* __yieldStar(this.pushIndicators());\n    switch (line[n4]) {\n      case void 0:\n        return \"flow\";\n      case \"#\":\n        yield* __yieldStar(this.pushCount(line.length - n4));\n        return \"flow\";\n      case \"{\":\n      case \"[\":\n        yield* __yieldStar(this.pushCount(1));\n        this.flowKey = false;\n        this.flowLevel += 1;\n        return \"flow\";\n      case \"}\":\n      case \"]\":\n        yield* __yieldStar(this.pushCount(1));\n        this.flowKey = true;\n        this.flowLevel -= 1;\n        return this.flowLevel ? \"flow\" : \"doc\";\n      case \"*\":\n        yield* __yieldStar(this.pushUntil(isNotAnchorChar));\n        return \"flow\";\n      case '\"':\n      case \"'\":\n        this.flowKey = true;\n        return yield* __yieldStar(this.parseQuotedScalar());\n      case \":\": {\n        const next = this.charAt(1);\n        if (this.flowKey || isEmpty(next) || next === \",\") {\n          this.flowKey = false;\n          yield* __yieldStar(this.pushCount(1));\n          yield* __yieldStar(this.pushSpaces(true));\n          return \"flow\";\n        }\n      }\n      // fallthrough\n      default:\n        this.flowKey = false;\n        return yield* __yieldStar(this.parsePlainScalar());\n    }\n  }\n  *parseQuotedScalar() {\n    const quote = this.charAt(0);\n    let end = this.buffer.indexOf(quote, this.pos + 1);\n    if (quote === \"'\") {\n      while (end !== -1 && this.buffer[end + 1] === \"'\")\n        end = this.buffer.indexOf(\"'\", end + 2);\n    } else {\n      while (end !== -1) {\n        let n4 = 0;\n        while (this.buffer[end - 1 - n4] === \"\\\\\")\n          n4 += 1;\n        if (n4 % 2 === 0)\n          break;\n        end = this.buffer.indexOf('\"', end + 1);\n      }\n    }\n    const qb = this.buffer.substring(0, end);\n    let nl2 = qb.indexOf(\"\\n\", this.pos);\n    if (nl2 !== -1) {\n      while (nl2 !== -1) {\n        const cs = this.continueScalar(nl2 + 1);\n        if (cs === -1)\n          break;\n        nl2 = qb.indexOf(\"\\n\", cs);\n      }\n      if (nl2 !== -1) {\n        end = nl2 - (qb[nl2 - 1] === \"\\r\" ? 2 : 1);\n      }\n    }\n    if (end === -1) {\n      if (!this.atEnd)\n        return this.setNext(\"quoted-scalar\");\n      end = this.buffer.length;\n    }\n    yield* __yieldStar(this.pushToIndex(end + 1, false));\n    return this.flowLevel ? \"flow\" : \"doc\";\n  }\n  *parseBlockScalarHeader() {\n    this.blockScalarIndent = -1;\n    this.blockScalarKeep = false;\n    let i = this.pos;\n    while (true) {\n      const ch = this.buffer[++i];\n      if (ch === \"+\")\n        this.blockScalarKeep = true;\n      else if (ch > \"0\" && ch <= \"9\")\n        this.blockScalarIndent = Number(ch) - 1;\n      else if (ch !== \"-\")\n        break;\n    }\n    return yield* __yieldStar(this.pushUntil((ch) => isEmpty(ch) || ch === \"#\"));\n  }\n  *parseBlockScalar() {\n    let nl2 = this.pos - 1;\n    let indent = 0;\n    let ch;\n    loop: for (let i2 = this.pos; ch = this.buffer[i2]; ++i2) {\n      switch (ch) {\n        case \" \":\n          indent += 1;\n          break;\n        case \"\\n\":\n          nl2 = i2;\n          indent = 0;\n          break;\n        case \"\\r\": {\n          const next = this.buffer[i2 + 1];\n          if (!next && !this.atEnd)\n            return this.setNext(\"block-scalar\");\n          if (next === \"\\n\")\n            break;\n        }\n        // fallthrough\n        default:\n          break loop;\n      }\n    }\n    if (!ch && !this.atEnd)\n      return this.setNext(\"block-scalar\");\n    if (indent >= this.indentNext) {\n      if (this.blockScalarIndent === -1)\n        this.indentNext = indent;\n      else {\n        this.indentNext = this.blockScalarIndent + (this.indentNext === 0 ? 1 : this.indentNext);\n      }\n      do {\n        const cs = this.continueScalar(nl2 + 1);\n        if (cs === -1)\n          break;\n        nl2 = this.buffer.indexOf(\"\\n\", cs);\n      } while (nl2 !== -1);\n      if (nl2 === -1) {\n        if (!this.atEnd)\n          return this.setNext(\"block-scalar\");\n        nl2 = this.buffer.length;\n      }\n    }\n    let i = nl2 + 1;\n    ch = this.buffer[i];\n    while (ch === \" \")\n      ch = this.buffer[++i];\n    if (ch === \"\t\") {\n      while (ch === \"\t\" || ch === \" \" || ch === \"\\r\" || ch === \"\\n\")\n        ch = this.buffer[++i];\n      nl2 = i - 1;\n    } else if (!this.blockScalarKeep) {\n      do {\n        let i2 = nl2 - 1;\n        let ch2 = this.buffer[i2];\n        if (ch2 === \"\\r\")\n          ch2 = this.buffer[--i2];\n        const lastChar = i2;\n        while (ch2 === \" \")\n          ch2 = this.buffer[--i2];\n        if (ch2 === \"\\n\" && i2 >= this.pos && i2 + 1 + indent > lastChar)\n          nl2 = i2;\n        else\n          break;\n      } while (true);\n    }\n    yield SCALAR2;\n    yield* __yieldStar(this.pushToIndex(nl2 + 1, true));\n    return yield* __yieldStar(this.parseLineStart());\n  }\n  *parsePlainScalar() {\n    const inFlow = this.flowLevel > 0;\n    let end = this.pos - 1;\n    let i = this.pos - 1;\n    let ch;\n    while (ch = this.buffer[++i]) {\n      if (ch === \":\") {\n        const next = this.buffer[i + 1];\n        if (isEmpty(next) || inFlow && flowIndicatorChars.has(next))\n          break;\n        end = i;\n      } else if (isEmpty(ch)) {\n        let next = this.buffer[i + 1];\n        if (ch === \"\\r\") {\n          if (next === \"\\n\") {\n            i += 1;\n            ch = \"\\n\";\n            next = this.buffer[i + 1];\n          } else\n            end = i;\n        }\n        if (next === \"#\" || inFlow && flowIndicatorChars.has(next))\n          break;\n        if (ch === \"\\n\") {\n          const cs = this.continueScalar(i + 1);\n          if (cs === -1)\n            break;\n          i = Math.max(i, cs - 2);\n        }\n      } else {\n        if (inFlow && flowIndicatorChars.has(ch))\n          break;\n        end = i;\n      }\n    }\n    if (!ch && !this.atEnd)\n      return this.setNext(\"plain-scalar\");\n    yield SCALAR2;\n    yield* __yieldStar(this.pushToIndex(end + 1, true));\n    return inFlow ? \"flow\" : \"doc\";\n  }\n  *pushCount(n4) {\n    if (n4 > 0) {\n      yield this.buffer.substr(this.pos, n4);\n      this.pos += n4;\n      return n4;\n    }\n    return 0;\n  }\n  *pushToIndex(i, allowEmpty) {\n    const s = this.buffer.slice(this.pos, i);\n    if (s) {\n      yield s;\n      this.pos += s.length;\n      return s.length;\n    } else if (allowEmpty)\n      yield \"\";\n    return 0;\n  }\n  *pushIndicators() {\n    switch (this.charAt(0)) {\n      case \"!\":\n        return (yield* __yieldStar(this.pushTag())) + (yield* __yieldStar(this.pushSpaces(true))) + (yield* __yieldStar(this.pushIndicators()));\n      case \"&\":\n        return (yield* __yieldStar(this.pushUntil(isNotAnchorChar))) + (yield* __yieldStar(this.pushSpaces(true))) + (yield* __yieldStar(this.pushIndicators()));\n      case \"-\":\n      // this is an error\n      case \"?\":\n      // this is an error outside flow collections\n      case \":\": {\n        const inFlow = this.flowLevel > 0;\n        const ch1 = this.charAt(1);\n        if (isEmpty(ch1) || inFlow && flowIndicatorChars.has(ch1)) {\n          if (!inFlow)\n            this.indentNext = this.indentValue + 1;\n          else if (this.flowKey)\n            this.flowKey = false;\n          return (yield* __yieldStar(this.pushCount(1))) + (yield* __yieldStar(this.pushSpaces(true))) + (yield* __yieldStar(this.pushIndicators()));\n        }\n      }\n    }\n    return 0;\n  }\n  *pushTag() {\n    if (this.charAt(1) === \"<\") {\n      let i = this.pos + 2;\n      let ch = this.buffer[i];\n      while (!isEmpty(ch) && ch !== \">\")\n        ch = this.buffer[++i];\n      return yield* __yieldStar(this.pushToIndex(ch === \">\" ? i + 1 : i, false));\n    } else {\n      let i = this.pos + 1;\n      let ch = this.buffer[i];\n      while (ch) {\n        if (tagChars.has(ch))\n          ch = this.buffer[++i];\n        else if (ch === \"%\" && hexDigits.has(this.buffer[i + 1]) && hexDigits.has(this.buffer[i + 2])) {\n          ch = this.buffer[i += 3];\n        } else\n          break;\n      }\n      return yield* __yieldStar(this.pushToIndex(i, false));\n    }\n  }\n  *pushNewline() {\n    const ch = this.buffer[this.pos];\n    if (ch === \"\\n\")\n      return yield* __yieldStar(this.pushCount(1));\n    else if (ch === \"\\r\" && this.charAt(1) === \"\\n\")\n      return yield* __yieldStar(this.pushCount(2));\n    else\n      return 0;\n  }\n  *pushSpaces(allowTabs) {\n    let i = this.pos - 1;\n    let ch;\n    do {\n      ch = this.buffer[++i];\n    } while (ch === \" \" || allowTabs && ch === \"\t\");\n    const n4 = i - this.pos;\n    if (n4 > 0) {\n      yield this.buffer.substr(this.pos, n4);\n      this.pos = i;\n    }\n    return n4;\n  }\n  *pushUntil(test) {\n    let i = this.pos;\n    let ch = this.buffer[i];\n    while (!test(ch))\n      ch = this.buffer[++i];\n    return yield* __yieldStar(this.pushToIndex(i, false));\n  }\n};\n\n// node_modules/yaml/browser/dist/parse/line-counter.js\nvar LineCounter = class {\n  constructor() {\n    this.lineStarts = [];\n    this.addNewLine = (offset) => this.lineStarts.push(offset);\n    this.linePos = (offset) => {\n      let low = 0;\n      let high = this.lineStarts.length;\n      while (low < high) {\n        const mid = low + high >> 1;\n        if (this.lineStarts[mid] < offset)\n          low = mid + 1;\n        else\n          high = mid;\n      }\n      if (this.lineStarts[low] === offset)\n        return { line: low + 1, col: 1 };\n      if (low === 0)\n        return { line: 0, col: offset };\n      const start = this.lineStarts[low - 1];\n      return { line: low, col: offset - start + 1 };\n    };\n  }\n};\n\n// node_modules/yaml/browser/dist/parse/parser.js\nfunction includesToken(list, type) {\n  for (let i = 0; i < list.length; ++i)\n    if (list[i].type === type)\n      return true;\n  return false;\n}\nfunction findNonEmptyIndex(list) {\n  for (let i = 0; i < list.length; ++i) {\n    switch (list[i].type) {\n      case \"space\":\n      case \"comment\":\n      case \"newline\":\n        break;\n      default:\n        return i;\n    }\n  }\n  return -1;\n}\nfunction isFlowToken(token) {\n  switch (token == null ? void 0 : token.type) {\n    case \"alias\":\n    case \"scalar\":\n    case \"single-quoted-scalar\":\n    case \"double-quoted-scalar\":\n    case \"flow-collection\":\n      return true;\n    default:\n      return false;\n  }\n}\nfunction getPrevProps(parent) {\n  var _a2;\n  switch (parent.type) {\n    case \"document\":\n      return parent.start;\n    case \"block-map\": {\n      const it = parent.items[parent.items.length - 1];\n      return (_a2 = it.sep) != null ? _a2 : it.start;\n    }\n    case \"block-seq\":\n      return parent.items[parent.items.length - 1].start;\n    /* istanbul ignore next should not happen */\n    default:\n      return [];\n  }\n}\nfunction getFirstKeyStartProps(prev) {\n  var _a2;\n  if (prev.length === 0)\n    return [];\n  let i = prev.length;\n  loop: while (--i >= 0) {\n    switch (prev[i].type) {\n      case \"doc-start\":\n      case \"explicit-key-ind\":\n      case \"map-value-ind\":\n      case \"seq-item-ind\":\n      case \"newline\":\n        break loop;\n    }\n  }\n  while (((_a2 = prev[++i]) == null ? void 0 : _a2.type) === \"space\") {\n  }\n  return prev.splice(i, prev.length);\n}\nfunction fixFlowSeqItems(fc) {\n  if (fc.start.type === \"flow-seq-start\") {\n    for (const it of fc.items) {\n      if (it.sep && !it.value && !includesToken(it.start, \"explicit-key-ind\") && !includesToken(it.sep, \"map-value-ind\")) {\n        if (it.key)\n          it.value = it.key;\n        delete it.key;\n        if (isFlowToken(it.value)) {\n          if (it.value.end)\n            Array.prototype.push.apply(it.value.end, it.sep);\n          else\n            it.value.end = it.sep;\n        } else\n          Array.prototype.push.apply(it.start, it.sep);\n        delete it.sep;\n      }\n    }\n  }\n}\nvar Parser = class {\n  /**\n   * @param onNewLine - If defined, called separately with the start position of\n   *   each new line (in `parse()`, including the start of input).\n   */\n  constructor(onNewLine) {\n    this.atNewLine = true;\n    this.atScalar = false;\n    this.indent = 0;\n    this.offset = 0;\n    this.onKeyLine = false;\n    this.stack = [];\n    this.source = \"\";\n    this.type = \"\";\n    this.lexer = new Lexer();\n    this.onNewLine = onNewLine;\n  }\n  /**\n   * Parse `source` as a YAML stream.\n   * If `incomplete`, a part of the last line may be left as a buffer for the next call.\n   *\n   * Errors are not thrown, but yielded as `{ type: 'error', message }` tokens.\n   *\n   * @returns A generator of tokens representing each directive, document, and other structure.\n   */\n  *parse(source, incomplete = false) {\n    if (this.onNewLine && this.offset === 0)\n      this.onNewLine(0);\n    for (const lexeme of this.lexer.lex(source, incomplete))\n      yield* __yieldStar(this.next(lexeme));\n    if (!incomplete)\n      yield* __yieldStar(this.end());\n  }\n  /**\n   * Advance the parser by the `source` of one lexical token.\n   */\n  *next(source) {\n    this.source = source;\n    if (this.atScalar) {\n      this.atScalar = false;\n      yield* __yieldStar(this.step());\n      this.offset += source.length;\n      return;\n    }\n    const type = tokenType(source);\n    if (!type) {\n      const message = `Not a YAML token: ${source}`;\n      yield* __yieldStar(this.pop({ type: \"error\", offset: this.offset, message, source }));\n      this.offset += source.length;\n    } else if (type === \"scalar\") {\n      this.atNewLine = false;\n      this.atScalar = true;\n      this.type = \"scalar\";\n    } else {\n      this.type = type;\n      yield* __yieldStar(this.step());\n      switch (type) {\n        case \"newline\":\n          this.atNewLine = true;\n          this.indent = 0;\n          if (this.onNewLine)\n            this.onNewLine(this.offset + source.length);\n          break;\n        case \"space\":\n          if (this.atNewLine && source[0] === \" \")\n            this.indent += source.length;\n          break;\n        case \"explicit-key-ind\":\n        case \"map-value-ind\":\n        case \"seq-item-ind\":\n          if (this.atNewLine)\n            this.indent += source.length;\n          break;\n        case \"doc-mode\":\n        case \"flow-error-end\":\n          return;\n        default:\n          this.atNewLine = false;\n      }\n      this.offset += source.length;\n    }\n  }\n  /** Call at end of input to push out any remaining constructions */\n  *end() {\n    while (this.stack.length > 0)\n      yield* __yieldStar(this.pop());\n  }\n  get sourceToken() {\n    const st2 = {\n      type: this.type,\n      offset: this.offset,\n      indent: this.indent,\n      source: this.source\n    };\n    return st2;\n  }\n  *step() {\n    const top = this.peek(1);\n    if (this.type === \"doc-end\" && (top == null ? void 0 : top.type) !== \"doc-end\") {\n      while (this.stack.length > 0)\n        yield* __yieldStar(this.pop());\n      this.stack.push({\n        type: \"doc-end\",\n        offset: this.offset,\n        source: this.source\n      });\n      return;\n    }\n    if (!top)\n      return yield* __yieldStar(this.stream());\n    switch (top.type) {\n      case \"document\":\n        return yield* __yieldStar(this.document(top));\n      case \"alias\":\n      case \"scalar\":\n      case \"single-quoted-scalar\":\n      case \"double-quoted-scalar\":\n        return yield* __yieldStar(this.scalar(top));\n      case \"block-scalar\":\n        return yield* __yieldStar(this.blockScalar(top));\n      case \"block-map\":\n        return yield* __yieldStar(this.blockMap(top));\n      case \"block-seq\":\n        return yield* __yieldStar(this.blockSequence(top));\n      case \"flow-collection\":\n        return yield* __yieldStar(this.flowCollection(top));\n      case \"doc-end\":\n        return yield* __yieldStar(this.documentEnd(top));\n    }\n    yield* __yieldStar(this.pop());\n  }\n  peek(n4) {\n    return this.stack[this.stack.length - n4];\n  }\n  *pop(error) {\n    const token = error != null ? error : this.stack.pop();\n    if (!token) {\n      const message = \"Tried to pop an empty stack\";\n      yield { type: \"error\", offset: this.offset, source: \"\", message };\n    } else if (this.stack.length === 0) {\n      yield token;\n    } else {\n      const top = this.peek(1);\n      if (token.type === \"block-scalar\") {\n        token.indent = \"indent\" in top ? top.indent : 0;\n      } else if (token.type === \"flow-collection\" && top.type === \"document\") {\n        token.indent = 0;\n      }\n      if (token.type === \"flow-collection\")\n        fixFlowSeqItems(token);\n      switch (top.type) {\n        case \"document\":\n          top.value = token;\n          break;\n        case \"block-scalar\":\n          top.props.push(token);\n          break;\n        case \"block-map\": {\n          const it = top.items[top.items.length - 1];\n          if (it.value) {\n            top.items.push({ start: [], key: token, sep: [] });\n            this.onKeyLine = true;\n            return;\n          } else if (it.sep) {\n            it.value = token;\n          } else {\n            Object.assign(it, { key: token, sep: [] });\n            this.onKeyLine = !it.explicitKey;\n            return;\n          }\n          break;\n        }\n        case \"block-seq\": {\n          const it = top.items[top.items.length - 1];\n          if (it.value)\n            top.items.push({ start: [], value: token });\n          else\n            it.value = token;\n          break;\n        }\n        case \"flow-collection\": {\n          const it = top.items[top.items.length - 1];\n          if (!it || it.value)\n            top.items.push({ start: [], key: token, sep: [] });\n          else if (it.sep)\n            it.value = token;\n          else\n            Object.assign(it, { key: token, sep: [] });\n          return;\n        }\n        /* istanbul ignore next should not happen */\n        default:\n          yield* __yieldStar(this.pop());\n          yield* __yieldStar(this.pop(token));\n      }\n      if ((top.type === \"document\" || top.type === \"block-map\" || top.type === \"block-seq\") && (token.type === \"block-map\" || token.type === \"block-seq\")) {\n        const last = token.items[token.items.length - 1];\n        if (last && !last.sep && !last.value && last.start.length > 0 && findNonEmptyIndex(last.start) === -1 && (token.indent === 0 || last.start.every((st2) => st2.type !== \"comment\" || st2.indent < token.indent))) {\n          if (top.type === \"document\")\n            top.end = last.start;\n          else\n            top.items.push({ start: last.start });\n          token.items.splice(-1, 1);\n        }\n      }\n    }\n  }\n  *stream() {\n    switch (this.type) {\n      case \"directive-line\":\n        yield { type: \"directive\", offset: this.offset, source: this.source };\n        return;\n      case \"byte-order-mark\":\n      case \"space\":\n      case \"comment\":\n      case \"newline\":\n        yield this.sourceToken;\n        return;\n      case \"doc-mode\":\n      case \"doc-start\": {\n        const doc = {\n          type: \"document\",\n          offset: this.offset,\n          start: []\n        };\n        if (this.type === \"doc-start\")\n          doc.start.push(this.sourceToken);\n        this.stack.push(doc);\n        return;\n      }\n    }\n    yield {\n      type: \"error\",\n      offset: this.offset,\n      message: `Unexpected ${this.type} token in YAML stream`,\n      source: this.source\n    };\n  }\n  *document(doc) {\n    if (doc.value)\n      return yield* __yieldStar(this.lineEnd(doc));\n    switch (this.type) {\n      case \"doc-start\": {\n        if (findNonEmptyIndex(doc.start) !== -1) {\n          yield* __yieldStar(this.pop());\n          yield* __yieldStar(this.step());\n        } else\n          doc.start.push(this.sourceToken);\n        return;\n      }\n      case \"anchor\":\n      case \"tag\":\n      case \"space\":\n      case \"comment\":\n      case \"newline\":\n        doc.start.push(this.sourceToken);\n        return;\n    }\n    const bv = this.startBlockValue(doc);\n    if (bv)\n      this.stack.push(bv);\n    else {\n      yield {\n        type: \"error\",\n        offset: this.offset,\n        message: `Unexpected ${this.type} token in YAML document`,\n        source: this.source\n      };\n    }\n  }\n  *scalar(scalar) {\n    if (this.type === \"map-value-ind\") {\n      const prev = getPrevProps(this.peek(2));\n      const start = getFirstKeyStartProps(prev);\n      let sep;\n      if (scalar.end) {\n        sep = scalar.end;\n        sep.push(this.sourceToken);\n        delete scalar.end;\n      } else\n        sep = [this.sourceToken];\n      const map2 = {\n        type: \"block-map\",\n        offset: scalar.offset,\n        indent: scalar.indent,\n        items: [{ start, key: scalar, sep }]\n      };\n      this.onKeyLine = true;\n      this.stack[this.stack.length - 1] = map2;\n    } else\n      yield* __yieldStar(this.lineEnd(scalar));\n  }\n  *blockScalar(scalar) {\n    switch (this.type) {\n      case \"space\":\n      case \"comment\":\n      case \"newline\":\n        scalar.props.push(this.sourceToken);\n        return;\n      case \"scalar\":\n        scalar.source = this.source;\n        this.atNewLine = true;\n        this.indent = 0;\n        if (this.onNewLine) {\n          let nl2 = this.source.indexOf(\"\\n\") + 1;\n          while (nl2 !== 0) {\n            this.onNewLine(this.offset + nl2);\n            nl2 = this.source.indexOf(\"\\n\", nl2) + 1;\n          }\n        }\n        yield* __yieldStar(this.pop());\n        break;\n      /* istanbul ignore next should not happen */\n      default:\n        yield* __yieldStar(this.pop());\n        yield* __yieldStar(this.step());\n    }\n  }\n  *blockMap(map2) {\n    var _a2;\n    const it = map2.items[map2.items.length - 1];\n    switch (this.type) {\n      case \"newline\":\n        this.onKeyLine = false;\n        if (it.value) {\n          const end = \"end\" in it.value ? it.value.end : void 0;\n          const last = Array.isArray(end) ? end[end.length - 1] : void 0;\n          if ((last == null ? void 0 : last.type) === \"comment\")\n            end == null ? void 0 : end.push(this.sourceToken);\n          else\n            map2.items.push({ start: [this.sourceToken] });\n        } else if (it.sep) {\n          it.sep.push(this.sourceToken);\n        } else {\n          it.start.push(this.sourceToken);\n        }\n        return;\n      case \"space\":\n      case \"comment\":\n        if (it.value) {\n          map2.items.push({ start: [this.sourceToken] });\n        } else if (it.sep) {\n          it.sep.push(this.sourceToken);\n        } else {\n          if (this.atIndentedComment(it.start, map2.indent)) {\n            const prev = map2.items[map2.items.length - 2];\n            const end = (_a2 = prev == null ? void 0 : prev.value) == null ? void 0 : _a2.end;\n            if (Array.isArray(end)) {\n              Array.prototype.push.apply(end, it.start);\n              end.push(this.sourceToken);\n              map2.items.pop();\n              return;\n            }\n          }\n          it.start.push(this.sourceToken);\n        }\n        return;\n    }\n    if (this.indent >= map2.indent) {\n      const atMapIndent = !this.onKeyLine && this.indent === map2.indent;\n      const atNextItem = atMapIndent && (it.sep || it.explicitKey) && this.type !== \"seq-item-ind\";\n      let start = [];\n      if (atNextItem && it.sep && !it.value) {\n        const nl2 = [];\n        for (let i = 0; i < it.sep.length; ++i) {\n          const st2 = it.sep[i];\n          switch (st2.type) {\n            case \"newline\":\n              nl2.push(i);\n              break;\n            case \"space\":\n              break;\n            case \"comment\":\n              if (st2.indent > map2.indent)\n                nl2.length = 0;\n              break;\n            default:\n              nl2.length = 0;\n          }\n        }\n        if (nl2.length >= 2)\n          start = it.sep.splice(nl2[1]);\n      }\n      switch (this.type) {\n        case \"anchor\":\n        case \"tag\":\n          if (atNextItem || it.value) {\n            start.push(this.sourceToken);\n            map2.items.push({ start });\n            this.onKeyLine = true;\n          } else if (it.sep) {\n            it.sep.push(this.sourceToken);\n          } else {\n            it.start.push(this.sourceToken);\n          }\n          return;\n        case \"explicit-key-ind\":\n          if (!it.sep && !it.explicitKey) {\n            it.start.push(this.sourceToken);\n            it.explicitKey = true;\n          } else if (atNextItem || it.value) {\n            start.push(this.sourceToken);\n            map2.items.push({ start, explicitKey: true });\n          } else {\n            this.stack.push({\n              type: \"block-map\",\n              offset: this.offset,\n              indent: this.indent,\n              items: [{ start: [this.sourceToken], explicitKey: true }]\n            });\n          }\n          this.onKeyLine = true;\n          return;\n        case \"map-value-ind\":\n          if (it.explicitKey) {\n            if (!it.sep) {\n              if (includesToken(it.start, \"newline\")) {\n                Object.assign(it, { key: null, sep: [this.sourceToken] });\n              } else {\n                const start2 = getFirstKeyStartProps(it.start);\n                this.stack.push({\n                  type: \"block-map\",\n                  offset: this.offset,\n                  indent: this.indent,\n                  items: [{ start: start2, key: null, sep: [this.sourceToken] }]\n                });\n              }\n            } else if (it.value) {\n              map2.items.push({ start: [], key: null, sep: [this.sourceToken] });\n            } else if (includesToken(it.sep, \"map-value-ind\")) {\n              this.stack.push({\n                type: \"block-map\",\n                offset: this.offset,\n                indent: this.indent,\n                items: [{ start, key: null, sep: [this.sourceToken] }]\n              });\n            } else if (isFlowToken(it.key) && !includesToken(it.sep, \"newline\")) {\n              const start2 = getFirstKeyStartProps(it.start);\n              const key = it.key;\n              const sep = it.sep;\n              sep.push(this.sourceToken);\n              delete it.key;\n              delete it.sep;\n              this.stack.push({\n                type: \"block-map\",\n                offset: this.offset,\n                indent: this.indent,\n                items: [{ start: start2, key, sep }]\n              });\n            } else if (start.length > 0) {\n              it.sep = it.sep.concat(start, this.sourceToken);\n            } else {\n              it.sep.push(this.sourceToken);\n            }\n          } else {\n            if (!it.sep) {\n              Object.assign(it, { key: null, sep: [this.sourceToken] });\n            } else if (it.value || atNextItem) {\n              map2.items.push({ start, key: null, sep: [this.sourceToken] });\n            } else if (includesToken(it.sep, \"map-value-ind\")) {\n              this.stack.push({\n                type: \"block-map\",\n                offset: this.offset,\n                indent: this.indent,\n                items: [{ start: [], key: null, sep: [this.sourceToken] }]\n              });\n            } else {\n              it.sep.push(this.sourceToken);\n            }\n          }\n          this.onKeyLine = true;\n          return;\n        case \"alias\":\n        case \"scalar\":\n        case \"single-quoted-scalar\":\n        case \"double-quoted-scalar\": {\n          const fs6 = this.flowScalar(this.type);\n          if (atNextItem || it.value) {\n            map2.items.push({ start, key: fs6, sep: [] });\n            this.onKeyLine = true;\n          } else if (it.sep) {\n            this.stack.push(fs6);\n          } else {\n            Object.assign(it, { key: fs6, sep: [] });\n            this.onKeyLine = true;\n          }\n          return;\n        }\n        default: {\n          const bv = this.startBlockValue(map2);\n          if (bv) {\n            if (bv.type === \"block-seq\") {\n              if (!it.explicitKey && it.sep && !includesToken(it.sep, \"newline\")) {\n                yield* __yieldStar(this.pop({\n                  type: \"error\",\n                  offset: this.offset,\n                  message: \"Unexpected block-seq-ind on same line with key\",\n                  source: this.source\n                }));\n                return;\n              }\n            } else if (atMapIndent) {\n              map2.items.push({ start });\n            }\n            this.stack.push(bv);\n            return;\n          }\n        }\n      }\n    }\n    yield* __yieldStar(this.pop());\n    yield* __yieldStar(this.step());\n  }\n  *blockSequence(seq2) {\n    var _a2;\n    const it = seq2.items[seq2.items.length - 1];\n    switch (this.type) {\n      case \"newline\":\n        if (it.value) {\n          const end = \"end\" in it.value ? it.value.end : void 0;\n          const last = Array.isArray(end) ? end[end.length - 1] : void 0;\n          if ((last == null ? void 0 : last.type) === \"comment\")\n            end == null ? void 0 : end.push(this.sourceToken);\n          else\n            seq2.items.push({ start: [this.sourceToken] });\n        } else\n          it.start.push(this.sourceToken);\n        return;\n      case \"space\":\n      case \"comment\":\n        if (it.value)\n          seq2.items.push({ start: [this.sourceToken] });\n        else {\n          if (this.atIndentedComment(it.start, seq2.indent)) {\n            const prev = seq2.items[seq2.items.length - 2];\n            const end = (_a2 = prev == null ? void 0 : prev.value) == null ? void 0 : _a2.end;\n            if (Array.isArray(end)) {\n              Array.prototype.push.apply(end, it.start);\n              end.push(this.sourceToken);\n              seq2.items.pop();\n              return;\n            }\n          }\n          it.start.push(this.sourceToken);\n        }\n        return;\n      case \"anchor\":\n      case \"tag\":\n        if (it.value || this.indent <= seq2.indent)\n          break;\n        it.start.push(this.sourceToken);\n        return;\n      case \"seq-item-ind\":\n        if (this.indent !== seq2.indent)\n          break;\n        if (it.value || includesToken(it.start, \"seq-item-ind\"))\n          seq2.items.push({ start: [this.sourceToken] });\n        else\n          it.start.push(this.sourceToken);\n        return;\n    }\n    if (this.indent > seq2.indent) {\n      const bv = this.startBlockValue(seq2);\n      if (bv) {\n        this.stack.push(bv);\n        return;\n      }\n    }\n    yield* __yieldStar(this.pop());\n    yield* __yieldStar(this.step());\n  }\n  *flowCollection(fc) {\n    const it = fc.items[fc.items.length - 1];\n    if (this.type === \"flow-error-end\") {\n      let top;\n      do {\n        yield* __yieldStar(this.pop());\n        top = this.peek(1);\n      } while ((top == null ? void 0 : top.type) === \"flow-collection\");\n    } else if (fc.end.length === 0) {\n      switch (this.type) {\n        case \"comma\":\n        case \"explicit-key-ind\":\n          if (!it || it.sep)\n            fc.items.push({ start: [this.sourceToken] });\n          else\n            it.start.push(this.sourceToken);\n          return;\n        case \"map-value-ind\":\n          if (!it || it.value)\n            fc.items.push({ start: [], key: null, sep: [this.sourceToken] });\n          else if (it.sep)\n            it.sep.push(this.sourceToken);\n          else\n            Object.assign(it, { key: null, sep: [this.sourceToken] });\n          return;\n        case \"space\":\n        case \"comment\":\n        case \"newline\":\n        case \"anchor\":\n        case \"tag\":\n          if (!it || it.value)\n            fc.items.push({ start: [this.sourceToken] });\n          else if (it.sep)\n            it.sep.push(this.sourceToken);\n          else\n            it.start.push(this.sourceToken);\n          return;\n        case \"alias\":\n        case \"scalar\":\n        case \"single-quoted-scalar\":\n        case \"double-quoted-scalar\": {\n          const fs6 = this.flowScalar(this.type);\n          if (!it || it.value)\n            fc.items.push({ start: [], key: fs6, sep: [] });\n          else if (it.sep)\n            this.stack.push(fs6);\n          else\n            Object.assign(it, { key: fs6, sep: [] });\n          return;\n        }\n        case \"flow-map-end\":\n        case \"flow-seq-end\":\n          fc.end.push(this.sourceToken);\n          return;\n      }\n      const bv = this.startBlockValue(fc);\n      if (bv)\n        this.stack.push(bv);\n      else {\n        yield* __yieldStar(this.pop());\n        yield* __yieldStar(this.step());\n      }\n    } else {\n      const parent = this.peek(2);\n      if (parent.type === \"block-map\" && (this.type === \"map-value-ind\" && parent.indent === fc.indent || this.type === \"newline\" && !parent.items[parent.items.length - 1].sep)) {\n        yield* __yieldStar(this.pop());\n        yield* __yieldStar(this.step());\n      } else if (this.type === \"map-value-ind\" && parent.type !== \"flow-collection\") {\n        const prev = getPrevProps(parent);\n        const start = getFirstKeyStartProps(prev);\n        fixFlowSeqItems(fc);\n        const sep = fc.end.splice(1, fc.end.length);\n        sep.push(this.sourceToken);\n        const map2 = {\n          type: \"block-map\",\n          offset: fc.offset,\n          indent: fc.indent,\n          items: [{ start, key: fc, sep }]\n        };\n        this.onKeyLine = true;\n        this.stack[this.stack.length - 1] = map2;\n      } else {\n        yield* __yieldStar(this.lineEnd(fc));\n      }\n    }\n  }\n  flowScalar(type) {\n    if (this.onNewLine) {\n      let nl2 = this.source.indexOf(\"\\n\") + 1;\n      while (nl2 !== 0) {\n        this.onNewLine(this.offset + nl2);\n        nl2 = this.source.indexOf(\"\\n\", nl2) + 1;\n      }\n    }\n    return {\n      type,\n      offset: this.offset,\n      indent: this.indent,\n      source: this.source\n    };\n  }\n  startBlockValue(parent) {\n    switch (this.type) {\n      case \"alias\":\n      case \"scalar\":\n      case \"single-quoted-scalar\":\n      case \"double-quoted-scalar\":\n        return this.flowScalar(this.type);\n      case \"block-scalar-header\":\n        return {\n          type: \"block-scalar\",\n          offset: this.offset,\n          indent: this.indent,\n          props: [this.sourceToken],\n          source: \"\"\n        };\n      case \"flow-map-start\":\n      case \"flow-seq-start\":\n        return {\n          type: \"flow-collection\",\n          offset: this.offset,\n          indent: this.indent,\n          start: this.sourceToken,\n          items: [],\n          end: []\n        };\n      case \"seq-item-ind\":\n        return {\n          type: \"block-seq\",\n          offset: this.offset,\n          indent: this.indent,\n          items: [{ start: [this.sourceToken] }]\n        };\n      case \"explicit-key-ind\": {\n        this.onKeyLine = true;\n        const prev = getPrevProps(parent);\n        const start = getFirstKeyStartProps(prev);\n        start.push(this.sourceToken);\n        return {\n          type: \"block-map\",\n          offset: this.offset,\n          indent: this.indent,\n          items: [{ start, explicitKey: true }]\n        };\n      }\n      case \"map-value-ind\": {\n        this.onKeyLine = true;\n        const prev = getPrevProps(parent);\n        const start = getFirstKeyStartProps(prev);\n        return {\n          type: \"block-map\",\n          offset: this.offset,\n          indent: this.indent,\n          items: [{ start, key: null, sep: [this.sourceToken] }]\n        };\n      }\n    }\n    return null;\n  }\n  atIndentedComment(start, indent) {\n    if (this.type !== \"comment\")\n      return false;\n    if (this.indent <= indent)\n      return false;\n    return start.every((st2) => st2.type === \"newline\" || st2.type === \"space\");\n  }\n  *documentEnd(docEnd) {\n    if (this.type !== \"doc-mode\") {\n      if (docEnd.end)\n        docEnd.end.push(this.sourceToken);\n      else\n        docEnd.end = [this.sourceToken];\n      if (this.type === \"newline\")\n        yield* __yieldStar(this.pop());\n    }\n  }\n  *lineEnd(token) {\n    switch (this.type) {\n      case \"comma\":\n      case \"doc-start\":\n      case \"doc-end\":\n      case \"flow-seq-end\":\n      case \"flow-map-end\":\n      case \"map-value-ind\":\n        yield* __yieldStar(this.pop());\n        yield* __yieldStar(this.step());\n        break;\n      case \"newline\":\n        this.onKeyLine = false;\n      // fallthrough\n      case \"space\":\n      case \"comment\":\n      default:\n        if (token.end)\n          token.end.push(this.sourceToken);\n        else\n          token.end = [this.sourceToken];\n        if (this.type === \"newline\")\n          yield* __yieldStar(this.pop());\n    }\n  }\n};\n\n// node_modules/yaml/browser/dist/public-api.js\nfunction parseOptions(options) {\n  const prettyErrors = options.prettyErrors !== false;\n  const lineCounter = options.lineCounter || prettyErrors && new LineCounter() || null;\n  return { lineCounter, prettyErrors };\n}\nfunction parseAllDocuments(source, options = {}) {\n  const { lineCounter, prettyErrors } = parseOptions(options);\n  const parser = new Parser(lineCounter == null ? void 0 : lineCounter.addNewLine);\n  const composer = new Composer(options);\n  const docs = Array.from(composer.compose(parser.parse(source)));\n  if (prettyErrors && lineCounter)\n    for (const doc of docs) {\n      doc.errors.forEach(prettifyError(source, lineCounter));\n      doc.warnings.forEach(prettifyError(source, lineCounter));\n    }\n  if (docs.length > 0)\n    return docs;\n  return Object.assign([], { empty: true }, composer.streamInfo());\n}\nfunction parseDocument(source, options = {}) {\n  const { lineCounter, prettyErrors } = parseOptions(options);\n  const parser = new Parser(lineCounter == null ? void 0 : lineCounter.addNewLine);\n  const composer = new Composer(options);\n  let doc = null;\n  for (const _doc of composer.compose(parser.parse(source), true, source.length)) {\n    if (!doc)\n      doc = _doc;\n    else if (doc.options.logLevel !== \"silent\") {\n      doc.errors.push(new YAMLParseError(_doc.range.slice(0, 2), \"MULTIPLE_DOCS\", \"Source contains multiple documents; please use YAML.parseAllDocuments()\"));\n      break;\n    }\n  }\n  if (prettyErrors && lineCounter) {\n    doc.errors.forEach(prettifyError(source, lineCounter));\n    doc.warnings.forEach(prettifyError(source, lineCounter));\n  }\n  return doc;\n}\nfunction parse(src, reviver, options) {\n  let _reviver = void 0;\n  if (typeof reviver === \"function\") {\n    _reviver = reviver;\n  } else if (options === void 0 && reviver && typeof reviver === \"object\") {\n    options = reviver;\n  }\n  const doc = parseDocument(src, options);\n  if (!doc)\n    return null;\n  doc.warnings.forEach((warning) => warn(doc.options.logLevel, warning));\n  if (doc.errors.length > 0) {\n    if (doc.options.logLevel !== \"silent\")\n      throw doc.errors[0];\n    else\n      doc.errors = [];\n  }\n  return doc.toJS(Object.assign({ reviver: _reviver }, options));\n}\nfunction stringify3(value, replacer, options) {\n  var _a2;\n  let _replacer = null;\n  if (typeof replacer === \"function\" || Array.isArray(replacer)) {\n    _replacer = replacer;\n  } else if (options === void 0 && replacer) {\n    options = replacer;\n  }\n  if (typeof options === \"string\")\n    options = options.length;\n  if (typeof options === \"number\") {\n    const indent = Math.round(options);\n    options = indent < 1 ? void 0 : indent > 8 ? { indent: 8 } : { indent };\n  }\n  if (value === void 0) {\n    const { keepUndefined } = (_a2 = options != null ? options : replacer) != null ? _a2 : {};\n    if (!keepUndefined)\n      return void 0;\n  }\n  if (isDocument(value) && !_replacer)\n    return value.toString(options);\n  return new Document(value, _replacer, options).toString(options);\n}\n\n// node_modules/yaml/browser/index.js\nvar browser_default = dist_exports;\n\n// node_modules/maml.js/build/index.js\nvar build_exports = {};\n__export(build_exports, {\n  parse: () => parse2,\n  stringify: () => stringify4\n});\n\n// node_modules/maml.js/build/parse.js\nfunction parse2(source) {\n  if (typeof source !== \"string\")\n    throw TypeError(\"Source must be a string\");\n  let pos = 0, lineNumber = 1, ch, done = false;\n  next();\n  const value = parseValue();\n  skipWhitespace();\n  if (!done) {\n    throw new SyntaxError(errorSnippet());\n  }\n  expectValue(value);\n  return value;\n  function next() {\n    if (pos < source.length) {\n      ch = source[pos];\n      pos++;\n    } else {\n      ch = \"\";\n      done = true;\n    }\n    if (ch === \"\\n\") {\n      lineNumber++;\n    }\n  }\n  function lookahead2() {\n    return source.substring(pos, pos + 2);\n  }\n  function parseValue() {\n    var _a2, _b2, _c, _d, _e, _f, _g;\n    skipWhitespace();\n    return (_g = (_f = (_e = (_d = (_c = (_b2 = (_a2 = parseMultilineString()) != null ? _a2 : parseString()) != null ? _b2 : parseNumber()) != null ? _c : parseObject()) != null ? _d : parseArray()) != null ? _e : parseKeyword(\"true\", true)) != null ? _f : parseKeyword(\"false\", false)) != null ? _g : parseKeyword(\"null\", null);\n  }\n  function parseString() {\n    if (ch !== '\"')\n      return;\n    let str = \"\";\n    let escaped = false;\n    while (true) {\n      next();\n      if (escaped) {\n        if (ch === \"u\") {\n          next();\n          if (ch !== \"{\") {\n            throw new SyntaxError(errorSnippet(errorMap.u + \" \" + JSON.stringify(ch) + ' (expected \"{\")'));\n          }\n          let hex = \"\";\n          while (true) {\n            next();\n            if (ch === \"}\")\n              break;\n            if (!isHexDigit(ch)) {\n              throw new SyntaxError(errorSnippet(errorMap.u + \" \" + JSON.stringify(ch)));\n            }\n            hex += ch;\n            if (hex.length > 6) {\n              throw new SyntaxError(errorSnippet(errorMap.u + \" (too many hex digits)\"));\n            }\n          }\n          if (hex.length === 0) {\n            throw new SyntaxError(errorSnippet(errorMap.u));\n          }\n          const codePoint = parseInt(hex, 16);\n          if (codePoint > 1114111) {\n            throw new SyntaxError(errorSnippet(errorMap.u + \" (out of range)\"));\n          }\n          str += String.fromCodePoint(codePoint);\n        } else {\n          const escapedChar = escapeMap[ch];\n          if (!escapedChar) {\n            throw new SyntaxError(errorSnippet(errorMap.u + \" \" + JSON.stringify(ch)));\n          }\n          str += escapedChar;\n        }\n        escaped = false;\n      } else if (ch === \"\\\\\") {\n        escaped = true;\n      } else if (ch === '\"') {\n        break;\n      } else if (ch === \"\\n\") {\n        throw new SyntaxError(errorSnippet(`Use \"\"\" for multiline strings or escape newlines with \"\\\\n\"`));\n      } else if (ch < \"\u001f\") {\n        throw new SyntaxError(errorSnippet(`Unescaped control character ${JSON.stringify(ch)}`));\n      } else {\n        str += ch;\n      }\n    }\n    next();\n    return str;\n  }\n  function parseMultilineString() {\n    if (ch !== '\"' || lookahead2() !== '\"\"')\n      return;\n    next();\n    next();\n    next();\n    let hasLeadingNewline = false;\n    if (ch === \"\\n\") {\n      hasLeadingNewline = true;\n      next();\n    }\n    let str = \"\";\n    while (!done) {\n      if (ch === '\"' && lookahead2() === '\"\"') {\n        next();\n        next();\n        next();\n        if (str === \"\" && !hasLeadingNewline) {\n          throw new SyntaxError(errorSnippet(\"Multiline strings cannot be empty\"));\n        }\n        return str;\n      }\n      str += ch;\n      next();\n    }\n    throw new SyntaxError(errorSnippet());\n  }\n  function parseNumber() {\n    if (!isDigit(ch) && ch !== \"-\")\n      return;\n    let numStr = \"\";\n    let float3 = false;\n    if (ch === \"-\") {\n      numStr += ch;\n      next();\n      if (!isDigit(ch)) {\n        throw new SyntaxError(errorSnippet());\n      }\n    }\n    if (ch === \"0\") {\n      numStr += ch;\n      next();\n    } else {\n      while (isDigit(ch)) {\n        numStr += ch;\n        next();\n      }\n    }\n    if (ch === \".\") {\n      float3 = true;\n      numStr += ch;\n      next();\n      if (!isDigit(ch)) {\n        throw new SyntaxError(errorSnippet());\n      }\n      while (isDigit(ch)) {\n        numStr += ch;\n        next();\n      }\n    }\n    if (ch === \"e\" || ch === \"E\") {\n      float3 = true;\n      numStr += ch;\n      next();\n      if (ch === \"+\" || ch === \"-\") {\n        numStr += ch;\n        next();\n      }\n      if (!isDigit(ch)) {\n        throw new SyntaxError(errorSnippet());\n      }\n      while (isDigit(ch)) {\n        numStr += ch;\n        next();\n      }\n    }\n    return float3 ? parseFloat(numStr) : toSafeNumber(numStr);\n  }\n  function parseObject() {\n    if (ch !== \"{\")\n      return;\n    next();\n    skipWhitespace();\n    const obj = {};\n    if (ch === \"}\") {\n      next();\n      return obj;\n    }\n    while (true) {\n      const keyPos = pos;\n      let key;\n      if (ch === '\"') {\n        key = parseString();\n      } else {\n        key = parseKey();\n      }\n      if (Object.prototype.hasOwnProperty.call(obj, key)) {\n        pos = keyPos;\n        throw new SyntaxError(errorSnippet(`Duplicate key ${JSON.stringify(key)}`));\n      }\n      skipWhitespace();\n      if (ch !== \":\") {\n        throw new SyntaxError(errorSnippet());\n      }\n      next();\n      const value2 = parseValue();\n      expectValue(value2);\n      obj[key] = value2;\n      const newlineAfterValue = skipWhitespace();\n      if (ch === \"}\") {\n        next();\n        return obj;\n      } else if (ch === \",\") {\n        next();\n        skipWhitespace();\n        if (ch === \"}\") {\n          next();\n          return obj;\n        }\n      } else if (newlineAfterValue) {\n        continue;\n      } else {\n        throw new SyntaxError(errorSnippet(\"Expected comma or newline between key-value pairs\"));\n      }\n    }\n  }\n  function parseKey() {\n    let identifier = \"\";\n    while (isKeyChar(ch)) {\n      identifier += ch;\n      next();\n    }\n    if (identifier === \"\") {\n      throw new SyntaxError(errorSnippet());\n    }\n    return identifier;\n  }\n  function parseArray() {\n    if (ch !== \"[\")\n      return;\n    next();\n    skipWhitespace();\n    const array = [];\n    if (ch === \"]\") {\n      next();\n      return array;\n    }\n    while (true) {\n      const value2 = parseValue();\n      expectValue(value2);\n      array.push(value2);\n      const newLineAfterValue = skipWhitespace();\n      if (ch === \"]\") {\n        next();\n        return array;\n      } else if (ch === \",\") {\n        next();\n        skipWhitespace();\n        if (ch === \"]\") {\n          next();\n          return array;\n        }\n      } else if (newLineAfterValue) {\n        continue;\n      } else {\n        throw new SyntaxError(errorSnippet(\"Expected comma or newline between values\"));\n      }\n    }\n  }\n  function parseKeyword(name, value2) {\n    if (ch !== name[0])\n      return;\n    for (let i = 1; i < name.length; i++) {\n      next();\n      if (ch !== name[i]) {\n        throw new SyntaxError(errorSnippet());\n      }\n    }\n    next();\n    if (isWhitespace(ch) || ch === \",\" || ch === \"}\" || ch === \"]\" || ch === void 0) {\n      return value2;\n    }\n    throw new SyntaxError(errorSnippet());\n  }\n  function skipWhitespace() {\n    let hasNewline = false;\n    while (isWhitespace(ch)) {\n      hasNewline || (hasNewline = ch === \"\\n\");\n      next();\n    }\n    const hasNewlineAfterComment = skipComment();\n    return hasNewline || hasNewlineAfterComment;\n  }\n  function skipComment() {\n    if (ch === \"#\") {\n      while (!done && ch !== \"\\n\") {\n        next();\n      }\n      return skipWhitespace();\n    }\n    return false;\n  }\n  function isWhitespace(ch2) {\n    return ch2 === \" \" || ch2 === \"\\n\" || ch2 === \"\t\" || ch2 === \"\\r\";\n  }\n  function isHexDigit(ch2) {\n    return ch2 >= \"0\" && ch2 <= \"9\" || ch2 >= \"A\" && ch2 <= \"F\";\n  }\n  function isDigit(ch2) {\n    return ch2 >= \"0\" && ch2 <= \"9\";\n  }\n  function isKeyChar(ch2) {\n    return ch2 >= \"A\" && ch2 <= \"Z\" || ch2 >= \"a\" && ch2 <= \"z\" || ch2 >= \"0\" && ch2 <= \"9\" || ch2 === \"_\" || ch2 === \"-\";\n  }\n  function toSafeNumber(str) {\n    if (str == \"-0\")\n      return -0;\n    const num = Number(str);\n    return num >= Number.MIN_SAFE_INTEGER && num <= Number.MAX_SAFE_INTEGER ? num : BigInt(str);\n  }\n  function expectValue(value2) {\n    if (value2 === void 0) {\n      throw new SyntaxError(errorSnippet());\n    }\n  }\n  function errorSnippet(message = `Unexpected character ${JSON.stringify(ch)}`) {\n    if (!ch)\n      message = \"Unexpected end of input\";\n    const lines = source.substring(pos - 40, pos).split(\"\\n\");\n    let lastLine = lines.at(-1) || \"\";\n    let postfix = source.substring(pos, pos + 40).split(\"\\n\", 1).at(0) || \"\";\n    if (lastLine === \"\") {\n      lastLine = lines.at(-2) || \"\";\n      lastLine += \" \";\n      lineNumber--;\n      postfix = \"\";\n    }\n    const snippet = `    ${lastLine}${postfix}\n`;\n    const pointer = `    ${\".\".repeat(Math.max(0, lastLine.length - 1))}^\n`;\n    return `${message} on line ${lineNumber}.\n\n${snippet}${pointer}`;\n  }\n}\nvar escapeMap = {\n  '\"': '\"',\n  \"\\\\\": \"\\\\\",\n  n: \"\\n\",\n  r: \"\\r\",\n  t: \"\t\"\n};\nvar errorMap = {\n  u: \"Invalid escape sequence\"\n};\n\n// node_modules/maml.js/build/stringify.js\nfunction stringify4(value) {\n  return doStringify(value, 0);\n}\nfunction doStringify(value, level) {\n  const kind = value === null ? \"null\" : Array.isArray(value) ? \"array\" : typeof value;\n  switch (kind) {\n    case \"string\":\n      return JSON.stringify(value);\n    case \"boolean\":\n    case \"bigint\":\n    case \"number\":\n      return `${value}`;\n    case \"null\":\n    case \"undefined\":\n      return \"null\";\n    case \"array\": {\n      const len = value.length;\n      if (len === 0)\n        return \"[]\";\n      const childIndent = getIndent(level + 1);\n      const parentIndent = getIndent(level);\n      let out = \"[\\n\";\n      for (let i = 0; i < len; i++) {\n        if (i > 0)\n          out += \"\\n\";\n        out += childIndent + doStringify(value[i], level + 1);\n      }\n      return out + \"\\n\" + parentIndent + \"]\";\n    }\n    case \"object\": {\n      const keys = Object.keys(value);\n      const len = keys.length;\n      if (len === 0)\n        return \"{}\";\n      const childIndent = getIndent(level + 1);\n      const parentIndent = getIndent(level);\n      let out = \"{\\n\";\n      for (let i = 0; i < len; i++) {\n        if (i > 0)\n          out += \"\\n\";\n        const key = keys[i];\n        out += childIndent + doKeyStringify(key) + \": \" + doStringify(value[key], level + 1);\n      }\n      return out + \"\\n\" + parentIndent + \"}\";\n    }\n    default:\n      throw new Error(`Unsupported value type: ${kind}`);\n  }\n}\nvar KEY_RE = /^[A-Za-z0-9_-]+$/;\nfunction doKeyStringify(key) {\n  return KEY_RE.test(key) ? key : JSON.stringify(key);\n}\nfunction getIndent(level) {\n  return \" \".repeat(2 * level);\n}\n\n// src/vendor-extra.ts\nvar _fs = __toESM(require_lib(), 1);\nvar import_create_require = __toESM(require_create_require(), 1);\n\n// node_modules/node-fetch-native/dist/index.mjs\ninit_node();\ninit_node();\ninit_node_fetch_native_DfbY2q_x();\nvar _a, _b;\nvar o2 = !!((_b = (_a = globalThis.process) == null ? void 0 : _a.env) == null ? void 0 : _b.FORCE_NODE_FETCH);\nvar r = !o2 && globalThis.fetch || Mi;\nvar p = !o2 && globalThis.Blob || ut;\nvar F3 = !o2 && globalThis.File || qn;\nvar h = !o2 && globalThis.FormData || br;\nvar n3 = !o2 && globalThis.Headers || ye;\nvar c = !o2 && globalThis.Request || dt;\nvar R2 = !o2 && globalThis.Response || le;\nvar T = !o2 && globalThis.AbortController || Mn;\n\n// node_modules/depseek/target/esm/index.mjs\nvar importRequireRe = /((\\.{3}|\\s|[!%&(*+,/:;<=>?[^{|}~-]|^)(require\\s?\\(\\s?|import\\s?\\(?\\s?)|\\sfrom)\\s?$/;\nvar isDep = (v2, re) => !!v2 && re.test(v2);\nvar isSpace = (v2) => v2 === \" \" || v2 === \"\\n\" || v2 === \"\t\";\nvar isQ = (v2) => `\"'\\``.includes(v2);\nvar normalizeOpts = (opts) => __spreadValues({\n  bufferSize: 1e3,\n  comments: false,\n  re: importRequireRe,\n  offset: 19\n}, opts);\nvar depseekSync = (input, opts) => extract(readify(input.toString()), opts);\nvar readify = (input) => {\n  const chunks = [null, input];\n  return { read: () => chunks.pop() };\n};\nvar extract = (readable, _opts) => {\n  const { re, comments, bufferSize, offset } = normalizeOpts(_opts);\n  const refs = [];\n  const pushRef = (type, value, index) => refs.push({ type, value, index });\n  let i = 0;\n  let prev = \"\";\n  let chunk;\n  let c2 = null;\n  let q = null;\n  let token = \"\";\n  let strLiteral = \"\";\n  let commentBlock = \"\";\n  let commentValue = \"\";\n  while (null !== (chunk = readable.read(bufferSize))) {\n    const len = chunk.length;\n    let j = 0;\n    while (j < len) {\n      const char = chunk[j];\n      if (c2 === q) {\n        if (isSpace(char)) {\n          if (!isSpace(prev)) token += char;\n        } else if (prev === \"/\" && (char === \"/\" || char === \"*\")) c2 = char;\n        else if (isQ(char)) q = char;\n        else token += char;\n      } else if (c2 === null) {\n        if (isSpace(char) || isQ(char)) {\n          if (strLiteral && isDep(token.slice(-offset), re)) pushRef(\"dep\", strLiteral, i - strLiteral.length);\n          strLiteral = \"\";\n          token = \"\";\n          q = null;\n        } else strLiteral += char;\n      } else if (q === null) {\n        if (c2 === \"/\" && char === \"\\n\" || c2 === \"*\" && prev === \"*\" && char === \"/\") {\n          commentValue = c2 === \"*\" ? commentBlock.slice(0, -1) : commentBlock;\n          if (commentValue && comments) pushRef(\"comment\", commentValue, i - commentValue.length);\n          commentBlock = \"\";\n          token = token.slice(0, -1);\n          c2 = null;\n        } else if (comments) commentBlock += char;\n      }\n      prev = char;\n      i++;\n      j++;\n    }\n  }\n  return refs;\n};\n\n// src/vendor-extra.ts\nvar import_minimist = __toESM(require_minimist(), 1);\n\n// node_modules/envapi/target/esm/index.mjs\nvar import_node_fs5 = __toESM(require(\"fs\"), 1);\nvar import_node_path6 = __toESM(require(\"path\"), 1);\nvar import_node_util4 = require(\"util\");\nvar DOTENV = \".env\";\nvar Q1 = '\"';\nvar Q2 = \"'\";\nvar Q3 = \"`\";\nvar KR = /^[a-zA-Z_]\\w*$/;\nvar SR = /\\s/;\nvar decoder = new import_node_util4.TextDecoder();\nvar parse3 = (content) => {\n  const e = {};\n  let k2 = \"\";\n  let b = \"\";\n  let q = \"\";\n  let i = 0;\n  const cap = () => {\n    k2 = k2.trim();\n    if (k2) {\n      if (!KR.test(k2)) throw new Error(`Invalid identifier: ${k2}`);\n      e[k2] = b.trim();\n      b = k2 = \"\";\n    }\n  };\n  for (const c2 of typeof content === \"string\" ? content : decoder.decode(content)) {\n    if (i) {\n      if (c2 === \"\\n\") i = 0;\n      continue;\n    }\n    if (!q) {\n      if (c2 === \"#\") {\n        i = 1;\n        continue;\n      }\n      if (c2 === \"\\n\") {\n        cap();\n        continue;\n      }\n      if (SR.test(c2)) {\n        if (!k2 && b === \"export\") b = \"\";\n        if (!b) continue;\n      }\n      if (c2 === \"=\") {\n        if (!k2) {\n          k2 = b;\n          b = \"\";\n          continue;\n        }\n      }\n    }\n    if (c2 === Q1 || c2 === Q2 || c2 === Q3) {\n      if (!q && !b) {\n        q = c2;\n        continue;\n      }\n      if (q === c2) {\n        q = \"\";\n        b && cap();\n        continue;\n      }\n    }\n    b += c2;\n  }\n  cap();\n  return e;\n};\nvar formatValue = (v2) => {\n  const q1 = v2.includes(Q1);\n  const q2 = v2.includes(Q2);\n  const q3 = v2.includes(Q3);\n  const s = SR.test(v2);\n  if (!q1 && !q2 && !q3 && !s) return v2;\n  if (!q1) return `${Q1}${v2}${Q1}`;\n  if (!q2) return `${Q2}${v2}${Q2}`;\n  if (parse3(`V=${Q3}${v2}${Q3}`).V !== v2) throw new Error(`Invalid value: ${v2}`);\n  return `${Q3}${v2}${Q3}`;\n};\nvar stringify5 = (env) => Object.entries(env).map(([k2, v2]) => `${k2}=${formatValue(v2 || \"\")}`).join(\"\\n\");\nvar _load = (read, ...files) => files.reverse().reduce((m2, f2) => Object.assign(m2, parse3(read(import_node_path6.default.resolve(f2)))), {});\nvar load = (...files) => _load((file) => import_node_fs5.default.readFileSync(file, \"utf8\"), ...files);\nvar loadSafe = (...files) => _load(\n  (file) => import_node_fs5.default.existsSync(file) ? import_node_fs5.default.readFileSync(file, \"utf8\") : \"\",\n  ...files\n);\nvar populate = (env, extra) => Object.assign(env, extra);\nvar config = (def = DOTENV, ...files) => populate(process.env, loadSafe(def, ...files));\nvar index_default = { parse: parse3, stringify: stringify5, load, loadSafe, config };\n\n// src/vendor-extra.ts\nvar import_internals = require(\"./internals.cjs\");\nvar { wrap } = import_internals.bus;\nvar globalVar = \"Deno\" in globalThis ? globalThis : global;\nglobalVar.AbortController = globalVar.AbortController || T;\nvar createRequire = import_create_require.default;\nvar globbyModule = {\n  convertPathToPattern,\n  globby,\n  sync: globbySync,\n  globbySync,\n  globbyStream,\n  generateGlobTasksSync,\n  generateGlobTasks,\n  isGitIgnoredSync,\n  isGitIgnored,\n  isDynamicPattern\n};\nvar _glob = Object.assign(function globby2(patterns, options) {\n  return globbyModule.globby(patterns, options);\n}, globbyModule);\nvar _YAML = browser_exports;\nvar depseek = wrap(\"depseek\", depseekSync);\nvar dotenv = wrap(\"dotenv\", index_default);\nvar fs5 = wrap(\"fs\", _fs);\nvar YAML = wrap(\"YAML\", _YAML);\nvar MAML = wrap(\"MAML\", build_exports);\nvar glob = wrap(\"glob\", _glob);\nvar nodeFetch = wrap(\"nodeFetch\", r);\nvar minimist = wrap(\"minimist\", import_minimist.default);\n/* c8 ignore next 100 */\n// Annotate the CommonJS export names for ESM import in node:\n0 && (module.exports = {\n  MAML,\n  YAML,\n  createRequire,\n  depseek,\n  dotenv,\n  fs,\n  glob,\n  minimist,\n  nodeFetch\n});"
  },
  {
    "path": "build/vendor-extra.d.ts",
    "content": "// Generated by dts-bundle-generator v9.5.1\n\n/// <reference types=\"node\" />\n\nimport * as fs from 'fs';\nimport { URL as URL$1 } from 'node:url';\n\ndeclare type ErrnoException = NodeJS.ErrnoException;\ndeclare type StatAsynchronousMethod = (path: string, callback: (error: ErrnoException | null, stats: fs.Stats) => void) => void;\ndeclare type StatSynchronousMethod = (path: string) => fs.Stats;\ninterface FileSystemAdapter {\n\tlstat: StatAsynchronousMethod;\n\tstat: StatAsynchronousMethod;\n\tlstatSync: StatSynchronousMethod;\n\tstatSync: StatSynchronousMethod;\n}\ninterface Entry {\n\tdirent: Dirent;\n\tname: string;\n\tpath: string;\n\tstats?: Stats;\n}\ndeclare type Stats = fs.Stats;\ndeclare type ErrnoException$1 = NodeJS.ErrnoException;\ninterface Dirent {\n\tisBlockDevice: () => boolean;\n\tisCharacterDevice: () => boolean;\n\tisDirectory: () => boolean;\n\tisFIFO: () => boolean;\n\tisFile: () => boolean;\n\tisSocket: () => boolean;\n\tisSymbolicLink: () => boolean;\n\tname: string;\n}\ninterface ReaddirAsynchronousMethod {\n\t(filepath: string, options: {\n\t\twithFileTypes: true;\n\t}, callback: (error: ErrnoException$1 | null, files: Dirent[]) => void): void;\n\t(filepath: string, callback: (error: ErrnoException$1 | null, files: string[]) => void): void;\n}\ninterface ReaddirSynchronousMethod {\n\t(filepath: string, options: {\n\t\twithFileTypes: true;\n\t}): Dirent[];\n\t(filepath: string): string[];\n}\ndeclare type FileSystemAdapter$1 = FileSystemAdapter & {\n\treaddir: ReaddirAsynchronousMethod;\n\treaddirSync: ReaddirSynchronousMethod;\n};\ndeclare type Entry$1 = Entry;\ntype Entry$2 = Entry$1;\ntype Pattern = string;\ntype FileSystemAdapter$2 = FileSystemAdapter$1;\ntype Options = {\n\t/**\n\t * Return the absolute path for entries.\n\t *\n\t * @default false\n\t */\n\tabsolute?: boolean;\n\t/**\n\t * If set to `true`, then patterns without slashes will be matched against\n\t * the basename of the path if it contains slashes.\n\t *\n\t * @default false\n\t */\n\tbaseNameMatch?: boolean;\n\t/**\n\t * Enables Bash-like brace expansion.\n\t *\n\t * @default true\n\t */\n\tbraceExpansion?: boolean;\n\t/**\n\t * Enables a case-sensitive mode for matching files.\n\t *\n\t * @default true\n\t */\n\tcaseSensitiveMatch?: boolean;\n\t/**\n\t * Specifies the maximum number of concurrent requests from a reader to read\n\t * directories.\n\t *\n\t * @default os.cpus().length\n\t */\n\tconcurrency?: number;\n\t/**\n\t * The current working directory in which to search.\n\t *\n\t * @default process.cwd()\n\t */\n\tcwd?: string;\n\t/**\n\t * Specifies the maximum depth of a read directory relative to the start\n\t * directory.\n\t *\n\t * @default Infinity\n\t */\n\tdeep?: number;\n\t/**\n\t * Allow patterns to match entries that begin with a period (`.`).\n\t *\n\t * @default false\n\t */\n\tdot?: boolean;\n\t/**\n\t * Enables Bash-like `extglob` functionality.\n\t *\n\t * @default true\n\t */\n\textglob?: boolean;\n\t/**\n\t * Indicates whether to traverse descendants of symbolic link directories.\n\t *\n\t * @default true\n\t */\n\tfollowSymbolicLinks?: boolean;\n\t/**\n\t * Custom implementation of methods for working with the file system.\n\t *\n\t * @default fs.*\n\t */\n\tfs?: Partial<FileSystemAdapter$2>;\n\t/**\n\t * Enables recursively repeats a pattern containing `**`.\n\t * If `false`, `**` behaves exactly like `*`.\n\t *\n\t * @default true\n\t */\n\tglobstar?: boolean;\n\t/**\n\t * An array of glob patterns to exclude matches.\n\t * This is an alternative way to use negative patterns.\n\t *\n\t * @default []\n\t */\n\tignore?: Pattern[];\n\t/**\n\t * Mark the directory path with the final slash.\n\t *\n\t * @default false\n\t */\n\tmarkDirectories?: boolean;\n\t/**\n\t * Returns objects (instead of strings) describing entries.\n\t *\n\t * @default false\n\t */\n\tobjectMode?: boolean;\n\t/**\n\t * Return only directories.\n\t *\n\t * @default false\n\t */\n\tonlyDirectories?: boolean;\n\t/**\n\t * Return only files.\n\t *\n\t * @default true\n\t */\n\tonlyFiles?: boolean;\n\t/**\n\t * Enables an object mode (`objectMode`) with an additional `stats` field.\n\t *\n\t * @default false\n\t */\n\tstats?: boolean;\n\t/**\n\t * By default this package suppress only `ENOENT` errors.\n\t * Set to `true` to suppress any error.\n\t *\n\t * @default false\n\t */\n\tsuppressErrors?: boolean;\n\t/**\n\t * Throw an error when symbolic link is broken if `true` or safely\n\t * return `lstat` call if `false`.\n\t *\n\t * @default false\n\t */\n\tthrowErrorOnBrokenSymbolicLink?: boolean;\n\t/**\n\t * Ensures that the returned entries are unique.\n\t *\n\t * @default true\n\t */\n\tunique?: boolean;\n};\ntype Task = {\n\tbase: string;\n\tdynamic: boolean;\n\tpatterns: Pattern[];\n\tpositive: Pattern[];\n\tnegative: Pattern[];\n};\ntype EntryObjectModePredicate = {\n\t[TKey in keyof Pick<Options, \"objectMode\">]-?: true;\n};\ntype EntryStatsPredicate = {\n\t[TKey in keyof Pick<Options, \"stats\">]-?: true;\n};\ntype EntryObjectPredicate = EntryObjectModePredicate | EntryStatsPredicate;\ndeclare function FastGlob(source: Pattern | Pattern[], options: Options & EntryObjectPredicate): Promise<Entry$2[]>;\ndeclare function FastGlob(source: Pattern | Pattern[], options?: Options): Promise<string[]>;\ndeclare namespace FastGlob {\n\texport {Options};\n\texport type Entry = Entry$2;\n\texport {Task};\n\texport {Pattern};\n\ttype FileSystemAdapter = FileSystemAdapter$2;\n\tconst glob: typeof FastGlob;\n\tconst globSync: typeof sync;\n\tconst globStream: typeof stream;\n\tconst async: typeof FastGlob;\n\tfunction sync(source: Pattern | Pattern[], options: Options & EntryObjectPredicate): Entry$2[];\n\tfunction sync(source: Pattern | Pattern[], options?: Options): string[];\n\tfunction stream(source: Pattern | Pattern[], options?: Options): NodeJS.ReadableStream;\n\tfunction generateTasks(source: Pattern | Pattern[], options?: Options): Task[];\n\tfunction isDynamicPattern(source: Pattern, options?: Options): boolean;\n\tfunction escapePath(source: string): Pattern;\n\tfunction convertPathToPattern(source: string): Pattern;\n\tnamespace posix {\n\t\tfunction escapePath(source: string): Pattern;\n\t\tfunction convertPathToPattern(source: string): Pattern;\n\t}\n\tnamespace win32 {\n\t\tfunction escapePath(source: string): Pattern;\n\t\tfunction convertPathToPattern(source: string): Pattern;\n\t}\n}\ntype GlobEntry = FastGlob.Entry;\ntype GlobTask = {\n\treadonly patterns: string[];\n\treadonly options: Options$1;\n};\ntype ExpandDirectoriesOption = boolean | readonly string[] | {\n\tfiles?: readonly string[];\n\textensions?: readonly string[];\n};\ntype FastGlobOptionsWithoutCwd = Omit<FastGlob.Options, \"cwd\">;\ntype Options$1 = {\n\t/**\n\tIf set to `true`, `globby` will automatically glob directories for you. If you define an `Array` it will only glob files that matches the patterns inside the `Array`. You can also define an `Object` with `files` and `extensions` like in the example below.\n\n\tNote that if you set this option to `false`, you won't get back matched directories unless you set `onlyFiles: false`.\n\n\t@default true\n\n\t@example\n\t```\n\timport {globby} from 'globby';\n\n\tconst paths = await globby('images', {\n\t\texpandDirectories: {\n\t\t\tfiles: ['cat', 'unicorn', '*.jpg'],\n\t\t\textensions: ['png']\n\t\t}\n\t});\n\n\tconsole.log(paths);\n\t//=> ['cat.png', 'unicorn.png', 'cow.jpg', 'rainbow.jpg']\n\t```\n\t*/\n\treadonly expandDirectories?: ExpandDirectoriesOption;\n\t/**\n\tRespect ignore patterns in `.gitignore` files that apply to the globbed files.\n\n\tWhen enabled, globby searches for `.gitignore` files from the current working directory downward, and if a Git repository is detected (by finding a `.git` directory), it also respects `.gitignore` files in parent directories up to the repository root. This matches Git's actual behavior where patterns from parent `.gitignore` files apply to subdirectories.\n\n\tGitignore patterns take priority over user patterns, matching Git's behavior. To include gitignored files, set this to `false`.\n\n\tPerformance: Globby reads `.gitignore` files before globbing. When there are no negation patterns (like `!important.log`) and no parent `.gitignore` files are found, it passes ignore patterns to fast-glob to skip traversing ignored directories entirely, which significantly improves performance for large `node_modules` or build directories. When negation patterns or parent `.gitignore` files are present, all filtering is done after traversal to ensure correct Git-compatible behavior. For optimal performance, prefer specific `.gitignore` patterns without negations, or use `ignoreFiles: '.gitignore'` to target only the root ignore file.\n\n\t@default false\n\t*/\n\treadonly gitignore?: boolean;\n\t/**\n\tGlob patterns to look for ignore files, which are then used to ignore globbed files.\n\n\tThis is a more generic form of the `gitignore` option, allowing you to find ignore files with a [compatible syntax](http://git-scm.com/docs/gitignore). For instance, this works with Babel's `.babelignore`, Prettier's `.prettierignore`, or ESLint's `.eslintignore` files.\n\n\tPerformance tip: Using a specific path like `'.gitignore'` is much faster than recursive patterns.\n\n\t@default undefined\n\t*/\n\treadonly ignoreFiles?: string | readonly string[];\n\t/**\n\tWhen only negation patterns are provided (e.g., `['!*.json']`), automatically prepend a catch-all pattern (`**\\/*`) to match all files before applying negations.\n\n\tSet to `false` to return an empty array when only negation patterns are provided. This can be useful when patterns are user-controlled, to avoid unexpectedly matching all files.\n\n\t@default true\n\n\t@example\n\t```\n\timport {globby} from 'globby';\n\n\t// Default behavior: matches all files except .json\n\tawait globby(['!*.json']);\n\t//=> ['file.txt', 'image.png', ...]\n\n\t// Disable expansion: returns empty array\n\tawait globby(['!*.json'], {expandNegationOnlyPatterns: false});\n\t//=> []\n\t```\n\t*/\n\treadonly expandNegationOnlyPatterns?: boolean;\n\t/**\n\tThe current working directory in which to search.\n\n\t@default process.cwd()\n\t*/\n\treadonly cwd?: URL | string;\n} & FastGlobOptionsWithoutCwd;\ntype GitignoreOptions = {\n\t/**\n\tThe current working directory in which to search.\n\n\t@default process.cwd()\n\t*/\n\treadonly cwd?: URL | string;\n\t/**\n\tSuppress errors when encountering directories or files without read permissions.\n\n\tBy default, fast-glob only suppresses `ENOENT` errors. Set to `true` to suppress any error.\n\n\t@default false\n\t*/\n\treadonly suppressErrors?: boolean;\n\t/**\n\tSpecifies the maximum depth of ignore file search relative to the start directory.\n\n\t@default Infinity\n\t*/\n\treadonly deep?: number;\n\t/**\n\tGlob patterns to exclude from ignore file search.\n\n\t@default []\n\t*/\n\treadonly ignore?: string | readonly string[];\n\t/**\n\tIndicates whether to traverse descendants of symbolic link directories.\n\n\t@default true\n\t*/\n\treadonly followSymbolicLinks?: boolean;\n\t/**\n\tSpecifies the maximum number of concurrent requests from a reader to read directories.\n\n\t@default os.cpus().length\n\t*/\n\treadonly concurrency?: number;\n\t/**\n\tThrow an error when symbolic link is broken if `true` or safely return `lstat` call if `false`.\n\n\t@default false\n\t*/\n\treadonly throwErrorOnBrokenSymbolicLink?: boolean;\n\t/**\n\tCustom file system implementation (useful for testing or virtual file systems).\n\n\t@default undefined\n\t*/\n\treadonly fs?: FastGlob.Options[\"fs\"];\n};\ntype GlobbyFilterFunction = (path: URL | string) => boolean;\ntype AsyncIterableReadable<Value> = Omit<NodeJS.ReadableStream, typeof Symbol.asyncIterator> & {\n\t[Symbol.asyncIterator](): NodeJS.AsyncIterator<Value>;\n};\ntype GlobbyStream = AsyncIterableReadable<string>;\ntype GlobbyEntryStream = AsyncIterableReadable<GlobEntry>;\ndeclare function globby(patterns: string | readonly string[], options: Options$1 & ({\n\tobjectMode: true;\n} | {\n\tstats: true;\n})): Promise<GlobEntry[]>;\ndeclare function globby(patterns: string | readonly string[], options?: Options$1): Promise<string[]>;\ndeclare function globbySync(patterns: string | readonly string[], options: Options$1 & ({\n\tobjectMode: true;\n} | {\n\tstats: true;\n})): GlobEntry[];\ndeclare function globbySync(patterns: string | readonly string[], options?: Options$1): string[];\ndeclare function globbyStream(patterns: string | readonly string[], options: Options$1 & ({\n\tobjectMode: true;\n} | {\n\tstats: true;\n})): GlobbyEntryStream;\ndeclare function globbyStream(patterns: string | readonly string[], options?: Options$1): GlobbyStream;\ndeclare function generateGlobTasks(patterns: string | readonly string[], options?: Options$1): Promise<GlobTask[]>;\ndeclare function generateGlobTasksSync(patterns: string | readonly string[], options?: Options$1): GlobTask[];\ndeclare function isDynamicPattern(patterns: string | readonly string[], options?: FastGlobOptionsWithoutCwd & {\n\t/**\n\tThe current working directory in which to search.\n\n\t@default process.cwd()\n\t*/\n\treadonly cwd?: URL | string;\n}): boolean;\ndeclare function isGitIgnored(options?: GitignoreOptions): Promise<GlobbyFilterFunction>;\ndeclare function isGitIgnoredSync(options?: GitignoreOptions): GlobbyFilterFunction;\ndeclare function convertPathToPattern(source: string): FastGlob.Pattern;\ndeclare function parse(source: string): any;\ndeclare function stringify(value: any): string;\ndeclare const fetch$1: typeof globalThis.fetch;\ntype TCodeRef = {\n\ttype: string;\n\tvalue: string;\n\tindex: number;\n};\ntype TOptsNormalized = {\n\tcomments: boolean;\n\tbufferSize: number;\n\tre: RegExp;\n\toffset: number;\n};\ntype TOpts = Partial<TOptsNormalized>;\ndeclare const depseekSync: (input: string | Buffer, opts?: TOpts) => TCodeRef[];\ndeclare function minimist(args?: string[], opts?: minimist.Opts): minimist.ParsedArgs;\ndeclare function minimist<T>(args?: string[], opts?: minimist.Opts): T & minimist.ParsedArgs;\ndeclare function minimist<T extends minimist.ParsedArgs>(args?: string[], opts?: minimist.Opts): T;\ndeclare namespace minimist {\n\tinterface Opts {\n\t\t/**\n\t\t * A string or array of strings argument names to always treat as strings\n\t\t */\n\t\tstring?: string | string[] | undefined;\n\t\t/**\n\t\t * A boolean, string or array of strings to always treat as booleans. If true will treat\n\t\t * all double hyphenated arguments without equals signs as boolean (e.g. affects `--foo`, not `-f` or `--foo=bar`)\n\t\t */\n\t\tboolean?: boolean | string | string[] | undefined;\n\t\t/**\n\t\t * An object mapping string names to strings or arrays of string argument names to use as aliases\n\t\t */\n\t\talias?: {\n\t\t\t[key: string]: string | string[];\n\t\t} | undefined;\n\t\t/**\n\t\t * An object mapping string argument names to default values\n\t\t */\n\t\tdefault?: {\n\t\t\t[key: string]: any;\n\t\t} | undefined;\n\t\t/**\n\t\t * When true, populate argv._ with everything after the first non-option\n\t\t */\n\t\tstopEarly?: boolean | undefined;\n\t\t/**\n\t\t * A function which is invoked with a command line parameter not defined in the opts\n\t\t * configuration object. If the function returns false, the unknown option is not added to argv\n\t\t */\n\t\tunknown?: ((arg: string) => boolean) | undefined;\n\t\t/**\n\t\t * When true, populate argv._ with everything before the -- and argv['--'] with everything after the --.\n\t\t * Note that with -- set, parsing for arguments still stops after the `--`.\n\t\t */\n\t\t\"--\"?: boolean | undefined;\n\t}\n\tinterface ParsedArgs {\n\t\t[arg: string]: any;\n\t\t/**\n\t\t * If opts['--'] is true, populated with everything after the --\n\t\t */\n\t\t\"--\"?: string[] | undefined;\n\t\t/**\n\t\t * Contains all the arguments that didn't have an option associated with them\n\t\t */\n\t\t_: string[];\n\t}\n}\ndeclare const _default: {\n\tparse: (content: string | Buffer) => NodeJS.ProcessEnv;\n\tstringify: (env: NodeJS.ProcessEnv) => string;\n\tload: (...files: string[]) => NodeJS.ProcessEnv;\n\tloadSafe: (...files: string[]) => NodeJS.ProcessEnv;\n\tconfig: (def?: string, ...files: string[]) => NodeJS.ProcessEnv;\n};\nexport declare const createRequire: (filename: string | URL$1) => NodeJS.Require;\ndeclare const globbyModule: {\n\tconvertPathToPattern: typeof convertPathToPattern;\n\tglobby: typeof globby;\n\tsync: typeof globbySync;\n\tglobbySync: typeof globbySync;\n\tglobbyStream: typeof globbyStream;\n\tgenerateGlobTasksSync: typeof generateGlobTasksSync;\n\tgenerateGlobTasks: typeof generateGlobTasks;\n\tisGitIgnoredSync: typeof isGitIgnoredSync;\n\tisGitIgnored: typeof isGitIgnored;\n\tisDynamicPattern: typeof isDynamicPattern;\n};\ndeclare const _glob: (typeof globbyModule)[\"globby\"] & typeof globbyModule;\ndeclare const _YAML: YAML;\nexport interface YAML {\n\tparse(text: string): any;\n\tstringify(object: any): string;\n\t/** @deprecated */\n\tparseAllDocuments(s: string, opts?: any): any[];\n\t/** @deprecated */\n\tparseDocument(s: string, opts?: any): any;\n\t/** @deprecated */\n\tisAlias(v: any): boolean;\n\t/** @deprecated */\n\tisCollection(v: any): boolean;\n\t/** @deprecated */\n\tisDocument(v: any): boolean;\n\t/** @deprecated */\n\tisMap(v: any): boolean;\n\t/** @deprecated */\n\tisNode(v: any): boolean;\n\t/** @deprecated */\n\tisPair(v: any): boolean;\n\t/** @deprecated */\n\tisScalar(v: any): boolean;\n\t/** @deprecated */\n\tisSeq(v: any): boolean;\n\t/** @deprecated */\n\tAlias: any;\n\t/** @deprecated */\n\tComposer: any;\n\t/** @deprecated */\n\tDocument: any;\n\t/** @deprecated */\n\tSchema: any;\n\t/** @deprecated */\n\tYAMLSeq: any;\n\t/** @deprecated */\n\tYAMLMap: any;\n\t/** @deprecated */\n\tYAMLError: any;\n\t/** @deprecated */\n\tYAMLParseError: any;\n\t/** @deprecated */\n\tYAMLWarning: any;\n\t/** @deprecated */\n\tPair: any;\n\t/** @deprecated */\n\tScalar: any;\n\t/** @deprecated */\n\tLexer: any;\n\t/** @deprecated */\n\tLineCounter: any;\n\t/** @deprecated */\n\tParser: any;\n}\nexport declare const depseek: typeof depseekSync;\nexport declare const dotenv: typeof _default;\ndeclare const fs$1: typeof import(\"fs-extra\");\nexport declare const YAML: typeof _YAML;\nexport declare const MAML: typeof _maml;\nexport declare const glob: typeof _glob;\nexport declare const nodeFetch: typeof fetch$1;\ndeclare const minimist$1: typeof minimist;\ndeclare namespace minimist$1 {\n\tinterface Opts extends minimist.Opts {\n\t}\n\tinterface ParsedArgs extends minimist.ParsedArgs {\n\t}\n}\n\ndeclare namespace _maml {\n\texport { parse, stringify };\n}\n\nexport {\n\tfs$1 as fs,\n\tminimist$1 as minimist,\n};\n\nexport {};\n"
  },
  {
    "path": "build/vendor.cjs",
    "content": "\"use strict\";\nconst {\n  __reExport,\n  __toCommonJS\n} = require('./esblib.cjs');\n\n\n// src/vendor.ts\nvar vendor_exports = {};\nmodule.exports = __toCommonJS(vendor_exports);\n__reExport(vendor_exports, require(\"./vendor-core.cjs\"), module.exports);\n__reExport(vendor_exports, require(\"./vendor-extra.cjs\"), module.exports);\n/* c8 ignore next 100 */\n// Annotate the CommonJS export names for ESM import in node:\n0 && (module.exports = {\n  ...require(\"./vendor-core.cjs\"),\n  ...require(\"./vendor-extra.cjs\")\n});"
  },
  {
    "path": "build/vendor.d.ts",
    "content": "/// <reference types=\"node\" />\n/// <reference types=\"fs-extra\" />\n\nexport * from './vendor-core.js';\nexport * from './vendor-extra.js';\n"
  },
  {
    "path": "build/versions.d.ts",
    "content": "export declare const versions: Record<string, string>;\n"
  },
  {
    "path": "dcr/Dockerfile",
    "content": "FROM node:24-alpine\n\nRUN apk add --no-cache bash\n\nCOPY ../build /zx/build\nCOPY ../package.json /zx/package.json\nCOPY ../LICENSE /zx/LICENSE\nCOPY ../README.md /zx/README.md\n\nENTRYPOINT [\"node\", \"/zx/build/cli.js\"]\n"
  },
  {
    "path": "docs/.gitignore",
    "content": "/cache/\n/build/\n"
  },
  {
    "path": "docs/.vitepress/config.mts",
    "content": "import { defineConfig } from 'vitepress'\n\n// https://vitepress.dev/reference/site-config\nexport default defineConfig({\n  base: '/zx/',\n  outDir: 'build',\n  cleanUrls: true,\n  title: 'google/zx',\n  titleTemplate: ':title | google/zx',\n  description: 'A tool for writing better scripts',\n  head: [\n    [\n      'link',\n      {\n        rel: 'apple-touch-icon',\n        sizes: '180x180',\n        href: '/zx/img/favicons/apple-touch-icon.png',\n      },\n    ],\n    [\n      'link',\n      {\n        rel: 'icon',\n        type: 'image/png',\n        sizes: '32x32',\n        href: '/zx/img/favicons/favicon-32x32.png',\n      },\n    ],\n    [\n      'link',\n      {\n        rel: 'icon',\n        type: 'image/png',\n        sizes: '16x16',\n        href: '/zx/img/favicons/favicon-16x16.png',\n      },\n    ],\n    [\n      'link',\n      {\n        rel: 'mask-icon',\n        href: '/zx/img/favicons/safari-pinned-tab.svg',\n        color: '#3a0839',\n      },\n    ],\n    ['link', { rel: 'shortcut icon', href: '/zx/img/favicons/favicon.ico' }],\n    ['meta', { name: 'og:image', content: '/zx/img/og-image.png' }],\n    ['meta', { name: 'twitter:image', content: '/zx/img/og-image.png' }],\n  ],\n  themeConfig: {\n    logo: '/img/logo.svg',\n    // https://vitepress.dev/reference/default-theme-config\n    nav: [\n      { text: 'Home', link: '/' },\n      { text: 'Docs', link: '/getting-started' },\n    ],\n\n    sidebar: {\n      '/': [\n        {\n          text: 'Docs',\n          items: [\n            { text: 'Getting Started', link: '/getting-started' },\n            { text: 'Setup', link: '/setup' },\n            { text: 'API Reference', link: '/api' },\n            { text: 'CLI Usage', link: '/cli' },\n            { text: 'Configuration', link: '/configuration' },\n            { text: 'Process Promise', link: '/process-promise' },\n            { text: 'Process Output', link: '/process-output' },\n            { text: 'Contribution Guide', link: '/contribution' },\n            { text: 'Architecture', link: '/architecture' },\n            { text: 'Migration from v7', link: '/migration-from-v7' },\n            { text: '⚡ zx@lite', link: '/lite' },\n          ],\n        },\n        {\n          text: 'FAQ',\n          link: '/faq',\n          items: [\n            { text: 'Quotes', link: '/quotes' },\n            { text: 'Shell', link: '/shell' },\n            { text: 'TypeScript', link: '/typescript' },\n            { text: 'Markdown Scripts', link: '/markdown' },\n            { text: 'Known Issues', link: '/known-issues' },\n          ],\n        },\n      ],\n    },\n\n    socialLinks: [{ icon: 'github', link: 'https://github.com/google/zx' }],\n\n    editLink: {\n      pattern: 'https://github.com/google/zx/blob/main/docs/:path',\n    },\n\n    footer: {\n      message:\n        'Disclaimer: This is not an officially supported Google product.',\n    },\n\n    search: {\n      provider: 'local',\n    },\n  },\n})\n"
  },
  {
    "path": "docs/.vitepress/theme/MyLayout.vue",
    "content": "<script setup>\nimport DefaultTheme from 'vitepress/theme'\nimport MyOxygen from './MyOxygen.vue'\n\nconst { Layout } = DefaultTheme\n</script>\n\n<template>\n  <Layout>\n    <template #aside-ads-after>\n      <MyOxygen />\n    </template>\n  </Layout>\n</template>\n"
  },
  {
    "path": "docs/.vitepress/theme/MyOxygen.vue",
    "content": "<template>\n  <!--  <div class=\"Oxygen\">-->\n  <!--    <a href=\"https://webpod.dev/?from=zx-site\">-->\n  <!--      &lt;!&ndash;<img src=\"https://webpod.dev/img/banner.png\" alt=\"Webpod - deploy JavaScript apps\">&ndash;&gt;-->\n  <!--      <img-->\n  <!--        src=\"https://webpod.dev/img/logo.svg\"-->\n  <!--        alt=\"Webpod - deploy JavaScript apps\"-->\n  <!--      />-->\n  <!--      <p>Webpod – deploy JavaScript apps to own cloud or private server</p>-->\n  <!--    </a>-->\n  <!--  </div>-->\n</template>\n\n<style scoped>\n.Oxygen {\n  display: flex;\n  justify-content: center;\n  align-items: center;\n  padding: 24px;\n  border-radius: 12px;\n  min-height: 256px;\n  text-align: center;\n  line-height: 18px;\n  font-size: 12px;\n  font-weight: 500;\n  background-color: var(--vp-carbon-ads-bg-color);\n}\n\n.Oxygen :deep(img) {\n  margin: 0 auto;\n}\n\n.Oxygen :deep(p) {\n  display: block;\n  margin: 0 auto;\n  color: var(--vp-carbon-ads-text-color);\n  transition: color 0.25s;\n}\n\n.Oxygen :deep(p:hover) {\n  color: var(--vp-carbon-ads-hover-text-color);\n}\n</style>\n<script setup></script>\n"
  },
  {
    "path": "docs/.vitepress/theme/custom.css",
    "content": ":root {\n  --vp-home-hero-name-color: transparent;\n  --vp-home-hero-name-background: -webkit-linear-gradient(\n    120deg,\n    #f11a7b 10%,\n    #feffac\n  );\n\n  --vp-home-hero-image-background-image: linear-gradient(\n    -45deg,\n    rgba(241, 26, 123, 0.33) 50%,\n    rgba(254, 255, 172, 0.33) 50%\n  );\n  --vp-home-hero-image-filter: blur(40px);\n}\n\n@media (min-width: 640px) {\n  :root {\n    --vp-home-hero-image-filter: blur(56px);\n  }\n}\n\n@media (min-width: 960px) {\n  :root {\n    --vp-home-hero-image-filter: blur(72px);\n  }\n}\n"
  },
  {
    "path": "docs/.vitepress/theme/index.js",
    "content": "import DefaultTheme from 'vitepress/theme'\nimport MyLayout from './MyLayout.vue'\nimport './custom.css'\n\nexport default {\n  ...DefaultTheme,\n  // override the Layout with a wrapper component that\n  // injects the slots\n  Layout: MyLayout,\n}\n"
  },
  {
    "path": "docs/api.md",
    "content": "# API Reference\n\n## `$.sync`\nZx provides both synchronous and asynchronous command executions, returns [`ProcessOutput`](./process-output) or [`ProcessPromise`](./process-promise) respectively.\n\n```js\nconst list = await $`ls -la`\nconst dir = $.sync`pwd`\n```\n\n## `$({...})`\n\n`$` object holds the default zx [configuration](./configuration), which is used for all execution. To specify a custom preset use `$` as factory:\n\n```js\nconst $$ = $({\n  verbose: false,\n  env: {NODE_ENV: 'production'},\n})\n\nconst env = await $$`node -e 'console.log(process.env.NODE_ENV)'`\nconst pwd = $$.sync`pwd`\nconst hello = $({quiet: true})`echo \"Hello!\"`\n```\n\nMoreover, presets are chainable:\n\n```js\nconst $1 = $({ nothrow: true })\nassert.equal((await $1`exit 1`).exitCode, 1)\n\nconst $2 = $1({ sync: true }) // Both {nothrow: true, sync: true} are applied\nassert.equal($2`exit 2`.exitCode, 2)\n\nconst $3 = $({ sync: true })({ nothrow: true })\nassert.equal($3`exit 3`.exitCode, 3)\n```\n\n### `$({input})`\n\nThe input option passes the specified `stdin` to the command.\n\n```js\nconst p1 = $({ input: 'foo' })`cat`\nconst p2 = $({ input: Readable.from('bar') })`cat`\nconst p3 = $({ input: Buffer.from('baz') })`cat`\nconst p4 = $({ input: p3 })`cat`\nconst p5 = $({ input: await p3 })`cat`\n```\n\n### `$({signal})`\n\nThe signal option makes the process abortable.\n\n```js\nconst {signal} = new AbortController()\nconst p = $({ signal })`sleep 9999`\n\nsetTimeout(() => signal.abort('reason'), 1000)\n```\n\n### `$({timeout})`\n\nThe timeout option makes the process autokillable after the specified delay.\n\n```js\nconst p = $({timeout: '1s'})`sleep 999`\n```\n\n### `$({nothrow})`\n\nThe `nothrow` option suppresses errors and returns a `ProcessOutput` with details.\n\n```js\nconst o1 = await $({nothrow: true})`exit 1`\no1.ok       // false\no1.exitCode // 1\no1.message  // exit code: 1 ...\n\nconst o2 = await $({nothrow: true, spawn() { throw new Error('BrokenSpawn') }})`echo foo`\no2.ok       // false\no2.exitCode // null\no2.message  // BrokenSpawn ...\n```\n\nThe full options list:\n```ts\ninterface Options {\n  cwd:            string\n  ac:             AbortController\n  signal:         AbortSignal\n  input:          string | Buffer | Readable | ProcessOutput | ProcessPromise\n  timeout:        Duration\n  timeoutSignal:  NodeJS.Signals\n  stdio:          StdioOptions\n  verbose:        boolean\n  sync:           boolean\n  env:            NodeJS.ProcessEnv\n  shell:          string | true\n  nothrow:        boolean\n  prefix:         string\n  postfix:        string\n  quote:          typeof quote\n  quiet:          boolean\n  detached:       boolean\n  preferLocal:    boolean | string | string[]\n  spawn:          typeof spawn\n  spawnSync:      typeof spawnSync\n  store:          TSpawnStore\n  log:            typeof log\n  kill:           typeof kill\n  killSignal:     NodeJS.Signals\n  halt:           boolean\n  delimiter:      string | RegExp\n}\n```\nSee also [Configuration](./configuration).\n\n## `cd()`\n\nChanges the current working directory.\n\n```js\ncd('/tmp')\nawait $`pwd` // => /tmp\n```\n\nLike `echo`, in addition to `string` arguments, `cd` accepts and trims\ntrailing newlines from `ProcessOutput` enabling common idioms like:\n\n```js\ncd(await $`mktemp -d`)\n```\n\n> ⚠️ `cd` invokes `process.chdir()` internally, so it does affect the global context. To keep `process.cwd()` in sync with separate `$` calls enable [syncProcessCwd()](#syncprocesscwd) hook.\n\n## `fetch()`\n\nA wrapper around the [node-fetch-native](https://www.npmjs.com/package/node-fetch-native)\npackage.\n\n```js\nconst r1 = await fetch('https://example.com')\nconst json = await r1.json()\n\nconst r2 = await fetch('https://example.com', {\n  signal: AbortSignal.timeout(5000),\n})\n```\n\nFor some cases, `text()` or `json()` can produce extremely large output that exceeds the string size limit.\nStreams are just for that, so we've attached a minor adjustment to the `fetch` API to make it more pipe friendly.\n\n```js\nconst p1 = fetch('https://example.com').pipe($`cat`)\nconst p2 = fetch('https://example.com').pipe`cat`\n```\n\n## `question()`\n\nA wrapper around the [readline](https://nodejs.org/api/readline.html) API.\n\n```js\nconst bear = await question('What kind of bear is best? ')\nconst selected = await question('Select an option:', {\n  choices: ['A', 'B', 'C'],\n})\n```\n\n## `sleep()`\n\nA wrapper around the `setTimeout` function.\n\n```js\nawait sleep(1000)\n```\n\n## `echo()`\n\nA `console.log()` alternative which can take [ProcessOutput](#processoutput).\n\n```js\nconst branch = await $`git branch --show-current`\n\necho`Current branch is ${branch}.`\n// or\necho('Current branch is', branch)\n```\n\n## `stdin()`\n\nReturns the stdin as a string.\n\n```js\nconst content = JSON.parse(await stdin())\n```\n\n## `within()`\n\nCreates a new async context.\n\n```js\nawait $`pwd` // => /home/path\n$.foo = 'bar'\n\nwithin(async () => {\n  $.cwd = '/tmp'\n  $.foo = 'baz'\n\n  setTimeout(async () => {\n    await $`pwd` // => /tmp\n    $.foo // baz\n  }, 1000)\n})\n\nawait $`pwd` // => /home/path\n$.foo // still 'bar'\n```\n\n```js\nawait $`node --version` // => v20.2.0\n\nconst version = await within(async () => {\n  $.prefix += 'export NVM_DIR=$HOME/.nvm; source $NVM_DIR/nvm.sh; nvm use 16;'\n\n  return $`node --version`\n})\n\necho(version) // => v16.20.0\n```\n\n## `syncProcessCwd()`\n\nKeeps the `process.cwd()` in sync with the internal `$` current working directory if it is changed via [cd()](#cd).\n\n```ts\nimport {syncProcessCwd} from 'zx'\n\nsyncProcessCwd()\nsyncProcessCwd(false) // pass false to disable the hook\n```\n\n> This feature is disabled by default because of performance overhead.\n\n## `retry()`\n\nRetries a callback for a few times. Will return the first\nsuccessful result, or will throw after the specified attempts count.\n\n```js\nconst p = await retry(10, () => $`curl https://medv.io`)\n\n// With a specified delay between attempts.\nconst p = await retry(20, '1s', () => $`curl https://medv.io`)\n\n// With an exponential backoff.\nconst p = await retry(30, expBackoff(), () => $`curl https://medv.io`)\n```\n\n## `spinner()`\n\nStarts a simple CLI spinner.\n\n```js\nawait spinner(() => $`long-running command`)\n\n// With a message.\nawait spinner('working...', () => $`sleep 99`)\n```\n\nAnd it's disabled for `CI` by default.\n\n## `glob()`\n\nThe [globby](https://github.com/sindresorhus/globby) package.\n\n```js\nconst packages = await glob(['package.json', 'packages/*/package.json'])\nconst markdowns = glob.sync('*.md') // sync API shortcut\n```\n\n## `which()`\n\nThe [which](https://github.com/npm/node-which) package.\n\n```js\nconst node = await which('node')\n```\n\nIf nothrow option is used, returns null if not found.\n\n```js\nconst pathOrNull = await which('node', { nothrow: true })\n```\n\n## `ps`\n\nThe [@webpod/ps](https://github.com/webpod/ps) package to provide a cross-platform way to list processes.\n\n```js\nconst all = await ps.lookup()\nconst nodejs = await ps.lookup({ command: 'node' })\nconst children = await ps.tree({ pid: 123 })\nconst fulltree = await ps.tree({ pid: 123, recursive: true })\n```\n\n## `kill()`\n\nA process killer.\n\n```js\nawait kill(123)\nawait kill(123, 'SIGKILL')\n```\n\n## `tmpdir()`\n\nCreates a temporary directory.\n\n```js\nt1 = tmpdir()       // /os/based/tmp/zx-1ra1iofojgg/\nt2 = tmpdir('foo')  // /os/based/tmp/zx-1ra1iofojgg/foo/\n```\n\n## `tmpfile()`\n\nTemp file factory.\n\n```js\nf1 = tmpfile()         // /os/based/tmp/zx-1ra1iofojgg\nf2 = tmpfile('f2.txt')  // /os/based/tmp/zx-1ra1iofojgg/foo.txt\nf3 = tmpfile('f3.txt', 'string or buffer')\nf4 = tmpfile('f4.sh', 'echo \"foo\"', 0o744) // executable\n```\n\n## `minimist`\n\nThe [minimist](https://www.npmjs.com/package/minimist) package.\n\n```js\nconst argv = minimist(process.argv.slice(2), {})\n```\n\n## `argv`\n\nA minimist-parsed version of the `process.argv` as `argv`.\n\n```js\nif (argv.someFlag) {\n  echo('yes')\n}\n```\n\nUse minimist options to customize the parsing:\n\n```js\nconst myCustomArgv = minimist(process.argv.slice(2), {\n  boolean: [\n    'force',\n    'help',\n  ],\n  alias: {\n    h: 'help',\n  },\n})\n```\n\n## `chalk`\n\nThe [chalk](https://www.npmjs.com/package/chalk) package.\n\n```js\nconsole.log(chalk.blue('Hello world!'))\n```\n\n## `fs`\n\nThe [fs-extra](https://www.npmjs.com/package/fs-extra) package.\n\n```js\nconst {version} = await fs.readJson('./package.json')\n```\n\n## `os`\n\nThe [os](https://nodejs.org/api/os.html) package.\n\n```js\nawait $`cd ${os.homedir()} && mkdir example`\n```\n\n## `path`\n\nThe [path](https://nodejs.org/api/path.html) package.\n\n```js\nawait $`mkdir ${path.join(basedir, 'output')}`\n```\n\n## `YAML`\n\nThe [yaml](https://www.npmjs.com/package/yaml) package.\n\n```js\nconsole.log(YAML.parse('foo: bar').foo)\n```\n\n## `MAML`\n\nThe [maml.js](https://www.npmjs.com/package/maml.js) package.\n\n```js\nconst maml = `{\n  example: \"MAML\"\n  # Comments are supported\n  notes: \"\"\"\nThis is a multiline string.\nKeeps formatting as‑is.\n\"\"\"\n}`\nconsole.log(MAML.parse(maml).example) // MAML \n```\n\n## `dotenv`\n\nThe [envapi](https://www.npmjs.com/package/envapi) package.  \nAn API to interact with environment vars in [dotenv](https://www.npmjs.com/package/dotenv) format.\n\n```js\n// parse\nconst raw = 'FOO=BAR\\nBAZ=QUX'\nconst data = dotenv.parse(raw) // {FOO: 'BAR', BAZ: 'QUX'}\nawait fs.writeFile('.env', raw)\n\n// load\nconst env = dotenv.load('.env')\nawait $({ env })`echo $FOO`.stdout // BAR\n\n// config\ndotenv.config('.env')\nprocess.env.FOO // BAR\n```\n\n## `versions`\nExports versions of the zx dependencies.\n\n```ts\nimport { versions } from 'zx'\n\nversions.zx     // 8.7.2\nversions.chalk  // 5.4.1\n```\n\n## `quote()`\n\nDefault bash quoting function.\n\n```js\nquote(\"$FOO\") // \"$'$FOO'\"\n```\n\n## `quotePowerShell()`\n\nPowerShell specific quoting.\n\n```js\nquotePowerShell(\"$FOO\") // \"'$FOO'\"\n```\n\n## `useBash()`\n\nEnables bash preset: sets `$.shell` to `bash` and `$.quote` to `quote`.\n\n```js\nuseBash()\n```\n\n## `usePowerShell()`\n\nSwitches to PowerShell. Applies the `quotePowerShell` for quoting.\n\n```js\nusePowerShell()\n```\n\n## `usePwsh()`\n\nSets pwsh (PowerShell v7+) as `$.shell` default.\n\n```js\nusePwsh()\n```\n"
  },
  {
    "path": "docs/architecture.md",
    "content": "# The zx architecture\nThis section helps to better understand the `zx` concepts and logic, and will be useful for those who want to become a project contributor, make tools based on it, or create something similar from scratch.\n\n## High-level modules\n| Module                                                                  | Description                                                         |\n|-------------------------------------------------------------------------|---------------------------------------------------------------------|\n| [zurk](https://github.com/webpod/zurk)                                  | Execution engine for spawning and managing child processes.         |\n| [./src/core.ts](https://github.com/google/zx/blob/main/src/core.ts)     | `$` factory, presets, utilities, high-level APIs.                   |\n| [./src/goods.ts](https://github.com/google/zx/blob/main/src/goods.ts)   | Utilities for common tasks like fs ops, glob search, fetching, etc. |\n| [./src/cli.ts](https://github.com/google/zx/blob/main/src/cli.ts)       | CLI interface and scripts pre-processors.                           |\n| [./src/deps.ts](https://github.com/google/zx/blob/main/src/deps.ts)     | Dependency analyzing and installation.                              |\n| [./src/vendor.ts](https://github.com/google/zx/blob/main/src/vendor.ts) | Third-party libraries.                                              |\n| [./src/utils.ts](https://github.com/google/zx/blob/main/src/utils.ts)   | Generic helpers.                                                    |\n| [./src/md.ts](https://github.com/google/zx/blob/main/src/md.ts)         | Markdown scripts extractor.                                         |\n| [./src/error.ts](https://github.com/google/zx/blob/main/src/error.ts)   | Error handling and formatting.                                      |\n| [./src/global.ts](https://github.com/google/zx/blob/main/src/global.ts) | Global injectors.                                                   |\n\n\n## Core design\n\n### `Options`\nA set of options for `$` and `ProcessPromise` configuration. `defaults` holds the initial library preset. `Snapshot` captures the current `Options `context and attaches isolated subparts.\n\n### `$`\nA piece of template literal magic.\n```ts\ninterface Shell<\n  S = false,\n  R = S extends true ? ProcessOutput : ProcessPromise,\n> {\n  (pieces: TemplateStringsArray, ...args: any[]): R\n  <O extends Partial<Options> = Partial<Options>, R = O extends { sync: true } ? Shell<true> : Shell>(opts: O): R\n  sync: {\n    (pieces: TemplateStringsArray, ...args: any[]): ProcessOutput\n    (opts: Partial<Omit<Options, 'sync'>>): Shell<true>\n  }\n}\n\n$`cmd ${arg}`             // ProcessPromise\n$(opts)`cmd ${arg}`       // ProcessPromise\n$.sync`cmd ${arg}`        // ProcessOutput\n$.sync(opts)`cmd ${arg}`  // ProcessOutput\n```\n\nThe `$` factory creates `ProcessPromise` instances and bounds with snapshot-context via `Proxy` and `AsyncLocalStorage`. The trick:\n```ts\nconst storage = new AsyncLocalStorage<Options>()\n\nconst getStore = () => storage.getStore() || defaults\n\nfunction within<R>(callback: () => R): R {\n  return storage.run({ ...getStore() }, callback)\n}\n// Inside $ factory ...\nconst opts = getStore()\nif (!Array.isArray(pieces)) {\n  return function (this: any, ...args: any) {\n    return within(() => Object.assign($, opts, pieces).apply(this, args))\n  }\n}\n```\n\n### `ProcessPromise` \nA promise-inherited class represents and operates a child process, provides methods for piping, killing, response formatting.\n\n#### Lifecycle\n| Stage        | Description            |\n|--------------|------------------------|\n| `initial`    | Blank instance         |\n| `halted`     | Awaits running         |\n| `running`    | Process in action      |\n| `fulfilled`  | Successfully completed |\n| `rejected`   | Failed                 |\n\n| Gear         | Description                                                                                 |\n|--------------|---------------------------------------------------------------------------------------------|\n| `build()`    | Produces `cmd` from template and context, applies `quote` to arguments                      |\n| `run()`      | Spawns the process and captures its data via `zurk` events listeners                        |\n| `finalize()` | Assigns the result to the instance: analyzes status code, invokes `_resolve()`, `_reject()` |\n\n#### Piping\nThe remarkable part is `pipe()` and `_pipe()` interactions: the first provides a facade, the second binds different streams with acceptors. We use initialization inside static scope to comply with TS method visibility restrictions and to avoid extra `Proxy` usage:\n```ts\nconst p = $`cmd`\nconst crits = await p.pipe.stderr`grep critical`\nconst names = await p.pipe.stdout`grep name`\n```\n\nAnother `pipe()` superpower is an internal recorder. It allows binding processes at any stage w/o data loss, even if settled.\n```ts\nconst onData = (chunk: string | Buffer) => from.write(chunk)\nconst fill = () => {\n  for (const chunk of source) from.write(chunk)\n}\n\nee.once(source, () => {\n  fill()                    // 1. Pulling previous records\n  ee.on(source, onData)     // 2. Listening for new data\n}).once('end', () => {\n  ee.removeListener(source, onData)\n  from.end()\n})\n```\n\nWayback machine in action:\n```ts\nconst p = $`cmd`\nawait p\nawait p.pipe`grep name` // Still works, but `p` is settled\n```\n\n### `ProcessOutput`\nA class that represents the output of a `ProcessPromise`. It provides methods to access the process's stdout, stderr, exit code and extra methods for formatting the output and checking the process's success.\n\n### `Fail`\nConsolidates error handling functionality across the zx library: errors codes mapping, formatting, stack parsing.\n\n## CLI\nzx provides CLI with embedded script preprocessor to construct an execution context (apply presets, inject global vars) and to install the required deps. Then runs the specified script.\n\n| Helper         | Description                                                                                                                                                                                                                                               |\n|----------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `main()`       | Initializes a preset from flags, env vars and pushes the reader.                                                                                                                                                                                                |\n| `readScript()` | Fetches, parses and transforms the specified source into a runnable form. `stdin` reader, `https` loader and `md` transformer act right here. Deps analyzer internally relies on [depseek](https://www.npmjs.com/package/depseek) and inherits its limitations |\n| `runScript()`  | Executes the script in the target context via async `import()`, handles temp assets after.                                                                                                                                                                 |\n\n\n## Building\nIn the early stages of the project, we [had some difficulties](https://dev.to/antongolub/how-and-why-do-we-bundle-zx-1ca6) with zx packaging. We couldn't find a suitable tool for assembly, so we made our own toolkit based on [esbuild](https://github.com/evanw/esbuild) and [dts-bundle-generator](https://github.com/timocov/dts-bundle-generator). This process is divided into several scripts.\n\n| Script                                                                                       | Description                                                            |\n|----------------------------------------------------------------------------------------------|------------------------------------------------------------------------|\n| [`./scripts/build-dts.mjs`](https://github.com/google/zx/blob/main/scripts/build-dts.mjs)    | Extracts and merges 3rd-party types, generates `dts` files.            |\n| [`./scripts/build-js.mjs`](https://github.com/google/zx/blob/main/scripts/build-js.mjs)      | Produces [hybrid bundles](./setup#hybrid) for each package entry point |\n| [`./scripts/build-jsr.mjs`](https://github.com/google/zx/blob/main/scripts/build-jsr.mjs)    | Builds extra assets for [JSR](https://jsr.io/@webpod/zx) publishing    |\n| [`./scripts/build-tests.mjs`](https://github.com/google/zx/blob/main/scripts/build-test.mjs) | Generates autotests to verify exports consistency                      |\n\nCorresponding tasks are defined in the `package.json.scripts`:\n```json\n{\n  \"prebuild\":     \"rm -rf build\",\n  \"build\":        \"npm run build:js && npm run build:dts && npm run build:tests\",\n  \"build:js\":     \"node scripts/build-js.mjs --format=cjs --hybrid --entry=src/*.ts:!src/error.ts:!src/repl.ts:!src/md.ts:!src/log.ts:!src/globals-jsr.ts:!src/goods.ts && npm run build:vendor\",\n  \"build:vendor\": \"node scripts/build-js.mjs --format=cjs --entry=src/vendor-*.ts --bundle=all --external='./internals.ts'\",\n  \"build:tests\":  \"node scripts/build-tests.mjs\",\n  \"build:dts\":    \"tsc --project tsconfig.json && rm build/repl.d.ts build/globals-jsr.d.ts && node scripts/build-dts.mjs\",\n  \"build:dcr\":    \"docker build -f ./dcr/Dockerfile . -t zx\",\n  \"build:jsr\":    \"node scripts/build-jsr.mjs\"\n}\n```\n\n## Testing\n\nWe understand the importance, impact and risks of the tool and invest significant efforts in comprehensive research of its quality, reliability and safety. Therefore, we use an extensive set of tools and testing scenarios.\n\nFirst, we inspect not how the code was written, but how it actually works. Tests mainly focus on prod bundles, `pretest` ensures they are actual.\n```json\n{\n  \"pretest\": \"npm run build\"\n}\n```\n\nA basic set of implementation correctness checks is provided by unit tests. We also evaluate coverage to ensure that areas of code are not missed. \n```json\n{\n  \"test:unit\": \"node --experimental-transform-types ./test/all.test.js\",\n  \"test:coverage\": \"c8 -c .nycrc --check-coverage npm run test:unit\"\n}\n```\n\nNext, we control the contents of all the artifacts and examine their functionality.\n```json\n{\n  \"test:npm\": \"node ./test/it/build-npm.test.js\",\n  \"test:jsr\": \"node ./test/it/build-jsr.test.js\",\n  \"test:dcr\": \"node ./test/it/build-dcr.test.js\"\n}\n```\n\nBundle code duplication issues are highlighted through size check.\n```json\n{\n  \"test:size\": \"size-limit\"\n}\n```\n\nStatic analyzers are responsible for code quality.\n```json\n{\n  \"fmt:check\": \"prettier --check .\",\n  \"test:circular\": \"madge --circular src/*\"\n}\n```\n\nType checking examines declarations and compatibility with different loaders and transpilers.\n```json\n{\n  \"test:types\": \"tsd\",\n  \"test:smoke:strip-types\": \"node --experimental-strip-types test/smoke/ts.test.ts\",\n  \"test:smoke:tsx\": \"tsx test/smoke/ts.test.ts\",\n  \"test:smoke:tsc\": \"cd test/smoke && mkdir -p node_modules && ln -s ../../../  ./node_modules/zx; ../../node_modules/typescript/bin/tsc -v && ../../node_modules/typescript/bin/tsc --esModuleInterop --module node16 --rootDir . --outdir ./temp ts.test.ts && node ./temp/ts.test.js\",\n  \"test:smoke:ts-node\": \"cd test/smoke && node --loader ts-node/esm ts.test.ts\"\n}\n```\n\nWe also check compatibility with all the target [runtimes x OS variants](https://github.com/google/zx/blob/main/.github/workflows/test.yml).\n```json\n{\n  \"test:smoke:bun\": \"bun test ./test/smoke/bun.test.js && bun ./test/smoke/node.test.mjs\",\n  \"test:smoke:win32\": \"node ./test/smoke/win32.test.js\",\n  \"test:smoke:deno\": \"deno test ./test/smoke/deno.test.js --allow-read --allow-sys --allow-env --allow-run\",\n}\n```\n\nCJS and EMS exports are verified separately.\n```json\n{\n  \"test:smoke:cjs\": \"node ./test/smoke/node.test.cjs\",\n  \"test:smoke:mjs\": \"node ./test/smoke/node.test.mjs\"\n}\n```\n\nFinally, we check the license and supply chain security issues.\n```json\n{\n  \"test:license\": \"node ./test/extra.test.js\",\n  \"test:audit\": \"npm audit fix\",\n  \"test:workflow\": \"zizmor .github/workflows -v -p --min-severity=medium\"\n}\n```\n"
  },
  {
    "path": "docs/cli.md",
    "content": "# CLI Usage\n\nZx provides a CLI for running scripts. It comes with the package and can be used as `zx` executable (if referenced in package.json `\"scripts\"`, installed [globally](/setup#install) or added to the `$PATH` somehow).\n\n```sh\nzx script.mjs\n```\n\n`npx` or `node` inits are valid too.\n```sh\nnpx zx script.mjs\nnode -r zx/globals script.mjs\nnode --import zx/globals script.mjs\n```\n\n## No extensions\n\nIf the script does not have a file extension (like `.git/hooks/pre-commit`), zx\nassumes that it is\nan [ESM](https://nodejs.org/api/modules.html#modules_module_createrequire_filename)\nmodule unless the `--ext` option is specified.\n\n## Non-standard extension\n`zx` internally loads scripts via `import` API, so you can use any extension supported by the runtime (nodejs, deno, bun) or apply a [custom loader](https://nodejs.org/api/cli.html#--experimental-loadermodule).\nHowever, if the script has a non-js-like extension (`/^\\.[mc]?[jt]sx?$/`) and the `--ext` is specified, it will be used.\n\n```bash\nzx script.zx           # Unknown file extension \"\\.zx\"\nzx --ext=mjs script.zx # OK\n```\n\n## Markdown\nThe CLI supports [markdown](/markdown) files and interprets `ts`, `js` and `bash` code blocks as scripts.\n\n```bash\nzx docs/markdown.md\n```\n\n## Remote scripts\n\nIf the argument to the `zx` executable starts with `https://`, the file will be\ndownloaded and executed.\n\n```bash\nzx https://raw.githubusercontent.com/google/zx/refs/heads/main/examples/hello.mjs\n```\n\n> [!WARNING]\nMake sure you trust the remote source and understand the code before running it.\n\n## Scripts from stdin\n\nThe `zx` supports executing scripts from stdin.\n\n```js\nzx << 'EOF'\nawait $`pwd`\nEOF\n```\n\n## `--eval`\n\nEvaluate the following argument as a script.\n\n```bash\ncat package.json | zx --eval 'const v = JSON.parse(await stdin()).version; echo(v)'\n```\n\n## `--repl`\nStarts zx in [REPL](https://en.wikipedia.org/wiki/Read%E2%80%93eval%E2%80%93print_loop) mode.\n\n## `--install`\n\n```js\n// script.mjs:\nimport sh from 'tinysh'\n\nsh.say('Hello, world!')\n```\n\nAdd `--install` flag to the `zx` command to install missing dependencies\nautomatically.\n\n```bash\nzx --install script.mjs\n```\n\nYou can also specify needed version by adding comment with `@` after\nthe import.\n\n```js\nimport sh from 'tinysh' // @^1\n```\n\n## `--registry`\n\nBy default, `zx` uses `https://registry.npmjs.org` as a registry. Customize if needed.\n\n```bash\nzx --registry=https://registry.yarnpkg.com script.mjs\n```\n\n## `--quiet`\n\nSuppress any outputs.\n\n## `--verbose`\n\nEnable verbose mode.\n\n## `--shell`\n\nSpecify a custom shell binary path. By default, zx refers to `bash`.\n\n```bash\nzx --shell=/bin/another/sh script.mjs\n```\n\n## `--prefer-local, -l`\n\nPrefer locally installed packages and binaries.\n\n```bash\nzx --prefer-local=/external/node_modules/or/nm-root script.mjs\n```\n\n## `--prefix & --postfix`\n\nAttach a command to the beginning or the end of every command.\n\n```bash\nzx --prefix='echo foo;' --postfix='; echo bar' script.mjs\n```\n\n## `--cwd`\n\nSet the current working directory.\n\n```bash\nzx --cwd=/foo/bar script.mjs\n```\n\n## `--env`\nSpecify an env file.\n\n```bash\nzx --env=/path/to/some.env script.mjs\n```\n\nWhen `cwd` option is specified, it will be used as base path:  \n`--cwd='/foo/bar' --env='../.env'` → `/foo/.env`\n\n## `--ext`\n\nOverrides the default script extension (`.mjs`).\n\n## `--version, -v`\n\nPrint the current `zx` version.\n\n## `--help, -h`\n\nPrint help notes.\n\n## Environment variables\nAll the previously mentioned options can be set via the corresponding `ZX_`-prefixed environment variables.\n\n```bash\nZX_VERBOSE=true ZX_SHELL='/bin/bash' zx script.mjs\n```\n    \n```yaml\nsteps:\n  - name: Run script\n    run: zx script.mjs\n    env:\n      ZX_VERBOSE: true\n      ZX_SHELL: '/bin/bash'\n```\n\n## `__filename & __dirname`\n\nIn [ESM](https://nodejs.org/api/esm.html) modules, Node.js does not provide\n`__filename` and `__dirname` globals. As such globals are really handy in scripts,\nzx provides these for use in `.mjs` files (when using the `zx` executable).\n\n## `require()`\n\nIn [ESM](https://nodejs.org/api/modules.html#modules_module_createrequire_filename)\nmodules, the `require()` function is not defined.\nThe `zx` provides `require()` function, so it can be used with imports in `.mjs`\nfiles (when using `zx` executable).\n\n```js\nconst {version} = require('./package.json')\n```\n"
  },
  {
    "path": "docs/configuration.md",
    "content": "# Configuration\n\n## `$.shell`\n\nSpecifies what shell is used. Default is `which bash`.\n\n```js\n$.shell = '/usr/bin/bash'\n```\n\nOr use a CLI argument: `--shell=/bin/bash`\n\n## `$.spawn`\n\nSpecifies a `spawn` api. Defaults to native `child_process.spawn`.\n\nTo override a sync API implementation, set `$.spawnSync` correspondingly.\n\n## `$.kill`\nSpecifies a `kill` function. The default implements _half-graceful shutdown_ via `ps.tree()`. You can override with more sophisticated logic.\n\n```js\nimport treekill from 'tree-kill'\n\n$.kill = (pid, signal = 'SIGTERM') => {\n  return new Promise((resolve, reject) => {\n    treekill(pid, signal, (err) => {\n      if (err) reject(err)\n      else resolve()\n    })\n  })\n}\n```\n\n## `$.prefix`\n\nSpecifies the command that will be prefixed to all commands run.\n\nDefault is `set -euo pipefail;`.\n\nOr use a CLI argument: `--prefix='set -e;'`\n\n## `$.postfix`\n\nLike a `$.prefix`, but for the end of the command.\n\n```js\n$.postfix = '; exit $LastExitCode' // for PowerShell compatibility\n```\n\n## `$.preferLocal`\n\nSpecifies whether to prefer `node_modules/.bin` located binaries over globally system installed ones.\n\n```js\n$.preferLocal = true\n\nawait $`c8 npm test`\n```\n\nYou can also specify a directory to search for local binaries:\n\n```js\n$.preferLocal = '/some/to/bin'\n$.preferLocal = ['/path/to/bin', '/another/path/bin']\n```\n\n## `$.quote`\n\nSpecifies a function for escaping special characters during\ncommand substitution.\n\n## `$.verbose`\n\nSpecifies verbosity. Default is `false`.\n\nIn verbose mode, `zx` prints all executed commands alongside with their\noutputs.\n\nOr use the CLI argument: `--verbose` to set `true`.\n\n## `$.quiet`\n\nSuppresses all output. Default is `false`.\n\nVia CLI argument: `--quiet` sets `$.quiet = true`.\n\n## `$.env`\n\nSpecifies an environment variables map.\n\nDefaults to `process.env`.\n\n## `$.cwd`\n\nSpecifies a current working directory of all processes created with the `$`.\n\nThe [cd()](#cd) func changes only `process.cwd()` and if no `$.cwd` specified,\nall `$` processes use `process.cwd()` by default (same as `spawn` behavior).\n\n## `$.log`\n\nSpecifies a [logging function](src/log.ts).\n\n```ts\nimport {LogEntry, log} from 'zx/core'\n\n$.log = (entry: LogEntry) => {\n  switch (entry.kind) {\n    case 'cmd':\n      // for example, apply custom data masker for cmd printing\n      process.stderr.write(masker(entry.cmd))\n      break\n    default:\n      log(entry)\n  }\n}\n```\n\nThe log mostly acts like a debugger, so by default it uses `process.error` for output.\nOverride the `$.log.output` to change the stream.\n\n```ts\n$.log.output = process.stdout\n```\n\nDefine `$.log.formatters` to customize each log entry kind printing:\n\n```ts\n$.log.formatters = {\n  cmd: (entry: LogEntry) => `CMD: ${entry.cmd}`,\n  fetch: (entry: LogEntry) => `FETCH: ${entry.url}`\n}\n```\n\n## `$.timeout`\n\nSpecifies a timeout for the command execution.\n\n```js\n$.timeout = '1s'\n$.timeoutSignal= 'SIGKILL'\n\nawait $`sleep 999`\n```\n\n## `$.delimiter`\nSpecifies a delimiter for splitting command output into lines.\nDefaults to `\\r?\\n` (newline or carriage return + newline).\n\n```js\n$.delimiter = /\\0/        // null character\n\nawait $`find ./ -type f -print0 -maxdepth 1`\n```\n\n## `$.defaults`\n\nHolds default configuration values. They will be used if the corresponding\n`$` options are not specified.\n\n```ts\n$.defaults = {\n  cwd:            process.cwd(),\n  env:            process.env,\n  verbose:        false,\n  quiet:          false,\n  sync:           false,\n  shell:          true,\n  prefix:         'set -euo pipefail;',   // for bash\n  postfix:        '; exit $LastExitCode', // for powershell\n  nothrow:        false,\n  stdio:          'pipe', // equivalent to ['pipe', 'pipe', 'pipe']\n  detached:       false,\n  preferLocal:    false,\n  spawn:          childProcess.spawn,\n  spawnSync:      childProcess.spawnSync,\n  log:            $.log,\n  kill:           $.kill,\n  killSignal:     'SIGTERM',\n  timeoutSignal:  'SIGTERM',\n  delimiter:      /\\r?\\n/,\n}\n```\n"
  },
  {
    "path": "docs/contribution.md",
    "content": "# Contribution Guide\n\nzx is a fully [open-source project](https://github.com/google/zx), which is developing by the community for the community. \nWe welcome contributions of any kind, including but not limited to:\n* Bug reports\n* Feature requests\n* Code contributions\n* Documentation improvements\n* Discussions\n\nhttps://google.github.io/zx/contribution\n\n## Community Guidelines\n\nThis project follows [Google's Open Source Community Guidelines](https://opensource.google/conduct/).\nIn short: all contributors are treated with respect and fairness.\n\n## Contributor License Agreement\n\nContributions to this project must be accompanied by a Contributor License\nAgreement. You (or your employer) retain the copyright to your contribution;\nthis simply gives us permission to use and redistribute your contributions as\npart of the project. Head over to <https://cla.developers.google.com/> to see\nyour current agreements on file or to sign a new one.\n\nYou generally only need to submit a CLA once, so if you've already submitted one\n(even if it was for a different project), you probably don't need to do it\nagain.\n\n## How to Contribute\nBefore proposing changes, look for similar ones in the project's [issues](https://github.com/google/zx/issues) and [pull requests](https://github.com/google/zx/pulls). If you can't decide, create a new [discussion](https://github.com/google/zx/discussions) topic, and we will help you figure it out. Dive also into [architecture notes](/architecture) to observe design concepts. When ready to move on:\n\n* Prepare your development environment.\n  * Switch to the recommended version of Node.js\n    * Install manually `Node.js >= 22`.\n    * Delegate the routine to any version manager, that [supports .node_version config](https://stackoverflow.com/questions/27425852/what-uses-respects-the-node-version-file)\n    * Use [Volta](https://volta.sh/), the target version will be set automatically from the `package.json`\n  * Bash is essential for running zx scripts. Linux and macOS users usually have it installed by default. Consider using [Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install) or [Git Bash](https://git-scm.com/downloads) if you are on Windows.\n* Fork [the repository](https://github.com/google/zx).\n* Create a new branch.\n\n* Make your changes.\n  * If you are adding a new feature, please include additional tests. The coverage threshold is 98%.\n  * Create a [conventional-commits](https://www.conventionalcommits.org/en/v1.0.0/) compliant messages.\n* Ensure that everything is working:\n  * `npm run fmt` to format your code.\n  * `npm run test:coverage` to run the tests.\n* Push the changes to your fork.\n* Create a pull request.\n  * Describe your changes in detail.\n  * Reference any related issues if applicable.\n\n## Code Reviews\n\nAll submissions, including submissions by project members, require review. We use GitHub pull requests for this purpose. Consult [GitHub Help](https://help.github.com/articles/about-pull-requests/) for more information on using pull requests.\n\n## License\n\nThe project is licensed under the [Apache-2.0](https://github.com/google/zx?tab=Apache-2.0-1-ov-file#readme)\n"
  },
  {
    "path": "docs/faq.md",
    "content": "# FAQ\n\n## Passing env variables\n\n```js\nprocess.env.FOO = 'bar'\nawait $`echo $FOO`\n```\n\n## Passing array of values\n\nWhen passing an array of values as an argument to `$`, items of the array will\nbe escaped\nindividually and concatenated via space.\n\nExample:\n\n```js\nconst files = [...]\nawait $`tar cz ${files}`\n```\n\n## Importing into other scripts\n\nIt is possible to make use of `$` and other functions via explicit imports:\n\n```js\n#!/usr/bin/env node\nimport {$} from 'zx'\n\nawait $`date`\n```\n\n## Attaching a profile\n\nBy default `child_process` does not include aliases and bash functions.\nBut you are still able to do it by hand. Just attach necessary directives\nto the `$.prefix`.\n\n```js\n$.prefix += 'export NVM_DIR=$HOME/.nvm; source $NVM_DIR/nvm.sh; '\nawait $`nvm -v`\n```\n\n## Using GitHub Actions\n\nThe default GitHub Action runner comes with `npx` installed.\n\n```yaml\njobs:\n  build:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v4\n#      - uses: actions/setup-node@v4\n#        with:\n#          node-version: 22\n\n      - name: Build with zx\n        env:\n          FORCE_COLOR: 3\n        run: |\n          npx zx <<'EOF'\n          await $`...`\n          EOF\n```\n\n## Verbose and Quiet\nzx has internal logger, which captures events if a condition is met:\n\n| Event  | Verbose | Quiet   | Description                  |\n|--------|---------|---------|------------------------------|\n| stdout | `true`  | `false` | Spawned process stdout       |\n| stderr | `any`   | `false` | Process stderr data          |\n| cmd    | `true`  | `false` | Command execution            |\n| fetch  | `true`  | `false` | Fetch resources by http(s)   |\n| cd     | `true`  | `false` | Change directory             |\n| retry  | `true`  | `false` | Capture exec error           |\n| custom | `true`  | `false` | User-defined event           |\n\nBy default, both `$.verbose` and `$.quiet` options are `false`, so only `stderr` events are written. Any output goes to the `process.stderr` stream.\n\nYou may control this flow globally or in-place\n```js\n// Global debug mode on\n$.verbose = true\nawait $`echo hello`\n\n// Suppress the particular command\nawait $`echo fobar`.quiet()\n\n// Suppress everything\n$.quiet = true\nawait $`echo world`\n\n// Turn on in-place debug\nawait $`echo foo`.verbose()\n```\n\nYou can also override the default logger with your own:\n```js\n// globally\n$.log = (entry) => {\n  switch (entry.kind) {\n    case 'cmd':\n      console.log('Command:', entry.cmd)\n      break\n    default:\n      console.warn(entry)\n  }\n}\n// or in-place\n$({log: () => {}})`echo hello`\n```\n\n## Canary / Beta / RC builds\n\nImpatient early adopters can try the experimental zx versions.\nBut keep in mind: these builds are ⚠️️__beta__ in every sense.\n\n```bash\nnpm i zx@dev\nnpx zx@dev --install --quiet <<< 'import _ from \"lodash\" /* 4.17.15 */; console.log(_.VERSION)'\n```\n"
  },
  {
    "path": "docs/getting-started.md",
    "content": "# Getting Started\n\n## Overview\n\n```js\n#!/usr/bin/env zx\n\nawait $`cat package.json | grep name`\n\nconst branch = await $`git branch --show-current`\nawait $`dep deploy --branch=${branch}`\n\nawait Promise.all([\n  $`sleep 1; echo 1`,\n  $`sleep 2; echo 2`,\n  $`sleep 3; echo 3`,\n])\n\nconst name = 'foo bar'\nawait $`mkdir /tmp/${name}`\n```\n\nBash is great, but when it comes to writing more complex scripts,\nmany people prefer a more convenient programming language.\nJavaScript is a perfect choice, but the Node.js standard library\nrequires additional hassle before using. The `zx` package provides\nuseful wrappers around `child_process`, escapes arguments and\ngives sensible defaults.\n\n## Install\n\n```bash\nnpm install zx\n```\nor many [other ways](/setup)\n\n## Usage\n\nWrite your scripts in a file with an `.mjs` extension in order to\nuse `await` at the top level. If you prefer the `.js` extension,\nwrap your scripts in something like `void async function () {...}()`. [TypeScript](./typescript.md) is also supported.\n\nAdd the following shebang to the beginning of your `zx` scripts:\n\n```bash\n#!/usr/bin/env zx\n```\n\nNow you will be able to run your script like so:\n\n```bash\nchmod +x ./script.mjs\n./script.mjs\n```\n\nOr via the [CLI](cli.md):\n\n```bash\nzx ./script.mjs\n```\n\nAll functions (`$`, `cd`, `fetch`, etc) are available straight away\nwithout any imports.\n\nOr import globals explicitly (for better autocomplete in VS Code).\n\n```js\nimport 'zx/globals'\n```\n\n### ``$`command` ``\n\nExecutes a given command using the `spawn` func\nand returns [`ProcessPromise`](process-promise.md). It supports both sync and async modes.\n\n```js\nconst list = await $`ls -la`\nconst dir = $.sync`pwd`\n```\n\nEverything passed through `${...}` will be automatically escaped and quoted.\n\n```js\nconst name = 'foo & bar'\nawait $`mkdir ${name}`\n```\n\n**There is no need to add extra quotes.** Read more about it in\n[quotes](quotes.md).\n\nYou can pass an array of arguments if needed:\n\n```js\nconst flags = [\n  '--oneline',\n  '--decorate',\n  '--color',\n]\nawait $`git log ${flags}`\n```\n\nIn async mode, zx awaits any `thenable` in literal before executing the command.\n```js\nconst a1 = $`echo foo`\nconst a2 = new Promise((resolve) => setTimeout(resolve, 20, ['bar', 'baz']))\n\nawait $`echo ${a1} ${a2}` // foo bar baz\n```\n\nIf the executed program returns a non-zero exit code,\n[`ProcessOutput`](#processoutput) will be thrown.\n\n```js\ntry {\n  await $`exit 1`\n} catch (p) {\n  console.log(`Exit code: ${p.exitCode}`)\n  console.log(`Error: ${p.stderr}`)\n}\n```\n\n### `ProcessOutput`\n\n```ts\nclass ProcessOutput {\n  readonly stdout: string\n  readonly stderr: string\n  readonly signal: string\n  readonly exitCode: number\n  // ...\n  toString(): string // Combined stdout & stderr.\n  valueOf(): string  // Returns .toString().trim()\n}\n```\n\nThe output of the process is captured as-is. Usually, programs print a new\nline `\\n` at the end.\nIf `ProcessOutput` is used as an argument to some other `$` process,\n**zx** will use stdout and trim the new line.\n\n```js\nconst date = await $`date`\nawait $`echo Current date is ${date}.`\n```\n\n## License\n\n[Apache-2.0](https://github.com/google/zx/blob/main/LICENSE)\n\nDisclaimer: _This is not an officially supported Google product._\n"
  },
  {
    "path": "docs/index.md",
    "content": "---\n# https://vitepress.dev/reference/default-theme-home-page\nlayout: home\ntitleTemplate: google/zx\n\nhero:\n  name: \"zx\"\n  text: \"A tool for writing better scripts\"\n  image:\n    src: /img/logo.svg\n    alt: Zx Logo\n  actions:\n    - theme: brand\n      text: Documentation\n      link: /getting-started\n\nfeatures:\n  - title: Simple\n    details: Write your scripts in a familiar language.\n  - title: Powerful\n    details: Interact with the full ecosystem of JS libraries.\n  - title: Batteries included\n    details: Everything you need, right out of the box.\n---\n"
  },
  {
    "path": "docs/known-issues.md",
    "content": "# Known Issues\n\n## Output gets truncated\n\nThis is a known issue with `console.log()` (see [nodejs/node#6379](https://github.com/nodejs/node/issues/6379)).\nIt's caused by different behaviour of `console.log()` writing to the terminal vs\nto a file. If a process calls `process.exit()`, buffered output will be truncated.\nTo prevent this, the process should use `process.exitCode = 1` and wait for the\nprocess to exit itself. Or use something like [exit](https://www.npmjs.com/package/exit) package.\n\nWorkaround is to write to a temp file:\n```js\nconst tmp = await $`mktemp` // Creates a temp file.\nconst {stdout} = await $`cmd > ${tmp}; cat ${tmp}`\n```\n\n## Colors in subprocess\n\nYou may see what tools invoked with `await $` don't show colors, compared to\nwhat you see in a terminal. This is because, the subprocess does not think it's\na TTY and the subprocess turns off colors. Usually there is a way force\nthe subprocess to add colors.\n\n```js\nprocess.env.FORCE_COLOR='1'\nawait $`cmd`\n```\n"
  },
  {
    "path": "docs/lite.md",
    "content": "# zx@lite\n\nJust core functions without extras:\n* ~7x smaller than the full version\n* No CLI, no docs, no manpage assets embedded\n* Same package name, but different publish channel — `@lite`\n* Less code — ~~less risks~~ faster and more reliable ISEC audit\n* Recommended for custom toolkits based on zx\n\n```sh\nnpm i zx@lite\nnpm i zx@8.5.5-lite\n```\nDetailed comparison: [versions](./versions)\n\n```js\nimport { $ } from 'zx'\nawait $`echo foo`\n```\n\n### Range of choice\n**tool size ← [`child_process`](https://nodejs.org/api/child_process.html) [`zurk`](https://github.com/webpod/zurk) `zx@lite` `zx`  → built-in functionality** \n"
  },
  {
    "path": "docs/markdown.md",
    "content": "# Markdown Scripts\n\nImagine a script with code blocks, formatted comments, schemas, illustrations, etc. [Markdown](https://en.wikipedia.org/wiki/Markdown) is right for this purpose.\nCombine `ts`, `js`, `bash` sections to produce a single zx scenario. For example:\n\n````text\n# Some script\n`ls` — is an unix command to get directory contents. Let's see how to use it in `zx`:\n\n```js\n// ts, js, cjs, mjs, etc\nconst {stdout} = await $`ls -l`\nconsole.log('directory contents:', stdout)\n```\n\nThis part invokes the same command in a different way:\n```bash\n# bash syntax\nls -l\n```\n````\n\nAnd how it looks like:\n\n> # Some script\n> `ls` — is an unix command to get directory contents. Let's see how to use it in `zx`:\n> ```js\n> // ts, js, cjs, mjs, etc\n> const {stdout} = await $`ls -l`\n> console.log('directory contents:', stdout)\n> ```\n>\n> This part invokes the same command in a different way:\n> ```bash\n> # bash syntax\n> ls -l\n> ```\n\nThe rest is simple: just run via `zx` command:\n```bash \nzx script.md\n```\n\n## Hints\nYou can use imports here as well:\n\n```js\nawait import('chalk')\n```\n\n`js`, `javascript`, `ts`, `typescript`, `sh`, `shell`, `bash` code blocks will be executed by zx. \n\n```bash\nVAR=$(date)\necho \"$VAR\" | wc -c\n```\n\nOther kinds are ignored:\n\n```css\nbody .hero {\n  margin: 42px;\n}\n```\n\nThe `__filename` will be pointed to **markdown.md**:\n\n```js\nconsole.log(chalk.yellowBright(__filename))\n```\n\n"
  },
  {
    "path": "docs/migration-from-v7.md",
    "content": "# Migration from v7 to v8\n\n[v8.0.0 release](https://github.com/google/zx/releases/tag/8.0.0) brought many features, improvements, optimizations and fixes, but also has introduced a few breaking changes. Fortunately, everything can be restored and legacy v7 scripts can still run with minor configurations.\n\n1. `$.verbose` is set to `false` by default, but errors are still printed to `stderr`. Set `$.quiet = true` to suppress any output.\n```js\n$.verbose = true // everything works like in v7\n\n$.quiet = true   // to completely turn off logging\n```\n\n2. `ssh` API was dropped. Install [webpod](https://github.com/webpod/webpod) package instead.\n```js\n// import {ssh} from 'zx' ↓\nimport {ssh} from 'webpod'\n\nconst remote = ssh('user@host')\nawait remote`echo foo`\n```\n\n3. zx is not looking for `PowerShell` anymore, on Windows by default. If you still need it, use the `usePowerShell` helper to enable:\n\n```js\nimport { usePowerShell, useBash } from 'zx'\n\nusePowerShell() // to enable powershell\nuseBash()       // switch to bash, the default\n```\n\nTo look for modern [PowerShell v7+](https://github.com/google/zx/pull/790), invoke `usePwsh()` helper instead:\n\n```js\nimport { usePwsh } from 'zx'\n\nusePwsh()\n```\n\n4. Process cwd synchronization between `$` invocations is now disabled by default. This functionality is provided via an async hook and can now be controlled directly.\n\n```js\nimport { syncProcessCwd } from 'zx'\n\nsyncProcessCwd() // restores legacy v7 behavior\n```\n\n# 🚀\nKeep in mind, v7 is in maintenance mode, so it will not receive any new enhancements. We encourage you to upgrade to the latest: it's [16x smaller](https://dev.to/antongolub/how-and-why-do-we-bundle-zx-1ca6), faster, safer, more reliable and useful in a [wider range of practical scenarios](https://github.com/google/zx/releases).\n"
  },
  {
    "path": "docs/process-output.md",
    "content": "# Process Output\n\nRepresents a cmd execution result.\n\n```ts\nconst p = $`command` // ProcessPromise\nconst o = await p     // ProcessOutput\n```\n\n```ts\ninterface ProcessOutput extends Error {\n  // Exit code of the process: 0 for success, non-zero for failure\n  exitCode: number\n  \n  // Signal that caused the process to exit: SIGTERM, SIGKILL, etc.\n  signal: NodeJS.Signals | null\n  \n  // Holds the stdout of the process\n  stdout: string\n  \n  // Process errors are written to stderr\n  stderr: string\n\n  buffer(): Buffer\n\n  json<T = any>(): T\n\n  blob(type = 'text/plain'): Blob\n  \n  text(encoding: Encoding = 'utf8'): string\n\n  // Output lines splitted by newline\n  lines(delimiter?: string | RegExp): string[]\n  \n  // combined stdout and stderr\n  toString(): string\n\n  // Same as toString() but trimmed\n  valueOf(): string\n}\n```\n"
  },
  {
    "path": "docs/process-promise.md",
    "content": "# Process Promise\n\nThe `$` returns a `ProcessPromise` instance, which inherits native `Promise`. When resolved, it becomes a [`ProcessOutput`](./process-output.md).\n\n```js\nconst p = $`command` // ProcessPromise\nconst o = await p    // ProcessOutput\n```\n\nBy default, `$` spawns a new process immediately, but you can delay the start to trigger in manually.\n\n```ts\nconst p = $({halt: true})`command`\nconst o = await p.run()\n```\n\n## `stage`\n\nShows the current process stage: `initial` | `halted` | `running` | `fulfilled` | `rejected`\n\n```ts\nconst p = $`echo foo`\np.stage // 'running'\nawait p\np.stage // 'fulfilled'\n```\n\n\n## `stdin`\n\nReturns a writable stream of the stdin process. Accessing\nthis getter will trigger execution of a subprocess with [`stdio('pipe')`](#stdio).\n\nDo not forget to end the stream.\n\n```js\nconst p = $`while read; do echo $REPLY; done`\np.stdin.write('Hello, World!\\n')\np.stdin.end()\n```\n\nBy default, each process is created with stdin in _inherit_ mode.\n\n## `stdout`/`stderr`\n\nReturns a readable streams of stdout/stderr process.\n\n```js\nconst p = $`npm init`\nfor await (const chunk of p.stdout) {\n  echo(chunk)\n}\n```\n\n## `exitCode`\n\nReturns a promise which resolves to the exit code of the process.\n\n```js\nif (await $`[[ -d path ]]`.exitCode == 0) {\n// ...\n}\n```\n\n## `json(), text(), lines(), buffer(), blob()`\n\nOutput formatters collection.\n\n```js\nconst p = $`echo 'foo\\nbar'`\n\nawait p.text()        // foo\\n\\bar\\n\nawait p.text('hex')   // 666f6f0a0861720a\nawait p.buffer()      // Buffer.from('foo\\n\\bar\\n')\nawait p.lines()       // ['foo', 'bar']\n\n// You can specify a custom lines delimiter if necessary:\nawait $`touch foo bar baz; find ./ -type f -print0`\n  .lines('\\0')        // ['./bar', './baz', './foo']\n\n// If the output is a valid JSON, parse it in place:\nawait $`echo '{\"foo\": \"bar\"}'`\n  .json()             // {foo: 'bar'}\n```\n\n## `pid, cwd, cmd, fullCmd`\n\nProcess metadata getters.\n\n```js\nconst p = $`sleep 1`\np.pid       // process id\np.cwd       // process working directory\np.cmd       // command: \"sleep 1\"\np.fullCmd   // full command with prefix and postfix: \"set -euo pipefail;sleep 1\"\n```\n\n## `[Symbol.asyncIterator]`\n\nReturns an async iterator for the process stdout.\n\n```js\nconst p = $`echo \"Line1\\nLine2\\nLine3\"`\nfor await (const line of p) {\n  console.log(line)\n}\n\n// Custom delimiter can be specified:\nfor await (const line of $({\n  delimiter: '\\0'\n})`touch foo bar baz; find ./ -type f -print0`) {\n  console.log(line)\n}\n```\n\n## `pipe()`\n\nRedirects the output of the process. Almost same as `|` in bash but with enhancements.\n```js\nconst greeting = await $`printf \"hello\"`\n  .pipe($`awk '{printf $1\", world!\"}'`)\n  .pipe($`tr '[a-z]' '[A-Z]'`)\n```\n\n`pipe()` accepts any kind `Writable`, `ProcessPromise` or a file path.\n\n```js\nawait $`echo \"Hello, stdout!\"`\n  .pipe(fs.createWriteStream('/tmp/output.txt'))\n```\nYou can pass a string to `pipe()` to implicitly create a receiving file. The previous example is equivalent to:\n\n```js\nawait $`echo \"Hello, stdout!\"`\n  .pipe('/tmp/output.txt')\n```\n\nChained streams become _thenables_, so you can `await` them:\n\n```js\nconst p = $`echo \"hello\"`\n  .pipe(getUpperCaseTransform())\n  .pipe(fs.createWriteStream(tempfile()))  // <- stream\nconst o = await p\n```\n\nAnd the `ProcessPromise` itself is compatible with the standard `Stream.pipe` API:\n\n```js\nconst { stdout } = await fs\n  .createReadStream(await fs.writeFile(file, 'test'))\n  .pipe(getUpperCaseTransform())\n  .pipe($`cat`)\n```\n\nPipes can be used to show a real-time output of the process:\n\n```js\nawait $`echo 1; sleep 1; echo 2; sleep 1; echo 3;`\n  .pipe(process.stdout)\n```\n\nAnd the time machine is in stock! You can pipe the process at any phase: on start, in the middle, or even after the end. All chunks will be buffered and processed in the right order.\n\n```js\nconst result = $`echo 1; sleep 1; echo 2; sleep 1; echo 3`\nconst piped1 = result.pipe`cat`\nlet piped2\n\nsetTimeout(() => { piped2 = result.pipe`cat` }, 1500)\n  \n(await piped1).toString()  // '1\\n2\\n3\\n'\n(await piped2).toString()  // '1\\n2\\n3\\n'\n```\n\nThis mechanism allows you to easily split streams to multiple consumers:\n```js\nconst p = $`some-command`\nconst [o1, o2] = await Process.all([\n  p.pipe`log`,\n  p.pipe`extract`\n])\n```\n\nUse combinations of `pipe()` and [`nothrow()`](#nothrow):\n\n```js\nawait $`find ./examples -type f -print0`\n  .pipe($`xargs -0 grep ${'missing' + 'part'}`.nothrow())\n  .pipe($`wc -l`)\n```\n\nAnd literals! The `pipe()` does support them too:\n\n```js\nawait $`printf \"hello\"`\n  .pipe`awk '{printf $1\", world!\"}'`\n  .pipe`tr '[a-z]' '[A-Z]'`\n```\n\nThe `pipe()` allows not only chain or split stream, but also to merge them.\n```js\nconst $h = $({ halt: true })\nconst p1 = $`echo foo`\nconst p2 = $h`echo a && sleep 0.1 && echo c && sleep 0.2 && echo e`\nconst p3 = $h`sleep 0.05 && echo b && sleep 0.1 && echo d`\nconst p4 = $`sleep 0.4 && echo bar`\nconst p5 = $h`cat`\n\nawait p1\np1.pipe(p5)\np2.pipe(p5)\np3.pipe(p5)\np4.pipe(p5)\n\nconst { stdout } = await p5.run() // 'foo\\na\\nb\\nc\\nd\\ne\\nbar\\n'\n```\n\nBy default, `pipe()` operates with `stdout` stream, but you can specify `stderr` as well:\n\n```js\nconst p = $`echo foo >&2; echo bar`\nconst o1 = (await p.pipe.stderr`cat`).toString()  // 'foo\\n'\nconst o2 = (await p.pipe.stdout`cat`).toString()  // 'bar\\n'\n```\n\nThe [signal](/api#signal) option, if specified, will be transmitted through the pipeline.\n\n```js\nconst ac = new AbortController()\nconst { signal } = ac\nconst p = $({ signal, nothrow: true })`echo test`.pipe`sleep 999`\nsetTimeout(() => ac.abort(), 50)\n\ntry {\n  await p\n} catch ({ message }) {\n  message // The operation was aborted\n}\n```\n\nIn short, combine anything you want:\n\n```js\nconst getUpperCaseTransform = () => new Transform({\n  transform(chunk, encoding, callback) {\n    callback(null, String(chunk).toUpperCase())\n  },\n})\n\n// $ > stream (promisified) > $\nconst o1 = await $`echo \"hello\"`\n  .pipe(getUpperCaseTransform())\n  .pipe($`cat`)\n\no1.stdout //  'HELLO\\n'\n\n// stream > $\nconst file = tempfile()\nawait fs.writeFile(file, 'test')\nconst o2 = await fs\n  .createReadStream(file)\n  .pipe(getUpperCaseTransform())\n  .pipe($`cat`)\n\no2.stdout //  'TEST'\n```\n\n## `unpipe()`\n\nOpposite of `pipe()`, it removes the process from the pipeline.\n\n```js\nconst p1 = $`echo foo && sleep 0.05 && echo bar && sleep 0.05 && echo baz && sleep 0.05 && echo qux`\nconst p2 = $`echo 1 && sleep 0.05 && echo 2 && sleep 0.05 && echo 3`\nconst p3 = $`cat`\n\np1.pipe(p3)\np2.pipe(p3)\n\nsetTimeout(() => p1.unpipe(p3), 105)\n\nassert.equal((await p1).stdout, 'foo\\nbar\\nbaz\\nqux')\nassert.equal((await p2).stdout, '1\\n2\\n3')\nassert.equal((await p3).stdout, 'foo\\n1\\nbar\\n2\\n3')\n```\n\n## `kill()`\n\nKills the process and all children.\n\nBy default, signal `SIGTERM` is sent. You can specify a signal via an argument.\n\n```js\nconst p = $`sleep 999`\nsetTimeout(() => p.kill('SIGINT'), 100)\nawait p\n```\n\nKilling the expired process raises an error:\n\n```js\nconst p = await $`sleep 999`\np.kill() // Error: Too late to kill the process.\n```\n\n## `abort()`\n\nTerminates the process via an `AbortController` signal.\n\n```js\nconst ac = new AbortController()\nconst {signal} = ac\nconst p = $({signal})`sleep 999`\n\nsetTimeout(() => ac.abort('reason'), 100)\nawait p\n```\n\nIf `ac` or `signal` is not provided, it will be autocreated and could be used to control external processes.\n\n```js\nconst p = $`sleep 999`\nconst {signal} = p\n\nconst res = fetch('https://example.com', {signal})\np.abort('reason')\n```\n\nThe process may be aborted while executing, the method raises an error otherwise:\n\n```js\nconst p = $({nothrow: true})`sleep 999`\np.abort() // ok\n\nawait p\np.abort() // Error: Too late to abort the process.\n```\n\n## `stdio()`\nSpecifies a standard input-output for the process.\n\n```js\nconst h$ = $({halt: true})\nconst p1 = h$`read`.stdio('inherit', 'pipe', null).run()\nconst p2 = h$`read`.stdio('pipe').run() // sets ['pipe', 'pipe', 'pipe']\n```\n\nKeep in mind, `stdio` should be set before the process is started, so the preset syntax might be preferable:\n\n```js\nawait $({stdio: ['pipe', 'pipe', 'pipe']})`read`\n```\n\n## `nothrow()`\n\nChanges behavior of `$` to not throw an exception on non-zero exit codes. Equivalent to [`$({nothrow: true})` option](./api#nothrow).\n\n```js\nawait $`grep something from-file`.nothrow()\n\n// Inside a pipe():\nawait $`find ./examples -type f -print0`\n  .pipe($`xargs -0 grep something`.nothrow())\n  .pipe($`wc -l`)\n\n// Accepts a flag to switch nothrow mode for the specific command\n$.nothrow = true\nawait $`echo foo`.nothrow(false)\n```\n\nIf only the `exitCode` is needed, you can use [`exitCode`](#exitcode) directly:\n\n```js\nif (await $`[[ -d path ]]`.exitCode == 0) {\n//...\n}\n\n// Equivalent of:\n\nif ((await $`[[ -d path ]]`.nothrow()).exitCode == 0) {\n//...\n}\n```\n\n## `quiet()`\n\nChanges behavior of `$` to enable suppress mode.\n\n```js\n// Command output will not be displayed.\nawait $`grep something from-file`.quiet()\n\n$.quiet = true\nawait $`echo foo`.quiet(false) // Disable for the specific command\n```\n\n## `verbose()`\n\nEnables verbose output. Pass `false` to disable.\n\n```js\nawait $`grep something from-file`.verbose()\n\n$.verbose = true\nawait $`echo foo`.verbose(false) // Turn off verbose mode once\n```\n\n## `timeout()`\n\nKills the process after a specified period.\n\n```js\nawait $`sleep 999`.timeout('5s')\n\n// Or with a specific signal.\nawait $`sleep 999`.timeout('5s', 'SIGKILL')\n```\n\nIf the process is already settled, the method does nothing. Passing nullish value will disable the timeout.\n"
  },
  {
    "path": "docs/quotes.md",
    "content": "# Quotes\n\nBash supports various ways to quote arguments: single quotes, double quotes, and a bash-specific method using C-style\nquotes `$'...'`. Zx prefers the latter approach.\n\n```js\nconst name = 'foo & bar'\nawait $`mkdir ${name}`\n```\n\n\n> [!WARNING]  \n> Zx automatically escapes and quotes anything within `${...}`, so there's no need for additional quotes. Moreover, this may result in an **unsafe injection**.\n> ```ts\n> const args = ['param && echo bar']\n> const p = $`echo --foo=$'${args}'`\n> (await p).stdout // '--foo=$param\\nbar\\n'\n> ```\n\n\nThe following examples produce the same, correct result:\n\n```js\nawait $`mkdir ${'path/to-dir/' + name}`\n```\n\n```js\nawait $`mkdir path/to-dir/${name}`\n```\n\nKeep in mind, that `PowerShell` or `pwsh` requires a corresponding quote implementation. Define it [via helpers](./setup#bash) or manually:\n\n```js\nimport { quotePowerShell } from 'zx'\n\n$.quote = quotePowerShell\n```\n\n## Array of arguments\n\nZx can also accept an array of arguments within `${...}`. Each array item will be quoted separately and then joined by a\nspace.\n\n```js\nconst flags = [\n  '--oneline',\n  '--decorate',\n  '--color',\n]\nawait $`git log ${flags}`\n```\n\n## Glob patterns\n\nBecause Zx escapes everything inside `${...}`, you can't use glob syntax directly. Instead, Zx provides \na [`glob`](api.md#glob) function.\n\nThe following example won't work:\n\n```js\nconst files = './**/*.md' // [!code error] // Incorrect\nawait $`ls ${files}`\n```\n\nThe correct approach:\n\n```js\nconst files = await glob('./**/*.md')\nawait $`ls ${files}`\n```\n\n## Home dir `~`\n\nZx won't expand the home directory symbol `~` if it's within `${...}`. Use `os.homedir()` for that purpose.\n\n```js\nconst dir = `~/Downloads` // [!code error] // Incorrect\nawait $`ls ${dir}`\n```\n\n```js\nawait $`ls ${os.homedir()}/Downloads` // Correct\n```\n\n```js\nawait $`ls ~/Downloads` // Correct, ~ is outside of ${...}\n```\n\n## Assembling commands\n\nIf you're trying to dynamically assemble commands in Zx, you might run into limitations. For instance, the following\napproach won't work:\n\n```js\nconst cmd = 'rm'\nif (force) cmd += ' -f'\nif (recursive) cmd += ' -r'\ncmd += ' ' + file\n\nawait $`${cmd}` // [!code error] // Incorrect\n```\n\nZx will escape the entire string, making the command invalid. Instead, assemble an array of arguments and pass it to Zx\nlike this:\n\n```js\nconst args = []\nif (force) args.push('-f')\nif (recursive) args.push('-r')\nargs.push(file)\n\nawait $`rm ${args}` // [!code hl]\n```\n"
  },
  {
    "path": "docs/setup.md",
    "content": "# Setup\n\n## Requirements\n* Linux, macOS, or Windows\n* JavaScript Runtime:\n  * Node.js >= 12.17.0\n  * Bun >= 1.0.0\n  * Deno 1.x, 2.x\n  * GraalVM Node.js\n* Some kind of bash or PowerShell\n\n## Install\n\n::: code-group\n\n```bash [npm]\nnpm install zx     # add -g to install globally\n```\n\n```bash [npx]\nnpx zx script.js         # run script without installing the zx package\nnpx zx@8.6.0 script.js   # pin to a specific zx version\n```\n\n```bash [yarn]\nyarn add zx\n```\n\n```bash [pnpm]\npnpm add zx\n```\n\n```bash [bun]\nbun install zx\n```\n\n```bash [deno]\ndeno install -A npm:zx\n\n# zx requires additional permissions: --allow-read --allow-sys --allow-env --allow-run\n```\n\n```bash [jsr]\nnpx jsr add @webpod/zx\ndeno add jsr:@webpod/zx\n\n# https://jsr.io/docs/using-packages\n```\n\n```bash [docker]\ndocker pull ghcr.io/google/zx:8.5.0\ndocker run -t ghcr.io/google/zx:8.5.0 -e=\"await \\$({verbose: true})\\`echo foo\\`\"\ndocker run -t -i -v ./:/script ghcr.io/google/zx:8.5.0 script/t.js\n```\n\n```bash [brew]\nbrew install zx\n```\n\n:::\n\n### Channels\n\nzx is distributed in several versions, each with its own set of features.\n\n| Channel  | Description                                                                                  | Install              |\n|----------|----------------------------------------------------------------------------------------------|----------------------|\n| `latest` | Mainline releases with the latest features and improvements.                                 | `npm i zx`           |\n| `lite`   | [A minimalistic version of zx](./lite), suitable for lightweight scripts.                    | `npm i zx@lite`      |\n| `dev`    | Development snapshots with the latest changes, may be unstable.                              | `npm i zx@dev`       |\n| `legacy` | Legacy supporting versions for compatibility with older scripts, no new features, only bugfixes | `npm i zx@<version>` |\n\nDetailed comparison: [versions](./versions).\n\nPlease check the download sources carefully. Official links:\n\n* [npmjs](https://www.npmjs.com/package/zx)\n* [GH npm](https://github.com/google/zx/pkgs/npm/zx)\n* [GH repo](https://github.com/google/zx)\n* [GH docker](https://github.com/google/zx/pkgs/container/zx)\n* [JSR](https://jsr.io/@webpod/zx)\n* [Homebrew](https://github.com/Homebrew/homebrew-core/blob/master/Formula/z/zx.rb)\n\n### Github\nTo fetch zx directly from the GitHub:\n```bash\n# Install via git\nnpm i google/zx\nnpm i git@github.com:google/zx.git\n\n# Fetch from the GH pkg registry\nnpm i --registry=https://npm.pkg.github.com @google/zx\n```\n\n### Docker\nIf you'd prefer to run scripts in a container, you can pull the zx image from the [ghcr.io](https://ghcr.io).\n[node:24-alpine](https://hub.docker.com/_/node) is used as [a base](https://github.com/google/zx/blob/main/dcr/Dockerfile).\n\n```shell\ndocker pull ghcr.io/google/zx:8.5.0\ndocker run -t ghcr.io/google/zx:8.5.0 -e=\"await \\$({verbose: true})\\`echo foo\\`\"\ndocker run -t -i -v ./:/script ghcr.io/google/zx:8.5.0 script/t.js\n```\n\n## Bash\n\nzx mostly relies on bash, so make sure it's available in your environment. If you're on Windows, consider using [Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install) or [Git Bash](https://git-scm.com/downloads).\nBy default, zx looks for bash binary, but you can switch to PowerShell by invoking `usePowerShell()` or `usePwsh()`.\n\n```js\nimport { useBash, usePowerShell, usePwsh } from 'zx'\n\nusePowerShell() // Use PowerShell.exe\nusePwsh()       // Rely on pwsh binary (PowerShell v7+)\nuseBash()       // Switch back to bash\n```\n\n## Package\n\n### Hybrid\nzx is distributed as a [hybrid package](https://2ality.com/2019/10/hybrid-npm-packages.html): it provides both CJS and ESM entry points.\n\n```js\nimport { $ } from 'zx'\n\nconst { $ } = require('zx')\n```\n\nIt also contains built-in TypeScript libdefs. But `@types/fs-extra` and `@types/node` are required to be installed on user's side.\n\n```bash\nnpm i -D @types/fs-extra @types/node\n```\n\n```ts\nimport { type Options } from 'zx'\n\nconst opts: Options = {\n  quiet: true,\n  timeout: '5s'\n}\n```\n\n### Bundled\n\nWe use [esbuild](https://dev.to/antongolub/how-and-why-do-we-bundle-zx-1ca6) to produce a static build that allows us to solve several issues at once:\n* Reduce the pkg size and install time.\n* Make npx (yarn dlx / bunx) invocations reproducible.\n* Provide support for a wide range of Node.js versions: from [12 to 25](https://github.com/google/zx/blob/61d03329349770d90fda3c9e26f7ef09f869a096/.github/workflows/test.yml#L195).\n* Make auditing easier: complete code is in one place.\n\n### Composite\n\nzx exports several entry points adapted for different use cases:\n* `zx` – the main entry point, provides all the features.\n* `zx/global` – to populate the global scope with zx functions.\n* `zx/cli` – to run zx scripts from the command line.\n* `zx/core` – to use zx template spawner as part of 3rd party libraries with alternating set of utilities.\n\n### Typed\nThe library is written in TypeScript 5 and provides comprehensive type definitions for TS users.\n* Libdefs are bundled via [dts-bundle-generator](https://github.com/timocov/dts-bundle-generator).\n* Compatible with TS 4.0 and later.\n* Requires `@types/node` and `@types/fs-extra` to be installed.\n"
  },
  {
    "path": "docs/shell.md",
    "content": "# Shell\n\n[Bash](https://en.wikipedia.org/wiki/Bash_(Unix_shell)) is a fundamental part of the Unix ecosystem, and it is widely used for scripting and automation tasks. It provides a powerful set of built-in utils, operators, process controllers.\nBash gives an efficient way to fine-tune the behavior: cmd aliases, context presets, custom functions, env injections, and more.\n\nzx is not trying to replace bash, but to enhance it with JavaScript's capabilities:\n* Parallel execution\n* Data transformations\n* Exception handling\n* Conditional logic and loops\n\n```js\n#!/usr/bin/env zx\nimport { $ } from 'zx'\n\n$.nothrow = true\n\nconst repos = ['zx', 'webpod']\nconst clones = repos\n  .map(n => $`git clone https://github.com/google/${n} ${n}-clone`)\n\nconst results = await Promise.all(clones)\nconst errors = results.filter(o => !o.ok).map(o => o.stderr.trim())\nconsole.log('errors', errors.join('\\n'))\n\nfor (p of clones) {\n  await p.pipe`cat > ${p.pid}.txt`\n}\n```\n\n## Bash and Pwsh\nThere're many shell implementations. zx brings a few setup helpers:\n\n* [`useBash`](./api#usebash) switches to bash\n* [`usePowerShell`](./api#usepowershell) — PowerShell\n* [`usePwsh`](./api#usepwsh) — pwsh (PowerShell v7+)\n\nYou can also set the shell directly via [JS API](./setup#bash), [CLI flags](./cli#shell) or [envars](./cli#environment-variables):\n\n```js\n$.shell = '/bin/zsh'\n```\n\n```bash\nzx --shell /bin/zsh script.js\n```\n\n```bash\nZX_SHELL=/bin/zsh zx script.js\n```\n\n## zx = bash + js\nNo compromise, take the best of both.\n"
  },
  {
    "path": "docs/typescript.md",
    "content": "# TypeScript\n\nzx is written in TypeScript and provides the corresponding libdefs out of the box. Types are TS 4+ compatible. Write code in any suitable format `.ts`, `.mts`, `.cts` or add [a custom loader](./cli#non-standard-extension).\n\n```ts\n// script.ts\nimport { $ } from 'zx'\n\nconst list = await $`ls -la`\n```\n\nSome runtimes like [Bun](https://bun.sh/) or [Deno](https://deno.com/) have built-in TS support. Node.js requires additional setup. Configure your project according to the [ES modules contract](https://nodejs.org/api/packages.html#packages_type):\n\n- Set [`\"type\": \"module\"`](https://nodejs.org/api/packages.html#packages_type)\nin **package.json**\n- Set [`\"module\": \"ESNext\"`](https://www.typescriptlang.org/tsconfig/#module)\nin **tsconfig.json**.\n\nUsing TypeScript compiler is the most straightforward way, but native TS support from runtimes is gradually increasing.\n\n::: code-group\n\n```bash [node]\n# Since Node.js v22.6.0\nnode --experimental-strip-types script.js\n```\n\n```bash [npx]\n# Since Node.js v22.6.0\nNODE_OPTIONS=\"--experimental-strip-types\" zx script.js\n```\n\n```bash [tsc]\nnpm install typescript\n\ntsc script.ts\n\nnode script.js\n```\n\n```bash [ts-node]\nnpm install ts-node\n\nts-node script.ts\n# or via node loader\nnode --loader ts-node/esm script.ts\n```\n\n```bash [swc-node]\nnpm install swc-node\n\nswc-node script.ts\n```\n\n```bash [tsx]\nnpm install tsx\n\ntsx script.ts\n# or\nnode --import=tsx script.ts\n```\n\n```bash [bun]\nbun script.ts\n```\n\n```bash [deno]\ndeno run --allow-read --allow-sys --allow-env --allow-run script.ts\n```\n\n:::\n"
  },
  {
    "path": "docs/versions.md",
    "content": "# Versions\n\nzx is distributed in several versions, each with its own set of features.\n\n* `@latest` represents the stable full-featured version.\n* `@lite` separates the zx core from the extensions.\n* `@dev` brings experimental snapshots and RCs.\n\n| Feature           | latest | lite |\n|-------------------|--------|------|\n| **zx/globals**    | ✔️     | ️    |\n| **zx/cli**        | ✔️     |      |\n| `$`               | ✔️     | ✔️   |\n| `ProcessPromise`  | ✔️     | ✔️   |\n| `ProcessOutput`   | ✔️     | ✔️   |\n| `argv`            | ✔️     | ️    |\n| `cd`              | ✔️     | ✔️   |\n| `chalk`           | ✔️     | ✔️   |\n| `defaults`        | ✔️     | ✔️   |\n| `dotenv`          | ✔️     | ️    |\n| `echo`            | ✔️     | ️    |\n| `expBackoff`      | ✔️     | ️    |\n| `fetch`           | ✔️     | ️    |\n| `fs`              | ✔️     | ️    |\n| `glob`            | ✔️     | ️    |\n| `kill`            | ✔️     | ✔️   |\n| `log`             | ✔️     | ✔️   |\n| `minimist`        | ✔️     | ️    |\n| `nothrow`         | ✔️     | ️    |\n| `os`              | ✔️     | ✔️   |\n| `parseArgv`       | ✔️     | ️    |\n| `path`            | ✔️     | ✔️   |\n| `ps`              | ✔️     | ✔️   |\n| `question`        | ✔️     | ️    |\n| `quiet`           | ✔️     | ️    |\n| `quote`           | ✔️     | ✔️   |\n| `quotePowerShell` | ✔️     | ✔️   |\n| `resolveDefaults` | ✔️     | ✔️   |\n| `retry`           | ✔️     | ️    |\n| `sleep`           | ✔️     | ️    |\n| `spinner`         | ✔️     | ️    |\n| `syncProcessCwd`  | ✔️     | ✔️   |\n| `tempdir`         | ✔️     |      |\n| `tempfile`        | ✔️     |      |\n| `updateArgv`      | ✔️     |      |\n| `useBash`         | ✔️     | ✔️   |\n| `usePowerShell`   | ✔️     | ✔️   |\n| `usePwsh`         | ✔️     | ✔️   |\n| `version`         | ✔️     | ️    |\n| `which`           | ✔️     | ✔️   |\n| `within`          | ✔️     | ✔️   |\n| `YAML`            | ✔️     | ️    |\n| `MAML`            | ✔️     | ️    |\n"
  },
  {
    "path": "examples/background-process.mjs",
    "content": "#!/usr/bin/env zx\n\n// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     https://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nconst serve = $`npx serve`\n\nfor await (const chunk of serve.stdout) {\n  if (chunk.includes('Accepting connections')) break\n}\n\nawait $`curl http://localhost:3000`\n\nserve.kill('SIGINT')\n"
  },
  {
    "path": "examples/backup-github.mjs",
    "content": "#!/usr/bin/env zx\n\n// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     https://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nconst username = await question('What is your GitHub username? ')\nconst token = await question('Do you have GitHub token in env? ', {\n  choices: Object.keys(process.env),\n})\n\nlet headers = {}\nif (process.env[token]) {\n  headers = {\n    Authorization: `token ${process.env[token]}`,\n  }\n}\nlet res = await fetch(\n  `https://api.github.com/users/${username}/repos?per_page=1000`,\n  { headers }\n)\nconst data = await res.json()\nconst urls = data.map((x) =>\n  x.git_url.replace('git://github.com/', 'git@github.com:')\n)\n\nawait $`mkdir -p backups`\ncd('./backups')\n\nfor (const url of urls) {\n  await $`git clone ${url}`\n}\n"
  },
  {
    "path": "examples/fetch-weather.mjs",
    "content": "#!/usr/bin/env zx\n\n// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     https://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nasync function main() {\n  const argv = minimist(process.argv.slice(2), {\n    boolean: ['help'],\n    alias: { h: 'help' },\n  })\n\n  if (argv.help) {\n    echo(`\n${chalk.bold('Usage:')} zx fetch-weather.mjs [city name]\n\nFetches weather data using wttr.in with a neat two-column colored table format.\n\n${chalk.bold('Examples:')}\n  zx fetch-weather.mjs London\n  ./fetch-weather.mjs \"New York\"\n`)\n    process.exit(0)\n  }\n\n  const args = argv._.slice(__filename === process.argv[1] ? 0 : 1)\n  const city = args.join(' ')\n\n  if (!city) throw 'No city provided. Use -h for help.'\n\n  const svc_url = 'https://wttr.in'\n\n  const data = await spinner(\n    `📡 Fetching weather for \"${city}\" from ${svc_url}...`,\n    async () => {\n      try {\n        const res = await fetch(\n          `${svc_url}/${encodeURIComponent(city)}?format=j1`,\n          {\n            signal: AbortSignal.timeout(5000),\n          }\n        )\n        if (!res.ok) throw `API error: ${res.status} ${res.statusText}`\n        return res.json()\n      } catch (err) {\n        if (err.name === 'AbortError') {\n          throw 'Request timed out after 5 seconds.'\n        }\n        throw err\n      }\n    }\n  )\n\n  const area = data.nearest_area[0]\n  const current = data.current_condition[0]\n\n  if (!area || !current) {\n    throw '❌ Missing weather data in API response.'\n  }\n\n  const location = area.areaName[0].value\n  const condition = current.weatherDesc[0].value\n  const temperature = current.temp_C\n  const humidity = current.humidity\n\n  echo(chalk.yellow(`🌤️  Weather in ${location}: ${condition}`))\n  echo(chalk.red(`🌡️  Temperature: ${temperature}°C`))\n  echo(chalk.blue(`💧 Humidity: ${humidity}%`))\n}\n\nawait main().then(\n  () => process.exit(0),\n  (err) => {\n    const msg = typeof err === 'string' ? err : err.message\n    echo(chalk.red(`❌ ${msg}`))\n    process.exit(1)\n  }\n)\n\n// Here's how to add this script to your shell as a bash alias. This assumes you have zx installed globally.\n// 1. Save this script as `fetch-weather.mjs`.\n// 2. Add the following line to your .bashrc file, replacing the path with your own:\n// alias weather='zx /full/path/to/fetch-weather.mjs'\n// 3. Then reload your shell using the following command:\n// source ~/.bashrc\n// Now you can use the `weather` command to fetch weather data for any city.\n// Example usage: `weather London`\n"
  },
  {
    "path": "examples/hello.mjs",
    "content": "#!/usr/bin/env zx\n\n// Copyright 2026 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     https://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nawait $({ verbose: true })`echo \"Hello!\"`\n"
  },
  {
    "path": "examples/interactive.mjs",
    "content": "#!/usr/bin/env zx\n\n// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     https://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nconst p = $`npm init`.stdio('pipe')\n\nfor await (const chunk of p.stdout) {\n  if (chunk.includes('package name:')) p.stdin.write('test\\n')\n  if (chunk.includes('version:')) p.stdin.write('1.0.0\\n')\n  if (chunk.includes('description:')) p.stdin.write('My test package\\n')\n  if (chunk.includes('entry point:')) p.stdin.write('index.mjs\\n')\n  if (chunk.includes('test command:')) p.stdin.write('test.mjs\\n')\n  if (chunk.includes('git repository:')) p.stdin.write('my-org/repo\\n')\n  if (chunk.includes('keywords:')) p.stdin.write('foo, bar\\n')\n  if (chunk.includes('author:')) p.stdin.write('Anton Medvedev\\n')\n  if (chunk.includes('license:')) p.stdin.write('MIT\\n')\n  if (chunk.includes('Is this OK?')) p.stdin.write('yes\\n')\n}\n"
  },
  {
    "path": "examples/parallel.mjs",
    "content": "#!/usr/bin/env zx\n\n// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     https://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { spinner } from 'zx'\n\nconst tests = await glob('test/*.test.js')\nawait spinner('running tests', async () => {\n  try {\n    const res = await Promise.all(tests.map((file) => $`npx uvu . ${file}`))\n    res.forEach((r) => console.log(r.toString()))\n    console.log(chalk.bgGreen.black(' SUCCESS '))\n  } catch (e) {\n    console.log(e.toString())\n    process.exitCode = 1\n  }\n})\n"
  },
  {
    "path": "lefthook.yml",
    "content": "pre-commit:\n  parallel: true\n  commands:\n    format:\n      glob: '*.{js,ts,md,yml,yaml}'\n      run: npm run fmt && git add {staged_files}\n\ncommit-msg:\n  commands:\n    lint-commit-msg:\n      run: npx commitlint --edit\n\npre-push:\n  parallel: true\n  commands:\n    license:\n      run: npm run test:license\n    size:\n      run: npm run test:size\n    circular:\n      run: npm run test:circular\n"
  },
  {
    "path": "man/zx.1",
    "content": ".\\\" Manpage for zx.\n.TH man 8 \"06 Jul 2024\" \"8.x\" \"zx man page\"\n.SH NAME\nzx \\- the zx CLI\n.SH DESCRIPTION\nA tool for writing better scripts.\n.SH SYNOPSIS\n.SS zx\\fR [\\fIOPTIONS\\fR]  \\fIURI\\fR\n.SH OPTIONS\n.SS --cwd\nset current directory\n.SS --quiet\nsuppress any outputs\n.SS --verbose\nenables verbose mode\n.SS --shell=<path>\nset the shell to use\n.SS --prefix=<command>\nprefix all commands\n.SS --postfix=<command>\npostfix all commands\n.SS --prefer-local, -l\nprefer locally installed packages and binaries\n.SS --eval=<js>, -e\nevaluate script\n.SS --ext=<.mjs>\nscript extension\n.SS --install, -i\ninstall dependencies\n.SS --registry=<URL>\nnpm registry, defaults to https://registry.npmjs.org/\n.SS --repl\nstart repl\n.SS --env=<path>\npath to env file\n.SS --version, -v\nprint current zx version\n.SS --help, -h\nprint command help and options\n.SH EXAMPLES\n.TP\n.I zx --verbose script.js\n.TP\n.I zx https://example.com/script.js\n.TP\n.I zx -e '$`ls -l`'\n.SH BUGS\nhttps://github.com/google/zx/issues.\n.SH AUTHOR\nAnton Medvedev (https://medv.io/)"
  },
  {
    "path": "package.json",
    "content": "{\n  \"name\": \"zx\",\n  \"version\": \"8.9.0\",\n  \"description\": \"A tool for writing better scripts\",\n  \"type\": \"module\",\n  \"main\": \"./build/index.cjs\",\n  \"types\": \"./build/index.d.ts\",\n  \"typesVersions\": {\n    \"*\": {\n      \".\": [\n        \"./build/index.d.ts\"\n      ],\n      \"globals\": [\n        \"./build/globals.d.ts\"\n      ],\n      \"cli\": [\n        \"./build/cli.d.ts\"\n      ],\n      \"core\": [\n        \"./build/core.d.ts\"\n      ]\n    }\n  },\n  \"exports\": {\n    \".\": {\n      \"types\": \"./build/index.d.ts\",\n      \"import\": \"./build/index.js\",\n      \"require\": \"./build/index.cjs\",\n      \"default\": \"./build/index.js\"\n    },\n    \"./globals\": {\n      \"types\": \"./build/globals.d.ts\",\n      \"import\": \"./build/globals.js\",\n      \"require\": \"./build/globals.cjs\",\n      \"default\": \"./build/globals.js\"\n    },\n    \"./cli\": {\n      \"types\": \"./build/cli.d.ts\",\n      \"import\": \"./build/cli.js\",\n      \"require\": \"./build/cli.cjs\",\n      \"default\": \"./build/cli.js\"\n    },\n    \"./core\": {\n      \"types\": \"./build/core.d.ts\",\n      \"import\": \"./build/core.js\",\n      \"require\": \"./build/core.cjs\",\n      \"default\": \"./build/core.js\"\n    },\n    \"./package.json\": \"./package.json\"\n  },\n  \"bin\": {\n    \"zx\": \"build/cli.js\"\n  },\n  \"man\": \"./man/zx.1\",\n  \"files\": [\n    \"build/3rd-party-licenses\",\n    \"build/cli.js\",\n    \"build/core.js\",\n    \"build/deno.js\",\n    \"build/globals.js\",\n    \"build/index.js\",\n    \"build/*.cjs\",\n    \"build/*.d.ts\",\n    \"man\"\n  ],\n  \"engines\": {\n    \"node\": \">= 12.17.0\"\n  },\n  \"scripts\": {\n    \"fmt\": \"prettier --write .\",\n    \"fmt:check\": \"prettier --check .\",\n    \"prebuild\": \"rm -rf build\",\n    \"build\": \"npm run build:versions && npm run build:js && npm run build:dts && npm run build:tests\",\n    \"build:js\": \"node scripts/build-js.mjs --format=cjs --hybrid --entry='src/{cli,core,deps,globals,index,internals,util,vendor*}.ts' && npm run build:vendor\",\n    \"build:vendor\": \"node scripts/build-js.mjs --format=cjs --entry=src/vendor-*.ts --bundle=all --external='./internals.ts'\",\n    \"build:versions\": \"node scripts/build-versions.mjs\",\n    \"build:tests\": \"node scripts/build-tests.mjs\",\n    \"build:dts\": \"tsc --project tsconfig.json && node scripts/build-dts.mjs\",\n    \"build:dcr\": \"docker build -f ./dcr/Dockerfile . -t zx\",\n    \"build:jsr\": \"node scripts/build-jsr.mjs\",\n    \"build:lite\": \"node scripts/build-pkgjson-lite.mjs\",\n    \"build:pkgjson\": \"node scripts/build-pkgjson-main.mjs\",\n    \"build:manifest\": \"npm run build:pkgjson && npm run build:lite && npm run build:jsr\",\n    \"postbuild\": \"node scripts/build-clean.mjs && npm run build:manifest\",\n    \"docs:dev\": \"vitepress dev docs\",\n    \"docs:build\": \"vitepress build docs\",\n    \"docs:preview\": \"vitepress preview docs\",\n    \"pretest\": \"npm run build\",\n    \"test\": \"npm run test:size && npm run fmt:check && npm run test:unit && npm run test:types && npm run test:license\",\n    \"test:npm\": \"node ./test/it/build-npm.test.js\",\n    \"test:jsr\": \"node ./test/it/build-jsr.test.js\",\n    \"test:dcr\": \"node ./test/it/build-dcr.test.js\",\n    \"test:unit\": \"node --experimental-transform-types ./test/all.test.js\",\n    \"test:coverage\": \"c8 -c .nycrc --check-coverage npm run test:unit\",\n    \"test:circular\": \"madge --circular src/*\",\n    \"test:types\": \"tsd\",\n    \"test:license\": \"node ./test/extra.test.js\",\n    \"test:audit\": \"npm audit --package-lock\",\n    \"test:size\": \"size-limit\",\n    \"test:smoke:strip-types\": \"node --experimental-strip-types test/smoke/ts.test.ts\",\n    \"test:smoke:tsx\": \"tsx test/smoke/ts.test.ts\",\n    \"test:smoke:tsc\": \"cd test/smoke && mkdir -p node_modules && ln -s ../../../  ./node_modules/zx; ../../node_modules/typescript/bin/tsc -v && ../../node_modules/typescript/bin/tsc --project tsconfig.test.json && node ./temp/ts.test.js\",\n    \"test:smoke:ts-node\": \"cd test/smoke && node --loader ts-node/esm ts.test.ts\",\n    \"test:smoke:bun\": \"bun test ./test/smoke/bun.test.js && bun ./test/smoke/node.test.mjs\",\n    \"test:smoke:win32\": \"node ./test/smoke/win32.test.js\",\n    \"test:smoke:cjs\": \"node ./test/smoke/node.test.cjs\",\n    \"test:smoke:mjs\": \"node ./test/smoke/node.test.mjs\",\n    \"test:smoke:deno\": \"deno test ./test/smoke/deno.test.js --allow-read --allow-sys --allow-env --allow-run\",\n    \"test:workflow\": \"zizmor .github/workflows -v -p --min-severity=medium\"\n  },\n  \"devDependencies\": {\n    \"@commitlint/cli\": \"^20.4.2\",\n    \"@commitlint/config-conventional\": \"^20.4.2\",\n    \"@size-limit/file\": \"12.0.0\",\n    \"@types/fs-extra\": \"11.0.4\",\n    \"@types/minimist\": \"1.2.5\",\n    \"@types/node\": \"25.3.2\",\n    \"@types/which\": \"3.0.4\",\n    \"@webpod/ingrid\": \"1.1.1\",\n    \"@webpod/ps\": \"1.0.0\",\n    \"c8\": \"11.0.0\",\n    \"chalk\": \"5.6.2\",\n    \"create-require\": \"1.1.1\",\n    \"cronometro\": \"6.0.3\",\n    \"depseek\": \"0.4.3\",\n    \"dts-bundle-generator\": \"9.5.1\",\n    \"envapi\": \"0.2.3\",\n    \"esbuild\": \"0.27.3\",\n    \"esbuild-node-externals\": \"1.20.1\",\n    \"esbuild-plugin-entry-chunks\": \"0.1.17\",\n    \"esbuild-plugin-extract-helpers\": \"0.0.6\",\n    \"esbuild-plugin-hybrid-export\": \"0.3.1\",\n    \"esbuild-plugin-resolve\": \"2.0.0\",\n    \"esbuild-plugin-transform-hook\": \"0.2.0\",\n    \"esbuild-plugin-utils\": \"0.1.0\",\n    \"fs-extra\": \"11.3.3\",\n    \"get-port\": \"7.1.0\",\n    \"globby\": \"16.1.1\",\n    \"jsr\": \"0.14.3\",\n    \"lefthook\": \"2.1.1\",\n    \"madge\": \"8.0.0\",\n    \"maml.js\": \"^0.0.3\",\n    \"minimist\": \"1.2.8\",\n    \"node-fetch-native\": \"1.6.7\",\n    \"prettier\": \"3.8.1\",\n    \"size-limit\": \"12.0.0\",\n    \"ts-node\": \"10.9.2\",\n    \"tsd\": \"0.33.0\",\n    \"tsx\": \"4.21.0\",\n    \"typescript\": \"5.9.3\",\n    \"vitepress\": \"1.6.4\",\n    \"which\": \"6.0.1\",\n    \"yaml\": \"2.8.2\",\n    \"zurk\": \"0.11.10\"\n  },\n  \"overrides\": {\n    \"globby\": {\n      \"fast-glob\": \"3.3.3\"\n    },\n    \"tsx\": {\n      \"esbuild\": \"$esbuild\"\n    },\n    \"vite\": {\n      \"esbuild\": \"$esbuild\"\n    },\n    \"@webpod/ps\": {\n      \"zurk\": \"$zurk\"\n    }\n  },\n  \"publishConfig\": {\n    \"registry\": \"https://wombat-dressing-room.appspot.com\"\n  },\n  \"keywords\": [\n    \"bash\",\n    \"bin\",\n    \"binary\",\n    \"call\",\n    \"child\",\n    \"child_process\",\n    \"exec\",\n    \"execute\",\n    \"invoke\",\n    \"pipe\",\n    \"process\",\n    \"script\",\n    \"shell\",\n    \"spawn\",\n    \"zx\"\n  ],\n  \"prettier\": {\n    \"semi\": false,\n    \"singleQuote\": true,\n    \"endOfLine\": \"lf\",\n    \"trailingComma\": \"es5\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/google/zx.git\"\n  },\n  \"homepage\": \"https://google.github.io/zx/\",\n  \"author\": \"Anton Medvedev <anton@medv.io>\",\n  \"license\": \"Apache-2.0\",\n  \"volta\": {\n    \"node\": \"24.13.1\"\n  },\n  \"tsd\": {\n    \"compilerOptions\": {\n      \"rootDir\": \".\"\n    }\n  }\n}\n"
  },
  {
    "path": "scripts/build-clean.mjs",
    "content": "#!/usr/bin/env node\n\n// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     https://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport fs from 'node:fs'\nimport glob from 'fast-glob'\n\nconst redundants = await glob(\n  ['build/{repl,globals-jsr}.d.ts', 'build/{deps,internals,util,vendor*}.js'],\n  {\n    onlyFiles: true,\n    absolute: true,\n  }\n)\n\nfor (const file of redundants) {\n  fs.unlinkSync(file)\n}\n\nconsole.log('postbuild removed', redundants)\n"
  },
  {
    "path": "scripts/build-dts.mjs",
    "content": "#!/usr/bin/env node\n\n// Copyright 2024 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     https://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport fs from 'node:fs/promises'\nimport { generateDtsBundle } from 'dts-bundle-generator'\nimport glob from 'fast-glob'\n\nconst output = {\n  inlineDeclareExternals: true,\n  inlineDeclareGlobals: true,\n  sortNodes: false,\n  exportReferencedTypes: false, //args['export-referenced-types'],\n}\nconst entries = [\n  {\n    filePath: './src/vendor-extra.ts',\n    outFile: './build/vendor-extra.d.ts',\n    libraries: {\n      allowedTypesLibraries: ['node'], // args['external-types'],\n      inlinedLibraries: [\n        '@nodelib/fs.stat',\n        '@nodelib/fs.scandir',\n        '@nodelib/fs.walk',\n        'fast-glob',\n        '@types/jsonfile',\n        'node-fetch-native',\n        // 'chalk',\n        'globby',\n        '@types/minimist',\n        // '@types/which',\n        // 'zurk',\n        // '@webpod/ps',\n        '@webpod/ingrid',\n        'depseek',\n        'envapi',\n        'maml.js',\n      ], // args['external-inlines'],\n    },\n    output,\n  },\n  {\n    filePath: './src/vendor-core.ts',\n    outFile: './build/vendor-core.d.ts',\n    libraries: {\n      allowedTypesLibraries: ['node'], // args['external-types'],\n      inlinedLibraries: [\n        '@types/which',\n        '@webpod/ps',\n        '@webpod/ingrid',\n        'chalk',\n        'zurk',\n      ], // args['external-inlines'],\n    },\n    output,\n  },\n]\n\nconst compilationOptions = {\n  preferredConfigPath: './tsconfig.json', // args.project,\n  followSymlinks: true,\n}\n\nconst results = generateDtsBundle(entries, compilationOptions)\n  // generateDtsBundle cannot handle the circular refs on types inlining, so we need to help it manually:\n  /*\nbuild/vendor.d.ts(163,7): error TS2456: Type alias 'Options' circularly references itself.\nbuild/vendor.d.ts(164,7): error TS2456: Type alias 'Entry' circularly references itself.\nbuild/vendor.d.ts(165,7): error TS2456: Type alias 'Task' circularly references itself.\nbuild/vendor.d.ts(166,7): error TS2456: Type alias 'Pattern' circularly references itself.\nbuild/vendor.d.ts(167,7): error TS2456: Type alias 'FileSystemAdapter' circularly references itself.\nbuild/vendor.d.ts(197,48): error TS2694: Namespace 'FastGlob' has no exported member 'FastGlobOptions\n */\n\n  .map((r) =>\n    r\n      .replace('type Options = Options;', 'export {Options};')\n      .replace('type Task = Task;', 'export {Task};')\n      .replace('type Pattern = Pattern;', 'export {Pattern};')\n      .replace('FastGlob.FastGlobOptions', 'FastGlob.Options')\n      .replace('type Entry =', 'export type Entry =')\n  )\n\nfor (const i in results) {\n  const entry = entries[i]\n  const result = results[i]\n\n  await fs.writeFile(entry.outFile, result, 'utf8')\n}\n\n// Properly formats triple-slash directives\nconst pkgEntries = ['core', 'index', 'vendor']\nconst prefix = `/// <reference types=\"node\" />\n/// <reference types=\"fs-extra\" />\n\n`\n\nfor (const dts of await glob(['build/**/*.d.ts', '!build/vendor-*.d.ts'])) {\n  const contents =\n    (pkgEntries.some((e) => dts.includes(e)) ? prefix : '') +\n    (await fs.readFile(dts, 'utf8'))\n      .replaceAll(\".ts';\", \".js';\")\n      .split('\\n')\n      .filter((line) => !line.startsWith('/// <reference types'))\n      .join('\\n')\n\n  await fs.writeFile(dts, contents, 'utf8')\n}\n\nprocess.exit(0)\n"
  },
  {
    "path": "scripts/build-js.mjs",
    "content": "#!/usr/bin/env node\n\n// Copyright 2024 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     https://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport path from 'node:path'\nimport fs from 'node:fs'\nimport esbuild from 'esbuild'\nimport { injectCode, injectFile } from 'esbuild-plugin-utils'\nimport { nodeExternalsPlugin } from 'esbuild-node-externals'\nimport { entryChunksPlugin } from 'esbuild-plugin-entry-chunks'\nimport { hybridExportPlugin } from 'esbuild-plugin-hybrid-export'\nimport { transformHookPlugin } from 'esbuild-plugin-transform-hook'\nimport { extractHelpersPlugin } from 'esbuild-plugin-extract-helpers'\nimport esbuildResolvePlugin from 'esbuild-plugin-resolve'\nimport minimist from 'minimist'\nimport glob from 'fast-glob'\n\nconst __dirname = path.dirname(new URL(import.meta.url).pathname)\n\nconst argv = minimist(process.argv.slice(2), {\n  default: {\n    entry: './src/index.ts',\n    external: 'node:*',\n    bundle: 'src', // 'all' | 'none'\n    license: 'none', // see digestLicenses below // 'eof',\n    minify: false,\n    sourcemap: false,\n    format: 'cjs,esm',\n    target: 'node12',\n    cwd: process.cwd(),\n  },\n  boolean: ['minify', 'sourcemap', 'hybrid'],\n  string: ['entry', 'external', 'bundle', 'license', 'format', 'map', 'cwd'],\n})\nconst {\n  entry,\n  external,\n  bundle,\n  minify,\n  sourcemap,\n  license,\n  format,\n  hybrid,\n  cwd: _cwd,\n} = argv\n\nconst formats = format.split(',')\nconst cwd = [_cwd].flat().pop()\nconst entries = entry.split(/:\\s?/)\nconst entryPoints =\n  entry.includes('*') || entry.includes('{')\n    ? await glob(entries, { absolute: false, onlyFiles: true, cwd, root: cwd })\n    : entries.map((p) => path.relative(cwd, path.resolve(cwd, p)))\nconst _bundle = bundle && bundle !== 'none'\nconst _external = ['zx/globals', ...(_bundle ? external.split(',') : [])] // https://github.com/evanw/esbuild/issues/1466\n\nconst plugins = [\n  esbuildResolvePlugin({\n    yaml: path.resolve(__dirname, '../node_modules/yaml/browser'),\n  }),\n]\n\nconst thirdPartyModules = new Set()\n\nif (_bundle && entryPoints.length > 1) {\n  plugins.push(entryChunksPlugin())\n}\n\nif (bundle === 'src') {\n  // https://github.com/evanw/esbuild/issues/619\n  // https://github.com/pradel/esbuild-node-externals/pull/52\n  plugins.push(nodeExternalsPlugin())\n}\n\nif (hybrid) {\n  plugins.push(\n    hybridExportPlugin({\n      loader: 'reexport',\n      to: 'build',\n      toExt: '.js',\n    })\n  )\n}\n\nplugins.push(\n  {\n    name: 'get-3rd-party-modules',\n    setup: (build) => {\n      build.onResolve({ filter: /./, namespace: 'file' }, async (args) => {\n        thirdPartyModules.add(args.resolveDir)\n      })\n    },\n  },\n  transformHookPlugin({\n    hooks: [\n      {\n        on: 'end',\n        if: !hybrid,\n        pattern: /\\.js$/,\n        transform(contents, file) {\n          const { name } = path.parse(file)\n          const _contents = contents\n            .toString()\n            .replace(\n              '} = __module__',\n              `} = globalThis.Deno ? globalThis.require(\"./${name}.cjs\") : __module__`\n            )\n          return injectCode(_contents, `import \"./deno.js\"`)\n        },\n      },\n      {\n        on: 'end',\n        if: !hybrid,\n        pattern: /cli\\.js$/,\n        transform(contents) {\n          return `${contents}autorun(import.meta)\n`\n        },\n      },\n      {\n        on: 'end',\n        pattern: entryPointsToRegexp(entryPoints),\n        transform(contents) {\n          const extras = [\n            // https://github.com/evanw/esbuild/issues/1633\n            contents.includes('import_meta')\n              ? './scripts/import-meta-url.polyfill.js'\n              : '',\n\n            //https://github.com/evanw/esbuild/issues/1921\n            // p.includes('vendor') ? './scripts/require.polyfill.js' : '',\n          ].filter(Boolean)\n          return injectFile(contents, ...extras)\n        },\n      },\n      {\n        on: 'end',\n        pattern: entryPointsToRegexp(entryPoints),\n        transform(contents) {\n          return contents\n            .toString()\n            .replaceAll('import.meta.url', 'import_meta_url')\n            .replaceAll('import_meta.url', 'import_meta_url')\n            .replaceAll('\"node:', '\"')\n            .replaceAll(\n              'require(\"stream/promises\")',\n              'require(\"stream\").promises'\n            )\n            .replaceAll('require(\"fs/promises\")', 'require(\"fs\").promises')\n            .replaceAll('}).prototype', '}).prototype || {}')\n            .replace(/DISABLE_NODE_FETCH_NATIVE_WARN/, ($0) => `${$0} || true`)\n            .replace(\n              /\\/\\/ Annotate the CommonJS export names for ESM import in node:/,\n              ($0) => `/* c8 ignore next 100 */\\n${$0}`\n            )\n            .replace(\n              'yield import(\"zx/globals\")',\n              'yield require(\"./globals.cjs\")'\n            )\n            .replace('require(\"./internals.ts\")', 'require(\"./internals.cjs\")')\n        },\n      },\n    ],\n  }),\n  extractHelpersPlugin({\n    cwd: 'build',\n    include: /\\.cjs/,\n  }),\n  {\n    name: 'deno',\n    setup(build) {\n      build.onEnd(() => {\n        fs.copyFileSync('./scripts/deno.polyfill.js', './build/deno.js')\n        fs.writeFileSync(\n          './build/3rd-party-licenses',\n          digestLicenses(thirdPartyModules)\n        )\n      })\n    },\n  }\n)\n\n// prettier-ignore\nfunction digestLicenses(dirs) {\n  const digest = [...[...dirs]\n    .reduce((m, d) => {\n      const chunks = d.split('/')\n      const i = chunks.lastIndexOf('node_modules')\n      const name = chunks[i + 1]\n      const shift = i + 1 + (name.startsWith('@') ? 2 : 1)\n      const root = chunks.slice(0, shift).join('/')\n      m.add(root)\n      return m\n    }, new Set())]\n    .map(d => {\n      const extractName = (entry) => entry?.name ? `${entry.name} <${entry.email}>` : entry\n      const pkg = path.join(d, 'package.json')\n      const pkgJson = JSON.parse(fs.readFileSync(pkg, 'utf-8'))\n      const author = extractName(pkgJson.author)\n      const contributors = (pkgJson.contributors || pkgJson.maintainers || []).map(extractName).join(', ')\n      const by = author || contributors || '<unknown>'\n      const repository = pkgJson.repository?.url || pkgJson.repository || ''\n      const license = pkgJson.license || '<unknown>'\n\n      if (pkgJson.name === 'zx') return\n\n      return `${pkgJson.name}@${pkgJson.version}\n  ${by}\n  ${repository}\n  ${license}`\n    })\n    .filter(Boolean)\n    .sort()\n    .join('\\n\\n')\n\n  return `THIRD PARTY LICENSES\n\n${digest}\n`\n}\n\nfunction entryPointsToRegexp(entryPoints) {\n  return new RegExp(\n    '(' +\n      entryPoints.map((e) => escapeRegExp(path.parse(e).name)).join('|') +\n      ')\\\\.cjs$'\n  )\n}\n\nfunction escapeRegExp(str) {\n  return str.replace(/[/\\-\\\\^$*+?.()|[\\]{}]/g, '\\\\$&')\n}\n\nconst esmConfig = {\n  absWorkingDir: cwd,\n  entryPoints,\n  outdir: './build',\n  bundle: _bundle,\n  external: _external,\n  minify,\n  sourcemap,\n  sourcesContent: false,\n  platform: 'node',\n  target: 'esnext',\n  format: 'esm',\n  outExtension: {\n    '.js': '.mjs',\n  },\n  plugins,\n  legalComments: license,\n  tsconfig: './tsconfig.json',\n}\n\nconst cjsConfig = {\n  ...esmConfig,\n  outdir: './build',\n  target: 'es6',\n  format: 'cjs',\n  outExtension: {\n    '.js': '.cjs',\n  },\n}\n\nfor (const format of formats) {\n  const config = format === 'cjs' ? cjsConfig : esmConfig\n  console.log('esbuild config:', config)\n\n  await esbuild.build(config).catch(() => process.exit(1))\n}\n\nprocess.exit(0)\n"
  },
  {
    "path": "scripts/build-jsr.mjs",
    "content": "// Copyright 2024 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     https://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport fs from 'node:fs'\nimport path from 'node:path'\nconst __dirname = path.dirname(new URL(import.meta.url).pathname)\nconst root = path.resolve(__dirname, '..')\nconst pkgJson = JSON.parse(\n  fs.readFileSync(path.resolve(root, 'package.json'), 'utf-8')\n)\nconst deps = pkgJson.devDependencies\n\nconst jsrDeps = {\n  yaml: 'jsr:@eemeli/yaml',\n  zurk: 'jsr:@webpod/zurk',\n}\nconst prodDeps = new Set([\n  '@types/fs-extra',\n  '@types/minimist',\n  '@types/node',\n  '@types/which',\n  '@webpod/ingrid',\n  '@webpod/ps',\n  'chalk',\n  'create-require',\n  'depseek',\n  'envapi',\n  'fs-extra',\n  'globby',\n  'minimist',\n  'node-fetch-native',\n  'which',\n  'yaml',\n  'zurk',\n])\n\nfs.writeFileSync(\n  path.resolve(root, 'jsr.json'),\n  JSON.stringify(\n    {\n      name: '@webpod/zx',\n      version: pkgJson.version,\n      license: pkgJson.license,\n      exports: {\n        '.': './src/index.ts',\n        './core': './src/core.ts',\n        './cli': './src/cli.ts',\n        './globals': './src/globals-jsr.ts',\n      },\n      publish: {\n        include: ['src', 'README.md', 'LICENSE'],\n        exclude: ['src/globals.ts'],\n      },\n      nodeModulesDir: 'auto',\n      imports: Object.entries(deps).reduce(\n        (m, [k, v]) => {\n          if (prodDeps.has(k)) {\n            const name = jsrDeps[k] || `npm:${k}`\n            m[k] = `${name}@${v}`\n          }\n          return m\n        },\n        {\n          'zurk/spawn': `jsr:@webpod/zurk@${deps.zurk}`,\n          'zx/globals': './src/globals-jsr.ts',\n        }\n      ),\n    },\n    null,\n    2\n  )\n)\n\nconsole.log('jsr.json prepared for JSR')\n"
  },
  {
    "path": "scripts/build-pkgjson-lite.mjs",
    "content": "// Copyright 2024 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     https://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n// Prepares a lite (core) version of zx to publish\n\nimport fs from 'node:fs'\nimport path from 'node:path'\nimport { depseekSync } from 'depseek'\n\nconst __dirname = path.dirname(new URL(import.meta.url).pathname)\nconst root = path.resolve(__dirname, '..')\nconst source = 'package.json'\nconst dest = 'package-lite.json'\nconst _pkgJson = JSON.parse(fs.readFileSync(path.join(root, source), 'utf-8'))\n\nconst files = new Set()\nconst entries = new Set(['./core.js', './3rd-party-licenses'])\n\nfor (const entry of entries) {\n  if (!fs.existsSync(path.join(root, 'build', entry))) continue\n\n  files.add(entry)\n  const contents = fs.readFileSync(path.join(root, 'build', entry), 'utf-8')\n  const deps = depseekSync(contents)\n  for (const { value: file } of deps) {\n    if (file.startsWith('.')) {\n      entries.add(file)\n      entries.add(file.replace(/\\.c?js$/, '.d.ts'))\n    }\n  }\n}\n\nconst whitelist = new Set([\n  'name',\n  'version',\n  'description',\n  'type',\n  'main',\n  'types',\n  'typesVersions',\n  'exports',\n  'files',\n  'engines',\n  'optionalDependencies',\n  'publishConfig',\n  'keywords',\n  'repository',\n  'homepage',\n  'author',\n  'license',\n])\n\nconst __pkgJson = Object.fromEntries(\n  Object.entries(_pkgJson).filter(([k]) => whitelist.has(k))\n)\n\nconst pkgJson = {\n  ...__pkgJson,\n  version: _pkgJson.version + '-lite',\n  exports: {\n    '.': {\n      types: './build/core.d.ts',\n      import: './build/core.js',\n      require: './build/core.cjs',\n      default: './build/core.js',\n    },\n    './package.json': './package.json',\n  },\n  main: './build/core.cjs',\n  types: './build/core.d.ts',\n  typesVersions: {\n    '*': {\n      '.': ['./build/core.d.ts'],\n    },\n  },\n  files: [...files].map((f) => path.join('build', f)).sort(),\n}\n\nfs.writeFileSync(path.resolve(root, dest), JSON.stringify(pkgJson, null, 2))\n\nconsole.log(`${dest} prepared for npm`)\n"
  },
  {
    "path": "scripts/build-pkgjson-main.mjs",
    "content": "// Copyright 2024 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     https://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n// Optimizes package.json for npm publishing\n\nimport fs from 'node:fs'\nimport path from 'node:path'\n\nconst __dirname = path.dirname(new URL(import.meta.url).pathname)\nconst root = path.resolve(__dirname, '..')\nconst source = 'package.json'\nconst dest = 'package-main.json'\nconst _pkgJson = JSON.parse(fs.readFileSync(path.join(root, source), 'utf-8'))\n\nconst whitelist = new Set([\n  'name',\n  'version',\n  'description',\n  'type',\n  'main',\n  'types',\n  'typesVersions',\n  'exports',\n  'bin',\n  'man',\n  'files',\n  'engines',\n  'optionalDependencies',\n  'publishConfig',\n  'keywords',\n  'repository',\n  'homepage',\n  'author',\n  'license',\n])\n\nconst pkgJson = Object.fromEntries(\n  Object.entries(_pkgJson).filter(([k]) => whitelist.has(k))\n)\n\nfs.writeFileSync(path.resolve(root, dest), JSON.stringify(pkgJson, null, 2))\n\nconsole.log(`${dest} prepared for npm`)\n"
  },
  {
    "path": "scripts/build-tests.mjs",
    "content": "#!/usr/bin/env node\n\n// Copyright 2024 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     https://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport fs from 'node:fs'\nimport path from 'node:path'\nimport * as core from '../build/core.js'\nimport * as cli from '../build/cli.js'\nimport * as index from '../build/index.js'\n\n// prettier-ignore\nconst modules = [\n  ['core', core],\n  ['cli', cli],\n  ['index', index],\n]\nconst root = path.resolve(new URL(import.meta.url).pathname, '../..')\nconst filePath = path.resolve(root, `test/export.test.js`)\n\nconst copyright = fs.readFileSync(\n  path.resolve(root, 'test/fixtures/copyright.txt'),\n  'utf8'\n)\n\nlet head = `${copyright.replace('YEAR', new Date().getFullYear())}\nimport assert from 'node:assert'\nimport { test, describe } from 'node:test'`\nlet body = '\\n'\n\nfor (const [name, ref, apis = Object.keys(ref).sort()] of modules) {\n  head += `\\nimport * as ${name} from '../build/${name}.cjs'`\n  body += `\\n//prettier-ignore\\ndescribe('${name}', () => {\\n`\n  body += `  test('exports', () => {\\n`\n  for (const r of apis) {\n    const api = ref[r]\n    body += `    assert.equal(typeof ${name}.${r}, '${typeof api}', '${name}.${r}')\\n`\n    if (typeof api !== 'function' && typeof api !== 'object') continue\n    for (const k of Object.keys(api).sort()) {\n      const v = api[k]\n      body += `    assert.equal(typeof ${name}.${r}.${k}, '${typeof v}', '${name}.${r}.${k}')\\n`\n    }\n  }\n  body += '  })\\n'\n  body += '})\\n'\n}\n\nconst contents = head + body\n\nfs.writeFileSync(filePath, contents)\n"
  },
  {
    "path": "scripts/build-versions.mjs",
    "content": "#!/usr/bin/env node\n\n// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     https://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport fs from 'fs-extra'\nimport path from 'node:path'\nimport minimist from 'minimist'\n\nconst root = path.resolve(new URL(import.meta.url).pathname, '../..')\nconst copyright = fs.readFileSync(\n  path.resolve(root, 'test/fixtures/copyright.txt'),\n  'utf8'\n)\nconst license = copyright.replace('YEAR', new Date().getFullYear())\nconst deps = [\n  'chalk',\n  'depseek',\n  'dotenv',\n  'fetch',\n  'fs',\n  'glob',\n  'minimist',\n  'ps',\n  'which',\n  'yaml',\n]\nconst namemap = {\n  dotenv: 'envapi',\n  fs: 'fs-extra',\n  fetch: 'node-fetch-native',\n  glob: 'globby',\n  ps: '@webpod/ps',\n}\nconst versions = deps.reduce(\n  (m, name) => {\n    m[name] = fs.readJsonSync(\n      path.resolve(root, 'node_modules', namemap[name] || name, 'package.json')\n    ).version\n    return m\n  },\n  {\n    zx: fs.readJsonSync(path.join(root, 'package.json')).version,\n  }\n)\n\nconst argv = minimist(process.argv.slice(2), {\n  default: versions,\n  string: ['zx', ...deps],\n})\n\ndelete argv._\n\nconst list = JSON.stringify(argv, null, 2)\n  .replaceAll('  \"', '  ')\n  .replaceAll('\": ', ': ')\n  .replaceAll('\"', \"'\")\n  .replace(/\\n}$/, ',\\n}')\n\nconst versionsTs = `${license}\nexport const versions: Record<string, string> = ${list}\n`\nconst versionsCjs = `${license}\nmodule.exports = { versions: ${list}\n`\n\nfs.writeFileSync(path.join(root, 'src/versions.ts'), versionsTs, 'utf8')\n// fs.writeFileSync(path.join(root, 'build/versions.cjs'), versionsCjs, 'utf8')\n"
  },
  {
    "path": "scripts/deno.polyfill.js",
    "content": "import { createRequire } from 'node:module'\nimport * as process from 'node:process'\n\n// prettier-ignore\nif (globalThis.Deno) {\n  globalThis.require = createRequire(import.meta.url)\n  globalThis.__filename = new URL(import.meta.url).pathname\n  globalThis.__dirname = new URL('.', import.meta.url).pathname\n  globalThis.module = new Proxy({}, { set() { return true } })\n\n  const p = globalThis.process = globalThis.process || process\n  p.version || (p.version = 'v18.0.0')\n  p.version || (p.version = { node: '18.0.0' })\n  p.env || (p.env = globalThis.Deno.env.toObject())\n  p.argv || (p.argv = [globalThis.Deno.execPath(), globalThis.Deno.mainModule.replace('file://', ''), ...globalThis.Deno.args])\n}\n"
  },
  {
    "path": "scripts/import-meta-url.polyfill.js",
    "content": "const import_meta_url =\n  typeof document === 'undefined'\n    ? new (require('url').URL)('file:' + __filename).href\n    : (document.currentScript && document.currentScript.src) ||\n      new URL('main.js', document.baseURI).href\n"
  },
  {
    "path": "src/cli.ts",
    "content": "#!/usr/bin/env node\n\n// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     https://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport url from 'node:url'\nimport process from 'node:process'\nimport {\n  $,\n  ProcessOutput,\n  parseArgv,\n  updateArgv,\n  resolveDefaults,\n  chalk,\n  dotenv,\n  fetch,\n  fs,\n  path,\n  stdin,\n  VERSION,\n  Fail,\n} from './index.ts'\nimport { installDeps, parseDeps } from './deps.ts'\nimport { startRepl } from './repl.ts'\nimport { randomId } from './util.ts'\nimport { transformMarkdown } from './md.ts'\nimport { createRequire, type minimist } from './vendor.ts'\n\nexport { transformMarkdown } from './md.ts'\n\nconst EXT = '.mjs'\nconst EXT_RE = /^\\.[mc]?[jt]sx?$/\n\n// prettier-ignore\nexport const argv: minimist.ParsedArgs = parseArgv(process.argv.slice(2), {\n  default: resolveDefaults({ ['prefer-local']: false } as any, 'ZX_', process.env, new Set(['env', 'install', 'registry'])),\n  // exclude 'prefer-local' to let minimist infer the type\n  string: ['shell', 'prefix', 'postfix', 'eval', 'cwd', 'ext', 'registry', 'env'],\n  boolean: ['version', 'help', 'quiet', 'verbose', 'install', 'repl', 'experimental'],\n  alias: { e: 'eval', i: 'install', v: 'version', h: 'help', l: 'prefer-local', 'env-file': 'env' },\n  stopEarly: true,\n  parseBoolean: true,\n  camelCase: true,\n})\n\nautorun(import.meta)\n\nexport function autorun(meta: ImportMeta): void {\n  if (meta && isMain(meta))\n    main().catch((err) => {\n      if (err instanceof ProcessOutput) {\n        console.error('Error:', err.message)\n      } else {\n        console.error(err)\n      }\n\n      process.exitCode = 1\n    })\n}\n\nexport function printUsage() {\n  // language=txt\n  console.log(`\n ${chalk.bold('zx ' + VERSION)}\n   A tool for writing better scripts\n\n ${chalk.bold('Usage')}\n   zx [options] <script>\n\n ${chalk.bold('Options')}\n   --quiet              suppress any outputs\n   --verbose            enable verbose mode\n   --shell=<path>       custom shell binary\n   --prefix=<command>   prefix all commands\n   --postfix=<command>  postfix all commands\n   --prefer-local, -l   prefer locally installed packages and binaries\n   --cwd=<path>         set current directory\n   --eval=<js>, -e      evaluate script\n   --ext=<.mjs>         script extension\n   --install, -i        install dependencies\n   --registry=<URL>     npm registry, defaults to https://registry.npmjs.org/\n   --version, -v        print current zx version\n   --help, -h           print help\n   --repl               start repl\n   --env=<path>         path to env file\n   --experimental       enables experimental features (deprecated)\n\n ${chalk.italic('Full documentation:')} ${chalk.underline(Fail.DOCS_URL)}\n`)\n}\n\nexport async function main(): Promise<void> {\n  if (argv.version) {\n    console.log(VERSION)\n    return\n  }\n  if (argv.help) {\n    printUsage()\n    return\n  }\n  if (argv.cwd) $.cwd = argv.cwd\n  if (argv.env) {\n    const envfile = path.resolve($.cwd ?? process.cwd(), argv.env)\n    dotenv.config(envfile)\n    resolveDefaults()\n  }\n  if (argv.verbose) $.verbose = true\n  if (argv.quiet) $.quiet = true\n  if (argv.shell) $.shell = argv.shell\n  if (argv.prefix) $.prefix = argv.prefix\n  if (argv.postfix) $.postfix = argv.postfix\n  if (argv.preferLocal) $.preferLocal = argv.preferLocal\n\n  await import('zx/globals')\n  if (argv.repl) {\n    await startRepl()\n    return\n  }\n  argv.ext = normalizeExt(argv.ext)\n\n  const { script, scriptPath, tempPath } = await readScript()\n  await runScript(script, scriptPath, tempPath)\n}\n\nconst rmrf = (p: string) => {\n  if (!p) return\n\n  lstat(p)?.isSymbolicLink()\n    ? fs.unlinkSync(p)\n    : fs.rmSync(p, { force: true, recursive: true })\n}\nasync function runScript(\n  script: string,\n  scriptPath: string,\n  tempPath: string\n): Promise<void> {\n  let nmLink = ''\n  const rmTemp = () => {\n    rmrf(tempPath)\n    rmrf(nmLink)\n  }\n  try {\n    if (tempPath) {\n      scriptPath = tempPath\n      await fs.writeFile(tempPath, script)\n    }\n    const cwd = path.dirname(scriptPath)\n    if (typeof argv.preferLocal === 'string') {\n      nmLink = linkNodeModules(cwd, argv.preferLocal)\n    }\n    if (argv.install) {\n      await installDeps(parseDeps(script), cwd, argv.registry)\n    }\n\n    injectGlobalRequire(scriptPath)\n    process.once('exit', rmTemp)\n\n    // TODO: fix unanalyzable-dynamic-import to work correctly with jsr.io\n    await import(url.pathToFileURL(scriptPath).toString())\n  } finally {\n    rmTemp()\n  }\n}\n\nfunction linkNodeModules(cwd: string, external: string): string {\n  const nm = 'node_modules'\n  const alias = path.resolve(cwd, nm)\n  const target =\n    path.basename(external) === nm\n      ? path.resolve(external)\n      : path.resolve(external, nm)\n  const aliasStat = lstat(alias)\n  const targetStat = lstat(target)\n\n  if (!targetStat?.isDirectory())\n    throw new Fail(\n      `Can't link node_modules: ${target} doesn't exist or is not a directory`\n    )\n  if (aliasStat?.isDirectory() && alias !== target)\n    throw new Fail(`Can't link node_modules: ${alias} already exists`)\n  if (aliasStat) return ''\n\n  fs.symlinkSync(target, alias, 'junction')\n  return alias\n}\n\nfunction lstat(p: string) {\n  try {\n    return fs.lstatSync(p)\n  } catch {}\n}\n\nasync function readScript() {\n  const [firstArg] = argv._\n  let script = ''\n  let scriptPath = ''\n  let tempPath = ''\n  let argSlice = 1\n\n  if (argv.eval) {\n    argSlice = 0\n    script = argv.eval\n    tempPath = getFilepath($.cwd, 'zx', argv.ext)\n  } else if (!firstArg || firstArg === '-') {\n    script = await readScriptFromStdin()\n    tempPath = getFilepath($.cwd, 'zx', argv.ext)\n    if (script.length === 0) {\n      printUsage()\n      process.exitCode = 1\n      throw new Fail('No script provided')\n    }\n  } else if (/^https?:/.test(firstArg)) {\n    const { name, ext = argv.ext } = path.parse(new URL(firstArg).pathname)\n    script = await readScriptFromHttp(firstArg)\n    tempPath = getFilepath($.cwd, name, ext)\n  } else {\n    script = await fs.readFile(firstArg, 'utf8')\n    scriptPath = firstArg.startsWith('file:')\n      ? url.fileURLToPath(firstArg)\n      : path.resolve(firstArg)\n  }\n\n  const { ext, base, dir } = path.parse(tempPath || scriptPath)\n  if (ext === '' || (argv.ext && !EXT_RE.test(ext))) {\n    tempPath = getFilepath(dir, base)\n  }\n  if (ext === '.md') {\n    script = transformMarkdown(script)\n    tempPath = getFilepath(dir, base, EXT)\n  }\n  if (argSlice) updateArgv(argv._.slice(argSlice))\n\n  return { script, scriptPath, tempPath }\n}\n\nasync function readScriptFromStdin(): Promise<string> {\n  return process.stdin.isTTY ? '' : stdin()\n}\n\nasync function readScriptFromHttp(remote: string): Promise<string> {\n  const res = await fetch(remote)\n  if (!res.ok) {\n    console.error(`Error: Can't get ${remote}`)\n    process.exitCode = 1\n    throw new Fail(`Failed to fetch remote script: ${remote} (${res.status})`)\n  }\n  return res.text()\n}\n\nexport function injectGlobalRequire(origin: string): void {\n  const __filename = path.resolve(origin)\n  const __dirname = path.dirname(__filename)\n  const require = createRequire(origin)\n  Object.assign(globalThis, { __filename, __dirname, require })\n}\n\nexport function isMain(\n  meta: ImportMeta['url'] | ImportMeta = import.meta.url,\n  scriptpath: string = process.argv[1]\n): boolean {\n  if (typeof meta === 'string') {\n    if (meta.startsWith('file:')) {\n      const modulePath = url.fileURLToPath(meta).replace(/\\.\\w+$/, '')\n      const mainPath = fs.realpathSync(scriptpath).replace(/\\.\\w+$/, '')\n      return mainPath === modulePath\n    }\n\n    return false\n  }\n\n  return !!meta.main\n}\n\nexport function normalizeExt(ext?: string): string | undefined {\n  return ext ? path.parse(`foo.${ext}`).ext : ext\n}\n\n// prettier-ignore\nfunction getFilepath(cwd = '.', name = 'zx', _ext?: string): string {\n  const ext = _ext || argv.ext || EXT\n  return [\n    name + ext,\n    name + '-' + randomId() + ext,\n  ]\n    .map(f => path.resolve(process.cwd(), cwd, f))\n    .find(f => !fs.existsSync(f))!\n}\n"
  },
  {
    "path": "src/core.ts",
    "content": "// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     https://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { type AsyncHook, AsyncLocalStorage, createHook } from 'node:async_hooks'\nimport { type BlobPart, Buffer } from 'node:buffer'\nimport cp, {\n  type ChildProcess,\n  type IOType,\n  type StdioOptions,\n} from 'node:child_process'\nimport { type Encoding } from 'node:crypto'\nimport { EventEmitter } from 'node:events'\nimport fs from 'node:fs'\nimport { EOL as _EOL } from 'node:os'\nimport process from 'node:process'\nimport { type Readable, type Writable } from 'node:stream'\nimport { inspect } from 'node:util'\n\nimport { Fail } from './error.ts'\nimport { log } from './log.ts'\nimport {\n  exec,\n  buildCmd,\n  chalk,\n  which,\n  ps,\n  VoidStream,\n  type TSpawnStore,\n} from './vendor-core.ts'\nimport {\n  type Duration,\n  isString,\n  isStringLiteral,\n  iteratorToArray,\n  getLast,\n  getLines,\n  noop,\n  once,\n  parseBool,\n  parseDuration,\n  preferLocalBin,\n  proxyOverride,\n  quote,\n  quotePowerShell,\n  toCamelCase,\n  randomId,\n  bufArrJoin,\n} from './util.ts'\n\nexport { bus } from './internals.ts'\nexport { default as path } from 'node:path'\nexport * as os from 'node:os'\nexport { Fail } from './error.ts'\nexport { log, type LogEntry } from './log.ts'\nexport { chalk, which, ps } from './vendor-core.ts'\nexport { type Duration, quote, quotePowerShell } from './util.ts'\n\nconst CWD = Symbol('processCwd')\nconst SYNC = Symbol('syncExec')\nconst EPF = Symbol('end-piped-from')\nconst SHOT = Symbol('snapshot')\nconst EOL = Buffer.from(_EOL)\nconst BR_CC = '\\n'.charCodeAt(0)\nconst DLMTR = /\\r?\\n/\nconst SIGTERM = 'SIGTERM'\nconst ENV_PREFIX = 'ZX_'\nconst ENV_OPTS: Set<string> = new Set([\n  'cwd',\n  'preferLocal',\n  'detached',\n  'verbose',\n  'quiet',\n  'timeout',\n  'timeoutSignal',\n  'killSignal',\n  'prefix',\n  'postfix',\n  'shell',\n])\n\n// prettier-ignore\nexport interface Options {\n  [CWD]:          string\n  [SYNC]:         boolean\n  cwd?:           string\n  ac?:            AbortController\n  signal?:        AbortSignal\n  input?:         string | Buffer | Readable | ProcessOutput | ProcessPromise\n  timeout?:       Duration\n  timeoutSignal?: NodeJS.Signals\n  stdio:          StdioOptions\n  verbose:        boolean\n  sync:           boolean\n  env:            NodeJS.ProcessEnv\n  shell:          string | true\n  nothrow:        boolean\n  prefix?:        string\n  postfix?:       string\n  quote?:         typeof quote\n  quiet:          boolean\n  detached:       boolean\n  preferLocal:    boolean | string | string[]\n  spawn:          typeof cp.spawn\n  spawnSync:      typeof cp.spawnSync\n  store?:         TSpawnStore\n  log:            typeof log\n  kill:           typeof kill\n  killSignal?:    NodeJS.Signals\n  halt?:          boolean\n  delimiter?:     string | RegExp\n}\n\n// prettier-ignore\ntype Snapshot = Options & {\n  from:           string\n  pieces:         TemplateStringsArray\n  args:           string[]\n  cmd:            string\n  ee:             EventEmitter\n  ac:             AbortController\n}\n\n// prettier-ignore\nexport const defaults: Options = resolveDefaults({\n  [CWD]:          process.cwd(),\n  [SYNC]:         false,\n  verbose:        false,\n  env:            process.env,\n  sync:           false,\n  shell:          true,\n  stdio:          'pipe',\n  nothrow:        false,\n  quiet:          false,\n  detached:       false,\n  preferLocal:    false,\n  spawn:          cp.spawn,\n  spawnSync:      cp.spawnSync,\n  log,\n  kill,\n  killSignal:     SIGTERM,\n  timeoutSignal:  SIGTERM,\n})\n\nconst storage = new AsyncLocalStorage<Options>()\n\nconst getStore = () => storage.getStore() || defaults\n\nconst getSnapshot = (\n  opts: Options,\n  from: string,\n  pieces: TemplateStringsArray,\n  args: any[]\n): Snapshot => ({\n  ...opts,\n  ac: opts.ac || new AbortController(),\n  ee: new EventEmitter(),\n  from,\n  pieces,\n  args,\n  cmd: '',\n})\n\nexport function within<R>(callback: () => R): R {\n  return storage.run({ ...getStore() }, callback)\n}\n\n// prettier-ignore\nexport interface Shell<\n  S = false,\n  R = S extends true ? ProcessOutput : ProcessPromise,\n> {\n  (pieces: TemplateStringsArray, ...args: any[]): R\n  <O extends Partial<Options> = Partial<Options>, R = O extends { sync: true } ? Shell<true> : Shell>(opts: O): R\n  sync: {\n    (pieces: TemplateStringsArray, ...args: any[]): ProcessOutput\n    (opts: Partial<Omit<Options, 'sync'>>): Shell<true>\n  }\n}\n\n// The zx\nexport type $ = Shell & Options\n\nexport const $: $ = sync$(\n  function (pieces: TemplateStringsArray | Partial<Options>, ...args: any[]) {\n    const opts = getStore()\n\n    if (!Array.isArray(pieces))\n      return sync$(\n        function (this: any, ...args: any) {\n          return within(() => Object.assign($, opts, pieces).apply(this, args))\n        } as $,\n        () => $({ ...pieces, sync: true })\n      )\n\n    const from = Fail.getCallerLocation()\n    const cb: PromiseCallback = () =>\n      (cb[SHOT] = getSnapshot(opts, from, pieces as TemplateStringsArray, args))\n\n    const pp = new ProcessPromise(cb)\n    if (!pp.isHalted()) pp.run()\n\n    return pp.sync ? pp.output : pp\n  } as $,\n  () => $({ sync: true })\n)\n\nfunction sync$(fn: $, makeSync: () => $): $ {\n  return new Proxy(fn, {\n    get(t, key) {\n      if (key === 'sync') return makeSync()\n      return Reflect.get(key in Function.prototype ? t : getStore(), key)\n    },\n    set(t, key, value) {\n      return Reflect.set(\n        key in Function.prototype ? t : getStore(),\n        key === 'sync' ? SYNC : key,\n        value\n      )\n    },\n  })\n}\n\ntype ProcessStage = 'initial' | 'halted' | 'running' | 'fulfilled' | 'rejected'\n\ntype Resolve = (out: ProcessOutput) => void\n\ntype Reject = (error: ProcessOutput | Error) => void\n\ntype PromiseCallback = {\n  (resolve: Resolve, reject: Reject): void\n  [SHOT]?: Snapshot\n}\n\ntype PromisifiedStream<D extends Writable = Writable> = D &\n  PromiseLike<ProcessOutput & D> & { run(): void }\n\ntype PipeAcceptor = Writable | ProcessPromise\ntype PipeDest = PipeAcceptor | TemplateStringsArray | string\ntype PipeMethod = {\n  (dest: TemplateStringsArray, ...args: any[]): ProcessPromise\n  (file: string): PromisifiedStream\n  <D extends Writable>(dest: D): PromisifiedStream<D>\n  <D extends ProcessPromise>(dest: D): D\n}\n\nexport class ProcessPromise extends Promise<ProcessOutput> {\n  private _stage: ProcessStage = 'initial'\n  private _id = randomId()\n  private _snapshot!: Snapshot\n  private _timeoutId?: ReturnType<typeof setTimeout>\n  private _piped = false\n  private _stdin = new VoidStream()\n  private _zurk: ReturnType<typeof exec> | null = null\n  private _output: ProcessOutput | null = null\n  private _resolve!: Resolve\n  private _reject!: Reject\n\n  constructor(executor: PromiseCallback) {\n    let resolve: Resolve\n    let reject: Reject\n    super((...args) => {\n      ;[resolve = noop, reject = noop] = args\n      executor(...args)\n    })\n\n    const snapshot = executor[SHOT]\n    if (snapshot) {\n      this._snapshot = snapshot\n      this._resolve = resolve!\n      this._reject = reject!\n      if (snapshot.halt) this._stage = 'halted'\n      try {\n        this.build()\n      } catch (err) {\n        this.finalize(ProcessOutput.fromError(err as Error), true)\n      }\n    } else ProcessPromise.disarm(this)\n  }\n  // prettier-ignore\n  private build(): void {\n    const $ = this._snapshot\n    if (!$.shell)\n      throw new Fail(`No shell is available: ${Fail.DOCS_URL}/shell`)\n    if (!$.quote)\n      throw new Fail(`No quote function is defined: ${Fail.DOCS_URL}/quotes`)\n    if ($.pieces.some((p) => p == null))\n      throw new Fail(`Malformed command at ${$.from}`)\n\n    $.cmd = buildCmd(\n      $.quote!,\n      $.pieces as TemplateStringsArray,\n      $.args\n    ) as string\n\n    if ($[SYNC] && !isString($.cmd))\n      throw new Fail('sync mode does not allow async command resolution')\n  }\n  run(): this {\n    ProcessPromise.bus.runBack(this)\n    if (this.isRunning() || this.isSettled()) return this // The _run() can be called from a few places.\n    this._stage = 'running'\n\n    const self = this\n    const $ = self._snapshot\n    const { id, cwd } = self\n\n    if (!fs.existsSync(cwd)) {\n      this.finalize(\n        ProcessOutput.fromError(\n          new Error(`The working directory '${cwd}' does not exist.`)\n        )\n      )\n      return this\n    }\n\n    if ($.preferLocal) {\n      const dirs =\n        $.preferLocal === true ? [$.cwd, $[CWD]] : [$.preferLocal].flat()\n      $.env = preferLocalBin($.env, ...dirs)\n    }\n\n    // prettier-ignore\n    this._zurk = exec({\n      cmd:      self.fullCmd,\n      cwd,\n      input:    ($.input as ProcessPromise | ProcessOutput)?.stdout ?? $.input,\n      stdin:    self._stdin,\n      sync:     self.sync,\n      signal:   self.signal,\n      shell:    isString($.shell) ? $.shell : true,\n      id,\n      env:      $.env,\n      spawn:    $.spawn,\n      spawnSync:$.spawnSync,\n      store:    $.store,\n      stdio:    $.stdio,\n      detached: $.detached,\n      ee:       $.ee,\n      async run(cb, ctx){\n        try {\n          if (!isString(self.cmd)) {\n            $.cmd = await self.cmd\n            ctx.cmd = self.fullCmd\n          }\n          cb()\n        } catch (error) {\n          self.finalize(ProcessOutput.fromError(error as Error))\n        }\n      },\n      on: {\n        start: () => {\n          $.log({ kind: 'cmd', cmd: $.cmd, cwd, verbose: self.isVerbose(), id })\n          self.timeout($.timeout, $.timeoutSignal)\n        },\n        stdout: (data) => {\n          // If the process is piped, don't print its output.\n          $.log({ kind: 'stdout', data, verbose: !self._piped && self.isVerbose(), id })\n        },\n        stderr: (data) => {\n          // Stderr should be printed regardless of piping.\n          $.log({ kind: 'stderr', data, verbose: !self.isQuiet(), id })\n        },\n        end: (data, c) => {\n          const { error: _error, status, signal: __signal, duration, ctx: { store }} = data\n          const { stdout, stderr } = store\n          const { cause, exitCode, signal: _signal } = self._breakerData || {}\n\n          const signal = _signal ?? __signal\n          const code = exitCode ?? status\n          const error = cause ?? _error\n          const output = new ProcessOutput({\n            code,\n            signal,\n            error,\n            duration,\n            store,\n            from: $.from,\n          })\n\n          $.log({ kind: 'end', signal, exitCode: code, duration, error, verbose: self.isVerbose(), id })\n\n          // Ensures EOL\n          if (stdout.length && getLast(getLast(stdout)) !== BR_CC) c.on.stdout!(EOL, c)\n          if (stderr.length && getLast(getLast(stderr)) !== BR_CC) c.on.stderr!(EOL, c)\n\n          self.finalize(output)\n        },\n      },\n    })\n\n    return this\n  }\n  private _breakerData?: Partial<\n    Pick<ProcessOutput, 'exitCode' | 'signal' | 'cause'>\n  >\n\n  private break(\n    exitCode?: ProcessOutput['exitCode'],\n    signal?: ProcessOutput['signal'],\n    cause?: ProcessOutput['cause']\n  ): void {\n    if (!this.isRunning()) return\n    this._breakerData = { exitCode, signal, cause }\n    this.kill(signal)\n  }\n\n  private finalize(output: ProcessOutput, legacy = false): void {\n    if (this.isSettled()) return\n    this._output = output\n    ProcessPromise.bus.unpipeBack(this)\n    if (output.ok || this.isNothrow()) {\n      this._stage = 'fulfilled'\n      this._resolve(output)\n    } else {\n      this._stage = 'rejected'\n      if (legacy) {\n        this._resolve(output) // to avoid unhandledRejection alerts\n        throw output.cause || output\n      }\n      this._reject(output)\n      if (this.sync) throw output\n    }\n  }\n\n  abort(reason?: string) {\n    if (this.isSettled()) throw new Fail('Too late to abort the process.')\n    if (this.signal !== this.ac.signal)\n      throw new Fail('The signal is controlled by another process.')\n    if (!this.child)\n      throw new Fail('Trying to abort a process without creating one.')\n\n    this.ac.abort(reason)\n  }\n\n  kill(signal?: NodeJS.Signals | null): Promise<void> {\n    if (this.isSettled()) throw new Fail('Too late to kill the process.')\n    if (!this.child)\n      throw new Fail('Trying to kill a process without creating one.')\n    if (!this.pid) throw new Fail('The process pid is undefined.')\n\n    return $.kill(this.pid, signal || this._snapshot.killSignal || $.killSignal)\n  }\n\n  // Configurators\n  stdio(\n    stdin: IOType | StdioOptions,\n    stdout: IOType = 'pipe',\n    stderr: IOType = 'pipe'\n  ): this {\n    this._snapshot.stdio = Array.isArray(stdin)\n      ? stdin\n      : [stdin, stdout, stderr]\n    return this\n  }\n\n  nothrow(v = true): this {\n    this._snapshot.nothrow = v\n    return this\n  }\n\n  quiet(v = true): this {\n    this._snapshot.quiet = v\n    return this\n  }\n\n  verbose(v = true): this {\n    this._snapshot.verbose = v\n    return this\n  }\n\n  timeout(d: Duration = 0, signal = $.timeoutSignal): this {\n    if (this.isSettled()) return this\n\n    const $ = this._snapshot\n    $.timeout = parseDuration(d)\n    $.timeoutSignal = signal\n\n    if (this._timeoutId) clearTimeout(this._timeoutId)\n    if ($.timeout && this.isRunning()) {\n      this._timeoutId = setTimeout(() => this.kill($.timeoutSignal), $.timeout)\n      this.finally(() => clearTimeout(this._timeoutId)).catch(noop)\n    }\n    return this\n  }\n  /**\n   *  @deprecated Use $({halt: true})`cmd` instead.\n   */\n  halt(): this {\n    return this\n  }\n\n  // Getters\n  get id(): string {\n    return this._id\n  }\n\n  get pid(): number | undefined {\n    return this.child?.pid\n  }\n\n  get cwd(): string {\n    return this._snapshot.cwd || this._snapshot[CWD]\n  }\n\n  get cmd(): string {\n    return this._snapshot.cmd\n  }\n\n  get fullCmd(): string {\n    const { prefix = '', postfix = '', cmd } = this._snapshot\n    return prefix + cmd + postfix\n  }\n\n  get child(): ChildProcess | undefined {\n    return this._zurk?.child\n  }\n\n  get stdin(): Writable {\n    return this.child?.stdin!\n  }\n\n  get stdout(): Readable {\n    return this.child?.stdout!\n  }\n\n  get stderr(): Readable {\n    return this.child?.stderr!\n  }\n\n  get exitCode(): Promise<number | null> {\n    return this.then(\n      (o) => o.exitCode,\n      (o) => o.exitCode\n    )\n  }\n\n  get signal(): AbortSignal {\n    return this._snapshot.signal || this.ac.signal\n  }\n\n  get ac(): AbortController {\n    return this._snapshot.ac\n  }\n\n  get output(): ProcessOutput | null {\n    return this._output\n  }\n\n  get stage(): ProcessStage {\n    return this._stage\n  }\n\n  get sync(): boolean {\n    return this._snapshot[SYNC]\n  }\n\n  override get [Symbol.toStringTag](): string {\n    return 'ProcessPromise'\n  }\n\n  [Symbol.toPrimitive](): string {\n    return this.toString()\n  }\n\n  // Output formatters\n  json<T = any>(): Promise<T> {\n    return this.then((o) => o.json<T>())\n  }\n\n  text(encoding?: Encoding): Promise<string> {\n    return this.then((o) => o.text(encoding))\n  }\n\n  lines(delimiter?: Options['delimiter']): Promise<string[]> {\n    return this.then((o) => o.lines(delimiter))\n  }\n\n  buffer(): Promise<Buffer> {\n    return this.then((o) => o.buffer())\n  }\n\n  blob(type?: string): Promise<Blob> {\n    return this.then((o) => o.blob(type))\n  }\n\n  // Status checkers\n  isQuiet(): boolean {\n    return this._snapshot.quiet\n  }\n\n  isVerbose(): boolean {\n    return this._snapshot.verbose && !this.isQuiet()\n  }\n\n  isNothrow(): boolean {\n    return this._snapshot.nothrow\n  }\n\n  isHalted(): boolean {\n    return this.stage === 'halted' && !this.sync\n  }\n\n  private isSettled(): boolean {\n    return !!this.output\n  }\n\n  private isRunning(): boolean {\n    return this.stage === 'running'\n  }\n\n  // Piping\n  // prettier-ignore\n  get pipe(): PipeMethod & {\n    [key in keyof TSpawnStore]: PipeMethod\n  } {\n    const getPipeMethod = (kind: keyof TSpawnStore) => this._pipe.bind(this, kind) as PipeMethod\n    const stdout = getPipeMethod('stdout')\n    const stderr = getPipeMethod('stderr')\n    const stdall = getPipeMethod('stdall')\n    return Object.assign(stdout, { stdout, stderr, stdall })\n  }\n\n  unpipe(to?: PipeAcceptor): this {\n    ProcessPromise.bus.unpipe(this, to)\n    return this\n  }\n\n  // prettier-ignore\n  private _pipe(source: keyof TSpawnStore, dest: PipeDest, ...args: any[]): PromisifiedStream | ProcessPromise {\n    if (isString(dest))\n      return this._pipe(source, fs.createWriteStream(dest))\n\n    if (isStringLiteral(dest, ...args))\n      return this._pipe(\n        source,\n        $({\n          halt: true,\n          signal: this.signal,\n        })(dest as TemplateStringsArray, ...args)\n      )\n\n    const isP = dest instanceof ProcessPromise\n    if (isP && dest.isSettled()) throw new Fail('Cannot pipe to a settled process.')\n    if (!isP && dest.writableEnded) throw new Fail('Cannot pipe to a closed stream.')\n\n    this._piped = true\n    ProcessPromise.bus.pipe(this, dest)\n\n    const { ee } = this._snapshot\n    const output = this.output\n    const from = new VoidStream()\n    const check = () => !!ProcessPromise.bus.refs.get(this)?.has(dest)\n    const end = () => {\n      if (!check()) return\n      setImmediate(() => {\n        ProcessPromise.bus.unpipe(this, dest)\n        ProcessPromise.bus.sources(dest).length === 0 && from.end()\n      })\n    }\n    const fill = () => {\n      for (const chunk of this._zurk!.store[source]) from.write(chunk)\n    }\n    const fillSettled = () => {\n      if (!output) return\n      if (isP && !output.ok) dest.break(output.exitCode, output.signal, output.cause)\n      fill()\n      end()\n    }\n\n    if (!output) {\n      const onData = (chunk: string | Buffer) => check() && from.write(chunk)\n      ee\n        .once(source, () => {\n          fill()\n          ee.on(source, onData)\n        })\n        .once('end', () => {\n          ee.removeListener(source, onData)\n          end()\n        })\n    }\n\n    if (isP) {\n      from.pipe(dest._stdin)\n      if (this.isHalted()) ee.once('start', () => dest.run())\n      else {\n        dest.run()\n        this.catch((e) => dest.break(e.exitCode, e.signal, e.cause))\n      }\n      fillSettled()\n      return dest\n    }\n\n    from.once('end', () => dest.emit(EPF)).pipe(dest)\n    fillSettled()\n    return ProcessPromise.promisifyStream(dest, this)\n  }\n\n  // prettier-ignore\n  private static bus = {\n    refs: new Map<ProcessPromise, Set<PipeAcceptor>>,\n    streams: new WeakMap<Writable, PromisifiedStream>(),\n    pipe(from: ProcessPromise, to: PipeAcceptor) {\n      const set = this.refs.get(from) || (this.refs.set(from, new Set())).get(from)!\n      set.add(to)\n    },\n    unpipe(from: ProcessPromise, to?: PipeAcceptor) {\n      const set = this.refs.get(from)\n      if (!set) return\n      if (to) set.delete(to)\n      if (set.size) return\n      this.refs.delete(from)\n      from._piped = false\n    },\n    unpipeBack(to: ProcessPromise, from?: ProcessPromise) {\n      if (from) return this.unpipe(from, to)\n      for (const _from of this.refs.keys()) {\n        this.unpipe(_from, to)\n      }\n    },\n    runBack(p: PipeAcceptor) {\n      for (const from of this.sources(p)) {\n        if (from instanceof ProcessPromise) from.run()\n        else this.streams.get(from)?.run()\n      }\n    },\n    sources(p: PipeAcceptor): PipeAcceptor[] {\n      const refs = []\n      for (const [from, set] of this.refs.entries()) {\n        set.has(p) && refs.push(from)\n      }\n      return refs\n    }\n  }\n\n  private static promisifyStream = <S extends Writable>(\n    stream: S,\n    from: ProcessPromise\n  ): PromisifiedStream<S> => {\n    const proxy =\n      ProcessPromise.bus.streams.get(stream) ||\n      proxyOverride(stream as PromisifiedStream<S>, {\n        then(res: any = noop, rej: any = noop) {\n          return new Promise((_res, _rej) => {\n            const end = () => _res(res(proxyOverride(stream, from.output)))\n            stream\n              .once('error', (e) => _rej(rej(e)))\n              .once('finish', end)\n              .once(EPF, end)\n          })\n        },\n        run() {\n          from.run()\n        },\n        pipe(...args: any) {\n          const dest = stream.pipe.apply(stream, args)\n          return dest instanceof ProcessPromise\n            ? dest\n            : ProcessPromise.promisifyStream(dest as Writable, from)\n        },\n      })\n\n    ProcessPromise.bus.streams.set(stream, proxy as any)\n    return proxy as PromisifiedStream<S>\n  }\n\n  // Promise API\n  override then<R = ProcessOutput, E = ProcessOutput>(\n    onfulfilled?:\n      | ((value: ProcessOutput) => PromiseLike<R> | R)\n      | undefined\n      | null,\n    onrejected?:\n      | ((reason: ProcessOutput) => PromiseLike<E> | E)\n      | undefined\n      | null\n  ): Promise<R | E> {\n    return super.then(onfulfilled, onrejected)\n  }\n\n  override catch<T = ProcessOutput>(\n    onrejected?:\n      | ((reason: ProcessOutput) => PromiseLike<T> | T)\n      | undefined\n      | null\n  ): Promise<ProcessOutput | T> {\n    return super.catch(onrejected)\n  }\n\n  // Async iterator API\n  async *[Symbol.asyncIterator](): AsyncIterator<string> {\n    const memo: (string | undefined)[] = []\n    const dlmtr = this._snapshot.delimiter || $.delimiter || DLMTR\n\n    for (const chunk of this._zurk!.store.stdout) {\n      yield* getLines(chunk, memo, dlmtr)\n    }\n\n    for await (const chunk of this.stdout || []) {\n      yield* getLines(chunk, memo, dlmtr)\n    }\n\n    if (memo[0]) yield memo[0]\n\n    await this\n  }\n\n  // Stream-like API\n  private writable = true\n  private emit(event: string, ...args: any[]) {\n    return this\n  }\n  private on(event: string, cb: any) {\n    this._stdin.on(event, cb)\n    return this\n  }\n  private once(event: string, cb: any) {\n    this._stdin.once(event, cb)\n    return this\n  }\n  private write(data: any, encoding: NodeJS.BufferEncoding, cb: any) {\n    this._stdin.write(data, encoding, cb)\n    return this\n  }\n  private end(chunk: any, cb: any) {\n    this._stdin.end(chunk, cb)\n    return this\n  }\n  private removeListener(event: string, cb: any) {\n    this._stdin.removeListener(event, cb)\n    return this\n  }\n\n  // prettier-ignore\n  private static disarm(p: ProcessPromise, toggle = true): void {\n    Object.getOwnPropertyNames(ProcessPromise.prototype).forEach(k => {\n      if (k in Promise.prototype) return\n      if (!toggle) { Reflect.deleteProperty(p, k); return }\n      Object.defineProperty(p, k, { configurable: true, get() {\n        throw new Fail('Inappropriate usage. Apply $ instead of direct instantiation.')\n      }})\n    })\n  }\n}\n\ntype ProcessDto = {\n  code: number | null\n  signal: NodeJS.Signals | null\n  duration: number\n  error: any\n  from: string\n  store: TSpawnStore\n  delimiter?: string | RegExp\n}\n\nexport class ProcessOutput extends Error {\n  private readonly _dto!: ProcessDto\n  cause!: Error | null\n  message!: string\n  stdout!: string\n  stderr!: string\n  stdall!: string\n  constructor(dto: ProcessDto)\n  constructor(\n    code?: number | null,\n    signal?: NodeJS.Signals | null,\n    stdout?: string,\n    stderr?: string,\n    stdall?: string,\n    message?: string,\n    duration?: number\n  )\n  // prettier-ignore\n  constructor(\n    code: number | null | ProcessDto = null,\n    signal: NodeJS.Signals | null = null,\n    stdout: string = '',\n    stderr: string = '',\n    stdall: string = '',\n    message: string = '',\n    duration: number = 0,\n    error: any = null,\n    from: string = '',\n    store: TSpawnStore = { stdout: [stdout], stderr: [stderr], stdall: [stdall], }\n  ) {\n    super(message)\n    const dto = code !== null && typeof code === 'object'\n      ? code\n      : { code, signal, duration, error, from, store }\n\n    Object.defineProperties(this, {\n      _dto: { value: dto, enumerable: false },\n      cause: { get() { return dto.error }, enumerable: false },\n      stdout: { get: once(() => bufArrJoin(dto.store.stdout)) },\n      stderr: { get: once(() => bufArrJoin(dto.store.stderr)) },\n      stdall: { get: once(() => bufArrJoin(dto.store.stdall)) },\n      message: { get: once(() =>\n        dto.error || message\n          ? ProcessOutput.getErrorMessage(dto.error || new Error(message), dto.from)\n          : ProcessOutput.getExitMessage(\n            dto.code,\n            dto.signal,\n            this.stderr,\n            dto.from,\n            this.stderr.trim() ? '' : ProcessOutput.getErrorDetails(this.lines())\n          )\n      )},\n    })\n  }\n\n  get exitCode(): number | null {\n    return this._dto.code\n  }\n\n  get signal(): NodeJS.Signals | null {\n    return this._dto.signal\n  }\n\n  get duration(): number {\n    return this._dto.duration\n  }\n\n  get [Symbol.toStringTag](): string {\n    return 'ProcessOutput'\n  }\n\n  get ok(): boolean {\n    return !this._dto.error && this.exitCode === 0\n  }\n\n  json<T = any>(): T {\n    return JSON.parse(this.stdall)\n  }\n\n  buffer(): Buffer {\n    return Buffer.from(this.stdall)\n  }\n\n  blob(type = 'text/plain'): Blob {\n    if (!globalThis.Blob)\n      throw new Fail(\n        'Blob is not supported in this environment. Provide a polyfill'\n      )\n    return new Blob([this.buffer() as BlobPart], { type })\n  }\n\n  text(encoding: Encoding = 'utf8'): string {\n    return encoding === 'utf8'\n      ? this.toString()\n      : this.buffer().toString(encoding)\n  }\n\n  lines(delimiter?: string | RegExp): string[] {\n    return iteratorToArray(this[Symbol.iterator](delimiter))\n  }\n\n  override toString(): string {\n    return this.stdall\n  }\n\n  override valueOf(): string {\n    return this.stdall.trim()\n  }\n\n  [Symbol.toPrimitive](): string {\n    return this.valueOf()\n  }\n  // prettier-ignore\n  *[Symbol.iterator](dlmtr: Options['delimiter'] = this._dto.delimiter || $.delimiter || DLMTR): Iterator<string> {\n    const memo: (string | undefined)[] = []\n    for (const chunk of this._dto.store.stdall) {\n      yield* getLines(chunk, memo, dlmtr)\n    }\n\n    if (memo[0]) yield memo[0]\n  }\n\n  [inspect.custom](): string {\n    const codeInfo = ProcessOutput.getExitCodeInfo(this.exitCode)\n\n    return `ProcessOutput {\n  stdout: ${chalk.green(inspect(this.stdout))},\n  stderr: ${chalk.red(inspect(this.stderr))},\n  signal: ${inspect(this.signal)},\n  exitCode: ${(this.ok ? chalk.green : chalk.red)(this.exitCode)}${\n    codeInfo ? chalk.grey(' (' + codeInfo + ')') : ''\n  },\n  duration: ${this.duration}\n}`\n  }\n\n  static getExitMessage = Fail.formatExitMessage\n  static getErrorMessage = Fail.formatErrorMessage\n  static getErrorDetails = Fail.formatErrorDetails\n  static getExitCodeInfo = Fail.getExitCodeInfo\n\n  static fromError(error: Error): ProcessOutput {\n    const output = new ProcessOutput()\n    output._dto.error = error\n    return output\n  }\n}\n\nexport const useBash = (): void => setShell('bash', false)\nexport const usePwsh = (): void => setShell('pwsh')\nexport const usePowerShell = (): void => setShell('powershell.exe')\nfunction setShell(n: string, ps = true) {\n  $.shell = which.sync(n)\n  $.prefix = ps ? '' : 'set -euo pipefail;'\n  $.postfix = ps ? '; exit $LastExitCode' : ''\n  $.quote = ps ? quotePowerShell : quote\n}\n\ntry {\n  const { shell, prefix, postfix } = $\n  useBash()\n  if (isString(shell)) $.shell = shell\n  if (isString(prefix)) $.prefix = prefix\n  if (isString(postfix)) $.postfix = postfix\n} catch (err) {}\n\nlet cwdSyncHook: AsyncHook\n\nexport function syncProcessCwd(flag: boolean = true) {\n  cwdSyncHook =\n    cwdSyncHook ||\n    createHook({\n      init: syncCwd,\n      before: syncCwd,\n      promiseResolve: syncCwd,\n      after: syncCwd,\n      destroy: syncCwd,\n    })\n  if (flag) cwdSyncHook.enable()\n  else cwdSyncHook.disable()\n}\n\nfunction syncCwd() {\n  if ($[CWD] != process.cwd()) process.chdir($[CWD])\n}\n\nexport function cd(dir: string | ProcessOutput) {\n  if (dir instanceof ProcessOutput) {\n    dir = dir.toString().trim()\n  }\n\n  $.log({ kind: 'cd', dir, verbose: !$.quiet && $.verbose })\n  process.chdir(dir)\n  $[CWD] = process.cwd()\n}\n\nexport async function kill(\n  pid: number | `${number}`,\n  signal = $.killSignal || SIGTERM\n) {\n  if (\n    (typeof pid !== 'number' && typeof pid !== 'string') ||\n    !/^\\d+$/.test(pid as string)\n  )\n    throw new Fail(`Invalid pid: ${pid}`)\n\n  $.log({ kind: 'kill', pid, signal, verbose: !$.quiet && $.verbose })\n  if (\n    process.platform === 'win32' &&\n    (await new Promise((resolve) => {\n      cp.exec(`taskkill /pid ${pid} /t /f`, (err) => resolve(!err))\n    }))\n  )\n    return\n\n  for (const p of await ps.tree({ pid, recursive: true })) {\n    try {\n      process.kill(+p.pid, signal)\n    } catch (e) {}\n  }\n  try {\n    process.kill(-pid, signal)\n  } catch (e) {\n    try {\n      process.kill(+pid, signal)\n    } catch (e) {}\n  }\n}\n\nexport function resolveDefaults(\n  defs: Options = defaults,\n  prefix: string = ENV_PREFIX,\n  env = process.env,\n  allowed = ENV_OPTS\n): Options {\n  return Object.entries(env).reduce<Options>((m, [k, v]) => {\n    if (v && k.startsWith(prefix)) {\n      const _k = toCamelCase(k.slice(prefix.length))\n      const _v = parseBool(v)\n      if (allowed.has(_k)) (m as any)[_k] = _v\n    }\n    return m\n  }, defs)\n}\n"
  },
  {
    "path": "src/deps.ts",
    "content": "// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     https://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { builtinModules } from 'node:module'\nimport { $, spinner, Fail } from './index.ts'\nimport { depseek } from './vendor.ts'\n\n/**\n * Install npm dependencies\n * @param dependencies object of dependencies\n * @param prefix  path to the directory where npm should install the dependencies\n * @param registry custom npm registry URL when installing dependencies\n * @param installerType package manager: npm, yarn, pnpm, bun, etc.\n */\nexport async function installDeps(\n  dependencies: Record<string, string>,\n  prefix?: string,\n  registry?: string,\n  installerType = 'npm'\n): Promise<void> {\n  const installer = installers[installerType]\n  const packages = Object.entries(dependencies).map(\n    ([name, version]) => `${name}@${version}`\n  )\n  if (packages.length === 0) return\n  if (!installer) {\n    throw new Fail(\n      `Unsupported installer type: ${installerType}. Supported types: ${Object.keys(installers).join(', ')}`\n    )\n  }\n\n  await spinner(`${installerType} i ${packages.join(' ')}`, () =>\n    installer({ packages, prefix, registry })\n  )\n}\n\ntype DepsInstaller = (opts: {\n  packages: string[]\n  registry?: string\n  prefix?: string\n}) => Promise<void>\n\nconst installers: Record<any, DepsInstaller> = {\n  npm: async ({ packages, prefix, registry }) => {\n    const flags = [\n      '--no-save',\n      '--no-audit',\n      '--no-fund',\n      prefix && `--prefix=${prefix}`,\n      registry && `--registry=${registry}`,\n    ].filter(Boolean)\n    await $`npm install ${flags} ${packages}`.nothrow()\n  },\n}\n\nconst builtins = new Set(builtinModules)\n\nconst nameRe = /^(?<name>(@[a-z\\d-~][\\w-.~]*\\/)?[a-z\\d-~][\\w-.~]*)\\/?.*$/i\nconst versionRe = /^@(?<version>[~^]?(v?[\\dx*]+([-.][\\d*a-z-]+)*))/i\n\nexport function parseDeps(content: string): Record<string, string> {\n  return depseek(content + '\\n', { comments: true }).reduce<\n    Record<string, string>\n  >((m, { type, value }, i, list) => {\n    if (type === 'dep') {\n      const meta = list[i + 1]\n      const name = parsePackageName(value)\n      const version =\n        (meta?.type === 'comment' && parseVersion(meta?.value.trim())) ||\n        'latest'\n      if (name) m[name] = version\n    }\n    return m\n  }, {})\n}\n\nfunction parsePackageName(path?: string): string | undefined {\n  if (!path) return\n\n  const name = nameRe.exec(path)?.groups?.name\n  if (name && !builtins.has(name)) return name\n}\n\nfunction parseVersion(line: string) {\n  return versionRe.exec(line)?.groups?.version || 'latest'\n}\n"
  },
  {
    "path": "src/error.ts",
    "content": "// Copyright 2024 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     https://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nconst EXIT_CODES: Record<number, string> = {\n  2: 'Misuse of shell builtins',\n  126: 'Invoked command cannot execute',\n  127: 'Command not found',\n  128: 'Invalid exit argument',\n  129: 'Hangup',\n  130: 'Interrupt',\n  131: 'Quit and dump core',\n  132: 'Illegal instruction',\n  133: 'Trace/breakpoint trap',\n  134: 'Process aborted',\n  135: 'Bus error: \"access to undefined portion of memory object\"',\n  136: 'Floating point exception: \"erroneous arithmetic operation\"',\n  137: 'Kill (terminate immediately)',\n  138: 'User-defined 1',\n  139: 'Segmentation violation',\n  140: 'User-defined 2',\n  141: 'Write to pipe with no one reading',\n  142: 'Signal raised by alarm',\n  143: 'Termination (request to terminate)',\n  145: 'Child process terminated, stopped (or continued*)',\n  146: 'Continue if stopped',\n  147: 'Stop executing temporarily',\n  148: 'Terminal stop signal',\n  149: 'Background process attempting to read from tty (\"in\")',\n  150: 'Background process attempting to write to tty (\"out\")',\n  151: 'Urgent data available on socket',\n  152: 'CPU time limit exceeded',\n  153: 'File size limit exceeded',\n  154: 'Signal raised by timer counting virtual time: \"virtual timer expired\"',\n  155: 'Profiling timer expired',\n  157: 'Pollable event',\n  159: 'Bad syscall',\n}\n\nconst ERRNO_CODES: Record<number, string> = {\n  0: 'Success',\n  1: 'Not super-user',\n  2: 'No such file or directory',\n  3: 'No such process',\n  4: 'Interrupted system call',\n  5: 'I/O error',\n  6: 'No such device or address',\n  7: 'Arg list too long',\n  8: 'Exec format error',\n  9: 'Bad file number',\n  10: 'No children',\n  11: 'No more processes',\n  12: 'Not enough core',\n  13: 'Permission denied',\n  14: 'Bad address',\n  15: 'Block device required',\n  16: 'Mount device busy',\n  17: 'File exists',\n  18: 'Cross-device link',\n  19: 'No such device',\n  20: 'Not a directory',\n  21: 'Is a directory',\n  22: 'Invalid argument',\n  23: 'Too many open files in system',\n  24: 'Too many open files',\n  25: 'Not a typewriter',\n  26: 'Text file busy',\n  27: 'File too large',\n  28: 'No space left on device',\n  29: 'Illegal seek',\n  30: 'Read only file system',\n  31: 'Too many links',\n  32: 'Broken pipe',\n  33: 'Math arg out of domain of func',\n  34: 'Math result not representable',\n  35: 'File locking deadlock error',\n  36: 'File or path name too long',\n  37: 'No record locks available',\n  38: 'Function not implemented',\n  39: 'Directory not empty',\n  40: 'Too many symbolic links',\n  42: 'No message of desired type',\n  43: 'Identifier removed',\n  44: 'Channel number out of range',\n  45: 'Level 2 not synchronized',\n  46: 'Level 3 halted',\n  47: 'Level 3 reset',\n  48: 'Link number out of range',\n  49: 'Protocol driver not attached',\n  50: 'No CSI structure available',\n  51: 'Level 2 halted',\n  52: 'Invalid exchange',\n  53: 'Invalid request descriptor',\n  54: 'Exchange full',\n  55: 'No anode',\n  56: 'Invalid request code',\n  57: 'Invalid slot',\n  59: 'Bad font file fmt',\n  60: 'Device not a stream',\n  61: 'No data (for no delay io)',\n  62: 'Timer expired',\n  63: 'Out of streams resources',\n  64: 'Machine is not on the network',\n  65: 'Package not installed',\n  66: 'The object is remote',\n  67: 'The link has been severed',\n  68: 'Advertise error',\n  69: 'Srmount error',\n  70: 'Communication error on send',\n  71: 'Protocol error',\n  72: 'Multihop attempted',\n  73: 'Cross mount point (not really error)',\n  74: 'Trying to read unreadable message',\n  75: 'Value too large for defined data type',\n  76: 'Given log. name not unique',\n  77: 'f.d. invalid for this operation',\n  78: 'Remote address changed',\n  79: 'Can   access a needed shared lib',\n  80: 'Accessing a corrupted shared lib',\n  81: '.lib section in a.out corrupted',\n  82: 'Attempting to link in too many libs',\n  83: 'Attempting to exec a shared library',\n  84: 'Illegal byte sequence',\n  86: 'Streams pipe error',\n  87: 'Too many users',\n  88: 'Socket operation on non-socket',\n  89: 'Destination address required',\n  90: 'Message too long',\n  91: 'Protocol wrong type for socket',\n  92: 'Protocol not available',\n  93: 'Unknown protocol',\n  94: 'Socket type not supported',\n  95: 'Not supported',\n  96: 'Protocol family not supported',\n  97: 'Address family not supported by protocol family',\n  98: 'Address already in use',\n  99: 'Address not available',\n  100: 'Network interface is not configured',\n  101: 'Network is unreachable',\n  102: 'Connection reset by network',\n  103: 'Connection aborted',\n  104: 'Connection reset by peer',\n  105: 'No buffer space available',\n  106: 'Socket is already connected',\n  107: 'Socket is not connected',\n  108: \"Can't send after socket shutdown\",\n  109: 'Too many references',\n  110: 'Connection timed out',\n  111: 'Connection refused',\n  112: 'Host is down',\n  113: 'Host is unreachable',\n  114: 'Socket already connected',\n  115: 'Connection already in progress',\n  116: 'Stale file handle',\n  122: 'Quota exceeded',\n  123: 'No medium (in tape drive)',\n  125: 'Operation canceled',\n  130: 'Previous owner died',\n  131: 'State not recoverable',\n}\n\nconst DOCS_URL = 'https://google.github.io/zx'\n\nexport class Fail extends Error {\n  static DOCS_URL = DOCS_URL\n  static EXIT_CODES = EXIT_CODES\n  static ERRNO_CODES = ERRNO_CODES\n\n  static formatExitMessage(\n    code: number | null,\n    signal: NodeJS.Signals | null,\n    stderr: string,\n    from: string,\n    details: string = ''\n  ): string {\n    if (code == 0 && signal == null) return `exit code: ${code}`\n\n    const codeInfo = Fail.getExitCodeInfo(code)\n    let message = `${stderr}\n    at ${from}\n    exit code: ${code}${codeInfo ? ' (' + codeInfo + ')' : ''}`\n\n    if (signal != null) message += `\\n    signal: ${signal}`\n\n    if (details) message += `\\n    details: \\n${details}`\n\n    return message\n  }\n\n  static formatErrorMessage(err: NodeJS.ErrnoException, from: string): string {\n    return `${err.message}\n    errno: ${err.errno} (${Fail.getErrnoMessage(err.errno)})\n    code: ${err.code}\n    at ${from}`\n  }\n\n  static formatErrorDetails(lines: string[] = [], lim = 20): string {\n    if (lines.length < lim) return lines.join('\\n')\n\n    let errors = lines.filter((l) => /(fail|error|not ok|exception)/i.test(l))\n    if (errors.length === 0) errors = lines\n    return (\n      errors.slice(0, lim).join('\\n') + (errors.length > lim ? '\\n...' : '')\n    )\n  }\n\n  static getExitCodeInfo(exitCode: number | null): string | undefined {\n    return EXIT_CODES[exitCode as keyof typeof EXIT_CODES]\n  }\n\n  static getCallerLocationFromString(stackString = 'unknown'): string {\n    const lines = stackString\n      .split(/^\\s*(at\\s)?/m)\n      .filter((s) => s?.includes(':'))\n    const i = lines.findIndex((l) => l.includes('Proxy.set'))\n    const offset = i < 0 ? i : i + 2\n\n    return (\n      lines.find((l) => l.includes('file://')) ||\n      lines[offset] ||\n      stackString\n    ).trim()\n  }\n\n  static getCallerLocation(err: Error = new Error('zx error')): string {\n    return Fail.getCallerLocationFromString(err.stack)\n  }\n\n  static getErrnoMessage(errno?: number): string {\n    return (\n      ERRNO_CODES[-(errno as number) as keyof typeof ERRNO_CODES] ||\n      'Unknown error'\n    )\n  }\n}\n"
  },
  {
    "path": "src/globals-jsr.ts",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     https://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport * as _ from './index.ts'\nObject.assign(globalThis, _)\n"
  },
  {
    "path": "src/globals.ts",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     https://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport * as _ from './index.ts'\n\nObject.assign(globalThis, _)\n// TODO: global types not working with jsr.io\ndeclare global {\n  type ProcessPromise = _.ProcessPromise\n  type ProcessOutput = _.ProcessOutput\n  var ProcessPromise: typeof _.ProcessPromise\n  var ProcessOutput: typeof _.ProcessOutput\n  var $: typeof _.$\n  var argv: typeof _.argv\n  var cd: typeof _.cd\n  var chalk: typeof _.chalk\n  var defaults: typeof _.defaults\n  var dotenv: typeof _.dotenv\n  var echo: typeof _.echo\n  var expBackoff: typeof _.expBackoff\n  var fs: typeof _.fs\n  var glob: typeof _.glob\n  var globby: typeof _.globby\n  var kill: typeof _.kill\n  var log: typeof _.log\n  var minimist: typeof _.minimist\n  var nothrow: typeof _.nothrow\n  var os: typeof _.os\n  var parseArgv: typeof _.parseArgv\n  var path: typeof _.path\n  var ps: typeof _.ps\n  var question: typeof _.question\n  var quiet: typeof _.quiet\n  var quote: typeof _.quote\n  var quotePowerShell: typeof _.quotePowerShell\n  var resolveDefaults: typeof _.resolveDefaults\n  var retry: typeof _.retry\n  var sleep: typeof _.sleep\n  var spinner: typeof _.spinner\n  var stdin: typeof _.stdin\n  var syncProcessCwd: typeof _.syncProcessCwd\n  var tempdir: typeof _.tempdir\n  var tempfile: typeof _.tempfile\n  var tmpdir: typeof _.tempdir\n  var tmpfile: typeof _.tempfile\n  var updateArgv: typeof _.updateArgv\n  var usePowerShell: typeof _.usePowerShell\n  var usePwsh: typeof _.usePwsh\n  var useBash: typeof _.useBash\n  var version: typeof _.version\n  var VERSION: typeof _.VERSION\n  var which: typeof _.which\n  var within: typeof _.within\n  var YAML: typeof _.YAML\n}\n"
  },
  {
    "path": "src/goods.ts",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     https://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { Buffer } from 'node:buffer'\nimport process from 'node:process'\nimport { createInterface } from 'node:readline'\nimport { Readable } from 'node:stream'\nimport { type Mode } from 'node:fs'\nimport {\n  $,\n  within,\n  ProcessOutput,\n  type ProcessPromise,\n  path,\n  os,\n  Fail,\n} from './core.ts'\nimport {\n  type Duration,\n  getLast,\n  identity,\n  isStringLiteral,\n  parseBool,\n  parseDuration,\n  randomId,\n  toCamelCase,\n} from './util.ts'\nimport {\n  type RequestInfo,\n  type RequestInit,\n  nodeFetch,\n  minimist,\n  fs,\n} from './vendor.ts'\n\nexport { versions } from './versions.ts'\n\nexport function tempdir(\n  prefix: string = `zx-${randomId()}`,\n  mode?: Mode\n): string {\n  const dirpath = path.join(os.tmpdir(), prefix)\n  fs.mkdirSync(dirpath, { recursive: true, mode })\n\n  return dirpath\n}\n\nexport function tempfile(\n  name?: string,\n  data?: string | Buffer,\n  mode?: Mode\n): string {\n  const filepath = name\n    ? path.join(tempdir(), name)\n    : path.join(os.tmpdir(), `zx-${randomId()}`)\n\n  if (data === undefined) fs.closeSync(fs.openSync(filepath, 'w', mode))\n  else fs.writeFileSync(filepath, data, { mode })\n\n  return filepath\n}\n\nexport { tempdir as tmpdir, tempfile as tmpfile }\n\ntype ArgvOpts = minimist.Opts & { camelCase?: boolean; parseBoolean?: boolean }\n\nexport const parseArgv = (\n  args: string[] = process.argv.slice(2),\n  opts: ArgvOpts = {},\n  defs: Record<string, any> = {}\n): minimist.ParsedArgs =>\n  Object.entries<string>(minimist(args, opts)).reduce<minimist.ParsedArgs>(\n    (m, [k, v]) => {\n      const kTrans = opts.camelCase ? toCamelCase : identity\n      const vTrans = opts.parseBoolean ? parseBool : identity\n      const [_k, _v] = k === '--' || k === '_' ? [k, v] : [kTrans(k), vTrans(v)]\n      m[_k] = _v\n      return m\n    },\n    defs as minimist.ParsedArgs\n  )\n\nexport function updateArgv(args?: string[], opts?: ArgvOpts) {\n  for (const k in argv) delete argv[k]\n  parseArgv(args, opts, argv)\n}\n\nexport const argv: minimist.ParsedArgs = parseArgv()\n\nexport function sleep(duration: Duration): Promise<void> {\n  return new Promise((resolve) => {\n    setTimeout(resolve, parseDuration(duration))\n  })\n}\n\nconst responseToReadable = (response: Response, rs: Readable) => {\n  const reader = response.body?.getReader()\n  if (!reader) {\n    rs.push(null)\n    return rs\n  }\n  rs._read = async () => {\n    const result = await reader.read()\n    rs.push(result.done ? null : Buffer.from(result.value))\n  }\n  return rs\n}\n\nexport function fetch(\n  url: RequestInfo,\n  init?: RequestInit\n): Promise<Response> & {\n  pipe: {\n    (dest: TemplateStringsArray, ...args: any[]): ProcessPromise\n    <D>(dest: D): D\n  }\n} {\n  $.log({ kind: 'fetch', url, init, verbose: !$.quiet && $.verbose })\n  const p = nodeFetch(url, init)\n\n  return Object.assign(p, {\n    pipe(dest: any, ...args: any[]) {\n      const rs = new Readable()\n      const _dest = isStringLiteral(dest, ...args)\n        ? $({\n            halt: true,\n            signal: init?.signal as AbortSignal,\n          })(dest as TemplateStringsArray, ...args)\n        : dest\n      p.then(\n        (r) => responseToReadable(r, rs).pipe(_dest.run?.()),\n        (err) => _dest.abort?.(err)\n      )\n      return _dest\n    },\n  })\n}\n\nexport function echo(...args: any[]): void\nexport function echo(pieces: TemplateStringsArray, ...args: any[]) {\n  const msg = isStringLiteral(pieces, ...args)\n    ? args.map((a, i) => pieces[i] + stringify(a)).join('') + getLast(pieces)\n    : [pieces, ...args].map(stringify).join(' ')\n\n  console.log(msg)\n}\n\nfunction stringify(arg: any) {\n  return arg instanceof ProcessOutput ? arg.toString().trimEnd() : `${arg}`\n}\n\nexport async function question(\n  query?: string,\n  {\n    choices,\n    input = process.stdin,\n    output = process.stdout,\n  }: {\n    choices?: string[]\n    input?: NodeJS.ReadStream\n    output?: NodeJS.WriteStream\n  } = {}\n): Promise<string> {\n  /* c8 ignore next 5 */\n  const completer = Array.isArray(choices)\n    ? (line: string) => {\n        const hits = choices.filter((c) => c.startsWith(line))\n        return [hits.length ? hits : choices, line]\n      }\n    : undefined\n  const rl = createInterface({\n    input,\n    output,\n    terminal: true,\n    completer,\n  })\n\n  return new Promise((resolve) =>\n    rl.question(query ?? '', (answer) => {\n      rl.close()\n      resolve(answer)\n    })\n  )\n}\n\nexport async function stdin(stream: Readable = process.stdin): Promise<string> {\n  let buf = ''\n  for await (const chunk of stream.setEncoding('utf8')) {\n    buf += chunk\n  }\n  return buf\n}\n\nexport async function retry<T>(count: number, callback: () => T): Promise<T>\nexport async function retry<T>(\n  count: number,\n  duration: Duration | Generator<number>,\n  callback: () => T\n): Promise<T>\nexport async function retry<T>(\n  count: number,\n  d: Duration | Generator<number> | (() => T),\n  cb?: () => T\n): Promise<T> {\n  if (typeof d === 'function') return retry(count, 0, d)\n  if (!cb) throw new Fail('Callback is required for retry')\n\n  const total = count\n  const gen =\n    typeof d === 'object'\n      ? d\n      : (function* (d) {\n          while (true) yield d\n        })(parseDuration(d))\n\n  let attempt = 0\n  let lastErr: unknown\n  while (count-- > 0) {\n    attempt++\n    try {\n      return await cb()\n    } catch (err) {\n      lastErr = err\n      const delay = gen.next().value\n\n      $.log({\n        kind: 'retry',\n        total,\n        attempt,\n        delay,\n        exception: err,\n        verbose: !$.quiet && $.verbose,\n        error: `FAIL Attempt: ${attempt}/${total}, next: ${delay}`, // legacy\n      })\n      if (delay > 0) await sleep(delay)\n    }\n  }\n  throw lastErr\n}\n\nexport function* expBackoff(\n  max: Duration = '60s',\n  delay: Duration = '100ms'\n): Generator<number, void, unknown> {\n  const maxMs = parseDuration(max)\n  const randMs = parseDuration(delay)\n  let n = 0\n  while (true) {\n    yield Math.min(randMs * 2 ** n++, maxMs)\n  }\n}\n\nexport async function spinner<T>(callback: () => T): Promise<T>\nexport async function spinner<T>(title: string, callback: () => T): Promise<T>\nexport async function spinner<T>(\n  title: string | (() => T),\n  callback?: () => T\n): Promise<T> {\n  if (typeof title === 'function') return spinner('', title)\n  if ($.quiet || process.env.CI) return callback!()\n\n  let i = 0\n  const stream = $.log.output || process.stderr\n  const spin = () => stream.write(`  ${'⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏'[i++ % 10]} ${title}\\r`)\n  return within(async () => {\n    $.verbose = false\n    const id = setInterval(spin, 100)\n\n    try {\n      return await callback!()\n    } finally {\n      clearInterval(id as ReturnType<typeof setTimeout>)\n      stream.write(' '.repeat((process.stdout.columns || 1) - 1) + '\\r')\n    }\n  })\n}\n"
  },
  {
    "path": "src/index.ts",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     https://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { type ProcessPromise, bus } from './core.ts'\nimport { versions } from './goods.ts'\n\nbus.lock()\n\nexport * from './core.ts'\nexport * from './goods.ts'\nexport {\n  minimist,\n  dotenv,\n  fs,\n  YAML,\n  MAML,\n  glob,\n  glob as globby,\n} from './vendor.ts'\n\nexport const VERSION: string = versions.zx || '0.0.0'\nexport const version: string = VERSION\n\n/**\n *  @deprecated Use $`cmd`.nothrow() instead.\n */\nexport function nothrow(promise: ProcessPromise): ProcessPromise {\n  return promise.nothrow()\n}\n\n/**\n * @deprecated Use $`cmd`.quiet() instead.\n */\nexport function quiet(promise: ProcessPromise): ProcessPromise {\n  return promise.quiet()\n}\n"
  },
  {
    "path": "src/internals.ts",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     https://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\ntype TCallable = (...args: any[]) => any\n\nlet locked = false\nconst lock: () => void = () => (locked = true)\n\nconst store: Map<string, any> = new Map()\nconst override: (typeof store)['set'] = store.set.bind(store)\nfunction wrap<T extends object>(name: string, api: T): T {\n  if (locked) throw new Error('bus is locked')\n  override(name, api)\n  return new Proxy<T>(api, {\n    get(_, key) {\n      return store.get(name)[key] || store.get(name)?.default?.[key]\n    },\n    apply(_, self, args) {\n      return (store.get(name) as TCallable).apply(self, args)\n    },\n  })\n}\n\n/**\n * @internal\n * @private\n * @protected\n */\nexport const bus = {\n  override,\n  wrap,\n  lock,\n}\n"
  },
  {
    "path": "src/log.ts",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     https://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { chalk, type RequestInfo, type RequestInit } from './vendor-core.ts'\nimport { inspect } from 'node:util'\nimport { type Buffer } from 'node:buffer'\nimport process from 'node:process'\n\nexport type LogEntry = {\n  verbose?: boolean\n} & (\n  | {\n      kind: 'cmd'\n      cmd: string\n      cwd: string\n      id: string\n    }\n  | {\n      kind: 'stdout'\n      data: Buffer\n      id: string\n    }\n  | {\n      kind: 'stderr'\n      data: Buffer\n      id: string\n    }\n  | {\n      kind: 'end'\n      exitCode: number | null\n      signal: NodeJS.Signals | null\n      duration: number\n      error: null | Error\n      id: string\n    }\n  | {\n      kind: 'cd'\n      dir: string\n    }\n  | {\n      kind: 'fetch'\n      url: RequestInfo\n      init?: RequestInit\n    }\n  | {\n      kind: 'retry'\n      attempt: number\n      total: number\n      delay: number\n      exception: unknown\n      error?: string\n    }\n  | {\n      kind: 'custom'\n      data: any\n    }\n  | {\n      kind: 'kill'\n      pid: number | `${number}`\n      signal: NodeJS.Signals | null\n    }\n)\n\ntype LogFormatters = {\n  [key in LogEntry['kind']]: (\n    entry: Extract<LogEntry, { kind: key }>\n  ) => string | Buffer\n}\n\nconst formatters: LogFormatters = {\n  cmd({ cmd }) {\n    return formatCmd(cmd)\n  },\n  stdout({ data }) {\n    return data\n  },\n  stderr({ data }) {\n    return data\n  },\n  custom({ data }) {\n    return data\n  },\n  fetch(entry) {\n    const init = entry.init ? ' ' + inspect(entry.init) : ''\n    return `$ ${chalk.greenBright('fetch')} ${entry.url}${init}\\n`\n  },\n  cd(entry) {\n    return `$ ${chalk.greenBright('cd')} ${entry.dir}\\n`\n  },\n  retry(entry) {\n    const attempt = `Attempt: ${entry.attempt}${entry.total == Infinity ? '' : `/${entry.total}`}`\n    const delay = entry.delay > 0 ? `; next in ${entry.delay}ms` : ''\n\n    return `${chalk.bgRed.white(' FAIL ')} ${attempt}${delay}\\n`\n  },\n  end() {\n    return ''\n  },\n  kill() {\n    return ''\n  },\n}\n\ntype Log = {\n  (entry: LogEntry): void\n  formatters?: Partial<LogFormatters>\n  output?: NodeJS.WriteStream\n}\n\nexport const log: Log = function (entry) {\n  if (!entry.verbose) return\n  const stream = log.output || process.stderr\n  const format = (log.formatters?.[entry.kind] || formatters[entry.kind]) as (\n    entry: LogEntry\n  ) => string | Buffer\n  if (!format) return // ignore unknown log entries\n\n  stream.write(format(entry))\n}\n\nconst SPACE_RE = /\\s/\nconst SYNTAX = '()[]{}<>;:+|&='\nconst CMD_BREAK = '|&;><'\nconst RESERVED_WORDS = new Set([\n  'if',\n  'then',\n  'else',\n  'elif',\n  'fi',\n  'case',\n  'esac',\n  'for',\n  'select',\n  'while',\n  'until',\n  'do',\n  'done',\n  'in',\n  'EOF',\n])\n\nexport function formatCmd(cmd: string): string {\n  if (cmd == undefined) return chalk.grey('undefined')\n  let q = ''\n  let out = '$ '\n  let buf = ''\n  let mode: 'syntax' | 'quote' | 'dollar' | '' = ''\n  let pos = 0\n  const cap = () => {\n    const word = buf.trim()\n    if (word) {\n      pos++\n      if (mode === 'syntax') {\n        if (CMD_BREAK.includes(word)) {\n          pos = 0\n        }\n        out += chalk.red(buf)\n      } else if (mode === 'quote' || mode === 'dollar') {\n        out += chalk.yellowBright(buf)\n      } else if (RESERVED_WORDS.has(word)) {\n        out += chalk.cyanBright(buf)\n      } else if (pos === 1) {\n        out += chalk.greenBright(buf)\n        pos = Infinity\n      } else {\n        out += buf\n      }\n    } else {\n      out += buf\n    }\n    mode = ''\n    buf = ''\n  }\n\n  for (const c of [...cmd]) {\n    if (!q) {\n      if (c === '$') {\n        cap()\n        mode = 'dollar'\n        buf += c\n        cap()\n      } else if (c === \"'\" || c === '\"') {\n        cap()\n        mode = 'quote'\n        q = c\n        buf += c\n      } else if (SPACE_RE.test(c)) {\n        cap()\n        buf += c\n      } else if (SYNTAX.includes(c)) {\n        const isEnv = c === '=' && pos === 0\n        isEnv && (pos = 1)\n        cap()\n        mode = 'syntax'\n        buf += c\n        cap()\n        isEnv && (pos = -1)\n      } else {\n        buf += c\n      }\n    } else {\n      buf += c\n      if (c === q) {\n        cap()\n        q = ''\n      }\n    }\n  }\n  cap()\n  return out.replace(/\\n/g, chalk.reset('\\n> ')) + '\\n'\n}\n"
  },
  {
    "path": "src/md.ts",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     https://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { type Buffer } from 'node:buffer'\nimport { bufToString } from './util.ts'\n\nexport function transformMarkdown(buf: Buffer | string): string {\n  const out: string[] = []\n  const tabRe = /^(  +|\\t)/\n  const fenceRe =\n    /^(?<indent> {0,3})(?<fence>(`{3,20}|~{3,20}))(?:(?<js>js|javascript|ts|typescript)|(?<bash>sh|shell|bash)|.*)$/\n\n  let state = 'root'\n  let prevEmpty = true\n\n  let fenceChar = ''\n  let stripRe: RegExp | null = null\n  let endRe = /^$/\n  let linePrefix = ''\n  let closeOut = ''\n\n  const isEnd = (s: string) => fenceChar !== '' && endRe.test(s)\n\n  for (const line of bufToString(buf).split(/\\r\\n|[\\n\\r\\u2028\\u2029]/)) {\n    switch (state) {\n      case 'root': {\n        const g = line.match(fenceRe)?.groups\n        if (g?.fence) {\n          fenceChar = g.fence[0]\n          stripRe = g.indent ? new RegExp(`^ {0,${g.indent.length}}`) : null\n          endRe = new RegExp(`^ {0,3}${fenceChar}{${g.fence.length},}[ \\\\t]*$`)\n\n          if (g.js) {\n            out.push('')\n            linePrefix = ''\n            closeOut = ''\n          } else if (g.bash) {\n            out.push('await $`')\n            linePrefix = ''\n            closeOut = '`'\n          } else {\n            out.push('')\n            linePrefix = '// '\n            closeOut = ''\n          }\n\n          state = 'fence'\n          prevEmpty = false\n          break\n        }\n\n        if (prevEmpty && tabRe.test(line)) {\n          out.push(line)\n          state = 'tab'\n          continue\n        }\n\n        prevEmpty = line === ''\n        out.push('// ' + line)\n        continue\n      }\n\n      case 'tab':\n        if (line === '') out.push('')\n        else if (tabRe.test(line)) out.push(line)\n        else {\n          out.push('// ' + line)\n          state = 'root'\n        }\n        prevEmpty = line === ''\n        break\n\n      case 'fence':\n        if (isEnd(line)) {\n          out.push(closeOut)\n          state = 'root'\n          prevEmpty = true\n          fenceChar = ''\n        } else {\n          const s = stripRe ? line.replace(stripRe, '') : line\n          out.push(linePrefix + s)\n          prevEmpty = false\n        }\n        break\n    }\n  }\n\n  return out.join('\\n')\n}\n"
  },
  {
    "path": "src/repl.ts",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     https://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport process from 'node:process'\nimport repl from 'node:repl'\nimport { inspect } from 'node:util'\nimport { ProcessOutput, defaults, chalk, path, os } from './core.ts'\n\nconst HISTORY =\n  process.env.ZX_REPL_HISTORY ?? path.join(os.homedir(), '.zx_repl_history')\n\nexport async function startRepl(history = HISTORY) {\n  defaults.verbose = false\n  const r = repl.start({\n    prompt: chalk.greenBright.bold('❯ '),\n    useGlobal: true,\n    preview: false,\n    writer(output: any) {\n      return output instanceof ProcessOutput\n        ? output.toString().trimEnd()\n        : inspect(output, { colors: true })\n    },\n  })\n  r.setupHistory(history, () => {})\n}\n"
  },
  {
    "path": "src/util.ts",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     https://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport path from 'node:path'\nimport { type Buffer } from 'node:buffer'\nimport process from 'node:process'\nimport { type TSpawnStore } from './vendor-core.ts'\n\nexport { isStringLiteral } from './vendor-core.ts'\n\nexport function noop() {}\n\nexport function identity<T>(v: T): T {\n  return v\n}\n\nexport function randomId() {\n  return Math.random().toString(36).slice(2)\n}\n\nexport function isString(obj: any) {\n  return typeof obj === 'string'\n}\n\nconst utf8Decoder = new TextDecoder('utf-8')\nexport const bufToString = (buf: Buffer | string): string =>\n  isString(buf) ? buf : utf8Decoder.decode(buf)\n\nexport const bufArrJoin = (arr: TSpawnStore[keyof TSpawnStore]): string =>\n  arr.reduce((acc, buf) => acc + bufToString(buf), '')\n\nexport const getLast = <T>(arr: { length: number; [i: number]: any }): T =>\n  arr[arr.length - 1]\n\nexport function preferLocalBin(\n  env: NodeJS.ProcessEnv,\n  ...dirs: (string | undefined)[]\n) {\n  const pathKey =\n    process.platform === 'win32'\n      ? Object.keys(env)\n          .reverse()\n          .find((key) => key.toUpperCase() === 'PATH') || 'Path'\n      : 'PATH'\n  const pathValue = dirs\n    .map(\n      (c) =>\n        c && [\n          path.resolve(c as string, 'node_modules', '.bin'),\n          path.resolve(c as string),\n        ]\n    )\n    .flat()\n    .concat(env[pathKey])\n    .filter(Boolean)\n    .join(path.delimiter)\n\n  return {\n    ...env,\n    [pathKey]: pathValue,\n  }\n}\n\nexport function quote(arg: string): string {\n  if (arg === '') return `$''`\n  if (/^[\\w/.\\-+@:=,%]+$/.test(arg)) return arg\n\n  return (\n    `$'` +\n    arg\n      .replace(/\\\\/g, '\\\\\\\\')\n      .replace(/'/g, \"\\\\'\")\n      .replace(/\\f/g, '\\\\f')\n      .replace(/\\n/g, '\\\\n')\n      .replace(/\\r/g, '\\\\r')\n      .replace(/\\t/g, '\\\\t')\n      .replace(/\\v/g, '\\\\v')\n      .replace(/\\0/g, '\\\\0') +\n    `'`\n  )\n}\n\nexport function quotePowerShell(arg: string): string {\n  if (arg === '') return `''`\n  if (/^[\\w/.\\-@:=,+%]+$/.test(arg)) return arg\n\n  return `'` + arg.replace(/'/g, \"''\") + `'`\n}\n\nexport type Duration =\n  | number\n  | `${number}`\n  | `${number}m`\n  | `${number}s`\n  | `${number}ms`\n\nexport function parseDuration(d: Duration) {\n  if (typeof d === 'number') {\n    if (isNaN(d) || d < 0) throw new Error(`Invalid duration: \"${d}\".`)\n    return d\n  }\n  const [m, v, u] = d.match(/^(\\d+)(m?s?)$/) || []\n  if (!m) throw new Error(`Unknown duration: \"${d}\".`)\n\n  return +v * ({ s: 1000, ms: 1, m: 60_000 }[u] || 1)\n}\n\nexport const once = <T extends (...args: any[]) => any>(fn: T) => {\n  let called = false\n  let result: ReturnType<T>\n\n  return (...args: Parameters<T>): ReturnType<T> =>\n    called ? result : ((called = true), (result = fn(...args)))\n}\n\nexport const proxyOverride = <T extends object>(\n  origin: T,\n  ...fallbacks: any\n): T =>\n  new Proxy(origin, {\n    get(target: any, key) {\n      return (\n        fallbacks.find((f: any) => key in f)?.[key] ?? Reflect.get(target, key)\n      )\n    },\n  }) as T\n\nexport const toCamelCase = (str: string) =>\n  str\n    .toLowerCase()\n    .replace(/([a-z])[_-]+([a-z])/g, (_, p1, p2) => p1 + p2.toUpperCase())\n\nexport const parseBool = (v: string): boolean | string =>\n  v === 'true' || (v !== 'false' && v)\n\nexport const getLines = (\n  chunk: Buffer | string,\n  next: (string | undefined)[],\n  delimiter: string | RegExp\n) => {\n  const lines = ((next.pop() || '') + bufToString(chunk)).split(delimiter)\n  next.push(lines.pop())\n  return lines\n}\n\nexport const iteratorToArray = <T>(it: Iterator<T>): T[] => {\n  const arr = []\n  let entry\n  while (!(entry = it.next()).done) arr.push(entry.value)\n  return arr\n}\n"
  },
  {
    "path": "src/vendor-core.ts",
    "content": "// Copyright 2024 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     https://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { default as _chalk } from 'chalk'\nimport { default as _which } from 'which'\nimport { default as _ps } from '@webpod/ps'\nimport { bus } from './internals.ts'\n\nexport {\n  type TSpawnStore,\n  exec,\n  buildCmd,\n  isStringLiteral,\n  VoidStream,\n} from 'zurk/spawn'\n\nexport type RequestInfo = Parameters<typeof globalThis.fetch>[0]\nexport type RequestInit = Parameters<typeof globalThis.fetch>[1] & {\n  signal?: AbortSignal\n}\n\nexport { type ChalkInstance } from 'chalk'\nexport const chalk: typeof _chalk = bus.wrap('chalk', _chalk)\nexport const which: typeof _which = bus.wrap('which', _which)\nexport const ps: typeof _ps = bus.wrap('ps', _ps)\n"
  },
  {
    "path": "src/vendor-extra.ts",
    "content": "// Copyright 2024 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     https://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { URL } from 'node:url'\nimport {\n  convertPathToPattern,\n  globby,\n  globbySync,\n  globbyStream,\n  generateGlobTasksSync,\n  generateGlobTasks,\n  isGitIgnoredSync,\n  isGitIgnored,\n  isDynamicPattern,\n  type Options as GlobbyOptions,\n} from 'globby'\nimport * as _yaml from 'yaml'\nimport * as _maml from 'maml.js'\nimport * as _fs from 'fs-extra'\nimport _createRequire from 'create-require'\nimport { fetch as _nodeFetch, AbortController } from 'node-fetch-native'\nimport { depseekSync as _depseek } from 'depseek'\nimport { default as _minimist } from 'minimist'\nimport { default as _dotenv } from 'envapi'\n\nimport { bus } from './internals.ts'\n\nconst { wrap } = bus\n\n// Calculate a global variable for use (Deno/NodeJS) runtime.\n// deno-lint-ignore no-node-globals\nconst globalVar = 'Deno' in globalThis ? globalThis : global\n\nglobalVar.AbortController = globalVar.AbortController || AbortController\n\nexport const createRequire = _createRequire as unknown as (\n  filename: string | URL\n) => NodeJS.Require\n\nconst globbyModule = {\n  convertPathToPattern,\n  globby,\n  sync: globbySync,\n  globbySync,\n  globbyStream,\n  generateGlobTasksSync,\n  generateGlobTasks,\n  isGitIgnoredSync,\n  isGitIgnored,\n  isDynamicPattern,\n}\n\nconst _glob = Object.assign(function globby(\n  patterns: string | readonly string[],\n  options?: GlobbyOptions\n) {\n  return globbyModule.globby(patterns, options)\n}, globbyModule) as (typeof globbyModule)['globby'] & typeof globbyModule\n\nconst _YAML: YAML = _yaml\n\nexport interface YAML {\n  parse(text: string): any\n  stringify(object: any): string\n  /** @deprecated */\n  parseAllDocuments(s: string, opts?: any): any[]\n  /** @deprecated */\n  parseDocument(s: string, opts?: any): any\n  /** @deprecated */\n  isAlias(v: any): boolean\n  /** @deprecated */\n  isCollection(v: any): boolean\n  /** @deprecated */\n  isDocument(v: any): boolean\n  /** @deprecated */\n  isMap(v: any): boolean\n  /** @deprecated */\n  isNode(v: any): boolean\n  /** @deprecated */\n  isPair(v: any): boolean\n  /** @deprecated */\n  isScalar(v: any): boolean\n  /** @deprecated */\n  isSeq(v: any): boolean\n  /** @deprecated */\n  Alias: any\n  /** @deprecated */\n  Composer: any\n  /** @deprecated */\n  Document: any\n  /** @deprecated */\n  Schema: any\n  /** @deprecated */\n  YAMLSeq: any\n  /** @deprecated */\n  YAMLMap: any\n  /** @deprecated */\n  YAMLError: any\n  /** @deprecated */\n  YAMLParseError: any\n  /** @deprecated */\n  YAMLWarning: any\n  /** @deprecated */\n  Pair: any\n  /** @deprecated */\n  Scalar: any\n  /** @deprecated */\n  Lexer: any\n  /** @deprecated */\n  LineCounter: any\n  /** @deprecated */\n  Parser: any\n}\n\nexport const depseek: typeof _depseek = wrap('depseek', _depseek)\nexport const dotenv: typeof _dotenv = wrap('dotenv', _dotenv)\nexport const fs: typeof import('fs-extra') = wrap('fs', _fs)\nexport const YAML: typeof _YAML = wrap('YAML', _YAML)\nexport const MAML: typeof _maml = wrap('MAML', _maml)\nexport const glob: typeof _glob = wrap('glob', _glob)\nexport const nodeFetch: typeof _nodeFetch = wrap('nodeFetch', _nodeFetch)\n\nexport const minimist: typeof _minimist = wrap('minimist', _minimist)\nexport namespace minimist {\n  export interface Opts extends _minimist.Opts {}\n  export interface ParsedArgs extends _minimist.ParsedArgs {}\n}\n"
  },
  {
    "path": "src/vendor.ts",
    "content": "// Copyright 2024 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     https://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nexport * from './vendor-core.ts'\nexport * from './vendor-extra.ts'\n"
  },
  {
    "path": "src/versions.ts",
    "content": "// Copyright 2026 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     https://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nexport const versions: Record<string, string> = {\n  zx: '8.9.0',\n  chalk: '5.6.2',\n  depseek: '0.4.3',\n  dotenv: '0.2.3',\n  fetch: '1.6.7',\n  fs: '11.3.3',\n  glob: '16.1.1',\n  minimist: '1.2.8',\n  ps: '1.0.0',\n  which: '6.0.1',\n  yaml: '2.8.2',\n}\n"
  },
  {
    "path": "test/all.test.js",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     https://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport './cli.test.js'\nimport './core.test.js'\nimport './deps.test.js'\nimport './error.test.ts'\nimport './export.test.js'\nimport './global.test.js'\nimport './goods.test.ts'\nimport './index.test.js'\nimport './log.test.ts'\nimport './md.test.ts'\nimport './util.test.js'\nimport './vendor.test.js'\n"
  },
  {
    "path": "test/bench/buf-join.mjs",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     https://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport cronometro from 'cronometro'\n\nconst STR = 'a'.repeat(1024)\nconst BUF = Buffer.from(STR)\nconst BUF_ARR = new Array(128).fill(null).map(() => Buffer.from(STR))\nconst STR_ARR = new Array(128).fill(STR)\n\nconst decoder = new TextDecoder()\ncronometro({\n  buf_arr_map_decode_join() {\n    BUF_ARR.map(decoder.decode.bind(decoder)).join('')\n  },\n  buf_arr_reduce_decode() {\n    BUF_ARR.reduce((acc, buf) => acc + decoder.decode(buf), '')\n  },\n  buf_arr_reduce_to_string() {\n    BUF_ARR.reduce((acc, buf) => acc + buf.toString('utf8'), '')\n  },\n  buf_arr_for_decode() {\n    let res = ''\n    for (const buf of BUF_ARR) {\n      res += decoder.decode(buf)\n    }\n  },\n  buf_arr_while_decode() {\n    let res = ''\n    let i = 0\n    const bl = BUF_ARR.length\n    while (i < bl) {\n      res += decoder.decode(BUF_ARR[i])\n      i++\n    }\n  },\n  buf_arr_join() {\n    BUF_ARR.join('')\n  },\n  buf_arr_concat_decode() {\n    decoder.decode(Buffer.concat(BUF_ARR))\n  },\n  str_arr_join() {\n    STR_ARR.join('')\n  },\n  str_arr_reduce() {\n    STR_ARR.reduce((acc, buf) => acc + buf, '')\n  },\n})\n"
  },
  {
    "path": "test/cli.test.js",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     https://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport assert from 'node:assert'\nimport { test, describe, before, after } from 'node:test'\nimport { fileURLToPath } from 'node:url'\nimport net from 'node:net'\nimport getPort from 'get-port'\nimport { $, path, tmpfile, tmpdir, fs } from '../build/index.js'\nimport { isMain, normalizeExt } from '../build/cli.js'\nimport { fakeServer } from './fixtures/server.mjs'\n\nconst __filename = fileURLToPath(import.meta.url)\nconst spawn = $.spawn\nconst nodeMajor = +process.versions?.node?.split('.')[0]\nconst test22 = nodeMajor >= 22 ? test : test.skip\n\ndescribe('cli', () => {\n  // Helps to detect unresolved ProcessPromise.\n  before(() => {\n    const spawned = []\n    $.spawn = (...args) => {\n      const proc = spawn(...args)\n      const done = () => (proc._done = true)\n      spawned.push(proc)\n      return proc.once('close', done).once('error', done)\n    }\n    process.on('exit', () => {\n      if (spawned.some((p) => p._done !== true)) {\n        console.error('Error: ProcessPromise never resolved.')\n        process.exitCode = 1\n      }\n    })\n  })\n  after(() => ($.spawn = spawn))\n\n  test('promise resolved', async () => {\n    await $`echo`\n  })\n\n  test('prints version', async () => {\n    assert.match((await $`node build/cli.js -v`).toString(), /\\d+.\\d+.\\d+/)\n  })\n\n  test('prints help', async () => {\n    const p = $`node build/cli.js -h`\n    p.stdin.end()\n    const help = await p\n    assert.match(help.stdout, /zx/)\n  })\n\n  test('zx prints usage if no param passed', async () => {\n    const p = $`node build/cli.js`\n    p.stdin.end()\n    try {\n      await p\n      assert.fail('must throw')\n    } catch (out) {\n      assert.match(out.stdout, /A tool for writing better scripts/)\n      assert.equal(out.exitCode, 1)\n    }\n  })\n\n  test('starts repl with --repl', async () => {\n    const p = $`node build/cli.js --repl`\n    p.stdin.write('await $`echo f\"o\"o`\\n')\n    p.stdin.write('\"b\"+\"ar\"\\n')\n    p.stdin.end()\n    const out = await p\n    assert.match(out.stdout, /foo/)\n    assert.match(out.stdout, /bar/)\n  })\n\n  test('starts repl with verbosity off', async () => {\n    const p = $`node build/cli.js --repl`\n    p.stdin.write('\"verbose\" + \" is \" + $.verbose\\n')\n    p.stdin.end()\n    const out = await p\n    assert.match(out.stdout, /verbose is false/)\n  })\n\n  test('supports `--quiet` flag', async () => {\n    const p = await $`node build/cli.js --quiet test/fixtures/markdown.md`\n    assert.ok(!p.stderr.includes('ignore'), 'ignore was printed')\n    assert.ok(!p.stderr.includes('hello'), 'no hello')\n    assert.ok(p.stdout.includes('world'), 'no world')\n  })\n\n  test('supports `--shell` flag ', async () => {\n    const shell = $.shell\n    const p =\n      await $`node build/cli.js --verbose --shell=${shell} <<< '$\\`echo \\${$.shell}\\`'`\n    assert.ok(p.stderr.includes(shell))\n  })\n\n  test('supports `--prefix` flag ', async () => {\n    const prefix = 'set -e;'\n    const p =\n      await $`node build/cli.js --verbose --prefix=${prefix} <<< '$\\`echo \\${$.prefix}\\`'`\n    assert.ok(p.stderr.includes(prefix))\n  })\n\n  test('supports `--postfix` flag ', async () => {\n    const postfix = '; exit 0'\n    const p =\n      await $`node build/cli.js --verbose --postfix=${postfix} <<< '$\\`echo \\${$.postfix}\\`'`\n    assert.ok(p.stderr.includes(postfix))\n  })\n\n  test('supports `--cwd` option ', async () => {\n    const cwd = path.resolve(fileURLToPath(import.meta.url), '../../temp')\n    fs.mkdirSync(cwd, { recursive: true })\n    const p =\n      await $`node build/cli.js --verbose --cwd=${cwd} <<< '$\\`echo \\${$.cwd}\\`'`\n    assert.ok(p.stderr.endsWith(cwd + '\\n'))\n  })\n\n  test('supports `--env` option', async () => {\n    const env = tmpfile(\n      '.env',\n      `FOO=BAR\n      BAR=FOO+`\n    )\n    const file = `\n    console.log((await $\\`echo $FOO\\`).stdout);\n    console.log((await $\\`echo $BAR\\`).stdout)\n    `\n\n    const out = await $`node build/cli.js --env=${env} <<< ${file}`\n    fs.remove(env)\n    assert.equal(out.stdout, 'BAR\\n\\nFOO+\\n\\n')\n  })\n\n  test('supports `--env` and `--cwd` options with file', async () => {\n    const env = tmpfile(\n      '.env',\n      `FOO=BAR\n      BAR=FOO+`\n    )\n    const dir = tmpdir()\n    const file = `\n      console.log((await $\\`echo $FOO\\`).stdout);\n      console.log((await $\\`echo $BAR\\`).stdout)\n      `\n\n    const out =\n      await $`node build/cli.js --cwd=${dir} --env=${env}  <<< ${file}`\n    fs.remove(env)\n    fs.remove(dir)\n    assert.equal(out.stdout, 'BAR\\n\\nFOO+\\n\\n')\n  })\n\n  test('supports handling errors with the `--env` option', async () => {\n    const file = `\n      console.log((await $\\`echo $FOO\\`).stdout);\n      console.log((await $\\`echo $BAR\\`).stdout)\n      `\n    try {\n      await $`node build/cli.js --env=./env <<< ${file}`\n      fs.remove(env)\n      assert.throw()\n    } catch (e) {\n      assert.equal(e.exitCode, 1)\n    }\n  })\n\n  describe('`--prefer-local`', () => {\n    const pkgIndex = `export const a = 'AAA'`\n    const pkgJson = {\n      name: 'a',\n      version: '1.0.0',\n      type: 'module',\n      exports: './index.js',\n    }\n    const script = `\nimport {a} from 'a'\nconsole.log(a);\n`\n\n    test('true', async () => {\n      const cwd = tmpdir()\n      await fs.outputFile(path.join(cwd, 'node_modules/a/index.js'), pkgIndex)\n      await fs.outputJson(\n        path.join(cwd, 'node_modules/a/package.json'),\n        pkgJson\n      )\n\n      const out =\n        await $`node build/cli.js --cwd=${cwd} --prefer-local=true --test <<< ${script}`\n      assert.equal(out.stdout, 'AAA\\n')\n      assert.ok(await fs.exists(path.join(cwd, 'node_modules/a/index.js')))\n    })\n\n    test('external dir', async () => {\n      const cwd = tmpdir()\n      const external = tmpdir()\n      await fs.outputFile(\n        path.join(external, 'node_modules/a/index.js'),\n        pkgIndex\n      )\n      await fs.outputJson(\n        path.join(external, 'node_modules/a/package.json'),\n        pkgJson\n      )\n\n      const out =\n        await $`node build/cli.js --cwd=${cwd} --prefer-local=${external} --test <<< ${script}`\n      assert.equal(out.stdout, 'AAA\\n')\n      assert.ok(await fs.exists(path.join(external, 'node_modules/a/index.js')))\n    })\n\n    test('external alias', async () => {\n      const cwd = tmpdir()\n      const external = tmpdir()\n      await fs.outputFile(\n        path.join(external, 'node_modules/a/index.js'),\n        pkgIndex\n      )\n      await fs.outputJson(\n        path.join(external, 'node_modules/a/package.json'),\n        pkgJson\n      )\n      await fs.symlinkSync(\n        path.join(external, 'node_modules'),\n        path.join(cwd, 'node_modules'),\n        'junction'\n      )\n\n      const out =\n        await $`node build/cli.js --cwd=${cwd} --prefer-local=true --test <<< ${script}`\n      assert.equal(out.stdout, 'AAA\\n')\n      assert.ok(await fs.exists(path.join(cwd, 'node_modules')))\n    })\n\n    test('throws if exists', async () => {\n      const cwd = tmpdir()\n      const external = tmpdir()\n      await fs.outputFile(path.join(cwd, 'node_modules/a/index.js'), pkgIndex)\n      await fs.outputFile(\n        path.join(external, 'node_modules/a/index.js'),\n        pkgIndex\n      )\n      assert.rejects(\n        () =>\n          $`node build/cli.js --cwd=${cwd} --prefer-local=${external} --test <<< ${script}`,\n        /node_modules already exists/\n      )\n    })\n\n    test('throws if not dir', async () => {\n      const cwd = tmpdir()\n      const external = tmpdir()\n      await fs.outputFile(path.join(external, 'node_modules'), pkgIndex)\n      assert.rejects(\n        () =>\n          $`node build/cli.js --cwd=${cwd} --prefer-local=${external} --test <<< ${script}`,\n        /node_modules doesn't exist or is not a directory/\n      )\n    })\n  })\n\n  test('scripts from https 200', async () => {\n    const resp = await fs.readFile(path.resolve('test/fixtures/echo.http'))\n    const port = await getPort()\n    const server = await fakeServer([resp]).start(port)\n    const out =\n      await $`node build/cli.js --verbose http://127.0.0.1:${port}/script.mjs`\n    assert.match(out.stderr, /test/)\n    await server.stop()\n  })\n\n  test('scripts from https 500', async () => {\n    const port = await getPort()\n    const server = await fakeServer([`HTTP/1.1 500\\n\\n500\\n`]).listen(port)\n    const out = await $`node build/cli.js http://127.0.0.1:${port}`.nothrow()\n    assert.match(out.stderr, /Error: Can't get/)\n    assert.match(out.stderr, /Failed to fetch remote script/)\n    assert.equal(out.exitCode, 1)\n    await server.stop()\n  })\n\n  test('scripts (md) from https', async () => {\n    const resp = await fs.readFile(path.resolve('test/fixtures/md.http'))\n    const port = await getPort()\n    const server = await fakeServer([resp]).start(port)\n    const out =\n      await $`node build/cli.js --verbose http://127.0.0.1:${port}/script.md`\n    assert.match(out.stderr, /md/)\n    await server.stop()\n  })\n\n  test('scripts with no extension', async () => {\n    await $`node build/cli.js test/fixtures/no-extension`\n    assert.ok(\n      /Test file to verify no-extension didn't overwrite similarly name .mjs file./.test(\n        (await fs.readFile('test/fixtures/no-extension.mjs')).toString()\n      )\n    )\n  })\n\n  test('scripts with non standard extension', async () => {\n    const o =\n      await $`node build/cli.js --ext='.mjs' test/fixtures/non-std-ext.zx`\n    assert.ok(o.stdout.trim().endsWith('zx/test/fixtures/non-std-ext.zx.mjs'))\n\n    await assert.rejects(\n      $`node build/cli.js test/fixtures/non-std-ext.zx`,\n      /Unknown file extension \"\\.zx\"/\n    )\n  })\n\n  test22('scripts from stdin with explicit extension', async () => {\n    const out =\n      await $`node --experimental-strip-types build/cli.js --ext='.ts' <<< 'const foo: string = \"bar\"; console.log(foo)'`\n    assert.match(out.stdout, /bar/)\n  })\n\n  test('require() is working from stdin', async () => {\n    const out =\n      await $`node build/cli.js <<< 'console.log(require(\"./package.json\").name)'`\n    assert.match(out.stdout, /zx/)\n  })\n\n  test('require() is working in ESM', async () => {\n    await $`node build/cli.js test/fixtures/require.mjs`\n  })\n\n  test('__filename & __dirname are defined', async () => {\n    await $`node build/cli.js test/fixtures/filename-dirname.mjs`\n  })\n\n  test('markdown scripts are working', async () => {\n    await $`node build/cli.js test/fixtures/markdown.md`\n  })\n\n  test('markdown scripts are working for CRLF', async () => {\n    const p = await $`node build/cli.js test/fixtures/markdown-crlf.md`\n    assert.ok(p.stdout.includes('Hello, world!'))\n  })\n\n  test('markdown scripts from stdin with --ext .md', async () => {\n    const md = '# Test\\n\\n```js\\necho(\"md-stdin-ok\")\\n```\\n'\n    const p = await $`node build/cli.js --ext='.md' <<< ${md}`\n    assert.match(p.stdout, /md-stdin-ok/)\n  })\n\n  test('exceptions are caught', async () => {\n    const out1 = await $`node build/cli.js <<<${'await $`wtf`'}`.nothrow()\n    const out2 = await $`node build/cli.js <<<'throw 42'`.nothrow()\n    assert.match(out1.stderr, /Error:/)\n    assert.match(out2.stderr, /42/)\n  })\n\n  test('eval works', async () => {\n    assert.equal((await $`node build/cli.js --eval 'echo(42)'`).stdout, '42\\n')\n    assert.equal((await $`node build/cli.js -e='echo(69)'`).stdout, '69\\n')\n  })\n\n  test('eval works with stdin', async () => {\n    const p = $`(printf foo; sleep 0.1; printf bar) | node build/cli.js --eval 'echo(await stdin())'`\n    assert.equal((await p).stdout, 'foobar\\n')\n  })\n\n  test('executes a script from $PATH', async () => {\n    const isWindows = process.platform === 'win32'\n    const oldPath = process.env.PATH\n    const toPOSIXPath = (_path) => _path.split(path.sep).join(path.posix.sep)\n\n    const zxPath = path.resolve('./build/cli.js')\n    const zxLocation = isWindows ? toPOSIXPath(zxPath) : zxPath\n    const scriptCode = `#!/usr/bin/env ${zxLocation}\\nconsole.log('The script from path runs.')`\n    const scriptName = 'script-from-path'\n    const scriptFile = tmpfile(scriptName, scriptCode, 0o744)\n    const scriptDir = path.dirname(scriptFile)\n\n    const envPathSeparator = isWindows ? ';' : ':'\n    process.env.PATH += envPathSeparator + scriptDir\n\n    try {\n      await $`chmod +x ${zxLocation}`\n      await $`${scriptName}`\n    } finally {\n      process.env.PATH = oldPath\n      await fs.rm(scriptFile)\n    }\n  })\n\n  test('argv works with zx and node', async () => {\n    assert.equal(\n      (await $`node build/cli.js test/fixtures/argv.mjs foo`).toString(),\n      `global {\"_\":[\"foo\"]}\\nimported {\"_\":[\"foo\"]}\\n`\n    )\n    assert.equal(\n      (await $`node test/fixtures/argv.mjs bar`).toString(),\n      `global {\"_\":[\"bar\"]}\\nimported {\"_\":[\"bar\"]}\\n`\n    )\n    assert.equal(\n      (\n        await $`node build/cli.js --eval 'console.log(argv._.join(''))' baz`\n      ).toString(),\n      `baz\\n`\n    )\n  })\n\n  test('exit code can be set', async () => {\n    const p = await $`node build/cli.js test/fixtures/exit-code.mjs`.nothrow()\n    assert.equal(p.exitCode, 42)\n  })\n\n  describe('internals', () => {\n    test('isMain() checks process entry point', () => {\n      assert.equal(isMain(import.meta.url, __filename), true)\n\n      assert.equal(\n        isMain(import.meta.url.replace('.js', '.cjs'), __filename),\n        true\n      )\n\n      try {\n        assert.equal(\n          isMain(\n            'file:///root/zx/test/cli.test.js',\n            '/root/zx/test/all.test.js'\n          ),\n          true\n        )\n        assert.throw()\n      } catch (e) {\n        assert.ok(['EACCES', 'ENOENT'].includes(e.code))\n      }\n    })\n\n    test('isMain() function is running from the wrong path', () => {\n      assert.equal(isMain('///root/zx/test/cli.test.js'), false)\n    })\n\n    test('normalizeExt()', () => {\n      assert.equal(normalizeExt('.ts'), '.ts')\n      assert.equal(normalizeExt('ts'), '.ts')\n      assert.equal(normalizeExt('.'), '.')\n      assert.equal(normalizeExt(), undefined)\n    })\n  })\n})\n"
  },
  {
    "path": "test/core.test.js",
    "content": "// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     https://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport assert from 'node:assert'\nimport { test, describe, before, after, it } from 'node:test'\nimport { inspect } from 'node:util'\nimport { basename } from 'node:path'\nimport { WriteStream } from 'node:fs'\nimport { Readable, Transform, Writable } from 'node:stream'\nimport { Socket } from 'node:net'\nimport { ChildProcess } from 'node:child_process'\nimport {\n  $,\n  ProcessPromise,\n  ProcessOutput,\n  defaults,\n  resolveDefaults,\n  cd,\n  syncProcessCwd,\n  within,\n  usePowerShell,\n  usePwsh,\n  useBash,\n  Fail,\n  kill,\n} from '../build/core.js'\nimport {\n  tempfile,\n  tempdir,\n  fs,\n  quote,\n  quotePowerShell,\n  sleep,\n  quiet,\n  which,\n  nothrow,\n  fetch,\n} from '../build/index.js'\nimport { noop } from '../build/util.cjs'\nimport { EventEmitter } from 'node:events'\n\ndescribe('core', () => {\n  describe('resolveDefaults()', () => {\n    test('overrides known (allowed) opts', async () => {\n      const defaults = resolveDefaults({ verbose: false }, 'ZX_', {\n        ZX_VERBOSE: 'true',\n        ZX_PREFER_LOCAL: '/foo/bar/',\n      })\n      assert.equal(defaults.verbose, true)\n      assert.equal(defaults.preferLocal, '/foo/bar/')\n    })\n\n    test('ignores unknown', async () => {\n      const defaults = resolveDefaults({}, 'ZX_', {\n        ZX_INPUT: 'input',\n        ZX_FOO: 'test',\n      })\n      assert.equal(defaults.input, undefined)\n      assert.equal(defaults.foo, undefined)\n    })\n  })\n\n  describe('$', () => {\n    test('is a regular function', async () => {\n      const _$ = $.bind(null)\n      const foo = await _$`echo foo`\n      assert.equal(foo.stdout, 'foo\\n')\n      assert.ok(typeof $.call === 'function')\n      assert.ok(typeof $.apply === 'function')\n    })\n\n    test('only stdout is used during command substitution', async () => {\n      const hello = await $`echo Error >&2; echo Hello`\n      const len = +(await $`echo ${hello} | wc -c`)\n      assert.equal(len, 6)\n    })\n\n    test('env vars works', async () => {\n      process.env.ZX_TEST_FOO = 'foo'\n      const foo = await $`echo $ZX_TEST_FOO`\n      assert.equal(foo.stdout, 'foo\\n')\n      delete process.env.ZX_TEST_FOO\n    })\n\n    test('env vars are safe to pass', async () => {\n      process.env.ZX_TEST_BAR = 'hi; exit 1'\n      const bar = await $`echo $ZX_TEST_BAR`\n      assert.equal(bar.stdout, 'hi; exit 1\\n')\n      delete process.env.ZX_TEST_BAR\n    })\n\n    test('arguments are quoted', async () => {\n      const bar = 'bar\"\";baz!$#^$\\'&*~*%)({}||\\\\/'\n      assert.equal((await $`echo ${bar}`).stdout.trim(), bar)\n    })\n\n    test('broken quoting', async () => {\n      const args = ['param && echo bar']\n      const p = $`echo --foo=$'${args}'`\n      assert.equal((await p).stdout, '--foo=$param\\nbar\\n')\n    })\n\n    test('undefined and empty string correctly quoted', async () => {\n      assert.equal((await $`echo -n ${undefined}`).toString(), 'undefined')\n      assert.equal((await $`echo -n ${''}`).toString(), '')\n    })\n\n    test('accepts thenable arguments', async () => {\n      const a1 = $`echo foo`\n      const a2 = new Promise((res) => setTimeout(res, 10, ['bar', 'baz']))\n      const a3 = new Promise((_, rej) => setTimeout(rej, 20, 'failure'))\n\n      const p1 = $`echo ${a1} ${a2}`\n      assert(p1.cmd instanceof Promise)\n      const o1 = await p1\n      assert(o1 instanceof ProcessOutput)\n      assert.equal(o1.stdout.trim(), 'foo bar baz')\n      assert.equal(p1.cmd, 'echo foo bar baz')\n\n      try {\n        await $`echo ${a3}`\n      } catch (e) {\n        assert.ok(e instanceof ProcessOutput)\n        assert.equal(e.exitCode, null)\n        assert.equal(e.cause, 'failure')\n      }\n\n      try {\n        await $`echo ${$`exit 1`}`\n      } catch (e) {\n        assert.ok(e instanceof ProcessOutput)\n        assert.ok(e.cause instanceof ProcessOutput)\n        assert.equal(e.exitCode, null)\n        assert.equal(e.cause.exitCode, 1)\n      }\n\n      await Promise.allSettled([a3])\n    })\n\n    test('rejects thenable args in sync mode', () => {\n      const a = new Promise((res) => setTimeout(res, 10, 'foo'))\n      assert.throws(\n        () => $.sync`echo ${a}`,\n        /sync mode does not allow async command resolution/\n      )\n    })\n\n    test.skip('handles multiline literals', async () => {\n      assert.equal(\n        (\n          await $`echo foo\n     bar\n     \"baz\n      qux\"\n`\n        ).toString(),\n        'foo bar baz\\n      qux\\n'\n      )\n      assert.equal(\n        (\n          await $`echo foo \\\n                     bar \\\n                     baz \\\n`\n        ).toString(),\n        'foo bar baz\\n'\n      )\n    })\n\n    test('can create a dir with a space in the name', async () => {\n      const name = 'foo bar'\n      try {\n        await $`mkdir /tmp/${name}`\n      } catch {\n        assert.unreachable()\n      } finally {\n        await fs.rmdir('/tmp/' + name)\n      }\n    })\n\n    test('pipefail is on', async () => {\n      let p\n      try {\n        p = await $`cat /dev/not_found | sort`\n      } catch (e) {\n        p = e\n      }\n      assert.notEqual(p.exitCode, 0)\n    })\n\n    test('toString() is called on arguments', async () => {\n      const foo = 0\n      const p = await $`echo ${foo}`\n      assert.equal(p.stdout, '0\\n')\n    })\n\n    test('can use array as an argument', async () => {\n      const _$ = $({ prefix: '', postfix: '' })\n      const p1 = _$`echo ${['-n', 'foo']}`\n      assert.equal(p1.cmd, 'echo -n foo')\n      assert.equal((await p1).toString(), 'foo')\n\n      const p2 = _$`echo ${[1, '', '*', '2']}`\n      assert.equal(p2.cmd, `echo 1 $'' $'*' 2`)\n      assert.equal((await p2).toString(), `1  * 2\\n`)\n    })\n\n    test('requires $.shell to be specified', async () => {\n      await within(() => {\n        $.shell = undefined\n        assert.throws(() => $`echo foo`, /shell/)\n      })\n    })\n\n    test('malformed cmd error', async () => {\n      assert.throws(() => $`\\033`, /malformed/i)\n\n      try {\n        $([null])\n        throw new Error('unreachable')\n      } catch (e) {\n        assert.ok(e instanceof Fail)\n        assert.match(e.message, /malformed/i)\n      }\n\n      const o = await $({ nothrow: true })`\\033`\n      assert.equal(o.ok, false)\n      assert.match(o.cause.message, /malformed/i)\n    })\n\n    test('snapshots works', async () => {\n      await within(async () => {\n        $.prefix += 'echo success;'\n        const p = $`:`\n        $.prefix += 'echo fail;'\n        const out = await p\n        assert.equal(out.stdout, 'success\\n')\n        assert.doesNotMatch(out.stdout, /fail/)\n      })\n    })\n\n    test('$ thrown as error', async () => {\n      let err\n      try {\n        await $`wtf`\n      } catch (p) {\n        err = p\n      }\n      assert.ok(err.exitCode > 0)\n      assert.match(err.toString(), /command not found/)\n      assert.match(err.valueOf(), /command not found/)\n      assert.match(err.stderr, /wtf: command not found/)\n      assert.match(err[inspect.custom](), /Command not found/)\n    })\n\n    test('provides clear error when cwd does not exist', async () => {\n      await within(async () => {\n        const fakePath = '/path/that/does/not/exist'\n        $.cwd = fakePath\n        try {\n          await $`echo hello`\n          assert.unreachable('should have thrown')\n        } catch (err) {\n          assert.ok(err instanceof ProcessOutput)\n          assert.match(\n            err.message,\n            /The working directory '\\/path\\/that\\/does\\/not\\/exist' does not exist/\n          )\n        }\n      })\n    })\n\n    test('await $`cmd`.exitCode does not throw', async () => {\n      assert.notEqual(await $`grep qwerty README.md`.exitCode, 0)\n      assert.equal(await $`[[ -f README.md ]]`.exitCode, 0)\n    })\n\n    test('`$.sync()` provides synchronous API', () => {\n      const o1 = $.sync`echo foo`\n      const o2 = $({ sync: true })`echo foo`\n      const o3 = $.sync({})`echo foo`\n      assert.equal(o1.stdout, 'foo\\n')\n      assert.equal(o2.stdout, 'foo\\n')\n      assert.equal(o3.stdout, 'foo\\n')\n    })\n\n    describe('$({opts}) API', () => {\n      it('$ proxy uses `defaults` store', () => {\n        assert.equal($.foo, undefined)\n        defaults.foo = 'bar'\n        $.baz = 'qux'\n        assert.equal($.foo, 'bar')\n        assert.equal($.baz, 'qux')\n        assert.equal(defaults.baz, 'qux')\n        delete defaults.foo\n        $.baz = undefined\n        assert.equal($.foo, undefined)\n        assert.equal($.baz, undefined)\n        assert.equal(defaults.baz, undefined)\n      })\n\n      test('provides presets', async () => {\n        const $1 = $({ nothrow: true })\n        assert.equal((await $1`exit 1`).exitCode, 1)\n\n        const $2 = $1({ sync: true })\n        assert.equal($2`exit 2`.exitCode, 2)\n\n        const $3 = $({ sync: true })({ nothrow: true })\n        assert.equal($3`exit 3`.exitCode, 3)\n\n        assert.equal($1.sync`exit 4`.exitCode, 4)\n        assert.equal($.sync({ nothrow: true })`exit 5`.exitCode, 5)\n      })\n\n      test('handles `nothrow` option', async () => {\n        const o1 = await $({ nothrow: true })`exit 1`\n        assert.equal(o1.ok, false)\n        assert.equal(o1.exitCode, 1)\n        assert.match(o1.message, /exit code: 1/)\n\n        const err = new Error('BrokenSpawn')\n        const o2 = await $({\n          nothrow: true,\n          spawn() {\n            throw err\n          },\n        })`echo foo`\n        assert.equal(o2.ok, false)\n        assert.equal(o2.exitCode, null)\n        assert.match(o2.message, /BrokenSpawn/)\n        assert.equal(o2.cause, err)\n      })\n\n      test('handles `input` option', async () => {\n        const p1 = $({ input: 'foo' })`cat`\n        const p2 = $({ input: Readable.from('bar') })`cat`\n        const p3 = $({ input: Buffer.from('baz') })`cat`\n        const p4 = $({ input: p3 })`cat`\n        const p5 = $({ input: await p3 })`cat`\n\n        assert.equal((await p1).stdout, 'foo')\n        assert.equal((await p2).stdout, 'bar')\n        assert.equal((await p3).stdout, 'baz')\n        assert.equal((await p4).stdout, 'baz')\n        assert.equal((await p5).stdout, 'baz')\n      })\n\n      test('handles `timeout` and `timeoutSignal`', async () => {\n        let exitCode, signal\n        try {\n          await $({\n            timeout: 10,\n            timeoutSignal: 'SIGKILL',\n          })`sleep 999`\n        } catch (p) {\n          exitCode = p.exitCode\n          signal = p.signal\n        }\n        assert.equal(exitCode, null)\n        assert.equal(signal, 'SIGKILL')\n      })\n\n      test('`env` option', async () => {\n        const baz = await $({\n          env: { ZX_TEST_BAZ: 'baz' },\n        })`echo $ZX_TEST_BAZ`\n        assert.equal(baz.stdout, 'baz\\n')\n      })\n\n      test('`preferLocal` preserves env', async () => {\n        const cases = [\n          [true, `${process.cwd()}/node_modules/.bin:${process.cwd()}:`],\n          ['/foo', `/foo/node_modules/.bin:/foo:`],\n          [\n            ['/bar', '/baz'],\n            `/bar/node_modules/.bin:/bar:/baz/node_modules/.bin:/baz`,\n          ],\n        ]\n\n        for (const [preferLocal, expected] of cases) {\n          const PATH = await $({\n            preferLocal,\n            env: { PATH: process.env.PATH },\n          })`echo $PATH`\n          assert(PATH.stdout.startsWith(expected))\n        }\n      })\n\n      test('supports custom intermediate store', async () => {\n        const getFixedSizeArray = (size) => {\n          const arr = []\n          return new Proxy(arr, {\n            get: (target, prop) =>\n              prop === 'push' && arr.length >= size\n                ? () => {\n                    /* noop */\n                  }\n                : target[prop],\n          })\n        }\n        const store = {\n          stdout: getFixedSizeArray(1),\n          stderr: getFixedSizeArray(1),\n          stdall: getFixedSizeArray(0),\n        }\n\n        const p = await $({ store })`echo foo`\n\n        assert.equal(p.stdout.trim(), 'foo')\n        assert.equal(p.toString(), '')\n      })\n    })\n\n    describe('accepts `stdio`', () => {\n      test('ignore', async () => {\n        const p = $({ stdio: 'ignore' })`echo foo`\n        assert.equal((await p).stdout, '')\n      })\n\n      test('inherit', async () => {\n        const r1 = (await $({ stdio: 'inherit' })`ls`).stdout\n        const r2 = $.sync({ stdio: 'inherit' })`ls`.stdout\n        assert.equal(r1, r2)\n      })\n\n      test('mixed', async () => {\n        assert.equal(\n          (\n            await $({\n              quiet: true,\n              stdio: ['inherit', 'pipe', 'ignore'],\n            })`>&2 echo error; echo ok`\n          ).toString(),\n          'ok\\n'\n        )\n      })\n\n      test('via stdio() method', async () => {\n        assert.equal(\n          (\n            await $({ halt: true })`>&2 echo error; echo ok`\n              .stdio('inherit', 'ignore', 'pipe')\n              .quiet()\n              .run()\n          ).toString(),\n          'error\\n'\n        )\n\n        assert.equal(\n          (\n            await $({ halt: true })`>&2 echo error; echo ok`\n              .stdio(['inherit', 'pipe', 'ignore'])\n              .quiet()\n              .run()\n          ).toString(),\n          'ok\\n'\n        )\n      })\n\n      test('file stream as stdout', async () => {\n        const createWriteStream = (f) => {\n          const stream = fs.createWriteStream(f)\n          return new Promise((resolve) => {\n            stream.on('open', () => resolve(stream))\n          })\n        }\n        const file = tempfile()\n        const stream = await createWriteStream(file)\n        const p = $({ stdio: ['pipe', stream, 'ignore'] })`echo foo`\n\n        await p\n        assert.equal((await fs.readFile(file)).toString(), 'foo\\n')\n      })\n    })\n\n    it('uses custom `log` if specified', async () => {\n      const entries = []\n      const log = (entry) => entries.push(entry)\n      const p = $({ log })`echo foo`\n      const { id } = p\n      const { duration } = await p\n      const cwd = process.cwd()\n\n      assert.equal(entries.length, 3)\n      assert.deepEqual(entries[0], {\n        kind: 'cmd',\n        cmd: 'echo foo',\n        cwd,\n        verbose: false,\n        id,\n      })\n      assert.deepEqual(entries[1], {\n        kind: 'stdout',\n        data: Buffer.from('foo\\n'),\n        verbose: false,\n        id,\n      })\n      assert.deepEqual(entries[2], {\n        kind: 'end',\n        duration,\n        exitCode: 0,\n        signal: null,\n        error: null,\n        verbose: false,\n        id,\n      })\n    })\n  })\n\n  describe('ProcessPromise', () => {\n    test('getters', async () => {\n      const p = $`echo foo`\n      assert.ok(typeof p.pid === 'number')\n      assert.ok(typeof p.id === 'string')\n      assert.ok(typeof p.cwd === 'string')\n      assert.ok(typeof p.cmd === 'string')\n      assert.ok(typeof p.fullCmd === 'string')\n      assert.ok(typeof p.stage === 'string')\n      assert.ok(p.child instanceof ChildProcess)\n      assert.ok(p.stdout instanceof Socket)\n      assert.ok(p.stderr instanceof Socket)\n      assert.ok(p.exitCode instanceof Promise)\n      assert.ok(p.signal instanceof AbortSignal)\n      assert.equal(p.output, null)\n      assert.equal(Object.prototype.toString.call(p), '[object ProcessPromise]')\n      assert.equal('' + p, '[object ProcessPromise]')\n      assert.equal(`${p}`, '[object ProcessPromise]')\n      assert.equal(+p, NaN)\n\n      await p\n      assert.ok(p.output instanceof ProcessOutput)\n    })\n\n    test('id is unique', async () => {\n      const p1 = $`echo foo`\n      const p2 = $`echo bar`\n\n      assert.ok(p1.id !== p2.id)\n      assert.ok(p1.id.length > 5)\n      assert.ok(p2.id.length > 5)\n\n      await p1\n      await p2\n    })\n\n    describe('state machine transitions', () => {\n      it('running > fulfilled', async () => {\n        const p = $`echo foo`\n        assert.equal(p.stage, 'running')\n        await p\n        assert.equal(p.stage, 'fulfilled')\n      })\n\n      it('running > rejected', async () => {\n        const p = $`foo`\n        assert.equal(p.stage, 'running')\n\n        try {\n          await p\n        } catch {}\n        assert.equal(p.stage, 'rejected')\n      })\n\n      it('halted > running > fulfilled', async () => {\n        const p = $({ halt: true })`echo foo`\n        assert.equal(p.stage, 'halted')\n        p.run()\n        assert.equal(p.stage, 'running')\n        await p\n        assert.equal(p.stage, 'fulfilled')\n      })\n\n      it('all transitions', async () => {\n        const { promise, resolve, reject } = Promise.withResolvers()\n        const p = new ProcessPromise(noop)\n        ProcessPromise.disarm(p, false)\n        assert.equal(p.stage, 'initial')\n\n        p._resolve = resolve\n        p._reject = reject\n        p._stage = 'halted'\n        p._snapshot = {\n          ...defaults,\n          ac: new AbortController(),\n          from: 'test',\n          cmd: 'echo foo',\n          ee: new EventEmitter(),\n        }\n\n        assert.equal(p.stage, 'halted')\n        p.run()\n        assert.equal(p.stage, 'running')\n        await promise\n        assert.equal(p.stage, 'fulfilled')\n        assert.equal(p.output.stdout, 'foo\\n')\n      })\n    })\n\n    test('inherits native Promise', async () => {\n      const p1 = $`echo 1`\n      const p2 = p1.then((v) => v)\n      const p3 = p2.then((v) => v)\n      const p4 = p3.catch((v) => v)\n      const p5 = p1.finally((v) => v)\n\n      assert(p1 instanceof Promise)\n      assert(p1 instanceof ProcessPromise)\n      assert(p2 instanceof ProcessPromise)\n      assert(p3 instanceof ProcessPromise)\n      assert(p4 instanceof ProcessPromise)\n      assert(p5 instanceof ProcessPromise)\n      assert.ok(p1 !== p2)\n      assert.ok(p2 !== p3)\n      assert.ok(p3 !== p4)\n      assert.ok(p5 !== p1)\n    })\n\n    test('asserts self instantiation', async () => {\n      const p = new ProcessPromise(() => {})\n\n      assert(typeof p.then === 'function')\n      assert.throws(() => p.stage, /Inappropriate usage/)\n    })\n\n    test('resolves with ProcessOutput', async () => {\n      const o = await $`echo foo`\n      assert.ok(o instanceof ProcessOutput)\n    })\n\n    test('cmd() returns cmd to exec', () => {\n      const foo = '#bar'\n      const baz = 1\n      const p = $`echo ${foo} --t ${baz}`\n      assert.equal(p.cmd, \"echo $'#bar' --t 1\")\n      assert.equal(p.fullCmd, \"set -euo pipefail;echo $'#bar' --t 1\")\n    })\n\n    test('stdin works', async () => {\n      const p = $`read; printf $REPLY`\n      p.stdin.write('bar\\n')\n      assert.equal((await p).stdout, 'bar')\n    })\n\n    describe('pipe()', () => {\n      test('accepts Writable', async () => {\n        let contents = ''\n        const stream = new Writable({\n          write: function (chunk, encoding, next) {\n            contents += chunk.toString()\n            next()\n          },\n        })\n        const p1 = $`echo 'test'`\n        const p2 = p1.pipe(stream)\n        assert.equal(p1._piped, true)\n        await p2\n        assert.equal(p1._piped, false)\n        assert.ok(p1.stderr instanceof Socket)\n        assert.equal(contents, 'test\\n')\n      })\n\n      test('throws if Writable ended', async () => {\n        const stream = { writableEnded: true }\n        const p = $`echo foo`\n        assert.throws(() => p.pipe(stream), /Cannot pipe to a closed stream/)\n        await p\n      })\n\n      test('accepts WriteStream', async () => {\n        const file = tempfile()\n        try {\n          await $`echo foo`.pipe(fs.createWriteStream(file))\n          assert.equal((await fs.readFile(file)).toString(), 'foo\\n')\n\n          const r = $`cat`\n          fs.createReadStream(file).pipe(r.stdin)\n          assert.equal((await r).stdout, 'foo\\n')\n        } finally {\n          await fs.rm(file)\n        }\n      })\n\n      test('accepts file', async () => {\n        const file = tempfile()\n        try {\n          await $`echo foo`.pipe(file)\n          assert.equal((await fs.readFile(file)).toString(), 'foo\\n')\n\n          const r = $`cat`\n          fs.createReadStream(file).pipe(r.stdin)\n          assert.equal((await r).stdout, 'foo\\n')\n        } finally {\n          await fs.rm(file)\n        }\n      })\n\n      test('accepts ProcessPromise', async () => {\n        const p = await $`echo foo`.pipe($`cat`)\n        assert.equal(p.stdout.trim(), 'foo')\n      })\n\n      test('throws if dest ProcessPromise is settled', async () => {\n        const dest = $`echo bar`\n        await dest\n        const p = $`echo foo`\n        assert.throws(() => p.pipe(dest), /Cannot pipe to a settled process/)\n        await p\n      })\n\n      test('detects inappropriate ProcessPromise', async () => {\n        const foo = $`echo foo`\n        const p1 = $`cat`\n        const p2 = p1.then((v) => v)\n\n        assert.throws(() => foo.pipe(p2), /Inappropriate usage/)\n        await foo.pipe(p1)\n      })\n\n      test('accepts $ template literal', async () => {\n        const p = await $`echo foo`.pipe`cat`\n        assert.equal(p.stdout.trim(), 'foo')\n      })\n\n      test('accepts stdout', async () => {\n        const p1 = $`echo pipe-to-stdout`\n        const p2 = p1.pipe(process.stdout)\n        assert.equal((await p1).stdout.trim(), 'pipe-to-stdout')\n      })\n\n      describe('supports chaining', () => {\n        const getUpperCaseTransform = () =>\n          new Transform({\n            transform(chunk, encoding, callback) {\n              callback(null, String(chunk).toUpperCase())\n            },\n          })\n\n        test('$ > $', async () => {\n          const { stdout: o1 } = await $`echo \"hello\"`\n            .pipe($`awk '{print $1\" world\"}'`)\n            .pipe($`tr '[a-z]' '[A-Z]'`)\n          assert.equal(o1, 'HELLO WORLD\\n')\n\n          const { stdout: o2 } = await $`echo \"hello\"`\n            .pipe`awk '{print $1\" world\"}'`.pipe`tr '[a-z]' '[A-Z]'`\n          assert.equal(o2, 'HELLO WORLD\\n')\n        })\n\n        test('$ > $ halted', async () => {\n          const $h = $({ halt: true })\n          const { stdout } = await $`echo \"hello\"`\n            .pipe($h`awk '{print $1\" world\"}'`)\n            .pipe($h`tr '[a-z]' '[A-Z]'`)\n\n          assert.equal(stdout, 'HELLO WORLD\\n')\n        })\n\n        test('$ halted > $ halted', async () => {\n          const $h = $({ halt: true })\n          const { stdout } = await $h`echo \"hello\"`\n            .pipe($h`awk '{print $1\" world\"}'`)\n            .pipe($h`tr '[a-z]' '[A-Z]'`)\n            .run()\n\n          assert.equal(stdout, 'HELLO WORLD\\n')\n        })\n\n        test('$ halted > $ literal', async () => {\n          const { stdout } = await $({ halt: true })`echo \"hello\"`\n            .pipe`awk '{print $1\" world\"}'`.pipe`tr '[a-z]' '[A-Z]'`.run()\n\n          assert.equal(stdout, 'HELLO WORLD\\n')\n        })\n\n        test('several $ halted > $ halted', async () => {\n          const $h = $({ halt: true })\n          const p1 = $`echo foo`\n          const p2 = $h`echo a && sleep 0.1 && echo c && sleep 0.2 && echo e`\n          const p3 = $h`sleep 0.05 && echo b && sleep 0.1 && echo d`\n          const p4 = $`sleep 0.4 && echo bar`\n          const p5 = $h`cat`\n\n          await p1\n          p1.pipe(p5)\n          p2.pipe(p5)\n          p3.pipe(p5)\n          p4.pipe(p5)\n\n          const { stdout } = await p5.run()\n\n          assert.equal(stdout, 'foo\\na\\nb\\nc\\nd\\ne\\nbar\\n')\n        })\n\n        test('$ > stream', async () => {\n          const file = tempfile()\n          const fileStream = fs.createWriteStream(file)\n          const p = $`echo \"hello\"`\n            .pipe(getUpperCaseTransform())\n            .pipe(fileStream)\n          const o = await p\n\n          assert.ok(p instanceof WriteStream)\n          assert.ok(o instanceof WriteStream)\n          assert.equal(o.stdout, 'hello\\n')\n          assert.equal(o.exitCode, 0)\n          assert.equal((await fs.readFile(file)).toString(), 'HELLO\\n')\n          await fs.rm(file)\n        })\n\n        test('$ > stdout', async () => {\n          const p = $`echo 1`.pipe(process.stdout)\n          assert.deepEqual(p, process.stdout)\n        })\n\n        test('$ halted > stream', async () => {\n          const file = tempfile()\n          const fileStream = fs.createWriteStream(file)\n          const p1 = $({ halt: true })`echo \"hello\"`\n          const p2 = p1.pipe(getUpperCaseTransform()).pipe(fileStream)\n\n          assert.ok(p2 instanceof WriteStream)\n          assert.equal(p2.run(), undefined)\n\n          await p2\n\n          assert.equal((await fs.readFile(file)).toString(), 'HELLO\\n')\n          await fs.rm(file)\n        })\n\n        test('stream > $', async () => {\n          const file = tempfile()\n          await fs.writeFile(file, 'test')\n          const { stdout } = await fs\n            .createReadStream(file)\n            .pipe(getUpperCaseTransform())\n            .pipe($`cat`)\n\n          assert.equal(stdout, 'TEST')\n        })\n\n        test('fetch (stream) > $', async () => {\n          // stream.Readable.fromWeb requires Node.js 18+\n          const responseToReadable = (response) => {\n            const reader = response.body.getReader()\n            const rs = new Readable()\n            rs._read = async () => {\n              const result = await reader.read()\n              if (!result.done) rs.push(Buffer.from(result.value))\n              else rs.push(null)\n            }\n            return rs\n          }\n\n          const p = (\n            await fetch('https://github.com').then(responseToReadable)\n          ).pipe($`cat`)\n          const o = await p\n\n          assert.match(o.stdout, /GitHub/)\n        })\n\n        test('fetch (pipe) > $', async () => {\n          const zxPkgJsonUrl =\n            'https://raw.githubusercontent.com/google/zx/refs/heads/main/package.json'\n          const p1 = fetch(zxPkgJsonUrl).pipe($`cat`)\n          const p2 = fetch(zxPkgJsonUrl).pipe`cat`\n          const o1 = await p1\n          const o2 = await p2\n\n          assert.match(o1.stdout, /\"name\": \"zx\"/)\n          assert.equal(o1.stdout, o2.stdout)\n        })\n\n        test('$ > stream > $', async () => {\n          const p = $`echo \"hello\"`\n          const { stdout } = await p.pipe(getUpperCaseTransform()).pipe($`cat`)\n\n          assert.equal(stdout, 'HELLO\\n')\n        })\n      })\n\n      it('supports delayed piping', async () => {\n        const result = $`echo 1; sleep 1; echo 2; sleep 1; echo 3`\n        const piped1 = result.pipe`cat`\n        let piped2\n\n        setTimeout(() => {\n          piped2 = result.pipe`cat`\n        }, 1500)\n\n        await piped1\n        assert.equal((await piped1).toString(), '1\\n2\\n3\\n')\n        assert.equal((await piped2).toString(), '1\\n2\\n3\\n')\n      })\n\n      it('fulfilled piping', async () => {\n        const p1 = $`echo foo && sleep 0.1 && echo bar`\n        await p1\n        const p2 = p1.pipe`cat`\n        await p2\n\n        assert.equal(p1.output.toString(), 'foo\\nbar\\n')\n        assert.equal(p2.output.toString(), 'foo\\nbar\\n')\n      })\n\n      it('rejected piping', async () => {\n        const p1 = $({ nothrow: true })`echo foo && exit 1`\n        await p1\n        const p2 = p1.pipe($({ nothrow: true })`cat`)\n        await p2\n\n        assert.equal(p1.output.toString(), 'foo\\n')\n        assert.equal(p1.output.ok, false)\n        assert.equal(p1.output.exitCode, 1)\n\n        assert.equal(p2.output.toString(), 'foo\\n')\n        assert.equal(p2.output.ok, false)\n        assert.equal(p2.output.exitCode, 1)\n      })\n\n      test('propagates rejection', async () => {\n        const p1 = $`exit 1`\n        const p2 = p1.pipe($`echo hello`)\n\n        try {\n          await p1\n        } catch (e) {\n          assert.equal(e.exitCode, 1)\n          assert.equal(e.stdout, '')\n        }\n\n        try {\n          await p2\n        } catch (e) {\n          assert.equal(e.exitCode, 1)\n          assert.equal(e.ok, false)\n        }\n\n        const p3 = await $({ nothrow: true })`echo hello && exit 1`.pipe($`cat`)\n        assert.equal(p3.exitCode, 0)\n        assert.equal(p3.stdout.trim(), 'hello')\n\n        const p4 = $`exit 1`.pipe($`echo hello`)\n        try {\n          await p4\n        } catch (e) {\n          assert.equal(e.exitCode, 1)\n          assert.equal(e.ok, false)\n        }\n\n        const p5 = $`echo bar && sleep 0.1 && exit 1`\n        const [r1, r2, r3] = await Promise.allSettled([\n          p5.pipe($`cat`),\n          p5.pipe($({ nothrow: true })`cat`),\n          p5.pipe($({ nothrow: true, halt: true })`cat`),\n        ])\n        assert.equal(r1.reason.stdout, 'bar\\n')\n        assert.equal(r1.reason.exitCode, 1)\n        assert.equal(r1.reason.ok, false)\n\n        assert.equal(r2.value.stdout, 'bar\\n')\n        assert.equal(r2.value.exitCode, 1)\n        assert.equal(r2.value.ok, false)\n\n        assert.equal(r3.value.stdout, 'bar\\n')\n        assert.equal(r3.value.exitCode, 1)\n        assert.equal(r3.value.ok, false)\n\n        const p6 = $`echo bar && exit 1`\n        const [r4, r5] = await Promise.allSettled([\n          p6.pipe($`cat`),\n          p6.pipe($({ nothrow: true })`cat`),\n        ])\n        assert.equal(r4.reason.stdout, 'bar\\n')\n        assert.equal(r4.reason.exitCode, 1)\n        assert.equal(r4.reason.ok, false)\n\n        assert.equal(r5.value.stdout, 'bar\\n')\n        assert.equal(r5.value.exitCode, 1)\n        assert.equal(r5.value.ok, false)\n      })\n\n      test('pipes particular stream: stdout, stderr, stdall', async () => {\n        const p = $`echo foo >&2; sleep 0.01 && echo bar`\n        const o1 = (await p.pipe.stderr`cat`).toString()\n        const o2 = (await p.pipe.stdout`cat`).toString()\n        const o3 = (await p.pipe.stdall`cat`).toString()\n\n        assert.equal(o1, 'foo\\n')\n        assert.equal(o2, 'bar\\n')\n        assert.equal(o3, 'foo\\nbar\\n')\n      })\n    })\n\n    describe('unpipe()', () => {\n      it('disables piping', async () => {\n        const p1 = $`echo foo && sleep 0.2 && echo bar && sleep 0.3 && echo baz && sleep 0.4 && echo qux`\n        const p2 = $`echo 1 && sleep 0.3 && echo 2 && sleep 0.2 && echo 3`\n        const p3 = $`cat`\n\n        p1.pipe(p3)\n        p2.pipe(p3)\n\n        setTimeout(() => p1.unpipe(p3), 300)\n\n        const { stdout } = await p3\n        assert.equal(stdout, 'foo\\n1\\nbar\\n2\\n3\\n')\n      })\n    })\n\n    describe('abort()', () => {\n      test('just works', async () => {\n        const p = $({ detached: true })`sleep 999`\n        setTimeout(() => p.abort(), 100)\n\n        try {\n          await p\n          assert.unreachable('should have thrown')\n        } catch ({ message }) {\n          assert.match(message, /The operation was aborted/)\n        }\n      })\n\n      test('accepts optional AbortController', async () => {\n        const ac = new AbortController()\n        const p = $({ ac, detached: true })`sleep 999`\n        setTimeout(() => ac.abort(), 100)\n\n        try {\n          await p\n          assert.unreachable('should have thrown')\n        } catch ({ message }) {\n          assert.match(message, /The operation was aborted/)\n        }\n      })\n\n      test('accepts AbortController `signal` separately', async () => {\n        const ac = new AbortController()\n        const signal = ac.signal\n        const p = $({ signal, detached: true })`sleep 999`\n        setTimeout(() => ac.abort(), 100)\n\n        try {\n          await p\n          assert.unreachable('should have thrown')\n        } catch ({ message }) {\n          assert.match(message, /The operation was aborted/)\n        }\n      })\n\n      describe('handles halt option', () => {\n        test('just works', async () => {\n          const filepath = `${tempdir()}/${Math.random().toString()}`\n          const p = $({ halt: true })`touch ${filepath}`\n          await sleep(1)\n          assert.ok(\n            !fs.existsSync(filepath),\n            'The cmd called, but it should not have been called'\n          )\n          await p.run()\n          assert.ok(fs.existsSync(filepath), 'The cmd should have been called')\n        })\n\n        test('sync process ignores halt option', () => {\n          const p = $.sync({ halt: true })`echo foo`\n          assert.equal(p.stdout, 'foo\\n')\n        })\n      })\n\n      test('exposes `signal` property', async () => {\n        const ac = new AbortController()\n        const p = $({ ac, detached: true })`echo test`\n\n        assert.equal(p.signal, ac.signal)\n        await p\n      })\n\n      test('throws if the signal was previously aborted', async () => {\n        const ac = new AbortController()\n        const { signal } = ac\n        ac.abort('reason')\n\n        try {\n          await $({ signal, detached: true })`sleep 999`\n        } catch ({ message }) {\n          assert.match(message, /The operation was aborted/)\n        }\n      })\n\n      test('throws if the signal is controlled by another process', async () => {\n        const ac = new AbortController()\n        const { signal } = ac\n        const p = $({ signal })`sleep 999`\n\n        try {\n          p.abort()\n        } catch ({ message }) {\n          assert.match(message, /The signal is controlled by another process./)\n        }\n\n        try {\n          ac.abort()\n          await p\n        } catch ({ message }) {\n          assert.match(message, /The operation was aborted/)\n        }\n      })\n\n      test('throws if too late', async () => {\n        const p = $`echo foo`\n        await p\n\n        assert.throws(() => p.abort(), /Too late to abort the process/)\n      })\n\n      test('abort signal is transmittable through pipe', async () => {\n        const ac = new AbortController()\n        const { signal } = ac\n        const p1 = $({ signal, nothrow: true })`echo test`\n        const p2 = p1.pipe`sleep 999`\n        setTimeout(() => ac.abort(), 50)\n\n        try {\n          await p2\n        } catch ({ message }) {\n          assert.match(message, /The operation was aborted/)\n        }\n      })\n    })\n\n    describe('kill()', () => {\n      test('just works', async () => {\n        const p = $`sleep 999`.nothrow()\n        setTimeout(() => {\n          p.kill()\n        }, 100)\n        const o = await p\n        assert.equal(o.signal, 'SIGTERM')\n        assert.ok(o.duration >= 100 && o.duration < 1000)\n      })\n\n      test('applies custom signal if passed', async () => {\n        const p = $`while true; do :; done`\n        setTimeout(() => p.kill('SIGKILL'), 100)\n        let signal\n        try {\n          await p\n        } catch (p) {\n          signal = p.signal\n        }\n        assert.equal(signal, 'SIGKILL')\n      })\n\n      test('applies `$.killSignal` if defined', async () => {\n        const p = $({ killSignal: 'SIGKILL' })`while true; do :; done`\n        setTimeout(() => p.kill(), 100)\n        let signal\n        try {\n          await p\n        } catch (p) {\n          signal = p.signal\n        }\n        assert.equal(signal, 'SIGKILL')\n      })\n\n      test('throws if too late', async () => {\n        const p = $`echo foo`\n        await p\n\n        assert.throws(() => p.kill(), /Too late to kill the process/)\n      })\n\n      test('throws if too early', async () => {\n        const p = $({ halt: true })`echo foo`\n\n        assert.throws(\n          () => p.kill(),\n          /Trying to kill a process without creating one/\n        )\n      })\n\n      test('throws if pid is empty', async () => {\n        const p = $({\n          spawn() {\n            return new EventEmitter()\n          },\n        })`echo foo`\n\n        assert.throws(() => p.kill(), /The process pid is undefined/)\n      })\n    })\n\n    describe('[Symbol.asyncIterator]', () => {\n      it('should iterate over lines from stdout', async () => {\n        const process = $`echo \"Line1\\nLine2\\nLine3\"`\n        const lines = []\n        for await (const line of process) {\n          lines.push(line)\n        }\n\n        assert.deepEqual(lines, ['Line1', 'Line2', 'Line3'])\n      })\n\n      it('should handle partial lines correctly', async () => {\n        const process = $`node -e \"process.stdout.write('PartialLine1\\\\nLine2\\\\nPartial'); setTimeout(() => process.stdout.write('Line3\\\\n'), 100)\"`\n        const lines = []\n        for await (const line of process) {\n          lines.push(line)\n        }\n\n        assert.deepEqual(lines, ['PartialLine1', 'Line2', 'PartialLine3'])\n      })\n\n      it('should handle empty stdout', async () => {\n        const process = $`echo -n \"\"`\n        const lines = []\n        for await (const line of process) {\n          lines.push(line)\n        }\n\n        assert.equal(lines.length, 0, 'Should have 0 lines for empty stdout')\n      })\n\n      it('should handle single line without trailing newline', async () => {\n        const process = $`echo -n \"SingleLine\"`\n        const lines = []\n        for await (const line of process) {\n          lines.push(line)\n        }\n\n        assert.deepEqual(lines, ['SingleLine'])\n      })\n\n      it('should yield all buffered and new chunks when iterated after a delay', async () => {\n        const process = $`sleep 0.1; echo Chunk1; sleep 0.1; echo Chunk2; sleep 0.2; echo Chunk3; sleep 0.1; echo Chunk4;`\n        const chunks = []\n\n        await sleep(250)\n        for await (const chunk of process) {\n          chunks.push(chunk)\n        }\n\n        assert.equal(chunks.length, 4, 'Should get all chunks')\n        assert.equal(chunks[0], 'Chunk1', 'First chunk should be \"Chunk1\"')\n        assert.equal(chunks[3], 'Chunk4', 'Second chunk should be \"Chunk4\"')\n      })\n\n      it('handles ignored stdio', async () => {\n        const p = $({\n          stdio: 'ignore',\n        })`sleep 0.1; echo Chunk1; sleep 0.1; echo Chunk2`\n        const chunks = []\n        for await (const chunk of p) {\n          chunks.push(chunk)\n        }\n\n        assert.equal(chunks.length, 0)\n        assert.equal((await p).stdout, '')\n      })\n\n      it('handles non-iterable stdio', async () => {\n        const file = tempfile()\n        const fd = fs.openSync(file, 'w')\n        const p = $({\n          stdio: ['ignore', fd, 'ignore'],\n        })`sleep 0.1; echo Chunk1; sleep 0.1; echo Chunk2`\n        const chunks = []\n        for await (const chunk of p) {\n          chunks.push(chunk)\n        }\n\n        assert.equal(chunks.length, 0)\n        assert.equal((await p).stdout, '')\n        assert.equal(fs.readFileSync(file, 'utf-8'), `Chunk1\\nChunk2\\n`)\n      })\n\n      it('should process all output before handling a non-zero exit code', async () => {\n        const process = $`sleep 0.1; echo foo; sleep 0.1; echo bar; sleep 0.1; exit 1;`\n        const chunks = []\n\n        let errorCaught = null\n        try {\n          for await (const chunk of process) {\n            chunks.push(chunk)\n          }\n        } catch (err) {\n          errorCaught = err\n        }\n\n        assert.equal(chunks.length, 2, 'Should have received 2 chunks')\n        assert.equal(chunks[0], 'foo', 'First chunk should be \"foo\"')\n        assert.equal(chunks[1], 'bar', 'Second chunk should be \"bar\"')\n\n        assert.ok(errorCaught, 'An error should have been caught')\n        assert.equal(\n          errorCaught.exitCode,\n          1,\n          'The process exit code should be 1'\n        )\n      })\n\n      it('handles .nothrow() correctly', async () => {\n        const lines = []\n        for await (const line of $({ nothrow: true })`grep any test`) {\n          lines.push(line)\n        }\n        assert.equal(lines.length, 0, 'Should not yield any lines')\n      })\n\n      it('handles a custom delimiter', async () => {\n        const lines = []\n        for await (const line of $({\n          delimiter: '\\0',\n          cwd: tempdir(),\n        })`touch foo bar baz; find ./ -type f -print0 -maxdepth 1`) {\n          lines.push(line)\n        }\n        assert.deepEqual(lines.sort(), ['./bar', './baz', './foo'])\n      })\n    })\n\n    test('quiet() mode is working', async () => {\n      const log = console.log\n      let stdout = ''\n      console.log = (...args) => {\n        stdout += args.join(' ')\n      }\n      await $`echo 'test'`.quiet()\n      console.log = log\n      assert.equal(stdout, '')\n      {\n        // Deprecated.\n        let stdout = ''\n        console.log = (...args) => {\n          stdout += args.join(' ')\n        }\n        await quiet($`echo 'test'`)\n        console.log = log\n        assert.equal(stdout, '')\n      }\n    })\n\n    test('verbose() mode is working', async () => {\n      const p = $`echo 'test'`\n      assert.equal(p.isVerbose(), false)\n\n      p.verbose()\n      assert.equal(p.isVerbose(), true)\n\n      p.verbose(false)\n      assert.equal(p.isVerbose(), false)\n    })\n\n    test('nothrow() does not throw', async () => {\n      {\n        const { exitCode } = await $`exit 42`.nothrow()\n        assert.equal(exitCode, 42)\n      }\n      {\n        // Toggle\n        try {\n          const p = $`exit 42`.nothrow()\n          await p.nothrow(false)\n        } catch ({ exitCode }) {\n          assert.equal(exitCode, 42)\n        }\n      }\n      {\n        // Deprecated.\n        const { exitCode } = await nothrow($`exit 42`)\n        assert.equal(exitCode, 42)\n      }\n    })\n\n    describe('timeout()', () => {\n      test('expiration works', async () => {\n        await $`sleep 1`.timeout(1000)\n        let exitCode, signal\n        try {\n          await $`sleep 1`.timeout(200)\n        } catch (p) {\n          exitCode = p.exitCode\n          signal = p.signal\n        }\n        assert.equal(exitCode, null)\n        assert.equal(signal, 'SIGTERM')\n      })\n\n      test('accepts a signal opt', async () => {\n        let exitCode, signal\n        try {\n          await $`sleep 999`.timeout(10, 'SIGKILL')\n        } catch (p) {\n          exitCode = p.exitCode\n          signal = p.signal\n        }\n        assert.equal(exitCode, null)\n        assert.equal(signal, 'SIGKILL')\n      })\n    })\n\n    test('json()', async () => {\n      assert.deepEqual(await $`echo '{\"key\":\"value\"}'`.json(), { key: 'value' })\n    })\n\n    test('text()', async () => {\n      const p = $`echo foo`\n      assert.equal(await p.text(), 'foo\\n')\n      assert.equal(await p.text('hex'), '666f6f0a')\n    })\n\n    test('lines()', async () => {\n      const p1 = $`echo 'foo\\nbar\\r\\nbaz'`\n      assert.deepEqual(await p1.lines(), ['foo', 'bar', 'baz'])\n\n      const p2 = $.sync`echo 'foo\\nbar\\r\\nbaz'`\n      assert.deepEqual(p2.lines(), ['foo', 'bar', 'baz'])\n\n      const p3 = $({\n        cwd: await tempdir(),\n      })`touch foo bar baz; find ./ -type f -print0 -maxdepth 1`\n      assert.deepEqual((await p3.lines('\\0')).sort(), [\n        './bar',\n        './baz',\n        './foo',\n      ])\n    })\n\n    test('buffer()', async () => {\n      assert.equal(\n        (await $`echo foo`.buffer()).compare(Buffer.from('foo\\n', 'utf-8')),\n        0\n      )\n    })\n\n    test('blob()', async () => {\n      const p = $`echo foo`\n      assert.equal(await (await p.blob()).text(), 'foo\\n')\n    })\n  })\n\n  describe('ProcessOutput', () => {\n    test('getters', async () => {\n      const o = new ProcessOutput(-1, 'SIGTERM', '', '', 'foo\\n', 'msg', 20)\n\n      assert.equal(o.stdout, '')\n      assert.equal(o.stderr, '')\n      assert.equal(o.stdall, 'foo\\n')\n      assert.equal(o.signal, 'SIGTERM')\n      assert.equal(o.exitCode, -1)\n      assert.equal(o.duration, 20)\n      assert.equal(o.ok, false)\n      assert.equal(\n        o.message,\n        'msg\\n    errno: undefined (Unknown error)\\n    code: undefined\\n    at '\n      )\n      assert.equal(Object.prototype.toString.call(o), '[object ProcessOutput]')\n\n      const o1 = new ProcessOutput({\n        code: -1,\n        from: 'file.js(12:34)',\n        store: {\n          stdall: ['error in stdout'],\n          stdout: [],\n          stderr: [],\n        },\n      })\n      assert.equal(\n        o1.message,\n        '\\n    at file.js(12:34)\\n    exit code: -1\\n    details: \\nerror in stdout'\n      )\n    })\n\n    test('[Symbol.toPrimitive]', () => {\n      const o = new ProcessOutput(-1, 'SIGTERM', '', '', 'foo\\n', 'msg', 20)\n      assert.equal('' + o, 'foo')\n      assert.equal(`${o}`, 'foo')\n      assert.equal(+o, NaN)\n    })\n\n    test('toString()', async () => {\n      const o = new ProcessOutput(null, null, '', '', 'foo\\n')\n      assert.equal(o.toString(), 'foo\\n')\n    })\n\n    test('valueOf()', async () => {\n      const o = new ProcessOutput(null, null, '', '', 'foo\\n')\n      assert.equal(o.valueOf(), 'foo')\n      assert.ok(o == 'foo')\n    })\n\n    test('json()', async () => {\n      const o = new ProcessOutput(null, null, '', '', '{\"key\":\"value\"}')\n      assert.deepEqual(o.json(), { key: 'value' })\n    })\n\n    test('text()', async () => {\n      const o = new ProcessOutput(null, null, '', '', 'foo\\n')\n      assert.equal(o.text(), 'foo\\n')\n      assert.equal(o.text('hex'), '666f6f0a')\n    })\n\n    test('lines()', async () => {\n      const o1 = new ProcessOutput(null, null, '', '', 'foo\\nbar\\r\\nbaz\\n')\n      assert.deepEqual(o1.lines(), ['foo', 'bar', 'baz'])\n\n      const o2 = new ProcessOutput(null, null, '', '', 'foo\\0bar\\0baz\\0')\n      assert.deepEqual(o2.lines(), ['foo\\0bar\\0baz\\0'])\n      assert.deepEqual(o2.lines('\\0'), ['foo', 'bar', 'baz'])\n    })\n\n    test('buffer()', async () => {\n      const o = new ProcessOutput(null, null, '', '', 'foo\\n')\n      assert.equal(o.buffer().compare(Buffer.from('foo\\n', 'utf-8')), 0)\n    })\n\n    test('blob()', async () => {\n      const o = new ProcessOutput(null, null, '', '', 'foo\\n')\n      assert.equal(await o.blob().text(), 'foo\\n')\n\n      const { Blob } = globalThis\n      globalThis.Blob = undefined\n      assert.throws(() => o.blob(), /Blob is not supported/)\n      globalThis.Blob = Blob\n    })\n\n    test('[Symbol.Iterator]', () => {\n      const o = new ProcessOutput({\n        store: {\n          stdall: ['foo\\nba', 'r\\nbaz'],\n        },\n      })\n      const lines = []\n      const expected = ['foo', 'bar', 'baz']\n      for (const line of o) {\n        lines.push(line)\n      }\n      assert.deepEqual(lines, expected)\n      assert.deepEqual(o.lines(), expected)\n      assert.deepEqual([...o], expected) // isConcatSpreadable\n    })\n\n    describe('static', () => {\n      test('getExitMessage()', () => {\n        assert.match(\n          ProcessOutput.getExitMessage(2, null, '', ''),\n          /Misuse of shell builtins/\n        )\n      })\n\n      test('getErrorMessage()', () => {\n        assert.match(\n          ProcessOutput.getErrorMessage({ errno: -2 }, ''),\n          /No such file or directory/\n        )\n        assert.match(\n          ProcessOutput.getErrorMessage({ errno: -1e9 }, ''),\n          /Unknown error/\n        )\n        assert.match(ProcessOutput.getErrorMessage({}, ''), /Unknown error/)\n      })\n    })\n  })\n\n  describe('cd()', () => {\n    test('works with relative paths', async () => {\n      const cwd = process.cwd()\n      try {\n        fs.mkdirpSync('/tmp/zx-cd-test/one/two')\n        cd('/tmp/zx-cd-test/one/two')\n        const p1 = $`pwd`\n        assert.equal($.cwd, undefined)\n        assert.ok(process.cwd().endsWith('/two'))\n\n        cd('..')\n        const p2 = $`pwd`\n        assert.equal($.cwd, undefined)\n        assert.ok(process.cwd().endsWith('/one'))\n\n        cd('..')\n        const p3 = $`pwd`\n        assert.equal($.cwd, undefined)\n        assert.ok(process.cwd().endsWith('/tmp/zx-cd-test'))\n\n        const results = (await Promise.all([p1, p2, p3])).map((p) =>\n          basename(p.stdout.trim())\n        )\n        assert.deepEqual(results, ['two', 'one', 'zx-cd-test'])\n      } catch (e) {\n        assert.ok(!e, e)\n      } finally {\n        fs.rmSync('/tmp/zx-cd-test', { recursive: true })\n        cd(cwd)\n      }\n    })\n\n    test('does not affect parallel contexts ($.cwdSyncHook enabled)', async () => {\n      syncProcessCwd()\n      const cwd = process.cwd()\n      try {\n        fs.mkdirpSync('/tmp/zx-cd-parallel/one/two')\n        await Promise.all([\n          within(async () => {\n            assert.equal(process.cwd(), cwd)\n            cd('/tmp/zx-cd-parallel/one')\n            await sleep(Math.random() * 15)\n            assert.ok(process.cwd().endsWith('/tmp/zx-cd-parallel/one'))\n          }),\n          within(async () => {\n            assert.equal(process.cwd(), cwd)\n            await sleep(Math.random() * 15)\n            assert.equal(process.cwd(), cwd)\n          }),\n          within(async () => {\n            assert.equal(process.cwd(), cwd)\n            await sleep(Math.random() * 15)\n            $.cwd = '/tmp/zx-cd-parallel/one/two'\n            assert.equal(process.cwd(), cwd)\n            assert.ok(\n              (await $`pwd`).stdout\n                .toString()\n                .trim()\n                .endsWith('/tmp/zx-cd-parallel/one/two')\n            )\n          }),\n        ])\n      } catch (e) {\n        assert.ok(!e, e)\n      } finally {\n        fs.rmSync('/tmp/zx-cd-parallel', { recursive: true })\n        cd(cwd)\n        syncProcessCwd(false)\n      }\n    })\n\n    test('fails on entering not existing dir', async () => {\n      assert.throws(() => cd('/tmp/abra-kadabra'))\n    })\n\n    test('accepts ProcessOutput in addition to string', async () => {\n      await within(async () => {\n        const tmp = await $`mktemp -d`\n        cd(tmp)\n        assert.equal(\n          basename(process.cwd()),\n          basename(tmp.toString().trimEnd())\n        )\n      })\n    })\n  })\n\n  describe('kill()', () => {\n    test('throws if pid is invalid', async () => {\n      await assert.rejects(() => kill(''), /Invalid/)\n      await assert.rejects(() => kill('foo'), /Invalid/)\n      await assert.rejects(() => kill('100 foo'), /Invalid/)\n      await assert.rejects(() => kill(100.1), /Invalid/)\n      await assert.rejects(() => kill(null), /Invalid/)\n      await assert.rejects(() => kill({}), /Invalid/)\n      await assert.rejects(\n        () =>\n          kill({\n            toString() {\n              return '12345'\n            },\n          }),\n        /Invalid/\n      )\n    })\n  })\n\n  describe('within()', () => {\n    test('just works', async () => {\n      let resolve, reject\n      const promise = new Promise((...args) => ([resolve, reject] = args))\n\n      function yes() {\n        assert.equal($.verbose, true)\n        resolve()\n      }\n\n      assert.equal($.verbose, false)\n\n      within(() => {\n        $.verbose = true\n      })\n      assert.equal($.verbose, false)\n\n      within(async () => {\n        $.verbose = true\n        setTimeout(yes, 10)\n      })\n      assert.equal($.verbose, false)\n\n      await promise\n    })\n\n    test('keeps the cwd ref for internal $ calls', async () => {\n      let resolve, reject\n      const promise = new Promise((...args) => ([resolve, reject] = args))\n      const cwd = process.cwd()\n      const pwd = await $`pwd`\n\n      within(async () => {\n        cd('/tmp')\n        assert.ok(process.cwd().endsWith('/tmp'))\n        assert.ok((await $`pwd`).stdout.trim().endsWith('/tmp'))\n\n        setTimeout(async () => {\n          process.chdir('/')\n          assert.ok((await $`pwd`).stdout.trim().endsWith('/tmp'))\n          resolve()\n          process.chdir(cwd)\n        }, 1000)\n      })\n\n      assert.equal((await $`pwd`).stdout, pwd.stdout)\n      await promise\n    })\n\n    test(`isolates nested context and returns cb result`, async () => {\n      within(async () => {\n        const res = await within(async () => {\n          $.verbose = true\n\n          return within(async () => {\n            assert.equal($.verbose, true)\n            $.verbose = false\n\n            return within(async () => {\n              assert.equal($.verbose, false)\n              $.verbose = true\n              return 'foo'\n            })\n          })\n        })\n        assert.equal($.verbose, false)\n        assert.equal(res, 'foo')\n      })\n    })\n  })\n\n  describe('shell presets', () => {\n    const originalWhichSync = which.sync\n    before(() => {\n      which.sync = (bin) => bin\n    })\n    after(() => {\n      which.sync = originalWhichSync\n      useBash()\n    })\n\n    test('usePwsh()', () => {\n      usePwsh()\n      assert.equal($.shell, 'pwsh')\n      assert.equal($.prefix, '')\n      assert.equal($.postfix, '; exit $LastExitCode')\n      assert.equal($.quote, quotePowerShell)\n    })\n\n    test('usePowerShell()', () => {\n      usePowerShell()\n      assert.equal($.shell, 'powershell.exe')\n      assert.equal($.prefix, '')\n      assert.equal($.postfix, '; exit $LastExitCode')\n      assert.equal($.quote, quotePowerShell)\n    })\n\n    test('useBash()', () => {\n      useBash()\n      assert.equal($.shell, 'bash')\n      assert.equal($.prefix, 'set -euo pipefail;')\n      assert.equal($.postfix, '')\n      assert.equal($.quote, quote)\n    })\n  })\n})\n"
  },
  {
    "path": "test/deps.test.js",
    "content": "// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     https://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport assert from 'node:assert'\nimport { test, describe } from 'node:test'\nimport { $, tmpfile, tmpdir, fs, path } from '../build/index.js'\nimport { installDeps, parseDeps } from '../build/deps.cjs'\n\nconst __dirname = new URL('.', import.meta.url).pathname\nconst root = path.resolve(__dirname, '..')\nconst cli = path.resolve(root, 'build/cli.js')\n\ndescribe('deps', () => {\n  describe('installDeps()', () => {\n    const pkgjson = tmpfile(\n      'package.json',\n      '{\"name\": \"temp\", \"version\": \"0.0.0\"}'\n    )\n    const cwd = path.dirname(pkgjson)\n    const t$ = $({ cwd })\n    const load = (dep) =>\n      fs.readJsonSync(path.join(cwd, 'node_modules', dep, 'package.json'))\n\n    test('loader works via JS API', async () => {\n      await installDeps(\n        {\n          cpy: '9.0.1',\n          'lodash-es': '4.17.21',\n        },\n        cwd\n      )\n      assert(load('cpy').name === 'cpy')\n      assert(load('lodash-es').name === 'lodash-es')\n    })\n\n    test('loader works via JS API with custom npm registry URL', async () => {\n      await installDeps(\n        {\n          '@jsr/std__internal': '1.0.5',\n        },\n        cwd,\n        'https://npm.jsr.io'\n      )\n\n      assert(load('@jsr/std__internal').name === '@jsr/std__internal')\n    })\n\n    test('loader works via CLI', async () => {\n      const out =\n        await t$`node ${cli} --install <<< 'import _ from \"lodash\" /* @4.17.15 */; console.log(_.VERSION)'`\n      assert.match(out.stdout, /4.17.15/)\n    })\n\n    test('loader works via CLI with custom npm registry URL', async () => {\n      const code =\n        'import { diff } from \"@jsr/std__internal\";console.log(diff instanceof Function)'\n      const file = tmpfile('index.mjs', code)\n\n      let out = await t$`node ${cli} --i --registry=https://npm.jsr.io ${file}`\n      fs.remove(file)\n      assert.match(out.stdout, /true/)\n\n      out = await t$`node ${cli}  -i --registry=https://npm.jsr.io <<< ${code}`\n      assert.match(out.stdout, /true/)\n    })\n\n    test('throws on invalid installer type', async () => {\n      await assert.rejects(\n        () =>\n          installDeps({ foo: 'latest' }, cwd, 'https://npm.jsr.io', 'invalid'),\n        {\n          message: /Unsupported installer type: invalid. Supported types: npm/,\n        }\n      )\n    })\n\n    test('does nothing on empty deps', async () => {\n      const cwd = tmpdir()\n      await installDeps({}, cwd)\n      assert(!fs.existsSync(path.join(cwd, 'node_modules')))\n    })\n  })\n\n  describe('parseDeps()', () => {\n    test('import or require', async () => {\n      ;[\n        [`import \"foo\"`, { foo: 'latest' }],\n        [`import \"foo\"`, { foo: 'latest' }],\n        [`import * as bar from \"foo\"`, { foo: 'latest' }],\n        [`import('foo')`, { foo: 'latest' }],\n        [`require('foo')`, { foo: 'latest' }],\n        [`require('foo/bar')`, { foo: 'latest' }],\n        [`require('foo/bar.js')`, { foo: 'latest' }],\n        [`require('foo-bar')`, { 'foo-bar': 'latest' }],\n        [`require('foo_bar')`, { foo_bar: 'latest' }],\n        [`require('@foo/bar')`, { '@foo/bar': 'latest' }],\n        [`require('@foo/bar/baz')`, { '@foo/bar': 'latest' }],\n        [`require('foo.js')`, { 'foo.js': 'latest' }],\n\n        // ignores local deps\n        [`import '.'`, {}],\n        [`require('.')`, {}],\n        [`require('..')`, {}],\n        [`require('../foo.js')`, {}],\n        [`require('./foo.js')`, {}],\n\n        // ignores invalid pkg names\n        [`require('_foo')`, {}],\n        [`require('@')`, {}],\n        [`require('@/_foo')`, {}],\n        [`require('@foo')`, {}],\n      ].forEach(([input, result]) => {\n        assert.deepEqual(parseDeps(input), result)\n      })\n    })\n\n    test('import with org and filename', async () => {\n      assert.deepEqual(parseDeps(`import \"@foo/bar/file\"`), {\n        '@foo/bar': 'latest',\n      })\n    })\n\n    test('import with version', async () => {\n      assert.deepEqual(parseDeps(`import \"foo\" // @2.x`), { foo: '2.x' })\n      assert.deepEqual(parseDeps(`import \"foo\" // @^7`), { foo: '^7' })\n      assert.deepEqual(parseDeps(`import \"foo\" /* @1.2.x */`), { foo: '1.2.x' })\n    })\n\n    test('multiline', () => {\n      const contents = `\n  require('a') // @1.0.0\n  const b =require('b') /* @2.0.0 */\n  const c = {\n    c:require('c') /* @3.0.0 */,\n    d: await import('d') /* @4.0.0 */,\n    ...require('e') /* @5.0.0 */\n  }\n  const f = [...require('f') /* @6.0.0 */]\n  ;require('g'); // @7.0.0\n  const h = 1 *require('h') // @8.0.0\n  {require('i') /* @9.0.0 */}\n  import 'j' // @10.0.0\n\n  import fs from 'fs'\n  import path from 'path'\n  import foo from \"foo\"\n  // import aaa from 'a'\n  /* import bbb from 'b' */\n  import bar from \"bar\" /* @1.0.0 */\n  import baz from \"baz\" //    @^2.0\n  import qux from \"@qux/pkg/entry\" //    @^3.0\n  import {api as alias} from \"qux/entry/index.js\" // @^4.0.0-beta.0\n\n  const cpy = await import('cpy')\n  const { pick } = require(\"lodash\") //  @4.17.15\n  `\n\n      assert.deepEqual(parseDeps(contents), {\n        a: '1.0.0',\n        b: '2.0.0',\n        c: '3.0.0',\n        d: '4.0.0',\n        e: '5.0.0',\n        f: '6.0.0',\n        g: '7.0.0',\n        h: '8.0.0',\n        i: '9.0.0',\n        j: '10.0.0',\n        foo: 'latest',\n        bar: '1.0.0',\n        baz: '^2.0',\n        '@qux/pkg': '^3.0',\n        qux: '^4.0.0-beta.0',\n        cpy: 'latest',\n        lodash: '4.17.15',\n      })\n    })\n  })\n})\n"
  },
  {
    "path": "test/error.test.ts",
    "content": "// Copyright 2024 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     https://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport assert from 'node:assert'\nimport { test, describe } from 'node:test'\nimport { Fail } from '../src/error.ts'\n\nconst {\n  getErrnoMessage,\n  getExitCodeInfo,\n  getCallerLocation,\n  getCallerLocationFromString,\n  formatExitMessage,\n  formatErrorMessage,\n  formatErrorDetails,\n} = Fail\n\ndescribe('error', () => {\n  test('getExitCodeInfo()', () => {\n    assert.equal(getExitCodeInfo(2), 'Misuse of shell builtins')\n  })\n\n  test('getErrnoMessage()', () => {\n    assert.equal(getErrnoMessage(-2), 'No such file or directory')\n    assert.equal(getErrnoMessage(1e9), 'Unknown error')\n    assert.equal(getErrnoMessage(undefined), 'Unknown error')\n  })\n\n  test('getCallerLocation()', () => {\n    assert.match(\n      getCallerLocation(new Error('Foo')),\n      /TestContext\\.<anonymous>/\n    )\n  })\n\n  describe('getCallerLocationFromString()', () => {\n    test('empty', () => {\n      assert.equal(getCallerLocationFromString(), 'unknown')\n    })\n\n    test('no-match', () => {\n      assert.equal(\n        getCallerLocationFromString('stack\\nstring'),\n        'stack\\nstring'\n      )\n    })\n\n    test(`getCallerLocationFromString-v8`, () => {\n      const stack = `\n    Error\n      at getCallerLocation (/Users/user/test.js:22:17)\n      at Proxy.set (/Users/user/test.js:40:10)\n      at e (/Users/user/test.js:34:13)\n      at d (/Users/user/test.js:11:5)\n      at c (/Users/user/test.js:8:5)\n      at b (/Users/user/test.js:5:5)\n      at a (/Users/user/test.js:2:5)\n      at Object.<anonymous> (/Users/user/test.js:37:1)\n      at Module._compile (node:internal/modules/cjs/loader:1254:14)\n      at Module._extensions..js (node:internal/modules/cjs/loader:1308:10)\n      at Module.load (node:internal/modules/cjs/loader:1117:32)\n      at Module._load (node:internal/modules/cjs/loader:958:12)\n    `\n      assert.match(getCallerLocationFromString(stack), /^.*:11:5.*$/)\n    })\n\n    test(`getCallerLocationFromString-JSC`, () => {\n      const stack = `\n    getCallerLocation@/Users/user/test.js:22:17\n    Proxy.set@/Users/user/test.js:40:10)\n    e@/Users/user/test.js:34:13\n    d@/Users/user/test.js:11:5\n    c@/Users/user/test.js:8:5\n    b@/Users/user/test.js:5:5\n    a@/Users/user/test.js:2:5\n    module code@/Users/user/test.js:37:1\n    evaluate@[native code]\n    moduleEvaluation@[native code]\n    moduleEvaluation@[native code]\n    @[native code]\n    asyncFunctionResume@[native code]\n    promiseReactionJobWithoutPromise@[native code]\n    promiseReactionJob@[native code]\n    d@/Users/user/test.js:11:5\n  `\n      assert.match(getCallerLocationFromString(stack), /^.*:11:5.*$/)\n    })\n  })\n\n  // prettier-ignore\n  test('getExitMessage()', () => {\n    assert.match(formatExitMessage(2, null, '', ''), /Misuse of shell builtins/)\n    assert.equal(formatExitMessage(1, 'SIGKILL', '', '', 'data'), `\\n    at \\n    exit code: 1\\n    signal: SIGKILL\\n    details: \\ndata`)\n    assert.equal(formatExitMessage(0, null, '', ''), 'exit code: 0')\n  })\n\n  test('getErrorMessage()', () => {\n    assert.match(\n      formatErrorMessage({ errno: -2 } as NodeJS.ErrnoException, ''),\n      /No such file or directory/\n    )\n    assert.match(\n      formatErrorMessage({ errno: -1e9 } as NodeJS.ErrnoException, ''),\n      /Unknown error/\n    )\n    assert.match(\n      formatErrorMessage({} as NodeJS.ErrnoException, ''),\n      /Unknown error/\n    )\n  })\n\n  test('findErrors()', () => {\n    const lines = [...Array(40).keys()].map((v) => v + '')\n\n    assert.equal(formatErrorDetails([]), '', 'empty returns empty')\n    assert.equal(\n      formatErrorDetails(['foo', 'bar']),\n      'foo\\nbar',\n      'squashes a few'\n    )\n    assert.equal(\n      formatErrorDetails(['failure: foo', 'NOT OK smth', ...lines]),\n      'failure: foo\\nNOT OK smth',\n      'extracts errors'\n    )\n    assert.equal(\n      formatErrorDetails(lines),\n      '0\\n1\\n2\\n3\\n4\\n5\\n6\\n7\\n8\\n9\\n10\\n11\\n12\\n13\\n14\\n15\\n16\\n17\\n18\\n19\\n...',\n      'shows a sample'\n    )\n  })\n})\n"
  },
  {
    "path": "test/export.test.js",
    "content": "// Copyright 2026 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     https://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport assert from 'node:assert'\nimport { test, describe } from 'node:test'\nimport * as core from '../build/core.cjs'\nimport * as cli from '../build/cli.cjs'\nimport * as index from '../build/index.cjs'\n\n//prettier-ignore\ndescribe('core', () => {\n  test('exports', () => {\n    assert.equal(typeof core.$, 'function', 'core.$')\n    assert.equal(typeof core.Fail, 'function', 'core.Fail')\n    assert.equal(typeof core.Fail.DOCS_URL, 'string', 'core.Fail.DOCS_URL')\n    assert.equal(typeof core.Fail.ERRNO_CODES, 'object', 'core.Fail.ERRNO_CODES')\n    assert.equal(typeof core.Fail.EXIT_CODES, 'object', 'core.Fail.EXIT_CODES')\n    assert.equal(typeof core.ProcessOutput, 'function', 'core.ProcessOutput')\n    assert.equal(typeof core.ProcessOutput.getErrorDetails, 'function', 'core.ProcessOutput.getErrorDetails')\n    assert.equal(typeof core.ProcessOutput.getErrorMessage, 'function', 'core.ProcessOutput.getErrorMessage')\n    assert.equal(typeof core.ProcessOutput.getExitCodeInfo, 'function', 'core.ProcessOutput.getExitCodeInfo')\n    assert.equal(typeof core.ProcessOutput.getExitMessage, 'function', 'core.ProcessOutput.getExitMessage')\n    assert.equal(typeof core.ProcessPromise, 'function', 'core.ProcessPromise')\n    assert.equal(typeof core.ProcessPromise.bus, 'object', 'core.ProcessPromise.bus')\n    assert.equal(typeof core.ProcessPromise.promisifyStream, 'function', 'core.ProcessPromise.promisifyStream')\n    assert.equal(typeof core.bus, 'object', 'core.bus')\n    assert.equal(typeof core.bus.lock, 'function', 'core.bus.lock')\n    assert.equal(typeof core.bus.override, 'function', 'core.bus.override')\n    assert.equal(typeof core.bus.wrap, 'function', 'core.bus.wrap')\n    assert.equal(typeof core.cd, 'function', 'core.cd')\n    assert.equal(typeof core.chalk, 'function', 'core.chalk')\n    assert.equal(typeof core.chalk.level, 'number', 'core.chalk.level')\n    assert.equal(typeof core.defaults, 'object', 'core.defaults')\n    assert.equal(typeof core.defaults.detached, 'boolean', 'core.defaults.detached')\n    assert.equal(typeof core.defaults.env, 'object', 'core.defaults.env')\n    assert.equal(typeof core.defaults.kill, 'function', 'core.defaults.kill')\n    assert.equal(typeof core.defaults.killSignal, 'string', 'core.defaults.killSignal')\n    assert.equal(typeof core.defaults.log, 'function', 'core.defaults.log')\n    assert.equal(typeof core.defaults.nothrow, 'boolean', 'core.defaults.nothrow')\n    assert.equal(typeof core.defaults.postfix, 'string', 'core.defaults.postfix')\n    assert.equal(typeof core.defaults.preferLocal, 'boolean', 'core.defaults.preferLocal')\n    assert.equal(typeof core.defaults.prefix, 'string', 'core.defaults.prefix')\n    assert.equal(typeof core.defaults.quiet, 'boolean', 'core.defaults.quiet')\n    assert.equal(typeof core.defaults.quote, 'function', 'core.defaults.quote')\n    assert.equal(typeof core.defaults.shell, 'string', 'core.defaults.shell')\n    assert.equal(typeof core.defaults.spawn, 'function', 'core.defaults.spawn')\n    assert.equal(typeof core.defaults.spawnSync, 'function', 'core.defaults.spawnSync')\n    assert.equal(typeof core.defaults.stdio, 'string', 'core.defaults.stdio')\n    assert.equal(typeof core.defaults.sync, 'boolean', 'core.defaults.sync')\n    assert.equal(typeof core.defaults.timeoutSignal, 'string', 'core.defaults.timeoutSignal')\n    assert.equal(typeof core.defaults.verbose, 'boolean', 'core.defaults.verbose')\n    assert.equal(typeof core.kill, 'function', 'core.kill')\n    assert.equal(typeof core.log, 'function', 'core.log')\n    assert.equal(typeof core.os, 'object', 'core.os')\n    assert.equal(typeof core.os.EOL, 'string', 'core.os.EOL')\n    assert.equal(typeof core.os.arch, 'function', 'core.os.arch')\n    assert.equal(typeof core.os.availableParallelism, 'function', 'core.os.availableParallelism')\n    assert.equal(typeof core.os.constants, 'object', 'core.os.constants')\n    assert.equal(typeof core.os.cpus, 'function', 'core.os.cpus')\n    assert.equal(typeof core.os.default, 'object', 'core.os.default')\n    assert.equal(typeof core.os.devNull, 'string', 'core.os.devNull')\n    assert.equal(typeof core.os.endianness, 'function', 'core.os.endianness')\n    assert.equal(typeof core.os.freemem, 'function', 'core.os.freemem')\n    assert.equal(typeof core.os.getPriority, 'function', 'core.os.getPriority')\n    assert.equal(typeof core.os.homedir, 'function', 'core.os.homedir')\n    assert.equal(typeof core.os.hostname, 'function', 'core.os.hostname')\n    assert.equal(typeof core.os.loadavg, 'function', 'core.os.loadavg')\n    assert.equal(typeof core.os.machine, 'function', 'core.os.machine')\n    assert.equal(typeof core.os.networkInterfaces, 'function', 'core.os.networkInterfaces')\n    assert.equal(typeof core.os.platform, 'function', 'core.os.platform')\n    assert.equal(typeof core.os.release, 'function', 'core.os.release')\n    assert.equal(typeof core.os.setPriority, 'function', 'core.os.setPriority')\n    assert.equal(typeof core.os.tmpdir, 'function', 'core.os.tmpdir')\n    assert.equal(typeof core.os.totalmem, 'function', 'core.os.totalmem')\n    assert.equal(typeof core.os.type, 'function', 'core.os.type')\n    assert.equal(typeof core.os.uptime, 'function', 'core.os.uptime')\n    assert.equal(typeof core.os.userInfo, 'function', 'core.os.userInfo')\n    assert.equal(typeof core.os.version, 'function', 'core.os.version')\n    assert.equal(typeof core.path, 'object', 'core.path')\n    assert.equal(typeof core.path._makeLong, 'function', 'core.path._makeLong')\n    assert.equal(typeof core.path.basename, 'function', 'core.path.basename')\n    assert.equal(typeof core.path.delimiter, 'string', 'core.path.delimiter')\n    assert.equal(typeof core.path.dirname, 'function', 'core.path.dirname')\n    assert.equal(typeof core.path.extname, 'function', 'core.path.extname')\n    assert.equal(typeof core.path.format, 'function', 'core.path.format')\n    assert.equal(typeof core.path.isAbsolute, 'function', 'core.path.isAbsolute')\n    assert.equal(typeof core.path.join, 'function', 'core.path.join')\n    assert.equal(typeof core.path.matchesGlob, 'function', 'core.path.matchesGlob')\n    assert.equal(typeof core.path.normalize, 'function', 'core.path.normalize')\n    assert.equal(typeof core.path.parse, 'function', 'core.path.parse')\n    assert.equal(typeof core.path.posix, 'object', 'core.path.posix')\n    assert.equal(typeof core.path.relative, 'function', 'core.path.relative')\n    assert.equal(typeof core.path.resolve, 'function', 'core.path.resolve')\n    assert.equal(typeof core.path.sep, 'string', 'core.path.sep')\n    assert.equal(typeof core.path.toNamespacedPath, 'function', 'core.path.toNamespacedPath')\n    assert.equal(typeof core.path.win32, 'object', 'core.path.win32')\n    assert.equal(typeof core.ps, 'object', 'core.ps')\n    assert.equal(typeof core.ps.kill, 'function', 'core.ps.kill')\n    assert.equal(typeof core.ps.lookup, 'function', 'core.ps.lookup')\n    assert.equal(typeof core.ps.lookupSync, 'function', 'core.ps.lookupSync')\n    assert.equal(typeof core.ps.tree, 'function', 'core.ps.tree')\n    assert.equal(typeof core.ps.treeSync, 'function', 'core.ps.treeSync')\n    assert.equal(typeof core.quote, 'function', 'core.quote')\n    assert.equal(typeof core.quotePowerShell, 'function', 'core.quotePowerShell')\n    assert.equal(typeof core.resolveDefaults, 'function', 'core.resolveDefaults')\n    assert.equal(typeof core.syncProcessCwd, 'function', 'core.syncProcessCwd')\n    assert.equal(typeof core.useBash, 'function', 'core.useBash')\n    assert.equal(typeof core.usePowerShell, 'function', 'core.usePowerShell')\n    assert.equal(typeof core.usePwsh, 'function', 'core.usePwsh')\n    assert.equal(typeof core.which, 'function', 'core.which')\n    assert.equal(typeof core.which.sync, 'function', 'core.which.sync')\n    assert.equal(typeof core.within, 'function', 'core.within')\n  })\n})\n\n//prettier-ignore\ndescribe('cli', () => {\n  test('exports', () => {\n    assert.equal(typeof cli.argv, 'object', 'cli.argv')\n    assert.equal(typeof cli.argv._, 'object', 'cli.argv._')\n    assert.equal(typeof cli.argv.experimental, 'boolean', 'cli.argv.experimental')\n    assert.equal(typeof cli.argv.h, 'boolean', 'cli.argv.h')\n    assert.equal(typeof cli.argv.help, 'boolean', 'cli.argv.help')\n    assert.equal(typeof cli.argv.i, 'boolean', 'cli.argv.i')\n    assert.equal(typeof cli.argv.install, 'boolean', 'cli.argv.install')\n    assert.equal(typeof cli.argv.l, 'boolean', 'cli.argv.l')\n    assert.equal(typeof cli.argv.preferLocal, 'boolean', 'cli.argv.preferLocal')\n    assert.equal(typeof cli.argv.quiet, 'boolean', 'cli.argv.quiet')\n    assert.equal(typeof cli.argv.repl, 'boolean', 'cli.argv.repl')\n    assert.equal(typeof cli.argv.v, 'boolean', 'cli.argv.v')\n    assert.equal(typeof cli.argv.verbose, 'boolean', 'cli.argv.verbose')\n    assert.equal(typeof cli.argv.version, 'boolean', 'cli.argv.version')\n    assert.equal(typeof cli.autorun, 'function', 'cli.autorun')\n    assert.equal(typeof cli.injectGlobalRequire, 'function', 'cli.injectGlobalRequire')\n    assert.equal(typeof cli.isMain, 'function', 'cli.isMain')\n    assert.equal(typeof cli.main, 'function', 'cli.main')\n    assert.equal(typeof cli.normalizeExt, 'function', 'cli.normalizeExt')\n    assert.equal(typeof cli.printUsage, 'function', 'cli.printUsage')\n    assert.equal(typeof cli.transformMarkdown, 'function', 'cli.transformMarkdown')\n  })\n})\n\n//prettier-ignore\ndescribe('index', () => {\n  test('exports', () => {\n    assert.equal(typeof index.$, 'function', 'index.$')\n    assert.equal(typeof index.Fail, 'function', 'index.Fail')\n    assert.equal(typeof index.Fail.DOCS_URL, 'string', 'index.Fail.DOCS_URL')\n    assert.equal(typeof index.Fail.ERRNO_CODES, 'object', 'index.Fail.ERRNO_CODES')\n    assert.equal(typeof index.Fail.EXIT_CODES, 'object', 'index.Fail.EXIT_CODES')\n    assert.equal(typeof index.MAML, 'object', 'index.MAML')\n    assert.equal(typeof index.MAML.parse, 'function', 'index.MAML.parse')\n    assert.equal(typeof index.MAML.stringify, 'function', 'index.MAML.stringify')\n    assert.equal(typeof index.ProcessOutput, 'function', 'index.ProcessOutput')\n    assert.equal(typeof index.ProcessOutput.getErrorDetails, 'function', 'index.ProcessOutput.getErrorDetails')\n    assert.equal(typeof index.ProcessOutput.getErrorMessage, 'function', 'index.ProcessOutput.getErrorMessage')\n    assert.equal(typeof index.ProcessOutput.getExitCodeInfo, 'function', 'index.ProcessOutput.getExitCodeInfo')\n    assert.equal(typeof index.ProcessOutput.getExitMessage, 'function', 'index.ProcessOutput.getExitMessage')\n    assert.equal(typeof index.ProcessPromise, 'function', 'index.ProcessPromise')\n    assert.equal(typeof index.ProcessPromise.bus, 'object', 'index.ProcessPromise.bus')\n    assert.equal(typeof index.ProcessPromise.promisifyStream, 'function', 'index.ProcessPromise.promisifyStream')\n    assert.equal(typeof index.VERSION, 'string', 'index.VERSION')\n    assert.equal(typeof index.YAML, 'object', 'index.YAML')\n    assert.equal(typeof index.YAML.Alias, 'function', 'index.YAML.Alias')\n    assert.equal(typeof index.YAML.CST, 'object', 'index.YAML.CST')\n    assert.equal(typeof index.YAML.Composer, 'function', 'index.YAML.Composer')\n    assert.equal(typeof index.YAML.Document, 'function', 'index.YAML.Document')\n    assert.equal(typeof index.YAML.Lexer, 'function', 'index.YAML.Lexer')\n    assert.equal(typeof index.YAML.LineCounter, 'function', 'index.YAML.LineCounter')\n    assert.equal(typeof index.YAML.Pair, 'function', 'index.YAML.Pair')\n    assert.equal(typeof index.YAML.Parser, 'function', 'index.YAML.Parser')\n    assert.equal(typeof index.YAML.Scalar, 'function', 'index.YAML.Scalar')\n    assert.equal(typeof index.YAML.Schema, 'function', 'index.YAML.Schema')\n    assert.equal(typeof index.YAML.YAMLError, 'function', 'index.YAML.YAMLError')\n    assert.equal(typeof index.YAML.YAMLMap, 'function', 'index.YAML.YAMLMap')\n    assert.equal(typeof index.YAML.YAMLParseError, 'function', 'index.YAML.YAMLParseError')\n    assert.equal(typeof index.YAML.YAMLSeq, 'function', 'index.YAML.YAMLSeq')\n    assert.equal(typeof index.YAML.YAMLWarning, 'function', 'index.YAML.YAMLWarning')\n    assert.equal(typeof index.YAML.default, 'object', 'index.YAML.default')\n    assert.equal(typeof index.YAML.isAlias, 'function', 'index.YAML.isAlias')\n    assert.equal(typeof index.YAML.isCollection, 'function', 'index.YAML.isCollection')\n    assert.equal(typeof index.YAML.isDocument, 'function', 'index.YAML.isDocument')\n    assert.equal(typeof index.YAML.isMap, 'function', 'index.YAML.isMap')\n    assert.equal(typeof index.YAML.isNode, 'function', 'index.YAML.isNode')\n    assert.equal(typeof index.YAML.isPair, 'function', 'index.YAML.isPair')\n    assert.equal(typeof index.YAML.isScalar, 'function', 'index.YAML.isScalar')\n    assert.equal(typeof index.YAML.isSeq, 'function', 'index.YAML.isSeq')\n    assert.equal(typeof index.YAML.parse, 'function', 'index.YAML.parse')\n    assert.equal(typeof index.YAML.parseAllDocuments, 'function', 'index.YAML.parseAllDocuments')\n    assert.equal(typeof index.YAML.parseDocument, 'function', 'index.YAML.parseDocument')\n    assert.equal(typeof index.YAML.stringify, 'function', 'index.YAML.stringify')\n    assert.equal(typeof index.YAML.visit, 'function', 'index.YAML.visit')\n    assert.equal(typeof index.YAML.visitAsync, 'function', 'index.YAML.visitAsync')\n    assert.equal(typeof index.argv, 'object', 'index.argv')\n    assert.equal(typeof index.argv._, 'object', 'index.argv._')\n    assert.equal(typeof index.bus, 'object', 'index.bus')\n    assert.equal(typeof index.bus.lock, 'function', 'index.bus.lock')\n    assert.equal(typeof index.bus.override, 'function', 'index.bus.override')\n    assert.equal(typeof index.bus.wrap, 'function', 'index.bus.wrap')\n    assert.equal(typeof index.cd, 'function', 'index.cd')\n    assert.equal(typeof index.chalk, 'function', 'index.chalk')\n    assert.equal(typeof index.chalk.level, 'number', 'index.chalk.level')\n    assert.equal(typeof index.defaults, 'object', 'index.defaults')\n    assert.equal(typeof index.defaults.detached, 'boolean', 'index.defaults.detached')\n    assert.equal(typeof index.defaults.env, 'object', 'index.defaults.env')\n    assert.equal(typeof index.defaults.kill, 'function', 'index.defaults.kill')\n    assert.equal(typeof index.defaults.killSignal, 'string', 'index.defaults.killSignal')\n    assert.equal(typeof index.defaults.log, 'function', 'index.defaults.log')\n    assert.equal(typeof index.defaults.nothrow, 'boolean', 'index.defaults.nothrow')\n    assert.equal(typeof index.defaults.postfix, 'string', 'index.defaults.postfix')\n    assert.equal(typeof index.defaults.preferLocal, 'boolean', 'index.defaults.preferLocal')\n    assert.equal(typeof index.defaults.prefix, 'string', 'index.defaults.prefix')\n    assert.equal(typeof index.defaults.quiet, 'boolean', 'index.defaults.quiet')\n    assert.equal(typeof index.defaults.quote, 'function', 'index.defaults.quote')\n    assert.equal(typeof index.defaults.shell, 'string', 'index.defaults.shell')\n    assert.equal(typeof index.defaults.spawn, 'function', 'index.defaults.spawn')\n    assert.equal(typeof index.defaults.spawnSync, 'function', 'index.defaults.spawnSync')\n    assert.equal(typeof index.defaults.stdio, 'string', 'index.defaults.stdio')\n    assert.equal(typeof index.defaults.sync, 'boolean', 'index.defaults.sync')\n    assert.equal(typeof index.defaults.timeoutSignal, 'string', 'index.defaults.timeoutSignal')\n    assert.equal(typeof index.defaults.verbose, 'boolean', 'index.defaults.verbose')\n    assert.equal(typeof index.dotenv, 'object', 'index.dotenv')\n    assert.equal(typeof index.dotenv.config, 'function', 'index.dotenv.config')\n    assert.equal(typeof index.dotenv.load, 'function', 'index.dotenv.load')\n    assert.equal(typeof index.dotenv.loadSafe, 'function', 'index.dotenv.loadSafe')\n    assert.equal(typeof index.dotenv.parse, 'function', 'index.dotenv.parse')\n    assert.equal(typeof index.dotenv.stringify, 'function', 'index.dotenv.stringify')\n    assert.equal(typeof index.echo, 'function', 'index.echo')\n    assert.equal(typeof index.expBackoff, 'function', 'index.expBackoff')\n    assert.equal(typeof index.fetch, 'function', 'index.fetch')\n    assert.equal(typeof index.fs, 'object', 'index.fs')\n    assert.equal(typeof index.fs.Dir, 'function', 'index.fs.Dir')\n    assert.equal(typeof index.fs.Dirent, 'function', 'index.fs.Dirent')\n    assert.equal(typeof index.fs.FileReadStream, 'function', 'index.fs.FileReadStream')\n    assert.equal(typeof index.fs.FileWriteStream, 'function', 'index.fs.FileWriteStream')\n    assert.equal(typeof index.fs.ReadStream, 'function', 'index.fs.ReadStream')\n    assert.equal(typeof index.fs.Stats, 'function', 'index.fs.Stats')\n    assert.equal(typeof index.fs.Utf8Stream, 'function', 'index.fs.Utf8Stream')\n    assert.equal(typeof index.fs.WriteStream, 'function', 'index.fs.WriteStream')\n    assert.equal(typeof index.fs._toUnixTimestamp, 'function', 'index.fs._toUnixTimestamp')\n    assert.equal(typeof index.fs.access, 'function', 'index.fs.access')\n    assert.equal(typeof index.fs.accessSync, 'function', 'index.fs.accessSync')\n    assert.equal(typeof index.fs.appendFile, 'function', 'index.fs.appendFile')\n    assert.equal(typeof index.fs.appendFileSync, 'function', 'index.fs.appendFileSync')\n    assert.equal(typeof index.fs.chmod, 'function', 'index.fs.chmod')\n    assert.equal(typeof index.fs.chmodSync, 'function', 'index.fs.chmodSync')\n    assert.equal(typeof index.fs.chown, 'function', 'index.fs.chown')\n    assert.equal(typeof index.fs.chownSync, 'function', 'index.fs.chownSync')\n    assert.equal(typeof index.fs.close, 'function', 'index.fs.close')\n    assert.equal(typeof index.fs.closeSync, 'function', 'index.fs.closeSync')\n    assert.equal(typeof index.fs.constants, 'object', 'index.fs.constants')\n    assert.equal(typeof index.fs.copy, 'function', 'index.fs.copy')\n    assert.equal(typeof index.fs.copyFile, 'function', 'index.fs.copyFile')\n    assert.equal(typeof index.fs.copyFileSync, 'function', 'index.fs.copyFileSync')\n    assert.equal(typeof index.fs.copySync, 'function', 'index.fs.copySync')\n    assert.equal(typeof index.fs.cp, 'function', 'index.fs.cp')\n    assert.equal(typeof index.fs.cpSync, 'function', 'index.fs.cpSync')\n    assert.equal(typeof index.fs.createFile, 'function', 'index.fs.createFile')\n    assert.equal(typeof index.fs.createFileSync, 'function', 'index.fs.createFileSync')\n    assert.equal(typeof index.fs.createLink, 'function', 'index.fs.createLink')\n    assert.equal(typeof index.fs.createLinkSync, 'function', 'index.fs.createLinkSync')\n    assert.equal(typeof index.fs.createReadStream, 'function', 'index.fs.createReadStream')\n    assert.equal(typeof index.fs.createSymlink, 'function', 'index.fs.createSymlink')\n    assert.equal(typeof index.fs.createSymlinkSync, 'function', 'index.fs.createSymlinkSync')\n    assert.equal(typeof index.fs.createWriteStream, 'function', 'index.fs.createWriteStream')\n    assert.equal(typeof index.fs.default, 'object', 'index.fs.default')\n    assert.equal(typeof index.fs.emptyDir, 'function', 'index.fs.emptyDir')\n    assert.equal(typeof index.fs.emptyDirSync, 'function', 'index.fs.emptyDirSync')\n    assert.equal(typeof index.fs.emptydir, 'function', 'index.fs.emptydir')\n    assert.equal(typeof index.fs.emptydirSync, 'function', 'index.fs.emptydirSync')\n    assert.equal(typeof index.fs.ensureDir, 'function', 'index.fs.ensureDir')\n    assert.equal(typeof index.fs.ensureDirSync, 'function', 'index.fs.ensureDirSync')\n    assert.equal(typeof index.fs.ensureFile, 'function', 'index.fs.ensureFile')\n    assert.equal(typeof index.fs.ensureFileSync, 'function', 'index.fs.ensureFileSync')\n    assert.equal(typeof index.fs.ensureLink, 'function', 'index.fs.ensureLink')\n    assert.equal(typeof index.fs.ensureLinkSync, 'function', 'index.fs.ensureLinkSync')\n    assert.equal(typeof index.fs.ensureSymlink, 'function', 'index.fs.ensureSymlink')\n    assert.equal(typeof index.fs.ensureSymlinkSync, 'function', 'index.fs.ensureSymlinkSync')\n    assert.equal(typeof index.fs.exists, 'function', 'index.fs.exists')\n    assert.equal(typeof index.fs.existsSync, 'function', 'index.fs.existsSync')\n    assert.equal(typeof index.fs.fchmod, 'function', 'index.fs.fchmod')\n    assert.equal(typeof index.fs.fchmodSync, 'function', 'index.fs.fchmodSync')\n    assert.equal(typeof index.fs.fchown, 'function', 'index.fs.fchown')\n    assert.equal(typeof index.fs.fchownSync, 'function', 'index.fs.fchownSync')\n    assert.equal(typeof index.fs.fdatasync, 'function', 'index.fs.fdatasync')\n    assert.equal(typeof index.fs.fdatasyncSync, 'function', 'index.fs.fdatasyncSync')\n    assert.equal(typeof index.fs.fstat, 'function', 'index.fs.fstat')\n    assert.equal(typeof index.fs.fstatSync, 'function', 'index.fs.fstatSync')\n    assert.equal(typeof index.fs.fsync, 'function', 'index.fs.fsync')\n    assert.equal(typeof index.fs.fsyncSync, 'function', 'index.fs.fsyncSync')\n    assert.equal(typeof index.fs.ftruncate, 'function', 'index.fs.ftruncate')\n    assert.equal(typeof index.fs.ftruncateSync, 'function', 'index.fs.ftruncateSync')\n    assert.equal(typeof index.fs.futimes, 'function', 'index.fs.futimes')\n    assert.equal(typeof index.fs.futimesSync, 'function', 'index.fs.futimesSync')\n    assert.equal(typeof index.fs.glob, 'function', 'index.fs.glob')\n    assert.equal(typeof index.fs.globSync, 'function', 'index.fs.globSync')\n    assert.equal(typeof index.fs.gracefulify, 'function', 'index.fs.gracefulify')\n    assert.equal(typeof index.fs.lchmod, 'function', 'index.fs.lchmod')\n    assert.equal(typeof index.fs.lchmodSync, 'function', 'index.fs.lchmodSync')\n    assert.equal(typeof index.fs.lchown, 'function', 'index.fs.lchown')\n    assert.equal(typeof index.fs.lchownSync, 'function', 'index.fs.lchownSync')\n    assert.equal(typeof index.fs.link, 'function', 'index.fs.link')\n    assert.equal(typeof index.fs.linkSync, 'function', 'index.fs.linkSync')\n    assert.equal(typeof index.fs.lstat, 'function', 'index.fs.lstat')\n    assert.equal(typeof index.fs.lstatSync, 'function', 'index.fs.lstatSync')\n    assert.equal(typeof index.fs.lutimes, 'function', 'index.fs.lutimes')\n    assert.equal(typeof index.fs.lutimesSync, 'function', 'index.fs.lutimesSync')\n    assert.equal(typeof index.fs.mkdir, 'function', 'index.fs.mkdir')\n    assert.equal(typeof index.fs.mkdirSync, 'function', 'index.fs.mkdirSync')\n    assert.equal(typeof index.fs.mkdirp, 'function', 'index.fs.mkdirp')\n    assert.equal(typeof index.fs.mkdirpSync, 'function', 'index.fs.mkdirpSync')\n    assert.equal(typeof index.fs.mkdirs, 'function', 'index.fs.mkdirs')\n    assert.equal(typeof index.fs.mkdirsSync, 'function', 'index.fs.mkdirsSync')\n    assert.equal(typeof index.fs.mkdtemp, 'function', 'index.fs.mkdtemp')\n    assert.equal(typeof index.fs.mkdtempDisposableSync, 'function', 'index.fs.mkdtempDisposableSync')\n    assert.equal(typeof index.fs.mkdtempSync, 'function', 'index.fs.mkdtempSync')\n    assert.equal(typeof index.fs.move, 'function', 'index.fs.move')\n    assert.equal(typeof index.fs.moveSync, 'function', 'index.fs.moveSync')\n    assert.equal(typeof index.fs.open, 'function', 'index.fs.open')\n    assert.equal(typeof index.fs.openAsBlob, 'function', 'index.fs.openAsBlob')\n    assert.equal(typeof index.fs.openSync, 'function', 'index.fs.openSync')\n    assert.equal(typeof index.fs.opendir, 'function', 'index.fs.opendir')\n    assert.equal(typeof index.fs.opendirSync, 'function', 'index.fs.opendirSync')\n    assert.equal(typeof index.fs.outputFile, 'function', 'index.fs.outputFile')\n    assert.equal(typeof index.fs.outputFileSync, 'function', 'index.fs.outputFileSync')\n    assert.equal(typeof index.fs.outputJSON, 'function', 'index.fs.outputJSON')\n    assert.equal(typeof index.fs.outputJSONSync, 'function', 'index.fs.outputJSONSync')\n    assert.equal(typeof index.fs.outputJson, 'function', 'index.fs.outputJson')\n    assert.equal(typeof index.fs.outputJsonSync, 'function', 'index.fs.outputJsonSync')\n    assert.equal(typeof index.fs.pathExists, 'function', 'index.fs.pathExists')\n    assert.equal(typeof index.fs.pathExistsSync, 'function', 'index.fs.pathExistsSync')\n    assert.equal(typeof index.fs.promises, 'object', 'index.fs.promises')\n    assert.equal(typeof index.fs.read, 'function', 'index.fs.read')\n    assert.equal(typeof index.fs.readFile, 'function', 'index.fs.readFile')\n    assert.equal(typeof index.fs.readFileSync, 'function', 'index.fs.readFileSync')\n    assert.equal(typeof index.fs.readJSON, 'function', 'index.fs.readJSON')\n    assert.equal(typeof index.fs.readJSONSync, 'function', 'index.fs.readJSONSync')\n    assert.equal(typeof index.fs.readJson, 'function', 'index.fs.readJson')\n    assert.equal(typeof index.fs.readJsonSync, 'function', 'index.fs.readJsonSync')\n    assert.equal(typeof index.fs.readSync, 'function', 'index.fs.readSync')\n    assert.equal(typeof index.fs.readdir, 'function', 'index.fs.readdir')\n    assert.equal(typeof index.fs.readdirSync, 'function', 'index.fs.readdirSync')\n    assert.equal(typeof index.fs.readlink, 'function', 'index.fs.readlink')\n    assert.equal(typeof index.fs.readlinkSync, 'function', 'index.fs.readlinkSync')\n    assert.equal(typeof index.fs.readv, 'function', 'index.fs.readv')\n    assert.equal(typeof index.fs.readvSync, 'function', 'index.fs.readvSync')\n    assert.equal(typeof index.fs.realpath, 'function', 'index.fs.realpath')\n    assert.equal(typeof index.fs.realpathSync, 'function', 'index.fs.realpathSync')\n    assert.equal(typeof index.fs.remove, 'function', 'index.fs.remove')\n    assert.equal(typeof index.fs.removeSync, 'function', 'index.fs.removeSync')\n    assert.equal(typeof index.fs.rename, 'function', 'index.fs.rename')\n    assert.equal(typeof index.fs.renameSync, 'function', 'index.fs.renameSync')\n    assert.equal(typeof index.fs.rm, 'function', 'index.fs.rm')\n    assert.equal(typeof index.fs.rmSync, 'function', 'index.fs.rmSync')\n    assert.equal(typeof index.fs.rmdir, 'function', 'index.fs.rmdir')\n    assert.equal(typeof index.fs.rmdirSync, 'function', 'index.fs.rmdirSync')\n    assert.equal(typeof index.fs.stat, 'function', 'index.fs.stat')\n    assert.equal(typeof index.fs.statSync, 'function', 'index.fs.statSync')\n    assert.equal(typeof index.fs.statfs, 'function', 'index.fs.statfs')\n    assert.equal(typeof index.fs.statfsSync, 'function', 'index.fs.statfsSync')\n    assert.equal(typeof index.fs.symlink, 'function', 'index.fs.symlink')\n    assert.equal(typeof index.fs.symlinkSync, 'function', 'index.fs.symlinkSync')\n    assert.equal(typeof index.fs.truncate, 'function', 'index.fs.truncate')\n    assert.equal(typeof index.fs.truncateSync, 'function', 'index.fs.truncateSync')\n    assert.equal(typeof index.fs.unlink, 'function', 'index.fs.unlink')\n    assert.equal(typeof index.fs.unlinkSync, 'function', 'index.fs.unlinkSync')\n    assert.equal(typeof index.fs.unwatchFile, 'function', 'index.fs.unwatchFile')\n    assert.equal(typeof index.fs.utimes, 'function', 'index.fs.utimes')\n    assert.equal(typeof index.fs.utimesSync, 'function', 'index.fs.utimesSync')\n    assert.equal(typeof index.fs.watch, 'function', 'index.fs.watch')\n    assert.equal(typeof index.fs.watchFile, 'function', 'index.fs.watchFile')\n    assert.equal(typeof index.fs.write, 'function', 'index.fs.write')\n    assert.equal(typeof index.fs.writeFile, 'function', 'index.fs.writeFile')\n    assert.equal(typeof index.fs.writeFileSync, 'function', 'index.fs.writeFileSync')\n    assert.equal(typeof index.fs.writeJSON, 'function', 'index.fs.writeJSON')\n    assert.equal(typeof index.fs.writeJSONSync, 'function', 'index.fs.writeJSONSync')\n    assert.equal(typeof index.fs.writeJson, 'function', 'index.fs.writeJson')\n    assert.equal(typeof index.fs.writeJsonSync, 'function', 'index.fs.writeJsonSync')\n    assert.equal(typeof index.fs.writeSync, 'function', 'index.fs.writeSync')\n    assert.equal(typeof index.fs.writev, 'function', 'index.fs.writev')\n    assert.equal(typeof index.fs.writevSync, 'function', 'index.fs.writevSync')\n    assert.equal(typeof index.glob, 'function', 'index.glob')\n    assert.equal(typeof index.glob.convertPathToPattern, 'function', 'index.glob.convertPathToPattern')\n    assert.equal(typeof index.glob.generateGlobTasks, 'function', 'index.glob.generateGlobTasks')\n    assert.equal(typeof index.glob.generateGlobTasksSync, 'function', 'index.glob.generateGlobTasksSync')\n    assert.equal(typeof index.glob.globby, 'function', 'index.glob.globby')\n    assert.equal(typeof index.glob.globbyStream, 'function', 'index.glob.globbyStream')\n    assert.equal(typeof index.glob.globbySync, 'function', 'index.glob.globbySync')\n    assert.equal(typeof index.glob.isDynamicPattern, 'function', 'index.glob.isDynamicPattern')\n    assert.equal(typeof index.glob.isGitIgnored, 'function', 'index.glob.isGitIgnored')\n    assert.equal(typeof index.glob.isGitIgnoredSync, 'function', 'index.glob.isGitIgnoredSync')\n    assert.equal(typeof index.glob.sync, 'function', 'index.glob.sync')\n    assert.equal(typeof index.globby, 'function', 'index.globby')\n    assert.equal(typeof index.globby.convertPathToPattern, 'function', 'index.globby.convertPathToPattern')\n    assert.equal(typeof index.globby.generateGlobTasks, 'function', 'index.globby.generateGlobTasks')\n    assert.equal(typeof index.globby.generateGlobTasksSync, 'function', 'index.globby.generateGlobTasksSync')\n    assert.equal(typeof index.globby.globby, 'function', 'index.globby.globby')\n    assert.equal(typeof index.globby.globbyStream, 'function', 'index.globby.globbyStream')\n    assert.equal(typeof index.globby.globbySync, 'function', 'index.globby.globbySync')\n    assert.equal(typeof index.globby.isDynamicPattern, 'function', 'index.globby.isDynamicPattern')\n    assert.equal(typeof index.globby.isGitIgnored, 'function', 'index.globby.isGitIgnored')\n    assert.equal(typeof index.globby.isGitIgnoredSync, 'function', 'index.globby.isGitIgnoredSync')\n    assert.equal(typeof index.globby.sync, 'function', 'index.globby.sync')\n    assert.equal(typeof index.kill, 'function', 'index.kill')\n    assert.equal(typeof index.log, 'function', 'index.log')\n    assert.equal(typeof index.minimist, 'function', 'index.minimist')\n    assert.equal(typeof index.nothrow, 'function', 'index.nothrow')\n    assert.equal(typeof index.os, 'object', 'index.os')\n    assert.equal(typeof index.os.EOL, 'string', 'index.os.EOL')\n    assert.equal(typeof index.os.arch, 'function', 'index.os.arch')\n    assert.equal(typeof index.os.availableParallelism, 'function', 'index.os.availableParallelism')\n    assert.equal(typeof index.os.constants, 'object', 'index.os.constants')\n    assert.equal(typeof index.os.cpus, 'function', 'index.os.cpus')\n    assert.equal(typeof index.os.default, 'object', 'index.os.default')\n    assert.equal(typeof index.os.devNull, 'string', 'index.os.devNull')\n    assert.equal(typeof index.os.endianness, 'function', 'index.os.endianness')\n    assert.equal(typeof index.os.freemem, 'function', 'index.os.freemem')\n    assert.equal(typeof index.os.getPriority, 'function', 'index.os.getPriority')\n    assert.equal(typeof index.os.homedir, 'function', 'index.os.homedir')\n    assert.equal(typeof index.os.hostname, 'function', 'index.os.hostname')\n    assert.equal(typeof index.os.loadavg, 'function', 'index.os.loadavg')\n    assert.equal(typeof index.os.machine, 'function', 'index.os.machine')\n    assert.equal(typeof index.os.networkInterfaces, 'function', 'index.os.networkInterfaces')\n    assert.equal(typeof index.os.platform, 'function', 'index.os.platform')\n    assert.equal(typeof index.os.release, 'function', 'index.os.release')\n    assert.equal(typeof index.os.setPriority, 'function', 'index.os.setPriority')\n    assert.equal(typeof index.os.tmpdir, 'function', 'index.os.tmpdir')\n    assert.equal(typeof index.os.totalmem, 'function', 'index.os.totalmem')\n    assert.equal(typeof index.os.type, 'function', 'index.os.type')\n    assert.equal(typeof index.os.uptime, 'function', 'index.os.uptime')\n    assert.equal(typeof index.os.userInfo, 'function', 'index.os.userInfo')\n    assert.equal(typeof index.os.version, 'function', 'index.os.version')\n    assert.equal(typeof index.parseArgv, 'function', 'index.parseArgv')\n    assert.equal(typeof index.path, 'object', 'index.path')\n    assert.equal(typeof index.path._makeLong, 'function', 'index.path._makeLong')\n    assert.equal(typeof index.path.basename, 'function', 'index.path.basename')\n    assert.equal(typeof index.path.delimiter, 'string', 'index.path.delimiter')\n    assert.equal(typeof index.path.dirname, 'function', 'index.path.dirname')\n    assert.equal(typeof index.path.extname, 'function', 'index.path.extname')\n    assert.equal(typeof index.path.format, 'function', 'index.path.format')\n    assert.equal(typeof index.path.isAbsolute, 'function', 'index.path.isAbsolute')\n    assert.equal(typeof index.path.join, 'function', 'index.path.join')\n    assert.equal(typeof index.path.matchesGlob, 'function', 'index.path.matchesGlob')\n    assert.equal(typeof index.path.normalize, 'function', 'index.path.normalize')\n    assert.equal(typeof index.path.parse, 'function', 'index.path.parse')\n    assert.equal(typeof index.path.posix, 'object', 'index.path.posix')\n    assert.equal(typeof index.path.relative, 'function', 'index.path.relative')\n    assert.equal(typeof index.path.resolve, 'function', 'index.path.resolve')\n    assert.equal(typeof index.path.sep, 'string', 'index.path.sep')\n    assert.equal(typeof index.path.toNamespacedPath, 'function', 'index.path.toNamespacedPath')\n    assert.equal(typeof index.path.win32, 'object', 'index.path.win32')\n    assert.equal(typeof index.ps, 'object', 'index.ps')\n    assert.equal(typeof index.ps.kill, 'function', 'index.ps.kill')\n    assert.equal(typeof index.ps.lookup, 'function', 'index.ps.lookup')\n    assert.equal(typeof index.ps.lookupSync, 'function', 'index.ps.lookupSync')\n    assert.equal(typeof index.ps.tree, 'function', 'index.ps.tree')\n    assert.equal(typeof index.ps.treeSync, 'function', 'index.ps.treeSync')\n    assert.equal(typeof index.question, 'function', 'index.question')\n    assert.equal(typeof index.quiet, 'function', 'index.quiet')\n    assert.equal(typeof index.quote, 'function', 'index.quote')\n    assert.equal(typeof index.quotePowerShell, 'function', 'index.quotePowerShell')\n    assert.equal(typeof index.resolveDefaults, 'function', 'index.resolveDefaults')\n    assert.equal(typeof index.retry, 'function', 'index.retry')\n    assert.equal(typeof index.sleep, 'function', 'index.sleep')\n    assert.equal(typeof index.spinner, 'function', 'index.spinner')\n    assert.equal(typeof index.stdin, 'function', 'index.stdin')\n    assert.equal(typeof index.syncProcessCwd, 'function', 'index.syncProcessCwd')\n    assert.equal(typeof index.tempdir, 'function', 'index.tempdir')\n    assert.equal(typeof index.tempfile, 'function', 'index.tempfile')\n    assert.equal(typeof index.tmpdir, 'function', 'index.tmpdir')\n    assert.equal(typeof index.tmpfile, 'function', 'index.tmpfile')\n    assert.equal(typeof index.updateArgv, 'function', 'index.updateArgv')\n    assert.equal(typeof index.useBash, 'function', 'index.useBash')\n    assert.equal(typeof index.usePowerShell, 'function', 'index.usePowerShell')\n    assert.equal(typeof index.usePwsh, 'function', 'index.usePwsh')\n    assert.equal(typeof index.version, 'string', 'index.version')\n    assert.equal(typeof index.versions, 'object', 'index.versions')\n    assert.equal(typeof index.versions.chalk, 'string', 'index.versions.chalk')\n    assert.equal(typeof index.versions.depseek, 'string', 'index.versions.depseek')\n    assert.equal(typeof index.versions.dotenv, 'string', 'index.versions.dotenv')\n    assert.equal(typeof index.versions.fetch, 'string', 'index.versions.fetch')\n    assert.equal(typeof index.versions.fs, 'string', 'index.versions.fs')\n    assert.equal(typeof index.versions.glob, 'string', 'index.versions.glob')\n    assert.equal(typeof index.versions.minimist, 'string', 'index.versions.minimist')\n    assert.equal(typeof index.versions.ps, 'string', 'index.versions.ps')\n    assert.equal(typeof index.versions.which, 'string', 'index.versions.which')\n    assert.equal(typeof index.versions.yaml, 'string', 'index.versions.yaml')\n    assert.equal(typeof index.versions.zx, 'string', 'index.versions.zx')\n    assert.equal(typeof index.which, 'function', 'index.which')\n    assert.equal(typeof index.which.sync, 'function', 'index.which.sync')\n    assert.equal(typeof index.within, 'function', 'index.within')\n  })\n})\n"
  },
  {
    "path": "test/extra.test.js",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     https://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport assert from 'node:assert'\nimport { test, describe } from 'node:test'\nimport { globby, fs, path } from '../build/index.js'\n\nconst __dirname = path.dirname(new URL(import.meta.url).pathname)\n\ndescribe('extra', () => {\n  test('every file should have a license', async () => {\n    const copyright = await fs.readFile(\n      path.resolve(__dirname, 'fixtures/copyright.txt'),\n      'utf8'\n    )\n    const files = await globby(\n      ['**/*.{js,mjs,ts}', '!**/*polyfill.js', '!build'],\n      {\n        gitignore: true,\n        onlyFiles: true,\n        cwd: process.cwd(),\n        followSymbolicLinks: false,\n      }\n    )\n    for (const file of files) {\n      const content = await fs.readFile(file, 'utf8')\n      assert(\n        content.replace(/\\d{4}/g, 'YEAR').includes(copyright),\n        `No license header in ${file}.`\n      )\n    }\n  })\n})\n"
  },
  {
    "path": "test/fixtures/argv.mjs",
    "content": "#!/usr/bin/env zx\n\n// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     https://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport 'zx/globals'\nimport { argv as importedArgv } from 'zx'\nconsole.log('global', JSON.stringify(argv))\nconsole.log('imported', JSON.stringify(importedArgv))\n"
  },
  {
    "path": "test/fixtures/copyright.txt",
    "content": "// Copyright YEAR Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     https://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n"
  },
  {
    "path": "test/fixtures/echo.http",
    "content": "HTTP/1.1 200 OK\r\nContent-Type: text/javascript; charset=UTF-8\r\nContent-Length: 14\r\n\r\n$`echo 'test'`\r\n"
  },
  {
    "path": "test/fixtures/exit-code.mjs",
    "content": "// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     https://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nprocess.exitCode = 42\n"
  },
  {
    "path": "test/fixtures/filename-dirname.mjs",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     https://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { strict } from 'assert'\n\nstrict.equal(path.basename(__filename), 'filename-dirname.mjs')\nstrict.equal(path.basename(__dirname), 'fixtures')\n"
  },
  {
    "path": "test/fixtures/interactive.mjs",
    "content": "#!/usr/bin/env zx\n\n// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     https://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nconst out = fs.createWriteStream('log.txt') // Record program output to this file.\n\nprocess.stdin.pipe(out) // Record user input as well.\nawait $`npm init`.pipe(out) // Process will be interactive.\n"
  },
  {
    "path": "test/fixtures/js-project/package.json",
    "content": "{\n  \"private\": true,\n  \"type\": \"module\",\n  \"dependencies\": {\n    \"zx\": \"file:../../..\"\n  }\n}\n"
  },
  {
    "path": "test/fixtures/js-project/script.js",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     https://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n$`echo js-script`\n"
  },
  {
    "path": "test/fixtures/markdown-crlf.md",
    "content": "```js\r\necho`Hello, world!`\r\n```"
  },
  {
    "path": "test/fixtures/markdown.md",
    "content": "# Markdown\n\nignore\n\n>\n> ```\n> echo ignore\n> ```\n\n```js\nawait $`whoami`\nawait $`echo ${__dirname}`\n```\n\n~~~js\nawait $`echo \"tilde\"`\n~~~\n\n```js\nconsole.log(chalk.yellowBright(__filename))\n```\n\n```js\nawait import('chalk')\n```\n\n```bash\nVAR=$(echo hello)\necho \"$VAR\"\n```\n\n    // ignore\n    console.log('world')\n\nOther code blocks are ignored:\n\n```css\n.ignore {}\n```\n"
  },
  {
    "path": "test/fixtures/md.http",
    "content": "HTTP/1.1 200 OK\r\nContent-Type: plain/text; charset=UTF-8\r\nContent-Length: 15\r\nServer: netcat!\r\n\r\n# Title\r\n```js\r\n$`echo 'md'`\r\n```\r\n"
  },
  {
    "path": "test/fixtures/no-extension",
    "content": "#!/usr/bin/env zx\n\n// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     https://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nconsole.log(chalk.yellowBright`If file has no extension, zx assumes it's ESM.`)\nawait $`pwd`\nconsole.log('__filename =', __filename)\nconsole.log('__dirname  =', __dirname)\n"
  },
  {
    "path": "test/fixtures/no-extension.mjs",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     https://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n// Test file to verify no-extension didn't overwrite similarly name .mjs file.\n"
  },
  {
    "path": "test/fixtures/non-std-ext.zx",
    "content": "#!/usr/bin/env zx\n\n// Copyright 2024 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     https://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nconsole.log(chalk.yellowBright`If file has non-std ext and 'ext-override' option specified, zx assumes it's ESM.`)\nawait $`pwd`\nconsole.log('__filename =', __filename)\n"
  },
  {
    "path": "test/fixtures/require.mjs",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     https://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { strict as assert } from 'assert'\nconst data = require('../../package.json')\nassert.equal(data.name, 'zx')\nassert.equal(data, require('zx/package.json'))\n"
  },
  {
    "path": "test/fixtures/server.mjs",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     https://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport net from 'node:net'\n\nexport const fakeServer = (data = []) => {\n  const server = net.createServer()\n  server.on('connection', (conn) => {\n    conn.on('data', () => {\n      const d = data.shift() || 'pong'\n      const _d = d.toString('utf-8').split(/\\r?\\n/).join('\\r\\n')\n      conn.write(_d)\n    })\n  })\n  server.stop = () => new Promise((resolve) => server.close(() => resolve()))\n  server.start = async (port) => {\n    const p = port || (await (await import('get-port')).getPort())\n    server.url = `http://127.0.0.1:${p}`\n    return new Promise((resolve) => server.listen(p, () => resolve(server)))\n  }\n\n  return server\n}\n"
  },
  {
    "path": "test/fixtures/ts-project/package.json",
    "content": "{\n  \"private\": true,\n  \"type\": \"module\",\n  \"dependencies\": {\n    \"typescript\": \"^5.0.0\",\n    \"zx\": \"file:../../..\"\n  }\n}\n"
  },
  {
    "path": "test/fixtures/ts-project/script.ts",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     https://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { $, ProcessPromise } from 'zx'\n\nconst p: ProcessPromise = $({ verbose: true })`echo ts-script`\nawait p\n"
  },
  {
    "path": "test/fixtures/ts-project/tsconfig.json",
    "content": "{\n  \"compilerOptions\": {\n    \"outDir\": \"./build\",\n    \"target\": \"es2021\",\n    \"module\": \"nodenext\",\n    \"moduleResolution\": \"nodenext\",\n    \"allowSyntheticDefaultImports\": true,\n    \"strict\": true\n  },\n  \"include\": [\"*.ts\"]\n}\n"
  },
  {
    "path": "test/global.test.js",
    "content": "// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     https://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport assert from 'node:assert'\nimport { test, describe, after } from 'node:test'\nimport '../build/globals.js'\nimport * as index from '../build/index.js'\n\ndescribe('global', () => {\n  after(() => {\n    for (const key of Object.keys(index)) {\n      delete global[key]\n    }\n  })\n\n  test('global cd()', async () => {\n    const cwd = (await $`pwd`).toString().trim()\n    cd('/')\n    assert.equal((await $`pwd`).toString().trim(), path.resolve('/'))\n    cd(cwd)\n    assert.equal((await $`pwd`).toString().trim(), cwd)\n  })\n\n  test('injects zx index to global', () => {\n    for (const [key, value] of Object.entries(index)) {\n      assert.equal(global[key], value)\n    }\n  })\n})\n"
  },
  {
    "path": "test/goods.test.ts",
    "content": "// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     https://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport assert from 'node:assert'\nimport { test, describe, after } from 'node:test'\nimport { Duplex } from 'node:stream'\nimport { $, chalk, fs, path, dotenv } from '../src/index.ts'\nimport {\n  echo,\n  sleep,\n  argv,\n  parseArgv,\n  updateArgv,\n  stdin,\n  spinner,\n  fetch,\n  retry,\n  question,\n  expBackoff,\n  tempfile,\n  tempdir,\n  tmpdir,\n  tmpfile,\n  versions,\n} from '../src/goods.ts'\nimport { Writable } from 'node:stream'\nimport process from 'node:process'\n\nconst __dirname = new URL('.', import.meta.url).pathname\nconst root = path.resolve(__dirname, '..')\n\ndescribe('goods', () => {\n  function zx(script) {\n    return $`node build/cli.js --eval ${script}`.nothrow().timeout('5s')\n  }\n\n  describe('question()', async () => {\n    test('works', async () => {\n      let contents = ''\n      class Input extends Duplex {\n        constructor() {\n          super()\n        }\n        _read() {}\n        _write(chunk, encoding, callback) {\n          this.push(chunk)\n          callback()\n        }\n        _final() {\n          this.push(null)\n        }\n      }\n      const input = new Input() as any\n      const output = new Writable({\n        write: function (chunk, encoding, next) {\n          contents += chunk.toString()\n          next()\n        },\n      }) as NodeJS.WriteStream\n\n      setTimeout(() => {\n        input.write('foo\\n')\n        input.end()\n      }, 10)\n      const result = await question('foo or bar? ', {\n        choices: ['foo', 'bar'],\n        input,\n        output,\n      })\n\n      assert.equal(result, 'foo')\n      assert(contents.includes('foo or bar? '))\n    })\n\n    test('integration', async () => {\n      const p = $`node build/cli.js --eval \"\n  let answer = await question('foo or bar? ', { choices: ['foo', 'bar'] })\n  echo('Answer is', answer)\n\"`\n      p.stdin.write('foo\\n')\n      p.stdin.end()\n      assert.match((await p).stdout, /Answer is foo/)\n    })\n  })\n\n  test('echo() works', async () => {\n    const log = console.log\n    let stdout = ''\n    console.log = (...args) => {\n      stdout += args.join(' ')\n    }\n    echo(chalk.cyan('foo'), chalk.green('bar'), chalk.bold('baz'))\n    echo`${chalk.cyan('foo')} ${chalk.green('bar')} ${chalk.bold('baz')}`\n    echo(\n      await $`echo ${chalk.cyan('foo')}`,\n      await $`echo ${chalk.green('bar')}`,\n      await $`echo ${chalk.bold('baz')}`\n    )\n    console.log = log\n    assert.match(stdout, /foo/)\n  })\n\n  test('sleep() works', async () => {\n    const now = Date.now()\n    await sleep(100)\n    assert.ok(Date.now() >= now + 99)\n  })\n\n  describe('retry()', () => {\n    test('works', async () => {\n      let count = 0\n      const result = await retry(5, () => {\n        count++\n        if (count < 5) throw new Error('fail')\n        return 'success'\n      })\n      assert.equal(result, 'success')\n      assert.equal(count, 5)\n    })\n\n    test('works with custom delay and limit', async () => {\n      const now = Date.now()\n      let count = 0\n      try {\n        await retry(3, '2ms', () => {\n          count++\n          throw new Error('fail')\n        })\n      } catch (e) {\n        assert.match(e.message, /fail/)\n        assert.ok(Date.now() >= now + 4)\n        assert.equal(count, 3)\n      }\n    })\n\n    test('throws undefined on count misconfiguration', async () => {\n      try {\n        await retry(0, () => 'ok')\n      } catch (e) {\n        assert.equal(e, undefined)\n      }\n    })\n\n    test('throws err on empty callback', async () => {\n      try {\n        // @ts-ignore\n        await retry(5)\n      } catch (e) {\n        assert.match(e.message, /Callback is required for retry/)\n      }\n    })\n\n    test('supports expBackoff', async () => {\n      const result = await retry(5, expBackoff('10ms'), () => {\n        if (Math.random() < 0.1) throw new Error('fail')\n        return 'success'\n      })\n\n      assert.equal(result, 'success')\n    })\n\n    test('integration', async () => {\n      const now = Date.now()\n      const p = await zx(`\n    try {\n      await retry(5, '50ms', () => $\\`exit 123\\`)\n    } catch (e) {\n      echo('exitCode:', e.exitCode)\n    }\n    await retry(5, () => $\\`exit 0\\`)\n    echo('success')\n`)\n      assert.ok(p.toString().includes('exitCode: 123'))\n      assert.ok(p.toString().includes('success'))\n      assert.ok(Date.now() >= now + 50 * (5 - 1))\n    })\n\n    test('integration with expBackoff', async () => {\n      const now = Date.now()\n      const p = await zx(`\n    try {\n      await retry(5, expBackoff('60s', 0), () => $\\`exit 123\\`)\n    } catch (e) {\n      echo('exitCode:', e.exitCode)\n    }\n    echo('success')\n`)\n      assert.ok(p.toString().includes('exitCode: 123'))\n      assert.ok(p.toString().includes('success'))\n      assert.ok(Date.now() >= now + 2 + 4 + 8 + 16 + 32)\n    })\n  })\n\n  test('expBackoff()', async () => {\n    const g = expBackoff('10s', '100ms')\n\n    const [a, b, c] = [\n      g.next().value,\n      g.next().value,\n      g.next().value,\n    ] as number[]\n\n    assert.equal(a, 100)\n    assert.equal(b, 200)\n    assert.equal(c, 400)\n  })\n\n  describe('spinner()', () => {\n    test('works', async () => {\n      let contents = ''\n      const { CI } = process.env\n      const output = new Writable({\n        write: function (chunk, encoding, next) {\n          contents += chunk.toString()\n          next()\n        },\n      })\n\n      delete process.env.CI\n      $.log.output = output as NodeJS.WriteStream\n\n      const p = spinner(() => sleep(100))\n\n      delete $.log.output\n      process.env.CI = CI\n\n      await p\n      assert(contents.includes('⠋'))\n    })\n\n    describe('integration', () => {\n      test('works', async () => {\n        const out = await zx(\n          `\n    process.env.CI = ''\n    echo(await spinner(async () => {\n      await sleep(100)\n      await $\\`echo hidden\\`\n      return $\\`echo result\\`\n    }))\n  `\n        )\n        assert(out.stdout.includes('result'))\n        assert(out.stderr.includes('⠋'))\n        assert(!out.stderr.includes('result'))\n        assert(!out.stderr.includes('hidden'))\n      })\n\n      test('with title', async () => {\n        const out = await zx(\n          `\n    process.env.CI = ''\n    await spinner('processing', () => sleep(100))\n  `\n        )\n        assert.match(out.stderr, /processing/)\n      })\n\n      test('disabled in CI', async () => {\n        const out = await zx(\n          `\n    process.env.CI = 'true'\n    await spinner('processing', () => sleep(100))\n  `\n        )\n        assert.doesNotMatch(out.stderr, /processing/)\n      })\n\n      test('stops on throw', async () => {\n        const out = await zx(`\n    await spinner('processing', () => $\\`wtf-cmd\\`)\n  `)\n        assert.match(out.stderr, /Error:/)\n        assert(out.exitCode !== 0)\n      })\n    })\n  })\n\n  describe('args', () => {\n    test('parseArgv() works', () => {\n      assert.deepEqual(\n        parseArgv(\n          // prettier-ignore\n          [\n          '--foo-bar', 'baz',\n          '-a', '5',\n          '-a', '42',\n          '--aaa', 'AAA',\n          '--force',\n          './some.file',\n          '--b1', 'true',\n          '--b2', 'false',\n          '--b3',\n          '--b4', 'false',\n          '--b5', 'true',\n          '--b6', 'str'\n        ],\n          {\n            boolean: ['force', 'b3', 'b4', 'b5', 'b6'],\n            camelCase: true,\n            parseBoolean: true,\n            alias: { a: 'aaa' },\n          },\n          {\n            def: 'def',\n          }\n        ),\n        {\n          a: [5, 42, 'AAA'],\n          aaa: [5, 42, 'AAA'],\n          fooBar: 'baz',\n          force: true,\n          _: ['./some.file', 'str'],\n          b1: true,\n          b2: false,\n          b3: true,\n          b4: false,\n          b5: true,\n          b6: true,\n          def: 'def',\n        }\n      )\n    })\n\n    test('updateArgv() works', () => {\n      updateArgv(['--foo', 'bar'])\n      assert.deepEqual(argv, {\n        _: [],\n        foo: 'bar',\n      })\n    })\n  })\n\n  test('stdin()', async () => {\n    const stream = fs.createReadStream(path.resolve(root, 'package.json'))\n    const input = await stdin(stream)\n    assert.match(input, /\"name\": \"zx\"/)\n  })\n\n  test('fetch()', async () => {\n    const req1 = fetch('https://github.com/')\n    const req2 = fetch('https://github.com/')\n    const req3 = fetch('https://github.com/', { method: 'OPTIONS' })\n\n    const p1 = (await req1.pipe`cat`).stdout\n    const p2 = (await req2.pipe($`cat`)).stdout\n    const p3 = (await req3.pipe`cat`).stdout\n\n    assert.equal((await req1).status, 200)\n    assert.equal((await req2).status, 200)\n    assert.equal((await req3).status, 404)\n    assert(p1.includes('GitHub'))\n    assert(p2.includes('GitHub'))\n    assert(p3.includes('GitHub'))\n  })\n\n  describe('dotenv', () => {\n    test('parse()', () => {\n      assert.deepEqual(dotenv.parse(''), {})\n      assert.deepEqual(\n        dotenv.parse('ENV=v1\\nENV2=v2\\n\\n\\n  ENV3  =    v3   \\nexport ENV4=v4'),\n        {\n          ENV: 'v1',\n          ENV2: 'v2',\n          ENV3: 'v3',\n          ENV4: 'v4',\n        }\n      )\n\n      const multiline = `SIMPLE=xyz123\n# comment ###\nNON_INTERPOLATED='raw text without variable interpolation' \nMULTILINE = \"\"\"\nlong text here, # not-comment\ne.g. a private SSH key\n\"\"\"\nENV=v1\\nENV2=v2\\n\\n\\n\\t\\t  ENV3  =    v3   \\n   export ENV4=v4\nENV5=v5 # comment\n`\n      assert.deepEqual(dotenv.parse(multiline), {\n        SIMPLE: 'xyz123',\n        NON_INTERPOLATED: 'raw text without variable interpolation',\n        MULTILINE: 'long text here, # not-comment\\ne.g. a private SSH key',\n        ENV: 'v1',\n        ENV2: 'v2',\n        ENV3: 'v3',\n        ENV4: 'v4',\n        ENV5: 'v5',\n      })\n    })\n\n    describe('load()', () => {\n      const file1 = tempfile('.env.1', 'ENV1=value1\\nENV2=value2')\n      const file2 = tempfile('.env.2', 'ENV2=value222\\nENV3=value3')\n      after(() => Promise.all([fs.remove(file1), fs.remove(file2)]))\n\n      test('loads env from files', () => {\n        const env = dotenv.load(file1, file2)\n        assert.equal(env.ENV1, 'value1')\n        assert.equal(env.ENV2, 'value2')\n        assert.equal(env.ENV3, 'value3')\n      })\n\n      test('throws error on ENOENT', () => {\n        try {\n          dotenv.load('./.env')\n          throw new Error('unreachable')\n        } catch (e) {\n          assert.equal(e.code, 'ENOENT')\n          assert.equal(e.errno, -2)\n        }\n      })\n    })\n\n    describe('loadSafe()', () => {\n      const file1 = tempfile('.env.1', 'ENV1=value1\\nENV2=value2')\n      const file2 = '.env.notexists'\n\n      after(() => fs.remove(file1))\n\n      test('loads env from files', () => {\n        const env = dotenv.loadSafe(file1, file2)\n        assert.equal(env.ENV1, 'value1')\n        assert.equal(env.ENV2, 'value2')\n      })\n    })\n\n    describe('config()', () => {\n      test('updates process.env', () => {\n        const file1 = tempfile('.env.1', 'ENV1=value1')\n\n        assert.equal(process.env.ENV1, undefined)\n        dotenv.config(file1)\n        assert.equal(process.env.ENV1, 'value1')\n        delete process.env.ENV1\n      })\n    })\n  })\n\n  describe('temp*', () => {\n    test('tempdir() creates temporary folders', () => {\n      assert.equal(tmpdir, tempdir)\n      assert.match(tempdir(), /\\/zx-/)\n      assert.match(tempdir('foo'), /\\/foo$/)\n    })\n\n    test('tempfile() creates temporary files', () => {\n      assert.equal(tmpfile, tempfile)\n      assert.match(tempfile(), /\\/zx-.+/)\n      assert.match(tempfile('foo.txt'), /\\/zx-.+\\/foo\\.txt$/)\n\n      const tf = tempfile('bar.txt', 'bar')\n      assert.match(tf, /\\/zx-.+\\/bar\\.txt$/)\n      assert.equal(fs.readFileSync(tf, 'utf-8'), 'bar')\n    })\n  })\n\n  describe('versions', () => {\n    test('exports deps versions', () => {\n      assert.deepEqual(\n        Object.keys(versions).sort(),\n        [\n          'chalk',\n          'depseek',\n          'dotenv',\n          'fetch',\n          'fs',\n          'glob',\n          'minimist',\n          'ps',\n          'which',\n          'yaml',\n          'zx',\n        ].sort()\n      )\n    })\n  })\n})\n"
  },
  {
    "path": "test/index.test.js",
    "content": "// Copyright 2024 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     https://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport assert from 'node:assert'\nimport { describe, test } from 'node:test'\nimport {\n  bus,\n  nothrow,\n  quiet,\n  versions,\n  version,\n  VERSION,\n  $,\n  log,\n  cd,\n  syncProcessCwd,\n  usePowerShell,\n  usePwsh,\n  useBash,\n  kill,\n  ProcessOutput,\n  ProcessPromise,\n  defaults,\n  dotenv,\n  minimist,\n  chalk,\n  fs,\n  which,\n  YAML,\n  ps,\n  quote,\n  quotePowerShell,\n  within,\n  os,\n  argv,\n  parseArgv,\n  updateArgv,\n  globby,\n  glob,\n  sleep,\n  fetch,\n  echo,\n  question,\n  stdin,\n  retry,\n  expBackoff,\n  spinner,\n  path,\n  tempdir,\n  tempfile,\n  tmpdir,\n  tmpfile,\n} from '../build/index.js'\n\ndescribe('index', () => {\n  test('has proper exports', () => {\n    // index\n    assert(nothrow)\n    assert(quiet)\n    assert(version)\n    assert(versions)\n    assert.equal(version, VERSION)\n\n    // core\n    assert($)\n    assert(ProcessOutput)\n    assert(ProcessPromise)\n    assert(cd)\n    assert(syncProcessCwd)\n    assert(log)\n    assert(kill)\n    assert(defaults)\n    assert(within)\n    assert(usePowerShell)\n    assert(usePwsh)\n    assert(useBash)\n\n    // goods\n    assert(os)\n    assert(argv)\n    assert(parseArgv)\n    assert(updateArgv)\n    assert(globby)\n    assert(glob)\n    assert(sleep)\n    assert(fetch)\n    assert(echo)\n    assert(question)\n    assert(stdin)\n    assert(retry)\n    assert(expBackoff)\n    assert(spinner)\n    assert(path)\n\n    // vendor\n    assert(minimist)\n    assert(chalk)\n    assert(fs)\n    assert(which)\n    assert(YAML)\n    assert(ps)\n    assert(dotenv)\n\n    // utils\n    assert(quote)\n    assert(quotePowerShell)\n    assert(tempdir)\n    assert(tmpdir)\n    assert(tmpfile)\n    assert(tempfile)\n  })\n\n  test('bus is locked', () => {\n    assert.throws(() => bus.wrap('test', () => {}), /locked/)\n  })\n})\n"
  },
  {
    "path": "test/it/build-dcr.test.js",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     https://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { $ } from '../../build/index.js'\nimport { describe, test } from 'node:test'\nimport assert from 'node:assert'\n\ndescribe('docker container', () => {\n  test('works', async () => {\n    const hello = await $({\n      input: 'await $({verbose: true})`echo hello`',\n    })`docker run -i zx`\n    assert.equal(hello.stderr, '$ echo hello\\nhello\\n')\n\n    const node = await $({\n      input: 'console.log((await $`node -v`).valueOf())',\n    })`docker run -i zx`\n    assert.match(node.stdout, /^v24\\./)\n  })\n})\n"
  },
  {
    "path": "test/it/build-jsr.test.js",
    "content": "// Copyright 2024 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     https://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { tempdir, $, path, fs } from '../../build/index.js'\nimport { describe, before, after, it } from 'node:test'\n\nconst __dirname = path.dirname(new URL(import.meta.url).pathname)\nconst root = path.resolve(__dirname, '../../')\n\ndescribe('jsr artifact', () => {\n  let tmp\n  let t$\n\n  before(async () => {\n    tmp = tempdir()\n    t$ = $({ cwd: tmp, quiet: true })\n\n    // copy all for jsr publish\n    await Promise.all(\n      [\n        'src/',\n        'tsconfig.json',\n        'LICENSE',\n        'README.md',\n        'scripts/build-jsr.mjs',\n        'package.json',\n      ].map((filepath) =>\n        fs.copy(\n          path.resolve(path.join(root, filepath)),\n          path.resolve(path.join(tmp, filepath))\n        )\n      )\n    )\n    await t$`ln -s ${path.resolve(root, 'node_modules')} ${path.resolve(tmp, 'node_modules')}`\n  })\n  after(() => fs.remove(tmp))\n\n  it('publish --dry-run`', async () => {\n    await t$`node scripts/build-jsr.mjs`\n    await t$({ quiet: false })`jsr publish --dry-run`\n  })\n})\n"
  },
  {
    "path": "test/it/build-npm.test.js",
    "content": "// Copyright 2024 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     https://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport assert from 'node:assert'\nimport { describe, test } from 'node:test'\nimport {\n  $,\n  within,\n  path,\n  glob,\n  tempdir,\n  fs,\n  version,\n} from '../../build/index.js'\n\nconst __dirname = new URL('.', import.meta.url).pathname\nconst root = path.resolve(__dirname, '../..')\nconst sync = async (from, to, entries) => {\n  for (const entry of entries)\n    await fs.copy(path.resolve(from, entry), path.join(to, entry))\n}\n\ndescribe('npm artifact', () => {\n  describe('contents', () => {\n    test('zx full', async () =>\n      within(async () => {\n        const tmp = tempdir()\n        $.cwd = tmp\n        $.quiet = true\n\n        // link\n        await $`ln -s ${path.resolve(root, 'node_modules')} ${path.resolve(tmp, 'node_modules')}`\n        await sync(root, tmp, [\n          'scripts',\n          'build',\n          'man',\n          'package.json',\n          'package-main.json',\n          'README.md',\n          'LICENSE',\n        ])\n\n        // pack / unpack\n        await $`mv package-main.json package.json`\n        const pack = await $`npm pack`\n        await $`tar xf ${pack}`\n        await $`rm ${pack}`.nothrow()\n\n        // run\n        const { stderr } =\n          await $`node -e 'import {$} from \"./package/build/core.js\"; $.verbose = true; await $\\`echo hello\\`'`\n        assert.match(stderr, /hello/)\n\n        // contents\n        const pkgJson = await fs.readJson(\n          path.resolve(tmp, 'package/package.json')\n        )\n        const files = await glob('**/*', {\n          cwd: path.resolve(tmp, 'package'),\n          absolute: false,\n          onlyFiles: true,\n        })\n\n        assert.equal(pkgJson.name, 'zx')\n        assert.equal(pkgJson.description, 'A tool for writing better scripts')\n        assert.equal(pkgJson.devDependencies, undefined)\n        assert.equal(pkgJson.prettier, undefined)\n        assert.equal(pkgJson.scripts, undefined)\n        assert.equal(pkgJson.volta, undefined)\n\n        assert.deepEqual(\n          files.sort(),\n          [\n            'LICENSE',\n            'README.md',\n            'package.json',\n            'man/zx.1',\n            'build/cli.cjs',\n            'build/cli.d.ts',\n            'build/cli.js',\n            'build/core.cjs',\n            'build/core.d.ts',\n            'build/core.js',\n            'build/deno.js',\n            'build/deps.cjs',\n            'build/deps.d.ts',\n            'build/error.d.ts',\n            'build/esblib.cjs',\n            'build/globals.cjs',\n            'build/globals.d.ts',\n            'build/globals.js',\n            'build/goods.d.ts',\n            'build/index.cjs',\n            'build/index.d.ts',\n            'build/index.js',\n            'build/internals.cjs',\n            'build/internals.d.ts',\n            'build/log.d.ts',\n            'build/md.d.ts',\n            'build/util.cjs',\n            'build/util.d.ts',\n            'build/versions.d.ts',\n            'build/vendor-core.cjs',\n            'build/vendor-core.d.ts',\n            'build/vendor-extra.cjs',\n            'build/vendor-extra.d.ts',\n            'build/vendor.cjs',\n            'build/vendor.d.ts',\n            'build/3rd-party-licenses',\n          ].sort()\n        )\n      }))\n\n    test('zx@lite', async () =>\n      within(async () => {\n        const tmp = tempdir()\n        $.cwd = tmp\n        $.quiet = true\n\n        // link\n        await $`ln -s ${path.resolve(root, 'node_modules')} ${path.resolve(tmp, 'node_modules')}`\n        await sync(root, tmp, [\n          'build',\n          'package.json',\n          'package-lite.json',\n          'README.md',\n          'LICENSE',\n          'scripts',\n        ])\n\n        // pack / unpack\n        await $`mv package-lite.json package.json`\n        const pack = await $`npm pack`\n        await $`tar xf ${pack}`\n        await $`rm ${pack}`.nothrow()\n\n        // run\n        const { stderr } =\n          await $`node -e 'import {$} from \"./package/build/core.js\"; $.verbose = true; await $\\`echo hello\\`'`\n        assert.match(stderr, /hello/)\n\n        // contents\n        const pkgJson = await fs.readJson(\n          path.resolve(tmp, 'package/package.json')\n        )\n        const files = await glob('**/*', {\n          cwd: path.resolve(tmp, 'package'),\n          absolute: false,\n          onlyFiles: true,\n        })\n\n        assert.equal(pkgJson.name, 'zx')\n        assert.equal(pkgJson.devDependencies, undefined)\n        assert.equal(pkgJson.bin, undefined)\n        assert.deepEqual(\n          files.sort(),\n          [\n            'LICENSE',\n            'README.md',\n            'build/3rd-party-licenses',\n            'build/core.cjs',\n            'build/core.d.ts',\n            'build/core.js',\n            'build/deno.js',\n            'build/error.d.ts',\n            'build/esblib.cjs',\n            'build/internals.cjs',\n            'build/internals.d.ts',\n            'build/log.d.ts',\n            'build/util.cjs',\n            'build/util.d.ts',\n            'build/vendor-core.cjs',\n            'build/vendor-core.d.ts',\n            'package.json',\n          ].sort()\n        )\n      }))\n  })\n\n  describe('compatibility', () => {\n    test('js', async () => {\n      const out = await within(async () => {\n        $.cwd = path.resolve(root, 'test/fixtures/js-project')\n        await $`npm i --no-package-lock`\n        return $`node node_modules/zx/build/cli.js --verbose script.js`\n      })\n      assert.match(out.stderr, /js-script/)\n    })\n\n    test('tsc', async () => {\n      const out = await within(async () => {\n        $.cwd = path.resolve(root, 'test/fixtures/ts-project')\n        await $`npm i --no-package-lock`\n        try {\n          await $`npx tsc`\n        } catch (err) {\n          throw new Error(err.stdout)\n        }\n        return $`node build/script.js`\n      })\n      assert.match(out.stderr, /ts-script/)\n    })\n\n    test('tsc (isolated)', async () => {\n      const tmp = tempdir()\n      const t$ = $({ cwd: tmp, quiet: true })\n      const zxdir = path.resolve(tmp, 'node_modules/zx')\n      const pkgJson = {\n        name: 'zx-test',\n        dependencies: {\n          typescript: '^5',\n          '@types/node': '*',\n          '@types/fs-extra': '*',\n        },\n      }\n\n      await fs.outputJSON(path.resolve(tmp, 'package.json'), pkgJson)\n      await t$`npm i`\n      await sync(root, zxdir, ['package.json', 'build']) // `file:<path>` dep mounts `node_modules` too, so we use cloning here\n\n      const tsconfig = {\n        compilerOptions: {\n          module: 'commonjs',\n          target: 'esnext',\n          outDir: 'bundle',\n          rootDir: 'src',\n          declaration: true,\n          declarationMap: false,\n          esModuleInterop: true,\n        },\n        include: ['src'],\n      }\n      const indexTs = `import {$} from 'zx'\n(async () => {\n  await $({verbose: true})\\`echo hello\\`\n})()\n`\n      await fs.outputJSON(path.resolve(tmp, 'tsconfig.json'), tsconfig)\n      await fs.outputFile(path.resolve(tmp, 'src/index.ts'), indexTs)\n\n      await t$`tsc`\n      const out = await t$`node bundle/index.js`.text()\n      assert.strictEqual(out, '$ echo hello\\nhello\\n')\n    })\n\n    test('esbuild (iife)', async () => {\n      const tmp = tempdir()\n      const t$ = $({ cwd: tmp, quiet: true })\n      const zxdir = path.resolve(tmp, 'node_modules/zx')\n      const pkgJson = {\n        name: 'zx-test',\n        dependencies: {\n          esbuild: '^0.25.8',\n        },\n      }\n\n      await sync(root, zxdir, ['package.json', 'build'])\n      await fs.outputJSON(path.resolve(tmp, 'package.json'), pkgJson)\n\n      const verJs = `import {version, $} from 'zx'\n(async () => {\n  await $({verbose: true})\\`echo \\${version}\\`\n})()\n`\n      await fs.outputFile(path.resolve(tmp, 'src/ver.js'), verJs)\n      await fs.mkdir(path.resolve(tmp, 'bundle'))\n\n      await t$`npx esbuild src/ver.js --bundle --format=iife --platform=node > bundle/ver.js`\n      const out = await t$`node bundle/ver.js`.text()\n      assert.strictEqual(out, `$ echo ${version}\\n${version}\\n`)\n    })\n  })\n})\n"
  },
  {
    "path": "test/log.test.ts",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     https://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport assert from 'node:assert'\nimport { test, describe, beforeEach, before, after } from 'node:test'\nimport { formatCmd, log } from '../src/log.ts'\n\ndescribe('log', () => {\n  describe('log()', () => {\n    const data = []\n    const stream = {\n      write(s: string) {\n        data.push(s)\n      },\n    } as NodeJS.WriteStream\n\n    before(() => (log.output = stream))\n\n    after(() => {\n      delete log.output\n      delete log.formatters\n    })\n\n    beforeEach(() => (data.length = 0))\n\n    test('empty log', () => {\n      log({\n        kind: 'cmd',\n        cmd: 'echo hi',\n        cwd: process.cwd(),\n        id: '1',\n        verbose: false,\n      })\n      assert.equal(data.join(''), '')\n    })\n\n    test('cmd', () => {\n      log({\n        kind: 'cmd',\n        cmd: 'echo hi',\n        cwd: process.cwd(),\n        id: '1',\n        verbose: true,\n      })\n      assert.equal(data.join(''), '$ \\x1B[92mecho\\x1B[39m hi\\n')\n    })\n\n    test('stdout', () => {\n      log({\n        kind: 'stdout',\n        data: Buffer.from('foo'),\n        id: '1',\n        verbose: true,\n      })\n      assert.equal(data.join(''), 'foo')\n    })\n\n    test('cd', () => {\n      log({\n        kind: 'cd',\n        dir: '/tmp',\n        verbose: true,\n      })\n      assert.equal(data.join(''), '$ \\x1B[92mcd\\x1B[39m /tmp\\n')\n    })\n\n    test('fetch', () => {\n      log({\n        kind: 'fetch',\n        url: 'https://github.com',\n        init: { method: 'GET' },\n        verbose: true,\n      })\n      assert.equal(\n        data.join(''),\n        \"$ \\x1B[92mfetch\\x1B[39m https://github.com { method: 'GET' }\\n\"\n      )\n    })\n\n    test('custom', () => {\n      log({\n        kind: 'custom',\n        data: 'test',\n        verbose: true,\n      })\n      assert.equal(data.join(''), 'test')\n    })\n\n    test('retry', () => {\n      log({\n        kind: 'retry',\n        attempt: 1,\n        total: 3,\n        delay: 1000,\n        exception: new Error('foo'),\n        error: 'bar',\n        verbose: true,\n      })\n      assert.equal(\n        data.join(''),\n        '\\x1B[41m\\x1B[37m FAIL \\x1B[39m\\x1B[49m Attempt: 1/3; next in 1000ms\\n'\n      )\n    })\n\n    test('end', () => {\n      log({\n        kind: 'end',\n        id: '1',\n        exitCode: null,\n        signal: null,\n        duration: 0,\n        error: null,\n        verbose: true,\n      })\n      assert.equal(data.join(''), '')\n    })\n\n    test('kill', () => {\n      log({\n        kind: 'kill',\n        signal: null,\n        pid: 1234,\n      })\n      assert.equal(data.join(''), '')\n    })\n\n    test('formatters', () => {\n      log.formatters = {\n        cmd: ({ cmd }) => `CMD: ${cmd}`,\n      }\n\n      log({\n        kind: 'cmd',\n        cmd: 'echo hi',\n        cwd: process.cwd(),\n        id: '1',\n        verbose: true,\n      })\n      assert.equal(data.join(''), 'CMD: echo hi')\n    })\n  })\n\n  test('formatCwd()', () => {\n    const cases = [\n      [\n        `echo $'hi'`,\n        \"$ \\x1B[92mecho\\x1B[39m \\x1B[93m$\\x1B[39m\\x1B[93m'hi'\\x1B[39m\\n\",\n      ],\n      [`echo$foo`, '$ \\x1B[92mecho\\x1B[39m\\x1B[93m$\\x1B[39mfoo\\n'],\n      [\n        `test --foo=bar p1 p2`,\n        '$ \\x1B[92mtest\\x1B[39m --foo\\x1B[31m=\\x1B[39mbar p1 p2\\n',\n      ],\n      [\n        `cmd1 --foo || cmd2`,\n        '$ \\x1B[92mcmd1\\x1B[39m --foo \\x1B[31m|\\x1B[39m\\x1B[31m|\\x1B[39m\\x1B[92m cmd2\\x1B[39m\\n',\n      ],\n      [\n        `A=B C='D' cmd`,\n        \"$ A\\x1B[31m=\\x1B[39mB C\\x1B[31m=\\x1B[39m\\x1B[93m'D'\\x1B[39m\\x1B[92m cmd\\x1B[39m\\n\",\n      ],\n      [\n        `foo-extra --baz = b-a-z --bar = 'b-a-r' -q -u x`,\n        \"$ \\x1B[92mfoo-extra\\x1B[39m --baz \\x1B[31m=\\x1B[39m b-a-z --bar \\x1B[31m=\\x1B[39m \\x1B[93m'b-a-r'\\x1B[39m -q -u x\\n\",\n      ],\n      [\n        `while true; do \"$\" done`,\n        '$ \\x1B[96mwhile\\x1B[39m true\\x1B[31m;\\x1B[39m\\x1B[96m do\\x1B[39m \\x1B[93m\"$\"\\x1B[39m\\x1B[96m done\\x1B[39m\\n',\n      ],\n      [\n        `echo '\\n str\\n'`,\n        \"$ \\x1B[92mecho\\x1B[39m \\x1B[93m'\\x1B[39m\\x1B[0m\\x1B[0m\\n\\x1B[0m> \\x1B[0m\\x1B[93m str\\x1B[39m\\x1B[0m\\x1B[0m\\n\\x1B[0m> \\x1B[0m\\x1B[93m'\\x1B[39m\\n\",\n      ],\n      [`$'\\\\''`, \"$ \\x1B[93m$\\x1B[39m\\x1B[93m'\\\\'\\x1B[39m\\x1B[93m'\\x1B[39m\\n\"],\n      [\n        'sass-compiler --style=compressed src/static/bootstrap.scss > dist/static/bootstrap-v5.3.3.min.css',\n        '$ \\x1B[92msass-compiler\\x1B[39m --style\\x1B[31m=\\x1B[39mcompressed src/static/bootstrap.scss \\x1B[31m>\\x1B[39m\\x1B[92m dist/static/bootstrap-v5.3.3.min.css\\x1B[39m\\n',\n      ],\n      [\n        'echo 1+2 | bc',\n        '$ \\x1B[92mecho\\x1B[39m 1\\x1B[31m+\\x1B[39m2 \\x1B[31m|\\x1B[39m\\x1B[92m bc\\x1B[39m\\n',\n      ],\n      [\n        'echo test &>> filepath',\n        '$ \\x1B[92mecho\\x1B[39m test \\x1B[31m&\\x1B[39m\\x1B[31m>\\x1B[39m\\x1B[31m>\\x1B[39m\\x1B[92m filepath\\x1B[39m\\n',\n      ],\n      [\n        'bc < filepath',\n        '$ \\x1B[92mbc\\x1B[39m \\x1B[31m<\\x1B[39m\\x1B[92m filepath\\x1B[39m\\n',\n      ],\n      [\n        `cat << 'EOF' | tee -a filepath\nline 1\nline 2\nEOF`,\n        \"$ \\x1B[92mcat\\x1B[39m \\x1B[31m<\\x1B[39m\\x1B[31m<\\x1B[39m \\x1B[93m'EOF'\\x1B[39m \\x1B[31m|\\x1B[39m\\x1B[92m tee\\x1B[39m -a filepath\\x1B[0m\\x1B[0m\\n\\x1B[0m> \\x1B[0mline 1\\x1B[0m\\x1B[0m\\n\\x1B[0m> \\x1B[0mline 2\\x1B[96m\\x1B[39m\\x1B[0m\\x1B[0m\\n\\x1B[0m> \\x1B[0m\\x1B[96mEOF\\x1B[39m\\n\",\n      ],\n    ]\n\n    cases.forEach(([input, expected]) => {\n      assert.equal(formatCmd(input), expected, input)\n    })\n  })\n})\n"
  },
  {
    "path": "test/md.test.ts",
    "content": "// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     https://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { describe, test } from 'node:test'\nimport assert from 'node:assert'\nimport { transformMarkdown } from '../src/md.ts'\n\ndescribe('transformMarkdown()', () => {\n  describe('root handling', () => {\n    test('comments out plain lines (including empty line)', () => {\n      assert.equal(transformMarkdown('\\n'), '// \\n// ')\n    })\n\n    test('preserves tab-indented blocks after a blank line (legacy behavior)', () => {\n      assert.equal(transformMarkdown('  \\n    '), '  \\n    ')\n    })\n\n    test('does not treat a mid-paragraph fence as a fenced block (legacy behavior)', () => {\n      assert.equal(\n        transformMarkdown(`\n\\t~~~js\nconsole.log('js')`),\n        `// \\n\\t~~~js\\n// console.log('js')`\n      )\n    })\n  })\n\n  describe('fenced code blocks', () => {\n    test('converts js/ts to raw code, bash to await $`...` and comments unknown fences', () => {\n      // prettier-ignore\n      assert.equal(transformMarkdown(`\n# Title\n    \n~~~js\nawait $\\`echo \"js\"\\`\n~~~\n\ntypescript code block\n~~~~~ts\nawait $\\`echo \"ts\"\\`\n~~~~~\n\n~~~\nunknown code block\n~~~\n\n~~~sh\necho foo\n~~~\n\n`), `// \n// # Title\n//     \n\nawait $\\`echo \"js\"\\`\n\n// \n// typescript code block\n\nawait $\\`echo \"ts\"\\`\n\n// \n\n// unknown code block\n\n// \nawait $\\`\necho foo\n\\`\n// \n// `)\n    })\n\n    test('accepts fences indented up to 3 spaces (CommonMark) and converts them', () => {\n      const input = `# h1\n\nparagraph\n\n## h2\n\n### h3\n\n\\`\\`\\`bash\necho \"1\"\n\\`\\`\\`\n\n### h3\n\n- item 1\n\n   \\`\\`\\`bash\n   echo \"2\"\n   \\`\\`\\`\n\n### h3\n\n\\`\\`\\`bash\necho \"4\"\n\\`\\`\\`\n`\n      const result = transformMarkdown(input)\n\n      assert.ok(!/```|~~~/.test(result), 'no raw markdown fences should remain')\n      assert.equal((result.match(/await \\$`/g) ?? []).length, 3)\n      assert.equal((result.match(/^`$/gm) ?? []).length, 3)\n    })\n  })\n\n  test('handles all ECMAScript line terminators', () => {\n    const input = 'a\\r\\nb\\nc\\rd\\u2028e\\u2029f'\n    const expected = '// a\\n// b\\n// c\\n// d\\n// e\\n// f'\n    assert.equal(transformMarkdown(input), expected)\n  })\n})\n"
  },
  {
    "path": "test/smoke/bun.test.js",
    "content": "// Copyright 2024 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     https://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport assert from 'node:assert'\nimport { test, describe } from 'bun:test'\nimport { $, within, tmpdir } from '../../build/index.js'\nimport '../../build/cli.js'\n\ndescribe('bun', () => {\n  test('smoke test', async () => {\n    const p = await $`echo foo`\n    assert.match(p.stdout, /foo/)\n  })\n\n  test('captures err stack', async () => {\n    const p = await $({ nothrow: true })`echo foo; exit 3`\n    assert.match(p.message, /exit code: 3/)\n  })\n\n  test('stdio: inherit', async () => {\n    await $({ stdio: 'inherit' })`ls`\n  })\n\n  test('ctx isolation', async () => {\n    await within(async () => {\n      const t1 = tmpdir()\n      const t3 = tmpdir()\n      $.cwd = t1\n      assert.equal($.cwd, t1)\n      assert.equal($.cwd, t1)\n\n      const w = within(async () => {\n        const t3 = tmpdir()\n        $.cwd = t3\n        assert.equal($.cwd, t3)\n\n        assert.ok((await $`pwd`).toString().trim().endsWith(t3))\n        assert.equal($.cwd, t3)\n      })\n\n      await $`pwd`\n      assert.ok((await $`pwd`).toString().trim().endsWith(t1))\n      assert.equal($.cwd, t1)\n      assert.ok((await $`pwd`).toString().trim().endsWith(t1))\n\n      $.cwd = t3\n      assert.ok((await $`pwd`).toString().trim().endsWith(t3))\n      assert.equal($.cwd, t3)\n\n      await w\n    })\n  })\n})\n"
  },
  {
    "path": "test/smoke/deno.test.js",
    "content": "// Copyright 2024 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     https://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { assert } from 'https://deno.land/std@0.224.0/assert/assert.ts'\nimport { $ } from '../../build/index.js'\nimport '../../build/cli.js'\n\nDeno.test('deno smoke test', async () => {\n  // smoke test\n  {\n    const p = await $`echo foo`\n    assert(p.valueOf() === 'foo')\n  }\n\n  // captures err stack\n  {\n    const p = await $({ nothrow: true })`echo foo; exit 3`\n    assert(p.message.match(/exit code: 3/))\n  }\n})\n"
  },
  {
    "path": "test/smoke/node.test.cjs",
    "content": "// Copyright 2024 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     https://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nconst assert = require('assert')\nrequire('zx/globals')\n;(async () => {\n  // smoke test\n  {\n    const p = await $`echo foo`\n    assert.match(p.stdout, /foo/)\n  }\n\n  // captures err stack\n  {\n    const p = await $({ nothrow: true })`echo foo; exit 3`\n    assert.match(p.message, /exit code: 3/)\n  }\n\n  console.log('smoke cjs: ok')\n})()\n"
  },
  {
    "path": "test/smoke/node.test.mjs",
    "content": "// Copyright 2024 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     https://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport assert from 'assert'\nimport 'zx/globals'\n;(async () => {\n  // smoke test\n  {\n    const p = await $`echo foo`\n    assert.match(p.stdout, /foo/)\n    assert.deepEqual(p.lines(), ['foo'])\n  }\n\n  // captures err stack\n  {\n    const p = await $({ nothrow: true })`echo foo; exit 3`\n    assert.match(p.message, /exit code: 3/)\n  }\n\n  // ctx isolation\n  {\n    await within(async () => {\n      const t1 = tmpdir()\n      const t3 = tmpdir()\n      $.cwd = t1\n      assert.equal($.cwd, t1)\n      assert.equal($.cwd, t1)\n\n      const w = within(async () => {\n        const t3 = tmpdir()\n        $.cwd = t3\n        assert.equal($.cwd, t3)\n\n        assert.ok((await $`pwd`).toString().trim().endsWith(t3))\n        assert.equal($.cwd, t3)\n      })\n\n      await $`pwd`\n      assert.ok((await $`pwd`).toString().trim().endsWith(t1))\n      assert.equal($.cwd, t1)\n      assert.ok((await $`pwd`).toString().trim().endsWith(t1))\n\n      $.cwd = t3\n      assert.ok((await $`pwd`).toString().trim().endsWith(t3))\n      assert.equal($.cwd, t3)\n\n      await w\n    })\n  }\n\n  // ps works fine\n  {\n    const [root] = await ps.lookup({ pid: process.pid })\n    assert.equal(root.pid, process.pid)\n  }\n\n  // abort controller\n  {\n    const ac = new AbortController()\n    const { signal } = ac\n    const p = $({\n      signal,\n      timeout: '5s',\n      nothrow: true,\n      killSignal: 'SIGKILL',\n    })`sleep 10`\n\n    setTimeout(async () => {\n      assert.throws(\n        () => p.abort('SIGINT'),\n        /signal is controlled by another process/\n      )\n      setTimeout(() => {\n        ac.abort('stop')\n      }, 500)\n    }, 500)\n\n    const o = await p\n    assert.equal(o.signal, 'SIGTERM')\n    assert.throws(() => p.kill(), /Too late to kill the process/)\n  }\n\n  // fetch()\n  {\n    const server = (await import('../fixtures/server.mjs')).fakeServer([\n      `HTTP/1.1 200 OK\nContent-Type: application/json\nContent-Length: 13\nServer: netcat!\n\n{\"foo\":\"bar\"}\n`,\n    ])\n\n    const { url } = await server.start(8081)\n    const res = await fetch(url)\n    const json = await res.json()\n    assert.equal(res.status, 200)\n    assert.equal(json.foo, 'bar')\n\n    await server.stop()\n  }\n\n  console.log('smoke mjs: ok')\n})()\n"
  },
  {
    "path": "test/smoke/ts.test.ts",
    "content": "// Copyright 2024 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     https://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport * as assert from 'node:assert'\nimport 'zx/globals'\n;(async () => {\n  // smoke test async\n  {\n    const p = await $`echo foo`\n    assert.match(p.stdout, /foo/)\n  }\n\n  // smoke test sync\n  {\n    const p = $.sync`echo foo`\n    assert.match(p.stdout, /foo/)\n  }\n\n  // captures err stack\n  {\n    const p = await $({ nothrow: true })`echo foo; exit 3`\n    assert.match(p.message, /exit code: 3/)\n  }\n})()\n\nconsole.log('smoke ts: ok')\n"
  },
  {
    "path": "test/smoke/tsconfig.json",
    "content": "{\n  \"compilerOptions\": {\n    \"target\": \"ES2021\",\n    \"lib\": [\"ES2021\"],\n    \"moduleResolution\": \"NodeNext\",\n    \"module\": \"NodeNext\",\n    \"strict\": true,\n    \"outDir\": \"./build\",\n    \"declaration\": true,\n    \"emitDeclarationOnly\": true,\n    \"types\": []\n  },\n  \"include\": [\"./src/**/*\"],\n  \"exclude\": [\"./src/globals.ts\"]\n}\n"
  },
  {
    "path": "test/smoke/tsconfig.test.json",
    "content": "{\n  \"extends\": \"./tsconfig.json\",\n  \"compilerOptions\": {\n    \"module\": \"node16\",\n    \"esModuleInterop\": true,\n    \"rootDir\": \".\",\n    \"emitDeclarationOnly\": false,\n    \"outDir\": \"./temp\"\n  },\n  \"include\": [\"./ts.test.ts\"],\n  \"exclude\": []\n}\n"
  },
  {
    "path": "test/smoke/win32.test.js",
    "content": "// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     https://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport assert from 'node:assert'\nimport { test, describe } from 'node:test'\nimport process from 'node:process'\nimport '../../build/globals.js'\n\nconst _describe = process.platform === 'win32' ? describe : describe.skip\n\nconst _testPwsh = which.sync('pwsh', { nothrow: true }) ? test : test.skip\n\n_describe('win32', () => {\n  test('should work with windows-specific commands', async () => {\n    const p = await $`echo $0` // Bash is first by default.\n    assert.match(p.stdout, /bash/)\n\n    await within(async () => {\n      usePowerShell()\n      assert.match($.shell, /powershell/i)\n      const p = await $`get-host`\n      assert.match(p.stdout, /PowerShell/)\n    })\n  })\n\n  test('quotePowerShell works', async () => {\n    await within(async () => {\n      usePowerShell()\n      const p = await $`echo ${`Windows 'rulez!'`}`\n      assert.match(p.stdout, /Windows 'rulez!'/)\n    })\n  })\n\n  _testPwsh('should work with pwsh when it is available', async () => {\n    await within(async () => {\n      usePwsh()\n      assert.match($.shell, /pwsh/i)\n      const p = await $`echo 'Hello,' && echo ${`new 'PowerShell'!`}`\n      assert.match(p.stdout, /Hello,\\s+new 'PowerShell'!/)\n    })\n  })\n\n  test('should create a dir via mkdir', async () => {\n    const temp = tmpdir()\n    const _$ = $({ verbose: true, cwd: temp })\n\n    console.log('shell:', $.shell)\n    await _$`which bash`\n    await _$`bash --version`\n\n    await _$`mkdir -p ${path.join(temp, 'AA-zx-test')}`\n    await _$`mkdir -p BB-zx-test`\n    const { stdout } = await _$`ls -l | grep zx-test`\n\n    assert.match(stdout, /AA-zx-test/)\n    assert.match(stdout, /BB-zx-test/)\n  })\n\n  test('ps detects self process', async () => {\n    const [root] = await ps.lookup({ pid: process.pid })\n    assert.equal(root.pid, process.pid)\n  })\n\n  test('kill works', async () => {\n    const p = $({ nothrow: true })`sleep 100`\n    const { pid } = p\n    const found = await ps.lookup({ pid })\n    console.log('found:', found)\n    assert.equal(found.length, 1)\n    assert.equal(found[0].pid, pid)\n\n    await p.kill()\n    const killed = await ps.lookup({ pid })\n    console.log('killed:', killed)\n    assert.equal(killed.length, 0)\n  })\n\n  test('abort controller works', async () => {\n    const ac = new AbortController()\n    const { signal } = ac\n    const p = $({\n      signal,\n      timeout: '5s',\n      nothrow: true,\n      killSignal: 'SIGKILL',\n    })`sleep 10`\n\n    setTimeout(async () => {\n      assert.throws(\n        () => p.abort('SIGINT'),\n        /signal is controlled by another process/\n      )\n      setTimeout(() => {\n        ac.abort('stop')\n      }, 500)\n    }, 500)\n\n    const o = await p\n    assert.equal(o.signal, 'SIGTERM')\n    assert.throws(() => p.abort(), /Too late to abort the process/)\n    assert.throws(() => p.kill(), /Too late to kill the process/)\n  })\n})\n"
  },
  {
    "path": "test/util.test.js",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     https://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport assert from 'node:assert'\nimport { test, describe } from 'node:test'\nimport {\n  isString,\n  isStringLiteral,\n  identity,\n  once,\n  noop,\n  parseDuration,\n  parseBool,\n  quote,\n  quotePowerShell,\n  randomId,\n  // normalizeMultilinePieces,\n  preferLocalBin,\n  toCamelCase,\n  getLast,\n} from '../build/util.cjs'\n\ndescribe('util', () => {\n  test('randomId()', () => {\n    assert.ok(/^[a-z0-9]+$/.test(randomId()))\n    assert.ok(\n      new Set(Array.from({ length: 1000 }).map(() => randomId())).size === 1000\n    )\n  })\n\n  test('noop()', () => {\n    assert.ok(noop() === undefined)\n  })\n\n  test('once()', () => {\n    const fn = once(identity)\n    assert.equal(identity(1), 1)\n    assert.equal(identity(2), 2)\n    assert.equal(fn(1), 1)\n    assert.equal(fn(2), 1)\n  })\n\n  test('isString()', () => {\n    assert.ok(isString('string'))\n    assert.ok(!isString(1))\n  })\n\n  test('isStringLiteral()', () => {\n    const bar = 'baz'\n    assert.ok(isStringLiteral``)\n    assert.ok(isStringLiteral`foo`)\n    assert.ok(isStringLiteral`foo ${bar}`)\n\n    assert.ok(!isStringLiteral(''))\n    assert.ok(!isStringLiteral('foo'))\n    assert.ok(!isStringLiteral(['foo']))\n  })\n\n  test('quote()', () => {\n    assert.ok(quote('string') === 'string')\n    assert.ok(quote('') === `$''`)\n    assert.ok(quote(`'\\f\\n\\r\\t\\v\\0`) === `$'\\\\'\\\\f\\\\n\\\\r\\\\t\\\\v\\\\0'`)\n\n    const allowed =\n      'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_/.-+@:=,%'\n    assert.equal(quote(allowed), allowed)\n  })\n\n  test('quotePowerShell()', () => {\n    assert.equal(quotePowerShell('string'), 'string')\n    assert.equal(quotePowerShell(`'`), `''''`)\n    assert.equal(quotePowerShell(''), `''`)\n\n    const allowed =\n      'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_/.-+@:=,%'\n    assert.equal(quote(allowed), allowed)\n  })\n\n  test('duration parsing works', () => {\n    assert.equal(parseDuration(0), 0)\n    assert.equal(parseDuration(1000), 1000)\n    assert.equal(parseDuration('100'), 100)\n    assert.equal(parseDuration('2s'), 2000)\n    assert.equal(parseDuration('500ms'), 500)\n    assert.equal(parseDuration('2m'), 120000)\n    assert.throws(() => parseDuration('f2ms'))\n    assert.throws(() => parseDuration('2mss'))\n    assert.throws(() => parseDuration(NaN))\n    assert.throws(() => parseDuration(-1))\n  })\n\n  // test('normalizeMultilinePieces()', () => {\n  //   assert.equal(\n  //     normalizeMultilinePieces([' a ', 'b    c    d', ' e']).join(','),\n  //     ' a ,b c d, e'\n  //   )\n  // })\n\n  test('preferLocalBin()', () => {\n    const env = {\n      PATH: '/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/sbin',\n    }\n    const _env = preferLocalBin(env, process.cwd())\n    assert.equal(\n      _env.PATH,\n      `${process.cwd()}/node_modules/.bin:${process.cwd()}:${env.PATH}`\n    )\n  })\n\n  test('toCamelCase()', () => {\n    assert.equal(toCamelCase('VERBOSE'), 'verbose')\n    assert.equal(toCamelCase('PREFER_LOCAL'), 'preferLocal')\n    assert.equal(toCamelCase('SOME_MORE_BIG_STR'), 'someMoreBigStr')\n    assert.equal(toCamelCase('kebab-input-str'), 'kebabInputStr')\n  })\n\n  test('parseBool()', () => {\n    assert.equal(parseBool('true'), true)\n    assert.equal(parseBool('false'), false)\n    assert.equal(parseBool('other'), 'other')\n  })\n\n  test('getLast()', () => {\n    assert.equal(getLast([1, 2, 3]), 3)\n    assert.equal(getLast([]), undefined)\n  })\n})\n"
  },
  {
    "path": "test/vendor.test.js",
    "content": "// Copyright 2024 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     https://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport assert from 'node:assert'\nimport { test, describe } from 'node:test'\nimport {\n  YAML,\n  MAML,\n  minimist,\n  which,\n  glob,\n  nodeFetch as fetch,\n} from '../build/vendor.cjs'\n\ndescribe('vendor API', () => {\n  describe('YAML', () => {\n    test('parse()', () => {\n      assert.deepEqual(YAML.parse('a: b\\n'), { a: 'b' })\n    })\n    test('stringify()', () => {\n      assert.equal(YAML.stringify({ a: 'b' }), 'a: b\\n')\n    })\n  })\n\n  describe('MAML', () => {\n    test('parse()/stringify()', () => {\n      const maml = `{\n  project: \"MAML\"\n  tags: [\n    \"minimal\"\n    \"readable\"\n  ]\n  spec: {\n    version: 1\n    author: \"Anton Medvedev\"\n  }\n  notes: \"\"\"\nThis is a multiline string.\nKeeps formatting as‑is.\n\"\"\"\n}`\n      const obj = MAML.parse(maml)\n\n      assert.deepEqual(MAML.parse(MAML.stringify(obj)), obj)\n      assert.deepEqual(obj, {\n        project: 'MAML',\n        tags: ['minimal', 'readable'],\n        spec: {\n          version: 1,\n          author: 'Anton Medvedev',\n        },\n        notes: 'This is a multiline string.\\nKeeps formatting as‑is.\\n',\n      })\n    })\n  })\n\n  test('globby() works', async () => {\n    assert.deepEqual(await glob('*.md'), ['README.md'])\n    assert.deepEqual(glob.sync('*.md'), ['README.md'])\n  })\n\n  test('fetch() works', async () => {\n    assert.match(\n      await fetch('https://github.com').then((res) => res.text()),\n      /GitHub/\n    )\n  })\n\n  test('which() available', async () => {\n    assert.equal(which.sync('npm'), await which('npm'))\n    assert.throws(() => which.sync('not-found-cmd'), /not-found-cmd/)\n  })\n\n  test('minimist available', async () => {\n    assert.equal(typeof minimist, 'function')\n  })\n\n  test('minimist works', async () => {\n    assert.deepEqual(\n      minimist(\n        ['--foo', 'bar', '-a', '5', '-a', '42', '--force', './some.file'],\n        { boolean: 'force' }\n      ),\n      {\n        a: [5, 42],\n        foo: 'bar',\n        force: true,\n        _: ['./some.file'],\n      }\n    )\n  })\n})\n"
  },
  {
    "path": "test-d/core.test-d.ts",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     https://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport assert from 'node:assert'\nimport { Readable, Writable } from 'node:stream'\nimport { expectError, expectType } from 'tsd'\nimport { $, ProcessPromise, ProcessOutput, within } from 'zx'\n\nlet p = $`cmd`\nassert(p instanceof ProcessPromise)\nexpectType<ProcessPromise>(p)\nexpectType<Writable>(p.stdin)\nexpectType<Readable>(p.stdout)\nexpectType<Readable>(p.stderr)\nexpectType<ProcessPromise>(p.nothrow())\nexpectType<ProcessPromise>(p.quiet())\nexpectType<ProcessPromise>(p.pipe($`cmd`))\nexpectType<ProcessPromise>(p.pipe`cmd`)\nexpectType<\n  Writable & PromiseLike<ProcessOutput & Writable> & { run: () => void }\n>(p.pipe('file'))\nexpectType<\n  typeof process.stdout &\n    PromiseLike<ProcessOutput & typeof process.stdout> & { run: () => void }\n>(p.pipe(process.stdout))\nexpectType<ProcessPromise>(p.stdio('pipe'))\nexpectType<ProcessPromise>(p.timeout('1s'))\nexpectType<Promise<void>>(p.kill())\nexpectType<Promise<ProcessOutput>>(p.then((p) => p))\nexpectType<Promise<ProcessOutput>>(p.catch((p) => p))\nexpectType<Promise<any>>(p.then((p) => p).catch((p) => p))\n\nlet o = await p\nassert(o instanceof ProcessOutput)\nexpectType<ProcessOutput>(o)\nexpectType<string>(o.stdout)\nexpectType<string>(o.stderr)\nexpectType<number | null>(o.exitCode)\nexpectType<NodeJS.Signals | null>(o.signal)\n// prettier-ignore\nexpectType<ProcessOutput>(new ProcessOutput({\n  code: null,\n  signal: null,\n  duration: 0,\n  store: { stdout: [], stderr: [], stdall: [] },\n  error: null,\n  from: ''\n}))\n\nexpectType<ProcessOutput>(new ProcessOutput(null, null, '', '', '', '', 1))\nexpectType<ProcessOutput>(new ProcessOutput(null, null, '', '', '', ''))\nexpectError(new ProcessOutput('1'))\n\nexpectType<'banana'>(within(() => 'apple' as 'banana'))\n\nexpectType<ProcessPromise>($`cmd`)\nexpectType<ProcessPromise>($({ sync: false })`cmd`)\nexpectType<ProcessOutput>($({ sync: true })`cmd`)\nexpectType<ProcessOutput>($.sync`cmd`)\n"
  },
  {
    "path": "test-d/globals.test-d.ts",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     https://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport assert from 'node:assert'\nimport { expectType } from 'tsd'\nimport 'zx/globals'\nimport { ParsedArgs } from 'minimist'\n\nlet p = $`cmd`\nassert(p instanceof ProcessPromise)\nexpectType<ProcessPromise>(p)\n\nlet o = await p\nassert(o instanceof ProcessOutput)\nexpectType<ProcessOutput>(o)\n\nexpectType<string>(quote('foo'))\nexpectType<string>(quotePowerShell('foo'))\n\nexpectType<ParsedArgs>(minimist(['--foo', 'bar']))\n"
  },
  {
    "path": "test-d/goods.test-d.ts",
    "content": "// Copyright 2022 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     https://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { expectType } from 'tsd'\nimport { $, echo, sleep, spinner, retry, expBackoff } from 'zx'\n\necho`Date is ${await $`date`}`\necho('Hello, world!')\n\nawait sleep('1s')\nawait sleep(1000)\n\nexpectType<'foo'>(await spinner(() => 'foo' as 'foo'))\nexpectType<'bar'>(await spinner('title', () => 'bar' as 'bar'))\nexpectType<'foo'>(await retry(0, () => 'foo' as 'foo'))\nexpectType<Generator<number, void, unknown>>(expBackoff())\n"
  },
  {
    "path": "tsconfig.json",
    "content": "{\n  \"compilerOptions\": {\n    \"target\": \"ES2021\",\n    \"lib\": [\"ES2021\"],\n    \"rootDir\": \"./src\",\n    \"moduleResolution\": \"NodeNext\",\n    \"module\": \"NodeNext\",\n    \"strict\": true,\n    \"outDir\": \"./build\",\n    \"declaration\": true,\n    \"emitDeclarationOnly\": true,\n    \"allowImportingTsExtensions\": true,\n    \"resolveJsonModule\": true,\n    \"types\": [\"node\", \"fs-extra\"]\n  },\n  \"include\": [\"./src/**/*\"],\n  \"exclude\": [\"./src/globals.ts\"]\n}\n"
  },
  {
    "path": "zizmor.yml",
    "content": "rules:\n  unpinned-uses:\n    config:\n      policies:\n        '*': hash-pin\n        'actions/*': ref-pin\n        'github/codeql-action/*': ref-pin\n"
  }
]